
  :root {
    --bg: #0a0d0f;
    --surface: #111518;
    --surface2: #181d21;
    --border: #1e2529;
    --accent: #00e5a0;
    --accent2: #00b87a;
    --accent-glow: rgba(0, 229, 160, 0.15);
    --accent-glow2: rgba(0, 229, 160, 0.06);
    --red: #ff4444;
    --red-glow: rgba(255, 68, 68, 0.2);
    --text: #e8edf0;
    --text-muted: #5a6872;
    --text-sub: #8fa0ad;
    --radius: 16px;
    --radius-sm: 10px;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'Syne', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
  }

  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
  }

 
  header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    background: rgba(10, 13, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
  }

  .logo {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .logo-icon {
    width: 38px;
    height: 38px;
    background: var(--accent-glow);
    border: 1px solid var(--accent2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .logo-icon svg { color: var(--accent); }

  .logo-text h1 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text);
  }

  .logo-text p {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    font-family: 'DM Mono', monospace;
    margin-top: 1px;
  }

  #endBtn {
    display: none;
    padding: 10px 22px;
    border-radius: 8px;
    border: 1px solid var(--accent2);
    background: transparent;
    color: var(--accent);
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: all 0.2s;
  }

  #endBtn:hover {
    background: var(--accent-glow);
  }

  .screen { display: none; min-height: calc(100vh - 65px); position: relative; }
  .screen.active { display: flex; }

  #idleScreen {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
  }

  .waveform-idle {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 32px;
    opacity: 0.3;
  }

  .waveform-idle span {
    display: block;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    height: 4px;
  }

  .mic-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  #startBtn {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
  }

  #startBtn::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px dashed var(--border);
    animation: spin 20s linear infinite;
  }

  @keyframes spin { to { transform: rotate(360deg); } }

  #startBtn:hover {
    background: var(--accent-glow2);
    border-color: var(--accent2);
    transform: scale(1.06);
    box-shadow: 0 0 40px var(--accent-glow);
  }

  #startBtn svg { color: var(--text-sub); transition: color 0.2s; }
  #startBtn:hover svg { color: var(--accent); }

  .idle-hint {
    text-align: center;
  }

  .idle-hint h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
  }

  .idle-hint p {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
  }

  /* ── RECORDING SCREEN ── */
  #recordingScreen {
    flex-direction: column;
    padding: 0;
  }

  .rec-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 32px 28px;
    gap: 20px;
    position: relative;
  }

  
  .waveform-live {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 36px;
  }

  .waveform-live span {
    display: block;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
  }

  .waveform-live span:nth-child(1)  { animation-delay: 0s;    height: 8px; }
  .waveform-live span:nth-child(2)  { animation-delay: 0.1s;  height: 18px; }
  .waveform-live span:nth-child(3)  { animation-delay: 0.2s;  height: 28px; }
  .waveform-live span:nth-child(4)  { animation-delay: 0.3s;  height: 22px; }
  .waveform-live span:nth-child(5)  { animation-delay: 0.4s;  height: 32px; }
  .waveform-live span:nth-child(6)  { animation-delay: 0.5s;  height: 18px; }
  .waveform-live span:nth-child(7)  { animation-delay: 0.6s;  height: 26px; }
  .waveform-live span:nth-child(8)  { animation-delay: 0.7s;  height: 12px; }
  .waveform-live span:nth-child(9)  { animation-delay: 0.8s;  height: 22px; }
  .waveform-live span:nth-child(10) { animation-delay: 0.9s;  height: 30px; }
  .waveform-live span:nth-child(11) { animation-delay: 1.0s;  height: 16px; }
  .waveform-live span:nth-child(12) { animation-delay: 1.1s;  height: 24px; }
  .waveform-live span:nth-child(13) { animation-delay: 0.35s; height: 10px; }
  .waveform-live span:nth-child(14) { animation-delay: 0.65s; height: 20px; }
  .waveform-live span:nth-child(15) { animation-delay: 0.15s; height: 28px; }
  .waveform-live span:nth-child(16) { animation-delay: 0.85s; height: 14px; }
  .waveform-live span:nth-child(17) { animation-delay: 0.45s; height: 22px; }
  .waveform-live span:nth-child(18) { animation-delay: 0.25s; height: 32px; }
  .waveform-live span:nth-child(19) { animation-delay: 0.75s; height: 18px; }
  .waveform-live span:nth-child(20) { animation-delay: 0.55s; height: 26px; }
  .waveform-live span:nth-child(21) { animation-delay: 0.05s; height: 8px; }
  .waveform-live span:nth-child(22) { animation-delay: 0.95s; height: 20px; }
  .waveform-live span:nth-child(23) { animation-delay: 0.15s; height: 14px; }

  @keyframes wave {
    0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
    50%       { transform: scaleY(1);   opacity: 1; }
  }

  .mic-center {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .btn-undo {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
  }
  .btn-undo:hover { border-color: var(--text-sub); color: var(--text); }

  #stopBtn {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--red);
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 0 0 var(--red-glow);
    animation: pulse-red 2s infinite;
    transition: transform 0.2s;
  }

  #stopBtn:hover { transform: scale(1.05); }

  @keyframes pulse-red {
    0%   { box-shadow: 0 0 0 0 var(--red-glow); }
    70%  { box-shadow: 0 0 0 16px rgba(255,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,68,68,0); }
  }

  .rec-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--text-sub);
  }

  .rec-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--red);
    animation: blink 1.2s step-end infinite;
  }

  @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

  /* panels */
  .panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 0 24px 24px;
    flex: 1;
  }

  .panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
  }

  .panel-title svg { opacity: 0.8; }

  .badge-live {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid var(--accent2);
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
  }

  .panel-body {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-sub);
    min-height: 160px;
    flex: 1;
  }

  .panel-body.placeholder {
    color: var(--text-muted);
    font-style: italic;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    font-size: 12px;
  }

  .bullet-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .bullet-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-sub);
  }

  .bullet-list li::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin-top: 7px;
  }

  /* ── NOTES SCREEN ── */
  #notesScreen {
    flex-direction: column;
    padding: 40px 32px;
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    gap: 28px;
    animation: fadeUp 0.5s ease forwards;
  }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .notes-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
  }

  .notes-title-block h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
  }

  .notes-title-block p {
    font-size: 12px;
    font-family: 'DM Mono', monospace;
    color: var(--text-muted);
    margin-top: 5px;
  }

  .notes-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
  }

  .btn-copy {
    display: flex; align-items: center; gap: 7px;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-sub);
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
  }

  .btn-copy:hover { border-color: var(--text-sub); color: var(--text); }

  .btn-download {
    display: flex; align-items: center; gap: 7px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: #000;
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
  }

  .btn-download:hover { background: #00ffb3; transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }

  .duration-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
  }

  .notes-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .notes-card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
  }

  .notes-card-body {
    padding: 22px;
    font-family: 'DM Mono', monospace;
    font-size: 13.5px;
    line-height: 1.85;
    color: var(--text-sub);
  }

  .notes-card-body ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 11px;
  }

  .notes-card-body ul li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }

  .notes-card-body ul li::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin-top: 8px;
  }

  .btn-new {
    display: flex; align-items: center; gap: 8px; justify-content: center;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    width: 100%;
  }

  .btn-new:hover { border-color: var(--accent2); color: var(--accent); background: var(--accent-glow2); }

 
  ::-webkit-scrollbar { width: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }