:root {
  --bg: #0E1116; --bg2: #0A0C10; --card: #171B22; --line: #1F242C; --track: #262C36;
  --fg: #F3F4F6; --mute: #9CA3AF; --dim: #D1D5DB;
  --accent: #FBBF24; --red: #EF4444; --red2: #DC2626; --green: #34D399; --blue: #60A5FA;
  --warnbg: #2A1F0A; --warn: #F59E0B;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font-family: 'Noto Sans TC', system-ui, -apple-system, sans-serif; font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex-shrink: 0; }
#app { min-height: 100%; max-width: 560px; margin: 0 auto; position: relative; }

.page { min-height: 100dvh; display: flex; flex-direction: column; padding: 20px 16px calc(92px + var(--safe-b)); gap: 14px; }
.top { display: flex; justify-content: space-between; align-items: center; min-height: 40px; gap: 8px; }
.title { font-size: 18px; font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: rgba(0,0,0,.6); font-size: 14px; white-space: nowrap; }
.pill.sm { height: 28px; font-size: 12px; padding: 0 10px; }
.round { width: 44px; height: 44px; border-radius: 999px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.round.lg { width: 56px; height: 56px; }
.card { background: var(--card); border-radius: 16px; padding: 14px; }
.mute { color: var(--mute); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }

/* 底部選單 */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(76px + var(--safe-b)); padding: 0 40px var(--safe-b);
  display: flex; align-items: center; justify-content: space-between; background: var(--bg2); border-top: 1px solid var(--line); max-width: 560px; margin: 0 auto; }
nav.tabs a { width: 72px; height: 56px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--mute); }
nav.tabs a small { font-size: 11px; font-weight: 700; line-height: 1; }
nav.tabs a.on { color: #fff; background: rgba(255,255,255,.12); }
nav.tabs.overlay { background: var(--bg2); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(0,0,0,.5); }

/* 首頁 */
.home { justify-content: center; gap: 18px; padding-bottom: 40px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.bigbtn { display: flex; align-items: center; gap: 18px; min-height: 104px; padding: 0 22px; border-radius: 22px; background: var(--card); font-size: 22px; font-weight: 700; text-align: left; width: 100%; }
.bigbtn .ic { width: 64px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center; }
.bigbtn.cam .ic { background: var(--red2); }
.bigbtn.live .ic { background: #1E3A5F; color: var(--blue); }
.bigbtn.stats .ic { background: #2A303A; color: var(--accent); }
.foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; color: var(--mute); font-size: 12px; margin-top: 6px; padding-bottom: 8px; }
.foot > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.foot > a { color: var(--mute); text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; white-space: nowrap; }

/* 定位 */
.locate { justify-content: center; align-items: stretch; text-align: center; }
.locate .q { font-size: 26px; font-weight: 700; }
.locate .place { font-size: 20px; font-weight: 700; }
.yesno { display: flex; justify-content: center; gap: 28px; margin-top: 10px; }
.yesno button { width: 96px; height: 96px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.yes { background: #065F46; color: #A7F3D0; }
.no { background: #3F1D1D; color: #FCA5A5; }
.list { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.list button, .list a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border-radius: 14px; background: var(--card); width: 100%; text-align: left; }
select, input { font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 12px; height: 48px; padding: 0 12px; width: 100%; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 40px; font-weight: 700; }
.primary { height: 64px; border-radius: 999px; background: var(--red2); color: #fff; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.primary:disabled { opacity: .5; }

/* 監票鏡頭 */
.campage { position: fixed; inset: 0; background: #000; overflow: hidden; max-width: 560px; margin: 0 auto; }
.campage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.campage .hud-top { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; justify-content: space-between; gap: 8px; }
.campage .hud-icons { position: absolute; top: calc(max(16px, env(safe-area-inset-top)) + 50px); left: 16px; display: flex; gap: 8px; }
.campage .hud-icons .round { width: 40px; height: 40px; background: rgba(0,0,0,.6); color: #6B7280; }
.campage .hud-icons .round.ok { color: var(--green); }
.campage .hud-icons .round.rec { background: var(--red2); color: #fff; animation: blink 1s infinite; }
.campage .torch { position: absolute; top: calc(max(16px, env(safe-area-inset-top)) + 50px); right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.campage .torch button { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 10px; border-radius: 999px; background: rgba(0,0,0,.6); font-size: 14px; font-weight: 700; }
.campage .torch button.on { background: var(--accent); color: #1A1204; }
.campage .heard { position: absolute; left: 50%; top: 42%; transform: translate(-50%,-50%); font-size: 16px; font-weight: 500; background: rgba(0,0,0,.7); padding: 8px 14px; border-radius: 999px; max-width: 86%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.campage .heard:empty { display: none; }
.campage .panel { position: absolute; left: 0; right: 0; bottom: calc(76px + var(--safe-b)); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,.55) 75%, transparent); }
.tally { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.tally button { height: 54px; border-radius: 12px; background: rgba(23,27,34,.9); display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-size: 22px; font-weight: 700; user-select: none; -webkit-user-select: none; }
.tally .no { width: 26px; height: 26px; border-radius: 999px; color: #0E1116; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.tally button.flash { outline: 2px solid #fff; }
.sumrow { display: flex; gap: 6px; }
.sumrow small { font-size: 11px; color: var(--mute); font-weight: 600; }
.sumrow > div { flex: 1; height: 40px; border-radius: 10px; background: rgba(23,27,34,.9); display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; }
.ctrl { display: flex; justify-content: center; align-items: flex-end; gap: 28px; padding: 4px 0 6px; }
.ctrl .cb { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 64px; }
.ctrl .cb .round { margin-bottom: 12px; }
.ctrl .cb small { font-size: 11px; color: #D1D5DB; font-weight: 600; }
.tipb { position: fixed; z-index: 100; max-width: 240px; padding: 8px 12px; border-radius: 10px; background: #F3F4F6; color: #111827; font-size: 13px; font-weight: 600; line-height: 1.4; box-shadow: 0 6px 20px rgba(0,0,0,.5); pointer-events: none; }
.shutter { width: 80px; height: 80px; border-radius: 999px; border: 5px solid #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.shutter span { width: 60px; height: 60px; border-radius: 999px; background: var(--red); display: flex; align-items: center; justify-content: center; }
.shutter.running span { border-radius: 14px; width: 40px; height: 40px; }
.shutter { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.shutter.paused span { background: var(--green); border-radius: 0; width: 34px; height: 38px; clip-path: polygon(10% 0, 100% 50%, 10% 100%); margin-left: 6px; }
.shutter .hold { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); transform: rotate(-90deg); pointer-events: none; }
.shutter .hold circle { fill: none; stroke: var(--red); stroke-width: 5; stroke-dasharray: 258; stroke-dashoffset: 258; }
.shutter.holding .hold circle { transition: stroke-dashoffset 3s linear; stroke-dashoffset: 0; }
.pzbar { position: absolute; left: 50%; top: 34%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: rgba(245,183,0,.92); color: #1A1204; font-weight: 700; font-size: 15px; white-space: nowrap; }
/* 拍計票板、報告表 */
.board { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 14px calc(14px + var(--safe-b)); gap: 8px; }
.board .bhead { display: flex; justify-content: space-between; align-items: center; font-size: 20px; }
.board .bhint { font-size: 14px; color: var(--dim); }
.board .bview { flex: 1; min-height: 0; border-radius: 16px; overflow: hidden; background: #111; }
.board .bview video, .board .bview img { width: 100%; height: 100%; object-fit: contain; }
.board .bctrl { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 4px; }
.board .bskip { min-width: 96px; font-size: 14px; color: var(--dim); text-align: center; }
.board .round.ok { background: var(--green); color: #052E1C; }

.alert { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 16px; background: var(--warnbg); border: 1.5px solid var(--warn); }
.alert .t { font-size: 15px; font-weight: 700; color: #FDE68A; }
.alert .d { font-size: 13px; color: #E5E7EB; }
.alert .r { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #FCA5A5; }
.alert .ok { background: var(--warn); color: #1A1204; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--red); display: inline-block; }

/* 實況 */
.live .stage { position: relative; height: min(56dvh, 480px); margin: -20px -16px 0; background: radial-gradient(120% 80% at 50% 45%, #2B3038 0%, #12151A 75%); overflow: hidden; }
.live .stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.live .stage .hud { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { height: 26px; padding: 0 10px; border-radius: 6px; background: var(--red2); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; }
.badge.off { background: #374151; }
.live .stage .where { position: absolute; left: 16px; bottom: 16px; }
.live .stage .ballot { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); }
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.cands > div { padding: 12px; border-radius: 14px; background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.bar { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > div { height: 6px; }
.races { display: flex; gap: 6px; overflow-x: auto; }
.races button { height: 36px; padding: 0 14px; border-radius: 999px; background: var(--card); font-size: 14px; white-space: nowrap; }
.races button.on { background: #fff; color: #0E1116; font-weight: 700; }
.acts { display: flex; justify-content: center; gap: 28px; }
.acts .round { background: #1F242C; }
.acts .round.on { background: var(--blue); color: #0E1116; }

/* 全台統計 */
.ring { position: relative; width: 88px; height: 88px; flex-shrink: 0; }
.ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.tw { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(9, 38px); gap: 6px; }
.tw button { position: relative; border-radius: 8px; font-size: 13px; font-weight: 500; }
.tw button i { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 999px; background: var(--accent); border: 2px solid var(--bg); }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); }
.legend span.sw { width: 18px; height: 10px; border-radius: 3px; display: block; }

#toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); background: #fff; color: #0E1116; padding: 10px 16px; border-radius: 999px; font-size: 15px; font-weight: 500; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; }
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet > div { width: 100%; max-width: 560px; max-height: 80dvh; overflow: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.hash { font-family: ui-monospace, monospace; font-size: 11px; color: var(--mute); word-break: break-all; }
@keyframes blink { 50% { opacity: .55; } }
[hidden] { display: none !important; }

/* 監票：背景執行（看其他頁時鏡頭與錄音不停）*/
.campage.bg { visibility: hidden; pointer-events: none; z-index: -1; }
.monpill { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--red2); color: #fff; font-size: 14px; font-weight: 700; animation: blink 1.6s infinite; }
/* 監票：計票分頁（小畫面＋大票數）*/
.tbar { display: none; }
.campage.count { background: var(--bg); overflow-y: auto; }
.campage.count video { position: relative; display: block; width: calc(100% - 32px); height: 150px; margin: calc(max(16px, env(safe-area-inset-top)) + 52px) 16px 0; border-radius: 18px; }
.campage.count .hud-icons, .campage.count .torch, .campage.count .ctrl { display: none; }
.campage.count .heard { top: calc(max(16px, env(safe-area-inset-top)) + 160px); }
.campage.count .panel { position: static; background: none; padding: 12px 16px calc(96px + var(--safe-b)); }
.campage.count .tally { grid-template-columns: 1fr; gap: 10px; }
.campage.count .tally button { height: 60px; gap: 12px; background: var(--card); }
.campage.count .tally .tbar { display: block; flex: 1; height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.campage.count .tally .tbar span { display: block; height: 10px; border-radius: 999px; }
.campage.count .tally button > span:last-child { width: 56px; text-align: right; font-size: 24px; }
.strip { display: none; gap: 6px; overflow-x: auto; }
.campage.count .strip { display: flex; }
.strip span { position: relative; flex-shrink: 0; }
.strip img { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; display: block; }
.strip b { position: absolute; left: 3px; bottom: 1px; font-size: 10px; color: #fff; text-shadow: 0 0 3px #000; }
.strip i { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }
/* AI 判斷不出 → 志工判定 */
.decide { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 16px; background: rgba(23,27,34,.95); border: 1.5px solid var(--accent); }
.decide button { min-width: 48px; height: 44px; border-radius: 12px; font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
#sMic.pulse { animation: blink 1s infinite; box-shadow: 0 0 0 2px #F87171 inset; }
.darktiles { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6); }
.brand .dom { font-style: normal; font-size: 13px; font-weight: 500; color: var(--mute); margin-left: 8px; letter-spacing: .5px; }
.brand small { display: block; font-size: 13px; font-weight: 400; color: var(--mute); margin-top: 2px; }
.sheetbox .yesno { margin-top: 8px; }
/* 標籤列：地區、鄉鎮、票種 */
.chips { scrollbar-width: none; padding: 2px 0; flex-shrink: 0; }
.chips::-webkit-scrollbar { display: none; }
.races { position: relative; }
.badge { white-space: nowrap; flex-shrink: 0; }
.blk { display: flex; flex-direction: column; gap: 10px; }
.seg button { background: #262C36; }
/* 縣市長：電視開票樣式 */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cc { background: #11151B; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border-top: 4px solid var(--pc); }
.cc.lead { box-shadow: 0 0 0 2px var(--pc) inset; }
.cc .nm { font-weight: 700; font-size: 16px; margin-top: 6px; }
.cc .pt { font-size: 12px; color: var(--mute); }
.cc .vv { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 4px; }
.cc .pp { font-size: 13px; color: var(--dim); }
.cc .bar { width: 100%; height: 6px; border-radius: 3px; background: #262C36; overflow: hidden; margin-top: 6px; }
.cc .bar div { height: 100%; }
/* 各選區列表 */
.grp { border-top: 1px solid #262C36; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.vlist { display: flex; flex-direction: column; gap: 6px; }
.vr { display: flex; align-items: center; gap: 10px; }
.vr .bar { display: block; height: 4px; border-radius: 2px; background: #262C36; margin-top: 4px; overflow: hidden; }
.vr .bar span { display: block; height: 100%; }
.vr .vv { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; }
.vr .vv small { display: block; font-size: 11px; font-weight: 400; color: var(--mute); }
/* 首頁：本次選舉卡片 */
.home { gap: 14px; }
.ecard { background: var(--card); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); }
.ecard .et { font-size: 20px; font-weight: 700; }
.ecard .ed { gap: 8px; font-size: 15px; }
.ecard .ek { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ecard .ek span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #262C36; color: var(--dim); }
.ph { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.ph.before { background: rgba(245,183,0,.15); color: var(--accent); }
#cdown { font-variant-numeric: tabular-nums; }
.ph.voting { background: rgba(96,165,250,.15); color: var(--blue); }
.ph.counting { background: var(--red2); color: #fff; }
.ph.counting i { width: 8px; height: 8px; border-radius: 999px; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.ph.ended { background: #262C36; color: var(--mute); }
.home .bigbtn { min-height: 84px; font-size: 20px; }
.home .bigbtn .ic { width: 56px; height: 56px; }
.hist { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--dim); font-size: 15px; padding: 6px; }
.hist small { color: var(--mute); font-size: 12px; }
.cbtn { padding: 0; background: none; border: 0; border-radius: 999px; cursor: pointer; }

/* 找開票所：篩選區與清單分開 */
.filt { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--line); position: sticky; top: 0; z-index: 5; box-shadow: 0 8px 16px -8px rgba(0,0,0,.6); }
.lhead { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); padding: 6px 4px 0; border-top: 1px solid var(--line); margin-top: 4px; }
.lhead:empty { display: none; }
/* 隱私權政策、使用條款 */
.legal { font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.legal h2 { font-size: 17px; margin: 22px 0 6px; }
.legal h3 { font-size: 15px; margin: 14px 0 4px; }
.legal p { margin: 6px 0; }
.legal p:first-child { color: var(--mute); font-size: 13px; }
.legal ol { margin: 4px 0; padding-left: 1.6em; }
.legal ol ol { list-style: lower-alpha; }
.legal li { margin: 3px 0; }
.legal a { color: #60A5FA; }
/* 加到主畫面引導、監票提醒開關 */
.inst { position: relative; display: flex; flex-direction: column; gap: 8px; font-size: 15px; border: 1px solid #2B3340; }
.inst b { display: flex; align-items: center; gap: 6px; padding-right: 28px; }
.inst .ix { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--mute); }
.inst .steps { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 6px; }
.inst .steps li { line-height: 1.5; }
.inst .steps svg { vertical-align: -4px; color: #60A5FA; }
.primary.sm { height: 44px; font-size: 16px; width: auto; padding: 0 18px; }
.remind { gap: 12px; cursor: pointer; }
.remind .ic { color: var(--accent); }
.remind input[type=checkbox] { appearance: none; width: 52px; height: 30px; border-radius: 999px; background: #2A303A; position: relative; transition: background .2s; flex: none; }
.remind input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.remind input[type=checkbox]:checked { background: #22C55E; }
.remind input[type=checkbox]:checked::after { transform: translateX(22px); }

/* 頁面底部說明（監票存證為主、票數以中選會為準） */
.disc { font-size: 12px; line-height: 1.6; color: var(--mute); text-align: center; padding: 4px 8px 12px; text-wrap: balance; }
/* 開票實況：地區標籤滑動時固定在上方 */
.stick { position: sticky; top: 0; z-index: 5; background: var(--bg); margin: -6px -16px 0; padding: 6px 16px 8px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 8px 12px -10px rgba(0,0,0,.8); }
/* 存證下載（依鄉鎮） */
.bulk #bt .brow { padding: 8px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.bulk #bt .brow small { font-size: 11px; color: var(--mute); white-space: nowrap; }
/* 管理頁（資安紀錄） */
.admin .adm-list { display: flex; flex-direction: column; }
.admin .arow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.admin .arow .grow { min-width: 0; overflow-wrap: anywhere; }
.admin .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.admin .tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--track); }
.admin .primary.sm { white-space: nowrap; flex-shrink: 0; }
.admin select, .admin input { background: var(--card); color: var(--fg, #fff); border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-width: 0; }
/* 唱票與票面比對 */
.sumrow .chk { font-size: 13px; gap: 3px; color: var(--green); }
.sumrow .chk b { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); margin-left: 4px; }
.strip i.bad { background: #F87171; width: 10px; height: 10px; }
.strip em { position: absolute; right: 3px; bottom: 1px; font-size: 11px; font-style: normal; color: #34D399; text-shadow: 0 0 3px #000; font-weight: 700; }
.decide button.hint { outline: 3px solid #fff; outline-offset: 2px; }
.ckrow { gap: 10px; font-size: 13px; flex-wrap: wrap; }
.ckrow .warn { color: var(--accent); font-weight: 700; }
#preset .cbtn { flex: none; width: auto; min-height: 0; padding: 0; background: none; }
#preset .card > .grow { min-width: 0; }
.lockbtn { text-align: left; color: var(--fg); border: 1px solid transparent; }
.lockbtn.on { border-color: #34D399; }
.lockbtn.on > svg:first-child { color: #34D399; }
.pin { font-size: 28px; letter-spacing: .5em; text-align: center; padding: 12px; }
.lockbox .guide summary { display: flex; gap: 8px; align-items: center; cursor: pointer; color: var(--dim); font-size: 14px; padding: 6px 0; }
.lockbox .steps { margin: 6px 0 10px; padding-left: 1.4em; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; }
/* iPhone：影片層不吃點擊，畫面上的按鍵都疊在影片上面 */
.campage video { pointer-events: none; }
.campage .hud-top, .campage .hud-icons, .campage .torch, .campage .panel, .campage .pzbar { z-index: 2; }
/* 鏡頭畫面：候選人一列、左右滑；無效票只顯示數字（計票畫面才有＋1 鍵） */
.campage:not(.count) .tally { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; touch-action: pan-x; }
.campage:not(.count) .tally::-webkit-scrollbar { display: none; }
.campage:not(.count) .tally button { flex: 0 0 calc((100% - 12px) / 3); scroll-snap-align: start; }
.campage:not(.count) .sumrow .invadd { display: none; }
.campage.count .sumrow .invshow { display: none; }
/* 異常票確認 */
.anomb { position: relative; background: var(--warnbg); color: var(--accent); border: 1.5px solid var(--warn); }
.anomb .badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #EF4444; color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #000; }
.anomb .badge[hidden] { display: none; }
.anom { position: fixed; inset: 0; max-width: 560px; margin: 0 auto; z-index: 35; background: rgba(8,10,14,.94); display: flex; flex-direction: column; padding: max(12px, env(safe-area-inset-top)) 0 calc(12px + var(--safe-b)); gap: 10px; }
.anom .ahead { display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 18px; }
.anom .ahead .round { width: 40px; height: 40px; background: rgba(255,255,255,.1); }
.anom .alist { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 0; }
.anom .alist::-webkit-scrollbar { display: none; }
.acard { flex: 0 0 100%; scroll-snap-align: start; padding: 0 14px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; box-sizing: border-box; }
.acard header { display: flex; justify-content: space-between; align-items: center; }
.acard .k { display: inline-flex; gap: 6px; align-items: center; color: var(--accent); font-weight: 700; }
.acard dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; padding: 10px 12px; border-radius: 14px; background: var(--card); font-size: 14px; }
.acard dt { color: var(--mute); }
.acard dd { margin: 0; font-weight: 600; }
.acard img { width: 100%; max-height: 32dvh; object-fit: contain; border-radius: 12px; background: #000; }
.acard .picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acard .picks button { min-height: 52px; border-radius: 12px; background: rgba(255,255,255,.12); font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.acard .picks button.inv { background: #3F1D1D; color: #FCA5A5; }
.acard button.sel { outline: 3px solid #34D399; outline-offset: 2px; }
.acard .others { display: flex; gap: 6px; flex-wrap: wrap; }
.acard .others button { min-width: 44px; height: 40px; border-radius: 10px; font-weight: 700; }
.acard .skipb { min-height: 44px; border-radius: 12px; background: none; border: 1px dashed var(--mute); color: var(--dim); }
.acard .done { color: #34D399; display: flex; gap: 6px; align-items: center; font-weight: 700; }
.acard .skip { color: var(--accent); font-size: 14px; }
.anom .aempty { flex: 0 0 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #34D399; }
.anom .areport { margin: 0 14px; min-height: 48px; border-radius: 14px; background: var(--warnbg); color: var(--accent); border: 1.5px solid var(--warn); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }
.ghost { height: 52px; width: 100%; border-radius: 999px; background: var(--card); color: var(--fg); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; font-weight: 600; }
.sumrow .chk b.nb { color: #9CA3AF; }
.nbwarn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(127,29,29,.95); border: 1.5px solid #F87171; color: #fff; font-size: 13px; line-height: 1.4; }
.nbwarn b { font-size: 15px; }
.nbwarn .round { width: 36px; height: 36px; background: rgba(255,255,255,.15); flex-shrink: 0; }
.tw button { line-height: 1.15; overflow: hidden; overflow-wrap: anywhere; padding: 0 2px; }
html[lang="th"] .tw button, html[lang="vi"] .tw button { font-size: 11px; }
.langtip { font-size: 13px; line-height: 1.5; color: var(--dim); align-items: flex-start; }
.langtip svg { color: #34D399; flex-shrink: 0; margin-top: 2px; }
.reportb { background: #DC2626 !important; color: #fff; box-shadow: 0 0 0 3px rgba(220,38,38,.35); }
