/* 「예산 회의」 공통 스타일. 판 도안(recipe/board.html)의 색을 그대로 씀 */
:root {
  color-scheme: light;
  --paper: #fbf8f1;
  --paper-2: #f4efe3;
  --ink: #1b1f2a;
  --muted: #5d6575;
  --line: #e2d9c6;
  --main: #1d5a8c;
  --main-2: #154a75;
  --main-soft: #e6eef6;
  --acc: #d9771f;
  --acc-soft: #fbeedd;
  --red: #c0392b;
  --red-soft: #f8e4e1;
  --green: #27ae60;
  --green-soft: #e3f4e9;
  --gold: #e2ad1c;
  --slot: #e3e3e3;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(27, 31, 42, .06), 0 6px 18px rgba(27, 31, 42, .06);
  --r: 14px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--main); }
button { font: inherit; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 800; }
h2 { font-size: clamp(21px, 3vw, 27px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 .8em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* ── 머리 ── */
.top {
  position: sticky; top: 0; z-index: 40; background: rgba(251, 248, 241, .94);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 14px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 19px; flex: none; }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px;
  padding: 7px 11px; border-radius: 999px;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--main); color: #fff; }
@media (max-width: 760px) {
  .top .wrap { flex-wrap: wrap; gap: 0; padding-top: 8px; }
  .nav { margin: 4px -16px 0; padding: 0 12px 8px; width: calc(100% + 32px); }
  .nav a { font-size: 14px; padding: 6px 10px; }
}

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--main);
  background: var(--main); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer;
  text-decoration: none; transition: transform .08s ease, background .15s;
}
.btn:hover { background: var(--main-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .chipbtn:focus-visible, .opt:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.btn.ghost { background: #fff; color: var(--main); }
.btn.ghost:hover { background: var(--main-soft); }
.btn.acc { background: var(--acc); border-color: var(--acc); }
.btn.acc:hover { background: #c1661a; }
.btn.red { background: var(--red); border-color: var(--red); }
.btn.green { background: var(--green); border-color: var(--green); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14.5px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── 상자·카드 ── */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.note {
  background: var(--main-soft); border-left: 4px solid var(--main); border-radius: 10px;
  padding: 12px 14px; font-size: 15px;
}
.note.acc { background: var(--acc-soft); border-color: var(--acc); }
.note.red { background: var(--red-soft); border-color: var(--red); }
.note.green { background: var(--green-soft); border-color: var(--green); }
.cap { font-size: 13px; color: var(--muted); text-align: center; margin-top: 6px; }
.tag {
  display: inline-block; font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--paper-2); color: var(--muted); vertical-align: 1px;
}
.tag.goal { background: #f3e8fa; color: #7a3a96; }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.blue { background: var(--main-soft); color: var(--main); }
.tag.green { background: var(--green-soft); color: #1e8a4c; }
.tag.acc { background: var(--acc-soft); color: #b0590f; }
ul.dots { margin: 0; padding-left: 1.1em; }
ul.dots li { margin: .2em 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* 단계 번호 */
.sn { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 50%; background: var(--ink); color: #fff; font-style: normal; font-size: .82em; font-weight: 800; margin-right: 5px; vertical-align: .05em; line-height: 1; }
.f.main .sn { background: var(--acc); }

/* 칩 */
.chip { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--main); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); vertical-align: -2px; }
.chip.red { background: var(--red); }
.chip.gold { background: var(--gold); }
.chip.gray { background: #9aa0a8; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; }
.chip-fly {
  position: fixed; z-index: 90; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: var(--main); box-shadow: 0 2px 4px rgba(0,0,0,.25), inset 0 -2px 0 rgba(0,0,0,.2); pointer-events: none;
}
.chip-fly.red { background: var(--red); }

/* ── 게임 카드 ── */
.gcard {
  --c: var(--main); background: #fff; border: 1.5px solid var(--c); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; min-width: 0;
}
.gcard .hd {
  background: var(--c); color: #fff; font-weight: 700; font-size: 13px; padding: 5px 10px;
  display: flex; justify-content: space-between; gap: 6px; align-items: center;
}
.gcard .bd { padding: 9px 11px 11px; font-size: 14.5px; line-height: 1.5; flex: 1; }
.gcard .bd b.t { display: block; font-size: 16.5px; margin-bottom: 2px; }
.gcard .back { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 13.5px; }
.gcard.sel { box-shadow: 0 0 0 3px var(--acc); }
.gcard.dim { opacity: .5; }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .cardgrid { grid-template-columns: 1fr 1fr; gap: 9px; } .gcard .bd { font-size: 13.5px; padding: 8px 9px; } .gcard .bd b.t { font-size: 15px; } }

/* ── 판 ── */
.board-wrap { position: relative; width: 100%; max-width: 620px; margin: 0 auto; }
.board-wrap svg { width: 100%; height: auto; display: block; }
.board-wrap svg text { font-family: var(--font); }
.cal { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; }
.cal .st {
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 4px; text-align: center;
  font-size: 13px; line-height: 1.3; color: var(--muted); position: relative;
}
.cal .st b { display: block; color: var(--ink); font-size: 13.5px; }
.cal .st.rd { background: var(--acc-soft); border-color: #f0cfa6; }
.cal .st.now { background: var(--acc); border-color: var(--acc); color: #fff; }
.cal .st.now b { color: #fff; }
.cal .st.done { opacity: .6; }
@media (max-width: 520px) { .cal { grid-template-columns: repeat(3, 1fr); } }

/* 결산 비교 */
.cmp { display: grid; gap: 7px; }
.cmp .row { display: grid; grid-template-columns: 150px 1fr 92px; gap: 8px; align-items: center; font-size: 14px; }
.cmp .lab { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp .lab i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.cmp .track { position: relative; height: 22px; background: var(--paper-2); border-radius: 6px; }
.cmp .bar-m { position: absolute; left: 0; top: 3px; bottom: 3px; background: #b9bcc2; border-radius: 4px 0 0 4px; }
.cmp .bar-d { position: absolute; top: 3px; bottom: 3px; border-radius: 0 4px 4px 0; opacity: .92; }
.cmp .bar-a {
  position: absolute; left: 0; top: 0; bottom: 0; border: 2.5px dashed var(--ink); border-radius: 6px;
  background: repeating-linear-gradient(135deg, rgba(27,31,42,.07) 0 4px, transparent 4px 8px); transition: opacity .3s;
}
.cmp.hide-a .bar-a { opacity: 0; }
.cmp .val { font-size: 13px; text-align: right; color: var(--muted); white-space: nowrap; }
.cmp .val b { color: var(--ink); }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.cmp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cmp-legend i { display: inline-block; width: 22px; height: 12px; border-radius: 3px; }
@media (max-width: 480px) { .cmp .row { grid-template-columns: 62px 1fr 74px; gap: 6px; font-size: 13px; } .cmp .val { font-size: 12px; } }

/* ── 바닥 ── */
.foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 22px 0 36px; color: var(--muted); font-size: 13.5px; }
.foot a { color: var(--muted); }

/* ── 첫 화면 ── */
.hero { padding: 36px 0 18px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 28px; align-items: center; }
.hero .kicker { color: var(--acc); font-weight: 800; letter-spacing: .02em; margin-bottom: 6px; }
.hero h1 span { color: var(--main); }
.hero .lead { font-size: 18px; color: #343a48; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 20px; }
.hero .facts span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 14.5px; font-weight: 600; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 22px; } .hero .lead { font-size: 16.5px; } }
.problems { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.problems .pb { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.problems .pb .n {
  width: 30px; height: 30px; border-radius: 50%; background: var(--acc); color: #fff; font-weight: 800;
  display: grid; place-items: center; margin-bottom: 8px;
}
.problems .pb h3 { font-size: 16.5px; margin-bottom: 4px; }
.problems .pb p { font-size: 14.5px; color: #3c4252; margin: 0; }
@media (max-width: 960px) { .problems { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .problems { grid-template-columns: 1fr; } }
.flow { display: flex; flex-wrap: wrap; gap: 6px; }
.flow .f { flex: 1 1 120px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.flow .f b { display: block; font-size: 15px; }
.flow .f span { font-size: 13px; color: var(--muted); }
.flow .f.main { background: var(--acc-soft); border-color: #f0cfa6; }
.section { margin-top: 38px; }
.go { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.go a { text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); display: block; transition: transform .12s; }
.go a:hover { transform: translateY(-2px); }
.go a b { display: block; font-size: 19px; margin-bottom: 4px; color: var(--main); }
.go a span { font-size: 14.5px; color: var(--muted); }
@media (max-width: 760px) { .go { grid-template-columns: 1fr; } }

/* 표 */
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; background: #fff; }
table.t th, table.t td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
table.t th { background: var(--paper-2); font-weight: 700; }
table.t td.r, table.t th.r { text-align: right; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }

/* 탭 */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 16px; }
.tabs button {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 700;
  font-size: 14.5px; color: var(--muted); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 모달 */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 24, 34, .45); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; max-width: 520px; width: 100%; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: 90vh; overflow: auto; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
