:root {
  color: #1a263b;
  background: #f6f5f0;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --navy: #172a46;
  --ink: #18263c;
  --muted: #505d70;
  --line: #e4e5e3;
  --cream: #f6f5f0;
  --accent: #a33834;
  --green: #246348;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #5883c0; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1168px; min-height: 84px; margin: auto; padding: 12px 26px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand, .top-actions { display: flex; align-items: center; gap: 12px; }
.monogram { font: italic 31px/1 Georgia, serif; display: grid; place-items: center; background: var(--navy); color: #fffaf1; border-radius: 9px; width: 48px; height: 48px; flex: 0 0 48px; }
.brand strong { display: block; font-size: 18px; line-height: 1.2; letter-spacing: -.04em; }
.brand-small { display: block; color: var(--muted); font-size: 13px; margin-bottom: 3px; }
.quiet { border: 0; background: transparent; color: var(--muted); padding: 8px 10px; border-radius: 7px; }
.quiet:hover { background: #eff1f3; color: var(--ink); }
.quiet:disabled { color: #758092; background: transparent; }
.shell { max-width: 1168px; margin: auto; padding: 24px 26px 0; }
.views { display: flex; gap: 5px; padding: 4px; border: 1px solid #e3e3de; border-radius: 10px; background: #ecece7; width: fit-content; margin-bottom: 18px; }
.views button { border: 1px solid transparent; padding: 9px 20px; min-height: 44px; border-radius: 7px; font-weight: 650; color: var(--muted); background: transparent; white-space: nowrap; }
.views button:hover { color: var(--ink); }
.views button[aria-pressed="true"] { color: var(--navy); background: white; border-color: #dddfdf; box-shadow: 0 1px 2px #1a263b12; }
.hero { background: var(--navy); background-image: radial-gradient(ellipse at 93% 8%, #2d496b, transparent 62%), radial-gradient(circle, #bbc9df30 1px, transparent 1.4px); background-size: auto, 21px 21px; color: #fffaf1; display: flex; justify-content: space-between; align-items: end; gap: 16px; min-height: 204px; padding: 28px 32px; border-radius: 16px; }
.hero-kicker { font-weight: 700; letter-spacing: .10em; font-size: 13px; color: #dbe3f1; display: flex; align-items: center; gap: 9px; }
.hero-kicker span { display: inline-block; height: 1px; width: 19px; background: #edaaa2; }
.hero h1 { font-weight: 760; font-size: clamp(37px, 5vw, 55px); line-height: 1.18; letter-spacing: -.065em; margin: 9px 0; }
#hero-description { color: #e0e7f4; font-size: 16px; word-break: keep-all; }
.hero-side { display: grid; justify-items: end; gap: 24px; }
.phase { background: #fff9eb; color: var(--navy); border-radius: 100px; padding: 5px 12px; font-size: 13px; font-weight: 760; white-space: nowrap; }
.phase[data-phase="open"] { background: #e1f5e8; color: #21563e; }
.office-steps { display: flex; gap: 13px; align-items: center; font-size: 14px; white-space: nowrap; }
.office-step { color: #c6d0e0; border-bottom: 2px solid #a6b3c347; padding: 0 0 6px; min-width: 48px; text-align: center; }
.office-step.current { border-color: #f1a69d; color: #fff; font-weight: 750; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr); align-items: start; gap: 18px; margin-top: 18px; }
.stack { display: grid; gap: 16px; min-width: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 25px; min-width: 0; box-shadow: 0 2px 3px #1a263b06; }
.card-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.card h2 { font-size: 22px; line-height: 1.25; letter-spacing: -.045em; }
.card-description { color: var(--muted); margin-top: 5px; font-size: 15px; word-break: keep-all; }
.subtle { color: var(--muted); font-size: 14px; word-break: keep-all; }
.tag { background: #edf0f5; color: #43536b; text-align: center; font-size: 13px; padding: 4px 9px; border-radius: 100px; font-weight: 650; white-space: nowrap; }
.round-label { font-size: 14px; color: var(--muted); margin-top: 5px; }
.candidate-list { padding: 0; margin: 0; list-style: none; display: grid; gap: 8px; }
.candidate { min-width: 0; display: flex; gap: 11px; align-items: center; padding: 11px 12px; border: 1px solid #e4e8ee; border-radius: 9px; background: #f8f9fb; min-height: 55px; }
.candidate-index { display: grid; place-items: center; min-width: 31px; height: 31px; border-radius: 6px; color: var(--navy); background: #e6ebf2; font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.candidate-name { font-size: 16px; font-weight: 700; flex: 1; overflow-wrap: anywhere; }
.candidate .quiet { padding: 5px 8px; font-size: 14px; }
.field { display: grid; gap: 6px; min-width: 0; color: var(--ink); font-size: 14px; font-weight: 680; }
input:not([type=radio]), select { min-height: 44px; color: var(--ink); width: 100%; border: 1px solid #c8cfd8; border-radius: 7px; background: white; padding: 8px 10px; font-size: 16px; }
input:disabled { background: #f4f5f7; color: #4f5b6d; }
.add-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(94px, .38fr) auto; align-items: end; gap: 8px; margin-top: 15px; }
.rule { background: #f4f2eb; border-radius: 8px; color: #424d60; padding: 11px 13px; margin-top: 14px; font-size: 14px; word-break: keep-all; }
.rule strong { color: var(--ink); }
.rule.warning { background: #f8efed; color: #7f332f; }
.action { border: 1px solid var(--navy); background: var(--navy); color: #fff; min-height: 44px; padding: 8px 16px; border-radius: 8px; font-weight: 720; white-space: nowrap; }
.action:hover:not(:disabled) { background: #294366; }
.action:disabled { border-color: #d6dbe2; background: #e9edf1; color: #535e6e; }
.action.secondary { color: var(--navy); background: #fff; border-color: #c9d0db; }
.action.secondary:hover:not(:disabled) { background: #eef2f7; }
.action.secondary:disabled { color: #535e6e; background: #e9edf1; border-color: #d6dbe2; }
.fill { width: 100%; }
.monitor-controls { display: grid; gap: 8px; margin-top: 18px; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #e7e9ed; border-radius: 10px; background: #f8f9fb; }
.metrics div { padding: 10px 13px; }
.metrics div + div { border-left: 1px solid #e7e9ed; }
.metrics span { display: block; color: var(--muted); font-size: 14px; }
.metrics strong { font-size: 28px; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.attendance-panel { margin-top: 18px; }
.attendance-panel .card-header { flex-wrap: wrap; }
.attendance-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.attendance-metrics > * { display: block; min-width: 0; padding: 12px; border: 1px solid #e7e9ed; border-radius: 9px; background: #f8f9fb; }
.attendance-metrics span, .attendance-metrics dt { display: block; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.attendance-metrics strong, .attendance-metrics dd { display: block; margin: 0; color: var(--ink); font-size: 24px; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.checkin-form { display: grid; gap: 12px; margin-top: 16px; }
.attendance-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.attendance-row { display: flex; min-width: 0; min-height: 52px; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; padding: 8px 11px; border: 1px solid #e4e8ee; border-radius: 9px; background: #f8f9fb; }
.attendance-row strong { overflow-wrap: anywhere; }
.attendance-actions { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 6px; }
.attendance-actions .action, .attendance-actions .quiet { min-height: 44px; padding: 6px 10px; font-size: 14px; }
.quorum-note { margin-top: 12px; padding: 11px 13px; border-radius: 8px; background: #f4f2eb; color: #424d60; font-size: 15px; word-break: keep-all; }
.quorum-note[data-ready="true"], .quorum-note.is-met { background: #edf8f1; color: var(--green); }
.presence-help { margin-top: 10px; color: var(--muted); font-size: 14px; word-break: keep-all; }
.qr-card { display: flex; align-items: center; gap: 17px; padding: 19px 21px; }
.qr-card h2 { font-size: 18px; }
.qr-card p { margin-top: 4px; }
.member-link { display: inline-block; margin-top: 6px; color: #29466e; font-size: 14px; font-weight: 700; text-underline-offset: 3px; }
.member-link:focus-visible { outline: 3px solid #5883c0; outline-offset: 3px; }
.qr-example { width: 79px; height: 79px; flex: 0 0 79px; padding: 7px; border: 1px solid #e1e5e9; border-radius: 8px; background: white; }
.qr-example canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.qr-example img { display: block; width: 100%; height: auto; }
.empty { padding: 16px; text-align: center; border-radius: 9px; border: 1px dashed #cdd4df; color: var(--muted); word-break: keep-all; }
.center-panel { max-width: 640px; margin: 18px auto 0; }
.sample-button { margin-top: 4px; padding-left: 0; color: #344c71; font-size: 14px; }
.ballot { border: 0; padding: 0; min-width: 0; margin: 17px 0; display: grid; gap: 8px; }
.ballot legend { font-size: 16px; font-weight: 700; padding: 0; margin-bottom: 7px; }
.choice { background: #fff; border: 1px solid #dce1e8; min-height: 60px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; }
.choice:has(:checked) { background: #eff4fb; border-color: #7892b4; }
.choice input { accent-color: var(--navy); width: 19px; height: 19px; flex: 0 0 19px; margin: 0; order: -1; }
fieldset:disabled .choice { background: #f6f7f8; color: #4d5a6a; }
.note { margin-top: 10px; font-size: 14px; color: var(--muted); word-break: keep-all; }
.feedback { margin-top: 10px; color: var(--accent); font-size: 15px; }
.feedback:empty { display: none; }
.success { border: 1px solid #c9e6d5; background: #edf8f1; color: var(--green); padding: 14px; margin-bottom: 17px; border-radius: 9px; }
.result-panel { margin-top: 18px; }
.result-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(230px, 1fr); gap: 21px; }
.count-list { display: grid; gap: 14px; }
.count-line { display: grid; gap: 5px; }
.count-row { display: flex; justify-content: space-between; gap: 12px; }
.count-row strong { overflow-wrap: anywhere; }
.count-row span { flex-shrink: 0; font-weight: 700; }
.track { height: 9px; overflow: hidden; border-radius: 50px; background: #edf0f3; }
.track > div { background: #28466d; height: 100%; border-radius: 50px; }
.output-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.output-stats div { background: #f1f3f6; padding: 9px 12px; border-radius: 8px; }
.output-stats span { display: block; font-size: 14px; color: var(--muted); }
.output-stats strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.confirm-line { display: flex; gap: 9px; margin-top: 13px; flex-wrap: wrap; }
.footer { color: var(--muted); border-top: 1px solid #e1e3e1; margin-top: 26px; padding: 15px 0 20px; font-size: 13px; }
.footer span { padding: 0 4px; color: var(--accent); }
@media (max-width: 1024px) {
  .attendance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .top-inner { min-height: 68px; padding: 10px 16px; }
  .shell { padding: 16px 16px 0; }
  .brand, .top-actions { gap: 8px; }
  .brand strong { font-size: 16px; }
  .monogram { width: 38px; height: 38px; flex-basis: 38px; font-size: 24px; }
  .views { width: 100%; margin-bottom: 12px; }
  .views button { flex: 1; padding: 8px 6px; font-size: 14px; }
  .hero { min-height: 184px; padding: 19px; gap: 10px; align-items: start; }
  .hero h1 { font-size: 38px; }
  .hero-side { gap: 9px; }
  .office-steps { flex-direction: column; gap: 2px; font-size: 12px; }
  .office-step { padding-bottom: 2px; }
  .phase { font-size: 12px; }
  .content-grid, .result-layout { grid-template-columns: 1fr; }
  .card { padding: 17px; }
  .card h2 { font-size: 21px; }
  .card-header { margin-bottom: 13px; }
  .add-form { grid-template-columns: minmax(0, 1fr) 88px; }
  .add-form > button { grid-column: 1 / -1; }
}

/* Live operation */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.connection-status { border: 1px solid #ead4d1; background: #fbefec; color: #7f332f; padding: 10px 13px; border-radius: 9px; margin-bottom: 12px; }
.login-panel h1 { font-size: clamp(25px, 5vw, 35px); letter-spacing: -.04em; }
.entry-links { margin-top: 14px; gap: 13px; }
.roster-panel { margin-top: 18px; }
.roster-panel > summary, .optional-field > summary { cursor: pointer; padding: 6px 0; }
.roster-panel > summary .tag { margin-left: 8px; }
.optional-field > label { margin-top: 7px; }
.field textarea { width: 100%; min-width: 0; min-height: 110px; padding: 9px 10px; border: 1px solid #c8cfd8; border-radius: 7px; background: white; font-size: 16px; resize: vertical; }
.checkin-actions { margin-top: 13px; }
.qr-card > :last-child { min-width: 0; }
.qr-actions { gap: 8px; margin-top: 5px; }
.qr-card .join-url { min-height: 36px; font-size: 14px; }
.qr-card .qr-example { height: auto; }
.result-track { width: 100%; height: 9px; overflow: hidden; border: 0; border-radius: 50px; background: #edf0f3; accent-color: #28466d; }
.result-track::-webkit-progress-bar { background: #edf0f3; border-radius: 50px; }
.result-track::-webkit-progress-value { background: #28466d; border-radius: 50px; }
.result-track::-moz-progress-bar { background: #28466d; border-radius: 50px; }
@media (max-width: 360px) {
  .top-inner { padding-inline: 11px; }
  .shell { padding-inline: 11px; }
  .hero { padding: 16px; }
  .hero h1 { font-size: 33px; }
  .monogram { width: 34px; height: 34px; flex-basis: 34px; }
  .top-actions { gap: 5px; }
}

/* Election guide and meeting-room display */
.guide-panel { margin: 18px auto 0; }
.guide-panel.center-panel { max-width: 780px; }
.guide-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 16px; }
.guide-head h2, .guide-head h3 { word-break: keep-all; }
.guide-head .card-description { max-width: 60ch; }
.guide-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 116px), 1fr)); gap: 8px; margin: 0; }
.guide-counts > * { min-width: 0; padding: 11px 13px; border: 1px solid #e1e6ed; border-radius: 9px; background: #f4f6f9; }
.guide-counts dt, .guide-counts span { display: block; color: var(--muted); font-size: 14px; }
.guide-counts dd, .guide-counts strong { display: block; margin: 2px 0 0; color: var(--navy); font-size: clamp(19px, 3vw, 26px); font-weight: 750; letter-spacing: -.04em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.guide-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 16px 0 0; padding: 0; list-style: none; }
.guide-step { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 12px; border: 1px solid #e7e8e5; border-radius: 9px; background: #faf9f6; }
.guide-no { display: grid; place-items: center; flex: 0 0 29px; width: 29px; height: 29px; border-radius: 6px; background: #e9edf3; color: var(--navy); font-size: 13px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.guide-copy { min-width: 0; }
.guide-step h3 { color: var(--ink); font-size: 16px; line-height: 1.35; letter-spacing: -.026em; }
.guide-step p { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.48; word-break: keep-all; overflow-wrap: anywhere; }
.guide-step p + p { margin-top: 5px; }
.guide-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.guide-actions .action { min-height: 46px; }
.hall-link { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; padding: 6px 11px; color: #29466e; background: #f4f6f9; border: 1px solid #dce1ea; border-radius: 8px; font-size: 14px; font-weight: 700; text-decoration: none; }
.hall-link:hover { color: var(--navy); background: #edf1f7; }
.hall-link:focus-visible { outline: 3px solid #5883c0; outline-offset: 3px; }

:is(.hall-mode.shell, .hall-mode .shell) { max-width: 1472px; padding-inline: clamp(16px, 3.2vw, 54px); }
.hall-mode .top-inner { max-width: 1472px; min-height: 64px; padding-block: 8px; }
.hall-mode .shell { padding-top: 16px; }
.hall-mode .hero { min-height: 116px; padding-block: 14px; }
.hall-mode .hero h1 { font-size: clamp(31px, 4.1vw, 58px); margin-block: 4px; }
.hall-mode .hero-side { gap: 15px; }
.hall-mode .footer { display: none; }
.hall-mode .shell { padding-bottom: 16px; }
.hall-panel { margin: 16px 0 0; }
.hall-layout { display: grid; gap: 14px; min-width: 0; align-items: start; }
.hall-layout:has(> :nth-child(2)) { grid-template-columns: minmax(0, 1fr) minmax(196px, .29fr); }
.hall-layout > * { min-width: 0; }
.hall-layout .guide-panel, .hall-layout .result-panel { margin-top: 0; }
.hall-panel h2, .hall-mode .result-panel h2 { font-size: clamp(23px, 3vw, 39px); letter-spacing: -.047em; }
.hall-panel .card-description, .hall-mode .result-panel .card-description { font-size: clamp(15px, 1.5vw, 21px); }
.hall-candidates { display: grid; gap: 9px; margin: 14px 0 0; padding: 0; list-style: none; }
.hall-candidates > * { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px 15px; border: 1px solid #e2e7ef; border-radius: 9px; background: #f4f6f9; font-size: clamp(18px, 2.8vw, 36px); font-weight: 750; overflow-wrap: anywhere; }
.hall-candidates .candidate-name { font-size: inherit; }
.hall-candidates .candidate-index { width: clamp(29px, 3.4vw, 46px); height: clamp(29px, 3.4vw, 46px); font-size: clamp(13px, 1.5vw, 21px); }
.hall-tag { display: inline-flex; align-items: center; width: fit-content; padding: 4px 10px; border-radius: 100px; background: #e9edf3; color: #354965; font-size: clamp(13px, 1.3vw, 18px); font-weight: 700; white-space: nowrap; }
.hall-count { margin-top: 10px; padding: 12px 15px; border-radius: 9px; background: #f4f6f9; color: var(--muted); font-size: clamp(15px, 1.5vw, 20px); }
.hall-count strong { color: var(--navy); font-size: clamp(24px, 3.8vw, 50px); font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1.15; }
.hall-qr { display: grid; justify-items: center; gap: 9px; text-align: center; padding: 18px; }
.hall-qr h2, .hall-qr h3 { font-size: clamp(19px, 1.8vw, 26px); }
.hall-qr .qr-example { width: min(100%, 175px); height: auto; aspect-ratio: 1; padding: 11px; }
.hall-qr .subtle { font-size: 14px; }
.hall-mode .guide-panel.center-panel { max-width: none; }
.hall-mode .guide-panel { padding: 17px; }
.hall-mode .guide-head { margin-bottom: 12px; }
.hall-mode .guide-steps { margin-top: 11px; }
.hall-mode .guide-step h3 { font-size: clamp(16px, 1.6vw, 22px); }
.hall-mode .guide-step p { font-size: clamp(14px, 1.22vw, 18px); }
.hall-mode .guide-counts dt, .hall-mode .guide-counts span { font-size: clamp(14px, 1.4vw, 20px); }
.hall-mode .guide-counts dd, .hall-mode .guide-counts strong { font-size: clamp(23px, 3vw, 42px); }
.hall-mode .count-row { font-size: clamp(18px, 2.5vw, 34px); }
.hall-mode .track { height: clamp(9px, .85vw, 15px); }
.hall-mode .output-stats span { font-size: clamp(14px, 1.4vw, 20px); }
.hall-mode .output-stats strong { font-size: clamp(22px, 2.7vw, 39px); }
.hall-mode .result-panel .rule { font-size: clamp(15px, 1.6vw, 22px); }

@media (min-width: 900px) and (max-height: 800px) {
  .hall-mode .top-inner { min-height: 54px; padding-block: 6px; }
  .hall-mode .monogram { width: 40px; height: 40px; flex-basis: 40px; }
  .hall-mode .shell { padding-block: 12px; }
  .hall-mode .hero { min-height: 108px; padding-block: 11px; }
  .hall-mode .hero h1 { font-size: 43px; }
  .hall-mode .hall-panel, .hall-mode .result-panel { margin-top: 12px; }
  .hall-mode .guide-head { gap: 6px 12px; margin-bottom: 9px; }
  .hall-mode .guide-head h2 { font-size: 30px; }
  .hall-mode .guide-head .card-description { font-size: 16px; }
  .hall-mode .guide-counts > * { padding: 8px 10px; }
  .hall-mode .guide-counts dd { font-size: 34px; }
  .hall-mode .quorum-note { margin-top: 8px; padding: 7px 10px; }
  .hall-mode .guide-steps { margin-top: 8px; gap: 8px; }
  .hall-mode .guide-step { padding: 8px; }
  .hall-mode .guide-step h3 { font-size: 18px; }
  .hall-mode .guide-step p { line-height: 1.38; }
  .hall-mode .result-panel { padding: 19px; }
}

@media (max-width: 760px) {
  .guide-panel { margin-top: 12px; }
  .guide-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .guide-counts > * { padding-inline: 8px; }
  .guide-counts dt { min-height: 2.8em; line-height: 1.4; word-break: keep-all; }
  .guide-steps { grid-template-columns: 1fr; }
  .guide-actions .action { flex: 1 0 100%; white-space: normal; }
  .hall-layout:has(> :nth-child(2)) { grid-template-columns: 1fr; }
  .hall-qr .qr-example { width: 115px; }
}
