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

    :root {
      /* ── Modern boho — muted earth on paper. The historical --purple-* names
         are kept as the primary ramp (olive→sage→sand) so the recolor cascades
         app-wide; nothing here is actually purple. ── */
      --purple-900: #3E3A34;   /* warm charcoal (deepest text) */
      --purple-800: #55563F;   /* deep olive-charcoal */
      --purple-700: #6E7F5C;   /* deep olive — emphasis / hover / links */
      --purple-600: #7E8E6A;   /* olive-sage — primary (icons, toggles, focus) */
      --purple-500: #A3B196;   /* sage */
      --purple-400: #B9C1A9;   /* light sage */
      --purple-300: #CDC6B2;   /* sage-beige */
      --purple-200: #DBD1BE;   /* soft beige */
      --purple-100: #E6DCCB;   /* blush tint */
      --purple-50:  #EFE8DA;   /* lightest sand tint */
      /* Warm paper + ink — no pure white, never pure black */
      --bg:         #E8DFD3;   /* sand */
      --white:      #F4ECE0;   /* warm cream surface (NOT #fff) */
      --text:       #3E3A34;   /* warm charcoal */
      --muted:      #7C7568;   /* muted taupe */
      --line:       #DBCFBD;   /* soft beige border */
      /* Sage/olive success + boho accents */
      --green:      #7E8E6A;
      --sage:       #A3B196;
      --sage-100:   #E4E7D8;
      --sage-dark:  #55604A;
      --olive:      #6E7F5C;
      --forest:     #35633F;   /* deep forest green — monstera foliage */
      --terracotta: #C4703F;   /* accent — sparing (primary CTA) */
      --terracotta-dark: #B85C38;
      --amber:      #C4913F;    /* muted ochre (warnings) */
      --red:        #B0503C;    /* muted brick (errors) */
      /* Subtle paper grain — tactile */
      --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
    }

    body {
      font-family: 'Assistant', 'Frank Ruhl Libre', 'David', system-ui, sans-serif;
      background: var(--bg);
      background-image: var(--grain);
      background-blend-mode: multiply;
      color: var(--text);
      min-height: 100svh;
    }
    /* Monospace accent for existing technical text (timecodes, sizes, %) */
    .mono, .check-time, .upload-bar-pct, #timeEstimateText {
      font-family: 'Assistant', sans-serif;
      letter-spacing: 0.02em;
    }

    /* ── Hero — warm, flat, no gradient/glow ── */
    .hero {
      position: relative;
      overflow: hidden;
      background: transparent;
      padding: 30px 0 6px;
      text-align: center;
    }
    .hero-overlay {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 0 24px;
    }
    .hero-greeting {
      color: var(--sage-dark);
      font-family: 'Assistant', sans-serif;
      font-size: 0.72rem;
      font-weight: 400;
      letter-spacing: 0.14em;
      margin-bottom: 10px;
    }
    .hero-title-row {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 6px;
    }
    .hero-logo {
      width: 44px; height: 44px; flex-shrink: 0;
      filter: drop-shadow(0 6px 16px rgba(62, 58, 52,0.28));
    }
    .hero-title {
      color: var(--text);
      font-family: 'Playpen Sans Hebrew', 'Frank Ruhl Libre', 'David', cursive;  /* Hebrew wordmark — cartoon */
      font-size: clamp(1.9rem, 6vw, 2.5rem);
      font-weight: 700;
      letter-spacing: 0;
    }
    .hero-sub {
      color: var(--text);
      font-family: 'Assistant', sans-serif;
      font-size: clamp(0.92rem, 2.3vw, 1.02rem);
      font-weight: 600;
      letter-spacing: 0;
      text-transform: none;
    }
    .hero-tags {
      color: var(--muted);
      font-size: 0.82rem;
      font-weight: 400;
      letter-spacing: 0.02em;
      text-transform: none;
      margin-top: 7px;
    }
    /* Flow-motif line under the hero (pipeline metaphor, light touch) */
    .hero-overlay::after { content: none;
      display: block;
      width: min(320px, 78%);
      height: 2px;
      margin: 18px auto 4px;
      background: repeating-linear-gradient(90deg, var(--purple-500) 0 6px, transparent 6px 11px);
      opacity: 0.7;
      -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
              mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    }

    /* ── Layout ── */
    .container {
      max-width: 560px;
      margin: 0 auto;
      padding: 28px 16px 60px;
      animation: view-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    }
    @keyframes view-in {
      from { opacity: 0; transform: translateY(10px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* ── Card ── */
    .card {
      background: var(--white);
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 24px;
      box-shadow: 0 2px 0 rgba(43,37,54,0.02), 0 12px 30px -20px rgba(43,37,54,0.28);
      margin-bottom: 16px;
    }

    /* ── Upload zone ── */
    .upload-zone {
      border: 2px dashed var(--purple-300);
      border-radius: 14px;
      padding: 36px 20px;
      text-align: center;
      cursor: pointer;
      transition: border-color 0.2s, background 0.2s;
      background: var(--purple-50);
      position: relative;
    }
    .upload-zone:hover, .upload-zone.drag-over {
      border-color: var(--purple-600);
      background: var(--purple-100);
    }
    .upload-zone input[type="file"] {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      width: 100%;
      height: 100%;
    }
    .upload-icon { color: var(--purple-600); margin-bottom: 12px; display: flex; justify-content: center; }
    .upload-icon svg { width: 46px; height: 46px; }
    .upload-main {
      font-size: 1rem;
      font-weight: 600;
      color: var(--purple-800);
      margin-bottom: 4px;
    }
    .upload-sub { font-size: 0.85rem; color: var(--muted); }
    .upload-link { color: var(--purple-600); text-decoration: underline; }
    .upload-hint { margin-top: 10px; font-size: 0.75rem; color: var(--purple-400); }
    .upload-note {
      margin-top: 12px; padding: 9px 12px; font-size: 0.8rem; line-height: 1.45;
      color: var(--purple-700); background: var(--purple-50); border: 1px solid var(--purple-100);
      border-radius: 10px; text-align: center;
    }

    /* ── File info strip ── */
    .file-info {
      display: none;
      align-items: center;
      gap: 12px;
      background: var(--purple-50);
      border: 1.5px solid #DDD6FE;
      border-radius: 12px;
      padding: 12px 16px;
      margin-top: 12px;
    }
    .file-info.visible { display: flex; }
    .file-info-icon { flex-shrink: 0; color: var(--purple-600); display: flex; }
    .file-info-icon svg { width: 26px; height: 26px; }
    .file-info-meta { flex: 1; min-width: 0; }
    .file-info-name {
      font-size: 0.88rem;
      font-weight: 600;
      color: var(--purple-800);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .file-info-detail { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
    .file-info-clear {
      margin-inline-start: auto;
      flex-shrink: 0;
      background: none;
      border: none;
      cursor: pointer;
      color: var(--muted);
      font-size: 1.1rem;
      padding: 4px;
      border-radius: 6px;
      transition: color 0.15s;
    }
    .file-info-clear:hover { color: var(--red); }
    .file-info-clear svg { width: 1.05rem; height: 1.05rem; display: block; }

    /* ── Warning / block banners ── */
    .notice {
      display: none;
      align-items: flex-start;
      gap: 10px;
      border-radius: 12px;
      padding: 12px 14px;
      margin-top: 12px;
      font-size: 0.82rem;
      line-height: 1.45;
    }
    .notice.visible { display: flex; }
    .notice-icon { flex-shrink: 0; font-size: 1rem; margin-top: 1px; }
    .notice-icon svg { width: 18px; height: 18px; display: block; }
    .notice-text { flex: 1; }
    .notice-title { font-weight: 700; margin-bottom: 2px; }

    .notice-warn {
      background: #FFF7ED;
      border: 1.5px solid #FDE68A;
      color: #92400E;
    }
    .notice-block {
      background: #F5E7DC;
      border: 1.5px solid #E3C2A8;
      color: #991B1B;
    }
    .notice-info {
      background: var(--purple-50);
      border: 1.5px solid var(--purple-100);
      color: var(--purple-800);
    }

    /* ── Options ── */
    .options-title {
      font-family: 'Assistant', sans-serif;
      font-size: 1.02rem;
      font-weight: 600;
      letter-spacing: 0;
      text-transform: none;
      color: var(--text);
      margin-bottom: 14px;
    }
    .title-with-icon { display: flex; align-items: center; gap: 8px; }
    .title-with-icon .ttl-icon { width: 19px; height: 19px; flex-shrink: 0; color: var(--purple-600); }
    .option-row {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 12px 0;
      border-bottom: 1px solid var(--purple-100);
    }
    .option-row:last-child { border-bottom: none; }
    .option-icon { color: var(--purple-600); flex-shrink: 0; width: 28px; display: flex; justify-content: center; }
    .option-icon svg { width: 23px; height: 23px; }
    .option-text { flex: 1; }
    .option-label { font-family: 'Assistant', sans-serif; font-size: 0.95rem; font-weight: 600; color: var(--text); }
    .option-desc { font-size: 0.78rem; color: var(--muted); margin-top: 1px; }
    .option-row.disabled .option-label,
    .option-row.disabled .option-desc { color: var(--purple-300); }

    /* ── Nested child options (auto B-roll / hook under Burn captions) ── */
    .option-children {
      padding-inline-start: 42px;      /* align under the parent's text column */
      border-bottom: 1px solid var(--purple-100);
      padding-bottom: 10px;
      position: relative;
    }
    /* Connector line down the left, tying children to the parent toggle. */
    .option-children::before {
      content: ''; position: absolute; inset-inline-start: 20px; top: 0; bottom: 18px;
      width: 1.5px; background: var(--purple-100);
    }
    .option-child {
      display: flex; align-items: center; gap: 12px; padding: 9px 0;
    }
    .option-child-text { flex: 1; }
    .option-child-label { font-family: 'Assistant', sans-serif; font-size: 0.88rem; font-weight: 600; color: var(--text); }
    .option-child-desc { font-size: 0.74rem; color: var(--muted); margin-top: 1px; }
    /* Disabled (parent captions off): grey out + block interaction. */
    .option-children.disabled .option-child-label,
    .option-children.disabled .option-child-desc { color: var(--purple-300); }
    .option-children.disabled .option-child .toggle { opacity: 0.45; pointer-events: none; }
    .option-child-note {
      font-size: 0.74rem; color: var(--purple-500); margin-top: 2px;
      display: flex; align-items: center; gap: 6px;
    }
    .option-child-note.extra { color: var(--terracotta); font-weight: 600; }
    /* The "needs captions" note only shows when disabled; the extra-time note
       only when enabled + a child is on (toggled via JS). */
    .option-children:not(.disabled) #captionChildrenNote { display: none; }

    /* iOS toggle */
    .toggle-wrap { flex-shrink: 0; }
    .toggle { position: relative; display: inline-block; width: 46px; height: 26px; }
    .toggle input { display: none; }
    .toggle-track {
      position: absolute; inset: 0;
      background: #DDD6FE; border-radius: 13px; transition: background 0.22s;
    }
    .toggle input:checked + .toggle-track { background: var(--purple-600); }
    .toggle-thumb {
      position: absolute; top: 3px; left: 3px;
      width: 20px; height: 20px; background: var(--white); border-radius: 50%;
      box-shadow: 0 1px 5px rgba(0,0,0,0.25);
      transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }
    .soon-badge {
      font-size: 0.65rem; font-weight: 600; letter-spacing: 0.05em;
      background: var(--purple-100); color: var(--purple-400);
      border-radius: 6px; padding: 2px 6px;
    }

    /* ── Enhance-video mode selector ── */
    .enhance-panel { padding: 0 0 14px; padding-inline-start: 42px; border-bottom: 1px solid var(--purple-100); }

    /* ── Silence-cut aggressiveness (under the Cut silences toggle) ── */
    .aggr-panel { padding: 0 0 14px; padding-inline-start: 42px; border-bottom: 1px solid var(--purple-100); }
    .aggr-panel.hidden { display: none; }

    .slider-row { margin-bottom: 18px; }
    .slider-row:last-child { margin-bottom: 0; }
    .slider-label { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 500; color: var(--purple-800); margin-bottom: 8px; }
    .slider-val { color: var(--purple-600); font-weight: 600; }
    .slider-desc { font-size: 0.75rem; color: var(--muted); margin-top: 5px; }
    .aggr-track { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
    .aggr-track input[type=range] { flex: 1; }
    .aggr-end { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
    input[type="range"] { width: 100%; height: 5px; accent-color: var(--purple-600); cursor: pointer; }

    /* ── Run button ── */
    .run-btn {
      width: 100%; padding: 16px;
      background: var(--terracotta);
      color: #F7F0E6; border: none; border-radius: 16px;
      font-family: 'Assistant', sans-serif;
      font-size: 1.05rem; font-weight: 600; letter-spacing: 0.01em;
      cursor: pointer; box-shadow: 0 10px 24px -12px rgba(120,70,40,0.5);
      transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
    }
    #runBtn { margin-bottom: 16px; }   /* gap between Burn & Download and whatever follows */
    .run-btn:hover:not(:disabled) {
      background: var(--terracotta-dark); transform: translateY(-1px);
      box-shadow: 0 14px 28px -12px rgba(120,70,40,0.55);
    }
    .run-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
    /* Shared secondary action button — full width, outlined purple */
    .action-btn {
      display: block; width: 100%; padding: 11px 18px;
      background: none; border: 1.5px solid var(--purple-400); color: var(--purple-700);
      border-radius: 12px; font-size: 0.88rem; font-weight: 700; cursor: pointer;
      font-family: inherit;
      transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    }
    .action-btn:hover:not(:disabled) { background: var(--purple-50); }
    .action-btn:disabled { opacity: 0.45; cursor: not-allowed; }

    /* Leading line-icon rendered as a currentColor mask, so it survives the
       button's textContent being swapped by JS/i18n (no icon element to wipe). */
    .btn-ai-icon::before,
    .btn-refresh-icon::before {
      content: ''; display: inline-block; width: 1.05em; height: 1.05em;
      margin-inline-end: 7px; vertical-align: -0.17em;
      background-color: currentColor;
      -webkit-mask: center / contain no-repeat var(--btn-icon);
      mask: center / contain no-repeat var(--btn-icon);
    }
    .btn-ai-icon { --btn-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M12%202l1.8%205.2L19%209l-5.2%201.8L12%2016l-1.8-5.2L5%209z'/%3E%3Cpath%20d='M18.5%2013.5l.9%202.6%202.6.9-2.6.9-.9%202.6-.9-2.6-2.6-.9%202.6-.9z'/%3E%3C/svg%3E"); }
    .btn-refresh-icon { --btn-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3%2012a9%209%200%200%201%2015-6.7L21%208'/%3E%3Cpath%20d='M21%203v5h-5'/%3E%3Cpath%20d='M21%2012a9%209%200%200%201-15%206.7L3%2016'/%3E%3Cpath%20d='M3%2021v-5h5'/%3E%3C/svg%3E"); }

    .link-btn {
      display: block; width: 100%; margin-top: 6px; padding: 11px 6px; min-height: 40px;
      background: none; border: none; color: var(--purple-500);
      font-size: 0.82rem; font-weight: 600; cursor: pointer; font-family: inherit;
      text-decoration: underline; text-underline-offset: 2px;
    }
    .link-btn:hover { color: var(--purple-700); }

    /* Show/hide password toggle */
    .pw-wrap { position: relative; }
    .pw-wrap .sched-input { padding-inline-end: 42px; }
    .pw-toggle {
      position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
      display: flex; align-items: center; justify-content: center;
      background: none; border: none; cursor: pointer; padding: 6px;
      color: var(--purple-400); border-radius: 8px; line-height: 0;
    }
    .pw-toggle:hover { color: var(--purple-700); background: var(--purple-50); }
    .pw-toggle svg { display: block; }

    /* Loading spinner (inherits currentColor, so it works on any button) */
    .spinner {
      display: inline-block; width: 16px; height: 16px; vertical-align: middle;
      border: 2px solid currentColor; border-top-color: transparent;
      border-radius: 50%; animation: spin 0.6s linear infinite;
    }
    .spinner-lg { width: 34px; height: 34px; border-width: 3px; }
    @keyframes spin { to { transform: rotate(360deg); } }
    .boot-loader {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      gap: 14px; padding: 80px 0; color: var(--purple-500);
    }
    /* Only surfaces on cold boots - fast loads never show it */
    .boot-msg {
      font-size: 0.9rem; color: var(--muted); opacity: 0;
      animation: bootMsgIn 0.4s ease 1.5s forwards;
    }
    @keyframes bootMsgIn { to { opacity: 1; } }

    /* Remember-me row */
    .remember-row {
      display: flex; align-items: center; gap: 8px; margin-top: 14px;
      font-size: 0.85rem; color: var(--muted); cursor: pointer; user-select: none;
    }
    .remember-row input { width: 16px; height: 16px; accent-color: var(--purple-600); cursor: pointer; }
    .field-err { display: none; color: var(--red); font-size: 0.8rem; line-height: 1.45; margin-top: 5px; }
    .auth-terms { font-size: 0.78rem; color: var(--muted); text-align: center; line-height: 1.5; }
    .auth-terms a { color: var(--olive); text-decoration: underline; }

    /* ── Email verification nudge ── */
    .verify-banner {
      display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
      max-width: 720px; margin: 10px auto 0; padding: 10px 14px;
      background: #FFFBEB; border: 1.5px solid #FDE68A; border-radius: 12px;
      color: #92400E; font-size: 0.84rem;
    }
    .verify-banner-msg { flex: 1 1 auto; min-width: 180px; }
    .verify-banner-input {
      flex: 1 1 160px; padding: 7px 10px; border: 1.5px solid #FDE68A;
      border-radius: 9px; font-size: 0.84rem; font-family: inherit;
    }
    .verify-banner-btn {
      flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; cursor: pointer;
      background: #C4913F; border: none; color: #fff; font-weight: 700;
      font-size: 0.82rem; font-family: inherit;
    }
    .verify-banner-btn:hover:not(:disabled) { background: #D97706; }
    .verify-banner-btn:disabled { opacity: 0.5; cursor: not-allowed; }

    .ev-warn { color: var(--red); font-weight: 600; }

    .reprocess-btn {
      width: 100%; padding: 11px 18px; margin-top: 14px;
      background: var(--white); color: var(--purple-700);
      border: 1.5px solid var(--purple-400); border-radius: 12px;
      font-size: 0.88rem; font-weight: 700; cursor: pointer;
      transition: background 0.15s, border-color 0.15s;
    }
    .reprocess-btn:hover { background: var(--purple-50); }
    .reprocess-btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

    /* ── Status card ── */
    .status { display: none; }
    .status.visible { display: block; }

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

    /* Step checklist (upload + processing) */
    .status-checklist { padding: 16px 20px 4px; position: relative; }
    /* Pipeline flow line linking the stages (dashed, behind the icon column) */
    .status-checklist::before {
      content: ""; position: absolute; top: 30px; bottom: 30px;
      inset-inline-start: 30px; width: 2px;
      background: repeating-linear-gradient(180deg, var(--purple-300) 0 5px, transparent 5px 10px);
      opacity: 0.7;
    }
    .check-item {
      display: flex; align-items: flex-start; gap: 12px;
      padding: 11px 0; border-bottom: 1px solid var(--line);
    }
    .check-item:last-of-type { border-bottom: none; }
    .check-icon-col {
      width: 22px; flex-shrink: 0; position: relative; z-index: 1;
      display: flex; align-items: center; justify-content: center; padding-top: 1px;
      background: var(--white);
    }
    .ci-pending { font-size: 1rem; color: var(--purple-200); line-height: 1; }
    .ci-spinner {
      display: none; width: 17px; height: 17px;
      border: 2px solid var(--purple-100); border-top-color: var(--purple-600);
      border-radius: 50%; animation: spin 0.9s linear infinite;
    }
    .ci-done { display: none; font-size: 1rem; font-weight: 700; color: var(--green); line-height: 1; }
    .ci-pending svg, .ci-done svg { width: 1rem; height: 1rem; display: block; }

    .check-item.active  .ci-pending { display: none; }
    .check-item.active  .ci-spinner { display: block; }
    .check-item.done    .ci-pending, .check-item.done .ci-spinner { display: none; }
    .check-item.done    .ci-done    { display: inline; animation: check-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
    @keyframes check-pop {
      from { transform: scale(0.3); opacity: 0; }
      to   { transform: scale(1); opacity: 1; }
    }

    .check-body { flex: 1; min-width: 0; }
    .check-row  { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .check-label {
      font-size: 0.88rem; font-weight: 600;
      color: var(--muted);
    }
    .check-item.active .check-label { color: var(--purple-800); }
    .check-item.done   .check-label { color: var(--text); }
    .check-time {
      font-size: 0.78rem; font-weight: 600; color: var(--purple-400);
      font-variant-numeric: tabular-nums; white-space: nowrap;
    }
    .check-item.active .check-time { color: var(--purple-600); }
    .check-item.done   .check-time { color: var(--green); }

    /* Inline upload progress bar inside the upload step */
    .upload-bar-row {
      display: flex; align-items: center; gap: 8px; margin-top: 5px;
    }
    .upload-bar-track {
      flex: 1; height: 4px; background: var(--purple-100); border-radius: 2px; overflow: hidden;
    }
    .upload-bar-fill {
      height: 100%; width: 0%;
      background: var(--olive);
      border-radius: 2px; transition: width 0.3s ease;
    }
    .upload-bar-pct { font-size: 0.72rem; font-weight: 600; color: var(--purple-600); min-width: 28px; }

    .checklist-footer {
      padding: 10px 0 4px; font-size: 0.75rem; color: var(--muted); text-align: center;
    }

    /* Done */
    .status-done { display: none; flex-direction: column; align-items: center; gap: 16px; padding: 28px 20px; }
    .status-done.visible { display: flex; }
    .done-icon { color: var(--green); animation: check-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
    .done-icon svg { width: 2.8rem; height: 2.8rem; display: block; }
    .done-label { font-size: 1rem; font-weight: 600; color: var(--green); }
    .done-saved {
      text-align: center; line-height: 1.6;
      background: var(--sage-100);
      border: 1.5px solid var(--purple-100);
      border-radius: 16px; padding: 10px 18px;
      font-size: 0.85rem; font-weight: 700; color: var(--purple-800);
      animation: view-in 0.4s 0.15s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    }
    .done-saved b { color: var(--green); }
    .done-time  { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
    .download-btn {
      width: 100%; padding: 15px;
      background: var(--olive);
      color: #F7F0E6; border: none; border-radius: 14px;
      font-size: 0.95rem; font-weight: 700; cursor: pointer;
      box-shadow: 0 6px 24px rgba(110,127,92,0.3);
      transition: opacity 0.18s, transform 0.18s;
    }
    .download-btn:hover { opacity: 0.9; transform: translateY(-1px); }

    /* Error */
    .status-error { display: none; flex-direction: column; align-items: center; gap: 10px; padding: 24px 20px; }
    .status-error.visible { display: flex; }
    .error-icon { color: var(--red); }
    .error-icon svg { width: 2rem; height: 2rem; display: block; }
    .error-msg { font-size: 0.85rem; color: var(--red); text-align: center; max-width: 360px; }
    .error-detail {
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.68rem;
      color: var(--muted); text-align: center; max-width: 360px; margin-top: 6px;
      overflow-wrap: anywhere;
    }
    .error-log-wrap { max-width: 360px; width: 100%; margin-top: 6px; }
    .error-log-wrap summary {
      font-size: 0.7rem; color: var(--muted); cursor: pointer; text-align: center;
      list-style-position: inside;
    }
    .error-log {
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.6rem;
      color: var(--muted); background: var(--purple-50); border: 1px solid var(--purple-100);
      border-radius: 8px; padding: 8px; margin-top: 6px; text-align: left;
      max-height: 130px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
    }
    .retry-btn {
      background: none; border: 1.5px solid var(--red); color: var(--red);
      border-radius: 10px; padding: 8px 20px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
    }
    /* B-roll */
    .time-estimate {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 0 4px;
      font-size: 0.82rem;
      color: var(--muted);
      border-top: 1px solid var(--purple-100);
      margin-top: 4px;
    }
    .time-estimate-icon { display: inline-flex; align-items: center; color: var(--purple-600); }
    .gemini-key-row { margin: 8px 0 2px; }
    .gemini-key-input {
      width: 100%; padding: 8px 12px; border: 1.5px solid var(--purple-200);
      border-radius: 8px; font-size: 0.82rem; color: var(--text);
      background: var(--purple-50); outline: none;
    }
    .gemini-key-input:focus { border-color: var(--purple-500); }
    .broll-status { display: flex; align-items: center; gap: 10px; padding: 14px 0; font-size: 0.85rem; color: var(--muted); }
    .spinner-sm {
      width: 18px; height: 18px; flex-shrink: 0;
      border: 2px solid var(--purple-100); border-top-color: var(--purple-600);
      border-radius: 50%; animation: spin 0.9s linear infinite;
    }
    .broll-row {
      display: flex; gap: 12px; align-items: flex-start;
      padding: 14px 0; border-bottom: 1px solid var(--purple-100);
    }
    .broll-row:last-child { border-bottom: none; }
    .broll-checkbox {
      width: 18px; height: 18px; flex-shrink: 0; margin-top: 4px;
      accent-color: var(--purple-600); cursor: pointer;
    }
    .broll-thumb {
      width: 72px; height: 128px; overflow: hidden;
      border-radius: 8px; flex-shrink: 0; background: var(--purple-100);
      display: flex; align-items: center; justify-content: center;
      position: relative;
    }
    .broll-thumb video, .broll-thumb img {
      width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 8px;
    }
    .broll-thumb-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
    .broll-thumb.zoomable { cursor: zoom-in; }
    .broll-thumb.zoomable:hover { opacity: 0.9; }
    .broll-retry {
      background: none; border: none; cursor: pointer; padding: 0;
      font-size: 0.68rem; color: var(--purple-400); line-height: 1;
      transition: color 0.15s;
    }
    .broll-retry:hover:not(:disabled) { color: var(--purple-600); }
    .broll-retry:disabled { opacity: 0.4; cursor: not-allowed; }
    .broll-thumb-placeholder {
      width: 28px; height: 28px; opacity: 0.35;
    }
    .broll-content { flex: 1; min-width: 0; }
    .broll-time { font-size: 0.7rem; color: var(--purple-400); font-variant-numeric: tabular-nums; }
    .broll-label { font-size: 0.85rem; font-weight: 600; color: var(--purple-800); margin: 3px 0 2px; }
    .broll-desc { font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; line-height: 1.4; }
    .broll-dismiss { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 0 2px; flex-shrink: 0; line-height: 1; }
    .broll-dismiss:hover { color: var(--red); }
    .card.burning    { pointer-events: none; opacity: 0.5; }
    .setup-locked    { pointer-events: none; opacity: 0.5; }

    /* ── Confirm dialog modal ── */
    .modal-overlay {
      position: fixed; inset: 0;
      background: rgba(46, 42, 36, 0.5);
      display: flex; align-items: center; justify-content: center;
      z-index: 900; padding: 16px;
    }
    .modal-dialog {
      background: var(--white);
      border: 1.5px solid var(--purple-100);
      border-radius: 20px;
      padding: 28px 24px;
      max-width: 360px;
      width: 100%;
      box-shadow: 0 12px 40px rgba(55, 7, 100, 0.22);
    }
    /* ── Floating WhatsApp feedback button (tester nudge) ── */
    .wa-fab {
      position: fixed;
      right: max(16px, env(safe-area-inset-right));
      bottom: max(16px, env(safe-area-inset-bottom));
      z-index: 800;                 /* below modals (900+), above page content */
      /* Force LTR layout so the button pins to the bottom-RIGHT corner in both
         languages (RTL flex-end would push it left). Bubble text direction is
         set separately below. */
      direction: ltr;
      display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
      /* The container's transparent box (incl. the collapsed bubble's layout
         space) must NOT swallow taps meant for content beneath it (e.g. the
         footer links on mobile). Only the actual button/bubble are interactive;
         desktop :hover still fires via the button (a pointer-events:auto child). */
      pointer-events: none;
    }
    .wa-fab-btn, .wa-fab-bubble { pointer-events: auto; }
    .wa-fab-btn {
      width: 58px; height: 58px; border-radius: 50%;
      background: #25D366; color: #fff;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 6px 18px rgba(0,0,0,0.28);
      cursor: pointer; text-decoration: none;
      animation: waGlow 2.4s ease-in-out infinite;
      transition: transform 0.15s ease;
    }
    .wa-fab-btn:hover  { transform: scale(1.06); }
    .wa-fab-btn:active { transform: scale(0.96); }
    .wa-fab-btn svg { width: 34px; height: 34px; display: block; }
    @keyframes waGlow {
      0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.55), 0 6px 18px rgba(0,0,0,0.28); }
      50%      { box-shadow: 0 0 0 14px rgba(37,211,102,0),  0 6px 18px rgba(0,0,0,0.28); }
    }
    .wa-fab-bubble {
      position: relative;
      max-width: min(258px, calc(100vw - 40px));
      background: var(--white);
      border: 1.5px solid var(--purple-100);
      border-radius: 14px;
      padding: 12px 30px 12px 14px;
      font-size: 0.82rem; line-height: 1.4; color: var(--text);
      box-shadow: 0 10px 28px rgba(55, 40, 20, 0.20);
      transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
      transform-origin: bottom right;
    }
    /* Little tail pointing down toward the button. */
    .wa-fab-bubble::after {
      content: ''; position: absolute; bottom: -7px; right: 22px;
      width: 13px; height: 13px; background: var(--white);
      border-right: 1.5px solid var(--purple-100);
      border-bottom: 1.5px solid var(--purple-100);
      transform: rotate(45deg);
    }
    .wa-fab-close {
      position: absolute; top: 6px; right: 6px;
      background: none; border: none; padding: 3px; cursor: pointer;
      color: var(--muted); border-radius: 6px; line-height: 0;
    }
    .wa-fab-close:hover { background: var(--purple-50); color: var(--text); }
    .wa-fab-close svg { width: 13px; height: 13px; display: block; }
    /* Hebrew: render the text RTL and move the close X to the LEFT (opposite the
       reading start) so it doesn't sit on the text. The tail + button stay on the
       right (the button is corner-pinned in both languages). */
    :root[dir="rtl"] .wa-fab-bubble {
      direction: rtl; text-align: right; padding: 12px 14px 12px 30px;
    }
    :root[dir="rtl"] .wa-fab-close { right: auto; left: 6px; }
    /* Collapsed (auto-timeout or dismissed): hide the bubble, keep the button. */
    .wa-fab.wa-collapsed .wa-fab-bubble {
      opacity: 0; visibility: hidden; transform: scale(0.85) translateY(6px); pointer-events: none;
    }
    /* Desktop: re-reveal on hover even after it collapsed. */
    @media (hover: hover) {
      .wa-fab:hover .wa-fab-bubble {
        opacity: 1; visibility: visible; transform: none; pointer-events: auto;
      }
    }

    .modal-dialog-title { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
    /* Privacy & Terms modal: a tall, wide dialog hosting legal.html in an iframe */
    .legal-dialog {
      max-width: 680px; width: 100%; height: 85vh;
      display: flex; flex-direction: column; padding: 16px 16px 18px;
    }
    .legal-dialog .sched-dialog-head { margin-bottom: 10px; }
    #legalFrame {
      flex: 1; width: 100%; border: none; border-radius: 12px;
      background: var(--white);
    }
    /* Scheduling modal: taller form, scrolls inside the dialog */
    .sched-dialog { max-width: 440px; max-height: 90vh; overflow-y: auto; }
    .sched-dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
    .sched-dialog-head .modal-dialog-title { margin-bottom: 0; }
    .sched-close {
      background: none; border: none; font-size: 1.05rem; color: var(--muted);
      cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 8px; font-family: inherit;
    }
    .sched-close:hover { background: var(--purple-50); color: var(--text); }
    .sched-close svg { width: 1.05rem; height: 1.05rem; display: block; }
    .sched-video-name { font-size: 0.8rem; color: var(--purple-600); font-weight: 700; margin: 2px 0 14px; word-break: break-word; }
    .modal-dialog-body  { font-size: 0.88rem; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }
    .modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
    .modal-cancel-btn {
      background: none; border: 1.5px solid var(--purple-200);
      color: var(--muted); border-radius: 10px; padding: 10px 18px;
      font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: border-color 0.15s;
    }
    .modal-cancel-btn:hover { border-color: var(--purple-400); color: var(--purple-700); }
    .modal-ok-btn {
      background: var(--olive);
      color: #F7F0E6; border: none; border-radius: 10px; padding: 10px 20px;
      font-size: 0.88rem; font-weight: 700; cursor: pointer;
      box-shadow: 0 4px 16px rgba(62, 58, 52, 0.32); transition: opacity 0.15s;
    }
    .modal-ok-btn:hover { opacity: 0.9; }

    /* ── Burn success banner ── */
    #burnSuccessBanner {
      background: var(--sage-100);
      border: 1.5px solid #A3B196;
      border-radius: 16px;
      padding: 20px;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      margin-bottom: 16px;
      text-align: center;
    }
    .burn-success-icon  { color: var(--green); }
    .burn-success-icon svg { width: 2rem; height: 2rem; display: block; }
    .burn-success-label { font-size: 1rem; font-weight: 700; color: #55604A; }
    .burn-success-stat  { font-size: 0.85rem; font-weight: 600; color: var(--terracotta); letter-spacing: 0.2px; }

    /* ── Celebration micro-interactions (restrained, on-brand) ── */
    /* One-shot warm glow pulse on a success surface. */
    @keyframes celebrate-glow-kf {
      0%   { box-shadow: 0 0 0 0 rgba(196,112,63,0); }
      30%  { box-shadow: 0 0 0 5px rgba(196,112,63,0.16), 0 10px 28px rgba(196,112,63,0.22); }
      100% { box-shadow: 0 0 0 0 rgba(196,112,63,0); }
    }
    .celebrate-glow { animation: celebrate-glow-kf 1.15s ease-out; }
    /* Check icon: spring the mark, draw the tick. */
    @keyframes celebrate-pop-kf {
      0% { transform: scale(0.6); } 55% { transform: scale(1.18); }
      75% { transform: scale(0.94); } 100% { transform: scale(1); }
    }
    @keyframes celebrate-draw-kf { to { stroke-dashoffset: 0; } }
    .celebrate-check { animation: celebrate-pop-kf 0.6s cubic-bezier(0.34,1.56,0.64,1) both; }
    .celebrate-check svg path:last-of-type {
      stroke-dasharray: 24; stroke-dashoffset: 24;
      animation: celebrate-draw-kf 0.45s 0.12s ease-out forwards;
    }
    /* Reusable toast (edit-ready / schedule). */
    .celebrate-toast {
      position: fixed; z-index: 10001; top: 74px; left: 50%;
      transform: translateX(-50%) translateY(-10px) scale(0.96);
      display: flex; align-items: center; gap: 9px;
      padding: 11px 18px; border-radius: 999px; max-width: 90vw;
      background: var(--white); border: 1.5px solid var(--sage-100);
      box-shadow: 0 10px 30px rgba(120,90,60,0.18);
      color: var(--text); font-weight: 700; font-size: 0.92rem;
      opacity: 0; pointer-events: none;
      transition: opacity 0.28s ease, transform 0.42s cubic-bezier(0.34,1.56,0.64,1);
    }
    .celebrate-toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    .celebrate-toast-check { color: var(--green); display: inline-flex; }
    .celebrate-toast-check svg { width: 1.3rem; height: 1.3rem; }
    .celebrate-toast-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* ── Disabled option row (Veo) ── */
    .option-row.disabled-feature {
      opacity: 0.42;
      pointer-events: none;
      cursor: not-allowed;
      filter: grayscale(0.3);
    }

    /* ── Stock B-roll moment cards ── */
    .moment-card {
      border: 1.5px solid var(--purple-100);
      border-radius: 14px;
      padding: 16px;
      margin-bottom: 12px;
      background: var(--purple-50);
    }
    .moment-card:last-child { margin-bottom: 0; }
    .moment-card.coverage {
      opacity: 0.82;
      border: 1.5px dashed #D1D5DB;
      background: #F9FAFB;
    }
    .moment-card.skipped-emphasis {
      opacity: 0.45;
    }
    .moment-badge-rhythm {
      background: #E4E7D8; color: #55604A; border: 1.5px solid #A3B196;
      font-size: 0.65rem; font-weight: 700; border-radius: 6px;
      padding: 1px 7px; letter-spacing: 0.04em; flex-shrink: 0;
    }
    .moment-restore-btn {
      background: none; border: 1px solid var(--purple-300);
      color: var(--purple-600); border-radius: 6px;
      padding: 2px 8px; font-size: 0.72rem; font-weight: 600;
      cursor: pointer; margin-inline-start: auto; flex-shrink: 0;
    }
    .moment-restore-btn:hover { background: var(--purple-50); }
    .broll-summary {
      font-size: 0.78rem; color: var(--muted); margin-bottom: 10px;
      padding: 6px 10px; background: var(--purple-50);
      border: 1px solid var(--purple-100); border-radius: 8px;
    }
    .moment-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 6px;
      flex-wrap: wrap;
    }
    .moment-time-badge {
      background: var(--purple-100);
      color: var(--purple-700);
      font-size: 0.7rem;
      font-weight: 700;
      padding: 2px 9px;
      border-radius: 20px;
      font-variant-numeric: tabular-nums;
      flex-shrink: 0;
      letter-spacing: 0.03em;
    }
    .moment-label {
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--purple-800);
      flex: 1;
      min-width: 0;
    }
    .moment-excerpt {
      font-size: 0.83rem;
      color: var(--text);
      direction: rtl;
      text-align: right;
      font-family: 'Assistant', 'Frank Ruhl Libre', sans-serif;
      font-style: italic;
      margin: 4px 0 8px;
      line-height: 1.55;
      padding: 7px 12px;
      background: var(--white);
      border-radius: 8px;
      border: 1px solid var(--purple-100);
      /* Quote accent on the reading-start (right, RTL) edge */
      border-right: 3px solid var(--terracotta);
    }
    .moment-reasoning {
      font-size: 0.74rem;
      color: var(--muted);
      margin-bottom: 12px;
      line-height: 1.45;
      font-style: italic;
    }
    .clips-row {
      display: flex;
      gap: 10px;
      overflow-x: auto;
      padding-bottom: 6px;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
    }
    .clip-card {
      flex-shrink: 0;
      width: 148px;
      scroll-snap-align: start;
      border-radius: 10px;
      overflow: hidden;
      background: var(--white);
      border: 1.5px solid var(--purple-100);
      box-shadow: 0 2px 8px rgba(62, 58, 52, 0.06);
      transition: transform 0.12s, box-shadow 0.12s;
    }
    .clip-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(62, 58, 52, 0.12); }
    .clip-thumb {
      position: relative;
      width: 148px;
      height: 92px;
      background: var(--purple-100);
      overflow: hidden;
      cursor: pointer;
    }
    .clip-thumb img {
      width: 100%; height: 100%; object-fit: cover; display: block;
    }
    .clip-thumb-play {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(0,0,0,0.16);
      transition: background 0.15s;
    }
    .clip-thumb:hover .clip-thumb-play { background: rgba(0,0,0,0.30); }
    .clip-thumb-play-icon {
      width: 34px; height: 34px;
      background: rgba(255,255,255,0.92);
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 13px;
      padding-left: 2px;
    }
    .clip-source-badge {
      position: absolute;
      top: 6px; left: 6px;
      font-size: 0.58rem;
      font-weight: 800;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      padding: 2px 6px;
      border-radius: 4px;
      color: #F7F0E6;
    }
    .clip-source-badge.pexels { background: #07A081; }
    .clip-source-badge.pixabay { background: #2EC66A; }
    .clip-score-badge {
      position: absolute;
      bottom: 6px; right: 6px;
      font-size: 0.62rem;
      font-weight: 800;
      padding: 2px 6px;
      border-radius: 4px;
      color: #F7F0E6;
      letter-spacing: 0.02em;
      cursor: default;
    }
    .clip-score-badge.high { background: rgba(5,150,105,0.92); }
    .clip-score-badge.mid  { background: rgba(217,119,6,0.92); }
    .clip-score-badge.low  { background: rgba(107,112,128,0.85); }

    /* ── Hook option cards ── */
    .hook-option {
      position: relative;
      border: 1.5px solid var(--purple-200);
      border-radius: 12px;
      padding: 12px 14px;
      margin-bottom: 8px;
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    }
    .hook-option:hover { border-color: var(--purple-300); background: var(--purple-50); }
    .hook-option.selected {
      border-color: var(--terracotta);
      background: #F7EFE7;
      box-shadow: 0 0 0 3px rgba(196,112,63,0.2);
    }
    .hook-option-check {
      position: absolute; top: 10px; inset-inline-end: 12px;
      width: 22px; height: 22px; border-radius: 50%;
      background: var(--terracotta); color: #F7F0E6;
      display: none; align-items: center; justify-content: center;
      font-size: 0.8rem; font-weight: 800; line-height: 1; pointer-events: none;
    }
    .hook-option.selected .hook-option-check { display: flex; }
    .clip-meta {
      padding: 6px 8px 8px;
    }
    .clip-author {
      display: block;
      font-size: 0.67rem;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      text-decoration: none;
      margin-bottom: 5px;
    }
    .clip-author:hover { color: var(--purple-600); }
    .clip-title {
      display: block;
      font-size: 0.64rem;
      color: var(--text);
      margin-bottom: 4px;
      line-height: 1.3;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
    .clip-tags {
      display: block;
      font-size: 0.59rem;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-bottom: 4px;
    }
    .clip-select-label {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      width: 100%;
      padding: 4px 0;
      border: 1.5px solid var(--purple-300);
      border-radius: 6px;
      background: none;
      color: var(--purple-600);
      font-size: 0.68rem;
      font-weight: 700;
      cursor: pointer;
      text-align: center;
      transition: background 0.12s, color 0.12s, border-color 0.12s;
      font-family: inherit;
      margin-bottom: 4px;
    }
    .clip-select-label:hover { background: var(--purple-100); color: var(--purple-700); }
    .clip-select-label input { display: none; }
    .clip-select-label.checked { background: var(--purple-600); color: #F7F0E6; border-color: var(--purple-600); }
    .clip-card.selected { border-color: var(--purple-500); box-shadow: 0 0 0 2px var(--purple-200), 0 4px 16px rgba(62, 58, 52,0.14); }
    .clip-view-link {
      display: block;
      text-align: center;
      font-size: 0.62rem;
      color: var(--muted);
      text-decoration: none;
    }
    .clip-view-link:hover { color: var(--purple-600); text-decoration: underline; }
    .moment-dur-badge {
      background: var(--purple-700);
      color: #F7F0E6;
      font-size: 0.65rem;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: 20px;
      font-variant-numeric: tabular-nums;
      flex-shrink: 0;
      letter-spacing: 0.03em;
    }
    .clip-window-note {
      font-size: 0.6rem;
      color: var(--muted);
      text-align: center;
      padding: 2px 0;
      white-space: nowrap;
    }
    .clip-window-note.padded { color: var(--amber, #d97706); }
    .moment-confidence-badge {
      font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em;
      padding: 2px 8px; border-radius: 20px; flex-shrink: 0; text-transform: uppercase;
    }
    .confidence-high   { background: #E4E7D8; color: #55604A; }
    .confidence-medium { background: #FEF3C7; color: #92400E; }
    .confidence-low    { background: #F3F4F6; color: #6B7280; }

    .moment-dismiss-btn {
      margin-inline-start: auto;
      background: none;
      border: none;
      color: var(--muted);
      cursor: pointer;
      font-size: 1rem;
      padding: 0 2px;
      line-height: 1;
      flex-shrink: 0;
    }
    .moment-dismiss-btn:hover { color: var(--red); }
    .moment-dismiss-btn svg { display: block; }
    .no-clips-msg {
      font-size: 0.78rem;
      color: var(--muted);
      padding: 8px 0;
      font-style: italic;
    }
    .find-clips-btn {
      margin-top: 10px;
      background: none;
      border: 1.5px solid var(--purple-200);
      border-radius: 8px;
      padding: 5px 12px;
      font-size: 0.74rem;
      font-weight: 600;
      color: var(--purple-500);
      cursor: pointer;
      transition: border-color 0.15s, color 0.15s, background 0.15s;
      font-family: inherit;
    }
    .find-clips-btn:hover { border-color: var(--purple-400); color: var(--purple-700); background: var(--purple-50); }
    .find-clips-btn:disabled { opacity: 0.4; cursor: not-allowed; }
    .moment-debug {
      margin-top: 10px;
      font-size: 0.71rem;
      display: none;
    }
    .debug-mode .moment-debug { display: block; }
    .debug-toggle-btn {
      font-size: 0.72rem;
      padding: 3px 9px;
      border-radius: 6px;
      border: 1px solid var(--purple-200);
      background: var(--white);
      color: var(--muted);
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
    }
    .debug-toggle-btn.active { background: var(--purple-100); color: var(--purple-700); border-color: var(--purple-400); font-weight: 600; }
    .moment-debug-body {
      margin-top: 7px;
      padding: 8px 10px;
      background: var(--white);
      border-radius: 8px;
      border: 1px solid var(--purple-100);
      display: flex;
      flex-direction: column;
      gap: 5px;
    }
    .moment-debug-row { color: var(--text); line-height: 1.45; }
    .moment-debug-row strong { color: var(--purple-600); margin-right: 4px; font-weight: 700; }
    .moment-reasoning { direction: rtl; text-align: right; font-family: 'Assistant', 'Frank Ruhl Libre', sans-serif; }

    /* Aspect ratio selector */
    .ar-select { display: flex; gap: 6px; margin-top: 6px; }
    .ar-select input[type="radio"] { display: none; }
    .ar-select label {
      flex: 1; text-align: center; padding: 5px 8px;
      border-radius: 8px; border: 1.5px solid var(--purple-200);
      font-size: 0.78rem; font-weight: 600; cursor: pointer;
      color: var(--purple-400); background: var(--purple-50);
      transition: border-color 0.15s, color 0.15s, background 0.15s;
    }
    .ar-select input[type="radio"]:checked + label {
      border-color: var(--purple-600); color: var(--purple-700);
      background: var(--purple-100);
    }

    /* Lightbox */
    #brollLightbox {
      display: none; position: fixed; inset: 0; z-index: 10000;
      background: rgba(0,0,0,0.88); align-items: center; justify-content: center;
      cursor: zoom-out;
    }
    #brollLightbox.open { display: flex; }
    #brollLightboxImg {
      max-width: 92vw; max-height: 92vh; object-fit: contain;
      border-radius: 10px; box-shadow: 0 8px 48px rgba(0,0,0,0.6);
    }

    .start-over-btn {
      width: 100%; padding: 12px; margin-top: 16px;
      background: #F5E7DC; border: 1.5px solid #E3C2A8; color: #B85C38;
      border-radius: 12px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
      transition: background 0.15s, border-color 0.15s;
    }
    .start-over-btn:hover { background: #FEE2E2; border-color: #FCA5A5; }

    /* ── Caption editor ── */
    .caption-row {
      display: flex; align-items: center; gap: 8px;
      padding: 6px 0; border-bottom: 1px solid var(--purple-100);
    }
    .caption-row:last-child { border-bottom: none; }
    .caption-time {
      font-size: 0.7rem; color: var(--purple-400);
      white-space: nowrap; font-variant-numeric: tabular-nums;
      flex-shrink: 0;
    }
    .caption-time-wrap {
      display: flex; flex-direction: column; gap: 3px; flex-shrink: 0;
    }
    .caption-time-row {
      display: flex; align-items: center; gap: 3px;
      font-size: 0.68rem; color: var(--purple-400);
    }
    .caption-time-row label { white-space: nowrap; display: inline-flex; align-items: center; }
    .caption-time-row label svg { display: block; }
    /* Admin role marker (was ★) */
    .admin-star { color: var(--olive); margin-inline-start: 5px; display: inline-flex; vertical-align: -0.08em; }
    .caption-time-input {
      width: 68px; border: 1.5px solid var(--purple-100); border-radius: 5px;
      padding: 2px 5px; font-size: 0.7rem; font-variant-numeric: tabular-nums;
      text-align: center; color: var(--text); background: var(--white);
      font-family: inherit;
    }
    .caption-time-input:focus { outline: none; border-color: var(--purple-600); }
    .caption-input {
      flex: 1; border: 1.5px solid var(--purple-100); border-radius: 8px;
      padding: 5px 10px; font-size: 0.85rem; direction: rtl;
      font-family: inherit; color: var(--text); background: var(--white);
    }
    .caption-input:focus { outline: none; border-color: var(--purple-600); }
    .caption-actions {
      display: flex; flex-direction: column; gap: 3px; flex-shrink: 0;
    }
    .cap-btn {
      width: 24px; height: 24px; border-radius: 5px; border: 1.5px solid var(--purple-200);
      background: var(--white); color: var(--purple-600); font-size: 0.8rem;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      line-height: 1; padding: 0; transition: background .15s, border-color .15s;
    }
    .cap-btn:hover:not(:disabled) { background: var(--purple-50); border-color: var(--purple-400); }
    .cap-btn:disabled { opacity: 0.3; cursor: default; }
    .cap-btn-split { font-size: 0.75rem; }
    .captions-list { max-height: 420px; overflow-y: auto; }

    /* Caption preview */
    .preview-row { display: flex; gap: 10px; align-items: stretch; justify-content: center; margin-bottom: 14px; }
    .preview-wrapper {
      position: relative; background: #000; border-radius: 8px; overflow: hidden;
      height: 220px; aspect-ratio: 9/16; flex-shrink: 0;
    }
    #previewCanvas { width: 100%; height: 100%; display: block; object-fit: contain; }
    .preview-caption {
      position: absolute; bottom: 8%; left: 50%; transform: translateX(-50%);
      color: #fff; text-shadow: 0 0 6px #000, 0 0 3px #000;
      font-size: clamp(10px, 2.5vw, 18px); font-weight: 700;
      white-space: nowrap; pointer-events: none;
      transition: bottom 0.05s;
    }
    .preview-sliders-col {
      display: flex; flex-direction: column; gap: 8px; align-items: center;
      flex-shrink: 0; min-width: 54px;
    }
    .pos-title {
      font-size: 0.62rem; font-weight: 700; letter-spacing: 0.05em;
      text-transform: uppercase; color: var(--purple-400); line-height: 1;
      user-select: none;
    }
    .pos-col {
      display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1;
    }
    .pos-lbl {
      color: var(--purple-400); line-height: 1; user-select: none; display: flex;
    }
    .pos-lbl svg { width: 20px; height: 20px; display: block; }
    /* Position rail + size slider share ONE look: a 6px rounded --purple-100
       track with an 18px --purple-600 circular thumb (see the size slider
       below) so the horizontal + vertical controls read as symmetric siblings. */
    .pos-track {
      width: 6px; border-radius: 3px; background: var(--purple-100);
      position: relative; cursor: pointer; flex: 1;
    }
    .pos-thumb {
      width: 18px; height: 18px; border-radius: 50%;
      background: var(--purple-600); position: absolute;
      left: 50%; transform: translate(-50%, -50%);
      box-shadow: 0 1px 4px rgba(0,0,0,0.25); cursor: grab;
      transition: box-shadow 0.1s;
    }
    .pos-thumb:active { cursor: grabbing; box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
    /* Font-size slider - horizontal, sits under the font selector. Fully
       custom-styled (not the native range) so its track + thumb match the
       vertical position rail exactly on every browser. */
    .size-controls { margin-top: 10px; }
    .size-controls input[type=range] {
      flex: 1; min-width: 0; cursor: pointer; margin: 0;
      -webkit-appearance: none; appearance: none;
      height: 18px; background: transparent;
    }
    .size-controls input[type=range]::-webkit-slider-runnable-track {
      height: 6px; border-radius: 3px; background: var(--purple-100);
    }
    .size-controls input[type=range]::-webkit-slider-thumb {
      -webkit-appearance: none; appearance: none;
      width: 18px; height: 18px; border-radius: 50%; border: none;
      background: var(--purple-600); margin-top: -6px;
      box-shadow: 0 1px 4px rgba(0,0,0,0.25); cursor: grab;
      transition: box-shadow 0.1s;
    }
    .size-controls input[type=range]:active::-webkit-slider-thumb {
      cursor: grabbing; box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    }
    .size-controls input[type=range]::-moz-range-track {
      height: 6px; border-radius: 3px; background: var(--purple-100);
    }
    .size-controls input[type=range]::-moz-range-thumb {
      width: 18px; height: 18px; border-radius: 50%; border: none;
      background: var(--purple-600);
      box-shadow: 0 1px 4px rgba(0,0,0,0.25); cursor: grab;
    }
    .fs-lbl { color: var(--purple-500); font-weight: 700; line-height: 1; user-select: none; }
    .fs-lbl-sm { font-size: 0.72rem; }
    .fs-lbl-lg { font-size: 1.1rem; }
    /* Caption video player */
    .player-outer { margin-bottom: 16px; }
    .player-wrap {
      position: relative; background: #000; border-radius: 10px; overflow: hidden;
      flex-shrink: 0; cursor: pointer; align-self: flex-start;
      /* Portrait default so the box has a real height BEFORE the video's
         metadata loads - otherwise the absolutely-positioned children (incl.
         the "Preview loading" spinner) collapse to a zero-height, invisible
         box. JS overrides width + aspect-ratio per the true orientation on
         'loadedmetadata'. */
      width: min(260px, 72vw); aspect-ratio: 9 / 16;
    }
    #cutVideo {
      position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    }
    /* Exact libass-rendered still, overlaid on the paused frame (WYSIWYG). Same
       object-fit/box as the video so the crop is identical. */
    #exactCap {
      position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
      display: none; pointer-events: none; z-index: 2;
    }
    #playerCap {
      position: absolute; left: 50%; transform: translateX(-50%);
      max-width: 92%; color: #fff; font-weight: 700; text-align: center;
      white-space: pre; word-break: normal; pointer-events: none; line-height: 1.35;
      -webkit-text-stroke: 0.5px rgba(0,0,0,0.85);
      text-shadow: 2px 2px 0 rgba(0,0,0,0.75);
    }
    #playerBigPlay {
      position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
      color: rgba(255,255,255,0.92); pointer-events: none; transition: opacity 0.15s;
    }
    #playerBigPlay svg { width: 58px; height: 58px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35)); }
    .player-loading {
      position: absolute; inset: 0; display: flex; flex-direction: column;
      align-items: center; justify-content: center; gap: 10px;
      color: rgba(255,255,255,0.9); font-size: 0.85rem; font-weight: 500;
      pointer-events: none; background: rgba(0,0,0,0.35); text-align: center;
    }
    .player-spinner {
      width: 30px; height: 30px; border-radius: 50%;
      border: 2.5px solid rgba(255,255,255,0.25);
      border-top-color: rgba(255,255,255,0.9);
      animation: player-spin 0.8s linear infinite;
    }
    @keyframes player-spin { to { transform: rotate(360deg); } }
    .player-controls {
      display: flex; align-items: center; gap: 8px;
      margin-top: 8px; padding: 0 4px;
    }
    .player-btn {
      background: none; border: none; cursor: pointer;
      color: var(--purple-700); padding: 2px 4px; flex-shrink: 0;
      display: inline-flex; align-items: center;
    }
    .player-btn svg { width: 20px; height: 20px; display: block; }
    .player-btn .ic-pause { display: none; }
    .player-btn.is-playing .ic-play  { display: none; }
    .player-btn.is-playing .ic-pause { display: block; }
    .player-prog-wrap {
      flex: 1; height: 20px; cursor: pointer; position: relative;
      display: flex; align-items: center;
      /* A video timeline is inherently left-to-right (0:00 → end), like the
         time labels. Force LTR so the fill (width%), the thumb (left%) and the
         click-to-seek math all agree - in RTL they landed on opposite sides. */
      direction: ltr;
    }
    .player-prog-track {
      position: absolute; left: 0; right: 0; height: 5px;
      background: var(--purple-100); border-radius: 3px; overflow: hidden;
    }
    .player-prog-fill {
      height: 100%; background: var(--purple-500);
      border-radius: 3px; width: 0%; pointer-events: none;
    }
    .player-prog-thumb {
      position: absolute; width: 12px; height: 12px;
      background: var(--purple-600); border-radius: 50%;
      top: 50%; transform: translate(-50%, -50%);
      pointer-events: none; left: 0%;
      box-shadow: 0 1px 3px rgba(0,0,0,.3);
    }
    .player-time-lbl {
      font-size: 0.7rem; color: var(--muted); white-space: nowrap;
      font-variant-numeric: tabular-nums; flex-shrink: 0;
    }
    .cap-hint-row {
      display: flex; align-items: center; justify-content: space-between;
      gap: 10px; margin: 10px 0 4px;
    }
    .cap-undo-btn {
      display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
      background: none; border: 1.5px solid var(--purple-200); color: var(--purple-700);
      border-radius: 8px; padding: 5px 12px; font-size: 0.76rem; font-weight: 600;
      cursor: pointer; font-family: inherit;
      transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    }
    .cap-undo-btn:hover:not(:disabled) { background: var(--purple-50); border-color: var(--purple-300); }
    .cap-undo-btn:disabled { opacity: 0.4; cursor: not-allowed; }
    .caption-row { cursor: pointer; }
    .caption-row-active   { background: var(--purple-50)  !important; border-radius: 6px; }
    .caption-row-selected { background: var(--purple-100) !important; border-radius: 6px; outline: 1.5px solid var(--purple-300); outline-offset: -1px; }
    .caption-row-selected .caption-input { border-color: var(--purple-400); }
    .caption-time-input[data-seek] { cursor: pointer; }
    .caption-time-input[data-seek]:hover { border-color: var(--purple-400); }
    .caption-time-input.time-invalid { border-color: var(--red) !important; background: #F5E7DC; }
    .caption-time-input.time-invalid:focus { border-color: #dc2626 !important; }
    .caption-controls {
      display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
    }
    .ctrl-label { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
    .font-select {
      flex: 1; border: 1.5px solid var(--purple-100); border-radius: 8px;
      padding: 5px 10px; font-size: 0.85rem; color: var(--text);
      background: var(--white); cursor: pointer;
    }
    .font-select:focus { outline: none; border-color: var(--purple-600); }

    /* ── Collapsible card sections ── */
    .card-header {
      display: flex; align-items: center; justify-content: space-between;
      cursor: pointer; user-select: none;
    }
    .card-header .options-title { margin-bottom: 0; }
    .collapse-chevron {
      font-size: 1.1rem; color: var(--purple-400); font-style: normal;
      transition: transform 0.2s; flex-shrink: 0;
    }
    .collapse-chevron svg { width: 1.05em; height: 1.05em; display: block; }
    .card-header.collapsed .collapse-chevron { transform: rotate(-90deg); }

    /* ── Footer ── */
    .footer {
      text-align: center; color: var(--purple-400);
      font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 8px;
    }
    .footer-contact {
      color: var(--purple-500); text-decoration: none; font-weight: 700;
      border: 2px solid var(--purple-400); border-radius: 999px; background: var(--white);
      padding: 7px 16px; display: inline-block; transition: color 0.15s, border-color 0.15s;
    }
    .footer-contact:hover { color: var(--purple-700); border-color: var(--purple-700); }
    .footer-contact + .footer-contact { margin-inline-start: 10px; margin-top: 6px; }

    /* ── Schedule card ── */
    .sched-intro { font-size: 0.82rem; color: var(--muted); line-height: 1.5; margin-bottom: 16px; }
    .sched-intro b { color: var(--purple-700); }
    .sched-label {
      display: block; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
      font-weight: 700; color: var(--purple-500); margin: 16px 0 8px;
    }
    .sched-label:first-of-type { margin-top: 0; }
    .sched-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
    .platform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .platform-opt {
      display: flex; align-items: center; gap: 8px; cursor: pointer;
      border: 1.5px solid var(--purple-100); border-radius: 12px; padding: 10px 12px;
      font-size: 0.9rem; font-weight: 600; color: var(--text); transition: border-color 0.15s, background 0.15s;
    }
    .platform-opt:hover { border-color: var(--purple-300); background: var(--purple-50); }
    .platform-opt input { accent-color: var(--purple-600); width: 16px; height: 16px; }
    .platform-opt:has(input:checked) { border-color: var(--purple-400); background: var(--purple-50); }
    .pf-badge {
      width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
      display: inline-flex; align-items: center; justify-content: center;
      font-size: 0.62rem; font-weight: 800; color: #fff;
    }
    .pf-badge.instagram { background: linear-gradient(135deg, #F58529, #DD2A7B 55%, #8134AF); }
    .pf-badge.facebook  { background: #1877F2; }
    .pf-badge.tiktok    { background: #111; }
    .pf-badge.youtube   { background: #FF0000; }
    .sched-datetime { display: flex; gap: 8px; }
    .sched-input {
      font-family: inherit; font-size: 0.9rem; color: var(--text);
      border: 1.5px solid var(--purple-100); border-radius: 10px; padding: 10px 12px;
      background: var(--white); outline: none; width: 100%; transition: border-color 0.15s;
    }
    .sched-input:focus { border-color: var(--purple-400); }
    .sched-datetime .sched-input { flex: 1; }
    .sched-caption {
      font-family: inherit; font-size: 0.9rem; color: var(--text); line-height: 1.55;
      border: 1.5px solid var(--purple-100); border-radius: 12px; padding: 12px 14px;
      background: var(--white); outline: none; width: 100%; resize: vertical; direction: rtl;
    }
    .sched-caption:focus { border-color: var(--purple-400); }
    .yt-fields { margin-top: 4px; }
    .yt-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
    .yt-row .sched-input { flex: 1; }
    .yt-kids { display: flex; align-items: center; gap: 7px; font-size: 0.85rem; color: var(--text); white-space: nowrap; cursor: pointer; }
    .yt-kids input { accent-color: var(--purple-600); width: 16px; height: 16px; }
    .sched-error {
      margin-top: 12px; color: var(--red); font-size: 0.82rem; text-align: center;
      padding: 10px 12px; background: #F5E7DC; border: 1.5px solid #E3C2A8; border-radius: 10px;
    }
    .sched-connect-note { font-size: 0.82rem; color: var(--muted); line-height: 1.5; margin-bottom: 10px; text-align: center; }
    .sched-status {
      margin-top: 12px; font-size: 0.85rem; text-align: center; line-height: 1.5;
      padding: 12px 14px; border-radius: 12px;
    }
    .sched-status.ok   { color: var(--green); background: #E4E7D8; border: 1.5px solid #A3B196; }
    .sched-status.busy { color: var(--purple-700); background: var(--purple-50); border: 1.5px solid var(--purple-200); }
    .sched-status a { color: var(--purple-700); font-weight: 700; }

    /* ── Tab bar ── */
    .tabs {
      max-width: 560px;
      margin: 0 auto;
      padding: 16px 16px 0;
      display: flex;
      gap: 8px;
    }
    .tab {
      flex: 1;
      appearance: none;
      border: 2px solid var(--line);
      background: var(--white);
      color: var(--muted);
      font-family: 'Assistant', sans-serif;
      font-size: 0.92rem;
      font-weight: 600;
      padding: 12px 14px;
      border-radius: 14px 14px 0 0;
      cursor: pointer;
      transition: color 0.15s, background 0.15s, border-color 0.15s;
      border-bottom: none;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .tab:hover { color: var(--purple-700); background: var(--purple-50); }
    /* Selected tab: the whole tab gets a bold terracotta border. */
    .tab.active {
      color: var(--purple-800);
      background: var(--white);
      border-color: var(--terracotta);
      font-weight: 700;
      box-shadow: 0 -3px 12px rgba(62, 58, 52, 0.08);
    }

    /* ── Mobile ── */
    @media (max-width: 480px) {
      .hero { height: 180px; }
      .hero-overlay { padding: 0 24px; }
      .container { padding: 20px 12px 48px; }
      .card { padding: 18px; border-radius: 16px; }
      .tabs { padding: 12px 12px 0; }
    }

/* ── Guide tab ── */
.guide-intro {
  font-size: 0.9rem; color: var(--muted); line-height: 1.55;
  margin: 12px 0 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
/* ── Guide: search + collapsible sections with screenshots ── */
.guide-search-wrap { position: relative; margin: 14px 0 8px; }
.guide-search-icon { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.guide-search {
  width: 100%; box-sizing: border-box; padding: 11px 14px; padding-inline-start: 42px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--white);
  font-family: 'Assistant', sans-serif; font-size: 0.92rem; color: var(--text);
}
.guide-search:focus { outline: none; border-color: var(--purple-400); }
.guide-noresults { font-size: 0.88rem; color: var(--muted); text-align: center; padding: 12px 0 4px; }

/* Floats at top-center over the guide while scrolling (top set in JS to sit
   just below the sticky bar). Terracotta so it stands apart from the content. */
.guide-backbar { position: fixed; left: 50%; transform: translateX(-50%); z-index: 45; margin: 0; }
.guide-back-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--terracotta-dark); background: var(--terracotta);
  color: var(--white); font-family: 'Assistant', sans-serif; font-size: 0.85rem; font-weight: 700;
  box-shadow: 0 8px 20px -6px rgba(62, 58, 52, 0.45);
}
.guide-back-btn:hover { background: var(--terracotta-dark); }
[dir="rtl"] .guide-back-btn svg { transform: scaleX(-1); }

.guide-secs { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.guide-sec { border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--white); scroll-margin-top: 16px; }
.guide-sec-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border: none; background: none; cursor: pointer; text-align: start;
  font-family: 'Frank Ruhl Libre', serif; font-weight: 500; font-size: 1.02rem; color: var(--forest);
}
.guide-sec-head .collapse-chevron { transition: transform .2s; flex-shrink: 0; color: var(--muted); }
.guide-sec:not(.open) .guide-sec-head .collapse-chevron { transform: rotate(-90deg); }
.guide-sec-body { display: none; padding: 0 16px 18px; }
.guide-sec.open .guide-sec-body { display: block; }
.guide-sec.gsec-flash { border-color: var(--terracotta); box-shadow: 0 0 0 3px color-mix(in srgb, var(--terracotta) 20%, transparent); }
.guide-shot {
  display: block; width: 100%; max-width: 330px; height: auto; margin: 2px auto 14px;
  border-radius: 12px; border: 1px solid var(--line);
}
.guide-sec-text { font-size: 0.9rem; color: var(--text); line-height: 1.6; }
.guide-sec-text ul { margin: 8px 0; padding-inline-start: 20px; }
.guide-sec-text li { margin: 5px 0; }
.guide-sec-text b, .guide-sec-text strong { color: var(--forest); font-weight: 600; }

/* Small "i" info button in app card headers → jumps to the guide */
.info-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex-shrink: 0; margin-inline-start: 8px;
  border-radius: 50%; border: 1.5px solid var(--purple-300); background: none;
  color: var(--purple-600); cursor: pointer; padding: 0;
}
.info-dot:hover { background: var(--purple-50); }
.info-dot svg { width: 13px; height: 13px; }

/* Hook rationale shown as a clearly-marked tip */
.hook-tip {
  font-size: 0.8rem; color: var(--text); line-height: 1.5; margin: 8px 0 0;
  padding: 7px 11px; border-radius: 9px; pointer-events: none;
  background: var(--purple-50); border-inline-start: 2px solid var(--purple-400);
}
.hook-tip-label { font-weight: 700; color: var(--purple-700); }

/* ── History tab ── */
.history-note {
  font-size: 0.82rem; color: var(--text); margin-bottom: 16px; line-height: 1.5;
  padding: 10px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--terracotta) 10%, transparent);
  border-inline-start: 3px solid var(--terracotta);
}
.history-loading, .history-empty { font-size: 0.9rem; color: var(--muted); text-align: center; padding: 24px 0; }
.history-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 14px;
  border: 1.5px solid var(--purple-100, #EDE9FE);
  margin-bottom: 10px; background: var(--white);
}
.history-thumb {
  width: 64px; height: 64px; object-fit: cover; border-radius: 10px;
  background: var(--purple-50); flex-shrink: 0;
}
.history-thumb-audio {
  display: flex; align-items: center; justify-content: center;
  color: var(--olive); background: var(--purple-100);
}
.history-info { flex: 1; min-width: 0; }
.history-name {
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Filenames are Latin - force LTR so the ellipsis cuts the tail (the uuid
   suffix), not the meaningful stem, when the page is RTL. */
[dir="rtl"] .history-name { direction: ltr; text-align: right; }
.history-meta { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.history-actions { display: flex; gap: 6px; flex-shrink: 0; }
.history-btn {
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--white);
  color: var(--olive); display: inline-flex; align-items: center; justify-content: center;
}
.history-btn svg { display: block; }
.history-btn:hover { background: var(--purple-50); }
.history-btn-danger { color: var(--terracotta); }
.history-btn-danger:hover { background: #F5E7DC; border-color: #E3C2A8; }

/* Cards greyed out while another operation is in flight */
.action-locked { pointer-events: none; opacity: 0.5; transition: opacity 0.15s; }

/* ── Micro-interactions (generic redesign) ── */
.run-btn:active:not(:disabled),
.action-btn:active:not(:disabled),
.download-btn:active,
.reprocess-btn:active:not(:disabled),
.retry-btn:active,
.history-btn:active,
.start-over-btn:active,
.modal-ok-btn:active,
.modal-cancel-btn:active,
.tab:active { transform: scale(0.97); }
.action-btn, .retry-btn, .history-btn, .start-over-btn,
.modal-ok-btn, .modal-cancel-btn, .tab { transition-property: background, border-color, color, opacity, transform; transition-duration: 0.15s; }

.card { transition: box-shadow 0.25s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Language toggle (hero corner, visible on every view) ── */
.lang-toggle {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 5;
  appearance: none;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--purple-700);
  font-family: 'Assistant', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.lang-toggle:hover:not(:disabled) { background: var(--purple-50); border-color: var(--purple-300); }
.lang-toggle:active:not(:disabled) { transform: scale(0.95); }
.lang-toggle:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── RTL (Hebrew) mirroring ── */
[dir="rtl"] .toggle-thumb { left: auto; right: 3px; }
[dir="rtl"] .toggle input:checked ~ .toggle-thumb { transform: translateX(-20px); }
[dir="rtl"] .card-header.collapsed .collapse-chevron { transform: rotate(90deg); }

/* Numeric/time labels stay LTR so "12 MB · 1:23" reads correctly in Hebrew */
[dir="rtl"] .check-time,
[dir="rtl"] .done-time,
[dir="rtl"] .player-time-lbl,
[dir="rtl"] .slider-val,
[dir="rtl"] .file-info-detail,
[dir="rtl"] .history-meta,
[dir="rtl"] .upload-bar-pct { direction: ltr; unicode-bidi: isolate; }


/* ── Quota pill + admin view ── */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 18px -14px rgba(62, 58, 52, 0.35);
}
.quota-pill-row { max-width: 560px; margin: 0 auto; text-align: center; }

.quota-pill {
  display: inline-block;
  margin: 8px 0;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--purple-100);
  color: var(--purple-800);
  font-size: 0.8rem;
  font-weight: 700;
}
.quota-pill-empty { background: #FEE2E2; color: #B85C38; }

.mc-chip {
  display: inline-block; margin: 8px 8px 8px 0;
  padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid var(--purple-200); background: var(--white);
  color: var(--purple-700); font-size: 0.78rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.mc-chip:hover { background: var(--purple-50); }
.mc-chip.connected { background: #E4E7D8; border-color: #A3B196; color: #6E7F5C; cursor: pointer; }
.mc-chip.connected:hover { background: #F5E7DC; border-color: #E3C2A8; color: #B85C38; }
/* Disconnect affordance stays hidden until hover; the space is reserved so
   the chip never jumps. Tapping always opens the confirm modal anyway. */
.mc-chip.connected::after { content: " \2715"; opacity: 0; }
.mc-chip.connected:hover::after { opacity: 1; }

.logout-btn {
  display: inline-block; margin-inline-start: 8px; padding: 6px 12px;
  border-radius: 999px; border: 1.5px solid var(--purple-100);
  background: var(--white); font-size: 0.85rem; cursor: pointer; font-family: inherit;
}
.logout-btn:hover { background: #F5E7DC; border-color: #E3C2A8; }

.admin-row {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 0; border-bottom: 1px solid var(--purple-100);
}
.admin-row:last-child { border-bottom: none; }
/* Header: email grows and truncates; usage count sits at the trailing edge. */
.admin-header { display: flex; align-items: baseline; gap: 12px; }
.admin-name {
  flex: 1 1 auto; min-width: 0;
  font-size: 0.92rem; font-weight: 600; direction: ltr; text-align: start;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-used { flex: 0 0 auto; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
/* Controls: uniform-height pills that wrap together, never a lone stranded item. */
.admin-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.admin-controls > * { height: 38px; box-sizing: border-box; }
.admin-limit-input {
  width: 68px; padding: 0 8px; border: 1.5px solid var(--purple-100); border-radius: 9px;
  font-family: inherit; font-size: 0.85rem; outline: none; direction: ltr; text-align: center;
}
.admin-limit-input:focus { border-color: var(--purple-400); }
.admin-save-btn {
  padding: 0 16px; border-radius: 9px; border: none; cursor: pointer;
  background: var(--olive); color: #F7F0E6; font-size: 0.82rem; font-weight: 600; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.admin-save-btn:disabled { opacity: 0.6; }
.admin-reset-btn {
  padding: 0 14px; border-radius: 9px; cursor: pointer;
  border: 1.5px solid var(--purple-100); background: transparent; color: var(--terracotta);
  font-size: 0.82rem; font-weight: 600; font-family: inherit; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
}
.admin-pw-input {
  flex: 1 1 140px; min-width: 120px; padding: 0 10px; border: 1.5px solid var(--purple-100); border-radius: 9px;
  font-family: inherit; font-size: 0.85rem; outline: none; direction: ltr;
}
.admin-pw-input:focus { border-color: var(--purple-400); }
.admin-cancel-btn {
  padding: 7px 12px; border-radius: 9px; cursor: pointer;
  border: 1.5px solid var(--purple-100); background: transparent; color: var(--muted);
  font-size: 0.8rem; font-weight: 600; font-family: inherit;
}

    /* ── Boho decorative background (blobs + wandering contour) ── */
    .boho-bg {
      position: fixed; inset: 0; z-index: 0;
      pointer-events: none; overflow: hidden;
    }
    /* Keep in-flow content above the decoration. Fixed overlays (.modal-overlay
       z-index:900, #reconnectBanner) already sit above it via their own
       positioning - do NOT set position:relative on them or it clobbers their
       position:fixed and drops them into normal flow. NOTE: .app-topbar is
       deliberately excluded - it needs position:sticky (see its own rule), and
       its z-index:40 already lifts it above the decoration; adding it here would
       clobber the sticky with position:relative and it would scroll away. */
    .hero, .container, #verifyBanner, .boot-loader {
      position: relative; z-index: 1;
    }
    .boho-blob {
      position: fixed; width: 60vw; max-width: 460px; height: auto; aspect-ratio: 1;
      filter: blur(8px);
    }
    .boho-blob path { }
    .boho-blob-1 path { fill: var(--sage); }
    .boho-blob-1 { inset-block-start: -12vh; inset-inline-start: -18vw; opacity: 0.16; }
    .boho-blob-2 path { fill: var(--terracotta); }
    .boho-blob-2 { inset-block-end: -14vh; inset-inline-end: -16vw; opacity: 0.10; width: 55vw; }
    /* Mirror the contour so it "flows" naturally in RTL */

    /* ── Scroll-grown monstera vine (subtle, behind content) ── */
    .vine-svg{
      position:fixed; inset-block:0; inset-inline-start:0;
      width:min(230px,44vw); height:100vh; z-index:0;
      pointer-events:none; overflow:visible; opacity:.5;
    }
    #vine{ fill:none; stroke:var(--terracotta); stroke-width:2.4; stroke-linecap:round; opacity:.85; }
    /* NOTE: plain class selectors (not descendant) - these style the cloned
       content inside <use>, which browsers do NOT reach via `.vine-svg .x`. */
    .leaf-body{ fill:rgba(60,107,69,0.20); stroke:var(--forest); stroke-width:2; stroke-linejoin:round; }
    .leaf-vein{ fill:none; stroke:var(--forest); stroke-width:1; stroke-linecap:round; opacity:.55; }
    .petiole{ fill:none; stroke:var(--forest); stroke-width:2; stroke-linecap:round; }
    @media (prefers-reduced-motion: reduce){ .vine-svg{ display:none; } }
