:root {
  --dash: #b9c3da;
  --rec: #ff3b5c;
  --rec-wash: rgba(255, 59, 92, .12);
  --hook: var(--mark);
  --shadow-lift: 0 2px 4px rgba(25, 45, 110, .06), 0 22px 44px rgba(25, 60, 170, .16);
  --app-tiktok: #ff3b5c;
  --app-reels: #b23cff;
  --app-shorts: #ff8a00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --dash: #3a4566;
    --rec-wash: rgba(255, 59, 92, .18);
    --hook: #50451f;
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 22px 44px rgba(0, 0, 0, .5);
    --app-reels: #c77dff;
    --app-shorts: #ffa53d;
  }
}
:root[data-theme="dark"] {
  --dash: #3a4566;
  --rec-wash: rgba(255, 59, 92, .18);
  --hook: #50451f;
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 22px 44px rgba(0, 0, 0, .5);
  --app-reels: #c77dff;
  --app-shorts: #ffa53d;
}

body { overflow-x: clip; }
button { font: inherit; color: inherit; }

.tool-hero { padding-bottom: calc(clamp(28px, 6vw, 60px) + 84px); }
.tool-hero .lede { max-width: 52ch; }
.tool {
  position: relative; z-index: 2; margin: -84px clamp(8px, 3vw, 36px) 0;
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 22px 32px; padding: clamp(18px, 3vw, 30px);
  border-radius: 34px; background: var(--card); box-shadow: var(--shadow-lift);
}
.tool > * { display: grid; gap: 12px; align-content: start; min-width: 0; }
.tool [hidden] { display: none !important; }
.t-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; font: 600 13px/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.t-label .sample { padding: 4px 8px; border-radius: 999px; background: var(--mark); color: var(--on-mark); letter-spacing: .04em; }
.t-tools { display: inline-flex; align-items: center; gap: 8px; }
.t-note { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.linkbtn { appearance: none; border: 0; background: none; padding: 4px 2px; cursor: pointer; font: 600 14px/1 var(--body); letter-spacing: 0; text-transform: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.big { margin: 0; font: 700 clamp(72px, 11vw, 104px)/.9 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); transition: color .2s ease; }
.big small { font-size: .42em; letter-spacing: 0; }
.status { display: inline-flex; align-items: center; gap: 8px; justify-self: start; margin: 0; padding: 8px 12px 8px 8px; border-radius: 999px; font: 600 15px/1.2 var(--display); background: var(--wash); color: var(--accent); }
.status i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 700 13px/1 var(--display); font-style: normal; }
.is-over .big { color: var(--rec); }
.is-over .status { background: var(--rec-wash); color: var(--rec); }
.is-over .status i { background: var(--rec); color: #ffffff; }
.is-empty .status { color: var(--muted); }
.is-empty .status i { background: var(--dash); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 2px 0 0; }
.stats div { padding: 10px 12px; border-radius: 16px; background: var(--ground); }
.stats dt { font: 600 12px/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 4px 0 0; font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums; }

.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 16px; background: var(--wash); }
.seg button { appearance: none; border: 0; cursor: pointer; display: grid; gap: 2px; justify-items: center; padding: 9px 6px; border-radius: 12px; background: none; color: var(--muted); }
.seg button b { font: 600 16px/1.1 var(--display); }
.seg button span { font: 500 12.5px/1.1 var(--body); font-variant-numeric: tabular-nums; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: 0 3px 0 var(--accent-depth); }
.range { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.range input { width: 100%; margin: 0; accent-color: var(--accent); height: 28px; }
.range output { font: 600 15px/1.2 var(--body); font-variant-numeric: tabular-nums; white-space: nowrap; }

.chip { appearance: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 14px; border: 2px solid var(--line); border-bottom-width: 4px; background: var(--card); font: 600 15px/1.1 var(--display); color: var(--ink); }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--wash); border-color: var(--accent); color: var(--accent); }
.chip.go { background: var(--accent); border-color: var(--accent-depth); color: var(--on-accent); }
.row { display: flex; flex-wrap: wrap; gap: 8px; }

.drop { position: relative; display: grid; place-items: center; align-content: center; gap: 6px; min-height: 150px; padding: 22px; border-radius: 22px; border: 2px dashed var(--dash); background: var(--ground); text-align: center; cursor: pointer; }
.drop b { font: 600 19px/1.2 var(--display); }
.drop span { color: var(--muted); font-size: 15px; }
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--wash); }
.drop:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.error { margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--rec-wash); color: var(--rec); font-weight: 600; font-size: 15px; }

.local { display: flex; align-items: center; gap: 10px; margin: 18px clamp(8px, 3vw, 36px) 0; color: var(--muted); font: 500 15px/1.4 var(--body); }
.local svg { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--wash); color: var(--accent); }
.local strong { color: var(--ink); font-weight: 600; }

.steps-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.formula { margin: 18px 0 0; color: var(--muted); font-size: 15.5px; }
.formula code { display: inline-block; margin-top: 6px; padding: 10px 14px; border-radius: 14px; background: var(--wash); color: var(--ink); font: 600 15px/1.4 ui-monospace, "SF Mono", Menlo, monospace; white-space: normal; }
.faq a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }

.timer { grid-template-areas: "script out" "script speed" "script fit"; grid-template-rows: auto auto 1fr; }
.t-script { grid-area: script; }
.t-out { grid-area: out; }
.t-speed { grid-area: speed; }
.t-fit { grid-area: fit; }
.ed { position: relative; border-radius: 22px; background: var(--ground); }
.ed-back, .ed textarea {
  margin: 0; padding: 18px 20px; border: 2px solid transparent; border-radius: 22px;
  font: 400 17px/1.75 var(--body); letter-spacing: 0; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4;
}
.ed-back { position: absolute; inset: 0; color: transparent; pointer-events: none; overflow: hidden; }
.ed textarea {
  position: relative; display: block; width: 100%; min-height: 220px; resize: none; overflow: hidden;
  background: transparent; color: var(--ink); border-color: var(--line); caret-color: var(--accent);
}
.ed textarea:focus { outline: none; border-color: var(--accent); }
.ed textarea::placeholder { color: var(--muted); }
.ed-back .hook { background: var(--hook); border-radius: 4px; box-shadow: 0 0 0 2px var(--hook); }
.ed-back .over { text-decoration: underline wavy var(--rec) 2px; text-underline-offset: 5px; }
.ed-back .pause { background: var(--wash); border-radius: 4px; box-shadow: 0 0 0 2px var(--wash); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font: 500 14px/1.3 var(--body); color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 18px; height: 12px; border-radius: 4px; }
.sw-hook { background: var(--hook); box-shadow: inset 0 0 0 1.5px var(--mark-depth); }
.sw-over { height: 8px; background: none; border-bottom: 3px solid var(--rec); border-radius: 0; }
.sw-pause { background: var(--wash); box-shadow: inset 0 0 0 1.5px var(--dash); }
.hook-says { margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--wash); font-size: 15px; line-height: 1.45; }
.hook-says b { display: block; margin-bottom: 2px; font: 600 12px/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hook-says q { font-weight: 500; }
.targets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.targets li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--line); border-bottom-width: 4px; }
.targets li::before { content: ""; grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6.5 11.3l3 2.9 6-6.4' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat; }
.targets li.no::before { background: var(--rec) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M7.5 7.5l7 7M14.5 7.5l-7 7' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 22px no-repeat; }
.targets b { font: 600 16px/1.15 var(--display); }
.targets span { font: 500 13px/1.25 var(--body); color: var(--muted); font-variant-numeric: tabular-nums; }
.targets li.no span { color: var(--rec); }

.prompter-tool { grid-template-areas: "stage controls" "stage script"; grid-template-rows: auto 1fr; }
.p-stage { grid-area: stage; }
.p-controls { grid-area: controls; }
.p-script { grid-area: script; }
.p-script textarea { width: 100%; min-height: 200px; padding: 14px 16px; border-radius: 18px; border: 2px solid var(--line); background: var(--ground); color: var(--ink); font: 400 16px/1.6 var(--body); resize: vertical; }
.p-script textarea:focus { outline: none; border-color: var(--accent); }
.stage { position: relative; height: clamp(360px, 52vh, 520px); overflow: hidden; border-radius: 26px; background: #0b0f1d; color: #ffffff; }
.stage-text { position: absolute; inset: 0 0 auto; padding: 0 8%; margin: 0; font: 600 var(--prompt-size, 38px)/1.4 var(--body); white-space: pre-wrap; overflow-wrap: break-word; will-change: transform; }
.stage.is-mirrored .stage-text { scale: -1 1; }
.stage::before, .stage::after { content: ""; position: absolute; left: 0; right: 0; z-index: 1; height: 28%; pointer-events: none; }
.stage::before { top: 0; background: linear-gradient(#0b0f1d, rgba(11, 15, 29, 0)); }
.stage::after { bottom: 0; background: linear-gradient(rgba(11, 15, 29, 0), #0b0f1d); }
.reading-line { position: absolute; z-index: 2; left: 0; right: 0; top: 33%; height: 0; border-top: 2px dashed rgba(255, 230, 143, .55); pointer-events: none; }
.reading-line::before { content: ""; position: absolute; left: 8px; top: -9px; border: 8px solid transparent; border-left: 12px solid var(--mark); }
.stage-bar { position: absolute; z-index: 3; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.stage-bar .chip { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); color: #ffffff; }
.stage-bar .chip.go { background: var(--mark); border-color: var(--mark-depth); color: var(--on-mark); }
.stage:fullscreen, .stage.is-full { height: 100%; border-radius: 0; }
.stage.is-full { position: fixed; inset: 0; z-index: 100; height: 100dvh; }
.stage:fullscreen .stage-text, .stage.is-full .stage-text { padding-inline: 12%; }
.stage:fullscreen .stage-bar, .stage.is-full .stage-bar { bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
.p-time { margin: 0; font: 700 34px/1 var(--display); font-variant-numeric: tabular-nums; }
.p-time small { display: block; margin-top: 6px; font: 500 14px/1.3 var(--body); color: var(--muted); }
kbd { padding: 1px 6px; border-radius: 6px; border: 1.5px solid var(--line); border-bottom-width: 3px; font: 600 13px/1.4 var(--body); }

.zones-tool { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "screen file" "screen apps"; grid-template-rows: auto 1fr; }
.z-screen { grid-area: screen; justify-items: center; }
.z-file { grid-area: file; }
.z-apps { grid-area: apps; }
.z-canvas { display: block; width: min(100%, 340px); aspect-ratio: 9 / 16; border-radius: 22px; background: #0b0f1d; box-shadow: var(--shadow); }
.z-video { display: none; }
.apps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.apps label { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 12px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); border-bottom-width: 4px; cursor: pointer; }
.apps input { grid-row: span 2; width: 20px; height: 20px; margin: 0; accent-color: var(--swatch); }
.apps b { display: flex; align-items: center; gap: 8px; font: 600 17px/1.2 var(--display); }
.apps b::before { content: ""; width: 14px; height: 14px; border-radius: 4px; background: var(--swatch); }
.apps span { font: 500 13.5px/1.35 var(--body); color: var(--muted); }
.app-tiktok { --swatch: var(--app-tiktok); }
.app-reels { --swatch: var(--app-reels); }
.app-shorts { --swatch: var(--app-shorts); }
.scrub { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; width: min(100%, 340px); }
.scrub input { width: 100%; accent-color: var(--accent); }

.pauses-tool { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); grid-template-areas: "wave wave" "list out"; }
.f-wave { grid-area: wave; }
.f-list { grid-area: list; }
.f-out { grid-area: out; }
.wave { display: block; width: 100%; height: 170px; border-radius: 20px; background: var(--ground); }
.f-file { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0; color: var(--muted); font-size: 15px; }
.pause-list { display: grid; gap: 6px; max-height: 340px; overflow: auto; margin: 0; padding: 0; list-style: none; counter-reset: pause; }
.pause-list li { counter-increment: pause; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: var(--ground); font-variant-numeric: tabular-nums; }
.pause-list li::before { content: counter(pause); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--wash); color: var(--accent); font: 700 13px/1 var(--display); }
.pause-list b { font: 600 15px/1.2 var(--body); }
.pause-list span { font: 700 16px/1 var(--display); color: var(--accent); }
.pause-list .none { grid-template-columns: minmax(0, 1fr); color: var(--muted); }
.pause-list .none::before { content: none; }
.f-out .big { font-size: clamp(60px, 8vw, 84px); }
.links { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.links a { font-weight: 600; color: var(--accent); text-underline-offset: 3px; }
.stage:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.cut-hint { margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--wash); font-size: 15px; line-height: 1.45; }
.cut-hint a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }

@media (max-width: 960px) {
  .steps-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .tool { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .timer { grid-template-areas: "out" "speed" "script" "fit"; }
  .prompter-tool { grid-template-areas: "stage" "controls" "script"; }
  .zones-tool { grid-template-areas: "screen" "file" "apps"; }
  .pauses-tool { grid-template-areas: "wave" "out" "list"; }
  .big { font-size: 84px; }
}
@media (max-width: 760px) {
  .steps-4 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .tool { border-radius: 28px; }
  .send .btn { width: 100%; }
  .ed-back, .ed textarea { padding: 14px; font-size: 16px; }
  .local { margin-inline: 4px; }
  .stage { height: 62vh; }
  .stage-text { padding-inline: 6%; }
}
