/* XOXO — Material 3 + kính mờ (liquid glass). Mobile-first. */
:root {
  --primary: #4355b9; --on-primary: #fff; --primary-container: #dfe0ff; --on-primary-container: #00105c;
  --secondary-container: #e2e1f6; --on-secondary-container: #191a2c;
  --surface: #f6f6fc; --on-surface: #1b1b21; --on-surface-variant: #50515c; --outline: #c5c5d3; --outline-soft: rgba(80, 85, 120, .12);
  --glass: rgba(255, 255, 255, .62); --glass-strong: rgba(255, 255, 255, .82); --glass-border: rgba(255, 255, 255, .75);
  --shadow: 0 1px 2px rgba(30, 35, 90, .06), 0 8px 24px rgba(30, 35, 90, .08);
  --win: #1d7a45; --lose: #c0392b; --hl: #ffe08a; --hl-ink: #1b1b21;
  --inverse: #2f3036; --on-inverse: #f2f0f7; --inverse-primary: #bac3ff;
  --blob1: #c9cfff; --blob2: #b6ece3; --blob3: #ffd9e6;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --r-lg: 24px; --r-md: 16px; --r-sm: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #bac3ff; --on-primary: #0d2178; --primary-container: #2a3c9f; --on-primary-container: #dfe0ff;
    --secondary-container: #3a3b4f; --on-secondary-container: #e2e1f6;
    --surface: #121318; --on-surface: #e4e1e9; --on-surface-variant: #b4b3c2; --outline: #474856; --outline-soft: rgba(255, 255, 255, .08);
    --glass: rgba(32, 33, 42, .58); --glass-strong: rgba(36, 37, 48, .86); --glass-border: rgba(255, 255, 255, .09);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
    --win: #6ad79a; --lose: #ff8a7a; --hl: #8a6d00; --hl-ink: #fff;
    --inverse: #e4e1e9; --on-inverse: #2f3036; --inverse-primary: #4355b9;
    --blob1: #27306e; --blob2: #0f4a44; --blob3: #4d2338;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; color: var(--on-surface); background: var(--surface);
  font: 15px/1.45 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); min-height: 100vh; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 8px; letter-spacing: .1px; }
code { background: var(--secondary-container); color: var(--on-secondary-container); padding: 0 5px; border-radius: 6px; font-size: 13px; }
.muted { color: var(--on-surface-variant); font-weight: normal; }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.full { width: 100%; margin-top: 8px; }

/* nền: các đốm màu mờ để kính có chiều sâu */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .75; }
.bg span:nth-child(1) { width: 60vmax; height: 60vmax; background: var(--blob1); top: -20vmax; left: -15vmax; }
.bg span:nth-child(2) { width: 50vmax; height: 50vmax; background: var(--blob2); bottom: -18vmax; right: -12vmax; }
.bg span:nth-child(3) { width: 34vmax; height: 34vmax; background: var(--blob3); top: 35%; left: 55%; opacity: .5; }

.card, .top, .tabs, .sheet, .lockbox {
  background: var(--glass); backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow);
}

/* ---------- thanh trên ---------- */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top)); border-width: 0 0 1px; border-radius: 0; }
.brand { font-weight: 800; letter-spacing: 2px; color: var(--primary); }
.datebar { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.datepick { position: relative; display: inline-flex; align-items: center; white-space: nowrap; cursor: pointer;
  background: var(--secondary-container); color: var(--on-secondary-container); border-radius: 999px; padding: 8px 16px; font-weight: 600; }
.datepick input { position: absolute; inset: 0; opacity: 0; width: 100%; min-height: 0; cursor: pointer; }
.icon { width: 40px; height: 40px; min-height: 0; border-radius: 50%; border: 0; background: none; color: var(--on-surface-variant); font-size: 24px; padding: 0; }
.icon:hover { background: var(--outline-soft); }
.badge { font-size: 12px; white-space: nowrap; color: var(--on-surface-variant); border: 1px solid var(--outline); border-radius: 8px; padding: 3px 8px; }
.syncdot { width: 12px; height: 12px; min-height: 0; padding: 0; border-radius: 50%; border: 0; flex: none; background: var(--outline); transition: background-color .3s; }
.syncdot[data-state="ok"], .syncdot[data-state="idle"] { background: var(--win); }
.syncdot[data-state="pending"], .syncdot[data-state="syncing"] { background: #e0a800; animation: pulse 1s infinite alternate; }
.syncdot[data-state="error"] { background: var(--lose); }

main { max-width: 1100px; margin: 0 auto; padding: 12px 16px; }
.card { border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; transition: background-color .3s, border-color .3s; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.row.between { justify-content: space-between; margin-top: 0; }
.lbl { display: block; font-size: 13px; color: var(--on-surface-variant); margin-bottom: 4px; }
.form { display: flex; flex-wrap: wrap; gap: 12px; }
.form label { display: flex; flex-direction: column; font-size: 13px; color: var(--on-surface-variant); gap: 4px; }

/* ---------- điều khiển ---------- */
input, select, textarea { font: inherit; color: var(--on-surface); background: var(--glass-strong);
  border: 1px solid var(--outline); border-radius: var(--r-sm); padding: 8px 12px; min-height: 44px; outline: none;
  transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--on-surface-variant) 70%, transparent); }
textarea { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; resize: vertical; }
button, .btn { font: inherit; font-weight: 600; color: var(--primary); background: transparent; cursor: pointer;
  border: 1px solid var(--outline); border-radius: 999px; padding: 8px 18px; min-height: 44px; -webkit-tap-highlight-color: transparent;
  transition: transform .15s var(--ease), background-color .2s, border-color .2s, color .2s, box-shadow .2s; }
.btn { display: inline-flex; align-items: center; }
button:hover, .btn:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
button:active { transform: scale(.96); }
button:disabled { opacity: .5; }
button.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 35%, transparent); }
button.primary:hover { background: color-mix(in srgb, var(--primary) 88%, #fff); }
button.big { padding: 10px 26px; font-size: 17px; min-height: 52px; }
button.danger { color: var(--lose); border-color: color-mix(in srgb, var(--lose) 50%, transparent); }
button.mini { padding: 2px 10px; font-size: 13px; min-height: 0; }

.msg { font-size: 13px; margin-top: 6px; white-space: pre-line; transition: color .2s; }
.msg.err, .err { color: var(--lose); }
.msg.ok { color: var(--win); }
.win { color: var(--win); font-weight: 600; }
.lose { color: var(--lose); }

/* ---------- bộ chọn loại ---------- */
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kinds button { min-height: 52px; font-size: 17px; border-radius: var(--r-md); color: var(--on-surface); background: var(--glass-strong); }
.kinds button::before { content: "✓"; display: inline-block; width: 0; opacity: 0; overflow: hidden; vertical-align: bottom; transition: width .2s var(--ease), opacity .2s; }
.kinds button.on { background: var(--primary-container); color: var(--on-primary-container); border-color: transparent; }
.kinds button.on::before { width: 1.1em; opacity: 1; }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin-top: 8px; padding: 3px;
  background: var(--outline-soft); border-radius: 999px; }
.seg button { position: relative; z-index: 1; border: 0; background: none; min-height: 38px; color: var(--on-surface-variant); }
.seg button:hover { background: none; }
.seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px;
  background: var(--glass-strong); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); transition: transform .3s var(--ease); }
.seg[data-sel="1"] .seg-thumb { transform: translateX(100%); }
.seg[data-sel="0"] [data-m="0"], .seg[data-sel="1"] [data-m="1"] { color: var(--primary); }
.tdesc { font-size: 13px; color: var(--on-surface-variant); margin-top: 8px; min-height: 1.3em; }
.tdesc.pop { animation: appear .25s var(--ease); }
.others { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.others:empty { display: none; }
.ochip { min-height: 32px; padding: 2px 12px; font-size: 13px; border-radius: 8px; color: var(--on-surface); }
.ochip.on { background: var(--secondary-container); color: var(--on-secondary-container); border-color: transparent; }

/* ---------- ô nhập ---------- */
.entrygrid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; margin-top: 12px; align-items: end; }
.entrygrid:has(.amounts[style*="--n: 2"]) { grid-template-columns: 1fr 1.6fr; }
.amounts { display: grid; grid-template-columns: repeat(var(--n, 1), 1fr); gap: 8px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--on-surface-variant); min-width: 0; }
.fld span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fld input { font-size: 24px; font-weight: 700; padding: 8px 12px; letter-spacing: .5px; width: 100%; min-height: 54px; border-radius: var(--r-md); }
.fld input::placeholder { font-size: 16px; font-weight: 400; letter-spacing: 0; }
.amt { animation: appear .25s var(--ease); }
.preview { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; font-size: 13px; }
.preview:empty { margin: 0; }
.preview span { background: var(--secondary-container); color: var(--on-secondary-container); border-radius: 8px; padding: 1px 9px; font-weight: 700; animation: pop .2s var(--ease); }
.preview em { color: var(--on-surface-variant); font-style: normal; align-self: center; margin-left: 4px; }
.preview.err { color: var(--lose); }
details { margin-top: 12px; border-top: 1px solid var(--outline-soft); padding-top: 6px; }
summary { cursor: pointer; color: var(--on-surface-variant); font-size: 14px; padding: 8px 0; }
details[open] > :not(summary) { animation: appear .25s var(--ease); }

/* ---------- tổng nhanh ---------- */
.minitotals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.minitotals div, .kpi { background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--r-md); padding: 8px 12px; }
.minitotals span, .kpi span { display: block; font-size: 12px; color: var(--on-surface-variant); }
.minitotals b { font-size: 18px; font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi b { display: block; font-size: 21px; font-variant-numeric: tabular-nums; }

/* ---------- danh sách phiếu ---------- */
.betlist { list-style: none; margin: 0; padding: 0; }
.bet { display: grid; grid-template-columns: 54px 1fr auto 36px; align-items: center; gap: 8px; padding: 10px 6px; margin: 0 -6px;
  border-radius: var(--r-sm); cursor: pointer; overflow: hidden; border-bottom: 1px solid var(--outline-soft);
  transition: background-color .3s, opacity .3s var(--ease), transform .3s var(--ease), height .3s var(--ease), padding .3s var(--ease); }
.bet:hover { background: var(--outline-soft); }
.bet.hit { background: color-mix(in srgb, var(--win) 10%, transparent); }
.bn { font-size: 24px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; color: var(--primary); }
.bm { min-width: 0; display: flex; flex-direction: column; }
.bm b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm small { color: var(--on-surface-variant); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br { text-align: right; display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.hits { font-size: 11px; background: var(--win); color: var(--surface); border-radius: 999px; padding: 0 8px; font-weight: 700; }
.del { width: 36px; height: 36px; min-height: 0; border-radius: 50%; padding: 0; border: 0; color: var(--on-surface-variant); font-size: 15px; }
.del:hover { background: color-mix(in srgb, var(--lose) 12%, transparent); color: var(--lose); }
.bet.entering { animation: slideIn .4s var(--ease); }
.bet.leaving { opacity: 0; transform: translateX(40px); padding-top: 0; padding-bottom: 0; border-bottom-width: 0; pointer-events: none; }
.bet.flash { animation: flash 1.1s ease-out; }
.empty { color: var(--on-surface-variant); padding: 20px 4px; text-align: center; animation: appear .3s var(--ease); }

/* ---------- bảng ---------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { border-collapse: collapse; width: 100%; font-size: 14px; }
.grid th, .grid td { border-bottom: 1px solid var(--outline-soft); padding: 8px; text-align: left; white-space: nowrap; }
.grid th { font-size: 12px; color: var(--on-surface-variant); font-weight: 600; }
.grid.num td:not(:first-child), .grid.num th:not(:first-child), .grid td.n { text-align: right; font-variant-numeric: tabular-nums; }
.grid tr.total td { font-weight: 700; border-top: 2px solid var(--outline); }
.grid td.muted:only-child { white-space: normal; }
.grid a { color: var(--primary); }
table.result td { text-align: center; font-variant-numeric: tabular-nums; }
table.result td:first-child { text-align: left; color: var(--on-surface-variant); }
table.result .db, table.result .g8 { color: var(--primary); font-weight: 800; font-size: 17px; }
table.result td.off { opacity: .35; }
mark { background: var(--hl); color: var(--hl-ink); border-radius: 4px; padding: 0 2px; animation: pop .3s var(--ease); }
.settings input { width: 72px; padding: 4px 8px; min-height: 36px; }
.settings input.w { width: 130px; }
.settings input[type="checkbox"] { width: 20px; min-height: 0; accent-color: var(--primary); }
.settings select { padding: 4px 8px; min-height: 36px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--outline); border-radius: 8px; padding: 4px 12px 4px 6px; background: var(--glass-strong); transition: background-color .2s; }
.chip.on { background: var(--secondary-container); border-color: transparent; }
.chip label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chip input { min-height: 0; accent-color: var(--primary); }
.chip .star { border: 0; background: none; padding: 0 4px; min-height: 0; color: var(--on-surface-variant); font-size: 16px; }
.chip.main .star { color: #e0a800; }

/* ---------- thanh điều hướng dưới (M3 navigation bar) ---------- */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; border-width: 1px 0 0; border-radius: 0;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; border-radius: 0; padding: 0; min-height: 56px;
  background: none; color: var(--on-surface-variant); font-size: 12px; font-weight: 600; }
.tabs button:hover { background: none; }
.tabs i { display: grid; place-items: center; width: 56px; height: 32px; border-radius: 999px; transition: background-color .3s var(--ease), width .3s var(--ease); }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.on { color: var(--on-surface); }
.tabs button.on i { width: 64px; background: var(--secondary-container); color: var(--on-secondary-container); }

/* ---------- bảng sửa (bottom sheet) ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(10, 12, 30, .32); z-index: 20; opacity: 0; transition: opacity .25s; }
.sheet-bg.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; border-radius: 28px 28px 0 0; background: var(--glass-strong);
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto;
  transform: translateY(105%); transition: transform .32s var(--ease); }
.sheet.show { transform: none; }
.grab { width: 32px; height: 4px; border-radius: 2px; background: var(--outline); margin: 0 auto 12px; }

/* ---------- snackbar ---------- */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px);
  background: var(--inverse); color: var(--on-inverse); border-radius: 8px; padding: 6px 6px 6px 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  transform: translate(-50%, 20px); opacity: 0; transition: transform .25s var(--ease), opacity .25s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast span { font-size: 14px; }
.toast button { border: 0; color: var(--inverse-primary); min-height: 36px; padding: 4px 12px; }

/* ---------- màn hình khoá ---------- */
.lock { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: var(--surface);
  opacity: 0; transition: opacity .3s var(--ease); }
.lock::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(40vmax 40vmax at 15% 20%, var(--blob1), transparent 70%),
  radial-gradient(40vmax 40vmax at 85% 85%, var(--blob2), transparent 70%),
  radial-gradient(25vmax 25vmax at 75% 25%, var(--blob3), transparent 70%); }
.lock.in { opacity: 1; }
.lock.out { opacity: 0; transform: scale(1.03); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.lockbox { position: relative; width: min(340px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px;
  border-radius: 28px; padding: 32px 24px; transform: translateY(16px); transition: transform .4s var(--ease); }
.lock.in .lockbox { transform: none; }
.lockbox img { border-radius: 20px; box-shadow: var(--shadow); }
.lockbox h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: 3px; color: var(--primary); }
.lockbox input { width: 100%; font-size: 20px; text-align: center; padding: 12px; border-radius: var(--r-md); }
.lockbox button { width: 100%; }
.lockbox .msg { min-height: 1.2em; text-align: center; }

/* ---------- chuyển cảnh ---------- */
.tab.appear { animation: appear .3s var(--ease); }
main.slide-l { animation: slideL .32s var(--ease); }
main.slide-r { animation: slideR .32s var(--ease); }
.shake { animation: shake .35s; border-color: var(--lose) !important; }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-14px) scale(.98); background: var(--primary-container); } }
@keyframes flash { from { background: var(--hl); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes slideL { from { opacity: .3; transform: translateX(24px); } }
@keyframes slideR { from { opacity: .3; transform: translateX(-24px); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes pulse { to { opacity: .45; } }

@media (max-width: 420px) {
  .brand, .badge { display: none; }
  .top { gap: 4px; }
  .datebar { margin-left: 0; flex: 1; justify-content: center; }
}
@media (max-width: 600px) { .grid .wide { display: none; } }
@media (min-width: 820px) {
  .tab.split:not([hidden]) { display: grid; grid-template-columns: 400px 1fr; gap: 12px; align-items: start; }
  .tab.split > .entry { position: sticky; top: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* thẻ loại cược trong Cài đặt */
.tcards { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.tcard { background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--r-md); padding: 0 14px; margin: 0; }
.tcard summary { display: flex; flex-direction: column; padding: 12px 0; color: var(--on-surface); list-style: none; }
.tcard summary::-webkit-details-marker { display: none; }
.tcard summary b::after { content: "›"; float: right; color: var(--on-surface-variant); transition: transform .25s var(--ease); }
.tcard[open] summary b::after { transform: rotate(90deg); }
.tform { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 4px; }
.tform label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--on-surface-variant); min-width: 0; }
.tform input, .tform select { width: 100%; }
.tform output { font-size: 17px; font-weight: 700; color: var(--on-surface); padding: 8px 0; }
.switch { grid-column: 1 / -1; flex-direction: row !important; align-items: center; gap: 12px !important; font-size: 14px !important; color: var(--on-surface) !important; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { flex: none; position: relative; width: 52px; height: 32px; border-radius: 999px; background: var(--outline-soft); border: 2px solid var(--outline); transition: background-color .25s, border-color .25s; }
.switch span::after { content: ""; position: absolute; top: 50%; left: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--on-surface-variant);
  transform: translateY(-50%); transition: left .25s var(--ease), width .25s var(--ease), height .25s var(--ease), background-color .25s; }
.switch input:checked + span { background: var(--primary); border-color: var(--primary); }
.switch input:checked + span::after { left: 24px; width: 22px; height: 22px; background: var(--on-primary); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
@media (min-width: 820px) { .tform { grid-template-columns: repeat(4, 1fr); } }

/* ---------- bảng giá nhiều kiểu ---------- */
.entry > .fld input { font-size: 26px; }
.pricehead { margin-top: 12px; align-items: center; }
.pricehead .lbl { margin: 0; }
.pricegrid { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px 8px; align-items: center; margin-top: 6px; }
.pricegrid .ph { font-size: 12px; color: var(--on-surface-variant); text-align: center; font-weight: 600; }
.pricegrid .pl { font-weight: 600; padding-right: 4px; white-space: nowrap; }
.pricegrid input { width: 100%; min-width: 0; min-height: 48px; font-size: 20px; font-weight: 700; text-align: center; border-radius: var(--r-sm);
  transition: background-color .2s, border-color .2s, box-shadow .2s; }
.pricegrid input.filled { background: var(--primary-container); color: var(--on-primary-container); border-color: transparent; }
.pricegrid .na { text-align: center; color: var(--outline); }
.pricegrid .pspan { grid-column: span 2; }
#orderSum { font-weight: 600; }

/* ---------- thẻ đơn (1 số, nhiều kiểu) ---------- */
.bet.order { grid-template-columns: 58px 1fr; align-items: start; cursor: default; }
.bet.order:hover { background: none; }
.bet.order.hit { background: color-mix(in srgb, var(--win) 7%, transparent); }
.bet.order .bn { display: flex; flex-direction: column; align-items: center; padding-top: 4px; line-height: 1.1; }
.bet.order .bn small { font-size: 11px; font-weight: 500; color: var(--on-surface-variant); max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.olines { display: flex; flex-direction: column; min-width: 0; }
.oline { display: grid; grid-template-columns: 1fr auto minmax(76px, auto) 32px; gap: 8px; align-items: center; padding: 3px 0 3px 8px;
  border-radius: 10px; cursor: pointer; transition: background-color .2s; }
.oline:hover { background: var(--outline-soft); }
.oline + .oline { border-top: 1px dashed var(--outline-soft); }
.oline .ot { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oline .oa { font-variant-numeric: tabular-nums; }
.oline .or { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oline .del { width: 32px; height: 32px; font-size: 13px; }
.oline.hit .ot { color: var(--win); font-weight: 600; }
.pricehead { flex-wrap: nowrap; margin-top: 14px; }

/* bảng giá theo đài */
.pricegrid { grid-template-columns: auto repeat(var(--cols, 3), minmax(0, 1fr)) minmax(0, .9fr); gap: 6px; }
.pricegrid .ph { display: flex; flex-direction: column; align-items: center; line-height: 1.15; font-size: 12px; color: var(--on-surface); min-width: 0; }
.pricegrid .ph small { font-size: 10px; color: var(--on-surface-variant); font-weight: 500; }
.pricegrid .ph.all { color: var(--primary); justify-content: flex-end; }
.pricegrid .pl { font-size: 14px; }
.pricegrid input { font-size: 18px; min-height: 46px; padding: 4px; }
.pricegrid input.rowall { border-style: dashed; background: transparent; }
.pricegrid input.rowall.filled { background: transparent; color: var(--primary); border-color: var(--primary); }
.pricegrid input.pulse { animation: pop .25s var(--ease); }
#stationHint:not(:empty) { margin-top: 6px; }
/* sửa phiếu: kiểu + đài */
.kinds.four { grid-template-columns: repeat(4, 1fr); }
.kinds.four button { font-size: 15px; padding: 6px 4px; }
.stchips { display: flex; flex-wrap: wrap; gap: 8px; }
.stchips button { min-height: 40px; border-radius: 10px; color: var(--on-surface); background: var(--glass-strong); }
.stchips button.on { background: var(--primary-container); color: var(--on-primary-container); border-color: transparent; }
button.badge { min-height: 30px; padding: 3px 10px; font-weight: 600; font-size: 12px; color: var(--on-surface-variant); }
button.badge.own { background: var(--primary-container); color: var(--on-primary-container); border-color: transparent; }
@media (max-width: 420px) { .badge { display: inline-flex !important; } .brand { display: none; } }
