:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #1f1c1a;
  --muted: #6c655f;
  --line: #e8e2db;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --chip: #f2ede7;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151312;
    --surface: #1f1c1a;
    --text: #efeae5;
    --muted: #a8a09a;
    --line: #36312d;
    --accent: #fb8a4c;
    --accent-ink: #1a0f08;
    --ok: #5fd08b;
    --warn: #f3b35d;
    --bad: #f87171;
    --chip: #2a2623;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.6;
}
a { color: var(--accent); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.ko { font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; word-break: keep-all; }

header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
nav.main { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
nav.main a { color: var(--muted); text-decoration: none; }
nav.main a:hover, nav.main a[aria-current="page"] { color: var(--text); }

main { padding: 24px 0 48px; }
h1 { font-size: 28px; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 32px 0 10px; }
h3 { font-size: 16px; margin: 18px 0 6px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* search + filters */
.search { display: block; width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); resize: vertical; min-height: 52px; }
.search:focus { outline: none; border-color: var(--accent); }
.filters { margin: 14px 0 6px; display: grid; gap: 10px; }
.fgroup { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fgroup > .flabel { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); min-width: 74px; }
.chip { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--chip); color: var(--text); padding: 6px 12px; border-radius: 999px; cursor: pointer; min-height: 34px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
select.chip { padding-right: 8px; }
.status { font-size: 14px; color: var(--muted); margin: 10px 0; min-height: 22px; }
.status strong { color: var(--text); }
.howto { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.howto summary { cursor: pointer; color: var(--accent); }
.howto ul { margin-top: 6px; }
.linkbtn { font: inherit; font-size: 14px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }

/* food cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.food { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); text-decoration: none; height: 100%; }
.food:hover { border-color: var(--accent); }
.food .name { font-size: 22px; font-weight: 700; line-height: 1.2; }
.food .rr { font-size: 14px; color: var(--muted); }
.food .en { font-weight: 600; margin: 2px 0 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--text); white-space: nowrap; }
.tag.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); font-weight: 600; }
.tag.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); font-weight: 600; }
.tag.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); font-weight: 600; }

.spice { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 4px; }
.spice i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--bad); display: inline-block; }
.spice.s1 i:nth-child(-n+1), .spice.s2 i:nth-child(-n+2), .spice.s3 i { background: var(--bad); }
.spice-row { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 6px; color: var(--muted); }

/* food page */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.answer { color: var(--text); font-size: 17px; }
.hero-ko { display: block; font-size: 48px; font-weight: 800; line-height: 1.1; margin: 4px 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 18px 0; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.fact h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; }
.fact p { margin: 0; }
ul.plain { margin: 6px 0; padding-left: 20px; }
.ask { background: var(--surface); border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; }
.ask p { margin: 6px 0; }
.ask .ko { font-size: 20px; font-weight: 600; }
.ask .tr { font-size: 13px; color: var(--muted); }

.notice { font-size: 13px; color: var(--muted); border-left: 3px solid var(--warn); padding: 8px 12px; background: var(--surface); border-radius: 0 8px 8px 0; margin: 20px 0; }

/* card page */
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 16px; }
.opt { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.opt input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.btn { font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.diet-card { background: #fff; color: #111; border: 3px solid #111; border-radius: 16px; padding: 22px; }
.diet-card .hello { font-size: 22px; font-weight: 700; margin: 0 0 10px; }
.diet-card .line { margin: 0 0 12px; }
.diet-card .line .ko { font-size: 22px; font-weight: 700; line-height: 1.4; display: block; }
.diet-card .line .tr { font-size: 13px; color: #555; }
.diet-card .empty { color: #666; }
.diet-card .foot { font-size: 12px; color: #555; border-top: 1px solid #ccc; padding-top: 8px; margin-top: 14px; }
body.staff-mode header.site, body.staff-mode footer.site, body.staff-mode .no-staff { display: none; }
body.staff-mode main { padding: 8px 0; }
body.staff-mode .diet-card .line .ko { font-size: 30px; }
body.staff-mode .diet-card .line .tr { display: none; }
.exit-staff { display: none; }
body.staff-mode .exit-staff { display: inline-block; margin-bottom: 10px; }

table.phr { width: 100%; border-collapse: collapse; font-size: 14px; }
table.phr td, table.phr th { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }

footer.site { border-top: 1px solid var(--line); padding: 20px 0 32px; font-size: 13px; color: var(--muted); }
footer.site a { color: var(--muted); }

@media (max-width: 560px) {
  h1 { font-size: 24px; }
  .hero-ko { font-size: 40px; }
  .fgroup > .flabel { min-width: 100%; }
}
@media print {
  header.site, footer.site, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .diet-card { border-width: 2px; }
  .diet-card .line .ko { font-size: 24px; }
}
