:root {
  --bg: #fffaf5;
  --card: #ffffff;
  --ink: #1f1a17;
  --muted: #6b625b;
  --line: #eadfd5;
  --accent: #c2410c;
  --accent-soft: #fff1e6;
  --green: #15803d;
  --green-soft: #e8f6ec;
  --red: #b91c1c;
  --red-soft: #fdecec;
  --radius: 16px;
  --font: "Noto Sans Myanmar", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.75; -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--accent); color: #fff; }
.brand { font-weight: 700; font-size: 18px; line-height: 1.4; }
.top .t2 .sub { color: rgba(255,255,255,.88); font-size: 13px; font-weight: 400; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.brand small { display: block; font-weight: 400; font-size: 13px; opacity: .85; }
.icon-btn { border: 0; background: rgba(255,255,255,.18); color: #fff; width: 44px; height: 44px; border-radius: 12px; font-size: 22px; cursor: pointer; }

main { max-width: 760px; margin: 0 auto; padding: 12px 16px 140px; }

/* two-language text */
.t2 { display: block; }
.t2 .sub { display: block; color: var(--muted); font-size: .82em; line-height: 1.5; }
.inline .t2, .t2.inline { display: inline; }
.inline .t2 .sub, .t2.inline .sub { display: inline; margin-left: .4em; }

/* search */
.search { position: relative; margin: 4px 0 10px; }
.search input { width: 100%; height: 54px; padding: 0 48px 0 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-size: 17px; }
.search input:focus { outline: none; border-color: var(--accent); }
.search .clear { position: absolute; right: 6px; top: 6px; width: 42px; height: 42px; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.hint { color: var(--muted); font-size: 14px; margin: -4px 0 8px; line-height: 1.6; }

#finder[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 15px; line-height: 1.6; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on .sub { color: rgba(255,255,255,.85); }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 14px; cursor: pointer; text-align: center; line-height: 1.5; }
.tab .emoji { font-size: 22px; display: block; }
.tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab.on .sub { color: rgba(255,255,255,.85); }

h2.section { font-size: 19px; margin: 18px 0 10px; line-height: 1.5; }

/* menu cards */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { position: relative; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(60,30,10,.08); border: 1px solid var(--line); }
.card .ph { aspect-ratio: 4 / 3; background: var(--accent-soft) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 44px; }
.card .body { padding: 8px 10px 10px; font-weight: 600; font-size: 16px; line-height: 1.55; }
.card .body .sub { font-weight: 400; }
.card .meta { font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.card .pick { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.95); box-shadow: 0 1px 4px rgba(0,0,0,.2); font-size: 22px; line-height: 40px; cursor: pointer; color: var(--accent); font-weight: 700; }
.card .pick.on { background: var(--green); color: #fff; }
.badge { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 999px; line-height: 1.8; font-weight: 600; }
.badge.hot { background: var(--red-soft); color: var(--red); }
.badge.ok { background: var(--green-soft); color: var(--green); }
.card .chili { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.95); border-radius: 999px; padding: 0 8px; font-size: 16px; }
.missing { font-size: 13px; color: var(--red); font-weight: 400; line-height: 1.55; margin-top: 2px; }
.have { font-size: 13px; color: var(--green); font-weight: 600; margin-top: 2px; }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* recipe page */
.back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 8px; padding: 6px 12px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.hero { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--accent-soft) center/cover no-repeat; }
.title { font-size: 26px; line-height: 1.5; margin: 12px 0 4px; }
.title .sub { font-size: 17px; font-weight: 400; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 14px; }
.panel h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.5; }
.people { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border: 2px solid var(--accent); border-radius: 14px; overflow: hidden; }
.stepper button { width: 48px; height: 46px; border: 0; background: var(--accent-soft); font-size: 24px; font-weight: 700; color: var(--accent); cursor: pointer; }
.stepper span { min-width: 54px; text-align: center; font-size: 22px; font-weight: 700; }

.ing { list-style: none; margin: 0; padding: 0; }
.ing li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ing li:last-child { border-bottom: 0; }
.ing .amt { white-space: nowrap; font-weight: 700; color: var(--accent); text-align: right; }
.ing .note { display: block; color: var(--muted); font-size: 13px; }
.ing li.skip .name, .ing li.skip .amt { text-decoration: line-through; color: var(--muted); }
.no-chili { display: inline-block; margin-top: 2px; background: var(--red); color: #fff; font-weight: 700; font-size: 14px; border-radius: 8px; padding: 0 8px; line-height: 1.8; text-decoration: none; }

.warn { border: 2px solid var(--red); background: var(--red-soft); color: var(--red); border-radius: 14px; padding: 10px 14px; margin-top: 12px; font-weight: 600; }
.wake { color: var(--muted); font-size: 13px; margin-top: 8px; }

.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 14px; }
.step .ph { aspect-ratio: 4 / 3; background: var(--accent-soft) center/cover no-repeat; }
.step .txt { padding: 12px 14px 14px; font-size: 18px; }
.step .num { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 18px; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 6px; font-size: 16px; }
.step .txt .sub { font-size: 15px; margin-top: 4px; }
.step .warn { margin: 10px 0 0; font-size: 16px; }
.timer-btn { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--green); color: #fff; font-weight: 700; padding: 10px 16px; border-radius: 14px; font-size: 17px; cursor: pointer; }
.timer-btn .sub { color: rgba(255,255,255,.9); }

/* selection bar */
.sel-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0,0,0,.08); }
.sel-bar a { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 728px; margin: 0 auto; background: var(--accent); color: #fff; border-radius: 14px; padding: 10px 16px; font-weight: 700; font-size: 17px; line-height: 1.5; text-align: center; }
.sel-bar a .sub { color: rgba(255,255,255,.88); }

/* timers */
.timers { position: fixed; right: 12px; bottom: 90px; z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.tmr { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 8px 8px 8px 14px; border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.tmr b { font-size: 22px; font-variant-numeric: tabular-nums; }
.tmr small { display: block; font-size: 12px; opacity: .8; line-height: 1.4; max-width: 140px; }
.tmr button { border: 0; background: rgba(255,255,255,.18); color: #fff; width: 36px; height: 36px; border-radius: 10px; font-size: 18px; cursor: pointer; }

.alarm { position: fixed; inset: 0; z-index: 60; background: rgba(185,28,28,.96); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 14px; }
.alarm[hidden] { display: none; }
.alarm .big { font-size: 64px; }
.alarm h2 { margin: 0; font-size: 30px; line-height: 1.5; }
.alarm p { margin: 0; font-size: 18px; }
.alarm button { margin-top: 10px; border: 0; background: #fff; color: var(--red); font-weight: 700; font-size: 22px; padding: 14px 40px; border-radius: 16px; cursor: pointer; }

/* plan / menu */
.row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.row:last-child { border-bottom: 0; }
.row .thumb { width: 72px; height: 54px; border-radius: 10px; background: var(--accent-soft) center/cover no-repeat; flex: none; }
.row .grow { flex: 1; min-width: 0; font-weight: 600; line-height: 1.5; }
.row .x { border: 0; background: var(--red-soft); color: var(--red); width: 40px; height: 40px; border-radius: 12px; font-size: 18px; cursor: pointer; flex: none; }
.btns { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 700; font-size: 17px; cursor: pointer; text-align: center; line-height: 1.5; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.wa { background: #25d366; color: #fff; }
.btn.ghost { background: #fff; border: 1.5px solid var(--line); }
.btn .sub { color: inherit; opacity: .85; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; cursor: pointer; }
.toggle input { width: 26px; height: 26px; accent-color: var(--red); flex: none; }

.shop li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.shop { list-style: none; margin: 0; padding: 0; }
.shop input { width: 26px; height: 26px; accent-color: var(--green); flex: none; }
.shop li.done .name, .shop li.done .amt { text-decoration: line-through; color: var(--muted); }
.shop .name { flex: 1; }
.shop .amt { font-weight: 700; color: var(--accent); white-space: nowrap; }
.shop-head { color: var(--muted); font-size: 14px; margin: 12px 0 0; }

/* settings dialog */
dialog { border: 0; border-radius: 20px; padding: 18px; width: min(420px, calc(100vw - 32px)); background: #fff; color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog h3 { margin: 0 0 10px; font-size: 19px; line-height: 1.5; }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.opt input { width: 22px; height: 22px; accent-color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 12px; z-index: 70; }
.alarm .sub { color: rgba(255,255,255,.85); }
