:root {
  --bg: #0b0b14;
  --bg2: #11111d;
  --card: #161625;
  --card2: #1d1d30;
  --line: #2a2a42;
  --text: #ececf5;
  --muted: #9a9ab3;
  --acc: #7c5cff;
  --acc2: #22d3ee;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Be Vietnam Pro', system-ui, sans-serif; font-size: 15px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grad { background: linear-gradient(90deg, var(--acc), var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card2); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: #3d3d5c; background: #24243a; }
.btn.primary { background: linear-gradient(135deg, var(--acc), #5b3df5); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; }
.btn.danger { color: #fca5a5; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 24px; font-size: 16px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label.f { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; font-weight: 500; }
.input, select.input, textarea.input { width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
.input:focus { border-color: var(--acc); }
.pw-wrap { position: relative; display: block; flex: 1; min-width: 0; }
.pw-wrap > input { padding-right: 42px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted, #94a3b8); cursor: pointer; padding: 0; }
.pw-eye:hover { color: var(--text); background: rgba(255,255,255,.06); }
textarea.input { resize: vertical; min-height: 180px; line-height: 1.6; }
.field { margin-bottom: 14px; }
input[type=range] { width: 100%; accent-color: var(--acc); }
input[type=checkbox] { accent-color: var(--acc); width: 16px; height: 16px; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 14px; }

/* ---------- landing ---------- */
.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 14px 32px; background: rgba(11,11,20,.8); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--acc), var(--acc2)); display: grid; place-items: center; }
.nav-links { display: flex; gap: 22px; color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); }
.hero { max-width: 1100px; margin: 0 auto; padding: 90px 24px 70px; text-align: center; position: relative; }
.hero::before { content: ''; position: absolute; inset: 0 10% auto; height: 420px; background: radial-gradient(closest-side, rgba(124,92,255,.28), transparent); z-index: -1; filter: blur(20px); }
.pill-credit { text-decoration: none; cursor: pointer; }
.pill-credit:hover { border-color: var(--acc); color: var(--text); }
.topup-btn { display: inline-flex; white-space: nowrap; }
#logout .lo-ic { display: none; }
@media (max-width: 520px) { #logout .lo-ic { display: inline; font-size: 15px; } #logout .lo-t { display: none; } #logout { padding: 6px 10px; } }
.pill { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; color: var(--muted); background: var(--bg2); }
.hero h1 { font-size: clamp(34px, 6vw, 62px); line-height: 1.12; margin: 22px 0 18px; font-weight: 800; letter-spacing: -1px; }
.hero p { font-size: 18px; color: var(--muted); max-width: 680px; margin: 0 auto 30px; }
.hero .row { justify-content: center; }
.ticks { display: flex; gap: 22px; justify-content: center; margin-top: 24px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.ticks span::before { content: '✓ '; color: var(--ok); }
.wave { display: flex; gap: 5px; justify-content: center; align-items: center; height: 60px; margin: 46px auto 0; }
.wave i { width: 5px; border-radius: 4px; background: linear-gradient(var(--acc), var(--acc2)); animation: wv 1.2s ease-in-out infinite; }
@keyframes wv { 0%,100% { height: 12px; } 50% { height: 56px; } }
.section { max-width: 1100px; margin: 0 auto; padding: 70px 24px; }
.section h2 { text-align: center; font-size: 34px; margin: 0 0 10px; }
.section > p.sub { text-align: center; color: var(--muted); margin: 0 0 40px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: .2s; }
.feat:hover { transform: translateY(-3px); border-color: #3d3d5c; }
.feat .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: rgba(124,92,255,.15); margin-bottom: 14px; }
.feat h3 { margin: 0 0 6px; font-size: 18px; }
.feat p { margin: 0; color: var(--muted); font-size: 14px; }
.steps .num { font-size: 40px; font-weight: 800; }
.price { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; text-align: center; position: relative; }
.price.pop { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc), 0 20px 50px -20px rgba(124,92,255,.5); }
.price .tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--acc); color: #fff; font-size: 12px; padding: 3px 12px; border-radius: 99px; font-weight: 700; }
.price .vnd { font-size: 34px; font-weight: 800; margin: 10px 0 4px; }
.price .cr { color: var(--acc2); font-weight: 700; }
.cta { text-align: center; background: linear-gradient(135deg, rgba(124,92,255,.18), rgba(34,211,238,.1)); border: 1px solid var(--line); border-radius: 22px; padding: 56px 24px; }
.footer { border-top: 1px solid var(--line); padding: 28px 32px; color: var(--muted); font-size: 13px; display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px; }
.auth h2 { margin: 18px 0 4px; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 4px 10px 18px; }
.side a.item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 14px; }
.side a.item:hover { background: var(--card); color: var(--text); }
.side a.item.on { background: rgba(124,92,255,.16); color: #fff; }
.side .sep { height: 1px; background: var(--line); margin: 10px 6px; }
.side .credit-box { margin-top: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.credit-box .n { font-size: 22px; font-weight: 800; }
.main { padding: 26px 32px 60px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.topbar h1 { font-size: 24px; margin: 0; white-space: nowrap; flex-shrink: 0; }
.mobile-nav { display: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 14px; font-size: 16px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.two.eq { grid-template-columns: 1fr 1fr; }
.two.sp { grid-template-columns: 260px 1fr; }
.stack > * + * { margin-top: 18px; }
.cost { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--bg2); border-radius: 10px; margin: 6px 0 14px; font-size: 14px; }
.cost b { color: var(--acc2); }
.voice-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.voice-btn:hover { border-color: var(--acc); }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; }
.slider-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

/* ---------- jobs ---------- */
.job { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.job + .job { margin-top: 10px; }
.job .t { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job audio, .job video { width: 100%; margin-top: 10px; height: 40px; }
.job video { height: auto; max-height: 360px; border-radius: 8px; background: #000; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--card2); color: var(--muted); }
.badge.done { background: rgba(34,197,94,.15); color: #86efac; }
.badge.failed { background: rgba(239,68,68,.15); color: #fca5a5; }
.badge.processing, .badge.queued, .badge.waiting { background: rgba(245,158,11,.15); color: #fcd34d; }
.bar { height: 5px; background: var(--bg2); border-radius: 9px; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); transition: width .4s; }
.bar.indet i { width: 35% !important; animation: indet 1.3s infinite ease-in-out; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.err { color: #fca5a5; font-size: 13px; margin-top: 8px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }

/* ---------- dialogue ---------- */
.spk { display: grid; grid-template-columns: 120px 1fr 170px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.turn { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.turn textarea { min-height: 44px; }

/* ---------- table ---------- */
table.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
.tb th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tb td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tb tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat .n { font-size: 24px; font-weight: 800; margin-top: 4px; }

/* ---------- modal / voice picker ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-box { width: 100%; max-width: 760px; max-height: 88vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.mh { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.mb { padding: 12px 20px 20px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
/* cửa sổ có <form> bọc cả đầu + thân: form phải co theo chiều cao cửa sổ để phần thân cuộn được (thấy nút Lưu / Tạo) */
.modal-box > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; max-height: 100%; }
.modal-box > form > .mh, .modal-box > .mh { flex: none; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); cursor: pointer; font-size: 13px; background: transparent; }
.tab.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.vlist .v { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; cursor: pointer; }
.vlist .v:hover { background: var(--card2); }
.vlist .v .meta { flex: 1; min-width: 0; }
.vlist .v .meta .d { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; flex: none; display: grid; place-items: center; font-size: 12px; }
.play:hover { border-color: var(--acc); }
.qr { background: #fff; border-radius: 12px; padding: 10px; width: 240px; max-width: 100%; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.kv b { font-weight: 600; word-break: break-all; }

/* ---------- chat ---------- */
.chat-fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; font-size: 24px;
  background: linear-gradient(135deg, var(--acc), #5b3df5); box-shadow: 0 10px 30px rgba(124,92,255,.45); }
/* nút Zalo nổi */
.zalo-fab { position: fixed; right: 22px; bottom: 22px; z-index: 39; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: #0068ff; box-shadow: 0 10px 26px rgba(0,104,255,.45); text-decoration: none; transition: transform .2s; }
.zalo-fab.above-chat { right: 90px; } /* có nút chat: Zalo nằm ngang, bên trái nút chat */
.zalo-fab:hover { transform: scale(1.07); }
.zalo-fab::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #0068ff; animation: zalo-ring 2.4s ease-out infinite; }
@keyframes zalo-ring { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.55); opacity: 0; } }
.zalo-tip { position: absolute; right: 66px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: #0068ff; color: #fff; font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; box-shadow: 0 6px 18px rgba(0,104,255,.35); }
.zalo-tip::after { content: ''; position: absolute; right: -5px; top: 50%; transform: translateY(-50%) rotate(45deg); width: 10px; height: 10px; background: #0068ff; }
.zalo-fab:hover .zalo-tip, .zalo-fab.hint .zalo-tip { opacity: 1; }
@media (max-width: 520px) { .zalo-fab { width: 50px; height: 50px; right: 14px; bottom: 16px; } .zalo-fab.above-chat { right: 88px; bottom: 25px; } .zalo-tip { right: 58px; font-size: 12px; } }
.chat-fab .dot { position: absolute; top: 6px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--err); border: 2px solid var(--bg); }
.chat-panel { position: fixed; right: 22px; bottom: 90px; z-index: 40; width: 360px; max-width: calc(100vw - 32px); height: 480px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.5); overflow: hidden; }
.chat-head { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow-y: auto; padding: 12px; background: var(--bg2); border-radius: 10px; }
.chat-panel .chat-body { border-radius: 0; }
.chat-form { display: flex; flex-direction: column; gap: 6px; }
.chat-panel .chat-form { padding: 10px; border-top: 1px solid var(--line); }
.chat-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-row textarea { min-height: 40px; max-height: 120px; resize: none; flex: 1; }
.att-btn { padding: 8px 10px; font-size: 17px; }
.att-chip { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg2); border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; min-width: 0; }
.att-chip .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-img { display: block; max-width: 240px; max-height: 240px; border-radius: 10px; margin-bottom: 4px; background: #000; }
.att-file { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.18); margin-bottom: 4px; min-width: 180px; text-decoration: none; }
.att-file b { font-weight: 600; word-break: break-all; }
.support-page .chat-body { height: calc(100vh - 260px); min-height: 320px; }
.side a.item { position: relative; }
.nav-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--err); margin-left: auto; }
.msg { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 10px; }
.msg.me { align-items: flex-end; }
.msg .bub { max-width: 85%; padding: 8px 12px; border-radius: 14px; background: var(--card2); font-size: 14px; word-wrap: break-word; }
.msg.me .bub { background: var(--acc); color: #fff; }
.msg .tm { font-size: 11px; color: var(--muted); margin-top: 3px; }
.vlist .v.on { background: rgba(124,92,255,.16); }
.msg-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0 4px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-del { opacity: 1; }
.msg-del:hover { color: var(--err); }

/* ---------- thư viện giọng (kiểu ElevenLabs) ---------- */
.modal-box.xl { max-width: 1280px; height: 92vh; max-height: 92vh; background: #0f0f10; border-color: #26262b; }
.vl-head { border-bottom: 0; padding-bottom: 0; }
.vl-tabs { display: flex; gap: 6px; margin-top: 14px; padding-bottom: 12px; border-bottom: 1px solid #26262b; }
.vl-tab { background: transparent; border: 0; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text); }
.vl-tab.on { background: #22c55e; color: #fff; }
.vl-filters { padding: 12px 20px 4px; }
.vl-frow { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.vf { display: flex; flex-direction: column; gap: 6px; }
.vf label { font-size: 13px; color: var(--muted); }
.vf select { width: auto; min-width: 86px; padding: 7px 10px; font-size: 13px; background: #17171a; border-color: #2a2a30; color: var(--muted); }
.vf select:disabled { opacity: .45; }
.vl-reset { padding: 7px 11px; background: #17171a; border-color: #2a2a30; }
.vl-filters .input { background: #17171a; border-color: #2a2a30; }
.vl-body { flex: 1; min-height: 0; overflow-y: auto; padding-top: 14px; }
.vl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.vc { display: flex; flex-direction: column; gap: 9px; background: #141416; border: 1px solid #26262b; border-radius: 12px; padding: 13px; min-width: 0; transition: border-color .15s; }
.vc:hover { border-color: #3a3a42; }
.vc-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.vc-av { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 15px; }
.vc-ttl { min-width: 0; }
.vc-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-lang { font-size: 13px; color: var(--muted); }
.vc-desc { font-size: 13px; color: #b9b9c6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.vtag { border: 1px solid #34343c; border-radius: 99px; padding: 4px 11px; font-size: 11px; font-weight: 700; letter-spacing: .3px; }
.vc-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: #c9c9d4; }
.vchip { background: #26262c; border-radius: 7px; padding: 2px 8px; font-size: 12.5px; color: #c9c9d4; }
.vc-users { font-size: 13px; color: var(--muted); }
.flag { vertical-align: -2px; border-radius: 2px; margin-right: 2px; }
.vc-act { display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 10px; border-top: 1px solid #26262b; }
.vbtn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; font-size: 16px; color: #d4d4dc; }
.vbtn:hover { background: #24242a; }
.vbtn[data-fav] { color: #fb7185; }
.vuse { background: #22c55e; border-color: #22c55e; color: #fff; padding: 7px 16px; }
.vuse:hover { background: #16a34a; }
@media (max-width: 900px) { .vl-grid { grid-template-columns: 1fr; } .vf select { min-width: 0; } .vl-frow .vf { flex: 1 1 45%; } }

/* ---------- admin ---------- */
.admin-tabs { margin-bottom: 18px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 0; }
.admin-tabs .tab { padding: 8px 16px; font-size: 14px; }
a.link { color: #a5b4fc; cursor: pointer; }
a.link:hover { text-decoration: underline; }
.scroll-box { max-height: 320px; overflow: auto; }
.scroll-box.tall { max-height: 460px; }
.scroll-box thead th { position: sticky; top: 0; background: var(--card); }
.chart { width: 100%; height: auto; display: block; }
.chart .bar-fill { fill: var(--acc); }
.chart .bar:hover .bar-fill { fill: #9b82ff; }
.chart .bar:hover rect { fill: rgba(255,255,255,.04); }
.chart .ax { fill: var(--muted); font-size: 11px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.tb td.cur { outline: 2px solid #22c55e; outline-offset: -2px; border-radius: 6px; }
.tb tr.tot td { border-top: 2px solid var(--line); }
.stat .muted.small:last-child { margin-top: 4px; }

/* ---------- giọng miễn phí & nhóm ---------- */
.quota { margin-bottom: 12px; }
.team-intro p { margin: 0 0 16px; color: var(--muted); max-width: 760px; line-height: 1.7; }
.invite { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: var(--bg2); }
.invite .code { font-size: 24px; font-weight: 800; letter-spacing: 3px; font-family: ui-monospace, Consolas, monospace; color: var(--acc2); }
a.pill { cursor: pointer; }

.sep-line { height: 1px; background: var(--line); margin: 14px 0; }
/* TTS: chọn nguồn + tải tệp */
.prov-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.prov { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: .15s; min-width: 0; }
.prov:hover { border-color: #3d3d5c; }
.prov .pi { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: var(--card2); }
.prov b { display: block; font-size: 15px; }
.prov small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; margin-top: 1px; }
.prov > span:last-child { min-width: 0; flex: 1 1 auto; }
.prov.on { border-color: var(--acc); background: linear-gradient(135deg, rgba(124,92,255,.16), rgba(34,211,238,.06)); box-shadow: 0 0 0 1px var(--acc) inset; }
.prov.on .pi { background: linear-gradient(135deg, var(--acc), var(--acc2)); }
.tts-tools { margin-bottom: 10px; gap: 8px; }
/* bộ đếm ký tự "0/200.000" */
.char-meter { display: inline-flex; align-items: center; gap: 1px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-meter b { color: var(--acc2); font-weight: 700; }
.char-meter .cm-sep { opacity: .7; }
.char-meter #cc-cap { color: var(--text); font-weight: 600; }
.char-meter.over b, .char-meter.over #cc-cap { color: var(--err); }
.cm-i { position: relative; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; cursor: help; outline: none; }
.cm-i:hover, .cm-i:focus { color: var(--text); border-color: var(--acc); }
.cm-tip { position: absolute; bottom: calc(100% + 10px); left: -8px; z-index: 50; width: 300px; padding: 10px 12px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0,0,0,.4); color: var(--text); font-size: 12.5px; font-weight: 400; line-height: 1.6; text-align: left;
  opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .15s, transform .15s; }
.cm-i:hover .cm-tip, .cm-i:focus .cm-tip { opacity: 1; transform: none; }
.cm-tip b { color: var(--text); }
.cm-warn { margin-top: 6px; color: var(--err); font-weight: 600; }
textarea.drop { border-color: var(--acc2); box-shadow: 0 0 0 3px rgba(34,211,238,.18); background: rgba(34,211,238,.04); }
@media (max-width: 1100px) { .prov-tabs { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .prov-tabs { grid-template-columns: 1fr 1fr; gap: 8px; } .prov { padding: 10px 11px; gap: 9px; } .prov .pi { width: 32px; height: 32px; font-size: 17px; } }
/* tài liệu API */
.doc-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.doc-toc { position: sticky; top: 10px; max-height: calc(100vh - 40px); overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.doc-toc a { display: flex; gap: 6px; align-items: center; padding: 5px 6px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.doc-toc a:hover { background: var(--card2); color: var(--text); }
.doc-g { margin: 10px 6px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.doc-main > * + * { margin-top: 14px; }
.doc-gh { margin: 26px 0 0; font-size: 18px; }
.doc-ep { scroll-margin-top: 14px; }
.doc-path { font-size: 14.5px; font-weight: 600; }
.mth { display: inline-block; min-width: 50px; text-align: center; font-size: 10.5px; font-weight: 800; padding: 2px 6px; border-radius: 6px; font-family: ui-monospace, Consolas, monospace; }
.mth.GET { background: rgba(34,197,94,.15); color: #4ade80; } .mth.POST { background: rgba(124,92,255,.18); color: #a78bfa; }
.mth.PUT { background: rgba(245,158,11,.18); color: #fbbf24; } .mth.DELETE { background: rgba(239,68,68,.15); color: #f87171; }
pre.code { position: relative; background: #0a0a12; color: #d8d8ea; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow: auto; font: 12.5px/1.55 ui-monospace, Consolas, monospace; margin: 0; white-space: pre; }
pre.code .cp { position: absolute; top: 6px; right: 6px; font: 600 11px 'Be Vietnam Pro', sans-serif; border: 1px solid var(--line); background: var(--card2); color: var(--muted); border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
:root[data-theme="light"] pre.code { background: #f4f5fa; color: #23243a; }
@media (max-width: 900px) { .doc-grid { grid-template-columns: minmax(0, 1fr); } .doc-toc { position: static; max-height: none; } }
/* tiếp thị liên kết */
.aff-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: start; }
.aff-bal { border-color: color-mix(in srgb, var(--acc2) 45%, var(--line)); }
.aff-amount { font-size: 30px; font-weight: 800; }
@media (max-width: 900px) { .aff-grid { grid-template-columns: 1fr; } }
/* ---------- tab trực tiếp ---------- */
.live-head { margin-bottom: 14px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.live-dot.on { background: var(--ok); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 1.6s infinite; }
.live-dot.off { background: var(--err); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.live-tiles .stat .n { font-size: 22px; }
.tab-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.tab-badge.hidden { display: none; }
/* ---- tab Trực tiếp: bố cục vừa 1 màn hình ---- */
.live-wrap { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.live-wrap .live-head { display: flex; align-items: center; gap: 8px; margin: 0; flex: none; font-size: 13px; }
.live-wrap .last-spend { max-width: 55%; margin-right: 10px; }
.kpis { flex: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
@media (min-width: 1500px) { .kpis { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; } }
@media (min-width: 1200px) and (max-width: 1499px) { .kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; min-width: 0; }
.kpi .l, .kpi .s { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-size: 18px; font-weight: 800; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.warn { border-color: rgba(245,158,11,.55); background: linear-gradient(0deg, rgba(245,158,11,.08), rgba(245,158,11,.08)), var(--card); }
.lrow-charts { flex: none; height: clamp(118px, 19vh, 178px); display: grid; grid-template-columns: 1.7fr 1.2fr 1fr; gap: 10px; }
.lrow-lists { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1.25fr 1fr 1fr; gap: 10px; }
.lcol { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.lp { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; }
.lp-h { flex: none; display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; margin-bottom: 6px; white-space: nowrap; }
.lp-h .cstats { font-weight: 400; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.lp-h .cstats b { color: var(--text); }
.lp-n .cnt { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 99px; background: var(--card2); font-size: 11px; line-height: 18px; text-align: center; }
.lp-b { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.lchart { flex: 1; min-height: 0; overflow: hidden; }
.lchart svg { display: block; }
.two-mini { display: grid; grid-template-columns: 1fr; gap: 8px; }
.tb-c { font-size: 12.5px; table-layout: fixed; }
.tb-c td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tb-c td:first-child { padding-left: 0; }
.tb-c td:last-child { padding-right: 0; }
.tb-c .btn.sm { padding: 4px 8px; font-size: 12px; }
.tb-c .badge { font-size: 11px; padding: 1px 7px; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.nowrap { white-space: nowrap; }
.tb-c td > a.link { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.lp .hbar { margin-bottom: 6px; }
.lp .hbar-l { font-size: 12px; margin-bottom: 3px; }
.lp .hbar-t { height: 6px; }
@media (max-width: 1199px) {
  .lrow-charts, .lrow-lists { grid-template-columns: 1fr; height: auto; }
  .lrow-charts .lp { height: 180px; }
  .lcol .lp { height: 300px; flex: none; }
}
/* ---- rê chuột: phóng to tại chỗ, hiện đầy đủ ---- */
.kpi { position: relative; cursor: default; transition: border-color .15s, transform .15s; }
.kpi:hover, .kpi:focus { border-color: var(--acc); outline: none; }
.kpi-pop { position: absolute; top: -8px; left: 50%; z-index: 40; width: max-content; min-width: calc(100% + 36px); max-width: 360px;
  background: var(--card); border: 1px solid var(--acc); border-radius: 14px; padding: 12px 16px; box-shadow: 0 18px 48px rgba(0,0,0,.45), 0 0 0 4px rgba(124,92,255,.12);
  opacity: 0; pointer-events: none; transform: translateX(-50%) scale(.82); transform-origin: top center; transition: opacity .16s ease, transform .16s ease; }
.kpi-pop.edge-l { left: -6px; transform: scale(.82); transform-origin: top left; }
.kpi-pop.edge-r { left: auto; right: -6px; transform: scale(.82); transform-origin: top right; }
.kpi:hover .kpi-pop, .kpi:focus .kpi-pop { opacity: 1; transform: translateX(-50%) scale(1); }
.kpi:hover .kpi-pop.edge-l, .kpi:hover .kpi-pop.edge-r, .kpi:focus .kpi-pop.edge-l, .kpi:focus .kpi-pop.edge-r { transform: scale(1); }
.kpi-pop .pl { font-size: 13px; color: var(--muted); white-space: nowrap; }
.kpi-pop .pv { font-size: 30px; font-weight: 800; line-height: 1.25; white-space: nowrap; }
.kpi-pop .ps { font-size: 13px; color: var(--muted); }
.kpi-pop .pm { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.6; color: var(--text); }
.kpi-pop .pm > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 330px; }
.kpi.warn .kpi-pop { border-color: var(--warn); box-shadow: 0 18px 48px rgba(0,0,0,.45), 0 0 0 4px rgba(245,158,11,.15); }
:root[data-theme="light"] .kpi-pop { box-shadow: 0 18px 40px rgba(20,20,60,.18), 0 0 0 4px rgba(109,74,255,.1); }
/* biểu đồ: cột sáng lên + khung thông tin theo chuột */
.chart .bar.hot .bar-fill { filter: brightness(1.45) saturate(1.2); }
.chart .bar.hot .hit { fill: rgba(255,255,255,.06); }
:root[data-theme="light"] .chart .bar.hot .hit { fill: rgba(0,0,0,.05); }
.lv-tip { position: fixed; z-index: 90; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.4); font-size: 12.5px; max-width: 280px; }
.lv-tip .tt-h { color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.lv-tip .tt-v { font-weight: 700; font-size: 14px; }
/* danh sách: rê chuột lên dòng -> hiện đầy đủ email / nội dung */
.fu { display: none; }
.tb-c tr:hover .sh, .hbar:hover .sh { display: none; }
.tb-c tr:hover .fu, .hbar:hover .fu { display: inline; word-break: break-all; }
.tb-c tr { transition: background .12s; }
.tb-c tr:hover { background: var(--card2); }
.tb-c tr:hover .ell { white-space: normal; overflow: visible; word-break: break-word; }
.tb-c tr:hover td > a.link { white-space: normal; overflow: visible; }
.hbar:hover .hbar-l span { white-space: normal; overflow: visible; }
.live-head .last-spend:hover { white-space: normal; overflow: visible; max-width: 70%; }
/* ---- nút ẩn / hiện thanh bên trái (máy tính) ---- */
.side-tg { width: 38px; height: 38px; padding: 0; flex: none; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; }
.side-tg:hover { color: var(--text); border-color: var(--acc); }
.side-tg svg { width: 20px; height: 20px; }
html.side-off .shell { grid-template-columns: minmax(0, 1fr); }
html.side-off .side { display: none; }
@media (max-width: 900px) { .side-tg { display: none; } }
/* trang Quản trị: ẩn nút Zalo nổi (dành cho khách) để không che nội dung */
body.on-admin .zalo-fab { display: none; }
/* ---- tab Trực tiếp: HIỆN ĐẦY ĐỦ (khung cao theo nội dung, chữ tự xuống dòng, không cắt "…") ---- */
.live-wrap { height: auto !important; overflow-x: clip; overflow-clip-margin: 14px; }
.live-wrap .kpi-pop.edge-l { left: 0; }
.live-wrap .kpi-pop.edge-r { right: 0; }
.lrow-charts { height: auto; align-items: stretch; }
.lrow-charts .lchart { flex: none; height: 150px; }
.lrow-lists { flex: none; align-items: start; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lcol .lp { flex: none; }
.lp-b { flex: none; max-height: none; overflow: visible; }
/* chia trang + thu gọn danh sách */
.lp .tb-c td { padding: 5px 4px; }
.lp .tb-c .small { font-size: 12px; }
.lv-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 12px; }
.lv-pg { width: 28px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: var(--card2); color: var(--text); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.lv-pg:hover:not(:disabled) { border-color: var(--acc); }
.lv-pg:disabled { opacity: .35; cursor: default; }
.lp-h { white-space: normal; flex-wrap: wrap; row-gap: 2px; }
.lp-h .cstats { overflow: visible; text-overflow: clip; white-space: normal; }
.lp .tb-c { table-layout: auto; }
.lp .tb-c td > a.link { display: inline; white-space: normal; overflow: visible; }
.lv-email, .lv-wrap-t { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.lp .tb-c td { vertical-align: top; }
.kpi .l, .kpi .s { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.kpi .v { white-space: nowrap; overflow: visible; text-overflow: clip; }
.live-wrap .kpis { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kpi-pop .pm > div { white-space: normal; overflow: visible; text-overflow: clip; }
.live-wrap .live-head .last-spend { white-space: normal; overflow: visible; text-overflow: clip; }
.live-wrap .hbar-l span { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 1800px) { .lrow-lists { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1199px) {
  .lrow-charts .lp, .lcol .lp { height: auto; }
  .lrow-lists { grid-template-columns: minmax(0, 1fr); }
}
/* credit trực tiếp */
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.mini-stats > div { background: var(--bg2); border-radius: 10px; padding: 10px 12px; }
.mini-stats b { font-size: 20px; }
.chart .credit-fill { fill: var(--acc2); }
.chart .credit-fill.now { animation: barpulse 2s ease-in-out infinite; }
@keyframes barpulse { 50% { opacity: .55; } }
.hbar { margin-bottom: 9px; }
.hbar-l { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.hbar-l span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-t { height: 8px; background: var(--bg2); border-radius: 6px; overflow: hidden; }
.hbar-t i { display: block; height: 100%; background: var(--acc2); border-radius: 6px; transition: width .6s; }
.neg { color: #fca5a5; } .pos { color: #86efac; }
:root[data-theme="light"] .neg { color: #b91c1c; } :root[data-theme="light"] .pos { color: #15803d; }
.last-spend { font-size: 13px; color: var(--muted); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.last-spend.pop { animation: pop 1.2s ease-out; }
/* trạng thái web công khai + sao lưu ở đầu tab Trực tiếp */
.hchips { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: 8px; }
.hchip { font-size: 12px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); cursor: pointer; white-space: nowrap; text-decoration: none; }
.hchip.ok { border-color: rgba(34,197,94,.35); }
.hchip.warn { border-color: rgba(245,158,11,.5); color: var(--warn); }
.hchip.bad { border-color: var(--err); color: #fff; background: var(--err); animation: pulse-bad 1.6s ease-in-out infinite; }
@keyframes pulse-bad { 50% { opacity: .7; } }
/* tab Sao lưu */
.bk-steps { margin: 6px 0 12px; padding-left: 22px; font-size: 14px; line-height: 1.6; }
.bk-steps li { margin-bottom: 10px; }
.bk-steps li::marker { font-weight: 800; color: var(--acc2); }
.stat.st-warn { border-color: rgba(245,158,11,.5); }
.stat.st-bad { border-color: var(--err); }
.ok-txt { color: var(--ok); font-weight: 600; }
/* khuyến mãi */
.promo-banner { display: flex; width: fit-content; flex-direction: column; gap: 4px; margin: 0 auto 18px; padding: 10px 18px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  background: linear-gradient(90deg, rgba(124,92,255,.18), rgba(34,211,238,.14)); border: 1px solid rgba(124,92,255,.45); text-align: left; max-width: 100%; }
.promo-tag { display: inline-block; margin: 0 auto 10px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: rgba(34,197,94,.16); color: var(--ok); border: 1px solid rgba(34,197,94,.4); }
.price .bonus { color: var(--ok); font-weight: 700; font-size: 13px; }
.promo-box { padding: 12px 16px; }
.modal-box.wide { max-width: 1000px; }
/* giọng nhân bản: trạng thái ở từng nguồn */
.pv-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.pv-chip { font-size: 10.5px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.pv-chip.done { color: var(--ok); border-color: rgba(34,197,94,.4); }
.pv-chip.processing { color: var(--warn); border-color: rgba(245,158,11,.45); }
.pv-chip.failed { color: var(--err); border-color: rgba(239,68,68,.45); }
/* tài liệu API: nút ⧉ + menu AI Markdown */
.doc-head { gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-actions { display: inline-flex; gap: 8px; align-items: center; flex: none; margin-left: auto; }
.icon-btn { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; border-radius: 99px; }
.ai-md-btn { border-radius: 99px; gap: 8px; display: inline-flex; align-items: center; font-weight: 700; }
.md-wrap { position: relative; }
.md-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 320px; max-width: calc(100vw - 32px); background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 6px; box-shadow: 0 18px 48px rgba(0,0,0,.4); }
.md-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 9px 12px; border-radius: 10px; cursor: pointer; font: inherit; }
.md-menu button:hover { background: var(--bg2); }
.md-menu button b { display: block; font-size: 14px; }
.md-menu button span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pm-calc { margin: 6px 0 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pm-calc .tb td, .pm-calc .tb th { padding: 6px 8px; font-size: 12.5px; white-space: nowrap; }
.pm-calc tr.muted td { opacity: .7; }
/* giọng mẫu */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 340px)); justify-content: center; gap: 14px; max-width: 1100px; margin: 0 auto; }
.sc-card { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-align: left; transition: .2s; }
.sc-card:hover { border-color: rgba(124,92,255,.6); }
.sc-card.off { opacity: .55; }
.sc-play { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-size: 16px;
  background: linear-gradient(135deg, var(--acc), var(--acc2)); box-shadow: 0 6px 18px rgba(124,92,255,.35); }
.sc-play:hover { transform: scale(1.06); }
.sc-body { min-width: 0; flex: 1; }
.sc-body b { font-size: 15px; }
.sc-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.sc-tags span { font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); }
.sc-tags .sc-prov { color: var(--acc2); border-color: rgba(34,211,238,.35); }
.sc-admin { display: grid; gap: 10px; }
.sc-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 520px) { .sc-admin .sc-card { flex-wrap: wrap; } .sc-act { width: 100%; } .promo-banner { font-size: 13px; padding: 8px 12px; } }
/* bảo mật / 2FA */
.forgot-btn { width: 100%; margin-top: 10px; justify-content: center; font-size: 14px; border: 1px dashed var(--line); white-space: normal; flex-wrap: wrap; text-align: center; }
@media (max-width: 520px) { .auth-wrap { padding: 16px; } .auth { padding: 24px 20px; min-width: 0; width: 100%; } }
.forgot-btn .muted { font-weight: 400; }
.warn-box { padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(245,158,11,.5); background: rgba(245,158,11,.1); font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ok-box { margin-top: 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(34,197,94,.45); background: rgba(34,197,94,.1); font-size: 14px; line-height: 1.6; }
.otp-input { font-size: 22px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.bk-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.bk-codes code { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; font-size: 15px; letter-spacing: 1px; }
.tf-qr { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 10px 0 4px; }
.tf-qr img { background: #fff; border-radius: 10px; padding: 6px; }
.tf-secret { display: inline-block; margin-top: 6px; font-size: 13px; letter-spacing: 1px; word-break: break-all; user-select: all; }
/* nạp tự động */
.sp-guide { margin: 4px 0 6px; }
.sp-guide summary { cursor: pointer; padding: 6px 0; }
.sp-kv { margin: 8px 0 4px; grid-template-columns: max-content 1fr; row-gap: 6px; align-items: center; }
.copy-field { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.copy-field code { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12.5px; word-break: break-all; }
.pay-wait { display: flex; gap: 10px; align-items: center; margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--bg2); border: 1px dashed var(--line); font-size: 14px; }
.pay-wait.ok { border: 1px solid var(--ok); background: rgba(34,197,94,.12); }
.pay-wait.bad { border: 1px solid var(--err); }
.spin-dot { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid var(--acc2); border-right-color: transparent; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btx .badge { white-space: nowrap; }
.btx td { vertical-align: top; }
.btx td:nth-child(4) { min-width: 150px; }
.btx td:nth-child(5) { word-break: break-all; min-width: 140px; }
.qr.qr-done { opacity: .35; filter: grayscale(1); transition: .4s; }
@keyframes pop { 0% { transform: scale(1.08); color: var(--text); } 100% { transform: scale(1); } }
tr.flash td { animation: rowflash 2.5s ease-out; }
@keyframes rowflash { 0% { background: rgba(124,92,255,.35); } 100% { background: transparent; } }

/* ---------- toast ---------- */
#toast { position: fixed; right: 20px; bottom: 90px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.ts { background: var(--card2); border: 1px solid var(--line); border-left: 4px solid var(--acc); padding: 12px 16px; border-radius: 10px; max-width: 360px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: tin .2s; }
.ts.err { border-left-color: var(--err); }
.ts.ok { border-left-color: var(--ok); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 14px; }
  .mobile-nav a { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
  .mobile-nav a.on { background: var(--acc); border-color: var(--acc); }
  .main { padding: 18px 16px 50px; }
  .two, .two.eq, .two.sp { grid-template-columns: minmax(0, 1fr); }
  .two > *, .stack > *, .doc-grid > * { min-width: 0; }
  .nav { padding: 12px 16px; gap: 12px; }
  .nav-links { display: none; }
  .spk { grid-template-columns: 1fr 1fr; }
  .turn { grid-template-columns: 1fr; }
}
/* điện thoại: thanh trên cùng trang chủ phải vừa 1 màn hình, không được kéo ngang */
@media (max-width: 520px) {
  .nav { padding: 10px 12px; gap: 8px; }
  .nav .logo { font-size: 16px; gap: 8px; min-width: 0; white-space: nowrap; }
  .nav .btn { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
  .nav .js-theme { padding: 7px 9px; }
}
@media (max-width: 520px) {
  /* thanh trên cùng trong app: tiêu đề 1 dòng, số dư + nút xuống dòng dưới */
  .topbar { flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  .topbar h1 { font-size: 20px; flex: 1 1 100%; white-space: normal; }
  .topbar .pill { padding: 5px 10px; }
  .kv { grid-template-columns: minmax(90px, auto) minmax(0, 1fr); }
  .main { padding: 16px 12px 50px; }
  .row { flex-wrap: wrap; }
  .row > div { min-width: 0; max-width: 100%; }
  .mh.row { flex-wrap: nowrap; }
  .mh.row > b, .mh.row > span:first-child { min-width: 0; flex: 1 1 auto; }
  .mh.row .spacer { display: none; }
  select.input, .input { max-width: 100%; min-width: 0; }
  .sp-kv { grid-template-columns: minmax(0, 1fr); }
  .copy-field { max-width: 100%; }
  /* tab Trực tiếp */
  .live-head { flex-wrap: wrap; }
  .live-head .last-spend { max-width: 100%; }
  .lrow-charts, .lrow-lists { grid-template-columns: minmax(0, 1fr); }
  .lrow-charts > *, .lrow-lists > *, .lcol > * { min-width: 0; }
  .lrow-charts .lp { min-height: 150px; }
  .kpi-pop { display: none; } /* điện thoại không có rê chuột: ẩn hộp phóng to */
  /* cửa sổ mã QR nạp tiền: QR trên, thông tin dưới */
  .pay-row { flex-direction: column; align-items: center !important; gap: 14px !important; }
  .pay-row > .grow { width: 100%; }
  .pay-row .qr { width: min(240px, 100%); height: auto; }
  .hchips { margin-left: 0; }
}
@media (max-width: 370px) {
  .nav .logo { font-size: 0; gap: 0; } /* màn rất hẹp: chỉ giữ biểu tượng, ẩn chữ */
}
img, video, pre, table { max-width: 100%; }

/* ================= GIAO DIỆN SÁNG ================= */
:root[data-theme="light"] {
  --bg: #f6f6fb;
  --bg2: #eef0f6;
  --card: #ffffff;
  --card2: #f1f2f8;
  --line: #e1e3ee;
  --text: #171725;
  --muted: #646880;
  --acc: #6d4aff;
  --acc2: #0891b2;
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] body { background: var(--bg); color: var(--text); }
:root[data-theme="light"] .nav { background: rgba(246,246,251,.85); }
:root[data-theme="light"] .btn:hover { background: #e7e8f2; border-color: #cfd2e2; }
:root[data-theme="light"] .btn.primary, :root[data-theme="light"] .btn.primary:hover { background: linear-gradient(135deg, var(--acc), #5b3df5); color: #fff; }
:root[data-theme="light"] .side a.item.on { background: rgba(109,74,255,.12); color: var(--acc); }
:root[data-theme="light"] .badge.done { background: #dcfce7; color: #15803d; }
:root[data-theme="light"] .badge.failed { background: #fee2e2; color: #b91c1c; }
:root[data-theme="light"] .badge.processing, :root[data-theme="light"] .badge.queued { background: #fef3c7; color: #a16207; }
:root[data-theme="light"] .err { color: #b91c1c; }
:root[data-theme="light"] a.link { color: var(--acc); }
:root[data-theme="light"] .modal { background: rgba(20,20,40,.35); }
:root[data-theme="light"] .ts { background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
:root[data-theme="light"] .msg .bub { background: var(--card2); }
:root[data-theme="light"] .msg.me .bub { background: var(--acc); color: #fff; }
:root[data-theme="light"] .att-file { background: rgba(0,0,0,.05); }
:root[data-theme="light"] .chat-panel { box-shadow: 0 20px 50px rgba(0,0,0,.18); }
:root[data-theme="light"] .scroll-box thead th { background: var(--card); }
:root[data-theme="light"] .price.pop { box-shadow: 0 0 0 1px var(--acc), 0 20px 50px -24px rgba(109,74,255,.45); }
:root[data-theme="light"] .feat .ic { background: rgba(109,74,255,.1); }
:root[data-theme="light"] .tb td [style*="#86efac"], :root[data-theme="light"] [style*="color:#86efac"] { color: #15803d !important; }
:root[data-theme="light"] [style*="color:#fca5a5"] { color: #b91c1c !important; }
:root[data-theme="light"] .btn.danger { color: #b91c1c; }
:root[data-theme="light"] .chart .bar:hover .bar-fill { fill: #5b3df5; }
/* thư viện giọng */
:root[data-theme="light"] .modal-box.xl { background: #ffffff; border-color: var(--line); }
:root[data-theme="light"] .vl-tabs { border-color: var(--line); }
:root[data-theme="light"] .vf select, :root[data-theme="light"] .vl-reset, :root[data-theme="light"] .vl-filters .input { background: #f4f5fa; border-color: var(--line); color: var(--text); }
:root[data-theme="light"] .vc { background: #fbfbfe; border-color: var(--line); }
:root[data-theme="light"] .vc:hover { border-color: #c9cce0; }
:root[data-theme="light"] .vc-desc { color: #4b4f66; }
:root[data-theme="light"] .vtag { border-color: #d5d8e6; color: #2b2e45; }
:root[data-theme="light"] .vc-meta, :root[data-theme="light"] .vchip { color: #3a3d55; }
:root[data-theme="light"] .vchip { background: #eceef6; }
:root[data-theme="light"] .vc-act { border-color: var(--line); }
:root[data-theme="light"] .vbtn { color: #3a3d55; }
:root[data-theme="light"] .vbtn:hover { background: #eceef6; }
:root[data-theme="light"] .vbtn[data-fav] { color: #e11d48; }
.js-theme { font-size: 16px; padding: 5px 9px; }

/* ---- khoá chức năng ---- */
.nav-lock { margin-left: auto; font-size: 12px; opacity: .85; }
.lock-note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; margin-bottom: 14px; border-radius: 12px; border: 1px solid rgba(245,158,11,.45); background: rgba(245,158,11,.10); font-size: 13.5px; line-height: 1.5; }
.lock-card { text-align: center; padding: 44px 20px; max-width: 520px; margin: 30px auto; }
.lock-card .lock-big { font-size: 46px; margin-bottom: 6px; }
.lock-card h2 { margin: 6px 0; }
.prov.locked { opacity: .72; }
.prov.locked.on { opacity: 1; }
.lk-group { margin: 16px 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.lk-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; }
.lk-row.on { border-color: rgba(245,158,11,.5); background: rgba(245,158,11,.07); }
.lk-name { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lk-bad { color: var(--warn); }
.lk-until { width: 200px; flex: 0 0 auto; }
.lk-msg { flex: 1 1 220px; min-width: 0; }
.lk-mode { width: 130px; flex: 0 0 auto; }
.lk-row.hid { border-color: rgba(148,163,184,.55); background: rgba(148,163,184,.08); }
.lk-row:not(.on):not(.edit) .lk-mode { display: none; }
.lk-sw { position: relative; flex: none; width: 40px; height: 22px; cursor: pointer; }
.lk-sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.lk-sw .lk-t { position: absolute; inset: 0; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); transition: .15s; pointer-events: none; }
.lk-sw .lk-t::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .15s; }
.lk-sw input:checked + .lk-t { background: var(--warn); border-color: var(--warn); }
.lk-sw input:checked + .lk-t::after { left: 20px; background: #fff; }
/* ---- nguồn giọng miễn phí ---- */
.fsrcs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 10px; }
.fsrc { text-align: left; padding: 8px 11px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: inherit; cursor: pointer; min-width: 0; }
.fsrc b { display: block; font-size: 13.5px; }
.fsrc small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsrc.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; background: rgba(124,92,255,.12); }
@media (max-width: 640px) {
  .lk-until, .lk-msg { flex: 1 1 100%; width: auto; }
  .fsrcs { grid-template-columns: 1fr 1fr; }
}
.lk-row:not(.on):not(.edit) .lk-until, .lk-row:not(.on):not(.edit) .lk-msg, .lk-row:not(.on):not(.edit) [data-save] { display: none; }
.lk-row { padding: 7px 10px; }
.lk-row.edit { border-color: var(--acc); }
/* logo Vbee */
.prov .pi.pi-logo, .prov.on .pi.pi-logo { background: none; padding: 0; border-radius: 50%; overflow: hidden; }
.prov.on .pi.pi-logo { box-shadow: 0 0 0 2px var(--acc); }
.mh-logo { display: inline-block; width: 26px; height: 26px; flex: none; margin-right: 8px; vertical-align: middle; }
.mh-logo svg { display: block; }

/* ================= LỊCH SỬ 48 GIỜ ================= */
.rp-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: -4px 0 16px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; }
.rp-tabs button { border: 0; background: none; color: var(--muted); padding: 8px 10px; border-radius: 9px; font-weight: 600; cursor: pointer; font: inherit; font-size: 14px; }
.rp-tabs button.on { background: var(--card2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 0 0 1px var(--line); }
.hist-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hist-note { border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.hist-list { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow-y: auto; padding-right: 2px; }
.hc { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.hc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hc-ic { width: 22px; height: 22px; display: inline-grid; place-items: center; flex: none; font-size: 15px; line-height: 1; }
.ki-logo { width: 20px; height: 20px; display: block; }
.ki-logo svg { display: block; }
.hc-text { margin: 8px 0 4px; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.hc-pl { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.hc-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.hpill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.hpill.ok { color: #4ade80; border-color: rgba(74,222,128,.45); background: rgba(74,222,128,.08); }
.hpill.bad { color: #f87171; border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.08); }
.hpill.run { color: #fbbf24; border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.08); }
.hi-btn { width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center; border-radius: 99px; border: 1px solid var(--line); background: var(--card2); color: var(--text); cursor: pointer; text-decoration: none; font-size: 14px; padding: 0; }
.hi-btn:hover { border-color: var(--acc); }
.hi-btn.off { opacity: .35; cursor: default; }
.hp { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.hp-play { width: 32px; height: 32px; flex: none; border-radius: 99px; border: 1px solid var(--line); background: var(--card2); color: var(--text); cursor: pointer; font-size: 12px; padding: 0; }
.hp-play:hover { border-color: var(--acc); }
.hp-bar { --p: 0%; flex: 1 1 auto; min-width: 60px; height: 6px; appearance: none; -webkit-appearance: none; border-radius: 9px; cursor: pointer; margin: 0;
  background: linear-gradient(90deg, var(--acc) var(--p), var(--line) var(--p)); }
.hp-bar::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 2px solid var(--acc); }
.hp-bar::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--text); border: 2px solid var(--acc); }
.hp-t { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }
.meta-tip { background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: help; border-bottom: 1px dashed var(--muted); }
.meta-box { position: fixed; z-index: 200; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; max-width: min(380px, calc(100vw - 16px)); padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.35); font-size: 13px; word-break: break-all; }
.modal-box.xwide { max-width: 1180px; }
.ht-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ht-all { margin-right: 6px; font-weight: 600; }
.ht-wrap { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
#hist-host .ht-wrap { max-height: none; }
table.ht td { padding: 10px 12px; }
table.ht tr.on td { background: rgba(124,92,255,.08); }
table.ht tr:last-child td { border-bottom: 0; }
.ht-ck { width: 34px; }
.ht-main { min-width: 0; max-width: 280px; width: 28%; }
.ht-time { gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
.ht-st { width: 1%; white-space: nowrap; }
.ht-pl { min-width: 220px; }
.ht-ic { width: 1%; white-space: nowrap; text-align: center; }
.ht-cost { width: 1%; white-space: nowrap; }
@media (max-width: 760px) {
  .ht-bar .spacer { display: none; }
  table.ht, table.ht tbody { display: block; }
  table.ht tr { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto auto; grid-template-areas: "ck main main main st" "ck pl pl pl pl" "ck dl meta del ."; gap: 6px 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
  table.ht td { display: block; padding: 0; border: 0; width: auto; max-width: none; min-width: 0; }
  .ht-ck { grid-area: ck; align-self: start; } .ht-main { grid-area: main; } .ht-st { grid-area: st; } .ht-pl { grid-area: pl; }
  table.ht td.ht-ic:nth-of-type(5) { grid-area: dl; } table.ht td.ht-ic:nth-of-type(6) { grid-area: meta; } table.ht td.ht-ic:nth-of-type(7) { grid-area: del; }
  .ht-cost { grid-area: cost; text-align: right; }
}
/* ---- trang Văn bản → Giọng nói: khung soạn thảo lớn + cột Cài đặt/Lịch sử rộng ---- */
.two.tts-two { grid-template-columns: minmax(0, 1fr) minmax(360px, 40%); }
.two.tts-two > * { min-width: 0; }
.tts-ed { display: flex; flex-direction: column; padding: 0; overflow: visible; }
.tag-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px 4px; }
.tag-bar.hidden { display: none; }
#dlg-tags { padding: 0 0 10px; }
.tag-lbl { color: var(--muted); font-size: 13px; }
.tag-dd { position: relative; }
.tag-btn { background: transparent; border: 1px solid rgba(148,163,184,.28); color: var(--text); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.tag-btn:hover { background: rgba(148,163,184,.12); }
.tag-btn .caret { opacity: .6; font-size: 10px; margin-left: 2px; }
.tag-menu { position: absolute; left: 0; top: calc(100% + 4px); z-index: 40; width: 290px; max-height: 320px; overflow-y: auto; background: var(--card2); border: 1px solid rgba(148,163,184,.28); border-radius: 12px; padding: 4px 0; box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.tag-menu.hidden { display: none; }
.tag-it { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 7px 12px; background: transparent; border: 0; text-align: left; color: var(--text); cursor: pointer; }
.tag-it:hover { background: rgba(148,163,184,.12); }
.tag-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.tag-row code { margin-left: auto; font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(148,163,184,.15); color: var(--muted); }
.tag-ex { padding-left: 16px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.t-expr { background: #a78bfa; } .t-emo { background: #f472b6; } .t-nv { background: #38bdf8; } .t-sfx { background: #fbbf24; } .t-exp { background: #34d399; }
.tts-area { flex: 1 1 auto; width: 100%; min-height: max(380px, calc(100vh - 360px)); resize: vertical; border: 0; outline: none; background: transparent; color: var(--text);
  font: inherit; font-size: 15px; line-height: 1.65; padding: 18px 20px; box-sizing: border-box; }
.tts-area::placeholder { color: var(--muted); opacity: .8; }
.tts-area.drop { background: rgba(124,92,255,.08); box-shadow: inset 0 0 0 2px var(--acc); }
.tts-hint { display: flex; align-items: center; gap: 8px; padding: 8px 20px; color: var(--muted); font-size: 12.5px; }
.tts-hint svg { width: 16px; height: 16px; flex: none; }
.tts-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px 12px 20px; border-top: 1px solid var(--line); background: var(--bg2); }
.tts-bar .hi-btn { width: 38px; height: 38px; background: transparent; border-color: transparent; color: var(--muted); }
.tts-bar .hi-btn:hover { color: var(--text); background: var(--card2); border-color: var(--line); }
.tts-bar .hi-btn svg { width: 19px; height: 19px; }
.tts-go { min-width: 170px; }
.rp-card .hist-list { max-height: calc(100vh - 290px); }
/* nút tròn viền mảnh (tải xuống / phát / xoá) như mẫu */
.hr-btn { width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; padding: 0; border-radius: 99px; border: 1.5px solid var(--line); background: transparent; color: var(--text); cursor: pointer; text-decoration: none; transition: .15s; }
.hr-btn:hover { border-color: var(--muted); background: var(--card2); }
.hr-btn.sm { width: 34px; height: 34px; color: var(--muted); }
.hr-btn.sm svg { width: 16px; height: 16px; }
.hr-btn[data-hdel]:hover { color: #f87171; border-color: rgba(248,113,113,.6); background: rgba(248,113,113,.08); }
.hr-btn.off { opacity: .35; cursor: default; }
.hr-btn[data-st="play"] svg { margin-left: 2px; }
.hc { border-radius: 16px; padding: 14px 16px; }
.hc.running { border-color: rgba(251,191,36,.35); }
.hc-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.hc-meta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; min-width: 0; }
.hc, .hc-pl, .hc-pl .hp, .hc-foot { min-width: 0; }
.hist-list { overflow-x: hidden; }
.hc-av { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); font-size: 18px; line-height: 1; }
.hc-av .ki-logo { width: 26px; height: 26px; }
.hc-time { white-space: nowrap; font-size: 14.5px; }
.hc-dur { color: var(--muted); font-size: 13px; white-space: nowrap; }
.hc-text { font-size: 15px; line-height: 1.5; margin: 10px 0 6px; }
.hc-pl { gap: 10px; margin-top: 10px; }
.hc-pl .hp { gap: 10px; }
.hc-foot { margin-top: 10px; }
.staging-bar { position: sticky; top: 0; z-index: 60; background: #f59e0b; color: #1a1300; font-weight: 700; font-size: 13px; text-align: center; padding: 6px 12px; }
/* tải ứng dụng Mac */
.mac-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 16px; }
.mac-opt { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); color: var(--text); text-decoration: none; transition: .15s; }
.mac-opt:hover { border-color: var(--acc); background: var(--card2); }
.mac-opt b { font-size: 16px; }
.mac-opt.off { opacity: .45; }
.mac-help { font-size: 13px; line-height: 1.6; color: var(--muted); background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.mac-help b { color: var(--text); }
@media (max-width: 520px) { .mac-opts { grid-template-columns: 1fr; } }
/* hộp thoại tự vẽ (thay prompt/confirm — chạy được cả trong phần mềm máy tính) */
.ask-wrap { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.55); animation: tin .15s; }
.ask-box { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 14px; }
.ask-msg { white-space: pre-line; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.ask-act { display: flex; justify-content: flex-end; gap: 8px; }
.btn.danger-solid { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn.danger-solid:hover { background: #b91c1c; border-color: #b91c1c; }
:root[data-theme="light"] .ask-wrap { background: rgba(20,20,40,.35); }
/* trưởng nhóm: lịch sử của thành viên */
.th-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.th-stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.th-stat b { font-size: 18px; }
.th-who { display: inline-block; max-width: 100%; overflow-wrap: anywhere; padding: 1px 8px; border-radius: 99px; background: rgba(124,92,255,.14); color: var(--text); font-weight: 600; font-size: 12px; margin: 2px 0; }
.th-wrap { max-height: 70vh; }
@media (max-width: 760px) {
  .th-sum { grid-template-columns: 1fr 1fr; }
  .th-wrap table.ht tr { grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: "main main main st" "pl pl pl pl" "dl meta . cost"; }
  .th-wrap table.ht td.ht-ic:nth-of-type(4) { grid-area: dl; } .th-wrap table.ht td.ht-ic:nth-of-type(5) { grid-area: meta; }
}
/* trang Nhân bản giọng: 2 bảng dưới khung đọc */
.clone-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.clone-mine { max-height: 420px; overflow-y: auto; }
@media (max-width: 1200px) { .clone-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) { .two.tts-two { grid-template-columns: minmax(0, 1fr) minmax(340px, 42%); } }
@media (max-width: 900px) {
  .two.tts-two { grid-template-columns: minmax(0, 1fr); }
  .rp-card .hist-list { max-height: none; }
  .tts-area { min-height: 260px; }
  .tts-go { min-width: 0; flex: 1 1 100%; }
}
:root[data-theme="light"] .hpill.ok { color: #15803d; } :root[data-theme="light"] .hpill.bad { color: #b91c1c; } :root[data-theme="light"] .hpill.run { color: #a16207; }
/* nhãn tài khoản thành viên (VIP / tuỳ biến Chữ + Icon + Màu) */
.vip-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .3px;
  color: #3b2a00; background: linear-gradient(135deg, #ffe08a, #f5b301); box-shadow: 0 0 0 1px rgba(245,179,1,.5), 0 4px 14px rgba(245,179,1,.25); white-space: nowrap; }
.vip-tag.sm { padding: 2px 8px; font-size: 11px; }
.vip-tag.vc-cyan { color: #fff; background: linear-gradient(135deg, #06b6d4, #0284c7); box-shadow: 0 0 0 1px rgba(6,182,212,.5), 0 4px 14px rgba(6,182,212,.25); }
.vip-tag.vc-purple { color: #fff; background: linear-gradient(135deg, #a855f7, #6d28d9); box-shadow: 0 0 0 1px rgba(168,85,247,.5), 0 4px 14px rgba(168,85,247,.28); }
.vip-tag.vc-emerald { color: #fff; background: linear-gradient(135deg, #10b981, #047857); box-shadow: 0 0 0 1px rgba(16,185,129,.5), 0 4px 14px rgba(16,185,129,.25); }
.vip-tag.vc-rose { color: #fff; background: linear-gradient(135deg, #fb7185, #e11d48); box-shadow: 0 0 0 1px rgba(244,63,94,.5), 0 4px 14px rgba(244,63,94,.26); }
.vip-tag.vc-orange { color: #fff; background: linear-gradient(135deg, #fb923c, #ea580c); box-shadow: 0 0 0 1px rgba(249,115,22,.5), 0 4px 14px rgba(249,115,22,.26); }
.vip-tag.vc-blue { color: #fff; background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 0 0 1px rgba(59,130,246,.5), 0 4px 14px rgba(59,130,246,.26); }
.credit-box .vip-tag { margin-bottom: 8px; }
.side .credit-box.is-vip { border-color: rgba(245,179,1,.6); background: linear-gradient(160deg, rgba(245,179,1,.12), transparent 55%), var(--card); }
.side .credit-box.is-vip.vc-cyan { border-color: rgba(6,182,212,.55); background: linear-gradient(160deg, rgba(6,182,212,.13), transparent 55%), var(--card); }
.side .credit-box.is-vip.vc-purple { border-color: rgba(168,85,247,.55); background: linear-gradient(160deg, rgba(168,85,247,.14), transparent 55%), var(--card); }
.side .credit-box.is-vip.vc-emerald { border-color: rgba(16,185,129,.55); background: linear-gradient(160deg, rgba(16,185,129,.13), transparent 55%), var(--card); }
.side .credit-box.is-vip.vc-rose { border-color: rgba(244,63,94,.55); background: linear-gradient(160deg, rgba(244,63,94,.13), transparent 55%), var(--card); }
.side .credit-box.is-vip.vc-orange { border-color: rgba(249,115,22,.55); background: linear-gradient(160deg, rgba(249,115,22,.13), transparent 55%), var(--card); }
.side .credit-box.is-vip.vc-blue { border-color: rgba(59,130,246,.55); background: linear-gradient(160deg, rgba(59,130,246,.13), transparent 55%), var(--card); }
.vip-cred { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; white-space: pre-wrap; user-select: all; }
.perk-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; align-items: center; }
.src-pill, .team-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; border: 1px solid var(--line); background: var(--bg2); color: var(--text); white-space: nowrap; }
.src-pill { cursor: pointer; border-color: rgba(34,211,238,.4); background: rgba(34,211,238,.1); color: #67e8f9; }
.src-pill:hover { filter: brightness(1.12); }
.src-pill.inh { border-style: dashed; opacity: .9; }
.src-pill.off { border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.12); color: #fca5a5; }
.mult-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer; border: 1px solid rgba(250,204,21,.45); background: rgba(250,204,21,.1); color: #fde047; }
.mult-pill:hover { filter: brightness(1.12); }
.mult-pill.inh { border-style: dashed; opacity: .9; }
:root[data-theme="light"] .mult-pill { color: #a16207; background: rgba(202,138,4,.1); border-color: rgba(202,138,4,.4); }
.team-pill { cursor: pointer; transition: .12s; }
.team-pill:hover { filter: brightness(1.15); border-color: var(--acc); }
.team-pill.owner { border-color: rgba(124,92,255,.45); background: rgba(124,92,255,.12); color: #c4b5fd; }
.team-pill.member { color: var(--muted); }
.u-fbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; align-items: center; }
.u-fpill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); cursor: pointer; transition: .12s; }
.u-fpill:hover { border-color: #3d3d5c; color: var(--text); }
.u-fpill.on { border-color: var(--acc); background: rgba(124,92,255,.16); color: var(--text); }
.u-fpill .fcnt { font-size: 11px; padding: 1px 6px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--text); }
:root[data-theme="light"] .u-fpill .fcnt { background: rgba(0,0,0,.07); }
.tm-leader-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); margin-bottom: 14px; }
.tm-add-box { padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line); background: var(--bg2); margin-bottom: 14px; }
.sp-u-link { cursor: pointer; text-decoration: none; }
.sp-u-link:hover { color: var(--acc); text-decoration: underline; }
:root[data-theme="light"] .src-pill { color: #0e7490; background: rgba(8,145,178,.1); border-color: rgba(8,145,178,.35); }
:root[data-theme="light"] .src-pill.off { color: #b91c1c; background: rgba(239,68,68,.1); border-color: rgba(220,38,38,.35); }
:root[data-theme="light"] .team-pill.owner { color: #5b21b6; background: rgba(124,92,255,.1); border-color: rgba(124,92,255,.35); }
.perk-note { padding: 10px 12px; border-radius: 10px; background: rgba(124,92,255,.1); border: 1px solid rgba(124,92,255,.35); font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.perk-warn { padding: 10px 12px; border-radius: 10px; background: rgba(239,68,68,.11); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; font-size: 13px; line-height: 1.5; margin-top: 8px; }
:root[data-theme="light"] .perk-warn { color: #b91c1c; }
.badge-pv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line); background: var(--bg2); margin-bottom: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.p-chip { border: 1px solid var(--line); background: var(--bg2); padding: 4px 9px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: .12s; }
.p-chip:hover, .p-chip.on { border-color: var(--acc); background: rgba(124,92,255,.16); }
.col-row { display: flex; flex-wrap: wrap; gap: 8px; }
.col-sw { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg2); font-size: 12px; font-weight: 600; cursor: pointer; }
.col-sw i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.col-sw.on { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.src-mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.src-mode-opt { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; text-align: left; }
.src-mode-opt.on { border-color: var(--acc); background: rgba(124,92,255,.13); }
.src-mode-opt b { display: block; font-size: 13.5px; }
.src-mode-opt small { color: var(--muted); font-size: 12px; }

/* ---------- Mục đề xuất / quảng cáo phần mềm AU98 Studio ở cột trái dưới phần Hỗ trợ ---------- */
#side-promo:empty { display: none; }
.studio-promo {
  position: relative;
  overflow: hidden;
  margin: 8px 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(124,92,255,.45);
  background: linear-gradient(145deg, rgba(124,92,255,.18) 0%, rgba(34,211,238,.09) 60%, var(--card) 100%);
  box-shadow: 0 8px 24px -10px rgba(124,92,255,.3);
}
.studio-promo .sp-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.studio-promo .sp-ic {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  box-shadow: 0 4px 12px rgba(124,92,255,.35);
  margin-top: 2px;
}
.studio-promo .sp-head {
  min-width: 0;
  flex: 1;
}
.studio-promo .sp-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 3px;
}
.studio-promo .sp-head b {
  display: block;
  font-size: 13.5px;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
}
.studio-promo .sp-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--acc), #06b6d4);
  white-space: nowrap;
}
.studio-promo .sp-ver {
  font-size: 11px;
  color: var(--muted);
}
.studio-promo .sp-desc {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  word-break: break-word;
}
.studio-promo .sp-btn {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  text-align: center;
  white-space: normal;
  line-height: 1.35;
  padding: 8px 10px;
  font-size: 12.5px;
  box-shadow: 0 6px 16px rgba(124,92,255,.28);
}
:root[data-theme="light"] .studio-promo {
  background: linear-gradient(145deg, rgba(109,74,255,.10) 0%, rgba(8,145,178,.07) 60%, var(--card) 100%);
}

/* ---------- Thông báo admin chạy ngang trên thanh tiêu đề (.topbar) ---------- */
.lk-sw.ok-sw input:checked + .lk-t { background: var(--ok); border-color: var(--ok); }
.topbar-notice-slot { flex: 1 1 200px; min-width: 0; display: flex; align-items: center; }
.topbar-spacer { display: none; }
@media (max-width: 1180px) {
  html:not(.side-off) .topbar { flex-wrap: wrap; row-gap: 10px; }
  html:not(.side-off) .topbar-spacer { display: block; flex: 1; }
  html:not(.side-off) .topbar-notice-slot:empty { display: none; }
  html:not(.side-off) .topbar-notice-slot:not(:empty) { order: 20; flex: 1 1 100%; }
}
@media (max-width: 940px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar-spacer { display: block; flex: 1; }
  .topbar-notice-slot:empty { display: none; }
  .topbar-notice-slot:not(:empty) { order: 20; flex: 1 1 100%; }
}
@media (max-width: 520px) {
  .topbar-spacer { display: none !important; }
}
.admin-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 12px 0 6px;
  border-radius: 99px;
  border: 1px solid rgba(124,92,255,.38);
  background: linear-gradient(90deg, rgba(124,92,255,.14), rgba(34,211,238,.08));
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
a.admin-notice:hover {
  border-color: var(--acc);
  box-shadow: 0 4px 16px -6px rgba(124,92,255,.45);
}
.admin-notice .an-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  line-height: 1;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #fff;
  box-shadow: 0 2px 8px rgba(124,92,255,.35);
}
.admin-notice .an-vp {
  flex: 1;
  min-width: 0;
  height: 34px;
  line-height: 34px;
  display: block;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.admin-notice .an-track {
  display: inline-block;
  vertical-align: top;
  white-space: nowrap;
  padding-left: 100%;
  will-change: transform;
  animation: admin-marquee var(--an-dur, 16s) linear var(--an-delay, 0s) infinite;
}
.admin-notice:hover .an-track {
  animation-play-state: paused;
}
.admin-notice .an-go {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  transition: transform .15s, color .15s;
}
a.admin-notice:hover .an-go {
  color: var(--text);
  transform: translateX(2px);
}
@keyframes admin-marquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}
.admin-notice.st-promo {
  border-color: rgba(245,158,11,.45);
  background: linear-gradient(90deg, rgba(245,158,11,.16), rgba(236,72,153,.10));
}
.admin-notice.st-promo .an-badge {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  box-shadow: 0 2px 8px rgba(245,158,11,.35);
}
a.admin-notice.st-promo:hover { border-color: #f59e0b; box-shadow: 0 4px 16px -6px rgba(245,158,11,.45); }
.admin-notice.st-warn {
  border-color: rgba(239,68,68,.45);
  background: linear-gradient(90deg, rgba(239,68,68,.15), rgba(245,158,11,.09));
}
.admin-notice.st-warn .an-badge {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  box-shadow: 0 2px 8px rgba(239,68,68,.35);
}
a.admin-notice.st-warn:hover { border-color: #ef4444; box-shadow: 0 4px 16px -6px rgba(239,68,68,.45); }
.admin-notice.st-ok {
  border-color: rgba(34,197,94,.42);
  background: linear-gradient(90deg, rgba(34,197,94,.14), rgba(34,211,238,.08));
}
.admin-notice.st-ok .an-badge {
  background: linear-gradient(135deg, #22c55e, #06b6d4);
  box-shadow: 0 2px 8px rgba(34,197,94,.35);
}
a.admin-notice.st-ok:hover { border-color: #22c55e; box-shadow: 0 4px 16px -6px rgba(34,197,94,.45); }
:root[data-theme="light"] .admin-notice {
  background: linear-gradient(90deg, rgba(109,74,255,.10), rgba(8,145,178,.07));
  border-color: rgba(109,74,255,.32);
}
:root[data-theme="light"] .admin-notice.st-promo {
  background: linear-gradient(90deg, rgba(245,158,11,.13), rgba(236,72,153,.08));
  border-color: rgba(217,119,6,.36);
}
:root[data-theme="light"] .admin-notice.st-warn {
  background: linear-gradient(90deg, rgba(239,68,68,.11), rgba(245,158,11,.08));
  border-color: rgba(220,38,38,.35);
}
:root[data-theme="light"] .admin-notice.st-ok {
  background: linear-gradient(90deg, rgba(34,197,94,.12), rgba(8,145,178,.07));
  border-color: rgba(22,163,74,.35);
}
