
:root {
  --ground: #eff0f2; --surface: #ffffff; --ink: #15171c; --muted: #5a5f69; --line: #dcdfe4; --soft: #f5f6f8; --field: #ffffff;
  --red: #d71920; --red-ink: #b3141a; --on-red: #ffffff; --yellow: #ffcf33; --on-yellow: #15171c; --frame: #111317;
  --done: #1d7f47; --done-soft: #e3f3e9; --focus: #2166d1; --hl: #fff4cc; --hl-line: #f1dc8f; --toast-link: #ffcf33;
  --display: "Anton", "Oswald", Impact, "Arial Narrow", sans-serif;
  --body: "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
  --nav-h: 66px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0e1014; --surface: #171a20; --ink: #eceef2; --muted: #9ba1ac; --line: #2a2e36; --soft: #1d2027; --field: #111318;
    --red-ink: #ff6166; --frame: #07080a; --done: #4cc783; --done-soft: #16301f; --focus: #7fb0ff; --hl: #2a2413; --hl-line: #4a3f1c; --toast-link: #b3141a;
  }
}
:root[data-theme="dark"] {
  --ground: #0e1014; --surface: #171a20; --ink: #eceef2; --muted: #9ba1ac; --line: #2a2e36; --soft: #1d2027; --field: #111318;
  --red-ink: #ff6166; --frame: #07080a; --done: #4cc783; --done-soft: #16301f; --focus: #7fb0ff; --hl: #2a2413; --hl-line: #4a3f1c; --toast-link: #b3141a;
}
* { box-sizing: border-box; }
body { background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
body.locked { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tc { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 1120px; margin-inline: auto; padding-inline: 16px; padding-block: 14px calc(var(--nav-h) + 48px); display: flex; flex-direction: column; gap: 22px; }
@media (min-width: 860px) { .app { padding-inline: 24px; padding-block: 22px 72px; } }

/* header */
.top { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
@media (min-width: 860px) { .top { grid-template-columns: auto 1fr auto; gap: 20px; } }
.logo { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; text-transform: uppercase; letter-spacing: .01em; }
.logo span { color: var(--red-ink); }
.tabs { display: none; }
@media (min-width: 860px) {
  .tabs { display: flex; justify-self: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
  .tabs a { padding: 9px 16px; border-radius: 9px; font-weight: 600; font-size: 15px; color: var(--muted); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
  .tabs a:hover { color: var(--ink); }
  .tabs a[aria-current="page"] { background: var(--ink); color: var(--ground); }
}
.cnt { font-family: var(--mono); font-size: 12px; }
.cnt:empty { display: none; }
.sync { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.sync[data-mode="cloud"] i { background: var(--done); }
.sync[data-mode="local"] i { background: #e0a800; }
.sync[data-mode="error"] i { background: var(--red); }
.sync .long { display: none; }
@media (min-width: 600px) { .sync .long { display: inline; } .sync .short { display: none; } }

/* bottom nav (phone) */
.bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.bnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 9px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.bnav svg { width: 22px; height: 22px; padding: 3px 16px; box-sizing: content-box; border-radius: 999px; }
.bnav a[aria-current="page"] { color: var(--ink); }
.bnav a[aria-current="page"] svg { background: var(--yellow); color: var(--on-yellow); }
@media (min-width: 860px) { .bnav { display: none; } }

/* buttons */
.btn { font: 600 15px/1.1 var(--body); display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 12px 16px; min-height: 44px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; text-align: center; }
.btn:hover { background: var(--soft); }
.btn-red { background: var(--red); border-color: var(--red); color: var(--on-red); }
.btn-red:hover { background: #e3262d; }
.btn-lg { font-size: 17px; padding: 14px 22px; }
.btn-sm { font-size: 14px; padding: 8px 12px; min-height: 38px; }
.btn-ghost { background: transparent; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-del { color: var(--red-ink); background: transparent; }
.btn-del.armed { background: var(--red); border-color: var(--red); color: #fff; }
.tag { display: inline-block; background: var(--yellow); color: var(--on-yellow); font-family: var(--display); font-size: 15px; letter-spacing: .04em; line-height: 1; padding: 7px 10px 6px; border-radius: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip-ex { background: var(--yellow); color: var(--on-yellow); border-color: transparent; }
.chip-ai { background: var(--done-soft); color: var(--done); border-color: transparent; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.ta, .ed-title { font: 400 16px/1.6 var(--body); color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%; resize: vertical; }
.ta:focus, .ed-title:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(33, 102, 209, .22); }
.ta[readonly] { background: var(--soft); }

/* ask panel: always dark, like the video covers */
.ask { background: radial-gradient(120% 90% at 85% 0%, #2a2f38 0%, transparent 60%), #111317; color: #f4f5f7; border-radius: 16px; padding: 20px 18px 22px; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 860px) { .ask { padding: 28px 28px 30px; } }
.ask-h { display: flex; flex-direction: column; font-family: var(--display); font-weight: 400; font-size: clamp(36px, 9vw, 58px); line-height: 1.06; text-transform: uppercase; color: #ffffff; letter-spacing: .01em;
  text-shadow: 3px 0 0 #d71920, -3px 0 0 #d71920, 0 3px 0 #d71920, 0 -3px 0 #d71920, 2px 2px 0 #d71920, -2px 2px 0 #d71920, 2px -2px 0 #d71920, -2px -2px 0 #d71920, 6px 6px 0 #000, 5px 7px 0 #000, 7px 5px 0 #000; }
.ask-sub { color: #b9bec8; font-size: 15px; max-width: 62ch; }
.fields { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .fields { grid-template-columns: 1fr 1fr; } .wide { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: #d5d9e0; }
.field label b { color: #ffcf33; }
.field input { font: 500 16px/1.3 var(--body); color: #f4f5f7; background: #1b1e25; border: 1px solid #343945; border-radius: 10px; padding: 12px 13px; width: 100%; }
.field input::placeholder { color: #7d8390; }
.field input:focus { border-color: #ffcf33; outline: none; box-shadow: 0 0 0 3px rgba(255, 207, 51, .25); }
.ask-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ask-note { font-size: 13px; color: #9ba1ac; max-width: 52ch; }
.ask-note.warn { color: #ffcf33; font-weight: 600; }

.match { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; background: var(--hl); border: 1px solid var(--hl-line); border-radius: 12px; padding: 12px 14px; font-size: 15px; max-width: 820px; }
.match a { font-weight: 700; }

/* status */
.status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; max-width: 820px; scroll-margin-top: 16px; }
.status > div { flex: 1; min-width: 200px; }
.status.err { background: var(--hl); border-color: var(--hl-line); font-weight: 600; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--red); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* results */
.res { display: flex; flex-direction: column; gap: 16px; max-width: 820px; scroll-margin-top: 16px; }
.res-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.res-title { font-size: 26px; font-weight: 700; line-height: 1.2; }
.res-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.res-note { color: var(--muted); font-size: 15px; max-width: 64ch; }
.m { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 16px; }
.m-head { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; }
.m-no { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--red-ink); }
.m-head h3 { grid-column: 1; font-size: 20px; font-weight: 700; line-height: 1.3; }
.m-link { grid-column: 2; grid-row: 1 / span 2; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.m-link:hover { color: var(--ink); border-color: var(--ink); }
.m-lead, .m-sub { color: var(--muted); font-size: 15px; max-width: 64ch; }
.m-sub { font-weight: 600; color: var(--ink); }
.m-text { font-size: 17px; line-height: 1.6; max-width: 64ch; }
.irs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ir { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.ir:first-child { border-top: 0; padding-top: 2px; }
.ir-t { font-size: 16px; line-height: 1.45; min-width: 0; }
.ir-sub { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.myth-l { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red-ink); margin-right: 4px; }
.ir-sub b { color: var(--done); }
.sv { font: 600 13px/1 var(--body); padding: 8px 10px; min-height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
.sv:hover { border-color: var(--ink); }
.sv.on { background: var(--done-soft); color: var(--done); border-color: transparent; cursor: default; }
.dots { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.dots li::marker { color: var(--red-ink); }

.venn-wrap { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: center; }
@media (min-width: 600px) { .venn-wrap { grid-template-columns: 230px 1fr; } }
.venn { width: 100%; max-width: 240px; height: auto; justify-self: center; }
.venn .c1 { fill: var(--red); fill-opacity: .16; stroke: var(--red); stroke-width: 1.5; }
.venn .c2 { fill: var(--yellow); fill-opacity: .38; stroke: #d9a800; stroke-width: 1.5; }
.venn .c3 { fill: var(--focus); fill-opacity: .14; stroke: var(--focus); stroke-width: 1.5; }
.venn text { font: 600 12.5px var(--body); fill: var(--ink); text-anchor: middle; }
.venn .dot { fill: var(--ink); }
.vdl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.vdl dt { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.vdl dd { margin: 0; font-size: 16px; }
.core { background: var(--frame); color: #f4f5f7; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.core-l { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .06em; color: #ffcf33; text-transform: uppercase; }
.core p { font-size: 18px; font-weight: 700; line-height: 1.4; }
.one { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.45; max-width: 60ch; }
.one::before { content: "\201C"; font-family: var(--display); color: var(--red-ink); font-size: 52px; line-height: 0; vertical-align: -.38em; margin-right: 4px; }
.root { font-size: 16px; }
.root-l { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .06em; background: var(--ink); color: var(--ground); padding: 3px 7px; border-radius: 5px; margin-right: 8px; }
.branches { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .branches { grid-template-columns: 1fr 1fr; } }
.br { background: var(--soft); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.br h4 { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.seasons { list-style: none; margin: 0; padding: 0; }
.season { display: grid; grid-template-columns: 150px 1fr auto; gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.season:first-child { border-top: 0; padding-top: 2px; }
.s-when { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--red-ink); padding-top: 3px; }
.s-lo { display: block; color: var(--muted); font-size: 14px; }
.s-t { display: block; font-size: 16px; font-weight: 600; }
@media (max-width: 560px) { .season { grid-template-columns: 1fr auto; } .s-when { grid-column: 1 / -1; } }
.kws { display: flex; flex-wrap: wrap; gap: 8px; }
.kw { font: 500 14px/1.2 var(--body); padding: 8px 12px; border-radius: 999px; border: 1px dashed var(--muted); background: transparent; color: var(--ink); cursor: pointer; }
.kw:hover { border-style: solid; }
.two { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .two { grid-template-columns: 1fr 1fr; } }
.col { background: var(--soft); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.col h4 { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.t30 { display: flex; flex-direction: column; gap: 10px; }
.t30-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.t30-clock { font-family: var(--mono); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.t30-n { margin-left: auto; font-size: 14px; color: var(--muted); }
.t30-n b { font-family: var(--mono); color: var(--ink); font-size: 20px; }
.meter { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--red); }
.meter.full i { background: var(--done); }
.t30-v { font-size: 15px; }
.t30-v.good { color: var(--done); font-weight: 600; }
.t30-v.bad { color: var(--red-ink); font-weight: 600; }

/* ideas */
.ide { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
@media (min-width: 860px) { .ide { grid-template-columns: 330px 1fr; } .ide-list { position: sticky; top: 16px; } .ide .back { display: none; } }
@media (max-width: 859px) { .ide[data-view="list"] .ide-edit { display: none; } .ide[data-view="edit"] .ide-list { display: none; } }
.ide-list { display: flex; flex-direction: column; gap: 12px; }
.ide-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ide-top h2 { font-size: 22px; font-weight: 700; }
.ilist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
@media (min-width: 860px) { .ilist { max-height: calc(100vh - 210px); overflow-y: auto; } }
.ilist li + li { border-top: 1px solid var(--line); }
.irow { display: flex; flex-direction: column; gap: 4px; padding: 13px 16px; text-decoration: none; color: inherit; }
.irow:hover { background: var(--soft); }
.irow[aria-current="true"] { background: var(--soft); box-shadow: inset 3px 0 0 var(--red); }
.irow-t { font-weight: 600; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.irow-m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.ilist-empty { padding: 14px 16px; color: var(--muted); font-size: 15px; }
.back { display: inline-flex; align-self: flex-start; font-weight: 600; color: var(--muted); text-decoration: none; padding: 6px 0; }
.back:hover { color: var(--ink); }
.ed { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 860px) { .ed { padding: 22px 24px; } }
.lbl { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ed-title { font-size: 20px; font-weight: 600; resize: none; }
#ed-body { min-height: 300px; }
.ed-stats { font-size: 14px; color: var(--muted); }
.ed-stats .tc { color: var(--ink); }
.ed-stats .warn { color: var(--red-ink); }
.ed-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 4px; }
.ed-actions .grow { flex: 1; }
.ed-hint { font-size: 13px; color: var(--muted); max-width: 70ch; }
.ed-note { background: var(--hl); border: 1px solid var(--hl-line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* lessons */
.series { display: flex; flex-direction: column; gap: 10px; }
.series-h { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 9vw, 56px); line-height: 1; text-transform: uppercase; }
.series-meta { color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.prog { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); max-width: 420px; }
.prog .meter { flex: 1; }
.prog b { color: var(--ink); font-family: var(--mono); }
.order { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.order-row + .order-row { border-top: 1px solid var(--line); }
.order-link { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; padding: 14px 16px; text-decoration: none; align-items: start; }
.order-link:hover { background: var(--soft); }
.order-num { font-family: var(--display); font-size: 34px; line-height: 1; color: var(--red-ink); }
.order-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.order-cover { font-family: var(--display); font-size: 17px; letter-spacing: .02em; line-height: 1.15; }
.order-cover span { color: var(--red-ink); }
.order-name { font-weight: 600; font-size: 15px; }
.order-why { color: var(--muted); font-size: 14px; line-height: 1.45; }
.order-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.order-date { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.done-pill { display: none; font-size: 12px; font-weight: 600; color: var(--done); background: var(--done-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.order-row.is-done .done-pill { display: inline-block; }
.order-row.is-done .order-num { color: var(--muted); }
@media (max-width: 480px) {
  .order-link { grid-template-columns: 34px 1fr; }
  .order-num { font-size: 28px; }
  .order-meta { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; }
}
.sec-h { font-size: 22px; font-weight: 700; }
.sec { display: flex; flex-direction: column; gap: 12px; }
.docs { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .docs { grid-template-columns: 1fr 1fr; } }
.doc { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.doc:hover { border-color: var(--ink); }
.doc-t { font-weight: 700; font-size: 16px; }
.doc-d { font-size: 14px; color: var(--muted); }
.doc-u { font-size: 13px; font-weight: 600; color: var(--red-ink); margin-top: 2px; }
.kc { display: flex; flex-wrap: wrap; gap: 8px; }
.kc a { padding: 8px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink); }
.kc a:hover { border-color: var(--ink); }

.script { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; max-width: 820px; }
.cover { background: radial-gradient(120% 90% at 85% 0%, #2a2f38 0%, transparent 60%), #111317; padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.cover-title { display: flex; flex-direction: column; font-family: var(--display); font-size: clamp(30px, 8.4vw, 50px); line-height: 1.08; color: #ffffff; text-transform: uppercase; letter-spacing: .01em;
  text-shadow: 3px 0 0 #d71920, -3px 0 0 #d71920, 0 3px 0 #d71920, 0 -3px 0 #d71920, 2px 2px 0 #d71920, -2px 2px 0 #d71920, 2px -2px 0 #d71920, -2px -2px 0 #d71920, 6px 6px 0 #000, 5px 7px 0 #000, 7px 5px 0 #000; }
.script.is-done .cover::after { content: "ĐÃ QUAY"; font-family: var(--display); font-size: 14px; letter-spacing: .06em; color: #0b0c0e; background: #4cc783; padding: 5px 9px 4px; border-radius: 6px; }
.script-body { padding: 20px; display: flex; flex-direction: column; gap: 22px; }
.script-head { display: flex; flex-direction: column; gap: 4px; }
.script-head h2 { font-size: 22px; font-weight: 700; }
.script-len { color: var(--muted); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.done-toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; padding: 10px 14px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.done-toggle input { width: 20px; height: 20px; accent-color: var(--done); margin: 0; }
.block { display: flex; flex-direction: column; gap: 10px; }
.beats { margin: 0; padding: 0; list-style: none; counter-reset: b; display: flex; flex-wrap: wrap; gap: 8px; }
.beats li { counter-increment: b; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 14px; font-weight: 500; }
.beats li::before { content: counter(b) " "; font-family: var(--mono); color: var(--red-ink); margin-right: 4px; }
.segs { display: flex; flex-direction: column; }
.seg { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding-block: 12px; border-top: 1px solid var(--line); }
.seg:first-child { border-top: 0; padding-top: 2px; }
.seg-time { display: flex; flex-direction: column; gap: 2px; }
.seg-time .tc { font-size: 15px; }
.seg-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.seg-text { font-size: 17px; line-height: 1.62; max-width: 62ch; }
.seg-hook .seg-text { font-weight: 700; font-size: 19px; }
.seg-hook .seg-label { color: var(--red-ink); }
.seg-cta .seg-text { color: var(--muted); font-style: italic; }
.notes { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.notes div { background: var(--soft); border-radius: 10px; padding: 12px 14px; }
.notes dt { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.notes dd { margin: 0; font-size: 15px; }
.pn { display: flex; justify-content: space-between; gap: 12px; }
.pn a { font-weight: 600; text-decoration: none; color: var(--muted); padding: 8px 0; }
.pn a:hover { color: var(--ink); }
@media (max-width: 480px) { .seg { grid-template-columns: 1fr; gap: 4px; } .seg-time { flex-direction: row; gap: 8px; align-items: baseline; } .script-body { padding: 16px; } }

/* teleprompter: always dark, it faces the speaker */
.prompter { position: fixed; inset: 0; z-index: 50; background: #050608; color: #f4f5f7; display: flex; flex-direction: column; font-family: var(--body); }
.p-top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; border-bottom: 1px solid #1d2027; }
.p-title { flex: 1; min-width: 0; font-size: 14px; color: #a9afba; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-title b { color: #f4f5f7; font-weight: 600; }
.p-timer { font-family: var(--mono); font-size: 22px; font-variant-numeric: tabular-nums; }
.p-timer.over { color: #ff6166; }
.p-timer small { font-size: 14px; color: #6f7581; }
.p-bar { height: 3px; background: #1d2027; }
.p-bar i { display: block; height: 100%; width: 0; background: #d71920; }
.p-view { position: relative; flex: 1; overflow: hidden; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.p-stage { height: 100%; }
.p-stage.mirror { transform: scaleX(-1); }
.p-line { position: absolute; left: 0; right: 0; top: 38%; height: 0; border-top: 1px dashed #2b3039; pointer-events: none; z-index: 1; }
.p-line::before { content: ""; position: absolute; left: 4px; top: -9px; border: 9px solid transparent; border-left: 12px solid #ffcf33; }
.p-inner { padding-inline: 32px 20px; will-change: transform; max-width: 900px; margin-inline: auto; }
.p-seg { margin-bottom: 1.1em; }
.p-seg span { display: block; font-family: var(--mono); font-size: 13px; letter-spacing: .08em; color: #ffcf33; margin-bottom: 4px; }
.p-seg p { font-size: var(--pfs, 34px); line-height: 1.38; font-weight: 600; }
.p-count { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 160px; color: #ffffff; background: rgba(5, 6, 8, .72); text-shadow: 5px 0 0 #d71920, -5px 0 0 #d71920, 0 5px 0 #d71920, 0 -5px 0 #d71920; }
.p-hint { position: absolute; bottom: 10px; left: 16px; right: 16px; text-align: center; font-size: 13px; color: #6f7581; pointer-events: none; }
.p-controls { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #1d2027; }
.p-row { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.p-btn { font: 600 15px/1 var(--body); color: #f4f5f7; background: #171a20; border: 1px solid #2b3039; border-radius: 10px; padding: 12px 14px; cursor: pointer; min-width: 48px; }
.p-btn:hover { background: #20242c; }
.p-btn[aria-pressed="true"] { background: #ffcf33; color: #15171c; border-color: #ffcf33; }
.p-go { background: #d71920; border-color: #d71920; flex: 1; max-width: 360px; font-size: 18px; padding: 15px; }
.p-go:hover { background: #e3262d; }
.p-dur { font-family: var(--mono); font-size: 14px; color: #a9afba; min-width: 72px; text-align: center; }
.p-sep { width: 1px; height: 26px; background: #2b3039; margin-inline: 4px; }
@media (max-width: 520px) { .p-sep { display: none; } .p-seg p { font-size: min(var(--pfs, 34px), 44px); } }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--ground); padding: 11px 16px; border-radius: 10px; font-size: 15px; font-weight: 500; z-index: 60; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); width: max-content; }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: var(--toast-link); font-weight: 700; margin-left: 10px; }
@media (min-width: 860px) { .toast { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* màn quay: luôn tối, chữ nhắc sát ống kính */
.quay { position: fixed; inset: 0; z-index: 55; background: #000; color: #f4f5f7; font-family: var(--body); overflow: hidden; }
.quay video#q-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.quay video.mirror { transform: scaleX(-1); }
.q-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; }
.q-title { flex: 1; min-width: 0; font-size: 13px; color: #c9ced6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-rec { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 16px; font-weight: 700; background: rgba(215, 25, 32, .9); padding: 5px 10px; border-radius: 999px; }
.q-rec i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: qblink 1s steps(2) infinite; }
@keyframes qblink { 50% { opacity: .2; } }
.q-btn { font: 600 14px/1 var(--body); color: #f4f5f7; background: rgba(23, 26, 32, .78); border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; padding: 11px 13px; cursor: pointer; min-height: 42px; }
.q-btn:hover { background: rgba(40, 44, 52, .9); }
.q-btn[disabled] { opacity: .45; cursor: default; }
.q-prompt { position: absolute; left: 0; right: 0; top: calc(56px + env(safe-area-inset-top, 0px)); height: 34%; z-index: 2; overflow: hidden; touch-action: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .62) 80%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 82%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 82%, transparent 100%); }
.q-inner { padding-inline: 20px; max-width: 760px; margin-inline: auto; will-change: transform; line-height: 1.34; font-weight: 600; font-size: 30px; text-shadow: 0 2px 6px rgba(0, 0, 0, .8); }
.q-seg { margin-bottom: .8em; }
.q-seg span { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: #ffcf33; margin-bottom: 2px; }
.q-seg p { margin: 0; }
.q-count { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 150px; color: #fff; background: rgba(0, 0, 0, .35);
  text-shadow: 5px 0 0 #d71920, -5px 0 0 #d71920, 0 5px 0 #d71920, 0 -5px 0 #d71920; }
.q-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(0deg, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0)); }
.q-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.q-dur { font-family: var(--mono); font-size: 13px; color: #d5d9e0; min-width: 64px; text-align: center; }
.q-shot { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: #d71920; cursor: pointer; box-shadow: 0 2px 12px rgba(0, 0, 0, .5); transition: border-radius .2s, transform .2s; }
.q-shot.on { border-radius: 18px; transform: scale(.82); }
.q-shot[disabled] { opacity: .4; cursor: default; }
.q-shot-l { font-size: 13px; color: #d5d9e0; }
.q-err { position: absolute; left: 16px; right: 16px; top: 45%; z-index: 5; background: #fff4cc; color: #15171c; border-radius: 12px; padding: 14px 16px; font-size: 16px; font-weight: 600; line-height: 1.45; }
.q-review { position: absolute; inset: 0; z-index: 6; background: #050608; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
.q-review video { max-width: 100%; max-height: 64vh; border-radius: 12px; background: #000; }
.q-review p { margin: 0; font-size: 14px; color: #a9afba; text-align: center; max-width: 46ch; }
.q-save { font: 700 17px/1 var(--body); background: #d71920; color: #fff; border: 0; border-radius: 12px; padding: 15px 22px; cursor: pointer; min-height: 50px; }
@media (prefers-reduced-motion: reduce) { .q-rec i { animation: none; } .q-shot { transition: none; } }
@media (min-width: 900px) { .q-prompt { height: 30%; } }
/* nền trang (bản artifact có sẵn các dòng này trong khung claude.ai) */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; height: auto; }

/* đầu trang: tên + trạng thái lưu + nút Bản quyền */
.logo { font-size: clamp(21px, 6vw, 30px); }
.top-r { display: flex; align-items: center; gap: 10px; justify-self: end; min-width: 0; }
.bq-chip { font: 600 13px/1 var(--body); padding: 8px 11px; min-height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
.bq-chip:hover { border-color: var(--ink); }
.bq-chip.sap { background: var(--hl); border-color: var(--hl-line); }
.bq-chip.het { background: var(--red); border-color: var(--red); color: #fff; }
@media (max-width: 420px) { .top .sync { display: none; } }

/* cổng kích hoạt: luôn tối như bìa video */
.cong { position: fixed; inset: 0; z-index: 70; overflow-y: auto; display: flex; justify-content: center;
  background: radial-gradient(120% 90% at 85% 0%, #2a2f38 0%, transparent 60%), #0b0c0f; color: #f4f5f7;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
.cong-hop { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 16px; margin-block: auto; }
.cong-h { display: flex; flex-direction: column; font-family: var(--display); font-weight: 400; font-size: clamp(40px, 11vw, 64px); line-height: 1.04; text-transform: uppercase; color: #fff; letter-spacing: .01em;
  text-shadow: 3px 0 0 #d71920, -3px 0 0 #d71920, 0 3px 0 #d71920, 0 -3px 0 #d71920, 2px 2px 0 #d71920, -2px 2px 0 #d71920, 2px -2px 0 #d71920, -2px -2px 0 #d71920, 6px 6px 0 #000, 5px 7px 0 #000, 7px 5px 0 #000; }
.cong-dan { color: #b9bec8; font-size: 16px; max-width: 46ch; }
.cong-tt { font-size: 15px; font-weight: 600; background: #1b1e25; border: 1px solid #343945; border-radius: 10px; padding: 10px 12px; color: #d5d9e0; line-height: 1.45; }
.cong-tt.loi { background: #fff4cc; color: #15171c; border-color: #f1dc8f; }
.cong form { display: flex; flex-direction: column; gap: 8px; }
.cong label { font-size: 13px; font-weight: 600; color: #d5d9e0; }
.cong .hang { display: flex; gap: 8px; flex-wrap: wrap; }
#in-ma { flex: 1 1 220px; min-width: 0; font: 600 18px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #f4f5f7; background: #1b1e25; border: 1px solid #343945; border-radius: 10px; padding: 13px 14px; }
#in-ma::placeholder { color: #6f7581; }
#in-ma:focus { border-color: #ffcf33; outline: none; box-shadow: 0 0 0 3px rgba(255, 207, 51, .25); }
.cong-hoac { display: flex; align-items: center; gap: 10px; color: #6f7581; font-size: 13px; }
.cong-hoac::before, .cong-hoac::after { content: ""; flex: 1; height: 1px; background: #2b3039; }
.cong .btn-toi { background: transparent; color: #f4f5f7; border-color: #4a505c; }
.cong .btn-toi:hover { background: #1b1e25; }
.cong-note { font-size: 14px; color: #9ba1ac; line-height: 1.5; }
.cong-note a { color: #ffcf33; }
.cong-ds { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: #d5d9e0; }
.cong-ds li::marker { color: #ffcf33; }

/* bảng Bản quyền */
.bq-hop { position: fixed; inset: 0; z-index: 65; background: rgba(5, 6, 8, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.bq-the { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 20px; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; }
.bq-the h2 { font-size: 20px; font-weight: 700; }
.bq-bang { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.bq-bang div { display: grid; grid-template-columns: 118px 1fr; gap: 10px; }
.bq-bang dt { font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.bq-bang dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.bq-nut { display: flex; flex-wrap: wrap; gap: 8px; }
.bq-ghi { font-size: 13px; color: var(--muted); }
