:root {
  --bg: #F6F5F2;
  --surface: #FFFFFF;
  --ink: #17171A;
  --muted: #6E6E76;
  --faint: #A9A9B0;
  --line: #E7E5E0;
  --wave: #C9C7C1;
  --wave-in: #2A2A30;
  --accent: #E8590C;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(232, 89, 12, 0.10);
  --good: #2F9E44;
  --shadow: 0 1px 2px rgba(20, 20, 25, .04), 0 8px 24px rgba(20, 20, 25, .06);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0E10;
    --surface: #18181B;
    --ink: #F2F2F3;
    --muted: #9B9BA3;
    --faint: #5D5D66;
    --line: #2A2A2F;
    --wave: #3A3A41;
    --wave-in: #E6E6E8;
    --accent: #FF7A33;
    --accent-ink: #160A03;
    --accent-soft: rgba(255, 122, 51, 0.14);
    --good: #51CF66;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 980px; margin: 0 auto; padding: 22px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.logo i { display: block; width: 3px; border-radius: 2px; background: #fff; }
.logo i:nth-child(1) { height: 7px; } .logo i:nth-child(2) { height: 13px; }
.logo i:nth-child(3) { height: 17px; } .logo i:nth-child(4) { height: 9px; }
.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--faint); }
.steps li { padding: 5px 11px; border-radius: 999px; }
.steps li.on { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); font-weight: 500; }
.steps li.done { color: var(--muted); }

main { max-width: 980px; margin: 0 auto; padding: 8px 24px 80px; }
.screen { display: none; animation: rise .35s ease both; }
.screen.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Upload */
#screen-upload { text-align: center; padding-top: 6vh; }
h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 14px; font-weight: 700; }
.lede { color: var(--muted); font-size: 17px; max-width: 520px; margin: 0 auto 36px; }
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  max-width: 560px; margin: 0 auto; padding: 48px 24px;
  background: var(--surface); border: 1.5px dashed var(--line); border-radius: 22px;
  cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
  box-shadow: var(--shadow);
}
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); outline: none; }
.drop.over { background: var(--accent-soft); transform: scale(1.01); }
.drop-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.drop strong { font-size: 17px; font-weight: 600; }
.drop span { color: var(--muted); font-size: 14px; }
.fine { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-top: 22px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 28px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Trim */
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.file-name { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; word-break: break-word; }
.file-meta { color: var(--muted); font-size: 13px; }
.suggest {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--accent-soft); color: var(--ink); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px;
}
.suggest:empty { display: none; }
.suggest b { font-weight: 600; }
.suggest .spark { color: var(--accent); flex: none; margin-top: 2px; }

.overview-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 14px 8px; margin-bottom: 16px; }
.overview { display: block; width: 100%; height: 96px; cursor: pointer; touch-action: none; }
.overview-times { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); padding-top: 4px; font-variant-numeric: tabular-nums; }

.points { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.point { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.q { display: block; font-weight: 600; font-size: 15px; margin-bottom: 10px; letter-spacing: -0.01em; }
.time-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.time {
  width: 150px; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  background: var(--bg); border: 1.5px solid transparent; border-radius: 10px; padding: 6px 12px;
  transition: border-color .15s;
}
.time:focus { outline: none; border-color: var(--accent); }
.time.bad { border-color: #E03131; }
.zoom { display: block; width: 100%; height: 70px; border-radius: 10px; background: var(--bg); cursor: ew-resize; touch-action: none; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.nudges { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; }
.nudges button { border: 0; background: transparent; padding: 6px 9px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.nudges button:hover { background: var(--surface); color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 500; font-size: 14px;
  background: var(--bg); color: var(--ink); text-decoration: none; transition: transform .1s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.big { padding: 14px 24px; font-size: 16px; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.play .pi { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.btn.play.playing .pi { width: 8px; height: 10px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.btn.play.playing { background: var(--accent-soft); color: var(--accent); }

/* Settings */
.settings { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 16px; }
.settings summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; font-weight: 600; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); margin-left: 4px; transition: transform .2s; flex: none; }
.settings[open] summary::after { transform: rotate(-135deg); }
.summary-text { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: auto; text-align: right; }
.settings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 0 18px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field em, .toggle em { font-style: normal; color: var(--faint); }
.field input, .field select {
  background: var(--bg); border: 1.5px solid transparent; border-radius: 10px; padding: 9px 11px; color: var(--ink); font-size: 14px; width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.wide { grid-column: 1 / -1; }
.toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 14px; padding-top: 4px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; margin-top: 1px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + .switch { background: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(16px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

.cta-row { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 22px; }
.cta-length { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Export */
#screen-export { padding-top: 8vh; }
.working, .done { max-width: 480px; margin: 0 auto; text-align: center; }
h2 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 18px; }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .2s; }
.stage { color: var(--muted); font-size: 14px; margin-top: 12px; }
.check { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: var(--good); color: #fff; animation: pop .4s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.done h2 { margin-bottom: 6px; }
.done-meta { color: var(--muted); margin: 0 0 22px; font-variant-numeric: tabular-nums; }
.done audio { width: 100%; margin-bottom: 22px; }
.done-actions { margin-bottom: 14px; }
.done-secondary { display: flex; justify-content: center; gap: 6px; }

@media (max-width: 720px) {
  .top { padding: 16px; }
  main { padding: 4px 16px 60px; }
  .steps { display: none; }
  .points { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .file-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .cta-row { flex-direction: column; align-items: stretch; text-align: center; }
}

/* Header link, first-time hint, footer share */
.top-right { display: flex; align-items: center; gap: 14px; }
.help-link { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; padding: 5px 11px; border-radius: 999px; }
.help-link:hover { color: var(--ink); background: var(--surface); }
.first-time { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.first-time a { color: var(--accent); text-decoration: none; font-weight: 500; }
.first-time a:hover { text-decoration: underline; }
.foot { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 24px 40px; }
.made { margin: 0; font-size: 12.5px; color: var(--faint); }
.made a { color: var(--muted); text-decoration: none; font-weight: 500; }
.made a:hover { color: var(--ink); text-decoration: underline; }
.share { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--faint); font-size: 13px; font-weight: 500; cursor: pointer; padding: 7px 12px; border-radius: 999px; }
.share:hover { color: var(--ink); background: var(--surface); }

/* Help page */
.help { max-width: 680px; margin: 0 auto; }
.help h1 { font-size: clamp(30px, 5vw, 40px); margin: 24px 0 10px; }
.help .lede { margin: 0 0 36px; text-align: left; max-width: none; }
.help h2 { font-size: 20px; margin: 44px 0 14px; }
.help p, .help li { color: var(--ink); }
.help .muted { color: var(--muted); }
.callout { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.callout ul { margin: 8px 0 0; padding-left: 20px; }
.callout li { margin: 6px 0; }
.hsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hsteps > li { display: grid; grid-template-columns: 36px 1fr; gap: 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.num { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; }
.hsteps h3 { margin: 5px 0 6px; font-size: 16px; letter-spacing: -0.01em; }
.hsteps p { margin: 0 0 8px; color: var(--muted); }
.hsteps p:last-child { margin-bottom: 0; }
.kbd { display: inline-block; background: var(--bg); border-radius: 6px; padding: 1px 7px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.faq details { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--faint); font-weight: 400; font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--muted); }
.help-cta { text-align: center; margin: 48px 0 8px; }
.help a:not(.btn) { color: var(--accent); }

.pro-upsell { margin: 26px auto 0; max-width: 420px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.pro-upsell a { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.pro-upsell a:hover { text-decoration: underline; }

/* Tutorial video (help page) */
.tut { margin: 0 0 40px; }
.tut video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #000; box-shadow: var(--shadow); }
.tut figcaption { text-align: center; font-size: 13px; color: var(--muted); margin-top: 10px; }

/* Go Pro (free site) */
.signin-link { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; padding: 5px 11px; border-radius: 999px; }
.signin-link:hover { color: var(--ink); background: var(--surface); }
.gopro-pill { font-size: 13px; font-weight: 600; color: var(--accent-ink); background: var(--accent); text-decoration: none; padding: 6px 13px; border-radius: 999px; white-space: nowrap; }
.gopro-pill:hover { filter: brightness(1.06); }
.gopro { margin: 72px auto 0; max-width: 900px; text-align: center; scroll-margin-top: 24px; }
.gopro-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.gopro-eyebrow .logo { width: 22px; height: 22px; border-radius: 6px; }
.gopro-eyebrow .logo i { width: 2.5px; }
.gopro-eyebrow b { color: var(--accent); }
.gopro h2 { font-size: clamp(26px, 4vw, 36px); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 10px; }
.gopro-sub { color: var(--muted); font-size: 16px; margin: 0 auto 28px; max-width: 520px; }
.gopro-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; text-align: left; }
.gopro-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; border-top: 3px solid var(--accent); }
.gc-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.gopro-card h3 { margin: 0 0 6px; font-size: 16px; letter-spacing: -0.01em; }
.gopro-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.gc-levels { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gc-levels i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 5px; vertical-align: 1px; }
.gc-levels b { color: var(--ink); font-weight: 600; }
.gopro-compare { margin: 22px 0 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-align: left; }
.gcmp-row { display: grid; grid-template-columns: 1fr 72px 72px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.gcmp-row:last-child { border-bottom: 0; }
.gcmp-row span:not(:first-child) { text-align: center; }
.gcmp-head { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 13px; padding-bottom: 10px; }
.gcmp-head span:last-child { color: var(--accent); }
.gcmp-row .y { color: var(--good); font-weight: 700; }
.gcmp-row .n { color: var(--faint); }
.gcmp-row.pro { background: var(--accent-soft); font-weight: 500; }
.gcmp-row.pro .y { color: var(--accent); }
.gopro-cta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.gopro-signin { background: var(--surface); box-shadow: var(--shadow); }
.gopro-fine { color: var(--faint); font-size: 13px; margin: 12px 0 0; }
@media (max-width: 720px) {
  .gopro { margin-top: 56px; }
  .gopro-cards { grid-template-columns: 1fr; }
  .gcmp-row { grid-template-columns: 1fr 48px 48px; padding: 10px 14px; font-size: 13.5px; }
  .signin-link { display: none; }
  .gopro-cta .btn { flex: 1 1 100%; }
}
@media (max-width: 720px) {
  .fine { display: block; text-align: center; }
  .fine svg { display: inline; vertical-align: -2px; margin-right: 4px; }
}
