/* Xưởng Video — giao diện theo ui/01..03 (artifact "Kế hoạch sửa"). */
:root {
  --bg: #F4F5F2; --page: #E9EBE6; --surface: #FFFFFF; --col: #ECEEEA; --chip: #EEF0EC;
  --line: #D5D8D2; --line-soft: #EEF0EC; --dash: #B9BDB6;
  --fg: #16181B; --fg2: #3D4247; --muted: #5F665E; --muted2: #4A5049;
  --accent: #0E7C66; --accent-dark: #0A5C4C; --accent-soft: #E7F3EF; --accent-mid: #9CCFC1; --live: #4CC38A;
  --warn: #8A4304; --warn-line: #E8A33B; --warn-soft: #FFF4E5; --warn-line-soft: #F3D19C;
  --err: #B42318; --err-line: #D9534A; --err-soft: #FDECEA; --err-line-soft: #F1B5AE;
  --violet: #5B3A9A; --violet-soft: #F0EAFB;
  --sans: 'Be Vietnam Pro', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); } a:hover { color: var(--accent-dark); }
button { font: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ── Thanh trên ── */
.top { position: sticky; top: 0; z-index: 10; height: 64px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 28px; }
.brandmark { display: flex; align-items: center; gap: 10px; min-width: 200px; text-decoration: none; color: var(--fg); }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.brandmark b { display: block; font-size: 15px; }
.brandmark div span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.nav { display: flex; align-items: stretch; gap: 4px; height: 64px; flex: 1; overflow-x: auto; }
.nav a { display: inline-flex; align-items: center; padding: 0 14px; font-size: 14px; font-weight: 500; color: var(--muted2); text-decoration: none;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a.on { border-bottom-color: var(--accent); font-weight: 600; color: var(--accent); }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--chip); }
.seg button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pill { min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; background: var(--surface); text-decoration: none; color: var(--fg); }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--dash); display: inline-block; }
.dot.ok { background: var(--live); } .dot.warn { background: var(--warn-line); } .dot.err { background: var(--err-line); }
.avatar { width: 32px; height: 32px; border-radius: 16px; background: #2A2F35; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }

main { padding: 24px; max-width: 1680px; margin: 0 auto; }
h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.lede { margin: 6px 0 0; color: var(--fg2); max-width: 620px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 24px 0 8px; }

/* ── Nút ── */
.btn { min-height: 36px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--fg); text-decoration: none; }
.btn:hover { border-color: var(--dash); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { color: var(--err); }
.btn:disabled, .btn.off { background: #C9D7D2; border-color: #C9D7D2; color: #fff; cursor: not-allowed; }
.btn.ghost-off:disabled { background: var(--surface); color: var(--dash); border-color: var(--line-soft); }
.btn.block { width: 100%; min-height: 44px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--chip); color: var(--muted2);
  font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--accent-soft); color: var(--accent-dark); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }

/* ── Khung chung ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-h b { font-size: 15px; }
.card-h .sub { font-size: 12.5px; color: var(--muted); }
.empty { padding: 18px 14px; border: 1px dashed var(--dash); border-radius: 10px; color: var(--muted); font-size: 13px; text-align: center; line-height: 1.5; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { text-align: right; font-weight: 600; }
.kv .mono { font-size: 12.5px; }
.err-text { color: var(--err); }

/* ── Bảng việc: đầu trang ── */
.head { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 640px) 340px; gap: 16px; align-items: start; }
.paste { min-height: 64px; padding: 8px 8px 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; gap: 10px; }
.paste textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paste textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 160px; padding: 10px 0; border: 0; outline: none; resize: none; font: inherit; color: var(--fg); background: transparent; }
.paste select, select.input, input.input { height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: var(--surface); color: var(--fg); }
.paste-note { font-size: 12.5px; margin: 6px 4px 0; min-height: 18px; }
.usage { min-height: 64px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 7px; }
.usage .row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--fg2); }
.usage .row b { font-family: var(--mono); font-size: 14px; color: var(--fg); }
.bar { height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; display: flex; }
.bar span { background: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }

/* ── Dải luồng ── */
.flow { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 0 43px; position: relative; overflow-x: auto; padding-bottom: 2px; }
.flow .st { position: relative; height: 56px; padding: 0 12px; border-radius: 10px; display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); color: var(--fg); min-width: 0; }
.flow .st:not(:last-child)::after { content: ""; position: absolute; right: -40px; top: 27px; width: 34px; height: 2px; background: #8A9089; }
.flow .st:not(:last-child)::before { content: ""; position: absolute; right: -42px; top: 24px; border: 4px solid transparent; border-left: 6px solid #8A9089; }
.flow .n { width: 18px; height: 18px; border-radius: 9px; background: var(--page); color: var(--fg2); font-family: var(--mono); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.flow .st b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow .st small { display: block; font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow .st > span:last-child { min-width: 0; line-height: 1.25; }
.flow .st.wait { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.flow .st.done { background: var(--accent-soft); border-color: var(--accent-mid); color: var(--accent-dark); }
.flow .st.done .n { background: var(--accent); color: #fff; }
.flow .st.done:not(:last-child)::after, .flow .st.cur:not(:last-child)::after { background: var(--accent); }
.flow .st.done:not(:last-child)::before, .flow .st.cur:not(:last-child)::before { border-left-color: var(--accent); }
.flow .st.cur { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(14,124,102,.28); }
.flow .st.cur .n { background: #fff; color: var(--accent); }
.flow .st.todo { border-style: dashed; border-color: var(--dash); color: var(--muted2); }
.flow .st.todo .n { background: transparent; border: 1px solid var(--dash); color: var(--muted); }
.flow .st.bad { background: var(--err-soft); border-color: var(--err-line-soft); color: var(--err); }

/* ── Kanban ── */
.board { display: grid; grid-template-columns: repeat(8, minmax(193px, 1fr)); gap: 12px; margin-top: 28px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.lane { min-height: 420px; padding: 8px; border-radius: 12px; background: var(--col); display: flex; flex-direction: column; gap: 8px; }
.lane-h { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 8px; border-radius: 8px; background: var(--page); color: var(--fg2); font-size: 13px; font-weight: 700; }
.lane-h span { font-family: var(--mono); font-size: 12.5px; }
.lane.wait .lane-h { background: var(--warn-soft); color: var(--warn); }
.lane.done .lane-h { background: var(--accent-soft); color: var(--accent-dark); }
.lane.err .lane-h { background: var(--err-soft); color: var(--err); }
.jc { display: flex; flex-direction: column; gap: 7px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--fg); }
.jc:hover { border-color: var(--dash); color: var(--fg); }
.jc.wait { border-color: var(--warn-line); border-left: 4px solid var(--warn-line); }
.jc.err { border-color: var(--err-line-soft); border-left: 4px solid var(--err-line); }
.jc.dim { opacity: .7; }
.jc-top { display: flex; gap: 8px; align-items: center; min-width: 0; }
.thumb { position: relative; flex: none; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, #B8BDC4, #7B8189); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.jc-title { display: flex; flex-direction: column; min-width: 0; }
.jc-title b { font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.jc-title span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jc-line { font-size: 12.5px; color: var(--fg2); overflow-wrap: anywhere; }
.jc.wait .jc-line { font-size: 13px; color: var(--warn); }
.jc.err .jc-line { font-size: 13px; color: var(--err); }
.jc-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.jc-foot .mono { color: var(--fg); }
.jc-act { display: flex; gap: 6px; }
.jc-act .btn { flex: 1; padding: 0 8px; }
.jc-edit { display: flex; flex-direction: column; gap: 6px; }
.jc-edit textarea { width: 100%; min-height: 54px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; resize: vertical; }
.lane-note { font-size: 12px; color: var(--warn); padding: 2px 4px; line-height: 1.4; }
.lane-tip { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--surface); border: 1px dashed var(--dash); border-radius: 10px; font-size: 12.5px; color: var(--fg2); line-height: 1.4; }
.lane-tip b { font-size: 13px; color: var(--fg); }

/* ── Chi tiết việc ── */
.crumb { font-size: 13px; color: var(--muted); }
.crumb a { text-decoration: none; }
.dhead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.dhead h1 { font-size: 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dgrid { display: grid; grid-template-columns: 356px minmax(0, 1fr) 416px; gap: 16px; margin-top: 36px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hero { position: relative; width: 100%; aspect-ratio: 324 / 200; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, #A9D2C5, #4F8E7B); }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .cap { position: absolute; left: 6px; bottom: 4px; font-size: 10px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.thumbs .thumb { width: 100%; height: auto; aspect-ratio: 1; }
.price { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-radius: 8px; background: var(--bg); font-size: 13px; }
.angle { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); border: 1px solid var(--warn-line-soft); }
.angle > span:first-child { font-size: 12px; font-weight: 600; color: var(--warn); text-transform: uppercase; letter-spacing: .06em; }
.angle label { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.clip { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; }
.clip.on { border: 2px solid var(--accent); }
.clip .ph { position: relative; height: 112px; border-radius: 8px; background: linear-gradient(135deg, #B7C9C1, #6B857A); }
.clip .dur { position: absolute; left: 8px; bottom: 8px; padding: 1px 6px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; font-family: var(--mono); font-size: 11.5px; }
.clip .tick { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.clip .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 0 2px; font-size: 12px; color: var(--muted); min-width: 0; }
.clip .score { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent); }
.timeline { display: flex; height: 28px; border-radius: 6px; overflow: hidden; }
.timeline span { display: flex; align-items: center; justify-content: center; border-right: 2px solid #fff; font-family: var(--mono); font-size: 11.5px; color: var(--fg2); }
.beats .beat { display: grid; grid-template-columns: 30px 110px minmax(0, 1fr) 230px; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line-soft); }
.beat .num { width: 26px; height: 26px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-dark); font-family: var(--mono); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.beat .name b { display: block; font-size: 13.5px; }
.beat .name span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.beat .src { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; font-size: 12px; color: var(--muted); }
.beat.todo .num { background: var(--chip); color: var(--muted); }
.beat.todo .say { color: var(--muted); font-style: italic; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 8px; background: var(--bg); }
.tile span { font-size: 12px; color: var(--muted); }
.tile b { font-size: 13.5px; }
.phone { width: 236px; height: 420px; border-radius: 28px; background: var(--fg); padding: 8px; align-self: center; }
.phone > div { position: relative; width: 100%; height: 100%; border-radius: 21px; overflow: hidden; background: linear-gradient(170deg, #A9D2C5, #3E7766);
  display: flex; align-items: center; justify-content: center; color: #fff; text-align: center; font-size: 13px; padding: 20px; }
.phone video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.check i { width: 20px; height: 20px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; }
.check.ok i { background: var(--accent); color: #fff; }
.check.no i { background: var(--err-line); color: #fff; }
.check.todo { color: var(--muted); }
.check.todo i { border: 2px dashed var(--dash); }
.cost { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.cost span:first-child { color: var(--fg2); }
.cost span:last-child { font-family: var(--mono); white-space: nowrap; }
.cost.total { border-top-color: var(--line); padding-top: 8px; font-size: 14px; font-weight: 700; }
.steps-log .row { display: grid; grid-template-columns: 120px 82px minmax(0, 1fr) 70px; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 12.5px; align-items: baseline; }
.steps-log .row .mono { font-size: 12px; }

/* ── Cài đặt ── */
.chain { display: grid; grid-template-columns: repeat(4, minmax(180px, 300px)); gap: 64px; margin: 24px 0; overflow-x: auto; }
.chain div { position: relative; height: 64px; padding: 10px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.chain div:not(:last-child)::after { content: ""; position: absolute; right: -58px; top: 31px; width: 48px; height: 2px; background: var(--accent); }
.chain div:not(:last-child)::before { content: ""; position: absolute; right: -60px; top: 28px; border: 4px solid transparent; border-left: 6px solid var(--accent); }
.chain div.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chain b { display: block; font-size: 14.5px; }
.chain span { font-size: 12.5px; opacity: .8; }
.sgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.sgrid .card { padding: 18px 20px; gap: 4px; }
.sgrid .card > .sub { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.tbl { display: grid; font-size: 13px; }
.tbl > div { padding: 9px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; overflow-wrap: anywhere; }
.tbl > div.h { padding: 6px 0; color: var(--muted); font-weight: 600; }
.hstep { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.hstep i { width: 26px; height: 26px; border-radius: 13px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; font-style: normal; flex: none; background: var(--accent); }
.hstep i.bad { background: var(--warn-line); }
.hstep b { flex: 1; font-size: 13.5px; }
.hstep span { font-size: 12.5px; color: var(--muted2); text-align: right; max-width: 60%; }
.actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.audit { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.audit .mono { color: var(--muted); width: 46px; flex: none; }
.audit b { width: 130px; flex: none; overflow: hidden; text-overflow: ellipsis; }

/* ── Sản phẩm, mẫu kịch bản ── */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pcard { display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--fg); min-width: 0; }
.pcard:hover { border-color: var(--dash); color: var(--fg); }
.pimg { position: relative; flex: none; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; }
.pimg img { width: 100%; height: 100%; object-fit: cover; }
.pimg svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.pbody { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.pbody b { font-size: 14px; overflow-wrap: anywhere; }
.pmeta > * { white-space: nowrap; }
.pmeta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg2); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photos a { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--chip); border: 1px solid var(--line); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tgrid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-top: 24px; align-items: start; }
.tgrid .card:first-child { grid-row: span 2; }
.tin { width: 100%; height: 34px; }
.scroll-x { overflow-x: auto; }
.scroll-x .tbl { min-width: 640px; }
.tgrid > .card { min-width: 0; }
.tarea { width: 100%; height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; font-size: 13px; }
.tarea.mono { font-size: 12.5px; }
.num-dot { width: 24px; height: 24px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-dark); font-family: var(--mono); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }

.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 8px; }
.fgrid > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fgrid p { margin: 0; font-size: 12.5px; line-height: 1.45; }
.fgrid .kv { border-top: 1px solid var(--line-soft); }
.fgrid .badge { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* ── Hộp thoại, thông báo, đăng nhập ── */
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 20px; max-width: 560px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(22,24,27,.35); }
dialog pre { background: var(--chip); padding: 10px 12px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12.5px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: 420px; padding: 12px 16px; border-radius: 10px; background: var(--fg); color: #fff; font-size: 13.5px; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.toast.err { background: var(--err); }
.login { max-width: 420px; margin: 12vh auto; }
.login input { width: 100%; }
.soon { max-width: 560px; }

@media (max-width: 1400px) {
  .dgrid { grid-template-columns: 320px minmax(0, 1fr); }
  .dgrid > .stack:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
  .head { grid-template-columns: minmax(0, 1fr); }
  .sgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  main { padding: 16px; }
  .top { height: auto; padding: 8px 16px 0; gap: 8px 12px; flex-wrap: wrap; }
  .nav { order: 9; flex-basis: 100%; height: 44px; margin: 0 -16px; padding: 0 8px; }
  .seg { margin-left: auto; }
  .paste { flex-wrap: wrap; padding: 8px; }
  .paste textarea { flex-basis: calc(100% - 30px); }
  .paste select { flex: 1; }
  .flow { grid-template-columns: repeat(7, 170px); }
  .brandmark { min-width: 0; } .brandmark div { display: none; }
  .dgrid, .sgrid, .tgrid, .fgrid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .beats .beat { grid-template-columns: 30px minmax(0, 1fr); }
  .beats .beat .say, .beats .beat .src { grid-column: 2; }
  .pill.aios span:last-child { display: none; }
}

/* Số video mỗi link + ô góc bán */
.nvid { display: flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.nvid input.input { width: 56px; height: 40px; text-align: center; }
.gb { display: flex; flex-direction: column; gap: 4px; }
.gb-in { width: 100%; min-height: 52px; height: auto; padding: 8px; resize: vertical; box-sizing: border-box; }
.dong-ho { font-size: 13px; color: var(--muted); }
.dong-ho.vuot { color: var(--warn); font-weight: 600; }
