/* v1 additions on top of styles.css */
select { min-height: 48px; padding: 0 12px; border: 1px solid #b8c3d3; border-radius: var(--radius-control); color: var(--ink); background: #fff; font: inherit; max-width: 100%; }
select:focus { border-color: var(--accent); outline: 3px solid rgba(21,94,239,.13); }
input[disabled], select[disabled] { background: #f1f4f8; color: #6e7789; }
.header-tools { display: inline-flex; align-items: center; gap: 8px; }
.lang-button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); background: #fff; font-size: .74rem; font-weight: 800; }
.list-panel h1 { margin: 0 0 24px; font-size: 1.9rem; letter-spacing: -.03em; word-break: keep-all; }
.event-links { display: grid; gap: 10px; }
.event-link { display: flex; justify-content: space-between; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-card); color: var(--ink); background: #fff; text-decoration: none; }
.event-link span { color: var(--accent); font-size: .8rem; font-weight: 800; }
.button.kakao { display: grid; place-items: center; color: #191919; background: #fee500; text-decoration: none; }
.category-block { margin: 0 0 34px; }
.category-title { display: block; width: 100%; margin-bottom: 14px; padding: 0; font-size: 1.25rem; font-weight: 850; letter-spacing: -.02em; }
.category-title small { display: block; margin-top: 4px; color: var(--muted); font-size: .8rem; font-weight: 500; }
.candidate-option.has-image { grid-template-columns: 64px 1fr 30px; }
.candidate-photo { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #e7ecf3; }
.receipt-list { margin: 26px 0 16px; }
.receipt-list .receipt { margin: 0; padding: 14px 0; border-top: 0; }
.receipt-list .receipt:first-child { border-top: 1px solid var(--line); }
.receipt em { color: var(--muted); font-style: normal; font-weight: 500; }
.complete-panel .button + .button { margin-top: 10px; }
.results-box { margin-top: 30px; }
.results-heading { margin: 0 0 14px; font-size: 1.1rem; }
.mini-results { margin-bottom: 18px; }
.mini-results h3 { margin: 0 0 10px; color: var(--muted); font-size: .95rem; }
.mini-row { display: grid; grid-template-columns: minmax(70px, .9fr) 1.4fr 42px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .86rem; }
.mini-row div { height: 8px; overflow: hidden; border-radius: 8px; background: #e7ecf3; }
.mini-row i { display: block; height: 100%; background: var(--accent); }
.mini-row b { text-align: right; font-variant-numeric: tabular-nums; }

/* admin */
.admin-nav { overflow-y: auto; }
.nav-bottom { display: grid; gap: 8px; margin-top: auto; }
.nav-bottom .nav-link-bottom { margin-top: 0; text-align: left; }
.nav-button { border: 1px solid rgba(255,255,255,.14); background: transparent; font: inherit; cursor: pointer; color: #aebad0; }
.topbar-tools { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.topbar-tools select { min-height: 42px; max-width: 280px; }
.heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.tab-pane + .tab-pane { margin-top: 0; }
.result-group + .result-group { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.result-group h3 { margin: 0 0 14px; font-size: 1rem; }
.result-group h3 small { margin-left: 6px; color: var(--muted); font-weight: 500; }
.event-card > strong.is-word { font-size: 1.7rem; letter-spacing: .02em; }
.join-qr { align-self: center; width: 150px; height: 150px; margin-top: 18px; border-radius: 10px; background: #fff; }
.join-url { margin: 12px 0 0; word-break: break-all; text-align: center; font-size: .75rem !important; }
.category-card { margin-bottom: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfd; }
.category-head { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(140px, 1.4fr) auto; gap: 10px; align-items: center; margin-bottom: 14px; }
.category-head .cat-name { font-weight: 800; }
.cand-list { display: grid; gap: 8px; }
.cand-row { display: grid; grid-template-columns: 48px minmax(120px, 1fr) minmax(120px, 1.4fr) auto; gap: 10px; align-items: center; }
.cand-thumb { display: grid; width: 48px; height: 48px; place-items: center; overflow: hidden; border-radius: 10px; color: var(--muted); background: #e7ecf3; font-size: .8rem; font-weight: 800; }
.cand-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.row-actions button, .mini-button { display: inline-flex; align-items: center; min-height: 34px; margin: 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: #fff; font-size: .78rem; font-weight: 700; cursor: pointer; }
.row-actions button:hover:not(:disabled), .mini-button:hover { border-color: #9eabc0; }
.row-actions .danger-link { color: var(--danger); border-color: #f0b7b2; }
.add-row { flex-wrap: wrap; margin-top: 14px; }
.add-row input, .add-row select { min-width: 140px; }
.cand-add { margin-top: 12px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.data-table th { padding: 10px 8px; border-bottom: 2px solid var(--line); color: var(--muted); text-align: left; font-size: .76rem; }
.data-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table code { font-size: .92rem; letter-spacing: .06em; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 99px; color: var(--muted); background: #e7ecf3; font-size: .74rem; font-weight: 800; }
.pill.ok { color: var(--success); background: #d9f3e8; }
.pill.bad { color: var(--danger); background: #fde4e1; }
.trend-chart svg { width: 100%; height: auto; }
.trend-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 10px; font-size: .82rem; }
.trend-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.trend-legend small { margin-left: auto; color: var(--muted); }
.flag { margin-bottom: 8px; padding: 12px 14px; border-radius: 10px; font-size: .86rem; font-weight: 650; }
.flag.info { color: #0e48bd; background: #e8f0ff; }
.flag.warn { color: #8a4b00; background: #fff0d5; }
.flag.ok { color: var(--success); background: #d9f3e8; }
.insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 20px; }
.insight-grid h3 { margin: 0 0 10px; font-size: .9rem; }
.mini-table > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .84rem; }
.audit-list small { margin-left: 8px; color: var(--muted); }
.settings-section + .settings-section, .settings-section + .audit-section { margin-top: 24px; }
.settings-footer .button.danger { margin-right: auto; }
#eventArea .settings-section { background: #fff; padding: 26px; border-radius: var(--radius-card); }

/* report / tickets */
.report-page { background: #e9edf3; }
.report-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fff; }
.report-toolbar .button { display: inline-grid; place-items: center; text-decoration: none; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.login-needed { margin: 40px auto; color: var(--danger); text-align: center; font-weight: 700; }
.report-sheet { width: min(100%, 900px); margin: 24px auto; padding: 48px; background: #fff; box-shadow: var(--shadow); }
.report-header h1 { margin: 0 0 6px; font-size: 2rem; letter-spacing: -.03em; }
.report-header > p:last-of-type { margin: 0; color: var(--muted); }
.report-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; margin: 24px 0 8px; }
.report-meta dt { color: var(--muted); font-size: .76rem; font-weight: 700; }
.report-meta dd { margin: 4px 0 0; font-weight: 750; }
.report-category { margin-top: 32px; break-inside: avoid; }
.report-category h2 { margin: 0 0 10px; font-size: 1.3rem; }
.report-category h2 small { color: var(--muted); font-size: .8rem; font-weight: 500; }
.report-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.report-table th, .report-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.report-table th { color: var(--muted); font-size: .76rem; }
.report-table .bar-col { width: 32%; }
.report-table tr.is-winner td { font-weight: 800; }
.report-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.ticket-sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: min(100%, 900px); margin: 20px auto; padding: 0 12px; }
.ticket { display: grid; grid-template-columns: 1fr 130px; gap: 14px; align-items: center; padding: 14px 16px; border: 1.5px dashed #8b96a8; border-radius: 12px; background: #fff; break-inside: avoid; }
.ticket img { width: 130px; height: 130px; }
.ticket p { margin: 0 0 6px; }
.ticket-event { font-size: 1rem; font-weight: 850; }
.ticket-label { color: var(--accent); font-weight: 800; }
.ticket-hint { color: var(--muted); font-size: .72rem; }
.ticket code { display: block; margin-top: 8px; font-size: 1.05rem; font-weight: 800; letter-spacing: .12em; }

@media (max-width: 960px) {
  .nav-bottom { position: absolute; top: 9px; right: 12px; display: flex; margin: 0; }
  .nav-bottom .nav-link-bottom { padding: 6px 8px; font-size: .75rem; }
  .admin-nav nav { display: flex; flex-wrap: wrap; margin-top: 14px; }
  .insight-grid { grid-template-columns: 1fr; }
  .category-head, .cand-row { grid-template-columns: 1fr; }
  .cand-thumb { display: none; }
}

@media print {
  .no-print { display: none !important; }
  body.report-page { background: #fff; }
  .report-sheet { width: 100%; margin: 0; padding: 0; box-shadow: none; }
  .ticket-sheet { width: 100%; margin: 0; padding: 0; gap: 8px; }
  @page { margin: 14mm; }
}

/* ===== participant layout fixes ===== */
/* A transform animation on the panel made the fixed action bar attach to the panel instead of the viewport,
   covering the last candidates. Fade only, and keep the bar in normal flow (sticky) so nothing can be hidden. */
@keyframes panel-in { from { opacity: .001; } to { opacity: 1; } }
.mobile-action-bar { position: sticky; bottom: 0; right: auto; left: auto; max-width: none; margin: 24px -18px 0; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
.participant-shell { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.vote-intro h1 { max-width: none; }

@media (min-width: 768px) {
  .participant-shell { width: min(100%, 760px); padding: 32px 32px 40px; }
  .mobile-action-bar { margin: 28px -32px 0; padding-left: 32px; padding-right: 32px; }
  .access-panel h1, .vote-panel h1, .complete-panel h1, .waiting-panel h1 { max-width: none; }
}
@media (min-width: 1100px) {
  .participant-shell { width: min(100%, 1040px); }
  .candidate-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .access-form { max-width: 520px; }
  .mini-results, .receipt-list { max-width: 620px; }
}
.participant-shell:has(.vote-panel:not([hidden])) { padding-bottom: 0; }
