/* 배치(레이아웃) 스타일. 색은 theme.css 에서 바꾸세요. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--primary); }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }

/* ---------- 머리글 ---------- */
.topbar { background: var(--primary); color: var(--primary-ink); padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 12px; max-width: var(--maxw); margin: 0 auto; color: inherit; text-decoration: none; }
.logo {
  width: 44px; height: 44px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; background: var(--primary-ink); color: var(--primary); font-weight: 800; font-size: 15px;
}
.logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-txt strong { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.brand-txt small { font-size: 13px; opacity: .85; }

.nav {
  position: sticky; top: 0; z-index: 10; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border-bottom: 1px solid var(--line); padding: 6px max(12px, calc((100% - var(--maxw)) / 2));
}
.nav::-webkit-scrollbar { display: none; }
.nav-item {
  flex: none; display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px;
}
.nav-item.is-active { background: var(--primary); color: var(--primary-ink); font-weight: 700; }

.status { max-width: var(--maxw); margin: 12px auto 0; padding: 10px 14px; border-radius: var(--radius-sm); background: #fff6e0; color: #6b4e00; font-size: 14px; }
@media (max-width: 792px) { .status { margin: 12px 16px 0; } }

/* ---------- 공통 ---------- */
.view { max-width: var(--maxw); margin: 0 auto; padding: 16px 16px 32px; }
.page-title { font-size: 22px; font-weight: 800; margin: 4px 0 14px; letter-spacing: -.02em; }
.section-title { font-size: 17px; font-weight: 700; margin: 26px 0 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.loading, .empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); line-height: 1.8; }
.notice-box { background: var(--primary-soft); color: var(--primary); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: rgba(0, 0, 0, .08); font-size: 12px; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 18px;
  border: 0; border-radius: 12px; background: var(--primary); color: var(--primary-ink); font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-ghost { background: var(--primary-soft); color: var(--primary); }
.btn-disabled { background: var(--line); color: var(--muted); cursor: default; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; }
.tag-ghost { background: #eef1f5; color: var(--muted); }
.tag-pin { background: #fff1d6; color: #8a5a00; }
.tag-new { background: var(--accent); color: #fff; }
.tag-src { background: #eaf6f0; color: #1f7a52; }
.dday { flex: none; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 800; white-space: nowrap; }
.dday.is-urgent { background: var(--danger); color: #fff; }

.seg { display: flex; background: #e7ebf1; border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg-btn { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.seg-btn.is-active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.chip {
  min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer;
}
.chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.chip.is-active .count { background: rgba(255, 255, 255, .25); }
.toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: 14px; color: var(--muted); cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
.search { width: 100%; min-height: var(--tap); padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; margin-bottom: 12px; background: var(--surface); }

/* ---------- 홈 ---------- */
.hero { margin: 4px 0 16px; }
.hero-hello { font-size: 16px; color: var(--muted); }
.soon { margin-bottom: 16px; border-color: color-mix(in srgb, var(--danger) 25%, var(--line)); }
.soon-list li + li { border-top: 1px solid var(--line); }
.soon-list a { display: flex; align-items: center; gap: 10px; min-height: var(--tap); color: inherit; text-decoration: none; }
.soon-title { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links { display: flex; flex-direction: column; gap: 10px; }
.link-btn {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); text-decoration: none;
}
.link-btn:hover { border-color: var(--primary); }
.link-ico { font-size: 24px; width: 32px; text-align: center; flex: none; }
.link-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.link-txt small { color: var(--muted); font-size: 13px; }
.link-arrow { font-size: 24px; color: var(--muted); }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .menu-grid { grid-template-columns: repeat(4, 1fr); } }
.menu-card {
  display: flex; flex-direction: column; gap: 2px; min-height: 104px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; box-shadow: var(--shadow);
}
.menu-card:hover { border-color: var(--primary); }
.menu-ico { font-size: 24px; margin-bottom: 4px; }
.menu-card strong { font-size: 15px; }
.menu-card small { color: var(--muted); font-size: 12px; }
.menu-card.is-soon { opacity: .55; box-shadow: none; border-style: dashed; }

/* ---------- 공지 ---------- */
.board-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 14px; font-weight: 700; text-decoration: none; }
.updated { margin-bottom: 10px; }
.notice-list, .survey-list, .pledge-list, .hotline-list, .ev-list { display: flex; flex-direction: column; gap: 10px; }
.notice h3, .survey h3, .partner h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.notice p, .survey p { color: #354153; font-size: 15px; }
.notice.is-pin { border-left: 5px solid var(--accent); }
.notice-foot, .survey-foot, .partner-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }

/* ---------- 일정 / 간트 ---------- */
.ev-group { margin-bottom: 14px; }
.ev-group summary { cursor: pointer; font-weight: 700; padding: 8px 2px; min-height: 40px; list-style-position: inside; }
.ev { display: flex; align-items: flex-start; gap: 10px; }
.ev-main { flex: 1; min-width: 0; }
.ev-title { display: block; font-size: 16px; }
.ev-date { font-size: 14px; color: var(--muted); margin-top: 2px; }
.ev-place { margin-top: 8px; font-size: 14px; }
.ev-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ev.is-urgent { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: color-mix(in srgb, var(--danger-soft) 60%, var(--surface)); }
.ev.is-past, .ev.is-cancel { opacity: .6; }
.ev.is-cancel .ev-title { text-decoration: line-through; }

.g-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.g-nav strong { font-size: 17px; min-width: 110px; text-align: center; }
.icon-btn { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 22px; cursor: pointer; }
.g-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.gantt { --label: 128px; position: relative; min-width: calc(var(--label) + var(--days) * 20px); }
@media (max-width: 699px) { .gantt { min-width: calc(var(--label) + var(--days) * 28px); } }
.gantt.g-week { min-width: calc(var(--label) + 7 * 52px); }
.g-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); min-height: 48px; }
.g-row:last-child { border-bottom: 0; }
.g-label {
  position: sticky; left: 0; z-index: 2; width: var(--label); flex: none; padding: 6px 10px; background: var(--surface);
  border-right: 1px solid var(--line); font-size: 13px; font-weight: 500; line-height: 1.35;
  overflow: hidden; display: flex; flex-direction: column; justify-content: center;
}
.g-label small { color: var(--muted); font-size: 11px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-track { position: relative; flex: 1; }
.g-head { min-height: 38px; background: #f8fafc; }
.g-head .g-label { background: #f8fafc; color: var(--muted); }
.g-days { display: grid; grid-template-columns: repeat(var(--days), 1fr); }
.g-days span { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.g-days small { font-size: 10px; }
.g-days .sun { color: var(--danger); }
.g-days .sat { color: #3b6fd0; }
.g-days .is-today { color: var(--primary-ink); background: var(--danger); border-radius: 8px; font-weight: 800; }
.g-body { position: relative; }
.g-bar {
  position: absolute; top: 10px; bottom: 10px; min-width: 10px; border: 0; border-radius: 8px; padding: 0 6px;
  background: var(--future); color: #fff; font-size: 11px; font-weight: 800; text-align: left; white-space: nowrap; overflow: hidden; cursor: pointer;
}
.g-bar.is-now { background: var(--ok); }
.g-bar.is-urgent { background: var(--danger); }
.g-bar.is-past, .g-bar.is-cancel { background: var(--past); }
.g-bar.is-sel { outline: 3px solid var(--text); outline-offset: 1px; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.g-today span { position: absolute; top: -2px; left: 4px; white-space: nowrap; font-size: 10px; font-weight: 800; color: var(--danger); background: var(--surface); padding: 0 3px; border-radius: 4px; }
.ev-detail { margin-top: 10px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.lg { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: -8px; background: var(--future); vertical-align: middle; }
.lg.is-now { background: var(--ok); } .lg.is-urgent { background: var(--danger); } .lg.is-past { background: var(--past); }

/* ---------- 공약 현황 ---------- */
.summary { margin-bottom: 14px; }
.summary-top { display: flex; justify-content: space-between; margin-bottom: 10px; }
.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line); gap: 2px; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.stack-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.stack-legend b { color: var(--text); }
.pledge h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.pl-num { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px; background: var(--primary); color: var(--primary-ink); font-size: 14px; }
.pl-item { padding: 12px 0 2px; }
.pl-item + .pl-item { border-top: 1px dashed var(--line); margin-top: 8px; }
.pl-sub { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.pl-no { color: var(--muted); font-weight: 500; margin-right: 6px; }
.pl-stage-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.stage {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 800;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); border: 1px solid color-mix(in srgb, var(--c) 35%, #fff);
}
.stage::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tag-org { background: #eef1f5; color: #445063; }
.tag-org.t1 { background: #e6edf7; color: #1f3a5f; } .tag-org.t2 { background: #e7f5ee; color: #1f7a52; }
.tag-org.t3 { background: #fdf0e3; color: #9a5b16; } .tag-org.t4 { background: #efe9f8; color: #5e3d99; }
.tag-org.t5 { background: #fde9ec; color: #a2304a; } .tag-org.t6 { background: #e6f5f6; color: #19777e; }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; }
.pl-memo { font-size: 14px; color: #354153; margin: 8px 0 2px; }

/* ---------- 설문 ---------- */
.survey.is-closed { opacity: .6; box-shadow: none; }

/* ---------- 제휴 ---------- */
.partner-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 620px) { .partner-grid { grid-template-columns: 1fr 1fr; } }
.partner-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.benefit { font-weight: 500; margin: 6px 0 8px; }
.partner-meta { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }

/* ---------- 핫라인 ---------- */
.person { display: flex; gap: 14px; align-items: flex-start; }
.avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 18px; }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.person-main .tags { margin: 0; }
.contact-text { font-size: 14px; color: var(--muted); }
.role { display: inline-block; font-size: 13px; font-weight: 700; color: var(--primary); margin-right: 2px; }
.phone-num { font-size: 16px; font-weight: 700; letter-spacing: .02em; margin-bottom: 8px; }
.phone-btns { display: flex; gap: 8px; }
.phone-btns .btn { flex: 1; max-width: 140px; }

/* ---------- 바닥글 · 오류 ---------- */
.footer { max-width: var(--maxw); margin: 0 auto; padding: 20px 16px 40px; text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.footer p + p { margin-top: 4px; }
.footer a { color: var(--muted); }
.fatal { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 32px 16px; }
.fatal .links { width: 100%; }
