* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 var(--font); color: var(--text); background: var(--bg); }
body.noscroll { overflow: hidden; }
main { max-width: 1100px; margin: 0 auto; padding: 12px 14px 96px; }
h1 { font-size: 22px; margin: 8px 0 12px; }
h2 { font-size: 17px; margin: 18px 0 8px; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; display: block; margin: 12px auto; }
.warn { color: var(--danger); }
.bar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 54px; padding: 0 12px; background: #fff; color: var(--text); border-bottom: 1px solid var(--border); }
.brand { grid-column: 2; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.logo { height: 38px; width: auto; max-width: 52vw; object-fit: contain; display: block; }
.spacer { flex: 1; }
.cartlink { grid-column: 3; justify-self: end; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; text-align: center; font-size: 13px; }
button, .btn { font: inherit; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.ghost { background: transparent; }
.big { width: 100%; padding: 14px; font-size: 17px; }
button.link { background: none; border: 0; color: #9fd3ff; text-decoration: underline; padding: 0 0 0 8px; }
.reorder .big small { display: block; font-weight: 400; opacity: .85; font-size: 13px; }

.strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-height: 92px; }
.tile .name { font-weight: 600; line-height: 1.25; }
.tile .meta, .meta { color: var(--muted); font-size: 13px; }
.tile.mini { flex: 0 0 150px; scroll-snap-align: start; min-height: 74px; }
.tile.off { opacity: .55; }
.star { position: absolute; top: 8px; right: 10px; color: #d9a300; }
.incart { margin-top: auto; align-self: flex-start; font-size: 12px; background: #e6f4ea; color: #1e6b34; border-radius: 999px; padding: 1px 8px; }
.searchbar { position: sticky; top: 54px; z-index: 10; background: var(--bg); padding: 8px 0; }
.searchbar input { width: 100%; padding: 12px; font: inherit; border: 1px solid var(--border); border-radius: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; }
.chip { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.lines { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.line { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.line .name { font-weight: 600; } .line .qty { margin-top: 4px; }
.line.off { opacity: .6; }
.lines.compact .line { padding: 8px 10px; }
.actions { display: flex; flex-direction: column; gap: 6px; }
.footbar { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.footbar > * { flex: 1; }
.back { display: inline-block; margin-top: 4px; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.locs { display: grid; gap: 8px; }
.loc { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
textarea { width: 100%; padding: 10px; font: inherit; border: 1px solid var(--border); border-radius: 10px; }
.summary { margin: 12px 0; }

.cal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; max-width: 420px; }
.calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dow, .daygrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.dow { color: var(--muted); font-size: 13px; }
.day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 8px; }
.day.ok { background: #eef7ff; border-color: #c8e0f4; }
.day.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.day.blocked, .day.out { color: #b5bec7; background: #f1f3f5; border-color: transparent; }
.day.empty { border: 0; }

#overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 25, 35, .5); display: flex; align-items: flex-end; justify-content: center; }
#overlay[hidden], #toast[hidden] { display: none; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; background: var(--surface); border-radius: 16px 16px 0 0; padding: 14px; display: flex; flex-direction: column; }
@media (min-width: 700px) { #overlay { align-items: center; } .sheet { border-radius: 16px; } }
#pm { display: flex; flex-direction: column; min-height: 0; }
.sheethead { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sheethead h2 { margin: 2px 0 6px; }
.x { font-size: 22px; line-height: 1; padding: 4px 10px; }
.sheetbody { overflow-y: auto; padding: 4px 2px 8px; }
.sheetfoot { padding-top: 8px; }
.group { margin: 12px 0; } .gl { font-weight: 600; margin-bottom: 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.stepper button { width: 44px; padding: 10px 0; font-size: 20px; }
.stepper input { width: 80px; text-align: center; font: inherit; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; } .row button { flex: 1; }

#toast { position: fixed; z-index: 60; left: 50%; bottom: 74px; transform: translateX(-50%); background: #1c2733; color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 92vw; }
#toast.err { background: var(--danger); }
.preview { text-align: center; font-size: 12px; color: var(--muted); padding: 10px; }
.confirm .orderno { font-size: 18px; }

/* Home page: each section is its own panel */
.panel { border-radius: 16px; padding: 14px; margin: 0 0 16px; border: 1px solid var(--border); }
.panel > h2 { margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.panel.reorder { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.panel.reorder .big { background: #fff; color: var(--brand); border-color: #fff; font-weight: 600; }
.panel.reorder .muted { color: var(--brand-contrast); opacity: .85; margin: 0; }
.panel.lastorder { background: #e8f1f8; border-color: #cfe0ee; }
.panel.catalog { background: var(--surface); box-shadow: 0 1px 3px rgba(20, 40, 60, .08); }
.panel.catalog .searchbar { background: var(--surface); margin: 0 -14px 10px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.tile.family { background: #eaf3fa; border-color: #b9d4e8; }
.optsel { width: 100%; padding: 12px; font: inherit; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }

/* header menu */
.iconbtn { grid-column: 1; justify-self: start; display: inline-flex; flex-direction: column; justify-content: center; gap: 4px; width: 40px; height: 40px; padding: 0 9px; background: none; border: 0; }
.iconbtn span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
#menuscrim { position: fixed; inset: 0; z-index: 40; background: rgba(15, 25, 35, .45); }
#menu { position: fixed; top: 0; bottom: 0; left: 0; z-index: 45; width: min(280px, 80vw); background: #fff; box-shadow: 4px 0 24px rgba(0, 0, 0, .2); display: flex; flex-direction: column; }
#menuscrim[hidden], #menu[hidden] { display: none; }
#menu .menuhead { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
#menu .menuhead .iconbtn { display: block; font-size: 26px; line-height: 1; padding: 0; text-align: center; color: var(--text); }
#menu a { padding: 14px 16px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
#menu a:hover { background: var(--bg); }
.line .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* sign in */
.loginpage { background: var(--bg); }
.logincard { max-width: 380px; margin: 8vh auto 0; padding: 24px 20px; background: #fff; border: 1px solid var(--border); border-radius: 16px; text-align: center; }
.logincard .logo { margin: 0 auto 8px; }
.logincard form { text-align: left; }
.logincard label { display: block; margin: 12px 0; font-weight: 600; }
.logincard input { display: block; width: 100%; margin-top: 4px; padding: 12px; font: inherit; font-weight: 400; border: 1px solid var(--border); border-radius: 10px; }
.logincard .big { margin-top: 8px; }
#menu form { margin: 0; }
#menu .menuitem, #menu .whoami { display: block; width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none; text-align: left; font: inherit; color: var(--text); }
#menu .whoami { background: var(--bg); line-height: 1.3; }

/* admin preview banner + customer switcher */
.previewbar{background:#fff3cd;color:#664d03;text-align:center;padding:6px 10px;font-size:14px;border-bottom:1px solid #f0d878}
.switchform{padding:8px 16px}.switchform select{width:100%;margin-top:4px;padding:6px}
#menu a{display:block}
.ordering-for{margin:8px 12px;font-size:14px}
