@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0a0a0b;
  --panel: #151518;
  --panel-2: #1d1d21;
  --line: #2c2c32;
  --text: #f4f4f2;
  --muted: #a4a4ad;
  --accent: #d4ff3a;
  --accent-2: #d4ff3a;
  --active: #242b18;
  --danger: #ff8490;
  color-scheme: dark;
}
body { background: var(--bg); color: var(--text); font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, .dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.topbar { min-height: 64px; background: #101012; border-color: var(--line); padding-inline: 28px; }
.plan-quick { display: none; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid #465428; border-radius: 999px; color: var(--text); background: #202716; text-decoration: none; white-space: nowrap; font-size: 12px; }
.topbar.editor-mode .plan-quick { display: inline-flex; }
.plan-quick span { color: #c6dc93; }
.plan-quick strong { color: var(--accent); font-weight: 700; }
.plan-quick.low { border-color: #876037; background: #2a2118; }
.plan-quick.low strong { color: #ffd192; }
.quota-note { margin: 0; color: var(--muted); font-size: 12px; }
.quota-note.warning { color: #ffd192; }
.brand { font: 700 17px/1 'Inter Tight', sans-serif; letter-spacing: -.02em; }
.logo, .logo.big { flex: none; width: 26px; height: 26px; border: 0; border-radius: 0; background: url('/assets/subtitle-studio-mark.svg') center / contain no-repeat; color: transparent; font-size: 0; box-shadow: none; }
.logo.big { width: 52px; height: 52px; }
.project-name { border-radius: 7px; }
.btn { border-radius: 999px; background: #19191c; color: var(--text); }
.btn:hover { border-color: #4b4b51; background: #252529; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0a0a0b; }
.btn.primary:hover { background: #e0ff69; border-color: #e0ff69; }
.btn.ghost { background: transparent; }
.btn.tiny { border-radius: 999px; }
input[type="number"], select, textarea { background: #111113; border-color: #39393f; color: var(--text); }
input[type="range"], input[type="checkbox"] { accent-color: var(--accent); }

/* ---------- home: compact header, upload + plan row, project grid */
.new-video-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; font-weight: 700; }
.new-video-btn span { font-size: 18px; line-height: 1; }
.topbar.editor-mode .new-video-btn { display: none; }
.home { position: relative; max-width: 1280px; padding: 40px 36px 90px; }
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.home-head h1 { margin: 0; font: 700 32px/1.1 'Inter Tight', sans-serif; letter-spacing: -.035em; }
.home-summary { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

.home-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }
.dropzone { position: relative; min-height: 0; display: flex; flex-direction: row; align-items: center; gap: 18px; padding: 24px 26px; text-align: left; border: 1.5px dashed #37373d; border-radius: 18px; background: #121214; cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; }
.dropzone::before { content: none; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: #161a10; }
.drop-icon { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: rgba(212,255,58,.1); border: 1px solid rgba(212,255,58,.25); color: var(--accent); font-size: 0; }
.drop-copy { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.drop-title { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.drop-title u { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.drop-sub { color: var(--muted); font-size: 13px; }
.progress > * { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .3s; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Upload in progress: the dropzone turns into a live upload card */
.dropzone.uploading { cursor: default; border-style: solid; border-color: rgba(212,255,58,.35); background: radial-gradient(120% 140% at 0% 0%, rgba(212,255,58,.09), transparent 55%), #121214; }
.dropzone.uploading > .drop-icon, .dropzone.uploading > .drop-copy, .dropzone.uploading > .drop-cta { display: none; }
.dropzone.uploading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(212,255,58,.07) 50%, transparent 70%); background-size: 250% 100%; animation: up-sweep 2.4s linear infinite; pointer-events: none; }
.up-card { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; width: 100%; min-width: 0; }
.up-card.hidden { display: none; }
.up-ring { position: relative; flex: none; width: 60px; height: 60px; display: grid; place-items: center; }
.up-ring svg:first-child { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.up-ring circle { fill: none; stroke-width: 5; }
.up-ring-bg { stroke: #26262b; }
.up-ring-fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 0)); transition: stroke-dashoffset .35s ease; }
.up-ring b { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.up-check { display: none; width: 26px; height: 26px; color: #0a0a0b; }
.up-body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.up-top { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.up-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.up-state { flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.up-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: up-blink 1.1s ease-in-out infinite; }
.up-wave { position: relative; display: block; height: 30px; }
.up-bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 3px; }
.up-bars i { flex: 1; min-width: 2px; height: var(--h); border-radius: 2px; background: #2c2c32; }
.up-bars-fill { clip-path: inset(0 calc(100% - var(--p, 0) * 1%) 0 0); transition: clip-path .35s ease; }
.up-bars-fill i { background: var(--accent); animation: up-bar 1.2s ease-in-out infinite; animation-delay: var(--d); transform-origin: center; }
.up-head { position: absolute; top: -3px; bottom: -3px; left: calc(var(--p, 0) * 1%); width: 2px; margin-left: -1px; border-radius: 2px; background: #fff; box-shadow: 0 0 10px rgba(212,255,58,.9); transition: left .35s ease; }
.up-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.up-meta span:empty { display: none; }
.up-meta span + span::before { content: "·"; margin-right: 14px; color: #4a4a52; }
.up-cancel { flex: none; padding: 9px 15px; border: 1px solid #3a3a40; border-radius: 999px; background: #1b1b1f; color: #e4e4e8; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.up-cancel:hover { border-color: #ff6b6b; color: #ff8a8a; }
/* after 100%: the server is saving the video */
.up-card.processing .up-ring svg:first-child { animation: up-spin 1s linear infinite; }
.up-card.processing .up-ring-fill { stroke-dashoffset: 72; }
.up-card.processing .up-head { display: none; }
.up-card.processing .up-bars-fill i { animation-duration: .7s; }
.up-card.done .up-ring { border-radius: 50%; background: var(--accent); animation: up-pop .35s cubic-bezier(.2,1.6,.4,1); }
.up-card.done .up-ring svg:first-child, .up-card.done .up-ring b { display: none; }
.up-card.done .up-check { display: block; }
.up-card.done .up-state::before, .up-card.failed .up-state::before { animation: none; }
.up-card.done .up-cancel, .up-card.processing .up-cancel { display: none; }
.up-card.failed .up-state { color: #ff7a7a; }
.up-card.failed .up-ring-fill { stroke: #ff6b6b; }
.up-card.failed .up-bars-fill i { background: #ff6b6b; animation: none; }
.up-card.failed .up-head { display: none; }
.up-card.failed .up-cancel { border-color: var(--accent); background: var(--accent); color: #0a0a0b; }
.dropzone.failed::after { display: none; }
@keyframes up-sweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@keyframes up-bar { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.55); } }
@keyframes up-blink { 50% { opacity: .25; } }
@keyframes up-spin { to { transform: rotate(270deg); } }
@keyframes up-pop { from { transform: scale(.7); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .dropzone.uploading::after, .up-bars-fill i, .up-state::before, .up-card.processing .up-ring svg:first-child, .up-card.done .up-ring { animation: none; }
  .up-ring-fill, .up-bars-fill, .up-head { transition: none; }
}
@media (max-width: 600px) {
  .up-card { flex-wrap: wrap; gap: 12px 14px; }
  .up-ring { width: 52px; height: 52px; }
  .up-body { flex-basis: calc(100% - 66px); }
  .up-cancel { width: 100%; }
}
.drop-cta { flex: none; padding: 10px 16px; border: 1px solid #3a3a40; border-radius: 999px; background: #1b1b1f; font-size: 13px; font-weight: 600; transition: border-color .15s; }
.dropzone:hover .drop-cta { border-color: var(--accent); color: var(--accent); }

.plan-card { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; background: #121214; }
.plan-card-head { display: flex; align-items: center; gap: 8px; }
.plan-card-label { color: var(--muted); font-size: 13px; }
.plan-badge { padding: 3px 9px; border-radius: 999px; background: rgba(212,255,58,.12); color: var(--accent); font-size: 12px; font-weight: 700; }
.plan-card-link { margin-left: auto; color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; }
.plan-card-link:hover { color: var(--accent); }
.plan-left { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.plan-left strong { color: var(--text); font-size: 26px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan-bar { height: 6px; border-radius: 6px; background: #26262b; overflow: hidden; }
.plan-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .5s ease; }
.plan-card.low .plan-bar span { background: #ffb547; }
.plan-card.low .plan-left strong { color: #ffd192; }
.plan-details { margin: 0; color: #7d7d85; font-size: 12px; }

.projects-section { margin-top: 40px; }
.projects-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; padding: 0; border: 0; }
.projects-heading h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; letter-spacing: -.02em; }
.project-count { padding: 2px 8px; border-radius: 999px; background: #1d1d21; color: var(--muted); font-size: 12px; font-weight: 600; }
.project-count:empty { display: none; }
.projects-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.project-filters { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #121214; }
.project-filters button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.project-filters button:hover { color: var(--text); }
.project-filters button[aria-selected="true"] { background: #25252a; color: var(--text); }
.project-filters button[data-count]:not([data-count=""])::after { content: attr(data-count); color: #6d6d75; font-size: 11px; }
.project-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #121214; color: #6d6d75; }
.project-search:focus-within { border-color: var(--accent); }
.project-search input { width: 180px; min-width: 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; outline: none; }

.project-list { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.project-card { position: relative; overflow: visible; border: 0; border-radius: 0; background: none; }
.project-card:hover, .project-card:focus-within { border: 0; }
.project-open { display: block; color: var(--text); text-decoration: none; border-radius: 14px; }
.project-thumbnail { aspect-ratio: 16 / 10; border-radius: 14px; border: 1px solid #1f1f23; background: #18181b; transition: border-color .15s, transform .2s; }
.project-thumbnail img { transition: transform .35s ease; }
.project-open:hover .project-thumbnail, .project-open:focus-visible .project-thumbnail { border-color: rgba(212,255,58,.6); }
.project-open:hover .project-thumbnail img { transform: scale(1.035); }
.project-thumbnail::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 30%, transparent 70%, rgba(0,0,0,.45)); pointer-events: none; }
.project-thumbnail .status-chip { position: absolute; z-index: 1; top: 10px; left: 10px; }
.project-duration { position: absolute; z-index: 1; right: 10px; bottom: 10px; padding: 3px 7px; border-radius: 6px; background: rgba(10,10,11,.75); color: #f4f4f2; font: 600 11px/1.2 'JetBrains Mono', monospace; }
.project-card-copy { display: grid; gap: 3px; padding: 12px 40px 0 2px; }
.project-card-name { font-size: 14px; font-weight: 650; }
.project-card-meta { color: #7d7d85; font-size: 12px; }
.project-delete { position: absolute; right: 0; top: calc(100% - 34px); width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: #6d6d75; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.project-card:hover .project-delete, .project-delete:focus-visible { opacity: 1; }
.project-delete:hover { background: #2d1d22; color: #ff9ca6; }
@media (hover: none) { .project-delete { opacity: 1; } }

.status-chip { gap: 6px; padding: 4px 9px 4px 8px; border: 0; border-radius: 999px; background: rgba(10,10,11,.78); backdrop-filter: blur(8px); color: #e4e4e7; font-size: 11px; font-weight: 700; }
.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-chip.status-ready { color: var(--accent); }
.status-chip.status-todo { color: #ffd192; }
.status-chip.status-busy { color: #8ab4ff; }
.status-chip.status-busy::before { animation: rec 1.2s ease-in-out infinite; }
.status-chip.status-error { border: 0; background: rgba(10,10,11,.78); color: #ff9ca6; }

.project-empty { padding: 56px 24px; border: 1px dashed #2f2f35; border-radius: 18px; background: #121214; }
.project-empty .empty-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 16px; background: rgba(212,255,58,.1); color: var(--accent); }
.project-empty h3 { font-size: 18px; letter-spacing: -.02em; }
.project-empty p { color: var(--muted); }
.project-skeleton { aspect-ratio: 16 / 13; border-radius: 14px; background: linear-gradient(110deg,#17171a 8%,#232327 18%,#17171a 33%); background-size: 220% 100%; }

.drop-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(10,10,11,.82); backdrop-filter: blur(6px); pointer-events: none; }
.drop-overlay > div { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(560px, 100%); padding: 56px 24px; border: 2px dashed var(--accent); border-radius: 24px; background: rgba(212,255,58,.06); text-align: center; }
.drop-overlay strong { font-size: 26px; letter-spacing: -.03em; }
.drop-overlay span { color: var(--muted); }

.panel, .style-scroll { background: #151518; }
.panel.left, .panel.right, .panel-head, .transcribe-box, .caption-tools { border-color: var(--line); }
.panel-head { font-size: 15px; }
.cap { border-radius: 8px; }
.cap:hover { background: #202024; }
.cap.active { background: #252b18; border-color: #667833; border-left: 2px solid var(--accent); }
.cap-time:hover, .icon-btn:hover, .cap-word:hover { color: var(--text); background: #30342a; }
.cap-word.on { color: #0a0a0b; background: var(--accent); }
.stage { background: #0a0a0b; }
.player-wrap { background: #0a0a0b; }
.transport, .waveform-wrap, .seek-row, .hint { background: #151518; border-color: var(--line); }
.transport .btn { background: #1d1d21; }
.transport .btn.ghost { background: transparent; }
.time, .speed-label, .waveform-wrap span, .hint { color: var(--muted); }
.style-group summary { color: var(--text); }
.style-group summary::after { color: var(--accent); }
.field > label, .field .two label, .field.two label { color: #c4c4ca; }
.preset:hover { border-color: var(--accent); }
.progress { background: #303035; }
.progress > div { background: var(--accent); }
.modal-card, .shortcuts-dialog { background: #1b1b1f; border-color: #414147; color: var(--text); }
.toast { background: #24282b; border-color: #4c5934; }
/* ---------- login: form on the left, live caption demo on the right */
body:has(#login:not(.hidden)) .topbar { display: none; }
.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; padding: 16px; place-items: stretch; min-height: 100vh; background: var(--bg); }
.login-side { display: flex; flex-direction: column; padding: 20px 24px; min-width: 0; }
.login-brand { display: inline-flex; align-items: center; gap: 10px; margin: 0; align-self: flex-start; color: var(--text); font-weight: 700; font-size: 16px; letter-spacing: -.01em; text-decoration: none; }
.login-mark { width: 28px; height: 28px; background: url('/assets/subtitle-studio-mark.svg') center / contain no-repeat; }
.login-card { width: min(380px, 100%); margin: auto; padding: 48px 0; background: none; border: 0; border-radius: 0; box-shadow: none; text-align: left; }
.login h1 { margin: 0; font-size: 36px; line-height: 1.05; font-weight: 700; letter-spacing: -.045em; }
.login-sub { margin: 12px 0 30px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.login-sub b { color: var(--text); font-weight: 600; word-break: break-all; }

.google-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 50px; border-radius: 12px; background: #f4f4f2; color: #0a0a0b; font-size: 15px; font-weight: 600; text-decoration: none; transition: background .15s, transform .15s, box-shadow .15s; }
.google-btn:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.google-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.google-btn svg { flex: none; }
.login-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: #6d6d75; font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login.code-step .login-google { display: none; }

.login-label { display: block; margin-bottom: 8px; color: #c4c4ca; font-size: 13px; font-weight: 500; }
.login-input { height: 50px; padding: 0 16px; border-radius: 12px; background: #111113; border: 1px solid #2f2f35; color: var(--text); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.login-input::placeholder { color: #5c5c64; }
.login-input:hover { border-color: #3f3f46; }
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(212,255,58,.12); }
.login-input.code { height: 64px; font: 600 28px/1 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .55em; text-indent: .55em; }
.login-btn { width: 100%; height: 50px; margin-top: 12px; padding: 0; border-radius: 12px; border: 1px solid #34343a; background: #1b1b1f; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.login-btn:hover { background: #242429; border-color: #45454c; }
.login-btn.primary { background: var(--accent); border-color: var(--accent); color: #0a0a0b; }
.login-btn.primary:hover { background: #e0ff69; border-color: #e0ff69; transform: translateY(-1px); }
.login-btn:disabled { opacity: .55; cursor: default; transform: none; }
.login-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.login-links { margin-top: 16px; }
.login .link-btn { color: #c4c4ca; font-size: 13px; }
.login .link-btn:hover:not(:disabled) { color: var(--accent); }
.login .link-btn:disabled { color: #5c5c64; }
.login-note { text-align: left; color: var(--muted); }
.login-error { margin-top: 14px; color: #ff8a7a; font-size: 13px; line-height: 1.45; min-height: 0; }
.login-error:empty { display: none; }
.login-legal { margin: 0; color: #6d6d75; font-size: 12px; line-height: 1.6; }
.login-legal a { color: #a4a4ad; text-decoration: underline; text-decoration-color: #3a3a40; text-underline-offset: 3px; }
.login-legal a:hover { color: var(--text); }

/* live caption demo */
.login-show { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 22px; padding: 28px; border-radius: 24px; overflow: hidden; isolation: isolate; border: 1px solid #1f1f23;
  background: linear-gradient(180deg, rgba(10,10,11,.1) 0%, rgba(10,10,11,.25) 40%, rgba(10,10,11,.92) 78%), url('/assets/cinematic-street.png') center 35% / cover, #121214; }
.login-show::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(700px 400px at 70% 110%, rgba(212,255,58,.14), transparent 70%); }
.show-frame { position: absolute; inset: 0 0 auto; height: 62%; }
.show-caption { position: absolute; left: 6%; right: 6%; bottom: 0; margin: 0; text-align: center; color: #fff; font-size: clamp(30px, 3.4vw, 52px); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; text-shadow: 0 4px 24px rgba(0,0,0,.55); }
.show-caption b { display: inline-block; padding: 0 .14em; border-radius: .16em; animation: word 4s infinite; }
.show-caption b:nth-child(2), .show-track i:nth-of-type(2) { animation-delay: 1s; }
.show-caption b:nth-child(3), .show-track i:nth-of-type(3) { animation-delay: 2s; }
.show-caption b:nth-child(4), .show-track i:nth-of-type(4) { animation-delay: 3s; }
.show-timeline { position: relative; padding: 14px 16px 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; background: rgba(14,14,16,.78); backdrop-filter: blur(14px); }
.show-ruler { display: flex; justify-content: space-between; margin-bottom: 10px; color: #6d6d75; font: 500 10px/1 'JetBrains Mono', ui-monospace, monospace; }
.show-track { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.show-track i { height: 34px; display: flex; align-items: center; padding: 0 10px; border-radius: 8px; background: #1d1d21; border: 1px solid #2c2c32; color: #a4a4ad; font: 600 12px/1 'Inter Tight', sans-serif; font-style: normal; overflow: hidden; white-space: nowrap; animation: clip 4s infinite; }
.show-track em { position: absolute; top: -8px; bottom: -4px; left: 0; width: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: playhead 4s linear infinite; }
.show-copy { display: flex; flex-direction: column; gap: 6px; }
.show-copy strong { font-size: 22px; letter-spacing: -.03em; }
.show-copy span { color: #a4a4ad; font-size: 14px; }
@keyframes word { 0%, 24% { background: var(--accent); color: #0a0a0b; text-shadow: none; } 25%, 100% { background: transparent; color: #fff; } }
@keyframes clip { 0%, 24% { background: rgba(212,255,58,.14); border-color: rgba(212,255,58,.6); color: var(--accent); } 25%, 100% { background: #1d1d21; border-color: #2c2c32; color: #a4a4ad; } }
@keyframes playhead { from { left: 0; } to { left: 100%; } }
@keyframes rec { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
  .show-caption b, .show-track i, .show-track em { animation: none; }
  .show-caption b:nth-child(3) { background: var(--accent); color: #0a0a0b; text-shadow: none; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; padding: 0; }
  .login-show { display: none; }
  .login-side { padding: 20px 16px 24px; }
  .login-card { padding: 40px 0; }
  .login h1 { font-size: 30px; }
}
.link-btn { color: var(--accent); }
.avatar { background: #202023; color: var(--text); }
.dropdown { background: #1c1c20; border-color: #3a3a40; }
.dropdown-item:hover { background: #2b3220; }

body.admin-page { background: var(--bg); }
.admin-mark, .admin-heading p { color: var(--accent); }
.admin-stats > div, .admin-section { background: #151518; border-color: var(--line); }
.admin-stats strong { color: var(--text); }
.admin-section th, .admin-section td { border-color: var(--line); }
.admin-heading span, .admin-stats span, .admin-stats small, .admin-section-head p, .admin-section th, .admin-section td.empty-row { color: var(--muted); }

body.landing-page { --bg:#0a0a0b; --panel:#151518; --panel-2:#1d1d21; --line:#2c2c32; --text:#f4f4f2; --muted:#a4a4ad; --accent:#d4ff3a; --accent-2:#d4ff3a; background:var(--bg); color:var(--text); color-scheme:dark; }
.landing-page .site-header { background: #0d0d0f; border-bottom: 1px solid var(--line); }
.landing-page .site-header .brand, .landing-page .site-footer .brand { font: 700 17px/1 'Inter Tight', sans-serif; letter-spacing: -.02em; }
.landing-page .site-header .logo, .landing-page .site-footer .logo { width: 26px; height: 26px; border-radius: 0; background: url('/assets/subtitle-studio-mark.svg') center / contain no-repeat; color: transparent; }
.landing-page .site-nav a, .landing-page .site-footer nav a { color: var(--muted); }
.landing-page .site-nav a:hover, .landing-page .site-footer nav a:hover { color: var(--text); }
.landing-page .nav-cta { padding: 10px 17px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent); color: #0a0a0b; }
.landing-page .nav-cta:hover { color: #0a0a0b; background: #e0ff69; }
.landing-page .site-footer { background: #101012; border-color: var(--line); }
.landing-page .footer-inner p, .landing-page .footer-inner small { color: var(--muted); }
.landing-page .skip-link { background: #1a1a1d; color: var(--text) !important; border-color: var(--line); }
.landing-page .eyebrow, .landing-page .section-label { color: var(--accent); }
.legal-page h1 { font-weight: 700; }
.legal-date, .legal-page section p { color: #bdbdc4; }
.legal-notice { background: #202715; border-color: #52632b; color: #e1f7ae; }
.legal-page section { border-color: var(--line); }
.legal-page section a, .legal-bottom a, .credits a { color: var(--accent); }

@media (max-width:900px) { .home-top { grid-template-columns: 1fr; } }
@media (max-width:600px) {
  .topbar { padding-inline: 12px; }
  .new-video-btn { height: 34px; padding: 0 12px; }
  .home { padding: 24px 16px 64px; }
  .home-head h1 { font-size: 26px; }
  .dropzone { padding: 18px; gap: 14px; }
  .drop-cta { display: none; }
  .projects-heading { align-items: stretch; }
  .projects-heading h2 { justify-content: flex-start; }
  .projects-tools, .project-search { width: 100%; }
  .project-filters { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .project-search input { width: 100%; }
  .project-list { grid-template-columns: 1fr 1fr; gap: 14px; }
}
@media (max-width:420px) { .project-list { grid-template-columns: 1fr; } }
@media (max-width:600px) { .topbar.editor-mode .plan-quick { order: 4; margin-right: auto; } .topbar.editor-mode .plan-quick span { display: none; } }
@media (prefers-reduced-motion:reduce) { .project-skeleton { animation: none; } }

/* ---------- keywords + templates */
.preset { position: relative; }
.preset.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.preset-badge { position: absolute; top: 5px; right: 5px; padding: 2px 6px; border-radius: 999px; background: var(--accent); color: #0a0a0b; font: 700 9px/1.2 'Inter Tight', sans-serif; font-style: normal; letter-spacing: .02em; }
.cap-word.kw { color: var(--accent); background: rgba(212,255,58,.1); box-shadow: 0 0 0 1px rgba(212,255,58,.45) inset; }
.cap-word.kw.on { color: #0a0a0b; background: var(--accent); }
.caption-list.kw-mode .cap-word { box-shadow: 0 0 0 1px #3a3a40 inset; cursor: copy; }
.caption-list.kw-mode .cap-word.kw { box-shadow: 0 0 0 1px var(--accent) inset; }
.caption-list.kw-mode .cap-word:hover { color: var(--accent); }
.kw-row .btn { flex: 1; }
.kw-hint { margin: 0; color: var(--accent); font-size: 11px; line-height: 1.4; }
.field-note { margin: -2px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }

/* ---------- job progress (transcribe / export / sync) */
.job-modal { background: rgba(6,6,7,.72); backdrop-filter: blur(6px); }
.job-card { width: min(460px, 100%); gap: 16px; padding: 22px 22px 18px; border-radius: 20px; background: #141416; border: 1px solid #2a2a2f; box-shadow: 0 30px 90px rgba(0,0,0,.55); animation: job-in .22s ease-out; }
.job-visual { position: relative; height: 76px; border-radius: 14px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(260px 90px at 50% 120%, rgba(212,255,58,.14), transparent 70%), #0e0e10; border: 1px solid #222226; }
.job-bars { display: flex; align-items: center; gap: 5px; height: 44px; }
.job-bars i { width: 5px; height: 100%; border-radius: 3px; background: linear-gradient(180deg, #e6ff8a, var(--accent)); opacity: .85; transform-origin: center; animation: job-bar 1.1s ease-in-out infinite; }
.job-bars i:nth-child(3n) { animation-duration: .9s; } .job-bars i:nth-child(4n) { animation-duration: 1.35s; } .job-bars i:nth-child(5n) { animation-duration: .75s; }
.job-bars i:nth-child(2n) { animation-delay: -.3s; } .job-bars i:nth-child(3n+1) { animation-delay: -.6s; } .job-bars i:nth-child(7n) { animation-delay: -.15s; }
.job-playhead { position: absolute; top: 10px; bottom: 10px; left: 0; width: 2px; border-radius: 2px; background: #fff; box-shadow: 0 0 12px rgba(255,255,255,.8); animation: job-scan 2.4s linear infinite; }
.job-done-mark, .job-error-mark { position: absolute; display: none; place-items: center; width: 52px; height: 52px; border-radius: 50%; font-weight: 800; font-size: 26px; }
.job-done-mark { background: var(--accent); color: #0a0a0b; }
.job-error-mark { background: #3a1d22; color: #ff9ca6; border: 1px solid #6c3943; }
.job-card[data-state="done"] .job-bars, .job-card[data-state="done"] .job-playhead,
.job-card[data-state="error"] .job-bars, .job-card[data-state="error"] .job-playhead { display: none; }
.job-card[data-state="done"] .job-done-mark { display: grid; animation: job-pop .35s cubic-bezier(.2,1.4,.4,1); }
.job-card[data-state="error"] .job-error-mark { display: grid; }

.job-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.job-card .modal-title { font-size: 19px; letter-spacing: -.02em; }
.job-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.job-percent { font: 700 28px/1 'Inter Tight', sans-serif; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--text); }
.job-card[data-state="done"] .job-percent { color: var(--accent); }
.job-card[data-state="error"] .job-percent { display: none; }

.job-progress { position: relative; height: 8px; border-radius: 8px; background: #26262b; overflow: hidden; }
.job-progress > div { position: relative; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s ease; overflow: hidden; }
.job-progress > div::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: translateX(-100%); animation: job-shine 1.6s ease-in-out infinite; }
.job-card[data-state="error"] .job-progress > div { background: #ff6b7a; }
.job-card:not([data-state="running"]) .job-progress > div::after { display: none; }
.job-meta { display: flex; justify-content: space-between; margin-top: -8px; color: #7d7d85; font: 500 12px/1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }

.job-steps { display: grid; gap: 10px; margin: 2px 0 0; padding: 14px; list-style: none; border-radius: 14px; background: #101012; border: 1px solid #222226; }
.job-steps li { display: flex; align-items: center; gap: 10px; color: #6d6d75; font-size: 13px; transition: color .2s; }
.job-steps li.active { color: var(--text); font-weight: 600; }
.job-steps li.done { color: #a4a4ad; }
.job-step-icon { position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #3a3a40; display: grid; place-items: center; }
.job-steps li.active .job-step-icon { border-color: var(--accent); border-top-color: transparent; animation: job-spin .8s linear infinite; }
.job-steps li.done .job-step-icon { border-color: var(--accent); background: var(--accent); }
.job-steps li.done .job-step-icon::after { content: ""; width: 5px; height: 9px; margin-top: -2px; border: solid #0a0a0b; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.job-card[data-state="error"] .job-steps li.active { color: #ff9ca6; }
.job-card[data-state="error"] .job-steps li.active .job-step-icon { animation: none; border-color: #ff6b7a; }

.job-detail { min-height: 0; margin-top: -6px; color: #6d6d75; font-size: 12px; }
.job-detail:empty, .job-tip:empty { display: none; }
.job-card[data-state="error"] .job-detail { color: #ff9ca6; }
.job-tip { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(212,255,58,.06); border: 1px solid rgba(212,255,58,.14); color: #c9d99a; font-size: 12px; line-height: 1.45; }
.job-card .modal-actions { margin-top: 2px; }

.job-pill { position: fixed; z-index: 55; right: 20px; bottom: 20px; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 999px;
  border: 1px solid #3a432a; background: #171a12; color: var(--text); font: 600 13px/1 'Inter Tight', sans-serif; cursor: pointer; box-shadow: 0 12px 40px rgba(0,0,0,.5); animation: job-in .2s ease-out; }
.job-pill:hover { border-color: var(--accent); }
.job-pill-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(212,255,58,.6); animation: job-ping 1.4s ease-out infinite; }

@keyframes job-bar { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
@keyframes job-scan { from { left: 6%; } to { left: 94%; } }
@keyframes job-shine { to { transform: translateX(100%); } }
@keyframes job-spin { to { transform: rotate(360deg); } }
@keyframes job-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes job-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes job-ping { to { box-shadow: 0 0 0 10px rgba(212,255,58,0); } }
@media (prefers-reduced-motion: reduce) {
  .job-bars i, .job-playhead, .job-progress > div::after, .job-steps li.active .job-step-icon, .job-pill-dot, .job-card, .job-pill { animation: none; }
  .job-bars i { transform: scaleY(.6); }
}
@media (max-width: 600px) { .job-pill { left: 16px; right: 16px; justify-content: center; } .job-percent { font-size: 24px; } }
.cap-word.low { text-decoration: underline dotted #ffb547; text-underline-offset: 3px; }

/* First step after upload: pick the spoken language */
.start-modal { z-index: 70; background: rgba(6,6,7,.74); backdrop-filter: blur(8px); }
.start-modal.hidden { display: none; }
.start-card { position: relative; width: min(620px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; gap: 18px; padding: 26px; border-radius: 22px; background: #141416; border: 1px solid #2a2a2f; box-shadow: 0 30px 90px rgba(0,0,0,.6); animation: job-in .22s ease-out; }
.start-head { display: grid; gap: 6px; padding-right: 40px; }
.start-step { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.start-head h2 { margin: 0; font-size: 23px; line-height: 1.2; letter-spacing: -.025em; }
.start-file { margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.start-x { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid #2e2e34; border-radius: 50%; background: #1b1b1f; color: #bdbdc4; cursor: pointer; }
.start-x:hover { border-color: #4b4b51; color: #fff; }
.start-langs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.start-langs label, .start-mode-list label { position: relative; display: block; cursor: pointer; }
.start-langs input, .start-mode-list input { position: absolute; opacity: 0; pointer-events: none; }
.start-langs span { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 12px 12px 11px; border: 1px solid #2a2a2f; border-radius: 14px; background: #19191c; transition: border-color .15s, background .15s, transform .15s; }
.start-langs b { font-size: 18px; line-height: 1.25; letter-spacing: -.01em; }
.start-langs em, .start-mode-list em { color: var(--muted); font-size: 12px; font-style: normal; }
.start-langs label:hover span, .start-mode-list label:hover span { border-color: #45454c; }
.start-langs input:checked + span { border-color: var(--accent); background: rgba(212,255,58,.09); box-shadow: inset 0 0 0 1px var(--accent); }
.start-langs input:checked + span b { color: var(--accent); }
.start-langs input:focus-visible + span, .start-mode-list input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.start-modes { display: grid; gap: 10px; }
.start-modes.hidden { display: none; }
.start-label { font-size: 14px; font-weight: 700; }
.start-mode-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.start-mode-list span { display: flex; flex-direction: column; gap: 5px; height: 100%; padding: 12px 12px 12px 38px; border: 1px solid #2a2a2f; border-radius: 14px; background: #19191c; transition: border-color .15s, background .15s; }
.start-mode-list span::before { content: ""; position: absolute; top: 14px; left: 13px; width: 14px; height: 14px; border: 2px solid #4a4a52; border-radius: 50%; box-sizing: border-box; }
.start-mode-list b { font-size: 13.5px; }
.start-mode-list em { line-height: 1.4; }
.start-mode-list input:checked + span { border-color: var(--accent); background: rgba(212,255,58,.07); }
.start-mode-list input:checked + span::before { border: 4px solid var(--accent); background: #0a0a0b; }
.start-quota { margin: 0; color: var(--muted); font-size: 13px; }
.start-quota.warning { color: #ffb45c; }
.start-actions { display: flex; justify-content: flex-end; gap: 10px; }
.start-actions .btn { min-height: 44px; padding: 0 20px; font-size: 14.5px; font-weight: 700; }
.start-actions .btn.primary { display: inline-flex; align-items: center; gap: 8px; padding: 0 24px; }
.start-actions .btn:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 640px) {
  .start-modal { align-items: end; padding: 0; }
  .start-card { width: 100%; max-height: 92dvh; padding: 22px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; border-bottom: 0; animation: start-up .25s ease-out; }
  .start-head h2 { font-size: 20px; }
  .start-langs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .start-langs span { padding: 10px; }
  .start-langs b { font-size: 16px; }
  .start-mode-list { grid-template-columns: 1fr; }
  .start-actions { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); margin: 0 -16px calc(-16px - env(safe-area-inset-bottom)); padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: #141416; border-top: 1px solid #232327; }
  .start-actions .btn { flex: 1; }
  .start-actions .btn.primary { flex: 2; justify-content: center; }
}
@media (max-width: 360px) { .start-langs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@keyframes start-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .start-card { animation: none; } }

/* home: a way back out to the public site */
.home-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line, #232327); color: var(--muted); font-size: 13.5px; }
.home-foot a { color: var(--muted); text-decoration: none; }
.home-foot a:first-child { color: #d3d3d9; font-weight: 600; }
.home-foot a:hover { color: var(--accent); }
@media (max-width: 600px) { .home-foot { margin-top: 32px; gap: 4px 10px; font-size: 13px; } }
