/* 웹 버전 공용 스타일. 한 칼럼, 투표용지 폭. 관리단 PC 와 고령 구분소유자의 폰 둘 다에서 읽혀야 한다. */
:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --ink: #18211f;
  --muted: #5d6b67;
  --line: #d6ddda;
  --accent: #1d5c4f;
  --accent-ink: #ffffff;
  --accent-soft: #e2efeb;
  --ok: #1d6b47;
  --ok-bg: #e2f2e8;
  --err: #a63a2b;
  --err-bg: #f8e4e0;
  --warn: #7a5310;
  --warn-bg: #fbf1dc;
  --radius: 10px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111716; --card: #1a2321; --ink: #e5ece9; --muted: #9aaaa5; --line: #2d3a37;
    --accent: #6fc2ad; --accent-ink: #0f1a17; --accent-soft: #1c3530;
    --ok: #8fdcae; --ok-bg: #173527; --err: #f3a597; --err-bg: #3d1f1a; --warn: #f1cf87; --warn-bg: #3a2f17;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.6;
  padding: 24px max(16px, env(safe-area-inset-right)) 64px max(16px, env(safe-area-inset-left));
}
.wrap { max-width: 720px; margin: 0 auto; display: grid; gap: 16px; }
h1 { font-size: 1.55rem; line-height: 1.3; margin: 0; text-wrap: balance; }
h2 { font-size: 1.15rem; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.04rem; color: var(--ink); font-weight: 800; letter-spacing: -.01em;
  text-decoration: none; justify-self: start;
}
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; display: block; filter: drop-shadow(0 2px 6px rgba(15, 59, 51, .18));  border-radius: 8px; }
.brand-body { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 1.2; }
.brand-tag {
  font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); letter-spacing: .02em;
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; min-width: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.choice {
  text-align: left; font: inherit; color: inherit; background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 18px; cursor: pointer; display: grid; gap: 6px;
}
.choice:hover, .choice:focus-visible { border-color: var(--accent); outline: none; }
.choice b { font-size: 1.05rem; }

.btn {
  font: inherit; font-weight: 700; border-radius: 8px; padding: 12px 18px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.big { padding: 15px 22px; font-size: 1.05rem; width: 100%; }
/* 테스트 결제 표시 — 운영 결제 채널이 실결제로 바뀌기 전까지 결제 단추에 붙는다 */
.test-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #fff; color: #d6232a; font-size: .74rem; font-weight: 900; letter-spacing: .02em; vertical-align: middle; border: 1.5px solid #d6232a; }
.test-strong { color: #d6232a; font-weight: 900; }
/* 테스트 본인인증 — 문자가 오지 않으니 인증번호를 크게 보여 준다 */
.test-code { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 12px; padding: 12px 16px; border: 2px solid #d6232a; border-radius: 12px; background: #fff3f3; color: #d6232a; font-weight: 800; line-height: 1.35; }
.test-code b { font-size: 2.1rem; letter-spacing: .14em; font-weight: 900; font-variant-numeric: tabular-nums; }
.test-code span { font-size: .92rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .test-code { background: #3a1416; } :root:not([data-theme="light"]) .test-badge { background: #2a0f10; } }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label { font-weight: 600; font-size: .95rem; }
input[type="text"], input[type="number"], input[type="tel"], input[type="email"], input[type="datetime-local"], select, textarea {
  font: inherit; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink);
}
textarea { min-height: 90px; }
.field { display: grid; gap: 6px; }

/* 아코디언 질문지 */
.q { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.q-head {
  width: 100%; display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center;
  padding: 16px 18px; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.q-head[disabled] { cursor: default; opacity: .5; }
.q-no {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 700;
  border: 1.5px solid var(--line); color: var(--muted);
}
.q.done .q-no { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.q.open .q-no { border-color: var(--accent); color: var(--accent); }
.q-title { font-weight: 700; }
.q-answer { font-size: .88rem; color: var(--muted); text-align: right; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-body { padding: 0 18px 18px 60px; display: grid; gap: 12px; }
@media (max-width: 520px) { .q-body { padding-left: 18px; } .q-answer { display: none; } }
.req { color: var(--err); font-weight: 700; }

.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.err { background: var(--err-bg); color: var(--err); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.info { background: var(--accent-soft); color: var(--accent); }

.note { border-radius: 8px; padding: 12px 14px; font-size: .92rem; }
.note.info { background: var(--accent-soft); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.err { background: var(--err-bg); color: var(--err); }
.note.ok { background: var(--ok-bg); color: var(--ok); }

.agenda-row { display: grid; grid-template-columns: 56px 1fr; gap: 8px; align-items: start; border-top: 1px dashed var(--line); padding-top: 12px; }
.agenda-row:first-child { border-top: 0; padding-top: 0; }
.agenda-row .agenda-no { font-weight: 700; color: var(--muted); padding-top: 10px; font-size: .92rem; background: none; width: auto; height: auto; border-radius: 0; display: block; }
.agenda-fields { display: grid; gap: 8px; min-width: 0; }

.link-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.link-box code { font-size: .85rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; overflow-wrap: anywhere; }

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choices label {
  border: 1.5px solid var(--line); border-radius: 8px; padding: 13px 6px; text-align: center; cursor: pointer;
  font-weight: 700; user-select: none;
}
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choices label.yes:has(input:checked) { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.choices label.no:has(input:checked) { border-color: var(--err); color: var(--err); background: var(--err-bg); }
.choices label.abs:has(input:checked) { border-color: var(--muted); color: var(--muted); background: var(--bg); }

table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.consult-bar { position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.consult-bar .btn { box-shadow: 0 4px 14px rgba(0,0,0,.15); }
/* 대시보드 — 지금 할 일 · 단계 표시 */
.now-card { border: 2px solid var(--accent); }
.now-card h2 { margin: 0; }
.steps-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.steps-bar .step { font-size: .82rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.steps-bar .step.done { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.steps-bar .step.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.close-box { border-top: 1px solid var(--line); padding-top: 10px; }
.close-box summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.close-box[open] { display: grid; gap: 8px; }
/* 접어 두는 칸 — 제목 줄만 보이고 누르면 펼친다 */
details.fold > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold > summary::after { content: '펼치기 ▾'; font-size: .82rem; color: var(--accent); font-weight: 700; }
details.fold[open] > summary::after { content: '접기 ▴'; }
details.fold:not([open]) { gap: 0; }
/* 안건 목록 — 누르면 그 자리에서 결과가 펼쳐진다 */
.agenda-list { display: grid; gap: 8px; }
details.agenda { border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
details.agenda > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 14px; }
details.agenda > summary::-webkit-details-marker { display: none; }
details.agenda[open] > summary { border-bottom: 1px solid var(--line); }
.agenda-no { font-weight: 800; color: var(--accent-ink); background: var(--accent); font-size: .85rem; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
a.btn { text-decoration: none; text-align: center; }
.bank-ask { display: grid; gap: 8px; justify-items: start; border-top: 1px solid var(--line); padding-top: 12px; }
.agenda-title { font-weight: 700; min-width: 0; }
.agenda-pills { justify-self: end; }
.agenda-meta { grid-column: 2 / 3; font-size: .84rem; color: var(--muted); }
.agenda-body { padding: 12px 14px; display: grid; gap: 8px; }
.verdict-line { margin: 0; font-weight: 800; }
.named-box { border-top: 1px dashed var(--line); padding-top: 6px; }
.verdict-line.ok { color: var(--ok); }
.verdict-line.err { color: var(--err); }
/* "잘 모르겠어요" 상담 — 카카오톡으로 이어지므로 카카오 노랑. 다크 모드에서도 같은 색이라 글자는 늘 어둡게. */
.consult-btn { background: #fee500; border-color: #fee500; color: #191600; font-weight: 800; font-size: 1.08rem; padding: 16px 24px; border-radius: 999px; }
.consult-choice { background: #fee500; border-color: #fee500; color: #191600; }
.consult-choice:hover, .consult-choice:focus-visible { border-color: #191600; }
.consult-choice small { font-weight: 700; opacity: .75; }
.consult-choice b { font-size: 1.3rem; }
.consult-choice .consult-go { justify-self: start; background: #191600; color: #fee500; font-weight: 800; padding: 10px 16px; border-radius: 10px; }
/* ── 공통 틀 (리디자인) ─────────────────────────────────────────────
   모든 웹 화면이 같은 뼈대를 쓴다: 상단 막대(브랜드 · 맥락 · 보조 링크) → 제목 → 상태 띠 → 본문 → 도구.
   주최자 PC 와 고령 투표자의 폰 둘 다에서 한눈에 "지금 뭘 하면 되는지" 가 보여야 한다. */
.wrap.wide { max-width: 880px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topbar .links { display: flex; gap: 14px; font-size: .9rem; }
.topbar .links a { color: var(--muted); text-decoration: none; }
.topbar .links a:hover { color: var(--ink); }
.page-head { display: grid; gap: 6px; }
.page-head .badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* 단계 표시 — 결제 → 전자투표 → 현장·서면 → 결과 (대시보드), 본인인증 → 투표 → 완료 (투표 화면) */
.stepper { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; counter-reset: st; }
.stepper .st { position: relative; text-align: center; font-size: .82rem; font-weight: 700; color: var(--muted); padding-top: 30px; }
.stepper .st::before { counter-increment: st; content: counter(st); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line); font-size: .78rem; z-index: 1; }
.stepper .st::after { content: ''; position: absolute; top: 11px; left: 50%; width: 100%; height: 2px; background: var(--line); }
.stepper .st:last-child::after { display: none; }
.stepper .st.done { color: var(--ok); }
.stepper .st.done::before { content: '✓'; background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper .st.done::after { background: var(--ok); }
.stepper .st.on { color: var(--accent); }
.stepper .st.on::before { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* 상태 띠 — 숫자 세 개와 지금 할 일 버튼 하나 */
.status { border: 2px solid var(--accent); display: grid; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: var(--bg); border-radius: 10px; padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.kpi b { font-size: 1.35rem; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .8rem; color: var(--muted); }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi:first-child { grid-column: 1 / -1; } }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cta-row .btn.big { width: auto; }
.btn.subtle { background: transparent; border-color: transparent; color: var(--muted); padding: 8px 10px; }
.btn.subtle:hover { color: var(--ink); }

/* 진행 막대 — 안건별 투표율 */
.bar { height: 8px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.agenda-meta .bar { width: 100%; margin-top: 4px; }
details.agenda > summary { grid-template-columns: auto 1fr auto; }
.agenda-meta { grid-column: 2 / 3; }

/* 도구 모음 — 접힌 칸들 앞의 작은 제목 */
.tools-head { font-size: .8rem; font-weight: 800; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; margin: 6px 0 -6px; }
details.fold > summary .fold-state { font-size: .84rem; color: var(--muted); }

/* 투표 화면 — 안건 카드와 하단 고정 제출 막대 */
.ballot-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 10px; background: var(--card); }
.ballot-item .head { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.ballot-item .head b { font-size: 1.02rem; }
.ballot-item.voted { opacity: .75; }
.sticky-bar { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.sticky-bar .btn { white-space: nowrap; }
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; }
.receipt { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; display: grid; gap: 4px; }

/* 질문지 — 위쪽 진행 막대 */
.wizard-progress { display: grid; gap: 6px; }
.wizard-progress .line { display: flex; justify-content: space-between; font-size: .84rem; color: var(--muted); font-weight: 700; }
.wizard-progress .bar i { transition: width .25s ease; }
.foot { color: var(--muted); font-size: .84rem; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.foot a { color: var(--muted); }
[hidden] { display: none !important; }
