:root {
  color-scheme: dark;
  --bg: #09090d;
  --surface: #15151b;
  --surface-2: #1d1d25;
  --surface-3: #272730;
  --text: #ffffff;
  --muted: #aaaab7;
  --line: rgba(255, 255, 255, .11);
  --accent: #58f28f;
  --accent-strong: #1ed760;
  --danger: #ff7f8d;
  --info: #73a7ff;
  --shadow: 0 28px 80px rgba(0, 0, 0, .48);
  font-family: "IBM Plex Sans Thai", "Noto Sans Thai", "Leelawadee UI", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background:
  radial-gradient(circle at 50% -10%, rgba(89, 242, 143, .12), transparent 29rem),
  linear-gradient(180deg, #101016 0%, var(--bg) 35%, #07070a 100%); overflow-x: hidden; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.stage-light { position: fixed; z-index: -1; width: 26rem; height: 26rem; border-radius: 50%; filter: blur(90px); opacity: .13; pointer-events: none; }
.stage-light-a { top: 10rem; left: -19rem; background: #7b61ff; }
.stage-light-b { top: 38rem; right: -20rem; background: #1ed760; }

.topbar { width: min(1120px, calc(100% - 32px)); min-height: 76px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #09090d; background: var(--accent); box-shadow: 0 0 36px rgba(88, 242, 143, .34); font-size: 20px; }
.brand > span:last-child { display: grid; line-height: 1; }
.brand b { font-size: 18px; letter-spacing: -.02em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .23em; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: #d7d7df; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 13px var(--accent); }

.app-shell, .admin-shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 80px; }
.panel, .category-card, .submit-card, .result-panel { border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(32, 32, 41, .96), rgba(19, 19, 25, .96)); box-shadow: var(--shadow); }
.loading-card, .fatal-card { width: min(520px, 100%); margin: 12vh auto; padding: 48px; text-align: center; }
.loader { display: inline-block; width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-copy { max-width: 760px; padding: 10px 0 42px; }
.eyebrow, .step-label { margin: 0 0 13px; color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .18em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 19px; font-size: clamp(44px, 8vw, 84px); line-height: .98; letter-spacing: -.055em; }
h1 em { color: var(--accent); font-style: normal; }
.hero-copy > p:last-child, .results-hero > div > p:last-child { max-width: 630px; color: var(--muted); font-size: 17px; line-height: 1.75; }

.login-card { width: min(560px, 100%); padding: 30px; }
.panel-kicker { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.login-card h2, .category-head h2, .result-head h2 { margin-bottom: 8px; font-size: 27px; letter-spacing: -.03em; }
.muted, .category-head p, .result-head p { color: var(--muted); line-height: 1.65; }
.field { display: grid; gap: 8px; margin: 22px 0; }
.field > span { color: #d8d8e0; font-size: 13px; font-weight: 700; }
.field input, .field select { width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 13px; outline: none; color: var(--text); background: #111117; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,242,143,.13); }
.primary-btn { width: 100%; min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 25px; border: 0; border-radius: 999px; color: #07100a; background: var(--accent); box-shadow: 0 12px 30px rgba(30,215,96,.18); cursor: pointer; font-weight: 850; letter-spacing: .03em; transition: transform .18s ease, filter .18s ease; }
.primary-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); }
.primary-btn:disabled { cursor: not-allowed; opacity: .38; box-shadow: none; }
.text-btn { min-height: 44px; padding: 7px 16px; border: 0; color: var(--muted); background: transparent; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.demo-note, .privacy-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 17px 0 0; color: #81818c; font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.privacy-note svg { width: 15px; }
.alert { padding: 13px 15px; border-radius: 12px; line-height: 1.55; }
.error-alert { margin: 16px 0; border: 1px solid rgba(255,127,141,.25); color: #ffbec5; background: rgba(255,127,141,.09); }

.ballot-intro, .results-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 38px; margin-bottom: 32px; }
.ballot-intro h1, .results-hero h1 { font-size: clamp(42px, 7vw, 72px); }
.identity-card { min-width: 225px; display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: rgba(24,24,31,.85); }
.avatar { width: 47px; height: 47px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #0b0b0f; background: var(--accent); font-size: 19px; font-weight: 900; }
.identity-card div { display: grid; gap: 2px; }
.identity-card small { color: var(--muted); }
.identity-card b { font-size: 17px; }
.identity-card div span { color: var(--accent); font-size: 12px; font-weight: 750; }
.rule-banner { display: flex; align-items: center; gap: 13px; margin: 0 0 20px; padding: 15px 18px; border: 1px solid rgba(115,167,255,.22); border-radius: 15px; color: #dbe8ff; background: rgba(115,167,255,.08); }
.rule-banner svg { flex: 0 0 auto; color: var(--info); }
.rule-banner span { color: #bfc5d1; }
.rule-banner b { color: #fff; }

.category-card { margin: 18px 0; padding: 25px; }
.category-head { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; margin-bottom: 22px; }
.category-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: var(--accent); background: rgba(88,242,143,.1); }
.category-icon svg { width: 25px; height: 25px; }
.category-head p { margin-bottom: 0; }
.group-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.group-choice { position: relative; min-width: 0; min-height: 108px; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto; gap: 5px 10px; align-items: center; padding: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; text-align: left; background: var(--surface-2); cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.group-choice::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--group, var(--accent)); opacity: .9; }
.group-choice:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(255,255,255,.3); background: var(--surface-3); }
.group-choice.is-selected { border-color: var(--accent); background: rgba(88,242,143,.095); box-shadow: inset 0 0 0 1px rgba(88,242,143,.23); }
.group-choice.is-own { cursor: not-allowed; opacity: .46; background: #111116; }
.group-choice.is-own::after { content: "LOCKED"; position: absolute; top: 10px; right: -23px; width: 88px; padding: 3px 0; color: #111; background: #b5b5bd; transform: rotate(39deg); text-align: center; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.group-number { align-self: start; color: var(--group, var(--muted)); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 800; }
.group-name { align-self: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 800; }
.choice-state { grid-column: 2; color: var(--muted); font-size: 11px; }
.choice-check { width: 25px; height: 25px; display: grid; place-items: center; grid-column: 3; grid-row: 1 / 3; border: 1px solid var(--line); border-radius: 50%; color: transparent; }
.is-selected .choice-check { border-color: var(--accent); color: #07100a; background: var(--accent); }
.group-1 { --group: #ff7b86; } .group-2 { --group: #ffa95e; } .group-3 { --group: #f2db57; }
.group-4 { --group: #58f28f; } .group-5 { --group: #73a7ff; } .group-6 { --group: #bd8cff; }

.submit-card { display: grid; gap: 18px; margin-top: 18px; padding: 25px; }
.confirm-row { display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: start; color: #bebec8; line-height: 1.6; cursor: pointer; }
.confirm-row input { width: 25px; height: 25px; margin: 1px 0 0; border: 1px solid #656571; border-radius: 7px; appearance: none; cursor: pointer; background: #111117; }
.confirm-row input:checked { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 5px #111117; }
.confirm-row input:focus-visible { outline: 3px solid rgba(88,242,143,.25); outline-offset: 2px; }
.submit-btn { max-width: 420px; justify-self: center; }
.submit-card .text-btn { justify-self: center; }

.done-card { width: min(620px, 100%); margin: 7vh auto; padding: 48px 36px; text-align: center; }
.done-card h1 { font-size: clamp(38px, 7vw, 58px); }
.done-card > p:not(.eyebrow) { max-width: 490px; margin: 0 auto 25px; color: var(--muted); line-height: 1.75; }
.success-orbit { width: 98px; height: 98px; display: grid; place-items: center; margin: 0 auto 27px; border: 1px solid rgba(88,242,143,.22); border-radius: 50%; box-shadow: 0 0 55px rgba(88,242,143,.15); }
.success-orbit span { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; color: #07100a; background: var(--accent); }
.success-orbit svg { width: 30px; height: 30px; stroke-width: 2.5; }
.done-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-bottom: 20px; }
.done-meta span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: #bdbdc6; font-size: 11px; }

.footer-rule { width: min(1040px, calc(100% - 32px)); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 0 auto; padding: 22px 0 30px; border-top: 1px solid var(--line); color: #777782; font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.footer-rule i { width: 3px; height: 3px; border-radius: 50%; background: #55555e; }

.admin-shell { width: min(1180px, calc(100% - 32px)); }
.admin-login { width: min(520px, 100%); margin: 6vh auto; padding: 32px; }
.admin-login h1 { font-size: 48px; }
.results-hero { align-items: center; }
.turnout-card { min-width: 205px; padding: 25px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(88,242,143,.15), rgba(29,29,37,.95)); box-shadow: var(--shadow); }
.turnout-card small { display: block; color: var(--muted); font-weight: 700; }
.turnout-card strong { display: inline-block; margin: 9px 6px 0 0; font-size: 56px; line-height: 1; letter-spacing: -.05em; }
.turnout-card span { color: var(--accent); font-weight: 800; }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.result-panel { padding: 25px; }
.result-head { display: flex; justify-content: space-between; gap: 18px; }
.result-head p { margin-bottom: 0; }
.trophy { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #0a0a0e; background: var(--accent); font-size: 20px; }
.score-list { display: grid; gap: 9px; margin: 23px 0 0; padding: 0; list-style: none; }
.score-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 3px 10px; align-items: center; padding: 12px; border-radius: 13px; background: rgba(255,255,255,.035); }
.rank { grid-row: 1 / 3; color: #73737d; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.score-main { display: grid; gap: 7px; min-width: 0; }
.score-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-list strong { grid-row: 1; grid-column: 3; color: var(--accent); font-size: 22px; }
.score-list small { grid-row: 2; grid-column: 3; color: var(--muted); font-size: 9px; }
.score-track { width: 100%; height: 5px; overflow: hidden; border: 0; border-radius: 99px; background: #303039; }
.score-track::-webkit-progress-bar { background: #303039; border-radius: 99px; }
.score-track::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.score-track::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.admin-privacy { margin: 20px 0 0; color: #777782; text-align: center; font-size: 11px; }

@media (max-width: 760px) {
  .topbar { min-height: 68px; }
  .app-shell, .admin-shell { padding: 38px 0 58px; }
  .hero-copy { padding-top: 0; }
  .ballot-intro, .results-hero { grid-template-columns: 1fr; align-items: start; gap: 18px; }
  .identity-card { width: 100%; min-width: 0; }
  .group-grid, .results-grid { grid-template-columns: 1fr; }
  .group-choice { min-height: 88px; }
  .category-card, .submit-card, .result-panel { padding: 19px; border-radius: 18px; }
  .category-head { grid-template-columns: 1fr; }
  .category-icon { width: 42px; height: 42px; }
  .turnout-card { width: 100%; min-width: 0; }
}

@media (max-width: 430px) {
  .topbar, .app-shell, .admin-shell, .footer-rule { width: min(100% - 24px, 1040px); }
  .live-pill { padding: 7px 9px; font-size: 8px; }
  .login-card, .done-card, .admin-login { padding: 23px 19px; border-radius: 18px; }
  h1 { font-size: 44px; }
  .ballot-intro h1, .results-hero h1 { font-size: 43px; }
  .category-head h2 { font-size: 24px; }
  .group-choice { grid-template-columns: 26px minmax(0, 1fr) 25px; padding: 14px 13px; }
  .group-name { font-size: 16px; }
  .rule-banner { align-items: flex-start; font-size: 13px; }
  .footer-rule { gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Secret Buddy shared visual identity */
@font-face { font-family: 'Bai Jamjuree'; font-style: normal; font-display: swap; font-weight: 600; src: url('/fonts/bai-jamjuree-thai-600-normal.woff2') format('woff2'); unicode-range: U+02D7,U+0303,U+0331,U+0E01-0E5B,U+200C-200D,U+25CC; }
@font-face { font-family: 'Bai Jamjuree'; font-style: normal; font-display: swap; font-weight: 600; src: url('/fonts/bai-jamjuree-latin-600-normal.woff2') 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: 'Bai Jamjuree'; font-style: normal; font-display: swap; font-weight: 700; src: url('/fonts/bai-jamjuree-thai-700-normal.woff2') format('woff2'); unicode-range: U+02D7,U+0303,U+0331,U+0E01-0E5B,U+200C-200D,U+25CC; }
@font-face { font-family: 'Bai Jamjuree'; font-style: normal; font-display: swap; font-weight: 700; src: url('/fonts/bai-jamjuree-latin-700-normal.woff2') 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: 'IBM Plex Sans Thai'; font-style: normal; font-display: swap; font-weight: 400; src: url('/fonts/ibm-plex-sans-thai-thai-400-normal.woff2') format('woff2'); unicode-range: U+02D7,U+0303,U+0331,U+0E01-0E5B,U+200C-200D,U+25CC; }
@font-face { font-family: 'IBM Plex Sans Thai'; font-style: normal; font-display: swap; font-weight: 400; src: url('/fonts/ibm-plex-sans-thai-latin-400-normal.woff2') 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: 'IBM Plex Sans Thai'; font-style: normal; font-display: swap; font-weight: 500; src: url('/fonts/ibm-plex-sans-thai-thai-500-normal.woff2') format('woff2'); unicode-range: U+02D7,U+0303,U+0331,U+0E01-0E5B,U+200C-200D,U+25CC; }
@font-face { font-family: 'IBM Plex Sans Thai'; font-style: normal; font-display: swap; font-weight: 500; src: url('/fonts/ibm-plex-sans-thai-latin-500-normal.woff2') 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: 'IBM Plex Sans Thai'; font-style: normal; font-display: swap; font-weight: 600; src: url('/fonts/ibm-plex-sans-thai-thai-600-normal.woff2') format('woff2'); unicode-range: U+02D7,U+0303,U+0331,U+0E01-0E5B,U+200C-200D,U+25CC; }
@font-face { font-family: 'IBM Plex Sans Thai'; font-style: normal; font-display: swap; font-weight: 600; src: url('/fonts/ibm-plex-sans-thai-latin-600-normal.woff2') 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: 'IBM Plex Sans Thai'; font-style: normal; font-display: swap; font-weight: 700; src: url('/fonts/ibm-plex-sans-thai-thai-700-normal.woff2') format('woff2'); unicode-range: U+02D7,U+0303,U+0331,U+0E01-0E5B,U+200C-200D,U+25CC; }
@font-face { font-family: 'IBM Plex Sans Thai'; font-style: normal; font-display: swap; font-weight: 700; src: url('/fonts/ibm-plex-sans-thai-latin-700-normal.woff2') 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; }

:root {
  color-scheme: light dark;
  --paper: #F2F4F8; --card: #FFFFFF; --card-2: #E9EDF5; --ink: #131A2C; --ink-2: #34415D; --muted: #68758F;
  --line: #DCE2EC; --line-2: #C8D0DE; --blue: #2340B0; --blue-2: #18318F; --blue-soft: #E7ECFF; --on-blue: #FFFFFF;
  --red: #CC382C; --red-soft: #FDEBE8; --ok: #137A4A; --ok-soft: #E2F4EA; --warn: #9A6400; --warn-soft: #FFF3D6;
  --focus: #2340B0; --shadow: 0 1px 2px rgba(19,26,44,.05), 0 12px 28px -20px rgba(19,26,44,.28);
  --bg: var(--paper); --surface: var(--card); --surface-2: var(--card-2); --surface-3: #E1E6F0; --text: var(--ink); --accent: var(--blue); --accent-strong: var(--blue-2); --danger: var(--red); --info: var(--blue);
  font-family: 'IBM Plex Sans Thai', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #0B101C; --card: #131A29; --card-2: #0F1524; --ink: #E6EBF5; --ink-2: #BCC5D8; --muted: #8A95AD; --line: #212A3E; --line-2: #2D3852; --blue: #8CA5FF; --blue-2: #B4C4FF; --blue-soft: #1A2547; --on-blue: #0B101C; --red: #FF7B6C; --red-soft: #3A1C1A; --ok: #4EC28B; --ok-soft: #102E1F; --warn: #F0B45C; --warn-soft: #33260F; --focus: #8CA5FF; --shadow: 0 1px 2px rgba(0,0,0,.45), 0 14px 32px -20px rgba(0,0,0,.8); --surface-3: #192134; }
}
html { background: var(--paper); }
body { color: var(--ink); background: var(--paper); }
.stage-light { display: none; }
.airline { height: 5px; background: repeating-linear-gradient(-45deg, var(--red) 0 8px, var(--paper) 8px 12px, var(--blue) 12px 20px, var(--paper) 20px 24px); }
.topbar { position: sticky; top: 0; z-index: 30; width: 100%; min-height: 58px; padding: 10px 16px; margin: 0; background: var(--paper); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(8px)) { .topbar { background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); } }
.brand { color: var(--ink); gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--red); box-shadow: inset 0 0 0 3px rgba(0,0,0,.14); transform: rotate(-8deg); font: 700 11px/1 'Bai Jamjuree', sans-serif; }
.brand b { font: 700 1.02rem/1.1 'Bai Jamjuree', sans-serif; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .78rem; font-weight: 400; letter-spacing: 0; }
.live-pill { border: 0; border-radius: 999px; padding: 5px 10px; color: var(--blue); background: var(--blue-soft); font-size: .76rem; letter-spacing: .03em; }
.live-pill i { background: var(--blue); box-shadow: none; }
.app-shell { width: min(560px, calc(100% - 32px)); padding: 22px 0 64px; }
.admin-shell { width: min(1120px, calc(100% - 32px)); padding: 22px 0 64px; }
.panel, .category-card, .submit-card, .result-panel { border-color: var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.loading-card, .fatal-card { padding: 30px 24px; }
.hero-copy { max-width: 560px; padding: 4px 0 20px; }
.eyebrow, .step-label { margin-bottom: 8px; color: var(--blue); font-size: .78rem; font-weight: 600; letter-spacing: .05em; }
h1, h2, .group-name, .turnout-card strong { font-family: 'Bai Jamjuree', 'IBM Plex Sans Thai', sans-serif; }
h1 { margin-bottom: 12px; font-size: clamp(2rem, 7vw, 2.75rem); line-height: 1.08; letter-spacing: -.025em; }
h1 em { color: var(--red); }
.hero-copy > p:last-child, .results-hero > div > p:last-child, .muted, .category-head p, .result-head p { color: var(--muted); }
.login-card, .access-card { width: min(520px, 100%); margin: 3vh auto; padding: 24px; }
.access-card { text-align: left; }
.access-seal { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 50%; color: var(--red); background: var(--red-soft); }
.panel-kicker { color: var(--blue); }
.field > span { color: var(--ink-2); }
.field input, .field select { min-height: 46px; border-color: var(--line-2); border-radius: 11px; color: var(--ink); background: var(--card); box-shadow: none; }
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent); }
.primary-btn { min-height: 46px; border-radius: 11px; color: var(--on-blue); background: var(--blue); box-shadow: none; font-weight: 600; letter-spacing: 0; text-decoration: none; }
.primary-btn:hover:not(:disabled) { transform: none; background: var(--blue-2); filter: none; }
.text-btn { color: var(--blue); }
.demo-note, .privacy-note { color: var(--muted); font-size: .78rem; font-weight: 500; letter-spacing: 0; }
.error-alert { border-color: color-mix(in srgb, var(--red) 28%, var(--line)); color: var(--red); background: var(--red-soft); }
.ballot-intro, .results-hero { align-items: start; gap: 20px; margin-bottom: 18px; }
.ballot-intro h1, .results-hero h1 { font-size: clamp(2rem, 7vw, 2.75rem); }
.identity-card { border-color: var(--line); border-radius: 14px; background: var(--card); }
.avatar { color: #fff; background: var(--red); }
.identity-card div span { color: var(--blue); }
.rule-banner { border-color: color-mix(in srgb, var(--blue) 22%, var(--line)); border-radius: 12px; color: var(--ink-2); background: var(--blue-soft); }
.rule-banner svg, .rule-banner b { color: var(--blue); }
.rule-banner span { color: var(--ink-2); }
.category-card, .submit-card, .result-panel { padding: 20px; }
.category-icon { color: var(--blue); background: var(--blue-soft); }
.group-choice { border-color: var(--line); border-radius: 12px; color: var(--ink); background: var(--card-2); }
.group-choice::before { display: none; }
.group-choice:hover:not(:disabled) { transform: none; border-color: var(--blue); background: var(--blue-soft); }
.group-choice.is-selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 18%, transparent); }
.group-choice.is-own { opacity: .58; background: var(--red-soft); }
.group-choice.is-own::after { color: #fff; background: var(--red); }
.is-selected .choice-check { border-color: var(--blue); color: var(--on-blue); background: var(--blue); }
.confirm-row { color: var(--ink-2); }
.confirm-row input { border-color: var(--line-2); background: var(--card); }
.confirm-row input:checked { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 5px var(--card); }
.done-card { padding: 36px 28px; }
.success-orbit { border-color: color-mix(in srgb, var(--ok) 25%, var(--line)); box-shadow: none; }
.success-orbit span { color: #fff; background: var(--ok); }
.done-meta span { color: var(--ink-2); border-color: var(--line); }
.footer-rule, .admin-privacy { color: var(--muted); }
.turnout-card { border-color: var(--line); border-radius: 14px; background: var(--blue-soft); box-shadow: var(--shadow); }
.turnout-card span, .score-list strong { color: var(--blue); }
.trophy { color: var(--on-blue); background: var(--blue); }
.score-list li { background: var(--card-2); }
.rank { color: var(--muted); }
.score-track, .score-track::-webkit-progress-bar { background: var(--line); }
.score-track::-webkit-progress-value, .score-track::-moz-progress-bar { background: var(--blue); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); outline-offset: 2px; }
@media (max-width: 430px) { .topbar { width: 100%; } .app-shell, .admin-shell, .footer-rule { width: min(100% - 24px, 1120px); } .login-card, .access-card, .done-card, .admin-login { padding: 21px 18px; } h1, .ballot-intro h1, .results-hero h1 { font-size: 2rem; } }
