:root {
  --bg: #f3efe6;
  --ink: #1c1915;
  --muted: #5e574c;
  --line: #ddd4c4;
  --card: #fffdf8;
  --accent: #0f6e56;
  --warn: #8a3b12;
  --warn-bg: #f8efe6;
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
  color-scheme: light;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Apple SD Gothic Neo", "Noto Sans KR", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
button, input { font: inherit; color: inherit; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.top, .toolbar, .board, .foot { padding-left: 20px; padding-right: 20px; }
.top { padding-top: 28px; }
.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 12px;
  color: var(--accent);
}
h1 { margin: 0; font-size: 40px; font-weight: 650; letter-spacing: -0.03em; }
.top-row { display: flex; justify-content: space-between; gap: 16px; align-items: end; }
.device-note {
  margin: 0;
  max-width: 280px;
  text-align: right;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 13px;
  color: var(--muted);
}
.lede { max-width: 68ch; color: var(--muted); }
.banner {
  margin: 0;
  padding: 10px 12px;
  background: var(--warn-bg);
  border-left: 4px solid var(--warn);
  color: #4d2a16;
}

.toolbar { display: grid; gap: 10px; margin: 8px 0 14px; }
.search input {
  width: min(100%, 420px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 14px;
}
.chips button[aria-pressed="true"] {
  background: var(--ink);
  color: #f7f3ea;
  border-color: var(--ink);
}
.count {
  margin: 0 0 8px;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 13px;
  color: var(--muted);
}

.grid { display: grid; gap: 12px; }
.card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
}
.card-hit {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 14px 14px 12px;
  cursor: pointer;
}
.card-hit:focus-visible, .chips button:focus-visible, .search input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.card.is-open { border-color: var(--accent); }
.kicker {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 12px;
  color: var(--muted);
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.card h2 { margin: 6px 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.summary { margin: 0; color: var(--muted); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #efeae0;
}

.detail, .card-detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.card-detail { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.detail h2, .card-detail h2 { margin: 0 0 4px; font-size: 28px; }
.detail h3, .card-detail h3 {
  margin: 16px 0 6px;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
dl { display: grid; grid-template-columns: 7.5em 1fr; gap: 4px 10px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }
.how p { margin: 0 0 8px; }
.cautions { margin: 0; padding-left: 18px; }
.cautions li { margin: 0 0 6px; }
.empty { color: var(--muted); }
.foot {
  margin-top: 28px;
  padding-bottom: 28px;
  color: var(--muted);
  font-size: 14px;
}
.thumb { display: block; margin: -14px -14px 10px; background: #f6f1e7; border-bottom: 1px solid var(--line); }
.thumb svg, .figure svg { width: 100%; height: auto; display: block; }
.thumb svg { height: 86px; }
.figure { margin: 0 0 8px; }
.figure p, .sheet-note { margin: 6px 0 0; font-family: "Avenir Next", "Segoe UI", sans-serif; font-size: 12px; color: var(--muted); }
.sheets { display: grid; gap: 8px; }
.sheet {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: #f6f1e7;
}
.sheet small { display: block; color: var(--muted); font-family: "Avenir Next", "Segoe UI", sans-serif; }
.sheet span:last-child { font-family: "Avenir Next", "Segoe UI", sans-serif; font-size: 13px; color: var(--accent); }


body[data-device="phone"] .top-row { display: block; }
body[data-device="phone"] h1 { font-size: 32px; }
body[data-device="phone"] .device-note { text-align: left; margin-top: 8px; max-width: none; }
body[data-device="phone"] .detail { display: none; }
body[data-device="phone"] .grid { grid-template-columns: 1fr; }
body[data-device="phone"] .card-detail { display: none; }
body[data-device="phone"] .card.is-open .card-detail { display: block; }
body[data-device="phone"] .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
body[data-device="phone"] .chips button { flex: 0 0 auto; }

body[data-device="tablet"] .board { display: flex; flex-direction: column; gap: 14px; }
body[data-device="tablet"] .grid { grid-template-columns: 1fr 1fr; }
body[data-device="tablet"] .card-detail { display: none; }
body[data-device="tablet"] .detail { position: static; }

body[data-device="desktop"] .board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: 18px;
  align-items: start;
}
body[data-device="desktop"] .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
body[data-device="desktop"] .card-detail { display: none; }
body[data-device="desktop"] .detail {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
}
