/*
 * GIAO DIỆN BỐ CỤC A (anh duyệt mẫu 2026-11-22: prototype/ui-mau/mau-ui-A.html).
 * Thanh dưới theo việc: Cơ sở / Đơn / Chợ / Công ty / Tôi. Màu và hình giữ tinh thần C · Pha (kem cam ấm, nâu ấm khi tối).
 * Ba màu việc: xanh lá = Thu / Giao, cam đất = Bảo trì / Mua, xanh dương = năng lượng và "giao được". Đỏ = thiếu, huy hiệu đếm.
 * Trang thật chiếm cả màn; trên máy tính cột giữa rộng tối đa 480px.
 * CSP của máy chủ cho style nội tuyến ('unsafe-inline' ở style-src), không cho script nội tuyến, chỉ phát .html/.js/.css
 * (nên tranh SVG nằm trong ui.js).
 */
/* THEME (anh chốt 2026-11-23). Sáng = hướng C (prototype/ui-mau/huong-c). Tối = Lo-fi đêm chill (prototype/ui-mau/concept, số 4).
   Hai bộ CÙNG bố cục: mọi khác biệt nằm ở token dưới đây và ở tranh cảnh. theme.js luôn ghi data-theme = light | dark lên <html>
   (đã quy đổi từ lựa chọn Theo máy / Theo giờ / Sáng / Tối), nên ở đây không cần @media prefers-color-scheme.
   Màu theo việc (luật H1): --okb xanh lá = Thu / Giao / Nhận · --pri cam = Bảo trì / Mua / Nâng · --nrg xanh dương = năng lượng ·
   --ink = đi tới màn khác. Tím neon --dream CHỈ dùng cho Dreamium, Chợ, Công ty. Cấp đơn: --t1 ngọc (Nhanh), --t2 vàng (Vừa), --t3 hồng (Lớn). */
:root {
  --bg: #F3F5FB; --bg2: #E9EDF7; --card: #FFFFFF; --ink: #1C2140; --muted: #5B6385; --line: #E1E6F2;
  --pri: #FF9A2E; --pri-ink: #3A1D00; --pri-sh: #C96A08; --pri-soft: #FFEBD2; --pri-t: #9A4B00;
  --okb: #12893D; --okb-sh: #0A5F29; --ok: #0C6B2E; --ok-bg: #DDF5E4;
  --warn: #7A5400; --warn-bg: #FFF1C7; --bad: #B3261E; --bad-bg: #FFE3E0;
  --nrg: #1265C0; --nrg-bg: #DCEBFF; --nrg-sh: #0B468A; --nrg-ink: #FFFFFF;
  --top1: #FFFFFF; --top2: #FFFFFF; --top-ink: #1C2140; --sky: #CDEFFB; --ground: #A3DFA6;
  --nav: #FFFFFF; --shadow: 0 2px 0 rgba(28, 33, 64, .05), 0 8px 18px rgba(28, 33, 64, .07);
  --farming: #4c9838; --livestock: #c4704f; --mining: #577795; --factory: #cf6526;
  --on-bad: #ffffff; --desk: #DDE2F0; --go-sh: #070916; --badge: #C9302C; --badge-ink: #FFFFFF;
  --dream: #8B5CF6; --dream-hi: #D9CCFF; --dream-deep: #1D1042; --dream-line: #A78BFA; --dream-t: #5B34C8;
  --t1: #0FA89A; --t1-soft: #D5F5F1; --t1-ink: #06655C; --t2: #E0A100; --t2-soft: #FFF1C7; --t2-ink: #7A5400; --t3: #E23D78; --t3-soft: #FFDDE9; --t3-ink: #9C1548;
  --isl: #5DBB73; --hud-pill: #F3F5FB; --overlay: rgba(28, 33, 64, .45);
  --font-d: "Baloo 2", "Be Vietnam Pro", ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-b: "Be Vietnam Pro", "Nunito", ui-rounded, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --r: 20px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1B2240; --bg2: #343F68; --card: #2B3558; --ink: #F6EBDD; --muted: #B4BCD6; --line: #414D79;
  --pri: #F2A65A; --pri-ink: #3A1D00; --pri-sh: #B56E28; --pri-soft: #4E3D2A; --pri-t: #FFC98A;
  --okb: #2F9461; --okb-sh: #1C6641; --ok: #9FE8C0; --ok-bg: #1F4A3A;
  --warn: #FFE3A0; --warn-bg: #4E4226; --bad: #FFB1BD; --bad-bg: #5A3344;
  --nrg: #9CCBFA; --nrg-bg: #27416E; --nrg-sh: #4878B4; --nrg-ink: #08263A;
  --top1: #1B2240; --top2: #1B2240; --top-ink: #F6EBDD; --sky: #3A4476; --ground: #2C3560;
  --nav: #141A34; --shadow: 0 8px 18px rgba(0, 0, 0, .25);
  --on-bad: #3A0E18; --desk: #0E1228; --go-sh: #B9A98F; --badge: #E0627A; --badge-ink: #FFFFFF;
  --dream-t: #D9CCFF;
  --t1: #4FC7B8; --t1-soft: #1F4B52; --t1-ink: #A9F0E6; --t2: #E8B94A; --t2-soft: #4E4226; --t2-ink: #FFE3A0; --t3: #EE7FA4; --t3-soft: #552B45; --t3-ink: #FFC4D8;
  --hud-pill: rgba(255, 255, 255, .08); --overlay: rgba(8, 10, 26, .6);
  color-scheme: dark;
}
/* Tông riêng của từng đảo: chỉ dùng cho tranh cảnh, nhãn tên đảo và vòng sáng nút Đảo. */
:root[data-isl="bloomvale"] { --isl: #5DBB73; }
:root[data-isl="neon_harbor"] { --isl: #19B6C9; }
:root[data-isl="driftmoon"] { --isl: #2FC4B8; }
:root[data-theme="dark"][data-isl="bloomvale"] { --isl: #F2C879; }
:root[data-theme="dark"][data-isl="neon_harbor"] { --isl: #3CF2FF; }
:root[data-theme="dark"][data-isl="driftmoon"] { --isl: #7FE3D6; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--desk); color: var(--ink); overflow: hidden;
  font: 15px/1.4 ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--nrg); outline-offset: 2px; }

/* Khung: thanh trên cố định, thân cuộn, thanh dưới */
#app { max-width: 480px; margin: 0 auto; height: 100vh; height: 100dvh; display: flex; flex-direction: column; position: relative; background: var(--bg); overflow: hidden; }
#main { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
#tabs:empty { display: none; }
.page { padding: 14px 14px 24px; }
.page > * + * { margin-top: 14px; }

/* ===================== Chữ và mảnh dùng chung ===================== */
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.okc { color: var(--ok); } .badc { color: var(--bad); } .warnc { color: var(--warn); }
.b { font-weight: 800; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
h2, .title { font-size: 20px; line-height: 1.2; margin: 0; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0; font-weight: 800; }
p { margin: 0; }
.cap-l { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

.ico { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--bg2); font-size: 17px; line-height: 1; flex: none; }
.ico svg { width: 20px; height: 20px; display: block; }
.ico.lg { width: 40px; height: 40px; border-radius: 13px; font-size: 24px; } .ico.lg svg { width: 28px; height: 28px; }
.ico.xs { width: 22px; height: 22px; border-radius: 7px; font-size: 13px; } .ico.xs svg { width: 15px; height: 15px; }

.tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--bg2); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.warn { background: var(--warn-bg); color: var(--warn); } .tag.pri { background: var(--pri-soft); color: var(--pri); }
.tag.nrg { background: var(--nrg-bg); color: var(--nrg); }

.card { display: block; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
button.card { width: 100%; text-align: left; }
.card.link { display: flex; gap: 10px; align-items: center; min-height: 64px; }
.stack > * + * { margin-top: 12px; }
.note, .alert { font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: 14px; background: var(--bg2); }
.note.warn, .alert.warn { background: var(--warn-bg); color: var(--warn); }
.note.bad, .alert.bad { background: var(--bad-bg); color: var(--bad); }
.note.ok, .alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert { font-size: 14px; }
.empty { text-align: center; }
.empty .em { font-size: 34px; line-height: 1.2; }

/* Nút: khối nổi, bấm thì lún. Mặc định là nút chính (cam); .green = Thu / Giao; .ghost = nút phụ. */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 46px; min-width: 46px; padding: 8px 14px;
  border: 0; border-radius: 15px; background: var(--pri); color: var(--pri-ink); font-weight: 800; font-size: 15px; line-height: 1.15;
  box-shadow: 0 4px 0 var(--pri-sh); margin-bottom: 4px; text-align: center; transition: transform .06s, box-shadow .06s;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--pri-sh); }
.btn.green { background: var(--okb); color: #fff; box-shadow: 0 4px 0 var(--okb-sh); }
.btn.green:active:not(:disabled) { box-shadow: 0 1px 0 var(--okb-sh); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 1.5px solid var(--line); }
.btn.ghost:active:not(:disabled) { box-shadow: 0 1px 0 var(--line); }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 56px; font-size: 17px; border-radius: 18px; }
.btn small { font-weight: 700; opacity: .9; font-size: 12px; display: block; }
/* Nút tắt: nền xám, vẫn đọc được lý do */
.btn:disabled, .btn.ghost:disabled, .btn.green:disabled { background: var(--bg2); color: var(--muted); box-shadow: 0 4px 0 var(--line); border: 0; cursor: not-allowed; }
.btn:disabled small { opacity: 1; }
.btn.sq { padding: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.two .btn { padding-left: 8px; padding-right: 8px; font-size: 14.5px; }

.seg { display: flex; background: var(--bg2); border-radius: 16px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-width: 0; min-height: 44px; border: 0; border-radius: 12px; background: transparent; font-weight: 800; font-size: 13.5px; white-space: nowrap; color: var(--muted); padding: 4px 6px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 2px 6px rgba(80, 40, 10, .18); }
.seg .cnt { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: var(--on-bad); font-size: 12px; margin-left: 2px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-left: -14px; margin-right: -14px; padding: 0 14px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 800; font-size: 14px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.locked { color: var(--muted); border-style: dashed; font-weight: 700; }

.meter { display: block; height: 8px; border-radius: 999px; background: var(--bg2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--pri); }
.meter.green > i { background: var(--okb); } .meter.blue > i { background: var(--nrg); } .meter.red > i { background: var(--bad); }

.inp { min-height: 46px; width: 76px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font-size: 16px; font-weight: 800; padding: 0 6px; text-align: center; }
textarea { width: 100%; min-height: 140px; font-family: ui-monospace, monospace; font-size: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); padding: 8px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 8px 0; border-bottom: 1.5px dashed var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.ev { font-size: 13px; }
.ev time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.back { display: flex; align-items: center; gap: 10px; }

/* ===================== Thanh trên ===================== */
#top {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(160deg, var(--top1), var(--top2)); color: var(--top-ink);
  border-radius: 0 0 24px 24px; box-shadow: 0 3px 0 rgba(90, 45, 10, .18); position: relative; z-index: 2;
}
.me { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; min-height: 48px; text-align: left; flex: 1; min-width: 0; color: inherit; }
.ava { position: relative; width: 46px; height: 46px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--card); display: grid; place-items: center; font-size: 25px; flex: none; box-shadow: 0 2px 0 rgba(90, 45, 10, .25); }
.ava b { position: absolute; right: -6px; bottom: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 12px; display: grid; place-items: center; border: 2px solid var(--card); }
.ava.big { width: 56px; height: 56px; font-size: 30px; }
.me .who { min-width: 0; line-height: 1.15; overflow: hidden; }
.me .who b { display: block; font-size: 14px; line-height: 1.12; }
#top .tt { font-weight: 800; font-size: 17px; }
.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 4px 11px 4px 8px; border-radius: 999px; background: var(--card); color: var(--ink); border: 0; font-weight: 800; font-size: 15px; box-shadow: 0 2px 0 rgba(90, 45, 10, .25); flex: none; white-space: nowrap; }
.pill small { font-size: 11px; font-weight: 700; color: var(--muted); display: block; line-height: 1; }
.pill .pv { line-height: 1.1; text-align: left; }
.pill.nrg { outline: 2px solid var(--nrg-bg); outline-offset: -2px; }
.pill.sq { width: 44px; padding: 0; justify-content: center; font-size: 20px; position: relative; }
.pill.sq.soon { opacity: .7; }
.pill.sq.soon i { position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); font-style: normal; font-size: 9px; font-weight: 800; line-height: 1; padding: 2px 4px; border-radius: 999px; background: var(--ink); color: var(--bg); white-space: nowrap; }
.dot { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: var(--on-bad); font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--card); }
.tua { flex-basis: 100%; font-size: 12px; font-weight: 800; }

/* ===================== Thanh dưới ===================== */
.nav { flex: none; display: flex; background: var(--nav); border-top: 1.5px solid var(--line); padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0px)); gap: 2px; }
.nav button { flex: 1; min-width: 0; min-height: 56px; border: 0; background: none; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 12px; font-weight: 800; color: var(--muted); position: relative; padding: 2px; }
.nav button .ni { font-size: 22px; line-height: 1.1; filter: grayscale(.6); opacity: .8; transition: transform .12s; }
.nav button[aria-current="page"] { background: var(--pri-soft); color: var(--pri); }
.nav button[aria-current="page"] .ni { filter: none; opacity: 1; transform: translateY(-1px) scale(1.12); }
.nav .dot { top: 4px; right: calc(50% - 26px); border-color: var(--nav); }
.nav .ns { position: absolute; top: 3px; right: calc(50% - 32px); font-size: 9px; font-weight: 800; padding: 1px 4px; border-radius: 999px; background: var(--bg2); color: var(--muted); }

/* ===================== Cơ sở ===================== */
.now { background: var(--card); border: 1.5px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 12px; }
.now-h { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 8px; }
.now3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { border: 0; border-radius: 18px; padding: 10px 4px 9px; min-height: 92px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; text-align: center; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08); }
.tile .tn { font-size: 30px; font-weight: 900; line-height: 1; display: flex; align-items: center; gap: 4px; }
.tile .tn span { font-size: 19px; }
.tile .tl { font-size: 13px; font-weight: 800; }
.tile .ts { font-size: 11.5px; font-weight: 700; opacity: .9; line-height: 1.2; }
.tile.t-thu { background: var(--ok-bg); color: var(--ok); }
.tile.t-bt { background: var(--pri-soft); color: var(--pri); }
.tile.t-giao { background: var(--nrg-bg); color: var(--nrg); }
.tile.zero { background: var(--bg2); color: var(--muted); }
.tile[aria-pressed="true"] { outline: 3px solid currentColor; outline-offset: -3px; }
.soon-l { margin-top: 10px; padding: 8px 4px 0; border-top: 1.5px dashed var(--line); }
.soon-l ul { list-style: none; margin: 4px 0 0; padding: 0; }
.soon-l li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; padding: 2px 0; }
.soon-l li b { flex: none; min-width: 44px; padding: 1px 6px; border-radius: 8px; background: var(--bg2); text-align: center; font-size: 12.5px; }
.moneyready { display: block; width: 100%; border: 0; text-align: left; margin-top: 8px; min-height: 44px; font-weight: 700; }

.grp-h { display: flex; align-items: center; gap: 8px; padding: 4px 4px 0; flex-wrap: wrap; }
.grp-h h3 { white-space: nowrap; }
.grp-h .bar { flex: 1; height: 1.5px; background: var(--line); min-width: 12px; }
.fac { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.fac.hl { border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-soft), var(--shadow); }
.fac-main { display: flex; gap: 10px; align-items: stretch; width: 100%; background: none; border: 0; padding: 10px; text-align: left; min-height: 84px; }
.art { width: 64px; height: 64px; border-radius: 16px; overflow: hidden; flex: none; align-self: center; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .08); position: relative; display: block; }
.art svg { width: 100%; height: 100%; display: block; }
.fac-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.fac-t { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.fac-t b { font-size: 15.5px; }
.lv { font-style: normal; font-size: 11.5px; font-weight: 800; padding: 1px 6px; border-radius: 7px; background: var(--ink); color: var(--bg); white-space: nowrap; }
.fac-s { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.st { font-size: 13px; font-weight: 800; display: flex; align-items: baseline; gap: 5px; }
.st i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.st.run { color: var(--ok); } .st.wait { color: var(--pri); } .st.full { color: var(--warn); } .st.stall { color: var(--bad); }
.st.run i { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.pend { flex: none; width: 58px; border-radius: 14px; background: var(--bg2); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1.15; padding: 4px 2px; }
.pend b { font-size: 20px; color: var(--ink); line-height: 1.1; }
.pend.has { background: var(--ok-bg); color: var(--ok); } .pend.has b { color: var(--ok); }
.pend.full { background: var(--warn-bg); color: var(--warn); } .pend.full b { color: var(--warn); }
.mat { border-top: 1.5px dashed var(--line); padding: 8px 10px 10px; background: color-mix(in srgb, var(--bg2) 45%, var(--card)); }
.mat-row { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 14px; }
.mat-row .src { font-size: 12px; color: var(--muted); }
.mat-row .hv { margin-left: auto; font-weight: 800; white-space: nowrap; }
.mat .btn { margin-top: 6px; }
details.side > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 4px; cursor: pointer; }
details.side > summary::-webkit-details-marker { display: none; }
details.side > summary .chev { margin-left: auto; transition: transform .15s; font-size: 12px; color: var(--muted); }
details.side[open] > summary .chev { transform: rotate(180deg); }
details.side > .stack { margin-top: 4px; }
.dots { display: flex; gap: 3px; margin: 4px 0 2px; }
.dots i { width: 100%; max-width: 16px; height: 7px; border-radius: 3px; background: var(--line); }
.dots i.on { background: var(--c, var(--pri)); }

/* ===================== Đơn ===================== */
.sum2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sum2 > div { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 10px 12px; min-width: 0; }
.sum2 .k { font-size: 12px; font-weight: 700; color: var(--muted); }
.sum2 .v { font-size: 20px; font-weight: 900; line-height: 1.2; }
.sum2 .hi { background: var(--nrg-bg); border-color: transparent; } .sum2 .hi .k, .sum2 .hi .v { color: var(--nrg); }
.reroll { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 16px; background: var(--bg2); font-size: 13px; }
.reroll .dice { font-size: 24px; }
.board-reroll { flex-direction: column; gap: 2px; margin: 0 0 10px; }
.board-reroll .tag { margin-left: 4px; }
.ord { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; border-left: 6px solid var(--line); }
.ord.ready { border-left-color: var(--okb); }
.ord-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ord-h b { font-size: 17px; }
.ord-lines { margin: 8px 0; }
.ol { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.ol .grow span { font-size: 12px; color: var(--muted); }
.ol .hv { margin-left: auto; font-weight: 800; white-space: nowrap; }
.ord-f { display: flex; gap: 8px; align-items: flex-start; }
.ord-f .btn.main { flex: 1; }
.hint { font-size: 13px; color: var(--muted); margin: 0 0 8px; padding: 6px 10px; border-radius: 12px; background: var(--bg2); }

/* ===================== Chợ ===================== */
.li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1.5px dashed var(--line); }
.li:last-child { border-bottom: 0; padding-bottom: 0; } .li:first-child { padding-top: 0; }
.li .grow b { display: block; font-size: 14.5px; }
.li .grow span { font-size: 12.5px; color: var(--muted); }
.li .grow span.tag { font-size: 12px; }
.li .grow span.badc { color: var(--bad); } .li .grow span.warnc { color: var(--warn); } .li .grow span.okc { color: var(--ok); }
.li .btn { flex: none; font-size: 14px; }
.li .qty { font-size: 18px; font-weight: 800; }
.capbox { display: flex; gap: 12px; align-items: center; }
.capbox .big { font-size: 26px; font-weight: 900; line-height: 1; }
.kg-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--muted); padding: 10px 0 4px; }
.kg-h:first-child { padding-top: 0; }

/* ===================== Công ty, Tôi ===================== */
.hero { border-radius: 24px; padding: 16px; background: linear-gradient(150deg, var(--top1), var(--top2)); color: var(--top-ink); box-shadow: var(--shadow); }
.hero h2 { font-size: 21px; }
.hero .sub { font-weight: 700; opacity: .9; }
.locked { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; gap: 12px; align-items: center; background: transparent; }
.locked .lk { font-size: 26px; filter: grayscale(.4); }
.prof { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1.5px dashed var(--line); }
.prof:last-child { border-bottom: 0; padding-bottom: 0; } .prof:first-child { padding-top: 0; }
.menu { padding: 4px 14px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 52px; background: none; border: 0; border-bottom: 1.5px dashed var(--line); text-align: left; font-weight: 800; font-size: 15px; padding: 4px 0; }
.menu button:last-child { border-bottom: 0; }
.menu button span.r { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 700; }
.pick { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px; min-height: 92px; }
.pick .nm { font-weight: 900; font-size: 17px; display: block; }
.buyrow { display: flex; gap: 10px; align-items: flex-start; }
.est { margin-top: 6px; font-size: 13px; color: var(--muted); }
.est b { color: var(--ink); }
.login label { display: block; margin-bottom: 10px; font-weight: 800; }
.login input { display: block; width: 100%; margin-top: 4px; font-size: 16px; padding: 10px 14px; min-height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }

/* ===================== Tấm trượt và hộp nổi ===================== */
#modal { position: fixed; inset: 0; z-index: 20; background: rgba(30, 15, 5, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; max-height: 90%; background: var(--bg); color: var(--ink); border-radius: 28px 28px 0 0; display: flex; flex-direction: column; box-shadow: 0 -8px 30px rgba(0, 0, 0, .3); animation: up .2s ease-out; }
.sheet.still { animation: none; }
@keyframes up { from { transform: translateY(24px); opacity: .4; } }
.sheet-h { flex: none; display: flex; align-items: center; gap: 8px; padding: 14px 10px 8px 16px; position: relative; }
.sheet-h::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line); }
.sheet-h h2 { min-width: 0; }
.x { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--bg2); font-size: 16px; font-weight: 800; flex: none; }
.sheet-b { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 14px 18px; }
.sheet-b > * + * { margin-top: 12px; }
.sheet.dlg .sheet-b { padding-top: 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.sheet-f { flex: none; padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1.5px solid var(--line); background: var(--card); }
/* Chơi thử 60 phút (P): báo nổi lên đầu trang, ngay dưới thanh trên, không đè thẻ cố vấn và hàng nút ở đáy; nhiều dòng thì xuống dòng. */
#toast { white-space: pre-line; position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 62px); bottom: auto; transform: translateX(-50%); width: max-content; max-width: min(calc(100% - 28px), 452px); z-index: 30; background: var(--ink); color: var(--bg); padding: 11px 14px; border-radius: 16px; font-size: 14px; font-weight: 700; text-align: center; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }

/* Năng lượng */
.gauge { text-align: center; padding: 6px 0 2px; }
.gauge .gv { font-size: 44px; font-weight: 900; line-height: 1; color: var(--nrg); }
.gauge .gv small { font-size: 18px; color: var(--muted); font-weight: 800; }
.ebar { position: relative; height: 14px; border-radius: 999px; background: var(--bg2); margin: 12px 0 4px; }
.ebar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #3aa6e0, #0d6494); }
.ebar > u { position: absolute; top: -4px; bottom: -4px; width: 2.5px; background: var(--ink); border-radius: 2px; }
.ebar-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 700; }
.src-h { display: flex; align-items: center; gap: 10px; }
.src-h .grow b { display: block; font-size: 15.5px; }
.src-h .gain { font-size: 15px; font-weight: 900; color: var(--nrg); white-space: nowrap; }
.nb { display: flex; gap: 10px; padding: 10px 0 0; border-top: 1.5px dashed var(--line); margin-top: 10px; }
.nb .face { width: 44px; height: 44px; border-radius: 50%; background: var(--bg2); display: grid; place-items: center; font-size: 25px; flex: none; }

/* Chi tiết cơ sở */
.banner { position: relative; height: 104px; border-radius: 22px; overflow: hidden; background: linear-gradient(var(--sky) 71.8%, var(--ground) 71.8%); }
.banner > div { width: 104px; height: 104px; margin: 0 auto; }
.banner svg { width: 100%; height: 100%; display: block; }
.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .rc { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; text-align: center; padding: 0 12px; }
.ring .rc b { font-size: 18px; } .ring .rc span { font-size: 11px; font-weight: 700; color: var(--muted); }
.swrow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; background: none; border: 0; padding: 0; text-align: left; }
.sw { position: relative; width: 56px; height: 44px; flex: none; display: block; }
.sw::before { content: ""; position: absolute; left: 2px; right: 2px; top: 8px; height: 28px; border-radius: 999px; background: var(--line); transition: background .15s; }
.sw::after { content: ""; position: absolute; left: 5px; top: 11px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left .15s; }
[aria-checked="true"] > .sw::before { background: var(--okb); } [aria-checked="true"] > .sw::after { left: 29px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper output { min-width: 42px; text-align: center; font-weight: 900; font-size: 18px; }
.stepper .btn { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) { .st.run i, .sheet { animation: none; } .btn, .nav button .ni { transition: none; } }

/* ===================== Gói tân thủ: thẻ cố vấn, Mốc kế, màn chào (theo mẫu A) ===================== */
.guide { background: linear-gradient(135deg, var(--card), var(--pri-soft)); border: 1.5px solid var(--pri); border-radius: 24px; padding: 12px; box-shadow: var(--shadow); position: relative; }
.guide + .guide { margin-top: 10px; }
.guide .gh { display: flex; gap: 10px; align-items: center; }
.guide .face { width: 48px; height: 48px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 28px; flex: none; border: 2px solid var(--pri); }
.guide .bubble { margin-top: 10px; background: var(--card); border-radius: 4px 16px 16px 16px; padding: 10px 12px; font-size: 14.5px; border: 1.5px solid var(--line); }
.guide .why { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.guide .row.wrap { flex-wrap: wrap; gap: 8px; }
.guide .row.wrap .btn { min-height: 44px; }
.steps { display: flex; gap: 3px; margin-top: 6px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--pri); }
.mile { width: 100%; text-align: left; border: 1.5px solid var(--line); }
.mile .grow { display: block; min-width: 0; }
.mile .grow > b { display: block; font-size: 14.5px; }
.mile .grow > .row { display: flex; }
details.away-d { margin-top: 10px; }
details.away-d > .card { margin-top: 6px; }
.swrow:disabled { opacity: .55; cursor: not-allowed; }

/* ===== Xã hội (2026-11-22, xa-hoi.js): tấm Cộng đồng, chat, bạn bè, hồ sơ, xếp hạng, công ty sơ khai ===== */
#social { position: fixed; inset: 0; z-index: 22; background: rgba(30, 15, 5, .5); display: flex; align-items: flex-end; justify-content: center; }
#social.hidden { display: none; }
.sx-sheet { height: 92%; max-height: 92%; }
.sx-tabs { margin: 0 14px 6px; flex: none; }
.sx-tabs button { font-size: 13px; padding: 4px 2px; }
.pill.sq .cnt { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: var(--on-bad); font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--card); line-height: 1; }
.btn.sm { min-height: 44px; padding: 4px 10px; font-size: 13px; width: auto; }
.sx-list { display: flex; flex-direction: column; gap: 6px; }
.sx-msg { max-width: 86%; align-self: flex-start; background: var(--card); border-radius: 16px 16px 16px 4px; padding: 6px 10px 7px; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.sx-msg.mine { align-self: flex-end; background: var(--pri-soft); border-radius: 16px 16px 4px 16px; }
.sx-msg.sys { align-self: center; max-width: 100%; background: var(--bg2); box-shadow: none; font-size: 12.5px; color: var(--muted); border-radius: 12px; }
.sx-msg.hid .sx-text { font-style: italic; color: var(--muted); }
.sx-meta { font-size: 12.5px; line-height: 1.3; }
.sx-name { border: 0; background: none; padding: 0; font: inherit; font-weight: 800; color: var(--pri); text-align: left; min-height: 0; cursor: pointer; }
.sx-text { font-size: 15px; line-height: 1.35; white-space: pre-wrap; }
.sx-tr-btn { position: relative; border: 0; background: none; padding: 0 4px; margin-left: 4px; font-size: 14px; line-height: 1; opacity: .75; cursor: pointer; }
.sx-tr-btn::after { content: ""; position: absolute; inset: -14px -8px; } /* vùng chạm 44 px */
.sx-tr { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line); font-size: 14px; line-height: 1.35; color: var(--muted); }
.sx-tr.err { color: var(--bad); }
.sx-tr-text { font-style: italic; white-space: pre-wrap; color: var(--ink); }
.sx-tr-lbl { position: relative; border: 0; background: none; padding: 0; margin-top: 2px; font-size: 12.5px; font-weight: 700; color: var(--pri); cursor: pointer; }
.sx-tr-lbl::after { content: ""; position: absolute; inset: -14px -8px; }
.sx-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.sx-send .row { gap: 8px; }
.sx-in { flex: 1; min-width: 0; min-height: 44px; border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 12px; font-size: 16px; background: var(--card); color: var(--ink); }
.sx-send .btn, .sx-mount .row .btn, .sx-sheet .card .row .btn { width: auto; flex: none; }
.sx-rules { margin: 4px 0 6px; padding-left: 18px; font-size: 13.5px; }
.sx-row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 0; border-top: 1px solid var(--line); }
.sx-row:first-of-type { border-top: 0; }
.sx-row .sx-name { color: var(--ink); min-height: 44px; }
.sx-dot { width: 12px; flex: none; color: var(--line); font-size: 12px; text-align: center; }
.sx-dot.on { color: var(--okb); }
.sx-rank { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); text-align: left; padding: 4px 2px; font: inherit; }
.sx-rank:first-child { border-top: 0; }
.sx-rank.me { background: var(--pri-soft); border-radius: 12px; }
.sx-no { width: 36px; flex: none; text-align: center; font-weight: 800; }
.sx-big { font-size: 26px; font-weight: 900; line-height: 1.1; }
.sx-dpt .right { text-align: right; }
.sx-up { color: var(--ok); font-weight: 800; }
.sx-down { color: var(--bad); font-weight: 800; }
.sx-eq { color: var(--muted); }
.sx-code { font-size: 15px; letter-spacing: 1px; }

/* ---------- Bong bóng góp ý (gop-y.js, 2026-11-22). Fable vẽ lại sau. Không lớp phủ: game vẫn bấm được. ---------- */
.gy-bubble { position: fixed; z-index: 18; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); color: var(--ink);
  box-shadow: var(--shadow); font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; cursor: grab;
  touch-action: none; user-select: none; -webkit-user-select: none; opacity: .92; }
.gy-bubble:hover, .gy-bubble:focus-visible { opacity: 1; }
.gy-bubble.drag { cursor: grabbing; opacity: 1; transform: scale(1.08); }
.gy-bubble > i { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; background: var(--pri); color: var(--pri-ink);
  font-size: 12px; font-style: normal; display: flex; align-items: center; justify-content: center; }
.gy-bubble .gy-n { position: absolute; left: -4px; top: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: var(--on-bad); font-size: 11px; display: flex; align-items: center; justify-content: center; }
.gy-bubble .gy-n.hidden { display: none; }
.gy-sheet { position: fixed; z-index: 19; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; max-height: 70%; overflow-y: auto;
  background: var(--bg); color: var(--ink); border-radius: 24px 24px 0 0; border: 1.5px solid var(--line); border-bottom: none; box-shadow: 0 -6px 18px rgba(60, 30, 10, .18);
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; }
.gy-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gy-chip { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.gy-chip[aria-pressed="true"] { background: var(--pri-soft); border-color: var(--pri); font-weight: 700; }
.gy-sheet textarea { width: 100%; box-sizing: border-box; min-height: 96px; resize: vertical; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 16px; }

/* ===================== H1 (anh chốt 2026-11-22): lưới thẻ cơ sở + bong bóng việc + dải nút đáy ===================== */
/* Ba lớp nhìn, không lẫn nhau:
   NÚT  = khối đặc, nổi (bóng dưới 4px), icon + 1 động từ, cao >= 44px. Màu theo việc:
          xanh lá = Thu / Giao / Nhận · cam = Bảo trì / Mua / Nâng · xanh dương = năng lượng · nâu đậm = đi tới · viền kem = phụ.
   NHÃN = chữ nhỏ trên nền nhạt, PHẲNG (không bóng, không viền), góc vuông nhẹ 6px: không bao giờ trông bấm được.
   THÔNG TIN = chữ trơn. Câu giải thích gập sau ⓘ. */
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tag { border-radius: 6px; padding: 1px 6px; font-size: 11.5px; font-weight: 700; box-shadow: none; border: 0; }
.btn.go { background: var(--ink); color: var(--bg); box-shadow: 0 4px 0 #000; }
.btn.go:active:not(:disabled) { box-shadow: 0 1px 0 #000; }
.btn.blue { background: var(--nrg); color: #fff; box-shadow: 0 4px 0 #06405f; }
.btn.blue:active:not(:disabled) { box-shadow: 0 1px 0 #06405f; }
:root[data-theme="dark"] .btn.blue { color: #08263a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.blue { color: #08263a; } }
.btn.sm { min-height: 44px; padding: 4px 10px; font-size: 13px; border-radius: 12px; }
.btn.sm.block { width: 100%; }

/* Ô ⓘ: chấm tròn nhỏ, chạm mở đoạn giải thích ngay dưới */
details.ii { display: inline-block; vertical-align: middle; }
details.ii > summary { list-style: none; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
details.ii > summary::-webkit-details-marker { display: none; }
.ii-i { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); color: var(--muted); display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--card); }
details.ii[open] .ii-i { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ii-b { font-size: 13px; color: var(--muted); background: var(--bg2); border-radius: 12px; padding: 8px 10px; margin-top: 2px; font-weight: 600; }
.ii-b p + p { margin-top: 4px; }
details.ii[open] { display: block; width: 100%; flex-basis: 100%; }

/* Trang có dải đáy: trang cao ít nhất bằng màn để dải luôn nằm sát thanh dưới */
.page.h1 { min-height: 100%; display: flex; flex-direction: column; padding-bottom: 0; }
.page.h1 > * + * { margin-top: 10px; }
.dock { position: sticky; bottom: 0; z-index: 3; margin-top: auto !important; margin-left: -14px; margin-right: -14px; padding: 12px 14px 8px;
  background: linear-gradient(to bottom, transparent, var(--bg) 14px); display: flex; flex-direction: column; gap: 8px; }
.page.h1 > :nth-last-child(2) { margin-bottom: 6px; }
.dock .btn { margin-bottom: 4px; }
.dock .acts { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; }
.dock .acts .btn { min-height: 54px; flex-direction: row; gap: 6px; font-size: 15px; position: relative; padding: 6px; }
.dock .acts .n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 12.5px; font-weight: 900; display: inline-grid; place-items: center; }
.dock .seg { background: var(--card); border: 1.5px solid var(--line); }
.btn.next { min-height: 64px; gap: 0; border-radius: 18px; }
.btn.next .cap { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; font-weight: 800; }
.btn.next .nl { font-size: 17px; }
.btn.next small { color: #ffd9a8; opacity: 1; }

/* Cố vấn gọn */
.page.h1 .guide { padding: 10px 12px; border-radius: 20px; }
.page.h1 .guide .gh { align-items: flex-start; gap: 10px; }
.page.h1 .guide .face { width: 40px; height: 40px; font-size: 23px; }
.page.h1 .guide .say { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.page.h1 .guide .steps { margin-top: 5px; }
.adv-f { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.adv-f .btn { margin-bottom: 4px; }
.adv-f > .lnk { margin-left: auto; }
.lnk { min-height: 44px; min-width: 44px; padding: 0 6px; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.adv-f details.ii > summary { min-height: 36px; }
.page.h1 .guide .adv-f + .adv-f { margin-top: 0; }
.adv-f details.ii[open] { order: 9; }

/* Mốc kế mảnh */
.mile2 { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 5px 10px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; color: var(--ink); }
.mile2.ready { border-color: var(--okb); }
.mile2 .mi-i { font-size: 18px; }
.mile2 .m-t { font-size: 12.5px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mile2 .m-t i { font-style: normal; font-size: 10px; font-weight: 900; color: var(--muted); letter-spacing: .05em; margin-right: 2px; }
.mile2 .m-n { font-size: 12px; font-weight: 800; color: var(--muted); flex: none; margin-left: 6px; }
.mile2 .meter { height: 5px; margin-top: 3px; }
.mile2 .chev { color: var(--muted); }

/* Khi bạn quay lại: gập một dòng */
details.ret { padding: 0 12px; }
details.ret > summary { list-style: none; display: flex; align-items: center; gap: 6px; min-height: 44px; font-size: 13px; }
details.ret > summary::-webkit-details-marker { display: none; }
details.ret > summary b { flex: none; }
details.ret .ret-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); flex: 1; }
details.ret .chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
details.ret[open] .chev { transform: rotate(180deg); }
details.ret[open] { padding-bottom: 10px; }
.page.h1 > details.ret { margin-top: 10px; border-top: 1.5px solid var(--line); }

/* Lưới thẻ cơ sở 2 cột */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; align-items: start; padding-top: 6px; }
.ft { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); min-width: 0; }
.ft.s-run { border-color: color-mix(in srgb, var(--okb) 55%, var(--line)); }
.ft.s-wait { border-color: var(--pri); }
.ft.s-stall { border-color: var(--bad); }
.ft.s-full { border-color: color-mix(in srgb, var(--warn) 60%, var(--line)); }
.ft.hl { box-shadow: 0 0 0 3px var(--pri-soft), var(--shadow); }
.ft-main { display: flex; flex-direction: column; gap: 3px; width: 100%; background: none; border: 0; padding: 0 0 8px; text-align: left; color: var(--ink); min-width: 0; }
.ft-art { position: relative; display: block; height: 86px; border-radius: 16px 16px 0 0; overflow: hidden; background: linear-gradient(var(--sky) 71.8%, var(--ground) 71.8%); }
.ft-art svg { width: 86px; height: 86px; display: block; margin: 0 auto; }
.ft-art .corner { position: absolute; left: 6px; top: 6px; display: flex; gap: 3px; flex-wrap: wrap; max-width: 70%; }
.ft-art .corner .tag { background: color-mix(in srgb, var(--card) 88%, transparent); }
.ft-art .corner .tag.up { background: var(--ok-bg); color: var(--ok); font-size: 13px; }
.ft-t { display: flex; align-items: center; gap: 5px; padding: 4px 9px 0; min-width: 0; }
.ft-t b { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-t .lv { flex: none; }
.ft-s { display: flex; align-items: center; gap: 5px; padding: 0 9px; min-width: 0; }
.ft-s .st { font-size: 12.5px; min-width: 0; align-items: center; }
.ft-s .st > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft .meter { height: 5px; margin: 1px 9px 0; }
.mats { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 9px 0; }
.mi { display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px 1px 3px; border-radius: 6px; background: var(--bg2); font-size: 13px; position: relative; }
.mi svg { width: 15px; height: 15px; }
.mi i { font-style: normal; font-size: 11px; font-weight: 800; color: var(--muted); }
.mi.miss { background: var(--bad-bg); }
.mi.miss i { color: var(--bad); }
.mi.miss::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 1.5px solid var(--card); }
.ft-f { padding: 0 8px 4px; }
.ft-f .btn { font-size: 12px; min-height: 44px; }
/* Bong bóng việc trên tranh: nút tròn nổi (bấm là làm luôn); ❗ là nhãn phẳng */
.bb { position: absolute; top: -8px; right: -6px; z-index: 2; min-width: 48px; height: 48px; padding: 0 9px; border-radius: 999px; border: 2.5px solid var(--card);
  display: inline-flex; align-items: center; justify-content: center; gap: 3px; font-size: 20px; line-height: 1; color: #fff; font-weight: 900; }
.bb b { font-size: 13px; }
.bb.b-thu { background: var(--okb); box-shadow: 0 4px 0 var(--okb-sh), 0 4px 10px rgba(0, 0, 0, .18); animation: bob 1.8s ease-in-out infinite; }
.bb.b-bt { background: var(--pri); box-shadow: 0 4px 0 var(--pri-sh), 0 4px 10px rgba(0, 0, 0, .18); animation: bob 1.8s ease-in-out infinite; }
.bb.b-go { background: var(--ink); color: var(--bg); box-shadow: 0 4px 0 #000; font-size: 16px; }
.bb.b-go b { font-size: 12px; }
.bb.b-bad { background: var(--bad-bg); color: var(--bad); width: 34px; min-width: 34px; height: 34px; padding: 0; font-size: 18px; top: -4px; right: -2px; border-width: 2px; box-shadow: none; }
.bb:active { transform: translateY(3px); }
@keyframes bob { 50% { transform: translateY(-3px); } }
.ft-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 150px; border: 2px dashed var(--line); border-radius: 18px; background: transparent; color: var(--muted); font-weight: 800; }
.ft-add .plus { font-size: 30px; line-height: 1; color: var(--pri); }
.ft-add b { color: var(--ink); font-size: 14px; }
.ft-note { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
@media (prefers-reduced-motion: reduce) { .bb { animation: none !important; } }

/* Thanh trên gọn: chỉ để xem */
.me { flex: none; }
.ava .up { position: absolute; left: -4px; top: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--okb); color: #fff; font-size: 11px; font-style: normal; font-weight: 900; display: grid; place-items: center; border: 2px solid var(--card); }
#top { justify-content: space-between; }
#top .pill.nrg .pv { display: flex; flex-direction: column; gap: 3px; min-width: 30px; }
.eb { display: block; width: 34px; height: 4px; border-radius: 3px; background: var(--nrg-bg); overflow: hidden; }
.eb b { display: block; height: 100%; background: var(--nrg); border-radius: 3px; }

/* Thanh dưới: icon to, chữ nhỏ; mục đang chọn nền cam đặc */
.nav button { font-size: 10.5px; }
.nav button .ni { font-size: 27px; }
.nav button[aria-current="page"] { background: var(--pri); color: var(--pri-ink); }

/* Tấm chi tiết cơ sở */
.fh .art { width: 64px; height: 64px; }
.fh-i { gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.ring.sm { width: 72px; height: 72px; }
.ring.sm .rc { padding: 0 6px; }
.ring.sm .rc b { font-size: 15px; }
.ring.sm .rc span { font-size: 10px; }
.strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 44px; padding: 4px 4px 4px 12px; border-radius: 14px; font-size: 13.5px; background: var(--bg2); }
.strip.bad { background: var(--bad-bg); color: var(--bad); }
.strip.warn { background: var(--warn-bg); color: var(--warn); }
.strip .ii-b { color: var(--ink); }
.foot2 { display: flex; gap: 8px; align-items: stretch; }
.foot2 > .btn { margin-bottom: 4px; }
.foot2 > .btn.green { flex: 0 0 34%; }
.stepper { flex-wrap: wrap; }

/* Đơn */
.don-tools { gap: 8px; }
.board-reroll { flex-direction: row; margin: 0; }
.ok-big { font-size: 20px; }
.ord.ready { border-color: var(--okb); border-width: 2px; border-left-width: 6px; }
.sum2 .v { font-size: 18px; }

.btn.blue:disabled, .btn.go:disabled { background: var(--bg2); color: var(--muted); box-shadow: 0 4px 0 var(--line); }
.src-h.wrap { flex-wrap: wrap; }
:root[data-theme="dark"] .btn.next small { color: #8a340c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.next small { color: #8a340c; } }
.ft-add { min-height: 120px; }

/* =====================================================================================================================
   THEME 2026-11-23: khung hướng C (sáng) / Lo-fi đêm (tối). Chỉ ghi đè hình dáng; màu lấy từ token đầu tệp.
   ===================================================================================================================== */
/* Font (anh chốt): Baloo 2 cho tiêu đề, số, nút; Be Vietnam Pro cho chữ thường. Chưa nhúng tệp font (máy chủ chỉ phát
   .html/.js/.css và CSP chặn nguồn ngoài): máy nào có sẵn font thì dùng, không thì rơi về font tròn của hệ thống. */
body { font-family: var(--font-b); }
h2, h3, .title, .btn, .pill, .nav button, #top .tt, .pick .nm, .sum2 .v, .tile .tn, .where, .lv, .tag.tw-t { font-family: var(--font-d); }
h2, .title { letter-spacing: 0; }

/* Nút: luật H1 giữ nguyên (khối đặc, >= 44px, màu theo việc). Bóng của nút "đi tới" và nút năng lượng lấy theo token. */
.btn.go { box-shadow: 0 4px 0 var(--go-sh); }
.btn.go:active:not(:disabled) { box-shadow: 0 1px 0 var(--go-sh); }
.bb.b-go { box-shadow: 0 4px 0 var(--go-sh); }
.btn.blue { color: var(--nrg-ink); box-shadow: 0 4px 0 var(--nrg-sh); }
.btn.blue:active:not(:disabled) { box-shadow: 0 1px 0 var(--nrg-sh); }
.btn.blue:disabled, .btn.go:disabled { background: var(--bg2); color: var(--muted); box-shadow: 0 4px 0 var(--line); }
.dock .acts .n { background: rgba(255, 255, 255, .3); color: inherit; }
.seg button[aria-pressed="true"] { box-shadow: 0 2px 6px rgba(28, 33, 64, .16); }
.seg.seg4 button { font-size: 12.5px; padding: 4px 2px; }
/* Cam là màu nền nút; chữ cam trên nền nhạt dùng --pri-t cho đủ tương phản */
.tag.pri, .st.wait, .tile.t-bt, .sx-name, .ft-add .plus { color: var(--pri-t); }
/* Huy hiệu đếm */
.dot, .seg .cnt, .pill.sq .cnt { background: var(--badge); color: var(--badge-ink); }
#modal { background: var(--overlay); }

/* Thanh trên: nền thẻ phẳng, viên thuốc nhạt; ảnh nhân vật mở hồ sơ */
#top { background: var(--top1); border-radius: 0; box-shadow: 0 1.5px 0 var(--line); gap: 6px; }
.pill { background: var(--hud-pill); box-shadow: none; padding: 4px 10px 4px 8px; font-size: 15px; min-width: 0; }
#top > .pill.num:not(.dream) { flex: 0 1 auto; overflow: hidden; }
.pill.nrg { outline: 0; }
.pill.sq { width: 44px; flex: none; }
.ava { width: 46px; height: 46px; border-radius: 15px; background: var(--nrg-bg); border: 0; box-shadow: 0 0 0 2px var(--line); overflow: visible; }
.ava .av-s { width: 100%; height: 100%; display: block; border-radius: inherit; }
.ava .pf { position: absolute; left: -5px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 1.5px var(--line); font-size: 11px; font-style: normal; display: grid; place-items: center; line-height: 1; }
.ava.big { width: 64px; height: 64px; border-radius: 20px; }
.ava.big .pf { width: 24px; height: 24px; font-size: 13px; }
.ava .up { left: auto; right: -5px; top: -5px; }
:root[data-theme="dark"] .ava { border-radius: 50%; background: var(--card); box-shadow: 0 0 0 2px #F2C879, 0 0 14px rgba(242, 184, 128, .5); }
:root[data-theme="dark"] .pill { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .09); }
.hero { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
/* Dreamium: tím neon (một trong ba chỗ được phát sáng) */
.gem { width: 18px; height: 18px; flex: none; filter: drop-shadow(0 0 3px #B79CFF); }
.pill.dream { background: var(--dream-deep); color: #F1EAFF; box-shadow: 0 0 0 1.5px var(--dream-line), 0 0 12px rgba(139, 92, 246, .65); padding: 4px 10px 4px 8px; flex: none; }
:root[data-theme="dark"] .pill.dream { box-shadow: 0 0 0 1.5px var(--dream-line), 0 0 16px rgba(139, 92, 246, .65); }
.card.dreamc { border-color: var(--dream-line); box-shadow: 0 0 0 1px var(--dream-line), 0 0 16px rgba(139, 92, 246, .35); }
.card.dreamc h3 { color: var(--dream-t); }

/* Thanh dưới: Đơn · Kho · Đảo · Chợ · Công ty. Đảo ở giữa, nhô lên; Chợ và Công ty viền tím neon; Công ty có khoá. */
.nav { position: relative; z-index: 4; padding-top: 6px; gap: 0; }
.nav button, .nav button[aria-current="page"] { background: none; color: var(--muted); font-size: 11.5px; overflow: visible; }
.nav button .ni, .nav button[aria-current="page"] .ni { width: 40px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-size: 23px; filter: none; opacity: 1; transform: none; }
.nav button[aria-current="page"] { color: var(--ink); }
.nav button[aria-current="page"] .ni { background: var(--bg2); }
.nav .home { color: var(--ink); }
.nav .home .ni, .nav .home[aria-current="page"] .ni { width: 52px; height: 52px; border-radius: 17px; margin-top: -22px; margin-bottom: 8px; font-size: 27px; background: var(--ink); box-shadow: 0 0 0 5px var(--nav), 0 4px 0 2px var(--go-sh); }
.nav .home[aria-current="page"] .ni { box-shadow: 0 0 0 5px var(--nav), 0 0 0 7.5px var(--isl); }
.nav .neo, .nav .neo[aria-current="page"] { color: var(--dream-t); }
.nav .neo .ni, .nav .neo[aria-current="page"] .ni { background: var(--dream-deep); box-shadow: 0 0 0 1.5px var(--dream-line), 0 0 10px rgba(139, 92, 246, .55); }
.nav .neo[aria-current="page"] .ni { box-shadow: 0 0 0 2.5px var(--dream-line), 0 0 16px rgba(139, 92, 246, .8); }
.nav .locked { color: var(--muted); }
.nav .locked .ni { filter: grayscale(.7); opacity: .75; box-shadow: 0 0 0 1.5px var(--line); }
.nav .ns { top: 0; right: calc(50% - 30px); font-size: 12px; padding: 1px 3px; background: var(--nav); border-radius: 999px; }
.nav .dot { top: 0; right: calc(50% - 28px); }
:root[data-theme="dark"] .nav { border-top: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -6px 20px rgba(0, 0, 0, .3); }
:root[data-theme="dark"] .nav button .ni { background: rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .nav button[aria-current="page"] .ni { background: rgba(255, 255, 255, .16); }
:root[data-theme="dark"] .nav .home { color: #FFE2A8; }
:root[data-theme="dark"] .nav .home .ni, :root[data-theme="dark"] .nav .home[aria-current="page"] .ni { border-radius: 50%; background: radial-gradient(circle at 50% 35%, #FFE9B8, #F2B45E); box-shadow: 0 0 0 5px var(--nav), 0 0 22px rgba(242, 184, 128, .55); }
:root[data-theme="dark"] .nav .home[aria-current="page"] .ni { box-shadow: 0 0 0 5px var(--nav), 0 0 0 7.5px var(--isl), 0 0 22px rgba(242, 184, 128, .55); }
:root[data-theme="dark"] .nav .neo .ni, :root[data-theme="dark"] .nav .neo[aria-current="page"] .ni { background: #231650; }
/* Nút Đảo nhô lên 24px: dải nút đáy chừa thêm chỗ để không bị che */
.dock { padding-bottom: 22px; }

/* Tranh cảnh đảo nhà ở đầu màn Đảo: sáng = cảnh ngày tràn mép; tối = cảnh đêm bo góc, đèn ấm */
.scene { position: relative; height: 78px; margin: -14px -14px 0; overflow: hidden; flex: none; }
.scene .art { width: 100%; height: 100%; display: block; }
.scene .art.night { display: none; }
.scene .where { position: absolute; left: 12px; bottom: 8px; min-height: 44px; padding: 0 14px 0 11px; border: 0; border-radius: 22px; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 15px; background: var(--card); color: var(--ink); box-shadow: 0 0 0 2px var(--isl), 0 3px 8px rgba(28, 33, 64, .18); }
:root[data-theme="dark"] .scene { margin: 0; height: 84px; border-radius: 24px; box-shadow: 0 10px 26px rgba(0, 0, 0, .35), inset 0 0 0 1.5px rgba(255, 255, 255, .1); }
:root[data-theme="dark"] .scene .art.day { display: none; }
:root[data-theme="dark"] .scene .art.night { display: block; }
:root[data-theme="dark"] .scene .where { background: rgba(27, 34, 64, .8); box-shadow: 0 0 0 1.5px var(--isl); }

/* Thẻ: bo tròn hơn; ở nền tối thẻ không viền sáng mà dùng bóng */
.ft { border-radius: 20px; }
.ft-art { border-radius: 18px 18px 0 0; }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .ft, :root[data-theme="dark"] .ord, :root[data-theme="dark"] .pick { box-shadow: 0 8px 18px rgba(0, 0, 0, .22), inset 0 0 0 1.5px rgba(255, 255, 255, .05); }
:root[data-theme="dark"] .ft.s-full { border-color: #F2C879; box-shadow: 0 0 0 1px #F2C879, 0 0 18px rgba(242, 184, 128, .35); }
.guide { background: linear-gradient(135deg, var(--card), var(--pri-soft)); }

/* Cấp đơn (anh chốt): viền Nhanh ngọc · Vừa vàng · Lớn hồng; luôn kèm icon và chữ, không dựa vào màu một mình */
.ord.tw-n, .ord.tw-v, .ord.tw-l { border: 2px solid var(--tw); border-left-width: 2px; }
.ord.tw-n, .tw-t.tw-n, .tw-h.tw-n { --tw: var(--t1); --tw-soft: var(--t1-soft); --tw-ink: var(--t1-ink); }
.ord.tw-v, .tw-t.tw-v, .tw-h.tw-v { --tw: var(--t2); --tw-soft: var(--t2-soft); --tw-ink: var(--t2-ink); }
.ord.tw-l, .tw-t.tw-l, .tw-h.tw-l { --tw: var(--t3); --tw-soft: var(--t3-soft); --tw-ink: var(--t3-ink); }
.tag.tw-t { background: var(--tw-soft); color: var(--tw-ink); font-size: 12.5px; padding: 2px 8px; }
h3.tw-h { color: var(--tw-ink); }
.ord.ready.tw-n, .ord.ready.tw-v, .ord.ready.tw-l { border-color: var(--tw); border-width: 2px; box-shadow: 0 0 0 3px var(--ok-bg), var(--shadow); }
.ord.idle { border-style: dashed; box-shadow: none; }

/* Màn tạo nhân vật / đổi ngoại hình: nửa trên xem, nửa dưới chọn, hai nút ở đáy (vùng ngón cái) */
.page.look { padding-top: 10px; }
.lk-top { display: flex; align-items: center; gap: 10px; }
.steps { display: inline-flex; gap: 5px; flex: none; }
.steps i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); }
.steps i.on { width: 20px; background: var(--ink); }
.lk-stage { flex: 1 1 200px; min-height: 180px; max-height: 380px; margin: 8px -14px 0 !important; display: grid; place-items: center; padding: 8px 0 0;
  background: radial-gradient(120% 90% at 50% 100%, var(--card) 0, var(--nrg-bg) 70%); }
:root[data-theme="dark"] .lk-stage { background: radial-gradient(120% 90% at 50% 100%, #5A6694 0, #2B3558 80%); }
.av-l { height: 100%; max-height: 350px; width: auto; display: block; }
.lk-panel { background: var(--card); border-radius: 24px; padding: 10px; margin-top: 0 !important; box-shadow: var(--shadow); position: relative; }
.lk-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.lk-opts.lk-g { grid-template-columns: 1fr 1fr; }
.lk-opts.lk-hair { grid-template-columns: repeat(3, 1fr); }
.lk-opts.lk-hair .lk-o, .lk-opts.lk-face .lk-o { min-height: 76px; }
.lk-opts.lk-shirt { grid-template-columns: repeat(7, 1fr); gap: 4px; }
.lk-o { position: relative; min-height: 64px; min-width: 0; padding: 4px; border: 2.5px solid transparent; border-radius: 16px; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 800; color: var(--ink); }
.lk-o .av-s { width: 100%; max-width: 62px; height: auto; display: block; }
.lk-o.wide { flex-direction: row; gap: 10px; min-height: 72px; font-size: 16px; }
.lk-o.wide .av-s { width: 56px; }
.lk-o.dot { background: none; min-height: 48px; padding: 2px; border-radius: 50%; aspect-ratio: 1; }
.lk-o .sw-c { display: block; width: 100%; max-width: 38px; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14); }
.lk-o[aria-pressed="true"] { border-color: var(--ink); background: var(--card); }
.lk-o[aria-pressed="true"]:not(.dot)::after { content: "✓"; position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 900; display: grid; place-items: center; }
.page.look .dock .two { grid-template-columns: 1fr 1.2fr; }
/* Nền tối: tóc nhân vật màu xanh mực, cần nền sáng hơn một nấc để thấy rõ */
:root[data-theme="dark"] .ava { background: #56628F; }
:root[data-theme="dark"] .lk-o:not(.dot) { background: #4A5683; }
:root[data-theme="dark"] .lk-o[aria-pressed="true"]:not(.dot) { background: #56628F; }

/* =====================================================================================================================
   ĐỢT 2 (2026-11-23): font nhúng, đơn trên màn Đảo, thẻ cơ sở vòng đếm.
   ===================================================================================================================== */
/* Font nhúng (SIL OFL, tệp gốc từ kho google/fonts; giấy phép ở fonts/OFL-*.txt). Máy chủ phát /fonts/*.ttf (cùng nguồn, CSP không nới).
   Dùng nguyên tệp .ttf, chưa cắt tập ký tự. font-display: swap = chữ hiện ngay bằng font hệ thống, tải xong thì đổi. */
@font-face { font-family: "Baloo 2"; src: url("fonts/Baloo2-wght.ttf") format("truetype"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("fonts/BeVietnamPro-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("fonts/BeVietnamPro-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("fonts/BeVietnamPro-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("fonts/BeVietnamPro-ExtraBold.ttf") format("truetype"); font-weight: 800; font-style: normal; font-display: swap; }

:root { --ring-track: #E4E9F5; --ring-full: #E0A100; }
:root[data-theme="dark"] { --ring-track: #3F4A74; --ring-full: #F2C879; }

/* Tiêu đề mục trên màn Đảo: Đơn, Cơ sở */
.sec-h { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.sec-h h3 { font-size: 18px; flex: 1; }
.sec-h .lnk { min-height: 44px; margin: -8px -6px -8px 0; white-space: nowrap; }
.sec-h .tag { background: var(--bg2); }

/* Đơn trên màn Đảo: 3 thẻ gọn một hàng, viền theo cấp, luôn kèm icon + chữ; nút Giao chỉ hiện khi đủ hàng */
.ordz.hl .ord3 { outline: 3px solid var(--pri); outline-offset: 5px; border-radius: 16px; }
.ord3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 2px; }
.oc { --tw: var(--line); --tw-soft: var(--bg2); --tw-ink: var(--muted); background: var(--card); border: 2px solid var(--tw); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; box-shadow: var(--shadow); }
.oc.tw-n { --tw: var(--t1); --tw-soft: var(--t1-soft); --tw-ink: var(--t1-ink); }
.oc.tw-v { --tw: var(--t2); --tw-soft: var(--t2-soft); --tw-ink: var(--t2-ink); }
.oc.tw-l { --tw: var(--t3); --tw-soft: var(--t3-soft); --tw-ink: var(--t3-ink); }
.oc-h { background: var(--tw-soft); color: var(--tw-ink); font: 800 13.5px/1.5 var(--font-d); padding: 2px 8px; white-space: nowrap; overflow: hidden; }
.oc-b { padding: 6px 7px 6px; display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.oc-due { font-size: 12px; font-weight: 800; color: var(--tw-ink); white-space: nowrap; overflow: hidden; }
.oc-its { display: flex; gap: 6px; flex-wrap: wrap; min-height: 32px; }
.oc .it { position: relative; width: 30px; height: 30px; border-radius: 9px; background: var(--bg2); display: grid; place-items: center; font-size: 17px; line-height: 1; }
.oc .it svg { width: 19px; height: 19px; }
.oc .it u { position: absolute; right: -5px; bottom: -5px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--okb); color: #fff; font-size: 10px; font-weight: 900; text-decoration: none; display: grid; place-items: center; box-shadow: 0 0 0 1.5px var(--card); }
.oc .it.miss { background: var(--bad-bg); }
.oc .it.miss u { background: var(--badge); color: var(--badge-ink); }
.oc-rw { font: 800 15px/1.2 var(--font-d); white-space: nowrap; }
.oc .btn { margin-top: auto; min-height: 44px; margin-bottom: 4px; padding: 4px; font-size: 15px; }
.oc-wait { margin-top: auto; min-height: 44px; border-radius: 10px; background: var(--bg2); color: var(--muted); font-size: 12px; font-weight: 800; display: grid; place-items: center; text-align: center; padding: 2px 4px; margin-bottom: 4px; }
.oc.ready { box-shadow: 0 0 0 3px var(--ok-bg), var(--shadow); }
.oc.idle { border-style: dashed; box-shadow: none; background: transparent; }
.oc.idle .oc-b { justify-content: center; }
.oc.idle .oc-wait { background: none; margin: 0; min-height: 0; }
.oc-e { font-size: 22px; text-align: center; }
:root[data-theme="dark"] .oc { box-shadow: 0 8px 18px rgba(0, 0, 0, .25); }
:root[data-theme="dark"] .oc.idle { box-shadow: none; }

/* Thẻ cơ sở: vòng đếm 60 phút quanh icon (vơi dần theo thời gian còn lại), cấp là nhãn nhỏ "C3" trên vòng */
.ft-main { padding: 9px 9px 8px; gap: 6px; }
.ft-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fring { position: relative; width: 58px; height: 58px; flex: none; }
.fring > svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.fring .fi { position: absolute; inset: 8px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 23px; line-height: 1; overflow: hidden; }
.fring .fi svg { width: 27px; height: 27px; display: block; }
.fring .fi svg[viewBox="0 0 64 64"] { width: 100%; height: 100%; }
.fring .lv { position: absolute; left: -4px; bottom: -4px; font-size: 10.5px; padding: 0 5px; border-radius: 7px; box-shadow: 0 0 0 1.5px var(--card); }
.ft-x { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.ft-t { padding: 0; }
.ft-t b { font: 800 14.5px/1.25 var(--font-d); }
.ft-s { padding: 0; }
.ft-s .st { font: 800 13.5px/1.25 var(--font-d); }
.ft-s .st.run { font-size: 18px; color: var(--ink); }
.ft-s .st.full { color: var(--ok); }
.ft-x .corner { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 2px; }
.ft .mats { padding: 0; }
.ft .bb { top: -12px; right: -6px; min-width: 44px; height: 44px; font-size: 17px; padding: 0 8px; }
.ft .bb.b-bad { width: 30px; min-width: 30px; height: 30px; top: -8px; right: -4px; }
.ft-add { min-height: 78px; gap: 0; }
.ft-add .plus { font-size: 22px; }
/* Bong bóng việc trên thẻ cơ sở gọn lại (chỉ icon; số ⚡ vẫn đọc ở nhãn trợ năng và tấm cơ sở) để không che tên */
.grid2 { padding-top: 12px; row-gap: 16px; }
.ft .bb { top: -16px; right: -8px; }
.ft .bb.b-bt b, .ft .bb.b-go b { display: none; }
.ft:has(> .bb) .ft-t { padding-right: 26px; }
.btn.next { min-height: 54px; }
.btn.next .nl { font-size: 16px; }
.ft-t b { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ft:has(> .bb) .ft-t { padding-right: 20px; }
/* Bong bóng treo trên mép thẻ, không đè tên cơ sở */
.grid2 { padding-top: 20px; row-gap: 24px; }
.ft-main { padding-top: 13px; }
.ft .bb { top: -24px; }
.ft .bb.b-bad { top: -12px; }


/* ==================================================================================================================
   XÂY LẠI BỐ CỤC (anh chốt 2026-11-23). Hai bố cục, người chơi chọn ở Cài đặt (ui.js ghi data-layout lên <html>):
     dao = Cảnh đảo (mặc định): màn chính là hòn đảo, bấm thẳng công trình; bến cảng (Bảng đơn, Kho, Chợ, Công ty) ghim ở đáy.
     day = Dây chuyền: cơ sở xếp hàng dọc, mỗi hàng một nút việc; thanh tab phẳng ở đáy.
   Màu, font, token giữ nguyên. Phần dưới chỉ là bố cục.
   ================================================================================================================== */
#gopYBubble, .gy-bubble { display: none !important; } /* góp ý mở từ Cài đặt, không nổi trên màn */
:root { --land1: #B9E7B0; --land2: #8FD49A; --sand: #F5E3B5; --sea: #8FD8F0; --up-bg: #12893D; --up-ink: #FFFFFF; --down-bg: #C9302C; --down-ink: #FFFFFF; }
:root[data-theme="dark"] { --land1: #3F6168; --land2: #2F4B58; --sand: #6B6480; --sea: #26346E; --up-bg: #2F9461; --down-bg: #D9506A; }

/* ---------- thanh đáy ---------- */
.nav .nl { display: block; line-height: 1.1; white-space: nowrap; }
.nav .nl small { display: block; font-size: 10px; font-weight: 800; color: var(--muted); }
.nav .home .ni, .nav .home[aria-current="page"] .ni { width: 40px; height: 36px; border-radius: 12px; margin: 0; font-size: 23px; background: none; box-shadow: none; }
.nav .home[aria-current="page"] .ni { background: var(--bg2); }
:root[data-theme="dark"] .nav .home .ni, :root[data-theme="dark"] .nav .home[aria-current="page"] .ni { border-radius: 12px; background: rgba(255, 255, 255, .06); box-shadow: none; }
:root[data-theme="dark"] .nav .home[aria-current="page"] .ni { background: rgba(255, 255, 255, .16); }
:root[data-theme="dark"] .nav .home { color: var(--muted); }
:root[data-theme="dark"] .nav .home[aria-current="page"] { color: var(--ink); }
.dock { padding-bottom: 10px; }
/* Dây chuyền: tab đang chọn có nền viên thuốc */
:root[data-layout="day"] .nav button .ni, :root[data-layout="day"] .nav .home .ni { width: 56px; height: 32px; border-radius: 16px; }
:root[data-layout="day"] .nav button[aria-current="page"] .ni { background: var(--pri-soft); }
:root[data-layout="day"] .nav .home, :root[data-layout="day"] .nav .neo { color: var(--muted); }
:root[data-layout="day"] .nav .neo .ni, :root[data-layout="day"] .nav .neo[aria-current="page"] .ni { background: none; box-shadow: none; }
:root[data-layout="day"] .nav .neo[aria-current="page"] { color: var(--ink); }
:root[data-layout="day"] .nav .neo[aria-current="page"] .ni { background: var(--pri-soft); }
:root[data-layout="day"] .nav .home[aria-current="page"] { color: var(--ink); }
/* Cảnh đảo: bến cảng. Mỗi nút là một công trình có mái màu trên nền cát. */
:root[data-layout="dao"] .nav { background: var(--sand); border-top: 0; border-radius: 22px 22px 0 0; padding: 12px 8px calc(8px + env(safe-area-inset-bottom, 0px)); gap: 6px; box-shadow: 0 -4px 14px rgba(28, 33, 64, .14); }
:root[data-layout="dao"] .nav button { background: var(--card); color: var(--ink); border-radius: 16px; border-top: 7px solid var(--pri); min-height: 64px; box-shadow: 0 4px 0 rgba(28, 33, 64, .16); font-size: 11.5px; }
:root[data-layout="dao"] .nav button[aria-current="page"] { background: var(--card); color: var(--ink); outline: 3px solid var(--ink); outline-offset: -3px; }
:root[data-layout="dao"] .nav button[data-go="kho"] { border-top-color: #B07B4A; }
:root[data-layout="dao"] .nav button[data-go="cho"] { border-top-color: var(--t1); }
:root[data-layout="dao"] .nav button[data-go="cty"] { border-top-color: var(--dream); }
:root[data-layout="dao"] .nav button[data-go="coso"] { border-top-color: var(--isl); flex: 0 0 58px; }
:root[data-layout="dao"] .nav button .ni, :root[data-layout="dao"] .nav button[aria-current="page"] .ni, :root[data-layout="dao"] .nav .neo .ni, :root[data-layout="dao"] .nav .home .ni { background: none; box-shadow: none; height: 30px; width: 40px; }
:root[data-layout="dao"] .nav .neo, :root[data-layout="dao"] .nav .home { color: var(--ink); }
:root[data-layout="dao"] .nav .locked { opacity: .6; }
:root[data-layout="dao"] .nav .dot { top: -12px; right: 4px; border-color: var(--card); }
:root[data-layout="dao"] .nav .ns { top: -10px; right: 4px; background: var(--card); }

/* ---------- màn con: nút ✕ về đảo + dải cố vấn ---------- */
.pg-top { padding: 10px 14px 0; display: flex; gap: 8px; align-items: flex-start; }
.pg-top + .page { padding-top: 10px; }
.pg-close { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); color: var(--muted); font-size: 16px; font-weight: 800; box-shadow: var(--shadow); }
.cvstrip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border-radius: 16px; background: var(--pri-soft); color: var(--ink); font-size: 13px; line-height: 1.3; box-shadow: inset 0 0 0 1.5px var(--pri); }
.cvstrip .face { width: 32px; height: 32px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 19px; flex: none; }
.cvstrip b { color: var(--pri-t); }
.cvstrip.here { box-shadow: inset 0 0 0 2.5px var(--pri); font-weight: 700; }
.cvstrip .btn { flex: none; min-height: 40px; }

/* ---------- cố vấn ---------- */
.cv-next { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; }
.cv-next li { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); min-width: 0; }
.cv-next li i { flex: none; width: 18px; height: 18px; border-radius: 6px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 800; }
.cv-next li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide.cv-spot { position: relative; z-index: 17; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
#cvspot { position: fixed; z-index: 16; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 200vmax var(--overlay), inset 0 0 0 3px var(--pri); animation: cvpulse 1.3s ease-in-out infinite; }
#cvspot i { position: absolute; left: 58%; top: 82%; font-style: normal; font-size: 36px; line-height: 1; animation: cvbob 1s ease-in-out infinite; }
#cvspot.wide { border-radius: 24px; }
#cvspot.wide i { left: 72%; top: 70%; }
#cvspot.low i { top: auto; bottom: 86%; transform: rotate(180deg); animation: none; }
@keyframes cvpulse { 0%, 100% { box-shadow: 0 0 0 200vmax var(--overlay), inset 0 0 0 3px var(--pri); } 50% { box-shadow: 0 0 0 200vmax var(--overlay), inset 0 0 0 7px var(--pri); } }
@keyframes cvbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { #cvspot, #cvspot i { animation: none; } }

/* ---------- CẢNH ĐẢO: màn chính ---------- */
.page.home-dao { padding: 0; background: var(--sea); }
.page.home-dao > * + * { margin-top: 0; }
.page.home-dao > .land { margin-top: 8px; }
.page.h1 .guide .steps { display: flex; gap: 3px; max-width: 100%; overflow: hidden; }
.page.h1 .guide .steps i { flex: 1 1 0; min-width: 0; width: auto; }
.guide .gh > .grow { min-width: 0; }
.home-dao .scene.sky, :root[data-theme="dark"] .home-dao .scene.sky { height: 104px; margin: 0; border-radius: 0; box-shadow: none; }
.page.home-dao > .guide { margin: 10px 12px 0; }
.page.home-dao > .btn.block { margin: 10px 12px 0; width: calc(100% - 24px); }
.land { margin: 10px 8px 0; padding: 10px 8px 18px; border-radius: 34px 34px 28px 28px; background: linear-gradient(var(--land1), var(--land2)); box-shadow: 0 8px 0 var(--sand); }
.zone { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); opacity: .75; }
.bgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 4px; padding-top: 36px; }
.bld { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; background: none; border: 0; padding: 0; color: var(--ink); font: inherit; }
.bld-main { width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; padding: 0; color: var(--ink); position: relative; font: inherit; }
.bld-art { position: relative; width: 78px; height: 62px; border-radius: 18px; display: grid; place-items: center; background: #D6F0C4; box-shadow: 0 7px 0 #7FBF68, 0 12px 10px rgba(0, 0, 0, .14); margin-bottom: 9px; }
.bld.d-livestock .bld-art { background: #F3D2BF; box-shadow: 0 7px 0 #C89479, 0 12px 10px rgba(0, 0, 0, .14); }
.bld.d-mining .bld-art { background: #D5DEE8; box-shadow: 0 7px 0 #8FA3B8, 0 12px 10px rgba(0, 0, 0, .14); }
.bld.d-factory .bld-art { background: #FFD9B0; box-shadow: 0 7px 0 #D99455, 0 12px 10px rgba(0, 0, 0, .14); }
:root[data-theme="dark"] .bld-art { filter: brightness(.88); }
.bld-main:active .bld-art { transform: translateY(4px); }
.bld-art .fi { font-size: 34px; line-height: 1; display: grid; place-items: center; }
.bld-art .fi svg { width: 46px; height: 46px; }
.bld-art .lv { position: absolute; left: -6px; bottom: -8px; font-size: 10.5px; padding: 0 5px; }
.bld-lb { max-width: 100%; padding: 1px 8px; border-radius: 9px; background: var(--card); font-size: 11.5px; line-height: 1.35; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bld .st { font-size: 11.5px; justify-content: center; max-width: 100%; padding: 0 6px; border-radius: 8px; background: color-mix(in srgb, var(--card) 85%, transparent); }
.bld .st > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bld .corner { position: absolute; right: 2px; top: -6px; display: flex; gap: 2px; }
.bld .corner .tag { padding: 0 4px; font-size: 10.5px; }
.bld.hl .bld-art { outline: 3px solid var(--pri); outline-offset: 3px; }
.bld .bb { position: absolute; top: -30px; left: 50%; margin-left: -23px; width: 46px; height: 46px; border-radius: 50% 50% 50% 10px; background: var(--card); border: 3px solid var(--okb); display: grid; place-items: center; font-size: 21px; line-height: 1; padding: 0; color: var(--ink); box-shadow: 0 3px 8px rgba(0, 0, 0, .22); z-index: 2; animation: cvbob 1.5s ease-in-out infinite; }
.bld .bb svg { width: 24px; height: 24px; }
.bld .bb b { position: absolute; right: -11px; top: -9px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 11px; background: var(--okb); color: #fff; font-size: 12px; display: grid; place-items: center; }
.bld .bb.b-bt, .bld .bb.b-go { border-color: var(--pri); }
.bld .bb.b-bad { border-color: var(--badge); animation: none; }
@media (prefers-reduced-motion: reduce) { .bld .bb { animation: none; } }
.bld.add .bld-art { background: transparent; box-shadow: none; border: 2.5px dashed color-mix(in srgb, var(--ink) 40%, transparent); }
.bld.add .plus { font-size: 28px; font-weight: 800; color: color-mix(in srgb, var(--ink) 60%, transparent); }
.home-dao .ft-note { text-align: center; margin-top: 10px; }
.page.home-dao > .mile2 { margin: 20px 12px 0; width: calc(100% - 24px); }
.dock.float { z-index: 17; background: none; padding: 10px 12px 12px; align-items: flex-start; pointer-events: none; margin-left: 0; margin-right: 0; }
.dock.float > * { pointer-events: auto; }
.dock.float .guide { width: 100%; }
.dock.float .guide .adv-f:last-child { padding-right: 52px; } /* chừa chỗ bong bóng chat ở góc dưới phải */
.thuall { min-height: 52px; padding: 0 16px; border-radius: 18px; font-size: 16px; flex-direction: row; gap: 6px; width: auto; }
.thuall .n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #1C2140; font-size: 12.5px; font-weight: 900; display: inline-grid; place-items: center; }
.btall { margin-top: 12px; }

/* ---------- DÂY CHUYỀN: màn chính ---------- */
.page.home-day { padding-bottom: 20px; }
.frow { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 18px; background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); min-width: 0; color: var(--ink); font: inherit; }
.frow.s-run { border-color: color-mix(in srgb, var(--okb) 55%, var(--line)); } .frow.s-wait { border-color: var(--pri); } .frow.s-stall { border-color: var(--bad); }
.frow.s-full { border-color: color-mix(in srgb, var(--warn) 60%, var(--line)); } .frow.hl { box-shadow: 0 0 0 3px var(--pri-soft), var(--shadow); }
.frow-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; text-align: left; color: var(--ink); min-height: 56px; font: inherit; }
.frow .fring { flex: none; }
.frow-x { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.frow-t { display: flex; align-items: center; gap: 4px; min-width: 0; }
.frow-t b { font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .st { font-size: 12.5px; min-width: 0; } .frow .st > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .mats { padding: 0; }
.frow-a { flex: none; width: 104px; }
.frow-a .btn { width: 100%; min-height: 54px; padding: 4px 6px; font-size: 14.5px; flex-direction: column; gap: 0; line-height: 1.15; }
.frow.add { width: 100%; justify-content: center; gap: 8px; min-height: 56px; background: none; box-shadow: none; border: 2px dashed var(--line); color: var(--muted); }
.frow.add .plus { font-size: 20px; font-weight: 800; }
.orail { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 12px 14px 6px; }
.orail::-webkit-scrollbar { display: none; }
.orail .ot { flex: 0 0 96px; }

/* ---------- ô đơn nhỏ (bảng đơn, dải đơn) ---------- */
.oboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 8px; padding-top: 6px; }
.ot { position: relative; min-width: 0; min-height: 92px; padding: 5px 7px 6px; border-radius: 16px; background: var(--card); border: 2.5px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 3px; text-align: left; color: var(--ink); font: inherit; }
.ot.tw-n { border-color: var(--t1); } .ot.tw-v { border-color: var(--t2); } .ot.tw-l { border-color: var(--t3); }
.ot-h { font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.ot.tw-n .ot-h { color: var(--t1-ink); } .ot.tw-v .ot-h { color: var(--t2-ink); } .ot.tw-l .ot-h { color: var(--t3-ink); }
.ot-its { display: flex; gap: 7px; flex-wrap: wrap; min-height: 30px; padding-top: 2px; }
.ot .it { position: relative; width: 28px; height: 28px; border-radius: 9px; background: var(--bg2); display: grid; place-items: center; font-size: 16px; line-height: 1; }
.ot .it svg { width: 18px; height: 18px; }
.ot .it u { position: absolute; right: -6px; bottom: -5px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--okb); color: #fff; font-size: 10px; font-weight: 900; text-decoration: none; display: grid; place-items: center; }
.ot .it.miss { background: var(--bad-bg); } .ot .it.miss u { background: var(--badge); color: var(--badge-ink); }
.ot-rw { margin-top: auto; font-family: var(--font-d); font-weight: 700; font-size: 15px; }
.ot-ok { position: absolute; right: -7px; top: -9px; width: 24px; height: 24px; border-radius: 50%; background: var(--okb); color: #fff; font-style: normal; font-size: 13px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.ot[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.ot.idle { border-style: dashed; box-shadow: none; background: var(--bg2); align-items: center; justify-content: center; text-align: center; color: var(--muted); gap: 1px; }
.osel > p { margin-top: 6px; }

/* ---------- chọn đảo + chỉ số đảo: ▲ xanh = lợi, ▼ đỏ = thiệt (góp ý NhaLinh) ---------- */
.ists { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ist { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 2px 9px 2px 6px; border-radius: 10px; font-size: 12.5px; font-weight: 800; background: var(--bg2); color: var(--muted); white-space: nowrap; }
.ist i { font-style: normal; font-size: 16px; line-height: 1; }
.ist b { font-size: 12px; }
.ist u { text-decoration: none; font-family: var(--font-d); font-size: 14px; }
.ist.up { background: var(--up-bg); color: var(--up-ink); }
.ist.down { background: var(--down-bg); color: var(--down-ink); }
.isl-pick .isl-card { padding: 0; overflow: hidden; }
.isl-pick .isl-card.on { border-color: var(--ink); border-width: 2.5px; }
.isl-pick .isl-card.hl { outline: 3px solid var(--pri); }
.isl-pick .pick { display: block; border: 0; box-shadow: none; border-radius: 0; padding: 0 0 12px; min-height: 0; background: none; }
.isl-pick .pick .ists, .isl-pick .pick .isl-tl, .isl-pick .pick .isl-more { margin-left: 12px; margin-right: 12px; }
.isl-pick .isl-card > .btn { margin: 0 12px 12px; width: calc(100% - 24px); }
.scene.isl-art, :root[data-theme="dark"] .scene.isl-art { display: block; height: 96px; margin: 0; border-radius: 0; box-shadow: none; }
.isl-art .nm { position: absolute; left: 10px; bottom: 8px; padding: 3px 12px 3px 9px; border-radius: 16px; background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--ink); font-size: 16px; font-weight: 800; font-family: var(--font-d); }
.isl-tl { display: block; margin-top: 8px; color: var(--muted); }
.isl-more { display: block; margin-top: 8px; padding-top: 8px; border-top: 1.5px dashed var(--line); }
.sheet-b .scene.isl-art, :root[data-theme="dark"] .sheet-b .scene.isl-art { border-radius: 14px; margin: -4px -4px 0; }
.card.link .ists { margin-top: 4px; }

/* ---------- bong bóng chat kéo thả ---------- */
.chatb { position: fixed; z-index: 14; right: calc(var(--colR, 0px) + 8px); bottom: 104px; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink); font-size: 24px; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); display: grid; place-items: center; touch-action: none; padding: 0; }
.chatb.soon { opacity: .55; }
/* Dây chuyền: nút việc nằm ở mép phải từng hàng nên bong bóng mặc định nằm bên trái (người chơi kéo đi đâu cũng được). */
:root[data-layout="day"] .chatb { right: auto; left: calc(var(--colL, 0px) + 8px); }
.chatb .cnt { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--badge); color: var(--badge-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--card); }
.chatb .say { position: absolute; right: 58px; top: 8px; width: max-content; max-width: 220px; padding: 7px 11px; border-radius: 14px 14px 4px 14px; background: var(--card); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); text-align: left; }
.chatb.left .say { right: auto; left: 58px; border-radius: 14px 14px 14px 4px; }

/* ===================== MÀN CÔNG TY — lát 2 (2026-11-24) =====================
   Dùng token có sẵn nên theo cả hai theme. Tím --dream chỉ cho nhãn cấp công ty và Dreamium (luật màu ở đầu tệp).
   Đồng hồ gói thầu to, đổi đỏ và nháy khi còn dưới 1 phút. Màn dọc điện thoại: mọi hàng nút xuống dòng được. */
.page.co > * + * { margin-top: 12px; }
.co-head h2 { font-size: 19px; line-height: 1.2; margin: 0 0 2px; overflow-wrap: anywhere; }
.co-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.co-stats > div { background: var(--bg2); border-radius: 12px; padding: 6px 4px; text-align: center; min-width: 0; }
.co-stats b { display: block; font-size: 15.5px; font-weight: 900; }
.co-stats span { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.tag.dreamt { background: var(--dream-deep); color: var(--dream-hi); }
.co-tabs .chip { min-height: 44px; padding: 6px 12px; font-size: 13.5px; }
.co-tabs .cnt { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 999px; background: var(--badge); color: var(--badge-ink); font-size: 12px; text-align: center; }
.co-lot { background: var(--card); border: 1.5px solid var(--line); border-left: 6px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.co-lot.sec-farming { border-left-color: var(--farming); } .co-lot.sec-livestock { border-left-color: var(--livestock); }
.co-lot.sec-mining { border-left-color: var(--mining); } .co-lot.sec-factory { border-left-color: var(--factory); }
.co-lot.mine { box-shadow: 0 0 0 2px var(--okb), var(--shadow); }
.co-lot.lk .co-lot-h b { color: var(--muted); }
.co-lot-h { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px 12px 4px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.co-lot-h .grow { min-width: 0; display: flex; flex-direction: column; }
.co-lot-h b { font-size: 15.5px; }
.co-clock { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; background: var(--bg2); font-weight: 900; font-size: 16px; font-variant-numeric: tabular-nums; }
.co-clock.hot { background: var(--bad-bg); color: var(--bad); animation: coPulse 1s ease-in-out infinite; }
@keyframes coPulse { 50% { transform: scale(1.07); } }
.co-lot-m { display: flex; align-items: flex-end; gap: 8px; padding: 2px 12px 10px; }
.co-lot-m .grow { display: flex; flex-direction: column; min-width: 0; }
.co-price { font-size: 20px; font-weight: 900; line-height: 1.15; }
.co-lead { color: var(--muted); }
.co-lead.okc { color: var(--ok); font-weight: 800; }
.co-feas { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.co-feas.green { background: var(--ok-bg); color: var(--ok); } .co-feas.yellow { background: var(--warn-bg); color: var(--warn); } .co-feas.red { background: var(--bad-bg); color: var(--bad); }
.co-bid { border-top: 1.5px dashed var(--line); padding: 10px 12px 12px; display: grid; gap: 8px; }
.co-bid p { margin: 0; }
.co-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.co-facts li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.co-facts li span { color: var(--muted); } .co-facts li b { text-align: right; } .co-facts small { font-weight: 600; color: var(--muted); }
.co-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.co-row .inp { width: 84px; } .co-row .inp.wide, .inp.wide { width: 120px; flex: 1 1 110px; }
.co-row label { display: grid; gap: 2px; color: var(--muted); }
.co-quick { font-size: 16.5px; }
.co-f { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.co-f .sx-in, .co-f .inp { width: 100%; text-align: left; padding: 0 12px; }
.co-bar { height: 12px; border-radius: 999px; background: var(--bg2); overflow: hidden; }
.co-bar i { display: block; height: 100%; border-radius: 999px; background: var(--okb); transition: width .4s; }
.co-box { background: var(--bg2); border-radius: 14px; padding: 10px; display: grid; gap: 8px; }
.co-box p { margin: 0; }
details.co-box > summary { font-weight: 800; cursor: pointer; min-height: 32px; display: flex; align-items: center; gap: 6px; }
details.co-box[open] > summary { margin-bottom: 8px; }
.co-ct .btn small { font-weight: 700; }
.co-big { font-size: 21px; }
.co-tb { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
.co-tb th { text-align: left; font-weight: 600; color: var(--muted); padding: 5px 0; }
.co-tb td { text-align: right; padding: 5px 0 5px 10px; font-weight: 800; white-space: nowrap; }
.co-tb tr + tr { border-top: 1.5px dashed var(--line); }
.co-chance { display: grid; place-items: center; padding: 10px; border-radius: 16px; background: var(--dream-deep); color: var(--dream-hi); }
.co-chance span { font-size: 34px; font-weight: 900; line-height: 1; } .co-chance small { font-size: 12px; opacity: .9; }
.co-feed .ev { font-size: 13px; }
.co-fx { text-align: center; padding: 6px 0 12px; }
.co-fx .title { margin-top: 8px; }
.co-fx-ring { width: 108px; height: 108px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 54px; }
.co-fx.ok .co-fx-ring { background: radial-gradient(circle, var(--ok-bg) 55%, transparent 56%); animation: coBurst 1.1s ease-out 2, coPop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.co-fx.fail .co-fx-ring { background: radial-gradient(circle, var(--bad-bg) 55%, transparent 56%); animation: coShake .5s linear 2; }
@keyframes coBurst { 0% { box-shadow: 0 0 0 0 rgba(18, 137, 61, .55); } 100% { box-shadow: 0 0 0 34px rgba(18, 137, 61, 0); } }
@keyframes coPop { 0% { transform: scale(.3); } 100% { transform: scale(1); } }
@keyframes coShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px) rotate(-4deg); } 40% { transform: translateX(8px) rotate(3deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .co-clock.hot, .co-fx-ring { animation: none !important; } }
@media (max-width: 359px) { .co-stats { grid-template-columns: repeat(2, 1fr); } .co-price { font-size: 18px; } }
.co-box .stepper { flex-wrap: nowrap; flex: none; }
.co-box .stepper .btn { min-width: 44px; }
.co-up ul.plain { margin-top: 12px; }

/* ---------- Sửa sau soát qa 2026-11-24 ---------- */
/* Bong bóng chat ở màn Công ty: dạt sát mép gần nhất thành tai nhỏ 22 px, nằm gọn trong lề trang (14 px) và lề thẻ, nên không che
   đồng hồ gói thầu, ô nhập hay nút. Vẫn kéo dọc được; kéo ngang qua nửa màn thì sang mép kia. Đang kéo (.drag) thì bỏ ghim. */
.chatb.edge { width: 22px; height: 48px; font-size: 13px; border-radius: 14px 0 0 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, .28); border: 1.5px solid var(--line); border-right: 0; opacity: .92; }
.chatb.edge:not(.drag) { left: auto !important; right: var(--colR, 0px) !important; }
.chatb.edge.left { border-radius: 0 14px 14px 0; border: 1.5px solid var(--line); border-left: 0; }
.chatb.edge.left:not(.drag) { left: var(--colL, 0px) !important; right: auto !important; }
.chatb.edge .cnt { top: -8px; right: 1px; min-width: 18px; height: 18px; padding: 0 4px; font-size: 10px; }
.chatb.edge.left .cnt { right: auto; left: 1px; }
/* Toà nhà Công ty trên cảnh đảo: cao hơn công trình sản xuất, tím neon (màu của Công ty). */
.bld.cty-b .bld-art { height: 74px; margin-top: -12px; border-radius: 16px 16px 18px 18px; background: linear-gradient(#EDE6FF, #CDBDFA); box-shadow: 0 7px 0 var(--dream), 0 12px 10px rgba(0, 0, 0, .14), 0 0 14px rgba(139, 92, 246, .45); }
.bld.cty-b .bld-art .fi { font-size: 40px; }
.bld.cty-b .bld-lb { box-shadow: 0 0 0 1.5px var(--dream-line), 0 1px 3px rgba(0, 0, 0, .12); }
.bld.cty-b .st { color: var(--dream-t); font-weight: 700; }
.bld.cty-b .bb { top: -42px; }
.bld .bb.b-ct { border-color: var(--dream); animation: none; }
.bld .bb.b-ct b { background: var(--dream); }
.bld .bb.b-ct.soon { border-color: var(--badge); animation: cvbob 1.5s ease-in-out infinite; }
.bld .bb.b-ct.soon b { background: var(--badge); color: var(--badge-ink); }
@media (prefers-reduced-motion: reduce) { .bld .bb.b-ct.soon { animation: none; } }
/* Hộp thư: tin công ty */
.co-mail .ev { padding: 6px 0; border-top: 1px dashed var(--line); line-height: 1.4; }
.co-mail .ev:first-child { border-top: 0; }
.co-mail .ev.new { font-weight: 700; }
.co-mail .ev .tag { font-size: 10.5px; padding: 0 5px; }
.co-facts small { font-weight: 500; color: var(--muted); }

/* Chơi thử 60 phút (2026-11-24, prototyper) */
/* J: ngón tay "Lập công ty" nằm trong khung toà nhà, không thò ra che đồng hồ cơ sở bên cạnh. */
.bb.b-go.in { top: 4px; right: 4px; min-width: 38px; height: 38px; padding: 0 6px; font-size: 14px; }
/* L: cố vấn trỏ tới "Thu hết" thì nút được viền sáng. */
.thuall.hl { outline: 3px solid #ffd24a; outline-offset: 2px; animation: bob 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .thuall.hl { animation: none; } }
/* B: thanh tiến độ cố vấn thay cho dãy chấm và "Bước n/N". */
.page .guide .steps .meter, .guide .steps .meter { display: block; flex: 1 1 auto; width: 100%; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.page.h1 .guide .steps .meter > i, .guide .steps .meter > i { display: block; flex: none !important; height: 100% !important; min-width: 0; background: var(--pri) !important; border-radius: 999px; }

/* (anh 2026-11-26) Mọi hộp nổi: hàng đầu có ✕ 44 px; 💬 nổi trên lớp phủ ở góc trên phải, tấm chừa chỗ cho nó. */
.dlg-h { flex: none; display: flex; justify-content: flex-end; padding: 6px 8px 0; position: relative; }
.dlg-h::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line); }
.sheet.dlg .sheet-b { padding-top: 0; }
#modal .sheet { max-height: min(90%, calc(100% - 76px - env(safe-area-inset-top, 0px))); }
html.ov-on #chatBubble:not(.hidden) { display: grid !important; z-index: 25; } /* (anh 2026-11-26) không ghim góc nữa: giữ chỗ đã kéo, kéo được trên tấm */
html.ov-on #chatBubble .say { display: none; }
.gy-bg { position: fixed; inset: 0; z-index: 59; background: rgba(30, 15, 5, .35); }
.gy-sheet { z-index: 60; }
.chatb { z-index: 18; } /* trên dải nút nổi của màn Căn cứ (dock.float 17), dưới lớp phủ tấm (20) */

/* ===== TẤM 💬: HÀNG ICON, HỖ TRỢ, MENU NHẤN GIỮ, ĐỀ XUẤT TÍNH NĂNG (anh chốt 2026-11-26) =====
   Chỉ dùng biến màu sẵn có nên theo cả sáng lẫn tối. Màu trạng thái: Mới = ngọc (--t1), Đang xem xét = vàng (--t2),
   Đang phát triển = màu chính (--pri: cam ở theme gốc, tím ở theme vũ trụ), Đã release = xanh lá (--ok), Đã huỷ = đỏ (--bad). Mọi nút chạm ≥ 44 px. */
.sx-nav { flex: none; display: flex; gap: 4px; margin: 0 14px 8px; padding: 4px; background: var(--bg2); border-radius: 18px; }
.sx-nav-b { flex: 1; min-width: 0; min-height: 56px; border: 0; border-radius: 14px; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 5px 2px 6px; font-weight: 800; }
.sx-nav-i { position: relative; font-size: 22px; line-height: 1.15; }
.sx-nav-i .cnt { position: absolute; top: -5px; left: 100%; margin-left: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--badge); color: var(--badge-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg2); line-height: 1; }
.sx-nav-l { font-size: 12.5px; white-space: nowrap; }
.sx-nav-b[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 2px 6px rgba(28, 33, 64, .16), inset 0 -3px 0 var(--pri); }

.sx-msg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sx-msg:focus-visible { outline: 3px solid var(--nrg); outline-offset: 2px; }
.sx-dx { position: relative; display: inline-flex; align-items: center; gap: 3px; margin-top: 5px; padding: 4px 10px; border: 0; border-radius: 999px; background: var(--t2-soft); color: var(--t2-ink); font-size: 12.5px; font-weight: 800; }
.sx-dx::after { content: ""; position: absolute; inset: -8px -4px; } /* vùng chạm 44 px */
.sx-menu-bg { position: fixed; inset: 0; z-index: 30; background: var(--overlay); display: flex; align-items: flex-end; justify-content: center; }
.sx-menu-bg.hidden { display: none; }
.sx-menu { width: 100%; max-width: 480px; background: var(--bg); color: var(--ink); border-radius: 24px 24px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 30px rgba(0, 0, 0, .3); animation: up .18s ease-out; display: flex; flex-direction: column; gap: 6px; }
.sx-menu-q { background: var(--card); border-radius: 14px; padding: 8px 12px; font-size: 13.5px; border-left: 4px solid var(--pri); margin-bottom: 4px; }
.sx-menu-q b { display: block; font-size: 12.5px; }
.sx-menu-q span { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sx-menu-t { font-weight: 800; font-size: 13px; color: var(--muted); padding: 2px 2px 0; }
.sx-mi { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: var(--card); color: var(--ink); font-weight: 700; font-size: 15px; text-align: left; padding: 6px 14px; }
.sx-mi:active { background: var(--bg2); }
.sx-mi-i { width: 28px; text-align: center; font-size: 20px; flex: none; }
.sx-mi.hl { background: var(--pri-soft); color: var(--pri-t); font-weight: 800; }
.sx-mi.bad { color: var(--bad); }
.sx-mi.soft { background: transparent; color: var(--muted); }
.sx-menu-x { margin-top: 6px; }
.sx-copy { position: fixed; left: -999px; top: 0; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .sx-menu { animation: none; } }

.sx-sup-hero { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--pri-soft); }
.sx-sup-hero h3 { font-size: 17px; }
.sx-sup-hero p { margin: 2px 0 0; color: var(--ink); opacity: .85; }
.sx-sup-big { font-size: 40px; line-height: 1; flex: none; }
.sx-sup-list { display: flex; flex-direction: column; gap: 10px; }
.sx-sup { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 12px; color: var(--ink); }
.sx-sup:active { transform: translateY(1px); }
.sx-sup-i { width: 48px; height: 48px; border-radius: 15px; background: var(--pri-soft); display: grid; place-items: center; font-size: 24px; flex: none; }
.sx-sup b { display: block; font-size: 15.5px; }
.sx-sup-d { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.3; margin-top: 1px; }
.sx-sup-go { font-size: 24px; color: var(--muted); flex: none; }
.sx-sup.alt .sx-sup-i { background: var(--t2-soft); }
.sx-hotro .sx-sup-or { font-size: 12.5px; font-weight: 800; color: var(--muted); margin-top: 20px; }
.sx-hotro .sx-sup-or + .sx-sup { margin-top: 8px; }

.s-moi { --sc: var(--t1-ink); --sb: var(--t1-soft); --sf: var(--t1); }
.s-xem_xet { --sc: var(--t2-ink); --sb: var(--t2-soft); --sf: var(--t2); }
.s-phat_trien { --sc: var(--pri-t); --sb: var(--pri-soft); --sf: var(--pri); }
.s-release { --sc: var(--ok); --sb: var(--ok-bg); --sf: var(--up-bg); }
.s-huy { --sc: var(--bad); --sb: var(--bad-bg); --sf: var(--bad); }
.dx-st { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--sb); color: var(--sc); white-space: nowrap; }
.dx-st.big { font-size: 14px; padding: 5px 12px; }
.dx > * + * { margin-top: 10px; }
.dx-chips { display: flex; gap: 6px; overflow-x: auto; margin-left: -14px; margin-right: -14px; padding: 0 14px 4px; scrollbar-width: none; }
.dx-chips::-webkit-scrollbar { display: none; }
.dx-chip { flex: none; min-height: 44px; display: inline-flex; align-items: center; gap: 5px; padding: 0 13px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--muted); font-weight: 800; font-size: 13px; white-space: nowrap; }
.dx-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dx-chip[class*="s-"][aria-pressed="true"] { background: var(--sb); color: var(--sc); border-color: var(--sf); }
.dx-chip-n { margin-left: 1px; font-size: 11.5px; opacity: .75; }
.dx-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--badge); flex: none; display: inline-block; }
.dx-chip .dx-dot { margin-left: 1px; }
.dx-list { display: flex; flex-direction: column; gap: 10px; }
.dx-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.dx-card.mine { box-shadow: inset 4px 0 0 var(--pri), var(--shadow); }
.dx-card.hid { opacity: .7; }
.dx-open { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--ink); padding: 12px 14px 4px; }
.dx-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dx-card-t { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; font-family: var(--font-d); font-weight: 800; font-size: 16.5px; line-height: 1.25; overflow-wrap: anywhere; }
.dx-card-t > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dx-card-x { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; font-size: 13.5px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.dx-card-f { display: flex; align-items: center; gap: 6px; padding: 4px 8px 8px 14px; }
.dx-by { font-size: 12.5px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-v, .dx-cm { flex: none; min-width: 52px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); color: var(--muted); font-weight: 800; font-size: 14px; }
.dx-v-a { font-size: 12px; }
.dx-v.up[aria-pressed="true"] { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.dx-v.down[aria-pressed="true"] { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.dx-v:disabled { opacity: .5; }
.dx-cm { border-color: transparent; background: none; min-width: 46px; padding: 0 6px; }
.dx-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 30px 20px; border: 2px dashed var(--line); border-radius: var(--r); }
.dx-empty-i { font-size: 44px; line-height: 1; }

.dx-prog { padding: 12px 8px 14px; }
.dx-prog-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; flex-wrap: wrap; }
.dx-track { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.dx-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; min-width: 0; }
.dx-step + .dx-step::before { content: ""; position: absolute; top: 16px; right: 50%; width: 100%; height: 4px; background: var(--line); }
.dx-step.done::before, .dx-step.cur::before, .dx-step.stop::before { background: var(--okb); }
.dx-node { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: 900; line-height: 1; background: var(--bg2); color: var(--muted); border: 2px solid var(--line); }
.dx-step.todo .dx-node { filter: grayscale(1); }
.dx-step.done .dx-node { background: var(--okb); border-color: var(--okb); color: #fff; }
.dx-step.cur .dx-node { width: 44px; height: 44px; margin: -4px 0; font-size: 21px; background: var(--card); border: 3px solid var(--sf); box-shadow: 0 0 0 5px var(--sb); }
.dx-lbl { font-size: 11.5px; font-weight: 700; color: var(--muted); line-height: 1.2; padding: 0 2px; }
.dx-step.done .dx-lbl { color: var(--ink); opacity: .8; }
.dx-step.cur .dx-lbl { color: var(--ink); font-weight: 800; margin-top: 4px; }
.dx-track.off .dx-step.done .dx-node, .dx-track.off .dx-step.stop .dx-node { background: var(--muted); border-color: var(--muted); color: var(--card); filter: grayscale(1); }
.dx-track.off .dx-step.done::before, .dx-track.off .dx-step.stop::before { background: var(--muted); }
.dx-track.off .dx-lbl { color: var(--muted); }
.dx-branch { display: grid; grid-template-columns: repeat(4, 1fr); justify-items: center; margin-top: 2px; }
.dx-branch.c0 > * { grid-column: 1; } .dx-branch.c1 > * { grid-column: 2; } .dx-branch.c2 > * { grid-column: 3; } .dx-branch.c3 > * { grid-column: 4; }
.dx-branch-l { width: 0; height: 14px; border-left: 3px dashed var(--bad); }
.dx-branch-n { padding: 4px 10px; border-radius: 999px; background: var(--bad-bg); color: var(--bad); font-size: 13px; font-weight: 800; white-space: nowrap; border: 1.5px solid var(--bad); }

.dx-main-h { display: flex; align-items: flex-start; gap: 6px; }
.dx-title { font-family: var(--font-d); font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; padding-top: 2px; }
.dx-more { flex: none; width: 44px; height: 44px; margin: -8px -8px 0 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 22px; font-weight: 900; line-height: 1; }
.dx-more[aria-expanded="true"] { background: var(--bg2); color: var(--ink); }
.dx-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; font-size: 13px; }
.dx .sx-name { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; }
.dx-body { margin: 8px 0 0; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.dx-vote { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.dx-v.big { min-height: 48px; font-size: 14.5px; border-radius: 16px; background: var(--card); }
.dx-ratio { height: 6px; border-radius: 3px; background: var(--bad); margin-top: 8px; overflow: hidden; }
.dx-ratio.none { background: var(--bg2); }
.dx-ratio i { display: block; height: 100%; background: var(--up-bg); }
.dx-vote-n { margin: 6px 0 0; }
.dx-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; padding: 8px; border-radius: 14px; background: var(--bg2); }
.dx-reply { border-radius: var(--r); padding: 12px 14px; background: var(--nrg-bg); border: 1.5px solid var(--nrg); color: var(--ink); }
.dx-reply-h { display: flex; align-items: center; gap: 8px; color: var(--nrg); }
.dx-reply-i { width: 34px; height: 34px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 18px; flex: none; }
.dx-dev { border-style: dashed; border-color: var(--nrg); }
.dx-dev > * + * { margin-top: 8px; }
.dx-dev-tt { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dx-dev-tt .dx-chip { justify-content: center; padding: 0 8px; }
.dx-dev-tt .dx-chip.s-huy { grid-column: 1 / -1; }
.dx-lb { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.dx-ta { display: block; width: 100%; min-height: 88px; resize: vertical; line-height: 1.4; font-family: inherit; }
.dx-ta[readonly] { background: var(--bg2); color: var(--muted); }
.dx-cnt { font-size: 11.5px; color: var(--muted); }
.dx-cnt.over { color: var(--bad); font-weight: 800; }
.dx-c { padding: 6px 0 10px; border-top: 1px solid var(--line); }
.dx-cs h3 + .dx-c { border-top: 0; }
.dx-c-h { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.dx-c-h > b { min-height: 44px; display: inline-flex; align-items: center; }
.dx-c-t { font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.dx-c.dev { background: var(--nrg-bg); margin: 4px -8px; padding: 4px 8px 10px; border-radius: 14px; border-top: 0; }
.dx-c.dev + .dx-c { border-top: 0; }
.dx-c.hid .dx-c-t { font-style: italic; color: var(--muted); }
.dx-c .dx-more { margin: 0 -6px 0 0; }
.dx-from { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--pri-soft); color: var(--pri-t); }
.dx-from-i { font-size: 26px; flex: none; }
.dx-from b, .dx-from .small { display: block; }
.dx-fs > .sx-in { display: block; width: 100%; margin-top: 4px; }
.dx-fs .dx-gap { margin-top: 12px; }
.dx-tips { margin: 0; padding: 10px 12px 10px 28px; font-size: 13px; color: var(--muted); background: var(--bg2); border-radius: 14px; }
.dx-tips li + li { margin-top: 3px; }

/* ---------- linh vật (2026-11-26): ảnh đại diện, màn tạo nhân vật. Bản đồ ở sinh-dong.css ---------- */
.lvx { position: relative; display: block; width: 100%; height: 100%; }
.lv-h { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.lv-than { position: absolute; inset: 0; z-index: 2; background-repeat: no-repeat; background-size: 800% 100%; }
.lv-m { position: absolute; display: block; background-repeat: no-repeat; pointer-events: none; }
.lvx.mini { overflow: hidden; border-radius: inherit; background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 70%), var(--lv-nen); }
.ava .lvx.mini { border-radius: inherit; }
.lvx.full { width: auto; height: 100%; aspect-ratio: 1; max-height: 330px; }
.lvx.full::before { content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 9%; border-radius: 50%; background: var(--lv-nen); opacity: .55; filter: blur(1px); }
.lvx.full .lv-h { left: 8%; top: 14%; width: 84%; height: 84%; animation: lvTho 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes lvTho { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, .985); } }
.lk-tap { display: block; height: 100%; max-height: 330px; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; }
.lk-stage { position: relative; overflow: hidden; }
.lk-name { position: absolute; left: 50%; bottom: 6px; translate: -50% 0; padding: 3px 12px; border-radius: 999px; background: var(--card); color: var(--ink); font-size: 13px; box-shadow: var(--shadow); }
.seg.seg3 button { font-size: 13px; padding: 4px 2px; }
.lk-opts.lk-sp, .lk-opts.lk-o-dau { grid-template-columns: repeat(4, 1fr); }
.lk-opts.lk-nen { grid-template-columns: repeat(7, 1fr); gap: 4px; }
.lk-o.sp { min-height: 86px; font-size: 11.5px; gap: 3px; }
.lk-o.sp b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lk-o .lvx.mini { width: 100%; max-width: 62px; height: auto; aspect-ratio: 1; border-radius: 14px; }
.lk-o.mon { min-height: 70px; }
.lk-none { font-size: 26px; color: var(--ink); opacity: .45; }
@media (prefers-reduced-motion: reduce) { .lvx.full .lv-h { animation: none; } }
.lk-o.khoa .lvx.mini { filter: grayscale(.85) brightness(.75); }
.lk-o.khoa b { opacity: .7; }

/* 🛟 Hỗ trợ CSKH (2026-11-26, ho-tro.js) */
.ht-list { display: flex; flex-direction: column; gap: 8px; }
.ht-row { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); border-radius: var(--r); padding: 10px 12px; min-height: 56px; }
.ht-row.new { box-shadow: inset 4px 0 0 var(--badge); }
.ht-row-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ht-row-x { font-size: 13.5px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ht-dm { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ht-dm .dx-chip { justify-content: flex-start; padding: 0 10px; white-space: normal; text-align: left; line-height: 1.2; }
.ht-dm .dx-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ht-pv { display: flex; align-items: flex-start; gap: 8px; }
.ht-pv img, .ht-img { max-width: 100%; max-height: 240px; border-radius: 12px; border: 1px solid var(--line); display: block; margin-top: 6px; }
.ht-pv img { max-width: 70%; }
.ht-thread { display: flex; flex-direction: column; gap: 8px; }
.ht-m { max-width: 88%; padding: 8px 12px; border-radius: 16px; background: var(--bg2); }
.ht-m.me { align-self: flex-end; background: var(--pri-soft); }
.ht-m.staff { align-self: flex-start; background: var(--nrg-bg); border: 1.5px solid var(--nrg); }
.ht-m.auto { border-style: dashed; background: var(--card); }
.ht-m-h { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; font-size: 12.5px; }
.ht-m-t { font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.ht-ai { margin-top: 4px; font-style: italic; }
.ht-rate .row { gap: 8px; margin-top: 8px; }
.ht-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ht-kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; margin: 8px 0 0; }
.ht-kv dt { color: var(--muted); font-weight: 700; }
.ht-kv dd { margin: 0; overflow-wrap: anywhere; }
.ht-ai-box > * + * { margin-top: 8px; }
.ht-q .dx-chips + .dx-chips { margin-top: -2px; }
.dx-ht { margin-bottom: 8px; }
.ht-score { font-family: var(--font-d); font-size: 22px; font-weight: 800; }
.ht-ex { border-top: 1px solid var(--line); padding-top: 8px; }
.ht-ex.bad { background: var(--bad-bg); border-radius: 12px; padding: 8px; }
.card.het-tien { border-left: 3px solid var(--warn); }
.card.het-tien ul { margin: 6px 0 0; }
.card.het-tien .lnk { text-align: left; min-height: 40px; }

/* ---------- Tân thủ ngắn (docs/TAN-THU-NGAN.md, 2026-11-27): thẻ bước thay chỗ Mốc kế, ngón tay chỉ một phần tử ---------- */
.mile2.ttn { align-items: stretch; gap: 6px; padding: 6px 8px; border-color: var(--dream-line); }
.mile2.ttn.cuu { border-color: var(--t2); }
.mile2.ttn .tt-go { display: flex; align-items: flex-start; gap: 8px; flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mile2.ttn .m-t { white-space: normal; }
.mile2.ttn .tt-say { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.35; white-space: normal; }
.mile2.ttn .tt-btns { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; gap: 2px; flex: none; }
.mile2.ttn .tt-btns .lnk { min-height: 30px; padding: 0 4px; }
.mile2[data-ttm] { margin-top: 6px !important; }
.tt-chi { outline: 3px solid var(--t2); outline-offset: 2px; border-radius: 12px; animation: ttNhip 1.4s ease-in-out infinite; }
.tt-rel { position: relative; }
.tt-chi::after { content: '👉'; position: absolute; left: -10px; top: -12px; font-size: 18px; line-height: 1; pointer-events: none; z-index: 6; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
@keyframes ttNhip { 0%, 100% { outline-offset: 2px; } 50% { outline-offset: 5px; } }
@media (prefers-reduced-motion: reduce) { .tt-chi { animation: none; } }
/* B: bong bóng 💬 nổi ở góc phải dưới đè lên mép phải thẻ; chừa chỗ để Tiếp / Bỏ qua luôn bấm được. */
.bfoot .mile2.ttn { padding-right: 56px; }
