﻿/* SousChef: an upscale kitchen. Marble walls, brass fittings, charcoal type, a tiled floor underfoot. */
:root {
  --marble: #f5f2ed; --marble-2: #ece8e1; --card: #fffdfa; --line: #e4dfd5; --line-2: #d5cfc3;
  --ink: #23252a; --ink-2: #5a5e67; --ink-3: #868a93;
  --brass: #b0884a; --brass-2: #d6b574; --brass-dk: #7e5c24; --char: #2a2c31;
  --fresh: #4f9a76; --fresh-t: #2b7552; --aging: #d89a24; --aging-t: #8a5e08; --old: #c0513c; --old-t: #a23b28;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --floor-h: 14px; --tabs-h: 62px;
  --bg: #ebe7df; --field: #fff; --tint: rgba(0, 0, 0, .05); --veil: rgba(250, 248, 244, .55); --pill: rgba(255, 255, 255, .7); --done: rgba(255, 253, 250, .6);
  --marble-0: rgba(245, 242, 237, 0); --tabs-a: #fbfaf7; --tabs-b: #efebe4; --tile-a: #34363c; --tile-b: #f1eee8; --plate-a: #fff; --plate-b: #efe8da;
  --btn: #2a2c31; --btn-ink: #fff; --btn-ic: #d6b574; --toast: #2a2c31;
  color-scheme: light;
}
/* obsidian marble: black stone, pale veins, a thread of gold */
:root[data-theme="dark"] {
  --marble: #17181c; --marble-2: #202228; --card: #1f2126; --line: #2d3037; --line-2: #3c4049;
  --ink: #ece8df; --ink-2: #b3b7c0; --ink-3: #868b95; --char: #f3efe6;
  --brass: #c49a56; --brass-2: #e0c07e; --brass-dk: #d6b574;
  --fresh-t: #7fd3a9; --aging-t: #eab75a; --old-t: #f39a86;
  --bg: #0e0f12; --field: #2a2c33; --tint: rgba(255, 255, 255, .08); --veil: rgba(12, 13, 16, .5); --pill: rgba(255, 255, 255, .09); --done: rgba(31, 33, 38, .6);
  --marble-0: rgba(23, 24, 28, 0); --tabs-a: #25272d; --tabs-b: #191a1e; --tile-a: #0c0d10; --tile-b: #383b44; --plate-a: #3a3d46; --plate-b: #23252b;
  --btn: #d6b574; --btn-ink: #1b1c20; --btn-ic: #6b4f1f; --toast: #3b3e46;
  color-scheme: dark;
}
:root[data-theme="dark"] .wall { background-color: #101114; background-image: url("/img/marble-dark.svg"); }
:root[data-theme="dark"] .row, :root[data-theme="dark"] .sheet { box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 18px -10px rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .app { box-shadow: 0 0 0 1px rgba(214, 181, 116, .12), 0 0 60px rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .scrim { background: rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .chandelier .gem { fill: #bcd6e0; }
.chips.big { gap: 10px; } .chips.big .chip { height: 48px; padding: 0 18px; font-size: 16px; }
.life { flex-wrap: wrap; }
.life .chips { flex: 1; flex-wrap: nowrap; gap: 6px; }
.life .chip { height: 40px; padding: 0 11px; flex: 1; justify-content: center; font-size: 14px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.35; overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.big { width: 44px; height: 44px; stroke-width: 1.3; color: var(--brass); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 8px; }

/* ---- the marble wall (one static layer, so scrolling stays smooth) ---- */
.wall { position: fixed; inset: 0; z-index: -1; background: #f3f0ea url("/img/marble.svg") center / cover no-repeat; }
.app { position: relative; height: 100dvh; max-width: 580px; margin: 0 auto; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; background: var(--veil); box-shadow: 0 0 0 1px rgba(120, 100, 60, .08), 0 0 60px rgba(60, 50, 30, .12); overflow: hidden; }

/* ---- header with the chandelier ---- */
.top { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; padding: calc(var(--safe-t) + 0px) 12px 0; min-height: 84px; }
.top-tools { display: flex; align-items: center; gap: 4px; padding-top: 22px; }
.top-tools.right { justify-content: flex-end; }
.brand { display: flex; flex-direction: column; align-items: center; }
.brand h1 { margin: -6px 0 0; font: 600 23px/1.05 var(--serif); letter-spacing: .07em; text-transform: none; color: var(--char); }
.brand h1::after { content: ""; display: block; width: 46px; height: 1.5px; margin: 5px auto 0; background: linear-gradient(90deg, transparent, var(--brass), transparent); }
.chandelier { width: 108px; height: 58px; overflow: visible; }
.chandelier .chain { stroke: var(--brass-dk); stroke-width: 1.2; fill: none; }
.chandelier .brass { fill: var(--brass); }
.chandelier .arm { stroke: var(--brass); stroke-width: 2; fill: none; stroke-linecap: round; }
.chandelier .fl { fill: #f7d98a; opacity: .95; transform-box: fill-box; transform-origin: 50% 100%; animation: flick 2.6s ease-in-out infinite; }
.chandelier .f2 { animation-delay: -.9s; } .chandelier .f3 { animation-delay: -1.7s; }
.chandelier .gem { fill: #cfe6ee; stroke: #9fc2cf; stroke-width: .5; animation: twinkle 4.4s ease-in-out infinite; }
.chandelier .g2 { animation-delay: -2.2s; }
.chandelier .sway { transform-box: fill-box; transform-origin: 50% 0; animation: sway 8s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-1.1deg); } 50% { transform: rotate(1.1deg); } }
@keyframes flick { 0%, 100% { opacity: .95; transform: scale(1, 1); } 40% { opacity: .75; transform: scale(.88, 1.1); } 70% { opacity: 1; transform: scale(1.05, .94); } }
@keyframes twinkle { 0%, 100% { opacity: .85; } 50% { opacity: .5; } }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--ink-2); transition: background .2s, transform .2s var(--ease); }
.icon-btn:hover { background: var(--tint); }
.icon-btn:active { transform: scale(.92); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.icon-btn.lg { color: var(--char); width: 36px; }
.pill-tool { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px 0 9px; border-radius: 17px; border: 1px solid var(--line-2); background: var(--pill); color: var(--char); font-weight: 600; font-size: 13.5px; letter-spacing: .02em; transition: transform .2s var(--ease), background .2s; }
.pill-tool:active { transform: scale(.95); }
.pill-tool .ic { width: 18px; height: 18px; }
.acct { display: inline-flex; align-items: center; gap: 5px; height: 36px; min-width: 36px; padding: 0 10px; white-space: nowrap; border-radius: 18px; border: 1px solid var(--line-2); background: var(--pill); color: var(--char); font-weight: 600; font-size: 13.5px; justify-content: center; transition: transform .2s var(--ease); position: relative; }
.acct:active { transform: scale(.95); }
.acct.signed { padding: 0; width: 36px; border-color: var(--brass); }
.acct .ic { width: 18px; height: 18px; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--btn); color: var(--btn-ink); }
.avatar .ic { width: 20px; height: 20px; }
.avatar.sm { width: 30px; height: 30px; font: 600 14px var(--serif); background: var(--btn); color: var(--btn-ic); }
.acct[data-net="offline"]::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--aging); border: 2px solid #fff; }

/* ---- sub header: storage places / page title ---- */
.subhead { display: grid; padding: 2px 12px 0; min-height: 48px; }
.subhead > * { grid-area: 1 / 1; transition: opacity .24s var(--ease); }
.sub-kitchen { position: relative; display: flex; align-items: stretch; border-bottom: 1px solid var(--line-2); }
.sub-title { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 4px 8px; border-bottom: 1px solid var(--line-2); opacity: 0; pointer-events: none; }
body:not([data-page="loc"]) .sub-kitchen { opacity: 0; pointer-events: none; }
body:not([data-page="loc"]) .sub-title { opacity: 1; pointer-events: auto; }
.sub-title h2 { margin: 0; font: 600 21px var(--serif); letter-spacing: .02em; }
.sub-note { color: var(--ink-2); font-size: 14px; }
.loc-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px 10px; color: var(--ink-2); font-weight: 600; font-size: 15px; transition: color .2s; min-width: 0; }
.loc-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-tab .ic { width: 19px; height: 19px; }
.loc-tab em { font-style: normal; font-size: 12px; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--tint); color: var(--ink-2); text-align: center; }
.loc-tab.on { color: var(--char); }
.loc-tab.on em { background: var(--btn); color: var(--btn-ink); }
.loc-ind { position: absolute; left: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, var(--brass), var(--brass-2)); transition: transform .34s var(--ease), width .34s var(--ease); width: 0; }

/* ---- pager ---- */
.pager { position: relative; overflow: hidden; min-height: 0; touch-action: pan-y; }
.pager.dragging { user-select: none; cursor: grabbing; }
.track { display: flex; height: 100%; will-change: transform; }
.page { flex: 0 0 100%; height: 100%; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.scroll { padding: 0 14px 120px; }
.filterbar, .quick { position: sticky; top: 0; z-index: 3; }
.filterbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0 8px; background: linear-gradient(var(--marble) 78%, var(--marble-0)); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--tint); }
.seg-b { padding: 6px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s, box-shadow .2s; }
.seg-b.on { background: var(--field); color: var(--char); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.sort-b { display: inline-flex; align-items: center; gap: 5px; padding: 6px 4px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.sort-b .ic { width: 16px; height: 16px; }

/* ---- rows ---- */
.rows { display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.row { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(60, 50, 30, .05), 0 6px 16px -10px rgba(60, 50, 30, .18); transition: transform .2s var(--ease), box-shadow .2s, opacity .3s; }
.row.item, .row.recipe, .row.glist .row-main { cursor: pointer; }
.row.item:active, .row.recipe:active { transform: scale(.992); }
.row.enter { animation: rise .45s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
.agebar { position: absolute; left: 0; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--fresh); }
.s1 > .agebar { background: var(--aging); } .s2 > .agebar { background: var(--old); }
.row-main { flex: 1; min-width: 0; }
.row-name { font-weight: 650; font-size: 16.5px; letter-spacing: .005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; font-size: 13px; color: var(--ink-2); }
.age { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; }
.age .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fresh); }
.age.s1 .dot { background: var(--aging); } .age.s2 .dot { background: var(--old); }
.age.s0 { color: var(--fresh-t); } .age.s1 { color: var(--aging-t); } .age.s2 { color: var(--old-t); }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 1px 7px; border-radius: 6px; background: var(--tint); color: var(--ink-2); }
.s0 .tag { background: rgba(79, 154, 118, .14); color: var(--fresh-t); } .s1 .tag { background: rgba(216, 154, 36, .17); color: var(--aging-t); } .s2 .tag { background: rgba(192, 81, 60, .14); color: var(--old-t); }
.tag.auto { background: rgba(176, 136, 74, .16); color: var(--brass-dk); } .tag.ok { background: rgba(79, 154, 118, .14); color: var(--fresh-t); }
.row-meta .sub { color: var(--ink-3); }
.mini { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 22px; background: var(--tint); }
.mini-b { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--char); background: var(--field); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); transition: transform .16s var(--ease); }
.mini-b:active { transform: scale(.86); }
.mini-b .ic { width: 17px; height: 17px; }
.mini-q { min-width: 52px; padding: 0 4px; text-align: center; font-weight: 650; font-size: 14.5px; white-space: nowrap; }
.foot { text-align: center; color: var(--ink-3); font-size: 13px; padding: 16px 0 4px; }

/* ---- grocery list ---- */
.quick { display: flex; align-items: center; gap: 8px; padding: 10px 0 8px; background: linear-gradient(var(--marble) 78%, var(--marble-0)); }
.quick-in { flex: 1; min-width: 0; height: 46px; padding: 0 14px 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--field); font-size: 16px; }
.quick-in:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(176, 136, 74, .22); }
.quick-go { width: 46px; height: 46px; border-radius: 14px; background: var(--btn); color: var(--btn-ink); display: grid; place-items: center; transition: transform .16s var(--ease); }
.quick-go:active { transform: scale(.92); }
.recipe-top { gap: 8px; }
.recipe-top .quick-in { padding-left: 40px; }
.mag { position: absolute; left: 14px; color: var(--ink-3); display: grid; }
.mag .ic { width: 19px; height: 19px; }
.pill-b { flex: none; height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--field); font-weight: 600; font-size: 14px; }
.pill-b.on { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.group-h { display: flex; align-items: center; gap: 10px; margin: 14px 2px 2px; font: 600 15px var(--serif); letter-spacing: .06em; text-transform: uppercase; color: var(--brass-dk); }
.group-h:first-child { margin-top: 4px; }
.group-h .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.group-h .count { font: 500 12.5px var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.row.glist { padding: 9px 12px 9px 10px; }
.check { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); display: inline-grid; place-items: center; background: var(--field); color: transparent; transition: background .22s, border-color .22s, transform .24s var(--ease); }
.check .ic { width: 19px; height: 19px; stroke-width: 2.4; }
.check:active { transform: scale(.88); }
.glist.done .check, .check.on { background: var(--brass); border-color: var(--brass); color: #fff; animation: pop .38s var(--ease); }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.16); } 100% { transform: scale(1); } }
.glist.done .row-name { text-decoration: line-through; text-decoration-color: var(--ink-3); color: var(--ink-3); }
.glist.done { background: var(--done); }
.tripbar { position: sticky; bottom: 12px; z-index: 4; padding-top: 14px; }
.tripbar .btn { box-shadow: 0 10px 24px -8px rgba(30, 28, 24, .5); }
.pill { margin-left: 6px; padding: 2px 9px; border-radius: 10px; background: rgba(255, 255, 255, .18); font-size: 12.5px; font-weight: 600; }

/* ---- recipes ---- */
.plate { width: 38px; height: 38px; flex: none; margin-left: -4px; border-radius: 50%; display: grid; place-items: center; color: var(--brass-dk); background: radial-gradient(circle at 35% 30%, var(--plate-a), var(--plate-b)); border: 1px solid var(--line-2); }
.plate .ic { width: 20px; height: 20px; }
.row.recipe { padding-left: 14px; }
.row.recipe.sel { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(176, 136, 74, .3); }
.stock { flex: none; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 9px; white-space: nowrap; }
.stock.ok { background: rgba(79, 154, 118, .15); color: var(--fresh-t); } .stock.part { background: rgba(216, 154, 36, .18); color: var(--aging-t); } .stock.none { background: rgba(192, 81, 60, .13); color: var(--old-t); }
.ings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ing { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.ing:last-child { border-bottom: 0; }
.mark { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.mark .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.mark.ok, .mark.unknown { background: var(--fresh); } .mark.part { background: var(--aging); } .mark.none { background: var(--old); }
.ing-t { flex: 1; min-width: 0; } .ing-t b { font-weight: 650; } .ing-t small { color: var(--ink-3); font-size: 12.5px; }
.ing-s { font-size: 12.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.ing.part .ing-s { color: var(--aging-t); } .ing.none .ing-s { color: var(--old-t); }
.addbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--marble-2); border: 1px solid var(--line); }
.addbar .btn { white-space: nowrap; flex: none; height: 46px; }
.sumtxt { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 15.5px; }
.steps li::marker { font: 600 15px var(--serif); color: var(--brass-dk); }
.serv { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-list { display: flex; flex-direction: column; gap: 6px; }
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.plan-row .row-name { white-space: normal; }
h3.sec { margin: 14px 0 2px; font: 600 15px var(--serif); letter-spacing: .08em; text-transform: uppercase; color: var(--brass-dk); }
h3.sec:first-child { margin-top: 0; }

/* ---- empty states ---- */
.empty { text-align: center; padding: 44px 24px 10px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.empty h3 { margin: 6px 0 0; font: 600 20px var(--serif); color: var(--ink); }
.empty p { margin: 0 0 8px; max-width: 28ch; font-size: 15px; }
.empty.small { padding-top: 28px; }

/* ---- floating add button ---- */
.fab { position: absolute; right: 16px; bottom: calc(var(--tabs-h) + var(--floor-h) + var(--safe-b) + 14px); width: 58px; height: 58px; border-radius: 50%; color: #fff; display: grid; place-items: center; background: radial-gradient(circle at 32% 26%, #dcbb7c, var(--brass) 55%, #94702f); box-shadow: 0 10px 22px -6px rgba(110, 80, 24, .55), inset 0 1px 0 rgba(255, 255, 255, .45); transition: transform .26s var(--ease), opacity .24s; z-index: 6; }
.fab .ic { width: 28px; height: 28px; stroke-width: 2.2; }
.fab:active { transform: scale(.9); }
.fab.gone, body[data-page="list"] .fab { opacity: 0; transform: scale(.6); pointer-events: none; }

/* ---- tab bar on the counter, tile floor beneath ---- */
.tabs { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); height: calc(var(--tabs-h) + var(--floor-h) + var(--safe-b)); padding-bottom: calc(var(--floor-h) + var(--safe-b)); background: linear-gradient(var(--tabs-a), var(--tabs-b)); border-top: 1px solid var(--line-2); box-shadow: 0 -8px 20px -14px rgba(60, 50, 30, .35); }
.tabs::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--floor-h) + var(--safe-b)); background: linear-gradient(rgba(255, 255, 255, .25), rgba(255, 255, 255, 0)), repeating-conic-gradient(from 45deg, var(--tile-a) 0 25%, var(--tile-b) 0 50%) 0 0 / 28px 14px; border-top: 2px solid var(--brass); pointer-events: none; }
.tab-ind { position: absolute; top: -1px; left: 0; width: 33.3333%; height: 3px; transform: translate3d(calc(var(--i, 0) * 100%), 0, 0); transition: transform .38s var(--ease); background: transparent; }
.tab-ind::after { content: ""; display: block; width: 44px; height: 3px; margin: 0 auto; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, var(--brass), var(--brass-2)); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 12px; font-weight: 650; letter-spacing: .02em; transition: color .2s; }
.tab .ic { width: 24px; height: 24px; transition: transform .3s var(--ease); }
.tab.on { color: var(--char); } .tab.on .ic { transform: translate3d(0, -1px, 0) scale(1.08); color: var(--brass-dk); }
.badge { position: absolute; top: 7px; left: calc(50% + 8px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--btn); color: var(--btn-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* ---- sheets ---- */
.sheet-root { position: fixed; inset: 0; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: rgba(32, 28, 22, .45); opacity: 0; transition: opacity .3s; }
.sheet-root.in .scrim { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 580px; max-height: 92dvh; display: flex; flex-direction: column; border-radius: 24px 24px 0 0; background: var(--card); box-shadow: 0 -16px 40px -12px rgba(30, 24, 12, .4); transform: translate3d(0, 102%, 0); transition: transform .38s var(--ease); pointer-events: auto; padding-bottom: var(--safe-b); }
.sheet.tall { height: 92dvh; }
.sheet-root.in .sheet { transform: translate3d(0, 0, 0); }
.sheet-root.out .sheet { transform: translate3d(0, 102%, 0); transition-duration: .28s; }
.sheet-root.out .scrim { opacity: 0; }
.sheet.drag { transition: none; }
.grab { display: grid; place-items: center; padding: 9px 0 2px; touch-action: none; cursor: grab; }
.grab span { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 2px 10px 6px 20px; touch-action: none; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; margin: 0; font: 600 22px var(--serif); letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px 24px; flex: 1; min-height: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.muted { color: var(--ink-2); margin: 0; font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.hint { font-size: 13px; color: var(--ink-3); }
.inp { width: 100%; height: 46px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--field); font-size: 16px; min-width: 0; }
.inp:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(176, 136, 74, .22); }
.inp.small { width: 76px; text-align: center; padding: 0 6px; }
.inp.area { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.45; }
.inp.code { text-align: center; font: 600 28px var(--serif); letter-spacing: .4em; height: 58px; padding-left: .4em; }
.inp.code.sm { font-size: 18px; letter-spacing: .2em; height: 46px; flex: 1; }
.pair { display: flex; align-items: center; gap: 10px; }
.pair .inp { flex: 1; }
.pre { color: var(--ink-2); font-size: 14.5px; white-space: nowrap; }
.shake { animation: shake .36s; border-color: var(--old) !important; }
@keyframes shake { 20%, 60% { transform: translate3d(-6px, 0, 0); } 40%, 80% { transform: translate3d(6px, 0, 0); } }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 26px; background: var(--tint); flex: none; }
.step-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--field); color: var(--char); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); transition: transform .16s var(--ease); }
.step-btn:active { transform: scale(.88); }
.step-val { width: 58px; height: 40px; text-align: center; border: 0; background: transparent; font-weight: 650; font-size: 17px; }
.step-val:focus { outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line-2); background: var(--field); font-weight: 600; font-size: 14.5px; color: var(--ink-2); transition: background .2s, color .2s, border-color .2s, transform .16s var(--ease); }
.chip:active { transform: scale(.95); }
.chip .ic { width: 18px; height: 18px; }
.chip.on { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.linkish { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 6px 2px; color: var(--brass-dk); font-weight: 650; font-size: 14.5px; }
.linkish .ic { width: 17px; height: 17px; }
.more { display: flex; flex-direction: column; gap: 14px; padding: 14px; border-radius: 14px; background: var(--marble); border: 1px solid var(--line); animation: rise .3s var(--ease); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: 14px; font-weight: 650; font-size: 16px; letter-spacing: .01em; transition: transform .16s var(--ease), background .2s, box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.wide { width: 100%; }
.btn.primary { background: var(--btn); color: var(--btn-ink); box-shadow: 0 8px 18px -8px rgba(30, 28, 24, .6); }
.btn.primary .ic { color: var(--btn-ic); }
.btn.ghost { background: var(--field); border: 1px solid var(--line-2); color: var(--char); }
.btn.danger { background: var(--old-t); color: #fff; }
.btn.danger-text, .danger-text { color: var(--old-t); }
.btn-row { display: flex; gap: 10px; } .btn-row > * { flex: 1; }
.agebox { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 12px; font-size: 14.5px; font-weight: 600; background: rgba(79, 154, 118, .12); color: var(--fresh-t); }
.agebox .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fresh); }
.agebox.s1 { background: rgba(216, 154, 36, .15); color: var(--aging-t); } .agebox.s1 .dot { background: var(--aging); }
.agebox.s2 { background: rgba(192, 81, 60, .12); color: var(--old-t); } .agebox.s2 .dot { background: var(--old); }
.ing-rows { display: flex; flex-direction: column; gap: 8px; }
.ing-row { display: grid; grid-template-columns: 58px 74px 1fr 36px; gap: 6px; align-items: center; }
.ing-row .inp { padding: 0 9px; height: 44px; font-size: 15.5px; }
.ing-row .icon-btn { width: 36px; height: 36px; }

/* settings / account */
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; }
.set-t { display: flex; flex-direction: column; } .set-t small { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.switch { flex: none; width: 52px; height: 32px; border-radius: 16px; background: var(--line-2); position: relative; transition: background .25s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .28s var(--ease); }
.switch.on { background: var(--brass); } .switch.on i { transform: translate3d(20px, 0, 0); }
.places { display: flex; flex-direction: column; gap: 10px; }
.place { padding: 12px; border-radius: 14px; background: var(--marble); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.place-top { display: flex; align-items: center; gap: 2px; } .place-top .inp { flex: 1; margin-right: 4px; }
.place-ages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); }
.place-ages .inp.small { width: 62px; height: 38px; }
.lead { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 4px 2px; }
.lead h3 { margin: 2px 0 0; font: 600 21px var(--serif); }
.msg { margin: 0; min-height: 0; color: var(--old-t); font-size: 14px; font-weight: 600; } .msg:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ts { display: flex; justify-content: center; } .ts:empty { display: none; }
.devnote { padding: 12px 14px; border-radius: 12px; background: rgba(216, 154, 36, .14); color: var(--aging-t); font-size: 14px; } .devnote strong { font: 700 18px var(--serif); letter-spacing: .15em; color: var(--char); }
.who { display: flex; align-items: center; gap: 12px; } .who small { display: block; color: var(--ink-3); font-size: 13px; } .who b { word-break: break-all; }
.members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; } .members li { display: flex; align-items: center; gap: 8px; color: var(--ink-2); } .members .ic { width: 18px; height: 18px; }
.invite { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 12px; border-radius: 14px; background: var(--marble); border: 1px dashed var(--brass); text-align: center; animation: rise .3s var(--ease); }
.invite strong { font: 700 30px var(--serif); letter-spacing: .22em; padding-left: .22em; color: var(--char); } .invite small { color: var(--ink-2); font-size: 13px; }
.joinrow { display: flex; gap: 8px; }

/* ---- toast ---- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--floor-h) + var(--safe-b) + 18px); z-index: 300; display: flex; align-items: center; gap: 12px; max-width: min(92vw, 460px); padding: 12px 16px; border-radius: 14px; background: var(--toast); color: #fff; font-size: 14.5px; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .5); opacity: 0; transform: translate3d(-50%, 14px, 0); transition: opacity .26s, transform .3s var(--ease); }
.toast.in { opacity: 1; transform: translate3d(-50%, 0, 0); }
.toast-act { color: var(--brass-2); font-weight: 700; padding: 4px 2px; }

/* first paint: gentle fade in */
body:not(.ready) .app { opacity: 0; }
.app { transition: opacity .4s; }

@media (min-width: 700px) {
  .wall { opacity: .6; }
  :root[data-theme="dark"] .wall { opacity: .9; }
  .app { margin-top: 18px; margin-bottom: 18px; height: calc(100dvh - 36px); border-radius: 26px; border: 1px solid rgba(120, 100, 60, .2); }
  .sheet { border-radius: 24px; bottom: 24px; max-height: calc(100dvh - 48px); }
  .sheet.tall { height: calc(100dvh - 48px); }
  :root { --safe-b: 0px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

input[list]::-webkit-calendar-picker-indicator { display: none !important; }

/* share block in settings */
.share-msg { padding: 12px 14px; border-radius: 12px; background: var(--marble); border: 1px dashed var(--brass); font-size: 14.5px; color: var(--ink-2); user-select: all; -webkit-user-select: all; word-break: break-word; }
.btn.ghost.done { border-color: var(--fresh); color: var(--fresh-t); }
