:root {
  --text: #4B3E36;
  --muted: #6E5F54;
  --line: #E2D8CE;
  --soft: #F5EFE9;
  --card: #FFFFFF;
  --warn-bg: #FBEBD2;
  --warn-fg: #8A5A14;
  --warn-line: #E3C48F;
  --k-bg: #3E3430;
  --k-fg: #F6EEE8;
  --k-muted: #CBBDB1;
  --k-box: #54473F;
  --k-line: #6E5F54;
  --radius: 14px;
}
body[data-season="winter"] { --bg: #F2ECE6; --accent: #8A6F5C; --k-btn: #DCCFC4; }
body[data-season="summer"] { --bg: #F8E9DD; --accent: #A55B35; --k-btn: #EBB596; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 16px; line-height: 1.5; transition: background .25s;
}
body.kitchen { background: var(--k-bg); color: var(--k-fg); }
main { max-width: 520px; margin: 0 auto; padding: 16px 18px 40px; display: flex; flex-direction: column; gap: 14px; }
h1 { font-size: 24px; font-weight: 700; margin: 4px 0 0; }
h2 { font-size: 18px; font-weight: 700; margin: 10px 0 0; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand b { font-size: 20px; }
.badge { font-size: 11px; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 1px 8px; background: var(--card); }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: none; background: transparent; border-radius: 999px; padding: 0 14px; height: 34px; font-size: 14px; color: var(--muted); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; }

/* cards & choices */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.card.list { padding: 0; gap: 0; overflow: hidden; }
.q { font-size: 16px; font-weight: 500; }
.choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.choice { min-height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 15px; padding: 6px 8px; }
.choice[aria-pressed="true"] { border: 2px solid var(--accent); color: var(--accent); font-weight: 500; }
.choice .sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper button { width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 22px; line-height: 1; }
.stepper .val { font-size: 28px; font-weight: 700; color: var(--accent); text-align: center; flex: 1; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--soft); border-radius: 10px; padding: 6px 10px; font-size: 14px; flex-wrap: wrap; }
.field input[type="time"] { border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; background: var(--card); min-height: 36px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.daychips { display: flex; flex-wrap: wrap; gap: 6px; }
.daychips button { width: 38px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; }
.daychips button[aria-pressed="true"] { border: 2px solid var(--accent); color: var(--accent); font-weight: 500; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 12px; border: none; background: var(--accent); color: #fff; font-size: 17px; font-weight: 500; text-decoration: none; padding: 0 16px; }
.btn.outline { background: var(--card); color: var(--accent); border: 1.5px solid var(--accent); }
.btn.small { min-height: 40px; font-size: 14px; }
.btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.note { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-fg); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.note b { font-size: 15px; }
.note .btn { align-self: flex-start; background: var(--card); color: var(--warn-fg); border: 1px solid var(--warn-fg); min-height: 40px; font-size: 14px; }
.info { background: var(--card); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 14px; font-size: 14px; }

/* timeline */
.summary { font-size: 14px; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.daylabel { font-size: 14px; font-weight: 500; color: var(--muted); margin-top: 6px; }
.row { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.row:last-child { border-bottom: none; }
.row .time { font-size: 16px; font-weight: 700; color: var(--accent); min-width: 48px; }
.row .body { flex: 1; min-width: 0; }
.row .title { font-size: 16px; font-weight: 500; }
.row .detail { font-size: 14px; color: var(--muted); }
.row svg { flex: none; margin-top: 3px; }
.row.wait { background: var(--soft); padding: 9px 14px; font-size: 14px; color: var(--muted); }
.row.wait .time { font-size: 13px; font-weight: 400; color: var(--muted); }
.row.conflict { background: var(--warn-bg); }
.row.conflict .time, .row.conflict .title, .row.conflict .detail { color: var(--warn-fg); }
.row.eat { background: var(--soft); }
details.step { border-bottom: 1px solid var(--line); }
details.step:last-child { border-bottom: none; }
details.step > summary { list-style: none; cursor: pointer; }
details.step > summary::-webkit-details-marker { display: none; }
details.step > summary .row { border-bottom: none; }
details.step .more { padding: 0 14px 12px 14px; padding-inline-start: 74px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
details.step .more b { font-weight: 500; }
.whyhint { font-size: 12px; color: var(--accent); }
details[open] .whyhint { display: none; }
.tune { display: flex; flex-direction: column; gap: 10px; }
.tune .stepper .val { font-size: 20px; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { font-size: 12px; font-weight: 400; color: var(--muted); text-align: right; padding: 8px 14px; border-bottom: 1px solid var(--line); }
td { padding: 10px 14px; border-bottom: 1px solid var(--soft); }
td.num, th.num { text-align: left; }
td.g { font-weight: 700; color: var(--accent); }
tr.cur td { background: var(--soft); }
.feed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.feed div { background: var(--soft); border-radius: 10px; padding: 8px; }
.feed b { display: block; font-size: 22px; color: var(--accent); }
.feed span { font-size: 12px; color: var(--muted); }

/* help pages */
.prose { display: flex; flex-direction: column; gap: 10px; }
.prose ul { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }
body[data-season="winter"] [data-season="summer"], body[data-season="summer"] [data-season="winter"] { display: none; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { font-size: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; text-decoration: none; color: var(--text); }

footer { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; font-size: 14px; color: var(--muted); text-align: center; }

/* kitchen mode */
.k { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; gap: 16px; }
.k .back { color: var(--k-muted); }
.k .seg { background: transparent; border-color: var(--k-line); }
.k .seg button { color: var(--k-muted); }
.k .seg button[aria-pressed="true"] { background: var(--k-btn); color: var(--k-bg); }
.k .meta { font-size: 15px; color: var(--k-muted); }
.k .bar { height: 6px; background: var(--k-box); border-radius: 999px; overflow: hidden; }
.k .bar div { height: 6px; background: var(--k-btn); }
.k h1 { font-size: 34px; line-height: 1.2; }
.k .detail { font-size: 20px; line-height: 1.5; }
.k .box { background: var(--k-box); border-radius: var(--radius); padding: 14px 16px; font-size: 17px; }
.k .box small { display: block; font-size: 13px; color: var(--k-muted); }
.k .bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.k .next { font-size: 15px; color: var(--k-muted); }
.k .done { min-height: 72px; border-radius: 16px; border: none; background: var(--k-btn); color: var(--k-bg); font-size: 22px; font-weight: 700; }
.k .ghost { min-height: 52px; border-radius: 16px; border: 1.5px solid var(--k-line); background: transparent; color: var(--k-fg); font-size: 17px; font-weight: 500; }
.k .row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.k .conflict { color: #F2C98A; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }

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