/* WZ Video Studio — theo "WZ Design System" (channel/studio/design/).
   Màu nói ai đang cầm việc: vàng = chờ bạn, tím = AI / máy, xanh = đạt, đỏ = lỗi / không nên. */

:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #f6f5f9; --panel: #ffffff; --sunken: #f0eef5; --ink: #26244a; --muted: #6c6985; --faint: #9a97ad;
  --line: #e6e3ee; --line2: #d6d2e2;
  --accent: #7a5af8; --accent-soft: #efeaff; --accent-ink: #5a3ce0;
  --you: #ffc83a; --you-soft: #fff5d6; --you-ink: #7a5300;
  --ok: #18864b; --ok-soft: #e5f5eb; --warn: #a8650a; --warn-soft: #fdf1dc; --bad: #c93a32; --bad-soft: #fcebea;
  --shadow: 0 1px 2px rgba(38,36,74,.05), 0 2px 8px rgba(38,36,74,.04);
  --shadow-lg: 0 24px 64px rgba(38,36,74,.18);
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0e17; --panel: #17161f; --sunken: #1f1d2b; --ink: #f1f0f7; --muted: #a3a0b8; --faint: #77748c;
  --line: #2a2839; --line2: #3a3750;
  --accent: #8b6dff; --accent-soft: #251f42; --accent-ink: #bcaaff;
  --you: #ffc83a; --you-soft: #2f2711; --you-ink: #ffd36a;
  --ok: #4ade80; --ok-soft: #10291b; --warn: #f5b54a; --warn-soft: #2c2210; --bad: #f87171; --bad-soft: #2d1515;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body {
  min-height: 100vh; display: flex; color: var(--ink);
  font: 14px/1.55 "Be Vietnam Pro", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
::placeholder { color: var(--faint); }
h1, h2, h3 { margin: 0; }
code { font-family: var(--mono); font-size: 12px; }
[hidden] { display: none !important; }
@keyframes wzspin { to { transform: rotate(360deg); } }
@keyframes wzpulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.spin { display: inline-block; animation: wzspin 1s linear infinite; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.pretty { text-wrap: pretty; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.dot { width: 10px; height: 10px; border-radius: 5px; flex: none; display: inline-block; }
.dot.sm { width: 7px; height: 7px; }

/* ---------- sidebar ---------- */
.side {
  width: 244px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px;
  padding: 20px 14px; border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; color: var(--ink); font-weight: 700; font-size: 15px; }
.brand:hover { text-decoration: none; }
.logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -.02em; flex: none; }
.logo.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }
/* chọn kênh (mỗi kênh: chủ đề, video, cài đặt riêng): xám khi chọn, không dùng tím (tím = AI đang làm) */
.ch-switch { display: flex; flex-direction: column; gap: 2px; }
.ch-switch:empty { display: none; }
.ch-switch button { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--muted); font-size: 13px; text-align: left; cursor: pointer; }
.ch-switch button:hover { background: var(--sunken); }
.ch-switch button.on { background: var(--panel); border-color: var(--line); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.ch-switch button .logo.sm { background: var(--muted); }
.ch-switch button.on .logo.sm { background: var(--accent); }
.ch-switch button i { font-size: 14px; color: var(--ok); }
.ch-select { width: auto; max-width: 150px; height: 32px; font-size: 13px; }
.topbar:has(.ch-select:not([hidden])) > b { display: none; } /* the channel name replaces "Video Studio" */
.topbar .ch-select { flex: 1; max-width: none; }
.search-btn {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--sunken); color: var(--muted); cursor: pointer; text-align: left;
}
.search-btn i { font-size: 16px; }
.search-btn span { flex: 1; }
kbd { font: 11px var(--mono); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: 10px; color: var(--ink); font-weight: 600;
}
.nav a:hover { background: var(--sunken); text-decoration: none; }
.nav a i { font-size: 19px; }
.nav a span:first-of-type { flex: 1; }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); }
.count {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--you); color: #3d2a00;
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.side-actions { display: flex; flex-direction: column; gap: 8px; }
.side-actions .btn { justify-content: center; }
.legend { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--sunken); font-size: 12px; color: var(--muted); }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend .dot { width: 8px; height: 8px; }
.side > * { flex-shrink: 0; } /* a long sidebar scrolls; its rows never get squeezed */
.tt-row { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 600; text-align: left; }
.tt-row:hover { background: var(--sunken); }
.tt-row i { font-size: 18px; }
.tt-row .grow { white-space: nowrap; flex: 1 0 auto; }
/* a channel admin with no channel yet: only "Tạo kênh" */
.no-channel .side-actions, .no-channel .tt-row, .no-channel #fab, .no-channel .legend { display: none !important; }
.tt-row > span:last-child { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ô mật khẩu có nút con mắt (hiện / ẩn) */
.pw { position: relative; display: flex; flex: 1; min-width: 0; }
.pw .inp { padding-right: 42px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { background: var(--sunken); color: var(--ink); }
.pw-eye i { font-size: 18px; }
.steps-guide { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.copy-box { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--sunken); font: 12px var(--mono); word-break: break-all; }
.copy-box span { flex: 1; }
.side-foot { display: flex; gap: 8px; }
.side-foot input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; }
.me-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; }
.me-btn:hover { background: var(--sunken); }
.me-btn .av { width: 24px; height: 24px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.me-btn b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- người dùng (#/users) ---------- */
.users { display: flex; flex-direction: column; gap: 10px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.user-row.off { opacity: .6; }
.user-row .av { width: 36px; height: 36px; border-radius: 18px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.user-row .who { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.role-help { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--sunken); font-size: 12px; color: var(--muted); }
.role-help b { color: var(--ink); }
.ch-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* hồ sơ sản phẩm: "Dán brief, AI điền" (tím = AI) */
.ai-brief { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--accent-soft); background: var(--accent-soft); }
.ai-brief summary { cursor: pointer; font-weight: 700; color: var(--accent-ink); display: flex; align-items: center; gap: 6px; }
.ai-brief .inp { background: var(--panel); }
.open-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.form label.open-it { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; text-align: center; min-width: 0; }
.form label.open-it span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form label.open-it.on { border-color: var(--accent); background: var(--accent-soft); }
.open-it input { position: absolute; top: 6px; left: 6px; }
.open-it img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.inp.ai-filled { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- mobile chrome ---------- */
.topbar { display: none; align-items: center; gap: 10px; margin-bottom: 18px; }
.topbar .logo { width: 30px; height: 30px; font-size: 12px; }
.topbar b { flex: 1; }
.bottomnav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line);
}
.bottomnav a {
  flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; font-size: 11px; font-weight: 600; color: var(--muted);
}
.bottomnav a:hover { text-decoration: none; }
.bottomnav a i { font-size: 22px; }
.bottomnav a.on { color: var(--accent-ink); }
.bottomnav .count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }

/* ---------- main ---------- */
main { flex: 1; min-width: 0; padding: clamp(16px, 3vw, 36px); }
.wrap { max-width: 1240px; margin: 0 auto; }
.page { display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1; min-width: 200px; }
h1 { font-size: 26px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; text-wrap: pretty; }
h1.detail { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.3; }
h2 { font-size: 16px; font-weight: 700; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.label-up { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--ink);
}
.btn:hover { border-color: var(--line2); background: var(--sunken); text-decoration: none; }
.btn.primary { border: 0; background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.danger { border: 0; background: var(--bad); color: #fff; font-weight: 700; }
.btn.danger-text { color: var(--bad); }
.btn.sm { height: 32px; padding: 0 12px; border-radius: 9px; font-size: 13px; }
.btn.md { height: 36px; }
.btn.lg { height: 44px; padding: 0 20px; border-radius: 12px; font-weight: 700; font-size: 15px; justify-content: center; }
.btn.lg i { font-size: 18px; }
.btn.icon { width: 38px; padding: 0; justify-content: center; }
.btn.icon.sm { width: 32px; }
.btn.link { border: 0; background: none; padding: 0 4px; color: var(--accent-ink); }
.btn:disabled, .btn[aria-disabled="true"] { border: 0; background: var(--sunken); color: var(--faint); cursor: not-allowed; filter: none; }
.busy-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 13px; white-space: nowrap;
}

/* ---------- tags, scores ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.tag.b { font-weight: 700; }
.tag.big { padding: 3px 9px; border-radius: 7px; font-weight: 700; }
.score {
  width: 52px; height: 52px; border-radius: 12px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--sunken); color: var(--muted);
}
.score b { font-size: 19px; font-weight: 800; line-height: 1; }
.score small { font-size: 10px; font-weight: 600; margin-top: 3px; opacity: .85; }
.score.xl { width: 64px; height: 64px; border-radius: 14px; }
.score.xl b { font-size: 24px; }
.c-you { background: var(--you-soft); color: var(--you-ink); }
.c-ai { background: var(--accent-soft); color: var(--accent-ink); }
.c-ok { background: var(--ok-soft); color: var(--ok); }
.c-warn { background: var(--warn-soft); color: var(--warn); }
.c-bad { background: var(--bad-soft); color: var(--bad); }
.c-done { background: var(--sunken); color: var(--muted); }


/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.card.pad { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card.flat { box-shadow: none; }
.list { display: flex; flex-direction: column; overflow: hidden; }
.list > .li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list > .li:first-child { border-top: 0; }
.empty-box { display: flex; align-items: center; gap: 16px; padding: 24px; background: var(--panel); border: 1px dashed var(--line2); border-radius: 14px; color: var(--muted); }
.empty-box b { color: var(--ink); display: block; }
.empty-box img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.mascot { object-fit: contain; flex: none; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col-main { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.col-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }

/* ---------- home ---------- */
.hello { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hello img { width: 64px; height: 64px; }
.hello > div { flex: 1; min-width: 220px; }
.pipeline { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; padding: 6px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pipeline a { flex: 1 1 120px; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.pipeline a:hover { text-decoration: none; filter: brightness(.97); background: var(--sunken); }
.pipeline a.hot, .pipeline a.hot:hover { background: var(--you-soft); }
.pipeline .own { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.pipeline .n { font-size: 22px; font-weight: 800; line-height: 1.2; }
.pipeline .l { font-size: 12px; color: var(--muted); line-height: 1.3; }
.blk-head { display: flex; align-items: center; gap: 8px; }
.blk-head span:last-child { color: var(--muted); }
.todo-open { flex: 1 1 280px; min-width: 0; display: flex; align-items: center; gap: 14px; color: var(--ink); }
.todo-open:hover { text-decoration: none; }
.todo-open b { font-weight: 600; line-height: 1.4; display: block; text-wrap: pretty; }
.thumb-sm { width: 40px; height: 56px; border-radius: 7px; flex: none; border: 1px solid var(--line); background: var(--sunken); overflow: hidden; }
.thumb-sm img, .vcard .thumb img { display: block; width: 600%; max-width: none; height: auto; }
.ico-box { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 20px; }
.job { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.job:last-child { border-bottom: 0; }
.job-head { display: flex; align-items: center; gap: 8px; }
.job-head a { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); }
.bar { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.bar > div { height: 100%; border-radius: 3px; background: var(--accent); transition: width .6s; }
.steps { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.steps div { display: flex; align-items: center; gap: 8px; }
.steps i { font-size: 14px; flex: none; }
.st-done { color: var(--ok); } .st-now { color: var(--accent-ink); } .st-todo { color: var(--faint); } .st-bad { color: var(--bad); }
.queue-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--accent-soft); border-top: 1px solid var(--line); }
.queue-row:first-child { border-top: 0; }
.radar-stats { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.radar-stats b { color: var(--ink); }

/* ---------- tabs, search ---------- */
.seg { display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--sunken); flex-wrap: wrap; }
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px; border: 0; cursor: pointer;
  font-weight: 600; font-size: 13px; background: transparent; color: var(--muted);
}
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.seg button span.n { color: var(--faint); font-weight: 500; }
.seg.full button { flex: 1; height: 32px; }
.search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.search i { color: var(--faint); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; }
.utabs { display: flex; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.utabs button { flex: none; height: 40px; padding: 0 14px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.utabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- topics ---------- */
.alert { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--bad-soft); }
.alert > i { font-size: 20px; color: var(--bad); margin-top: 1px; }
.alert > div { flex: 1 1 280px; min-width: 0; }
.topic-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 16px; }
.topic-open { flex: 1 1 360px; min-width: 0; display: flex; gap: 14px; align-items: flex-start; color: var(--ink); }
.topic-open:hover { text-decoration: none; }
.topic-open:hover .tt { color: var(--accent-ink); }
.topic-open .body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tt { font-size: 15px; font-weight: 700; line-height: 1.4; text-wrap: pretty; }
.topic-open .line { opacity: .85; line-height: 1.5; text-wrap: pretty; }
.acts { display: flex; gap: 8px; flex: none; margin-left: auto; flex-wrap: wrap; }
.sticky-bar { position: sticky; top: 12px; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; border: 1px solid transparent; box-shadow: var(--shadow); }
.sticky-bar > i { font-size: 20px; }
.sticky-bar > div:nth-child(2) { flex: 1 1 240px; min-width: 0; font-weight: 600; text-wrap: pretty; }
.b-you { background: var(--you-soft); border-color: var(--you) !important; }
.b-you > i, .b-you .bar-ico { color: var(--you-ink); }
.b-ai { background: var(--accent-soft); }
.b-ai > i, .b-ai .bar-ico { color: var(--accent-ink); }
.b-ok { background: var(--ok-soft); }
.b-ok > i, .b-ok .bar-ico { color: var(--ok); }
.b-bad { background: var(--bad-soft); border-color: var(--bad) !important; }
.b-bad > i, .b-bad .bar-ico { color: var(--bad); }
.b-done { background: var(--sunken); }
.b-done > i, .b-done .bar-ico { color: var(--muted); }
.eval-head { display: flex; gap: 16px; align-items: center; padding: 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.eval-body { padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.angle { font-size: 17px; font-weight: 600; line-height: 1.5; text-wrap: pretty; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.sunk { padding: 14px; border-radius: 12px; background: var(--sunken); }
.sunk > div:first-child { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.reason, .fact { display: flex; gap: 10px; align-items: flex-start; }
.reason i, .fact i { font-size: 16px; margin-top: 2px; flex: none; }
.fact { padding: 8px 0; border-top: 1px solid var(--line); }
.fact span { flex: 1; text-wrap: pretty; }
.fact a { font-size: 12px; flex: none; white-space: nowrap; }
.num { width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.risks { padding: 16px 18px; border-radius: 14px; background: var(--warn-soft); display: flex; flex-direction: column; gap: 8px; }
.risks > div:first-child { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--warn); }
.risks > div:not(:first-child) { padding-left: 24px; text-wrap: pretty; }
.src { display: flex; flex-direction: column; gap: 2px; padding: 10px; margin: 0 -10px; border-radius: 10px; color: var(--ink); }
.src:hover { background: var(--sunken); text-decoration: none; }
.src .m { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.src b { font-weight: 600; line-height: 1.4; text-wrap: pretty; }
.bk { display: grid; grid-template-columns: 130px 1fr 36px; align-items: center; gap: 10px; font-size: 13px; }
.bk > span:first-child { color: var(--muted); }
.bk .track { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.bk .track span { display: block; height: 100%; border-radius: 3px; }
.bk > span:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
details.card { padding: 14px 18px; }
details summary { cursor: pointer; font-weight: 700; }
.hist { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.hist div { display: flex; gap: 10px; font-size: 13px; }
.hist div span:first-child { color: var(--faint); flex: none; width: 84px; }
.field { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--sunken); resize: vertical; outline: 0; }
.field:focus, .inp:focus { border-color: var(--accent); }

/* ---------- videos board ---------- */
.lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; }
.lane { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: var(--sunken); }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 2px; }
.lane-head b { flex: 1; }
.vcard { display: flex; gap: 12px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.vcard:hover { border-color: var(--line2); text-decoration: none; }
.vcard .thumb, .vcard .noimg { width: 64px; height: 96px; border-radius: 8px; flex: none; background: var(--sunken); overflow: hidden; }
.vcard .noimg { display: grid; place-items: center; color: var(--faint); font-size: 22px; }
.vcard .body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vcard .body b { font-weight: 700; line-height: 1.4; text-wrap: pretty; }
.vcard .tag { align-self: flex-start; }
.lane-empty { padding: 18px; text-align: center; border: 1px dashed var(--line2); border-radius: 12px; color: var(--faint); font-size: 13px; }

/* ---------- video review ---------- */
/* stacked by default; side by side (and the player pinned while scrolling) only when both columns fit.
   Pinning a stacked player made it slide over the review panel below it. */
.vgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.pcol { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 12px; }
.dcol { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.vgrid.live .pcol { max-width: none; }
@media (min-width: 1180px) {
  .vgrid { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
  .pcol { position: sticky; top: 16px; }
  .vgrid.live { grid-template-columns: minmax(0, 1fr); }
  .vgrid.live .pcol { position: static; }
}
.screen { position: relative; width: 100%; aspect-ratio: 9/16; border-radius: 18px; overflow: hidden; background: #111; box-shadow: var(--shadow-lg); }
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.screen .big-play { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.screen .big-play span { width: 68px; height: 68px; border-radius: 34px; background: rgba(20,18,40,.72); color: #fff; display: grid; place-items: center; }
.screen .big-play i { font-size: 28px; margin-left: 4px; }
.screen .none { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #cfcbe6; text-align: center; padding: 20px; }
.screen .none img { width: 96px; height: 96px; }
.live-box { width: 100%; height: min(78vh, 900px); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); position: relative; }
.live-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.live-chip { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 600; }
.live-chip span { width: 7px; height: 7px; border-radius: 4px; background: #ff5a5a; animation: wzpulse 1.2s infinite; }
.controls { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.controls .r { display: flex; align-items: center; gap: 10px; }
.play-btn { width: 36px; height: 36px; border-radius: 18px; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.seek { flex: 1; position: relative; height: 28px; cursor: pointer; touch-action: none; }
.seek .rail { position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--sunken); }
.seek .fill { position: absolute; left: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--accent); }
.seek .mk { position: absolute; top: 5px; width: 6px; height: 18px; margin-left: -3px; border-radius: 3px; background: var(--you); border: 1px solid #c99400; }
.seek .knob { position: absolute; top: 7px; width: 14px; height: 14px; margin-left: -7px; border-radius: 7px; background: #fff; border: 2px solid var(--accent); }
.tnum { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); flex: none; }
.vbar { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 16px; border: 1px solid transparent; }
.vbar-head { display: flex; align-items: flex-start; gap: 10px; }
.vbar-head > i { font-size: 22px; margin-top: 1px; }
.vbar-head b { font-size: 16px; display: block; text-wrap: pretty; }
.vbar .acts { margin-left: 0; width: 100%; }
.vbar .acts .btn.lg { flex: 1 1 160px; }
.errlog { font: 12px/1.6 var(--mono); padding: 10px 12px; border-radius: 10px; background: var(--panel); color: var(--bad); white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }
.cmt { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; background: var(--sunken); }
.tpin { flex: none; height: 26px; padding: 0 8px; border-radius: 7px; border: 0; background: var(--you); color: #3d2a00; font-weight: 700; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums; }
.tpin.general { background: var(--line); color: var(--muted); cursor: default; }
.composer { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; border: 1px solid var(--line2); }
.composer textarea { width: 100%; border: 0; outline: 0; background: none; resize: vertical; }
.pin-btn { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; font-size: 12px; font-weight: 600; background: var(--panel); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.pin-btn.on { background: var(--you-soft); color: var(--you-ink); }
.script-ta { width: 100%; min-height: 320px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--sunken); font: 13px/1.7 var(--mono); resize: vertical; outline: 0; }
.chipbtn { height: 28px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 12px; font-weight: 600; }
.chipbtn:hover { border-color: var(--accent); }
.kv { display: grid; grid-template-columns: minmax(0, 130px) minmax(0, 1fr); gap: 12px; }
.kv > span:first-child { font-size: 13px; color: var(--muted); }
.kv > span:last-child { white-space: pre-line; text-wrap: pretty; }
.prod-step { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.prod-step i { font-size: 18px; }
.prod-step b { flex: 1; font-weight: 600; }
.prod-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 8px; }
.prod-act { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; }
.prod-act:hover:not(:disabled) { border-color: var(--accent); }
.prod-act:disabled { opacity: .5; cursor: not-allowed; }
.prod-act i { font-size: 18px; color: var(--accent); }
.prod-act span { display: flex; flex-direction: column; }
.prod-act small { font-size: 12px; color: var(--muted); }
.term { padding: 12px 14px; border-radius: 12px; background: #15131f; color: #d9d6ea; font: 12px/1.7 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }
.term .ok { color: #7ee2a8; } .term .bad { color: #ff8f86; }
.sheet-img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.inp { height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel); font-weight: 400; outline: 0; width: 100%; }
textarea.inp { height: auto; padding: 10px 12px; resize: vertical; }
select.inp { padding: 0 8px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { flex-direction: row !important; align-items: center; font-weight: 500 !important; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; font-weight: 600; font-size: 13px; cursor: pointer; border: 1px solid var(--line); background: var(--panel); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.chip.solid.on { background: var(--accent); color: #fff; }
.chip .n { opacity: .6; font-weight: 500; }
.note-warn { font-size: 13px; padding: 10px 12px; border-radius: 10px; }

/* ---------- library ---------- */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.asset { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.asset:hover { border-color: var(--accent); }
/* always light: mono logos are black (currentColor) and would vanish on the dark theme */
.asset .prev { aspect-ratio: 1; border-radius: 8px; background: #f0eef5; display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.asset .prev.dark { background: #26244a; }
.asset .prev img, .asset .prev video { width: 90%; height: 90%; object-fit: contain; }
.asset .prev i { font-size: 34px; color: #6c6985; }
.asset .prev .font { font-size: 26px; color: #26244a; }
.asset audio { width: 100%; height: 32px; }
.asset .name { font: 500 12px var(--mono); word-break: break-all; cursor: pointer; }
.asset .name:hover { color: var(--accent-ink); }
.asset .info { font-size: 12px; color: var(--muted); }
.asset .warn { color: var(--warn); }

/* ---------- AI assistant ---------- */
.fab {
  position: fixed; right: 20px; bottom: 24px; z-index: 31; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 6px;
  border-radius: 24px; border: 0; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; box-shadow: 0 10px 30px rgba(122,90,248,.4);
}
.fab img { width: 36px; height: 36px; border-radius: 18px; background: #fff; object-fit: cover; object-position: 50% 8%; }
.fab .busy-dot { width: 9px; height: 9px; border-radius: 5px; background: var(--you); animation: wzpulse 1.2s infinite; }
.ai-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(420px, 100%); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ai-head img { width: 38px; height: 38px; border-radius: 19px; background: var(--accent-soft); object-fit: cover; object-position: 50% 8%; }
.ai-head .ctx { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-log { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.next-btn { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent-soft); cursor: pointer; text-align: left; width: 100%; }
.next-btn > i { font-size: 20px; color: var(--accent-ink); }
.next-btn b { display: block; color: var(--accent-ink); }
.next-btn small { display: block; font-size: 12px; color: var(--muted); }
.sugg { text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 13px; }
.sugg:hover { border-color: var(--accent); }
.msg { max-width: 92%; display: flex; flex-direction: column; gap: 6px; }
.msg.user { align-self: flex-end; }
.msg.ai { align-self: flex-start; }
.bubble { padding: 10px 14px; border-radius: 14px; white-space: pre-line; text-wrap: pretty; background: var(--sunken); overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--accent); color: #fff; }
.msg.ai.failed .bubble { background: var(--bad-soft); }
.msg .meta { font-size: 11px; color: var(--faint); }
.msg.user .meta { text-align: right; }
.stepbox { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--sunken); font-size: 12px; }
.stepbox div { display: flex; align-items: center; gap: 8px; }
.stepbox summary { font-weight: 600; font-size: 12px; color: var(--muted); }
.ai-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.ai-pin { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
.ai-pin.on { color: var(--you-ink); }
.ai-input { display: flex; gap: 8px; align-items: flex-end; padding: 8px; border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); }
.ai-input textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: none; resize: none; }
.send-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; flex: none; }
.send-btn:disabled { background: var(--sunken); color: var(--faint); cursor: not-allowed; }

/* ---------- overlays ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(15,14,30,.45); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.scrim.center { z-index: 60; align-items: center; padding: 16px; }
.cmdk { width: min(620px, 100%); border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.cmdk-in i { font-size: 18px; color: var(--faint); }
.cmdk-in input { flex: 1; min-width: 0; height: 54px; border: 0; outline: 0; background: none; font-size: 16px; }
.cmdk-list { max-height: min(420px, 60vh); overflow: auto; padding: 8px; }
.cmdk-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.cmdk-item { width: 100%; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 10px; border-radius: 10px; border: 0; cursor: pointer; text-align: left; background: transparent; }
.cmdk-item i { font-size: 18px; }
.cmdk-item span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item span:last-child { font-size: 12px; color: var(--faint); flex: none; }
.cmdk-item.sel { background: var(--accent-soft); color: var(--accent-ink); }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.dialog { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dlg-head { display: flex; align-items: flex-start; gap: 10px; }
.dlg-head > div { flex: 1; }
.dlg-head b { font-size: 18px; font-weight: 800; display: block; }
.dlg-x { width: 32px; height: 32px; border-radius: 8px; border: 0; background: var(--sunken); cursor: pointer; display: grid; place-items: center; flex: none; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dlg-foot .btn { height: 40px; padding: 0 16px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 28px; z-index: 70; display: flex; align-items: center; gap: 12px;
  max-width: calc(100% - 32px); padding: 10px 12px 10px 16px; border-radius: 12px; background: #26244a; color: #fff; box-shadow: var(--shadow-lg);
}
.toast > i { color: #7ee2a8; font-size: 18px; }
.toast.bad > i { color: #ff8f86; }
.toast button { height: 30px; padding: 0 10px; border-radius: 8px; border: 0; background: rgba(255,255,255,.14); color: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; }

/* ---------- loading / error ---------- */
.skel { background: var(--sunken); animation: wzpulse 1.4s ease-in-out infinite; border-radius: 8px; }
.fatal { display: flex; justify-content: center; padding: clamp(16px, 8vh, 72px) 0; }
.fatal > div { width: min(540px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: clamp(20px, 4vw, 36px); }
.fatal img { width: 96px; height: 96px; }
.fatal pre { width: 100%; text-align: left; margin: 0; font: 12px/1.6 var(--mono); padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); white-space: pre-wrap; word-break: break-word; }

/* ---------- phone ---------- */
@media (max-width: 759px) {
  .side { display: none; }
  .topbar { display: flex; }
  .bottomnav { display: flex; }
  .wrap { padding-bottom: 84px; }
  .fab { bottom: 84px; padding: 0 6px; }
  .fab-t { display: none; }
  .toast { bottom: 92px; }
  .btn, .seg button { min-height: 40px; }
  .form .two { grid-template-columns: 1fr; }
  .bk { grid-template-columns: 110px 1fr 36px; }
}

/* voices (Thư viện → Giọng đọc, Đổi giọng) */
.asset.voice { justify-content: space-between; }
.asset.voice.def { border-color: var(--ok); }
.vplay { flex: none; width: 38px; height: 38px; border-radius: 19px; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--accent-soft); color: var(--accent-ink); font-size: 16px; }
.vplay:hover, .vplay.on { background: var(--accent); color: #fff; }
.voice-list { max-height: 340px; overflow: auto; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.vrow { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; cursor: pointer; font-weight: 500 !important; }
.vrow:hover { background: var(--sunken); }
.vrow:has(input:checked) { background: var(--accent-soft); }

/* ảnh bìa */
.cover-card { display: flex; gap: 12px; align-items: center; padding: 10px; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.cover-thumb { flex: none; width: 72px; height: 128px; object-fit: cover; border-radius: 8px; background: var(--sunken); display: block; }
.cover-thumb.none { display: grid; place-items: center; align-content: center; gap: 4px; color: var(--muted); font-size: 12px; }

/* phong cách (channel/styles): thẻ chọn có khung hình mẫu 9:16 */
.style-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.form label.style-opt { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 500; }
.style-opt:hover { border-color: var(--accent); }
.style-opt input { position: absolute; opacity: 0; pointer-events: none; }
.style-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.style-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.style-opt img, .style-opt .noprev { width: 100%; height: 150px; object-fit: cover; object-position: top; border-radius: 8px; background: var(--sunken); }
.style-opt .noprev { display: grid; place-items: center; color: var(--faint); font-size: 28px; }
.style-opt b { font-size: 13px; }
.style-opt .tiny { line-height: 1.4; font-weight: 400; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.style-opt .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.asset.style { justify-content: space-between; }
.asset.style.def { border-color: var(--ok); }
.asset.style .sprev { width: 100%; height: 220px; object-fit: cover; object-position: top; border-radius: 8px; background: var(--sunken); }

/* Claude accounts: quota of each subscription (5-hour and 7-day windows) */
.acc-row { display: flex; flex-direction: column; gap: 6px; }
.acc-row.off { opacity: .55; }
.acc-list .acc-row { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.acc-list { gap: 10px; }
.quota { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 8px; }
.quota .bar > div { transition: width .6s, background .3s; }
.ellipsis { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quota .bar { position: relative; }
.quota .bar .tick { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); opacity: .3; z-index: 1; }
.acc-rules { padding: 12px; border-radius: 12px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- kênh: Tạo kênh / Cài đặt kênh ---------- */
.ch-acts { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.ch-switch .ch-acts button, .ch-acts a { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px 0 11px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ch-switch .ch-acts button:hover, .ch-acts a:hover { background: var(--sunken); color: var(--ink); text-decoration: none; }
.ch-acts a.on { background: var(--panel); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow); }
.ch-switch .ch-acts i { font-size: 14px; color: inherit; }
.wz-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.wz-steps span { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--sunken); color: var(--muted); font-size: 12px; font-weight: 600; }
.wz-steps span b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 9px; background: var(--line2); color: var(--panel); font-size: 11px; }
.wz-steps span.on { background: var(--accent-soft); color: var(--accent-ink); }
.wz-steps span.on b { background: var(--accent); color: #fff; }
.wz-steps span.done { color: var(--ok); }
.fl { font-size: 13px; font-weight: 600; }
.pl-list { display: flex; flex-direction: column; gap: 10px; }
.pl-row { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.pl-row .pl-ico { flex: none; font-size: 18px; color: var(--accent-ink); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; padding: 6px; border-radius: 10px; background: var(--sunken); }
.icon-grid[hidden] { display: none; }
.icon-grid button { height: 34px; border-radius: 8px; border: 1px solid transparent; background: var(--panel); font-size: 17px; cursor: pointer; color: var(--muted); }
.icon-grid button:hover { color: var(--ink); border-color: var(--line2); }
.icon-grid button.on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.sty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sty-card { display: flex; flex-direction: column; gap: 5px; padding: 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel); }
.sty-card.def { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sty-card img, .sty-card .noprev { width: 100%; height: 140px; object-fit: cover; object-position: top; border-radius: 8px; background: var(--sunken); }
.sty-card .noprev { display: grid; place-items: center; color: var(--faint); font-size: 28px; }
.sty-card b { font-size: 13px; }
.sty-card .clamp { line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.form .sty-card label.check { gap: 6px; font-weight: 500; }
.src-list { display: flex; flex-direction: column; gap: 10px; }
.src-row { display: flex; flex-direction: column; gap: 6px; }
.src-res { font-size: 12px; }
.src-res:empty { display: none; }
.src-res ul { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.src-res li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-ok, .src-err { display: flex; gap: 6px; align-items: flex-start; }
.src-ok i { color: var(--ok); font-size: 15px; flex: none; }
.src-err { color: var(--bad); }
.src-err i { font-size: 15px; flex: none; }
.src-res .btn { margin-top: 6px; }
.src-cur { display: flex; flex-direction: column; gap: 10px; }
.src-cur .src-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.draft-box { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; border: 1px solid; }
textarea.inp.mono { font-size: 12.5px; line-height: 1.5; }
#ch-page .card.pad { gap: 12px; }
.src-fold summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 4px 0; }
.src-fold[open] summary { margin-bottom: 10px; }

/* thanh tốc độ đọc (×0,7 – ×1,3) */
input.speed { display: block; width: 100%; margin: 10px 0 2px; accent-color: var(--ink); }
.speed-v { font-weight: 700; }

/* ADN của phong cách (Thư viện → Phong cách) */
ul.dna { margin: 8px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.5; color: var(--muted); }
ul.dna li::marker { color: var(--faint); }

/* ---------- sản phẩm (video theo yêu cầu) ---------- */
.dialog.wide { width: min(720px, 100%); }
.prods { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.prod b { font-size: 15px; }
.prod-logo { width: 52px; height: 52px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: #fff; object-fit: contain; padding: 4px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--muted); }
.prod-shots { display: flex; gap: 6px; }
.prod-shots img { width: 64px; height: 96px; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); }
.prod-add { align-items: flex-start; text-align: left; cursor: pointer; border-style: dashed; color: var(--ink); font: inherit; }
.prod-add:hover { border-color: var(--accent); }
.prod-add i { font-size: 26px; color: var(--accent); }
.prod-media { display: flex; flex-direction: column; gap: 8px; }
.prod-media .pm { display: flex; align-items: center; gap: 10px; }
.prod-media .pm img { width: 56px; height: 56px; flex: none; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: var(--sunken); }
.prod-media .pm .inp { flex: 1; min-width: 0; }
.form label.btn { cursor: pointer; display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; }

/* Phong cách mới từ video mẫu (#/style/…): hai cách vào, form nháp + bảng màu xem nhanh */
.sd-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.sd-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.sd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 20px; align-items: start; }
.sd-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) { .sd-grid { grid-template-columns: 1fr; } .sd-side { position: static; max-width: 220px; } }
.sd-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.form label.sd-color { flex-direction: row; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-weight: 500; }
.sd-color span { display: flex; flex-direction: column; line-height: 1.3; }
.sd-color input[type=color], .sd-bg input[type=color] { width: 40px; height: 32px; padding: 0; border: 1px solid var(--line2); border-radius: 8px; background: none; cursor: pointer; }
.sd-bg { display: inline-flex; align-items: center; gap: 2px; }
.sd-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sd-frames { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.sd-frames figure { margin: 0; flex: none; text-align: center; }
.sd-frames img { height: 160px; border-radius: 8px; display: block; background: var(--sunken); }
.form label.chip.check { gap: 6px; cursor: pointer; }
.sw-prev { position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 220px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.sw-prev.big { max-height: none; }
.sw-card { position: absolute; left: 10%; right: 10%; top: 16%; padding: 10% 8%; border-radius: 10px; display: flex; flex-direction: column; gap: 8%; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.sw-card > i { display: block; height: 10px; width: 80%; border-radius: 4px; }
.sw-card > i.s { width: 55%; height: 7px; opacity: .8; }
.sw-ask { align-self: flex-end; width: 60%; height: 18px; border-radius: 9px 9px 3px 9px; }
.sw-pill { display: flex; align-items: center; gap: 6px; padding: 4px; border: 2px solid; border-radius: 8px; }
.sw-pill b { width: 34%; height: 10px; border-radius: 4px; }
.sw-pill i { width: 8px; height: 8px; border-radius: 50%; }
.sw-cap { position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%); padding: 2px 10px; border-radius: 9px; background: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; }
.sw-dots { position: absolute; left: 0; right: 0; bottom: 3%; display: flex; justify-content: center; gap: 3px; }
.sw-dots i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.asset.style.off { opacity: .6; }
