:root {
  --bg: #f5efe3; --card: #fffdf8; --ink: #22302a; --muted: #6e776f; --line: #e8e0cf;
  --green: #2f5d46; --green-d: #234836; --green-s: #e1ece0; --tomato: #c24a31; --tomato-s: #f8e3dc; --gold: #d9962b;
  --r: 16px; --shadow: 0 1px 0 rgba(34,48,42,.04), 0 8px 24px -14px rgba(34,48,42,.28);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-image: radial-gradient(circle at 100% -10%, #efe3c8 0, transparent 40%); min-height: 100vh; }
a { color: var(--green); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0; }
h1 { font-size: 30px; } h2 { font-size: 21px; } h3 { font-size: 18px; }
small { color: var(--muted); font-weight: 400; }
main { max-width: 640px; margin: 0 auto; padding: 8px 14px 96px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.neg { color: var(--tomato); }

.top { display: flex; align-items: center; justify-content: space-between; max-width: 640px; margin: 0 auto; padding: 14px 16px 6px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 700; }
.brand small { font-family: system-ui; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-left: 4px; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--green); color: #fff7e6; display: grid; place-items: center; font-size: 19px; transform: rotate(-4deg); }
.lang { display: flex; background: #ebe3d1; border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: none; padding: 5px 11px; border-radius: 999px; font: 600 12px system-ui; color: var(--muted); }
.lang button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; max-width: 640px; margin: 0 auto; padding: 6px 14px; }
.tabs a { white-space: nowrap; text-decoration: none; padding: 8px 12px; border-radius: 999px; background: #ebe3d1; color: var(--ink); font-weight: 600; font-size: 14px; }
.tabs a.on { background: var(--green); color: #fff; }

.bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.bottom a { flex: 1; text-align: center; padding: 9px 0 10px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; }
.bottom a.on { color: var(--green); }
.bottom .ico { display: block; font-size: 20px; line-height: 1.2; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 14px 2px 10px; }
.eyebrow { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .09em; font-size: 12px; color: var(--muted); font-weight: 700; }
.bal { text-align: right; text-decoration: none; background: var(--green-s); color: var(--green-d); padding: 8px 14px; border-radius: 14px; }
.bal small { display: block; color: inherit; opacity: .7; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.bal b { font-family: var(--serif); font-size: 22px; }
.bal.neg { background: var(--tomato-s); color: var(--tomato); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.chip { display: inline-block; padding: 7px 14px; border-radius: 999px; background: #ebe3d1; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.chip.on { background: var(--green); color: #fff; }
.weeknav, .daynav { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 12px; font-size: 14px; }
.weeknav a { text-decoration: none; font-weight: 600; }
.daynav { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px; font-size: 17px; }
.daynav a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; text-decoration: none; font-size: 26px; background: #f0e9d9; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 12px; box-shadow: var(--shadow); }
.card.day.has { border-color: #b9d1bb; }
.day-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.day-h h2 small { font-family: system-ui; font-size: 14px; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #efe8d8; color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--green-s); color: var(--green-d); }
.label { margin: 6px 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }

.combos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.combo { position: relative; display: grid; gap: 3px; text-align: left; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 13px; background: #fff; min-height: 76px; font: inherit; color: var(--ink); cursor: pointer; align-content: start; }
.combo b { font-family: var(--serif); font-size: 17px; }
.combo .parts { color: var(--muted); font-size: 12px; line-height: 1.3; }
.combo em { font-style: normal; font-weight: 700; color: var(--green-d); }
.combo.on { border-color: var(--green); background: var(--green-s); box-shadow: inset 0 0 0 1px var(--green); }
.combo .x { position: absolute; top: 4px; right: 6px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-size: 16px; line-height: 1; }
.combo:focus-visible { outline: 3px solid var(--gold); }
.dish.in { color: var(--muted); }
.tag { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--green-s); color: var(--green-d); white-space: nowrap; }
.total { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.total .row { display: flex; justify-content: space-between; align-items: baseline; margin: 2px 0; }
.total .row.sum b { font-family: var(--serif); font-size: 24px; color: var(--ink); }
.htmx-request .total { opacity: .5; }

details { margin: 10px 0; border-top: 1px dashed var(--line); padding-top: 8px; }
summary { cursor: pointer; font-weight: 600; padding: 8px 0; color: var(--green); }
.dish { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f1ebdd; }
.dish small { display: block; font-size: 12px; }
.step { display: flex; align-items: center; gap: 4px; }
.step button { width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 22px; line-height: 1; color: var(--green); }
.step input { width: 44px; height: 40px; text-align: center; border: 0; background: none; font: 700 17px system-ui; -moz-appearance: textfield; }
.step input::-webkit-outer-spin-button, .step input::-webkit-inner-spin-button { -webkit-appearance: none; }

.actions { display: flex; gap: 10px; margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid transparent; border-radius: 13px; padding: 12px 18px; min-height: 48px; font: 700 16px system-ui; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--green); color: #fff; flex: 1; }
.btn.primary:active { background: var(--green-d); }
.btn.danger { background: var(--tomato-s); color: var(--tomato); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--green); }
.btn.wide { width: 100%; } .btn.big { width: 100%; min-height: 56px; font-size: 18px; }
.linkbtn { display: inline-block; background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 14px; padding: 12px; }
.foot { text-align: center; margin-top: 18px; }
.err { background: var(--tomato-s); color: var(--tomato); padding: 10px 12px; border-radius: 12px; font-weight: 600; }
.flash { background: var(--green-s); color: var(--green-d); padding: 10px 14px; border-radius: 12px; font-weight: 600; }

.lines, .hist, .counts, .box, .drv { list-style: none; margin: 0 0 10px; padding: 0; }
.lines li, .hist li, .counts li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1ebdd; }
.hist li span small, .counts li span small { display: block; font-size: 12px; }
.hist li.void { opacity: .5; text-decoration: line-through; }
em { font-style: normal; font-weight: 700; } .plus { color: var(--green); } .minus { color: var(--tomato); }
.counts b { font-family: var(--serif); font-size: 26px; min-width: 40px; text-align: right; }
.venues { margin: 8px 0 12px; }
.venues .chip { margin: 0 6px 6px 0; font-size: 13px; background: #f0e9d9; }

.pack-h h3 { font-size: 20px; }
.pack-h p { margin: 2px 0 8px; font-size: 14px; }
.box { background: #faf6ec; border-radius: 12px; padding: 4px 12px; margin-bottom: 12px; }
.box li { padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; flex-direction: column; }
.box li:last-child { border: 0; }
.box li span { color: var(--muted); font-size: 14px; }
.pack.done { background: #f1f6ef; border-color: #b9d1bb; }

.winh { margin: 18px 2px 8px; font-size: 24px; }
.grp { margin: 12px 0 2px; color: var(--green-d); font-size: 16px; text-transform: uppercase; letter-spacing: .06em; font-family: system-ui; }
.drv li { padding: 8px 0; border-bottom: 1px solid #f1ebdd; }
.drv b { display: block; } .drv span { color: var(--muted); font-size: 14px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.stat b { font-family: var(--serif); font-size: 26px; display: block; }
.who { font-family: var(--serif); font-size: 22px; margin: 16px 0; }


.pack-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grp-h { font-size: 17px; margin: 18px 0 8px; }
.grp-h small, .grp-h .muted { font-size: 13px; font-weight: 400; }
.sect { margin-top: 18px; }
.ok-note { background: var(--green-s); color: var(--green-d); padding: 10px 12px; border-radius: 12px; font-weight: 600; margin: 0 0 10px; }
.warn { background: #fff3d6; color: #7a5300; padding: 10px 12px; border-radius: 12px; font-weight: 500; margin: 0 0 10px; }
.confirm { background: var(--tomato-s); border-radius: 12px; padding: 12px; margin-top: 8px; }
.confirm p { margin: 0 0 10px; font-weight: 600; }
.confirm .btn { margin-right: 8px; }
details.fold { padding: 0; }
details.fold > summary { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; color: var(--ink); list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary b { white-space: nowrap; }
details.fold > summary .brief { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; font-size: 14px; }
details.fold > summary em { font-style: normal; font-weight: 700; white-space: nowrap; }
details.fold[open] > summary { border-bottom: 1px solid var(--line); }
details.fold > :not(summary) { margin-left: 14px; margin-right: 14px; }
details.fold > :last-child { margin-bottom: 14px; }
.hist li small.void-note, .hist li.void-note small { color: var(--muted); }
.confirm .btn.danger { background: var(--tomato); color: #fff; }
.hist em, .lines em, .counts b { white-space: nowrap; }

/* публичные страницы: запись, главная, заявки */
.form label { display: block; margin: 0 0 12px; font-weight: 600; font-size: 14px; color: var(--muted); }
.form input:not([type=checkbox]), .form select { display: block; width: 100%; margin-top: 4px; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: 16px system-ui; color: var(--ink); }
.form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 0; margin: 0 0 12px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink); margin: 14px 0; }
.form .check input { margin-top: 3px; width: 20px; height: 20px; }
.form h2 { margin: 18px 0 10px; }
.card ul { padding-left: 20px; margin: 6px 0; } .card h3 { margin: 14px 0 4px; }
.flash.err { background: var(--tomato-s); color: var(--tomato); }
