:root { --bg:#fffdf7; --panel:#ffffff; --text:#1f2937; --muted:#4b5563; --accent:#15803d; --accent-soft:#dcfce7;
        --sun:#fef3c7; --border:#e5e7eb; --danger:#b91c1c; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 20px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
h1 { font-size: 28px; margin: 8px 0 12px; } h2 { font-size: 23px; margin: 0 0 8px; }
p { margin: 8px 0; } .muted { color: var(--muted); font-size: 18px; }
.hide { display: none !important; }

/* top bar */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
       padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--accent); color: #fff; }
.top .title { font-size: 23px; font-weight: 700; flex: 1; }
.iconbtn { background: transparent; border: 0; color: inherit; font-size: 30px; line-height: 1; padding: 6px 10px;
           cursor: pointer; border-radius: 10px; }
main { padding: calc(env(safe-area-inset-top) + 76px) 16px calc(env(safe-area-inset-bottom) + 24px);
       max-width: 640px; margin: 0 auto; }

/* menu */
.menu { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.25); }
.menu nav { background: var(--panel); width: 82%; max-width: 340px; height: 100%; overflow-y: auto;
            padding: calc(env(safe-area-inset-top) + 16px) 0 16px; box-shadow: 2px 0 12px rgba(0,0,0,.15); }
.menu a, .menu button.link { display: block; width: 100%; text-align: left; padding: 16px 22px; font: inherit;
            font-size: 21px; color: var(--text); text-decoration: none; background: none; border: 0; cursor: pointer; }
.menu a.on { background: var(--accent-soft); font-weight: 700; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }

/* cards and buttons */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 18px; margin: 14px 0;
        box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.card.sun { background: var(--sun); border-color: #fde68a; }
.btn { display: block; width: 100%; margin: 12px 0 0; padding: 16px; font: inherit; font-size: 21px; font-weight: 700;
       border: 0; border-radius: 14px; background: var(--accent); color: #fff; cursor: pointer; text-align: center;
       text-decoration: none; }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn:disabled { opacity: .5; }
.status { font-size: 19px; margin-top: 10px; min-height: 1.5em; }
.status.err { color: var(--danger); }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input { width: 100%; font: inherit; font-size: 21px; padding: 14px; border: 2px solid var(--border); border-radius: 12px;
        background: #fff; color: var(--text); }
input:focus { outline: none; border-color: var(--accent); }
.chatbox { display: flex; gap: 8px; margin-top: 10px; }
.chatbox input { flex: 1; }
.chatbox .btn { width: auto; margin: 0; padding: 14px 18px; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.center .card { width: 100%; max-width: 440px; }
img.appicon { width: 88px; height: 88px; border-radius: 20px; display: block; margin: 0 auto 8px; }
ol { padding-left: 26px; } li { margin: 8px 0; }
.key { display: inline-block; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; background: #fff; }
.tc { text-align: center; }

/* chat (layout copied from the gateway, light theme) */
body.inchat main { padding-bottom: 0; }
.chat { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; top: var(--toph, 64px);
        height: calc(var(--vvh, 100dvh) - var(--toph, 64px)); max-width: 640px; margin: 0 auto; padding: 0 16px; }
.chat.hide { display: none !important; }
body.inchat { overflow: hidden; overscroll-behavior: none; }
.log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 88%; padding: 12px 16px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { background: var(--panel); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.me { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.msg.err { background: #fee2e2; color: var(--danger); align-self: center; font-size: 18px; }
.msg.typing { color: var(--muted); }
.msg img.ph { display: block; max-width: 220px; border-radius: 12px; margin-bottom: 6px; }
.card.prop { border: 2px solid var(--accent); align-self: stretch; margin: 4px 0; }
.card.prop h3 { margin: 0 0 8px; font-size: 21px; }
.card.prop.cancelled { opacity: .6; border-color: var(--border); }
.card.prop.confirmed { border-color: var(--accent-soft); }
.sum { white-space: pre-wrap; }
.warn { display: block; background: #fff7ed; color: #9a3412; border-radius: 10px; padding: 8px 10px; margin-top: 8px; white-space: pre-wrap; font-size: 18px; }
.btns { display: flex; gap: 10px; } .btns .btn { flex: 1; }
.state { margin-top: 6px; color: var(--muted); font-size: 18px; }
.composer { flex: none; padding: 8px 0 calc(env(safe-area-inset-bottom) + 10px); background: var(--bg); border-top: 1px solid var(--border); }
.composer textarea { flex: 1; font: inherit; font-size: 20px; padding: 12px 14px; border: 2px solid var(--border); border-radius: 14px; resize: none; background: #fff; color: var(--text); }
.composer textarea:focus { outline: none; border-color: var(--accent); }
.tools { display: flex; gap: 8px; margin-bottom: 8px; }
.tool { flex: 1; font-size: 26px; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); cursor: pointer; }
.tool.rec { background: #fee2e2; border-color: var(--danger); }
.chatbox { margin-top: 0; }

/* pages */
.navrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0; }
.btn.sm { width: auto; margin: 0; padding: 8px 16px; font-size: 19px; }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); font-weight: 400; margin: 0; }
.check input { width: 26px; height: 26px; flex: none; margin-top: 3px; }
.check input:checked + span { text-decoration: line-through; color: var(--muted); }
.big { font-size: 34px; font-weight: 800; margin: 6px 0; }
.bar { height: 14px; background: var(--border); border-radius: 8px; overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 8px; }
.bar.low i { background: #f59e0b; } .bar.over i { background: var(--danger); }
table.nt { width: 100%; border-collapse: collapse; font-size: 18px; }
table.nt td { padding: 6px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.nt td:nth-child(3) { width: 30%; }
tr.boost td:first-child { font-weight: 700; }
.seg { display: flex; gap: 8px; margin: 10px 0; }
.seg button { flex: 1; font: inherit; padding: 10px; border-radius: 12px; border: 2px solid var(--accent); background: #fff; color: var(--accent); }
.seg button.on { background: var(--accent); color: #fff; }
details.card summary { cursor: pointer; list-style: none; }
details.card h3 { margin: 14px 0 4px; font-size: 20px; }
select { width: 100%; font: inherit; font-size: 21px; padding: 12px; border: 2px solid var(--border); border-radius: 12px; background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; font-size: 17px; margin: 0; padding: 6px 10px; border: 1px solid var(--border); border-radius: 20px; }
.chip input { width: auto; }
.rem { padding: 12px 0; border-bottom: 1px solid var(--border); }
.rem .check { border: 0; padding: 0 0 6px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.days label { display: inline-flex; gap: 4px; align-items: center; font-weight: 400; font-size: 17px; margin: 0; }
.days input { width: auto; }
.card.err { color: var(--danger); }
.card.prop.replaced { opacity: .55; border-color: var(--border); }
.row.draft { background: #fefce8; border-radius: 10px; padding-left: 6px; }
.btn.inl { display: inline-block; width: auto; margin: 6px 0 0; padding: 8px 14px; font-size: 19px; }
.card.prop details { margin-top: 8px; }
#rsearch { margin: 4px 0 6px; }
.msg.about { border: 2px dashed var(--accent); background: var(--accent-soft); }
.msg.about .btn.sm { float: right; margin-left: 8px; }

/* readable cards and bubbles: 2 sizes (21px titles / 18-20px text), bold labels, spaced bullets */
.msg p { margin: 0 0 6px; } .msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: 4px 0; padding-left: 24px; } .msg li { margin: 6px 0; }
.card.prop { padding: 16px 16px 14px; }
.card.prop h3 { font-size: 21px; font-weight: 800; margin: 0 0 4px; line-height: 1.3; }
.card.prop .csum { font-size: 19px; margin: 0 0 10px; color: var(--text); }
.card.prop details > summary { font-size: 18px; font-weight: 700; color: var(--accent); padding: 6px 0; cursor: pointer; }
.cbody { font-size: 18px; border-top: 1px solid var(--border); padding-top: 8px; }
.cbody ul.items { list-style: none; padding: 0; margin: 4px 0 10px; }
.cbody ul.items li { padding: 8px 0 8px 18px; border-bottom: 1px solid var(--border); position: relative; margin: 0; }
.cbody ul.items li::before { content: "•"; position: absolute; left: 2px; color: var(--accent); font-weight: 800; }
.cbody ul.items li:last-child { border-bottom: 0; }
.cbody .hint { font-size: 16px; color: var(--muted); font-style: italic; }
.cbody .kv { display: flex; gap: 10px; padding: 6px 0; } .cbody .kv b { flex: none; min-width: 92px; }
.cbody .kv.key { background: var(--accent-soft); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.cbody h4 { font-size: 19px; margin: 12px 0 4px; }
.cbody ol.steps { padding-left: 24px; margin: 0; } .cbody ol.steps li { margin: 6px 0; }
.warn ul { margin: 4px 0 0; padding-left: 20px; } .warn li { margin: 4px 0; }
.card.prop .btns { margin-top: 12px; }
ul.amts { margin: 4px 0 4px; padding-left: 22px; font-size: 18px; } ul.amts li { margin: 3px 0; }

details.meal { border-bottom: 1px solid var(--border); padding: 4px 0; }
details.meal > summary { list-style: none; cursor: pointer; padding: 8px 0; display: grid; grid-template-columns: 96px 1fr; gap: 2px 10px; }
details.meal > summary::-webkit-details-marker { display: none; }
details.meal .slot { font-weight: 800; text-transform: capitalize; }
details.meal .eat { font-size: 20px; font-weight: 600; }
details.meal .mk { grid-column: 2; font-size: 16px; }
details.meal[open] > summary .eat { color: var(--accent); }
details.meal.draft { background: #fefce8; border-radius: 10px; padding-left: 6px; }
.dish { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0 10px 12px; border-top: 1px dashed var(--border); }
details.meal .prop { grid-column: 2; font-size: 17px; color: #854d0e; background: #fef9c3; border-radius: 8px; padding: 4px 8px; margin-top: 4px; }

tr.nrow { cursor: pointer; } tr.nrow .tap { color: var(--accent); font-weight: 800; }
tr.nrow.on td { background: var(--accent-soft); }
tr.srcrow td { padding: 0 0 10px; }
.src { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-top: 4px; font-size: 17px; }
.src h4 { font-size: 18px; margin: 10px 0 4px; }
ol.srclist { list-style: none; padding: 0; margin: 0; counter-reset: n; }
ol.srclist li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
ol.srclist li:last-child { border-bottom: 0; }
ol.srclist .amt { font-weight: 800; white-space: nowrap; text-align: right; }
ol.srclist .amt small { display: block; font-weight: 400; color: var(--muted); font-size: 15px; }
.src .hint { font-size: 15px; color: var(--muted); font-style: italic; }

.srcsec { border-radius: 10px; padding: 4px 10px 6px; margin-top: 10px; border-left: 5px solid var(--accent); background: #f7fdf9; }
.srcsec.ingr { border-top: 3px solid var(--text); border-left-color: #d97706; background: #fffbeb; margin-top: 16px; padding-top: 8px; }
.srcsec h4 { margin: 6px 0 4px; }

label.shopline { display: flex; align-items: center; gap: 14px; padding: 12px 2px; margin: 0; border-bottom: 1px solid var(--border); font-weight: 400; cursor: pointer; }
label.shopline:last-child { border-bottom: 0; }
label.shopline input { width: 28px; height: 28px; flex: none; accent-color: var(--accent); }
label.shopline .nm { flex: 1; font-size: 20px; font-weight: 600; }
label.shopline .qty { font-size: 19px; white-space: nowrap; }
label.shopline input:checked ~ span { text-decoration: line-through; color: var(--muted); font-weight: 400; }
h3.shopsec { font-size: 18px; margin: 16px 0 2px; padding-bottom: 4px; border-bottom: 2px solid var(--accent-soft); color: var(--accent); }
h3.shopsec:first-of-type { margin-top: 6px; }

.shopitem { border-bottom: 1px solid var(--border); } .shopitem label.shopline { border-bottom: 0; }
.shopitem:last-child { border-bottom: 0; }
.have { font-size: 16px; color: #075985; background: #e0f2fe; border-radius: 8px; padding: 6px 8px; margin: 0 0 10px 42px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.have .btn.sm { padding: 4px 10px; font-size: 16px; }
label.switch { display: flex; gap: 10px; align-items: center; font-weight: 400; font-size: 18px; margin: 4px 0 8px; }
label.switch input { width: 24px; height: 24px; }
.kitem { padding: 10px 0; border-bottom: 1px solid var(--border); } .kitem:last-child { border-bottom: 0; }
.ktop { display: flex; justify-content: space-between; gap: 10px; font-size: 20px; }
.kbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.kbtns select { width: auto; font-size: 16px; padding: 6px 8px; }
.soon { color: #b45309; font-weight: 700; margin-left: 6px; } .bad { color: var(--danger); font-weight: 700; margin-left: 6px; }
.kbatch { border-bottom: 1px solid var(--border); padding: 8px 0 12px; } .kbatch:last-child { border-bottom: 0; }
details.insight summary { cursor: pointer; font-size: 19px; } details.insight p { margin: 8px 0; }

.viewsw { text-align: right; margin: -4px 0 2px; } .viewsw a { font-size: 17px; color: var(--accent); font-weight: 600; }
details.meal.next { background: #ca8a04; color: #fff; border-radius: 12px; padding: 4px 10px; border-bottom: 0; margin: 6px 0; }
details.meal.next .muted, details.meal.next .slot small { color: #fef9c3; }
details.meal.next .eat { color: #fff; }
details.meal .slot small { display: block; font-size: 14px; font-weight: 400; color: var(--muted); }
details.meal.next .dish { border-top-color: rgba(255,255,255,.4); }
details.meal.next .btn.soft { background: #fef9c3; color: #713f12; }
