/* ---------- Breadcrumb ---------- */
.crumbs {
    padding-top: 48px;
    font-family: var(--mono);
    font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--gray-500); display: flex; gap: 10px; align-items: center;
  }
  .crumbs a { color: var(--gray-500); transition: color .2s var(--ease); }
  .crumbs a:hover { color: var(--purple); }
  .crumbs .sep { opacity: 0.5; }
  .crumbs .current { color: var(--purple); }

  /* ---------- Hero card ---------- */
  .hero-card {
    margin-top: 24px; position: relative;
    background: linear-gradient(135deg, #2a0f66 0%, #4a22a8 50%, #6934c4 100%);
    color: #fff; border-radius: 28px;
    padding: 56px 72px; overflow: hidden;
    box-shadow: 0 40px 80px -40px rgba(63, 25, 147, 0.4);
  }
  .hero-card::before {
    content: ""; position: absolute; inset: 0;
    background:
      radial-gradient(ellipse 500px 300px at 85% 30%, color-mix(in srgb, var(--lilac) 30%, transparent), transparent 60%),
      radial-gradient(ellipse 400px 250px at 15% 90%, color-mix(in srgb, var(--blush) 15%, transparent), transparent 55%);
    pointer-events: none;
  }
  .hero-card::after {
    content: ""; position: absolute; inset: 0;
    background-image:
      linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 30% 50%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at 30% 50%, black 30%, transparent 80%);
    pointer-events: none;
  }
  .hero-card-inner { position: relative; z-index: 1; max-width: 820px; }
  .hero-pill {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 8px 16px; border-radius: 999px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    font-family: var(--mono); font-size: 11px; font-weight: 500;
    letter-spacing: 0.12em; text-transform: uppercase; color: #fff;
    margin-bottom: 24px;
  }
  .hero-pill .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--lilac); box-shadow: 0 0 12px var(--lilac);
  }
  .hero-card h1 {
    font-family: var(--display); font-weight: 800;
    font-size: clamp(40px, 5.2vw, 64px); line-height: 0.98;
    letter-spacing: -0.015em; margin: 0 0 20px; color: #fff; max-width: 22ch;
  }
  .hero-card p {
    margin: 0; font-size: 16px; color: rgba(255,255,255,0.78);
    line-height: 1.55; max-width: 58ch;
  }

  /* ---------- Widget section ---------- */
  .widget-section { padding: 72px 0 48px; position: relative; }
  .widget-intro { text-align: center; margin-bottom: 32px; }
  .widget-intro .eyebrow {
    font-family: var(--mono); font-size: 12px;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--purple); margin-bottom: 14px;
  }
  .widget-intro h2 {
    font-family: var(--display); font-weight: 800;
    font-size: clamp(36px, 4.5vw, 60px); line-height: 0.95;
    letter-spacing: -0.015em; margin: 0 auto 16px;
    max-width: 22ch; color: var(--charcoal);
  }
  .widget-intro p {
    font-size: 16px; color: var(--gray-700);
    max-width: 58ch; margin: 0 auto;
  }

  /* ---------- Mode toggle (outside card) ---------- */
  .mode-toggle-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
  }
  .mode-toggle {
    display: inline-flex;
    background: var(--paper);
    border: 1px solid var(--gray-100);
    padding: 6px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(20,10,50,0.06);
    position: relative;
    gap: 2px;
  }
  .mode-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    transition: all .4s var(--ease);
    position: relative;
    z-index: 1;
    white-space: nowrap;
  }
  .mode-toggle-btn.active {
    background: var(--purple);
    color: #fff;
    box-shadow: 0 2px 8px rgba(63,25,147,0.25);
  }
  .mode-toggle-btn svg { color: currentColor; }

  /* ---------- Widget card ---------- */
  .widget {
    background: var(--paper);
    border: 1px solid color-mix(in srgb, var(--charcoal) 7%, transparent);
    border-radius: var(--radius-lg);
    overflow: hidden; position: relative;
    box-shadow: 0 40px 80px -30px rgba(20, 10, 50, 0.18), 0 2px 8px -2px rgba(20, 10, 50, 0.06);
    max-width: 900px; margin: 0 auto;
    min-height: 520px;
  }

  .widget-header {
    padding: 28px 32px 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
  }
  .widget-icon-box {
    width: 42px; height: 42px;
    background: var(--purple);
    color: #fff;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  .widget-title {
    font-family: var(--sans);
    font-weight: 700;
    font-size: 19px;
    color: var(--charcoal);
    margin: 0 0 2px;
    letter-spacing: -0.005em;
  }
  .widget-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0;
  }

  /* ---------- Panels (mode content) ---------- */
  .panel {
    padding: 8px 32px 32px;
    display: none;
  }
  .widget[data-mode="tts"] .panel[data-panel="tts"] { display: block; }
  .widget[data-mode="stt-upload"] .panel[data-panel="stt"] { display: block; }
  .widget[data-mode="stt-record"] .panel[data-panel="stt"] { display: block; }

  /* ---------- TTS panel ---------- */
  .field-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray-500);
    font-weight: 600;
    margin-bottom: 10px;
  }

  .dialect-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
  }
  .dialect-row .field-label { margin-bottom: 0; }
  .dialect-chip {
    padding: 8px 18px;
    background: var(--paper);
    border: 1.5px solid var(--purple);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--purple);
    transition: all .3s var(--ease);
  }

  .text-area-wrap {
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    position: relative;
  }
  .text-area {
    font-family: var(--arabic);
    font-size: 17px;
    line-height: 1.9;
    color: var(--charcoal);
    direction: rtl;
    text-align: right;
    min-height: 120px;
    white-space: pre-wrap;
    position: relative;
  }
  .text-area.placeholder::before {
    content: attr(data-placeholder);
    color: var(--gray-400);
    font-weight: 400;
  }
  .text-area .caret {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--purple);
    vertical-align: middle;
    margin-right: 1px;
    opacity: 0;
    animation: blink 1s step-end infinite;
  }
  .widget.state-tts-typing .text-area .caret,
  .widget.state-tts-ready .text-area .caret { opacity: 1; }
  @keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
  }
  .char-counter {
    position: absolute;
    bottom: 10px;
    right: 16px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--gray-400);
    left: auto;
  }

  /* Voice note card (appears after generation) */
  .voice-note {
    background: var(--purple-soft);
    border: 1px solid color-mix(in srgb, var(--purple) 20%, transparent);
    border-radius: 14px;
    padding: 16px 18px;
    display: none;
    align-items: center;
    gap: 14px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .4s var(--ease), transform .4s var(--ease);
    margin-bottom: 20px;
  }
  .widget.state-tts-generating .voice-note,
  .widget.state-tts-playing .voice-note,
  .widget.state-tts-done .voice-note {
    display: flex;
    opacity: 1;
    transform: none;
  }

  .play-btn {
    width: 44px; height: 44px;
    background: var(--purple);
    color: #fff;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: transform .2s var(--ease);
    position: relative;
  }
  .play-btn:hover { transform: scale(1.05); }
  .widget.state-tts-generating .play-btn {
    background: var(--gray-300);
  }
  .widget.state-tts-generating .play-btn::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 2px solid transparent;
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .widget.state-tts-generating .play-btn svg { display: none; }

  /* Waveform */
  .waveform {
    flex: 1;
    height: 42px;
    display: flex;
    align-items: center;
    gap: 3px;
    overflow: hidden;
  }
  .waveform span {
    flex: 1;
    min-width: 2px;
    background: color-mix(in srgb, var(--purple) 35%, transparent);
    border-radius: 2px;
    height: 8px;
    transition: height .25s var(--ease), background .25s var(--ease);
  }
  .widget.state-tts-playing .waveform span {
    background: var(--purple);
  }
  .widget.state-tts-playing .waveform span {
    animation: waveBounce 0.9s ease-in-out infinite;
  }
  @keyframes waveBounce {
    0%, 100% { height: 8px; }
    50%      { height: 32px; }
  }
  /* Stagger each bar */
  .waveform span:nth-child(1)  { animation-delay: 0.00s; }
  .waveform span:nth-child(2)  { animation-delay: 0.05s; }
  .waveform span:nth-child(3)  { animation-delay: 0.10s; }
  .waveform span:nth-child(4)  { animation-delay: 0.15s; }
  .waveform span:nth-child(5)  { animation-delay: 0.20s; }
  .waveform span:nth-child(6)  { animation-delay: 0.25s; }
  .waveform span:nth-child(7)  { animation-delay: 0.30s; }
  .waveform span:nth-child(8)  { animation-delay: 0.35s; }
  .waveform span:nth-child(9)  { animation-delay: 0.40s; }
  .waveform span:nth-child(10) { animation-delay: 0.45s; }
  .waveform span:nth-child(11) { animation-delay: 0.50s; }
  .waveform span:nth-child(12) { animation-delay: 0.35s; }
  .waveform span:nth-child(13) { animation-delay: 0.30s; }
  .waveform span:nth-child(14) { animation-delay: 0.25s; }
  .waveform span:nth-child(15) { animation-delay: 0.20s; }
  .waveform span:nth-child(16) { animation-delay: 0.15s; }
  .waveform span:nth-child(17) { animation-delay: 0.10s; }
  .waveform span:nth-child(18) { animation-delay: 0.05s; }
  .waveform span:nth-child(19) { animation-delay: 0.00s; }
  .waveform span:nth-child(20) { animation-delay: 0.08s; }
  .waveform span:nth-child(21) { animation-delay: 0.16s; }
  .waveform span:nth-child(22) { animation-delay: 0.24s; }
  .waveform span:nth-child(23) { animation-delay: 0.32s; }
  .waveform span:nth-child(24) { animation-delay: 0.40s; }
  .waveform span:nth-child(25) { animation-delay: 0.48s; }
  .waveform span:nth-child(26) { animation-delay: 0.20s; }
  .waveform span:nth-child(27) { animation-delay: 0.14s; }
  .waveform span:nth-child(28) { animation-delay: 0.08s; }
  .waveform span:nth-child(29) { animation-delay: 0.02s; }
  .waveform span:nth-child(30) { animation-delay: 0.04s; }

  .voice-time {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--purple);
    font-weight: 500;
    flex-shrink: 0;
  }

  .generate-btn {
    width: 100%;
    padding: 16px;
    background: var(--gray-100);
    color: var(--gray-500);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all .3s var(--ease);
  }
  .widget.state-tts-ready .generate-btn,
  .widget.state-tts-generating .generate-btn {
    background: var(--purple);
    color: #fff;
  }
  .widget.state-tts-ready .generate-btn { animation: btnPulse 0.6s var(--ease); }
  @keyframes btnPulse {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(0.97); box-shadow: 0 0 0 8px color-mix(in srgb, var(--purple) 15%, transparent); }
  }
  .widget.state-tts-done .generate-btn {
    background: #dcfce7;
    color: #166534;
  }

  /* ---------- STT panel ---------- */
  .language-row {
    background: var(--purple-soft);
    border-radius: 12px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
  }
  .language-row .field-label { margin-bottom: 0; color: var(--gray-700); }
  .lang-select {
    background: var(--paper);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--charcoal);
  }

  /* Sub-tabs */
  .sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
  }
  .sub-tab {
    padding: 9px 18px;
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all .3s var(--ease);
  }
  .widget[data-mode="stt-upload"] .sub-tab[data-tab="upload"],
  .widget[data-mode="stt-record"] .sub-tab[data-tab="record"] {
    background: var(--paper);
    color: var(--charcoal);
    border-color: var(--charcoal);
    box-shadow: 0 2px 6px rgba(20,10,50,0.06);
  }

  /* Upload dropzone */
  .upload-zone {
    border: 1.5px dashed var(--gray-300);
    border-radius: 14px;
    padding: 40px 32px;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: all .3s var(--ease);
  }
  .widget[data-mode="stt-record"] .upload-zone { display: none; }
  .widget.state-upload-dragging .upload-zone {
    border-color: var(--purple);
    border-style: solid;
    background: var(--purple-soft);
  }
  .widget.state-upload-processing .upload-zone,
  .widget.state-upload-done .upload-zone { display: none; }

  .upload-icon {
    width: 48px; height: 48px;
    background: var(--purple-soft);
    color: var(--purple);
    border-radius: 12px;
    display: grid;
    place-items: center;
    transition: transform .3s var(--ease);
  }
  .widget.state-upload-dragging .upload-icon {
    background: #fff;
    transform: scale(1.1);
  }
  .upload-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--charcoal);
  }
  .upload-sub {
    font-size: 13px;
    color: var(--gray-500);
  }
  .format-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
  }
  .format-chips span {
    padding: 4px 10px;
    background: var(--purple-soft);
    color: var(--purple);
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 999px;
    letter-spacing: 0.04em;
  }

  /* Floating MP3 file */
  .floating-audio {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg) scale(0.8);
    width: 150px;
    opacity: 0;
    z-index: 5;
    pointer-events: none;
  }
  .widget.state-upload-dragging .floating-audio {
    animation: audioPlunge 1.8s var(--ease) forwards;
  }
  @keyframes audioPlunge {
    0%   { transform: translate(-50%, -120%) rotate(-12deg) scale(0.7); opacity: 0; }
    15%  { opacity: 1; }
    60%  { transform: translate(-50%, 30%) rotate(-2deg) scale(1); }
    85%  { transform: translate(-50%, 70%) rotate(0deg) scale(0.9); opacity: 1; }
    100% { transform: translate(-50%, 120%) rotate(0deg) scale(0.4); opacity: 0; }
  }
  .audio-card-visual {
    background: var(--paper);
    border-radius: 10px;
    box-shadow: 0 24px 48px -12px rgba(20, 10, 50, 0.3), 0 0 0 1px var(--gray-200);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
  }
  .audio-card-icon {
    width: 36px; height: 36px;
    background: var(--purple);
    color: #fff;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  .audio-card-meta {
    flex: 1;
    min-width: 0;
  }
  .audio-card-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .audio-card-sub {
    font-size: 9.5px;
    color: var(--gray-500);
    font-family: var(--mono);
  }

  /* Uploaded file card (stays visible during processing/done) */
  .audio-card {
    background: var(--paper);
    border: 1px solid var(--gray-100);
    border-radius: 14px;
    padding: 18px;
    display: none;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
  }
  .widget.state-upload-processing .audio-card,
  .widget.state-upload-done .audio-card,
  .widget.state-record-processing .audio-card.record-card,
  .widget.state-record-done .audio-card.record-card {
    display: flex;
  }
  .audio-card.upload-card {
    display: none;
  }
  .widget.state-upload-processing .audio-card.upload-card,
  .widget.state-upload-done .audio-card.upload-card {
    display: flex;
  }
  .audio-card-large-icon {
    width: 44px; height: 44px;
    background: var(--purple);
    color: #fff;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  .audio-card-info { flex: 1; min-width: 0; }
  .audio-card-info .name {
    font-size: 14px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 4px;
  }
  .audio-card-info .meta {
    font-size: 12px;
    color: var(--gray-500);
    font-family: var(--mono);
  }
  .audio-card-status {
    padding: 6px 12px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .widget.state-upload-processing .upload-card .audio-card-status,
  .widget.state-record-processing .record-card .audio-card-status {
    background: var(--purple-soft);
    color: var(--purple);
  }
  .widget.state-upload-done .upload-card .audio-card-status,
  .widget.state-record-done .record-card .audio-card-status {
    background: #dcfce7;
    color: #166534;
  }
  .audio-card-status .spinner {
    width: 10px; height: 10px;
    border: 1.5px solid color-mix(in srgb, var(--purple) 25%, transparent);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  .widget.state-upload-done .upload-card .audio-card-status .spinner,
  .widget.state-record-done .record-card .audio-card-status .spinner {
    border: 0;
    background: #22c55e;
    animation: none;
    position: relative;
  }
  .widget.state-upload-done .upload-card .audio-card-status .spinner::after,
  .widget.state-record-done .record-card .audio-card-status .spinner::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -55%) rotate(-45deg);
    width: 4px; height: 2px;
    border-left: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
  }

  /* Record zone */
  .record-zone {
    background: linear-gradient(to bottom, var(--paper), var(--purple-soft));
    border: 1px solid var(--gray-100);
    border-radius: 14px;
    padding: 48px 32px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
  }
  .widget[data-mode="stt-upload"] .record-zone { display: none; }
  .widget.state-record-processing .record-zone,
  .widget.state-record-done .record-zone { display: none; }

  .record-btn {
    width: 72px; height: 72px;
    background: var(--purple);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    position: relative;
    box-shadow: 0 10px 24px -6px rgba(63, 25, 147, 0.4);
    transition: transform .2s var(--ease);
  }
  .record-btn:hover { transform: scale(1.05); }
  .widget.state-record-recording .record-btn {
    background: #dc2626;
    animation: recordPulse 1.2s ease-in-out infinite;
  }
  @keyframes recordPulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, #dc2626 40%, transparent); }
    50% { box-shadow: 0 0 0 18px color-mix(in srgb, #dc2626 0%, transparent); }
  }
  .widget.state-record-recording .record-btn svg.mic { display: none; }
  .record-btn svg.stop { display: none; }
  .widget.state-record-recording .record-btn svg.stop { display: block; }

  .record-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--charcoal);
    text-align: center;
  }
  .record-sub {
    font-size: 13px;
    color: var(--gray-500);
    text-align: center;
    max-width: 36ch;
  }

  /* Live recording waveform */
  .live-wave {
    display: none;
    align-items: center;
    gap: 3px;
    height: 40px;
    width: 280px;
    justify-content: center;
  }
  .widget.state-record-recording .live-wave { display: flex; }
  .live-wave span {
    width: 3px;
    background: var(--purple);
    border-radius: 2px;
    animation: liveWave 0.6s ease-in-out infinite;
    height: 8px;
  }
  @keyframes liveWave {
    0%, 100% { height: 6px; opacity: 0.5; }
    50% { height: 30px; opacity: 1; }
  }
  .live-wave span:nth-child(1)  { animation-delay: 0.00s; }
  .live-wave span:nth-child(2)  { animation-delay: 0.05s; }
  .live-wave span:nth-child(3)  { animation-delay: 0.10s; }
  .live-wave span:nth-child(4)  { animation-delay: 0.15s; }
  .live-wave span:nth-child(5)  { animation-delay: 0.20s; }
  .live-wave span:nth-child(6)  { animation-delay: 0.25s; }
  .live-wave span:nth-child(7)  { animation-delay: 0.30s; }
  .live-wave span:nth-child(8)  { animation-delay: 0.35s; }
  .live-wave span:nth-child(9)  { animation-delay: 0.40s; }
  .live-wave span:nth-child(10) { animation-delay: 0.45s; }
  .live-wave span:nth-child(11) { animation-delay: 0.40s; }
  .live-wave span:nth-child(12) { animation-delay: 0.35s; }
  .live-wave span:nth-child(13) { animation-delay: 0.30s; }
  .live-wave span:nth-child(14) { animation-delay: 0.25s; }
  .live-wave span:nth-child(15) { animation-delay: 0.20s; }
  .live-wave span:nth-child(16) { animation-delay: 0.15s; }
  .live-wave span:nth-child(17) { animation-delay: 0.10s; }
  .live-wave span:nth-child(18) { animation-delay: 0.05s; }
  .live-wave span:nth-child(19) { animation-delay: 0.02s; }
  .live-wave span:nth-child(20) { animation-delay: 0.08s; }
  .live-wave span:nth-child(21) { animation-delay: 0.14s; }
  .live-wave span:nth-child(22) { animation-delay: 0.20s; }
  .live-wave span:nth-child(23) { animation-delay: 0.26s; }
  .live-wave span:nth-child(24) { animation-delay: 0.32s; }
  .live-wave span:nth-child(25) { animation-delay: 0.38s; }
  .live-wave span:nth-child(26) { animation-delay: 0.30s; }
  .live-wave span:nth-child(27) { animation-delay: 0.22s; }
  .live-wave span:nth-child(28) { animation-delay: 0.14s; }
  .live-wave span:nth-child(29) { animation-delay: 0.06s; }
  .live-wave span:nth-child(30) { animation-delay: 0.00s; }

  .live-timer {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 500;
  }
  .widget.state-record-recording .live-timer { color: #dc2626; }

  /* Transcript output */
  .transcript {
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: 14px;
    padding: 20px 22px;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .5s var(--ease), transform .5s var(--ease);
    min-height: 180px;
  }
  .widget.state-upload-done .transcript,
  .widget.state-record-done .transcript {
    display: block;
    opacity: 1;
    transform: none;
  }
  .transcript-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
  }
  .transcript-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--purple);
    font-weight: 600;
  }
  .transcript-lang-chip {
    font-family: var(--mono);
    font-size: 10.5px;
    padding: 4px 10px;
    background: var(--paper);
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    color: var(--gray-700);
    font-weight: 500;
  }
  .transcript-speaker {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(6px);
    animation: revealLine 0.4s var(--ease) forwards;
  }
  .transcript-speaker:nth-child(2) { animation-delay: 0.15s; }
  .transcript-speaker:nth-child(3) { animation-delay: 0.35s; }
  .transcript-speaker:nth-child(4) { animation-delay: 0.55s; }
  .transcript-speaker:nth-child(5) { animation-delay: 0.75s; }
  @keyframes revealLine {
    to { opacity: 1; transform: none; }
  }
  .speaker-badge {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-top: 2px;
  }
  .speaker-badge.s1 {
    background: var(--purple-soft);
    color: var(--purple);
  }
  .speaker-badge.s2 {
    background: #dbeafe;
    color: #1d4ed8;
  }
  .transcript-time {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--gray-400);
    flex-shrink: 0;
    margin-top: 3px;
    min-width: 46px;
  }
  .transcript-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--charcoal);
    flex: 1;
  }

  /* ---------- Section shell ---------- */
  section.sec { padding: 100px 0; }
  .section-head {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 48px;
    align-items: start;
    margin-bottom: 64px;
  }
  .section-index {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--purple);
    padding-top: 8px;
  }
  .section-title {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(36px, 5vw, 68px);
    line-height: 0.95;
    letter-spacing: -0.015em;
    color: var(--charcoal);
    max-width: 18ch;
    margin: 0;
  }
  .section-intro {
    margin-top: 20px;
    font-size: 17px;
    color: var(--gray-700);
    max-width: 58ch;
  }

  /* Two-up capability cards */
  .capabilities {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .capability {
    background: var(--paper);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    position: relative;
    overflow: hidden;
  }
  .capability.dark {
    background: var(--cosmic);
    border-color: var(--cosmic);
    color: #fff;
  }
  .capability.dark::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--purple) 50%, transparent), transparent 60%);
    pointer-events: none;
  }
  .capability-inner { position: relative; z-index: 1; }
  .capability-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--purple);
    margin-bottom: 16px;
    font-weight: 600;
  }
  .capability.dark .capability-eyebrow { color: var(--lilac); }
  .capability h3 {
    font-family: var(--display);
    font-weight: 800;
    font-size: 36px;
    letter-spacing: -0.01em;
    line-height: 0.98;
    margin: 0 0 16px;
    color: var(--charcoal);
    max-width: 14ch;
  }
  .capability.dark h3 { color: #fff; }
  .capability p {
    font-size: 15px;
    line-height: 1.55;
    color: var(--gray-700);
    margin: 0 0 24px;
  }
  .capability.dark p { color: rgba(255,255,255,0.72); }
  .capability-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .capability-list-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--charcoal);
  }
  .capability.dark .capability-list-item { color: rgba(255,255,255,0.85); }
  .capability-list-item svg {
    color: var(--purple);
    margin-top: 4px;
  }
  .capability.dark .capability-list-item svg { color: var(--lilac); }

  /* Dialect chips */
  .dialect-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .d-chip {
    padding: 8px 14px;
    background: var(--paper);
    border: 1px solid var(--gray-100);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--charcoal);
    transition: all .2s var(--ease);
  }
  .d-chip:hover { border-color: var(--purple); color: var(--purple); }
  .d-chip.highlight { background: var(--purple); color: #fff; border-color: var(--purple); }

  /* Use cases */
  .use-cases {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  .use-case {
    background: var(--paper);
    border: 1px solid var(--gray-100);
    border-radius: 14px;
    padding: 24px;
    transition: all .3s var(--ease);
  }
  .use-case:hover {
    border-color: var(--purple);
    transform: translateY(-2px);
  }
  .use-case-icon {
    width: 36px; height: 36px;
    background: var(--purple-soft);
    color: var(--purple);
    border-radius: 9px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
  }
  .use-case h4 {
    font-family: var(--sans);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin: 0 0 4px;
    color: var(--charcoal);
  }
  .use-case p {
    margin: 0;
    font-size: 12.5px;
    color: var(--gray-500);
    line-height: 1.4;
  }

  /* Coverage */
  .coverage-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: color-mix(in srgb, var(--charcoal) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--charcoal) 10%, transparent);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
  .coverage-block {
    background: var(--paper);
    padding: 40px 36px;
  }
  .coverage-block .label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 12px;
  }
  .coverage-block h3 {
    font-family: var(--display);
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 12px;
    color: var(--charcoal);
    letter-spacing: -0.005em;
  }
  .coverage-block p {
    font-size: 14.5px;
    color: var(--gray-700);
    line-height: 1.55;
    margin: 0 0 24px;
  }
  .coverage-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .cov-chip {
    padding: 7px 13px;
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--charcoal);
    font-weight: 500;
  }
  .cov-chip.primary { background: var(--purple); color: #fff; border-color: var(--purple); }

  /* Enterprise strip */
  .enterprise {
    background: var(--cosmic);
    color: #fff;
    border-radius: 28px;
    margin: 0 32px;
    padding: 80px 64px;
    position: relative;
    overflow: hidden;
  }
  .enterprise::before {
    content: "";
    position: absolute; inset: 0;
    background:
      radial-gradient(circle at 90% 20%, color-mix(in srgb, var(--purple) 50%, transparent), transparent 50%),
      radial-gradient(circle at 10% 80%, color-mix(in srgb, var(--lilac) 15%, transparent), transparent 55%);
    pointer-events: none;
  }
  .enterprise-inner {
    position: relative; z-index: 1;
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 64px;
    align-items: center;
  }
  .enterprise h2 {
    font-family: var(--display);
    font-size: clamp(40px, 5vw, 64px);
    line-height: 0.95;
    letter-spacing: -0.015em;
    margin: 0 0 20px;
    color: #fff;
  }
  .enterprise p {
    font-size: 16px;
    color: rgba(255,255,255,0.72);
    margin: 0;
    max-width: 44ch;
  }
  .enterprise-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .ent-pill {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 18px 20px;
    backdrop-filter: blur(8px);
  }
  .ent-pill h4 {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .ent-pill h4 svg { color: var(--lilac); }
  .ent-pill p {
    font-size: 12.5px;
    color: rgba(255,255,255,0.6);
    line-height: 1.45;
    margin: 0;
  }

  /* Sisters */
  .sisters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .sister {
    background: var(--paper);
    border: 1px solid var(--gray-100);
    border-radius: 16px;
    padding: 28px;
    transition: all .3s var(--ease);
    display: block;
  }
  .sister:hover {
    border-color: var(--charcoal);
    transform: translateY(-3px);
    box-shadow: 0 20px 40px -20px rgba(20,10,50,0.2);
  }
  .sister-icon {
    width: 44px; height: 44px;
    background: var(--purple);
    color: #fff;
    border-radius: 11px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
  }
  .sister h4 {
    font-family: var(--display);
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--charcoal);
    letter-spacing: -0.005em;
  }
  .sister p {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0 0 20px;
    line-height: 1.5;
  }
  .sister-link {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--charcoal);
    display: inline-flex;
    gap: 8px;
    align-items: center;
    transition: color .2s var(--ease), gap .2s var(--ease);
  }
  .sister:hover .sister-link { color: var(--purple); gap: 12px; }

  /* CTA */
  .cta {
    background: var(--cosmic);
    color: #fff;
    border-radius: 28px;
    margin: 0 32px 80px;
    padding: 80px 64px;
    position: relative;
    overflow: hidden;
  }
  .cta::before {
    content: "";
    position: absolute; inset: 0;
    background:
      radial-gradient(ellipse 600px 400px at 20% 20%, color-mix(in srgb, var(--purple) 55%, transparent), transparent 60%),
      radial-gradient(ellipse 500px 300px at 90% 80%, color-mix(in srgb, var(--blush) 25%, transparent), transparent 55%);
    pointer-events: none;
  }
  .cta-inner {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 64px;
    align-items: end;
    max-width: var(--container);
    margin: 0 auto;
  }
  .cta h2 {
    font-family: var(--display);
    font-size: clamp(44px, 5.5vw, 80px);
    line-height: 0.88;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0;
    max-width: 14ch;
  }
  .cta h2 span { color: var(--lilac); }
  .cta-body {
    font-size: 16px;
    color: rgba(255,255,255,0.72);
    line-height: 1.55;
    margin: 0 0 28px;
  }
  .cta-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
  .btn-light { background: #fff; color: var(--charcoal); border: 1px solid #fff; }
  .btn-light:hover { background: var(--blush); border-color: var(--blush); transform: translateY(-1px); }
  .btn-outline-light {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
  }
  .btn-outline-light:hover { border-color: #fff; background: rgba(255,255,255,0.08); }

  @media (max-width: 1024px) {
    .hero-card { padding: 48px 40px; }
    .capabilities { grid-template-columns: 1fr; }
    .use-cases { grid-template-columns: repeat(2, 1fr); }
    .coverage-wrap { grid-template-columns: 1fr; }
    .enterprise { padding: 56px 40px; margin: 0 16px; }
    .enterprise-inner { grid-template-columns: 1fr; gap: 40px; }
    .sisters { grid-template-columns: 1fr; }
    .cta { padding: 56px 40px; margin: 0 16px 48px; }
    .cta-inner { grid-template-columns: 1fr; }
    .section-head { grid-template-columns: 1fr; gap: 16px; }
  }
  @media (max-width: 720px) {
    .container { padding: 0 20px; }
    .hero-card { padding: 36px 24px; border-radius: 20px; }
    section.sec { padding: 64px 0; }
    .widget-header { padding: 22px 20px 12px; }
    .panel { padding: 8px 20px 24px; }
    .mode-toggle-btn { padding: 10px 14px; font-size: 12px; }
    .use-cases { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-brand { grid-column: 1 / -1; }
    .voice-note { flex-wrap: wrap; }
    .waveform { width: 100%; order: 3; }
  }