:root {
  /* 미색 바탕에 로고의 녹색(#828b70)과 미색(#fcf2e9)을 맞춘 색 */
  --bg: #fffdf6;
  --surface: #ffffff;
  --band: #f0f1e6;
  --ink: #23271c;
  --muted: #696e5c;
  --line: #e7e6d8;
  --accent: #5c6748;
  --accent-ink: #ffffff;
  --accent-soft: #eaeddd;
  --bright: #cfd6ba;
  --bright-ink: #353d26;
  --warn: #b4530a;
  --warn-soft: #fff1c9;
  --mixed: #6b6a55;
  --mixed-soft: #f3f1e2;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a12;
    --surface: #1c2419;
    --band: #1a2416;
    --ink: #edf2e6;
    --muted: #a3ad9a;
    --line: #2d3828;
    --accent: #b9c3a0;
    --accent-ink: #1a1f12;
    --accent-soft: #24331c;
    --bright: #aab391;
    --bright-ink: #1a1f12;
    --warn: #f5b96b;
    --warn-soft: #3a2c12;
    --mixed: #b5b39c;
    --mixed-soft: #2a2b20;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: block; }
.tabs { display: flex; gap: 4px; }
.tab { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.tab[aria-pressed="true"] { color: var(--bright-ink); background: var(--accent-soft); }
@media (prefers-color-scheme: dark) { .tab[aria-pressed="true"] { color: var(--ink); } }
.count { color: var(--accent); font-variant-numeric: tabular-nums; }

.hero { padding: 36px 0 20px; }
.hero h1 { color: var(--bright-ink); }
@media (prefers-color-scheme: dark) { .hero h1 { color: var(--ink); } }
.hero h1 { margin: 0 0 6px; font-size: clamp(22px, 4.6vw, 30px); line-height: 1.3; text-wrap: balance; }
.lede { margin: 0 0 18px; color: var(--muted); }
.search input {
  width: 100%; height: 52px; padding: 0 18px; font: inherit;
  color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--bright); border-radius: 14px; outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: thin; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 18px; cursor: pointer; white-space: nowrap;
}
.chip small { color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--bright); border-color: var(--bright); color: var(--bright-ink); font-weight: 700; }
.chip[aria-pressed="true"] small { color: inherit; opacity: .8; }
.selects { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
select {
  height: 36px; padding: 0 10px; font: inherit; font-size: 14px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.link { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 6px 4px; }

.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.result-bar p { margin: 0; font-weight: 700; }
.result-bar p span { color: var(--accent); font-variant-numeric: tabular-nums; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.card:hover { border-color: var(--accent); }
.card-org { grid-column: 1; margin: 0; font-size: 14px; color: var(--muted); }
.card-title { grid-column: 1; margin: 0; font-size: 17px; line-height: 1.4; }
.card-open { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; }
.card-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-open:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-meta { grid-column: 1; margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.card-tags { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.card-side { grid-column: 2; grid-row: 1 / span 4; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.tag { font-size: 12.5px; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 600; white-space: nowrap; }
.tag.mixed { background: var(--mixed-soft); color: var(--mixed); }
.tag.plain { background: var(--bg); color: var(--muted); }
.tag.new { background: var(--warn-soft); color: var(--warn); }
.dday { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dday.soon { color: var(--warn); }
.save {
  position: relative; z-index: 1; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  width: 36px; height: 36px; border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer;
}
.save[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }

.guide { margin-top: 56px; }
.guide h2 { font-size: 19px; margin: 0 0 12px; }
.guide dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.guide dl > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.guide dt { font-weight: 700; margin-bottom: 4px; }
.guide dd { margin: 0; font-size: 14.5px; color: var(--muted); }
.pre { padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pre a { font-weight: 700; color: var(--ink); text-decoration: none; }
.pre span { display: block; font-size: 14px; color: var(--muted); }

.foot { margin-top: 40px; padding: 24px 0 40px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.foot p { margin: 0 0 6px; }

dialog {
  width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink);
}
dialog::backdrop { background: rgb(0 0 0 / .45); }
#detail-body { padding: 22px 24px 0; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-head p { margin: 0; color: var(--muted); font-size: 14px; }
.detail-head h2 { margin: 2px 0 10px; font-size: 20px; line-height: 1.4; }
.close { border: 0; background: var(--bg); color: var(--ink); width: 36px; height: 36px; border-radius: 8px; font-size: 20px; cursor: pointer; flex: none; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 16px; margin: 14px 0 18px; padding: 14px 16px; background: var(--bg); border-radius: 10px; }
.facts div { min-width: 0; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-size: 14.5px; }
.detail-body h3 { margin: 18px 0 6px; font-size: 15px; }
.detail-text { margin: 0; white-space: pre-wrap; font-size: 14.5px; color: var(--ink); }
.note { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 18px; margin-top: 16px; background: var(--surface); border-top: 1px solid var(--line); }
.btn { flex: 1 1 160px; display: inline-flex; justify-content: center; align-items: center; height: 46px; padding: 0 16px; border-radius: 10px; font-weight: 700; text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

@media (max-width: 560px) {
  .hero { padding-top: 24px; }
  .card { padding: 14px; }
  #detail-body { padding: 16px 16px 0; }
}
