@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro/be-vietnam-pro-400-latin-ext.woff2?v=20260922") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro/be-vietnam-pro-400-latin.woff2?v=20260922") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro/be-vietnam-pro-400-vietnamese.woff2?v=20260922") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro/be-vietnam-pro-500-latin-ext.woff2?v=20260922") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro/be-vietnam-pro-500-latin.woff2?v=20260922") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro/be-vietnam-pro-500-vietnamese.woff2?v=20260922") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro/be-vietnam-pro-600-latin-ext.woff2?v=20260922") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro/be-vietnam-pro-600-latin.woff2?v=20260922") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro/be-vietnam-pro-600-vietnamese.woff2?v=20260922") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro/be-vietnam-pro-700-latin-ext.woff2?v=20260922") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro/be-vietnam-pro-700-latin.woff2?v=20260922") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro/be-vietnam-pro-700-vietnamese.woff2?v=20260922") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  --red: #d7263d;
  --red-dark: #b01d30;
  --ink: #1a1a1a;
  --muted: #5b6169;
  --gold: #f2a900;
  --bg: #ffffff;
  --bg-soft: #f5f6f7;
  --border: #e3e6e9;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 1rem;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 14px; }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; }
.logo:hover { text-decoration: none; }
.logo img { display: block; height: 32px; width: auto; }
@media (max-width: 480px) { .logo img { height: 28px; } }
.main-nav { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 500; font-size: 0.875rem; }
.main-nav a { color: var(--ink); }
.main-nav a:hover { color: var(--red); text-decoration: none; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--red); color: var(--red); }
.nav-toggle-icon { position: relative; display: inline-block; width: 16px; height: 2px; background: currentColor; }
.nav-toggle-icon::before, .nav-toggle-icon::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: currentColor; }
.nav-toggle-icon::before { top: -5px; }
.nav-toggle-icon::after { top: 5px; }

@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
    padding-top: 2px;
    font-size: 0.9375rem;
    border-top: 1px solid var(--border);
  }
  .site-header.nav-open .main-nav { display: flex; }
  .main-nav a { display: flex; align-items: center; min-height: 44px; padding: 2px 4px; border-bottom: 1px solid var(--border); }
  .main-nav a:last-child { border-bottom: 0; }
}

/* Typography */
h1 { font-size: 1.375rem; line-height: 1.3; margin: 18px 0 8px; }
h2 { font-size: 1.125rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
h4 { font-size: 0.875rem; margin: 0 0 6px; }
.intro { color: var(--muted); font-size: 0.875rem; margin: 0 0 14px; }

/* Countdown */
.countdown-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 18px; }
.countdown {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.8125rem;
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
a.countdown:hover, a.countdown:focus-visible { border-color: var(--red-dark); text-decoration: none; }
.cd-label { color: var(--muted); }
.cd-state { font-weight: 600; color: var(--ink); }
.cd-value { font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.countdown.is-soon { border-color: var(--red); background: #fff4f5; }
.countdown.is-soon .cd-state { color: var(--red-dark); }
.countdown.is-live { border-color: var(--red); background: #fff0f1; }
.countdown.is-live .cd-state { color: var(--red-dark); }
.countdown.is-live .cd-value { animation: cd-pulse 1.2s ease-in-out infinite; }
.countdown.is-done { background: #f2faf5; border-color: #cde8d8; }
.countdown.is-done .cd-state { color: #1d7a44; }
.countdown.is-done .cd-value { color: var(--muted); }
@keyframes cd-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) {
  .countdown.is-live .cd-value { animation: none; }
}

/* Region blocks */
.region-block { margin: 26px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid var(--red); padding-bottom: 6px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.draw-meta { color: var(--muted); font-size: 0.8125rem; }
p.draw-meta { margin: 0 0 10px; }

.result-card { overflow-x: auto; margin-bottom: 12px; }

/* Fixed-advance number boxes. Be Vietnam Pro has no tabular figures (digit
   advances vary 0.43-0.72em and its GSUB lacks tnum), so standalone numbers
   get a box sized from their digit count: width = n * .75em (0.72em widest
   digit + slack). Templates and live.js only set --n; the formula lives here. */
.numw { display: inline-block; box-sizing: border-box; text-align: center; width: calc(var(--n, 1) * .75em); }

/* Prize tables */
.prize-table { width: 100%; border-collapse: collapse; background: #fff; }
.prize-table th, .prize-table td { border: 1px solid var(--border); padding: 7px 9px; vertical-align: top; text-align: left; }
.prize-table th[scope="row"] { white-space: nowrap; background: var(--bg-soft); font-weight: 600; font-size: 0.8125rem; width: 90px; }
.prize-table .num { display: inline-block; box-sizing: border-box; text-align: center; font-weight: 700; font-size: 1.125rem; color: var(--red-dark); margin-right: 14px; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.prize-table .num:last-child { margin-right: 0; }
.prize-table.multi th { font-size: 0.8125rem; background: var(--bg-soft); }
.prize-table.multi .num { font-size: 1rem; margin-right: 10px; }
.prize-table tr.prize-db th[scope="row"] { background: #fff4d6; color: var(--red-dark); }
.prize-table tr.prize-db td { background: #fffaf0; }

/* Loto */
.loto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.loto-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; background: #fff; }
.loto-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.loto-table th, .loto-table td { border-bottom: 1px solid var(--border); padding: 4px 6px; text-align: left; }
.loto-table th { font-size: 0.75rem; color: var(--muted); }
.loto-table .head { font-weight: 700; width: 40px; color: var(--red); }
.loto-table .empty { color: #b9bec4; }
.loto-table .loto-num { display: inline-block; width: 1.5em; text-align: center; }

/* Info blocks */
.info-block { margin: 26px 0; }
.quick-links, .province-list, .date-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.875rem; }
.region-links { font-size: 0.8125rem; color: var(--muted); margin-top: 8px; }

/* Date navigation */
.date-nav { display: flex; justify-content: space-between; gap: 10px; margin: 10px 0; font-size: 0.875rem; }

/* 30-day table */
.table-scroll { overflow-x: auto; }
.last30-table, .history-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.last30-table th, .last30-table td, .history-table th, .history-table td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.last30-table th, .history-table th { background: var(--bg-soft); font-size: 0.8125rem; }
.last30-table .db, .history-table .db { font-weight: 700; color: var(--red-dark); }

/* Footer */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); margin-top: 40px; padding: 20px 0; font-size: 0.8125rem; color: var(--muted); }
.disclaimer { margin: 0 0 10px; }
.footer-links { margin: 0 0 8px; }
.copyright { margin: 0; }
.ad-slot { margin: 14px 0; min-height: 100px; }
.ad-placeholder { border: 1px dashed var(--border); padding: 18px; text-align: center; color: #b9bec4; border-radius: var(--radius); }

.no-data { color: var(--muted); font-style: italic; }

.answer-line { background: var(--bg-soft); border-left: 3px solid var(--red); border-radius: 0 var(--radius) var(--radius) 0; padding: 8px 12px; margin: 0 0 12px; font-size: 0.875rem; }
.answer-line strong { color: var(--red-dark); }

.faq-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 8px; background: #fff; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-answer { margin: 8px 0 0; font-size: 0.875rem; color: var(--muted); }

.correction-notice { background: #fff8e1; border: 1px solid #f2d98c; border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; font-size: 0.875rem; }
.correction-notice h2 { font-size: 0.9375rem; margin: 0 0 6px; color: #8a6100; }
.correction-notice p { margin: 0 0 4px; }

.glossary-list { margin: 0; }
.glossary-list dt { font-weight: 700; color: var(--red-dark); margin-top: 10px; }
.glossary-list dt:first-child { margin-top: 0; }
.glossary-list dd { margin: 2px 0 0; font-size: 0.875rem; color: var(--muted); }

/* Accessibility */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--red); color: #fff; padding: 10px 16px; font-weight: 600; }
.skip-link:focus { left: 8px; }

/* Live number flash */
@keyframes num-flash { 0% { background: #ffe9a8; } 100% { background: transparent; } }
.prize-table .num.flash, .vl-ball.flash, .loto-table td.flash { animation: num-flash 1.2s ease-out; border-radius: 4px; }

/* Share-as-image button */
.share-btn { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--ink); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.share-btn:hover { border-color: var(--red); color: var(--red); }

/* Table sort/filter */
.table-filter { display: block; width: 100%; max-width: 240px; margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.js-sortable th { user-select: none; }

/* Vietlott jackpot ticker */
.jackpot-ticker { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; }
.jackpot-ticker .label { display: block; color: var(--muted); font-size: 0.8125rem; }
.jackpot-ticker .value { color: var(--red-dark); font-weight: 700; font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.jackpot-line { color: var(--muted); font-size: 0.8125rem; margin: 6px 0 0; }
.jackpot-line strong { color: var(--red-dark); }

/* Public feedback form: honeypot + spacing */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.admin-form textarea { resize: vertical; }

@media (max-width: 640px) {
  h1 { font-size: 1.1875rem; }
  .prize-table .num { font-size: 1rem; margin-right: 10px; }
}

/* Statistics */
.stats-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}
.stats-nav a {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8125rem;
  color: var(--ink);
}
.stats-nav a:hover { background: #fff; border-color: var(--red); color: var(--red); text-decoration: none; }

.stats-region-switch { font-size: 0.875rem; margin: 0 0 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.stats-region-switch .label { color: var(--muted); }
.stats-region-switch strong { color: var(--red); }

.stats-updated { color: var(--muted); font-size: 0.8125rem; margin: 0 0 16px; }

.stats-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.stats-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
}
.stats-card:hover { border-color: var(--red); text-decoration: none; }
.stats-card h3 { margin: 0 0 4px; color: var(--red); }
.stats-card p { margin: 0; font-size: 0.8125rem; color: var(--muted); }

.stats-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.stats-table th, .stats-table td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.stats-table th { background: var(--bg-soft); font-size: 0.8125rem; white-space: nowrap; }
.stats-table .num-cell { font-weight: 700; color: var(--red-dark); font-variant-numeric: tabular-nums; }
.stats-table.compact th, .stats-table.compact td { padding: 4px 6px; font-size: 0.8125rem; }
.db-list { font-variant-numeric: tabular-nums; word-spacing: 4px; }

.stats-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .stats-columns { grid-template-columns: 1fr; } }

.gan-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.gan-cell {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 2px;
  text-align: center;
  font-size: 0.75rem;
}
.gan-num { display: block; font-weight: 700; color: var(--red-dark); }
.gan-val { display: block; color: var(--muted); }
@media (max-width: 560px) { .gan-grid { grid-template-columns: repeat(5, 1fr); } }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: #fff;
}
.chip small { color: var(--muted); font-weight: 400; margin-left: 2px; }

.head-block { margin: 0 0 10px; }
.head-block h3 { margin: 8px 0 6px; font-size: 0.875rem; color: var(--muted); }

/* Live */
.live-status { display: flex; align-items: center; gap: 10px; margin: 8px 0 14px; flex-wrap: wrap; }
.live-badge { padding: 4px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; }
.live-live { background: #fff4e5; color: #b26a00; border: 1px solid #ffd8a8; }
.live-done { background: #e7f6ec; color: #1b7a3d; border: 1px solid #b7e4c7; }
.live-none { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--border); }
.live-warn { background: #fdecea; color: #b3261e; border: 1px solid #f5c6c0; }
.live-updated { color: var(--muted); font-size: 0.8125rem; }
.live-note { color: var(--muted); font-size: 0.8125rem; margin-top: 10px; }
.live-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 12px; }
.live-switch-item { display: block; min-height: 54px; padding: 7px 6px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; text-align: center; color: var(--ink); }
.live-switch-item strong { display: block; font-size: 0.9375rem; color: var(--red); }
.live-switch-item small { display: block; font-size: 0.75rem; color: var(--muted); line-height: 1.35; }
.live-switch-item.is-current { border-color: var(--red); background: var(--bg-soft); }
.live-switch-item.is-current small { color: var(--red-dark); font-weight: 600; }
a.live-switch-item:hover { text-decoration: none; border-color: var(--red); }

/* Admin */
.admin-body { background: #f0f2f4; }
.admin-header { background: #1a1a1a; color: #fff; padding: 10px 0; }
.admin-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.admin-logo { color: #fff; font-size: 1.0625rem; }
.admin-nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.875rem; }
.admin-nav a { color: #d7dbe0; }
.admin-nav a:hover { color: #fff; text-decoration: none; }
.admin-logout { display: inline; margin: 0; }
.admin-logout button {
  background: none; border: 0; color: #d7dbe0; cursor: pointer;
  font: inherit; padding: 0;
}
.admin-logout button:hover { color: #fff; text-decoration: underline; }
.admin-badge { background: var(--red); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 0.75rem; }
.admin-main { padding-top: 18px; padding-bottom: 40px; }
.admin-readonly {
  background: #fff4d6; border: 1px solid #e6c96b; color: #6b5416;
  border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; font-size: 0.875rem;
}
.admin-login { max-width: 360px; margin: 8vh auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.admin-login h1 { margin-top: 0; color: var(--red); }
.admin-form { display: flex; flex-direction: column; gap: 10px; }
.admin-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.875rem; font-weight: 500; }
.admin-form input, .admin-form select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.admin-form button, .btn-small {
  background: var(--red); color: #fff; border: 0; border-radius: 6px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn-small { padding: 4px 10px; font-size: 0.8125rem; font-weight: 500; }
.btn-danger { background: #6c757d; }
.admin-form textarea { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-family: ui-monospace, monospace; font-size: 0.8125rem; }
.admin-form-wide { max-width: 900px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.admin-form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.admin-prizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 720px) { .admin-form-row, .admin-prizes { grid-template-columns: 1fr; } }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 14px 0 22px; }
.admin-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.admin-card h3 { margin: 0 0 6px; }
.admin-section { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 18px 0; }
.admin-section h2 { margin-top: 0; }
.admin-muted { color: var(--muted); font-size: 0.8125rem; }
.admin-error { color: #b3261e; background: #fdecea; border: 1px solid #f5c6c0; border-radius: 6px; padding: 8px 10px; font-size: 0.875rem; }
.admin-success { color: #1b7a3d; background: #e7f6ec; border: 1px solid #b7e4c7; border-radius: 6px; padding: 8px 10px; font-size: 0.875rem; }
.admin-url { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; }
.alert-level { padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.alert-info { background: #e7f1ff; color: #0b4a8f; }
.alert-warning { background: #fff4e5; color: #b26a00; }
.alert-error { background: #fdecea; color: #b3261e; }
.alert-row-unacked { background: #fffdf5; }

/* Live arrival progress (Phase 7g M5) */
.live-progress { font-size: 0.8125rem; color: var(--muted); }
.province-progress { font-size: 0.8125rem; color: var(--muted); margin: 4px 0 0; }
.live-sound {
  margin-left: 8px; padding: 2px 10px; font-size: 0.75rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--muted); cursor: pointer;
}
/* Waiting placeholders (Phase 7g M6): clearly not final values.
   No italic — italic metrics differ from the final digits and would reflow
   the fixed-width boxes at lock-in (owner report 2026-09-18). */
.num.placeholder { color: #9aa4ad; opacity: 0.55; user-select: none; }

/* Source lab (Phase 7g M1) */
.admin-filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 0 0 10px; }
.admin-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8125rem; font-weight: 500; }
.admin-filters input, .admin-filters select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.admin-inline-form { display: inline-block; margin-right: 8px; }
.probe-state { padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.probe-none { background: #eceff1; color: #546e7a; }
.probe-waiting { background: #fff4e5; color: #b26a00; }
.probe-ok { background: #e7f6ec; color: #1b7a3d; }
.probe-mismatch { background: #fdecea; color: #b3261e; }
.probe-error, .probe-timeout { background: #f3e5f5; color: #6a1b9a; }
details.source-drawer { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin: 8px 0; background: #fff; }
details.source-drawer summary { cursor: pointer; font-weight: 600; }
.diff-bad td { background: #fdecea; }

/* Vietlott */
.vl-balls { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.vl-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
}
.vl-ball.vl-special { background: var(--gold); color: #1a1a1a; }
.vl-balls.small .vl-ball { width: 30px; height: 30px; font-size: 0.8125rem; }
.vl-num { display: inline-block; font-weight: 700; color: var(--red-dark); margin-right: 10px; }
.vl-special-text { color: #b26a00; font-weight: 700; margin-left: 6px; }

/* Checker */
.checker-form {
  display: grid;
  grid-template-columns: minmax(240px, auto) 220px 1fr auto;
  grid-template-areas:
    "date date date date"
    "province numbers numbers button"
    ". hint hint .";
  gap: 12px;
  align-items: end;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin: 14px 0;
}
.checker-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.875rem; font-weight: 500; }
.checker-form input, .checker-form select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.checker-form button {
  background: var(--red); color: #fff; border: 0; border-radius: 6px;
  padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer;
}
.checker-date {
  grid-area: date;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.checker-date .checker-date-caption { font-size: 0.875rem; font-weight: 500; }
.checker-date .checker-date-alt {
  display: block; white-space: nowrap;
  font-size: 0.8rem; font-weight: 500; color: var(--muted);
}
.checker-date input[name="date"] { width: 180px; }
.weekday-picker { display: flex; flex: 0 1 440px; max-width: 440px; }
.weekday-picker button {
  flex: 1 1 0; min-width: 0; height: 42px; padding: 0 2px;
  border: 1px solid var(--border); border-left-width: 0; background: #fff;
  color: var(--ink); font: inherit; font-size: 0.8rem; font-weight: 600;
  cursor: pointer;
}
.weekday-picker button:first-child { border-left-width: 1px; border-radius: 8px 0 0 8px; }
.weekday-picker button:last-child { border-radius: 0 8px 8px 0; }
.weekday-picker button.active { background: var(--red); border-color: var(--red); color: #fff; }
.checker-numbers { grid-area: numbers; }
.checker-form > button { grid-area: button; }
@media (max-width: 720px) {
  .checker-form {
    grid-template-columns: 1fr;
    grid-template-areas: "date" "province" "numbers" "hint" "button";
  }
  .checker-date { flex-direction: column; align-items: stretch; gap: 4px; }
  .checker-date .checker-date-alt { margin-top: 4px; }
  .checker-date input[name="date"] { width: 100%; }
  .weekday-picker { flex: 1 1 auto; max-width: none; }
}
.checker-province { grid-area: province; position: relative; }
.checker-province > label { display: block; margin-bottom: 4px; }
.province-listbox {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  margin: 4px 0 0; padding: 4px; list-style: none;
  max-height: 45vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 24px rgba(16, 35, 63, 0.14);
}
.province-listbox .pc-group { padding: 6px 10px 2px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.province-listbox .pc-option {
  display: flex; align-items: center; min-height: 44px; padding: 8px 10px;
  border-radius: 6px; cursor: pointer;
}
.province-listbox .pc-option:hover, .province-listbox .pc-option.pc-active { background: var(--bg-soft); }
.province-listbox .pc-option[aria-selected="true"] { font-weight: 700; }
.province-listbox mark { background: transparent; color: var(--red-dark); font-weight: 700; }
.checker-province .checker-status { margin: 4px 0 0; }
.checker-hint { grid-area: hint; font-size: 0.75rem; font-weight: 400; color: var(--muted); }
.checker-result {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.checker-result h3 { margin: 0 0 6px; }

/* Breadcrumbs */
.breadcrumbs { font-size: 0.8125rem; color: var(--muted); margin: 10px 0 4px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--red); }
.breadcrumbs .sep { margin: 0 5px; }
.breadcrumbs .current { color: var(--ink); }

/* Blog / articles */
.article-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 18px 0 24px; }
.article-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #fff;
  color: var(--ink);
}
.article-card:hover { border-color: var(--red); text-decoration: none; }
.article-card h3 { margin: 0 0 6px; color: var(--red); font-size: 1rem; }
.article-card p { margin: 0 0 8px; font-size: 0.8125rem; color: var(--muted); }
.article-meta { font-size: 0.75rem; color: var(--muted); }
.stats-nav a.active { background: var(--red); color: #fff; border-color: var(--red); }
.stats-nav a.active:hover { color: #fff; }

.blog-post { max-width: 820px; }
.article-body { line-height: 1.7; }
.article-body h2 { margin-top: 26px; }
.article-body h3 { margin-top: 18px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.875rem; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.article-body th { background: var(--bg-soft); }
.article-body ul { padding-left: 20px; }

.search-form { display: flex; gap: 8px; max-width: 520px; margin: 12px 0 20px; }
.search-form input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 6px; font: inherit;
}
.search-form button {
  background: var(--red); color: #fff; border: 0; border-radius: 6px;
  padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer;
}

/* Personalization (Phase 8, R1) — localStorage-only features */
.follow-btn { border: 0; background: none; color: var(--muted); font-size: 1rem; line-height: 1; cursor: pointer; padding: 0 4px; vertical-align: middle; }
.follow-btn[aria-pressed="true"] { color: var(--red); }
.follow-row { margin: 2px 0 10px; display: flex; align-items: center; gap: 6px; }
.loto-num.watch-hit { background: #ffe3e8; color: var(--red-dark); font-weight: 700; border-radius: 4px; padding: 0 2px; }
.my-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.my-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: 0.875rem; }
.my-chip a { color: var(--ink); }
.my-chip .st { color: var(--muted); font-size: 0.75rem; }
.chip-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 0.8rem; padding: 0; line-height: 1; }
.chip-x:hover { color: var(--red); }
.my-add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.my-add-row select, .my-add-row input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.my-add-row button, .save-tickets { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.muted-small { color: var(--muted); font-size: 0.8125rem; }
.ticket-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--border); }
.ticket-row .num { font-weight: 700; }

/* Trust surfaces (Phase 8, R3) */
.trust-row { margin: 8px 0 0; font-size: 0.875rem; }
.trust-badge { display: inline-block; padding: 2px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-soft); color: var(--ink); font-weight: 600; }
.trust-badge:hover { text-decoration: none; border-color: var(--red); }
.stat-cards { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 12px; }
.stat-card { flex: 1 1 180px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--red); }
.stat-label { font-size: 0.8125rem; color: var(--muted); }
