/* salt & sumac — Cover Wall. Tokens follow DESIGN.md. */
@font-face { font-family: "Antonio"; font-weight: 400; font-display: swap; src: url("fonts/antonio-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Antonio"; font-weight: 700; font-display: swap; src: url("fonts/antonio-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-display: swap; src: url("fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/hanken-grotesk-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-display: swap; src: url("fonts/hanken-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 600; font-display: swap; src: url("fonts/hanken-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 700; font-display: swap; src: url("fonts/hanken-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Young Serif"; font-weight: 400; font-display: swap; src: url("fonts/young-serif-latin-400-normal.woff2") format("woff2"); }

:root {
  --saffron: #F4B63F; --saffron-bright: #FFC657; --saffron-ink: #1B1404;
  --rose: #F29AB0; --rose-ground: #3A1C26;
  --ground: #0B0E13; --surface: #151922; --raised: #1F2430; --line: #2A303C; --stroke: #3A4150;
  --bone: #E8E6E3; --text-2: #A7ABB4; --text-3: #8B909A;
  --alert: #E8957F;  /* warnings and removal; never decoration */
  --cloth-navy: #2C4A6B; --cloth-gold: #E9C46A;
  --display: "Antonio", "Hanken Grotesk", sans-serif;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --gutter: 16px; --tile-gap: 10px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --cover-rest: 0 6px 14px -6px rgba(0,0,0,.7);
  --lift: 0 0 0 2px var(--saffron), 0 22px 40px -14px rgba(0,0,0,.9);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--ground); color: var(--bone);
  font: 400 15px/1.4 var(--sans); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
::selection { background: var(--saffron); color: var(--saffron-ink); }
input, textarea { caret-color: var(--saffron); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--stroke) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { display: block; }
a { color: var(--bone); text-underline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; position: relative; }
.view { min-height: 100dvh; padding-bottom: calc(100px + var(--safe-bottom)); }
.view.has-bar { padding-bottom: calc(110px + var(--safe-bottom)); }

/* ---------- type ---------- */
.display { font: 700 44px/.95 var(--display); letter-spacing: .015em; text-transform: uppercase; margin: 0; text-wrap: balance; }
.headline { font: 700 28px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; margin: 0; }
.row-heading { font: 700 21px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; margin: 0; }
.row-heading .count { font-weight: 400; color: var(--text-2); margin-left: 6px; }
.title-type { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.small { font-size: 13px; line-height: 1.35; color: var(--text-2); }
.label { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.wordmark { font: 700 28px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; margin: 0; }
.wordmark .amp { color: var(--saffron); font-weight: 400; padding: 0 .06em; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px;
  padding: calc(var(--safe-top) + 8px) var(--gutter) 10px; background: var(--ground);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 18px; background: linear-gradient(var(--ground), rgba(11,14,19,0)); pointer-events: none; }
.scan .topbar::after { display: none; }
.topbar.page { padding-top: calc(var(--safe-top) + 18px); padding-bottom: 14px; justify-content: space-between; }
.topbar .t { min-width: 0; flex: 1; }
.topbar .t .title-type { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.topbar .t .small { display: block; }
.topbar.page .meta { font: 400 21px/1 var(--display); letter-spacing: .04em; color: var(--text-2); }

/* ---------- buttons ---------- */
.icon-btn { width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; flex: none; transition: background-color .15s; }
.icon-btn:hover { background: var(--raised); }
.icon-btn svg { width: 22px; height: 22px; }
.btn { height: 44px; padding: 0 16px; border-radius: 6px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background-color .15s, border-color .15s, opacity .15s; }
.btn-confirm { background: var(--bone); color: var(--ground); font-weight: 700; }
.btn-confirm:hover { background: #fff; }
.btn-secondary { background: var(--surface); border: 1px solid var(--stroke); color: var(--bone); }
.btn-secondary:hover { border-color: var(--text-2); }
.btn-primary {
  width: 100%; height: 52px; border-radius: 6px; background: var(--saffron); color: var(--saffron-ink);
  font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background-color .15s, opacity .15s;
}
.btn-primary.with-icon { height: 56px; }
.btn-primary svg { width: 22px; height: 22px; }
.btn-primary:hover:not(:disabled) { background: var(--saffron-bright); }
.btn-primary:disabled { background: var(--raised); color: var(--text-3); }
.btn-wide { width: 100%; height: 52px; }
.link-btn { font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-2); display: inline-flex; align-items: center; gap: 2px; min-height: 44px; }
.link-btn svg { width: 15px; height: 15px; }
.link-btn:hover { color: var(--bone); }

/* ---------- bottom bars ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 520px; margin: 0 auto;
  padding: 12px var(--gutter) calc(12px + var(--safe-bottom)); background: var(--ground); border-top: 1px solid var(--line);
}
.actionbar .hint { font-size: 13px; color: var(--text-2); text-align: center; margin: 0 0 10px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 520px; margin: 0 auto;
  height: calc(84px + var(--safe-bottom)); padding: 8px 8px var(--safe-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr); background: var(--ground); border-top: 1px solid var(--line);
}
.tab { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 5px; padding-top: 6px; color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--bone); }
.tab[aria-current="page"] svg { stroke: var(--saffron); }
.tab:hover { color: var(--bone); }

/* ---------- covers ---------- */
.tile { width: 88px; flex: none; text-align: left; scroll-snap-align: start; }
.tile .cover { width: 100%; aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; background: var(--raised); box-shadow: var(--cover-rest); position: relative; }
.tile .cover img, .tile .cover svg { width: 100%; height: 100%; object-fit: cover; }
.tile .name { font-size: 12.5px; font-weight: 500; line-height: 1.3; margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .by { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile:hover .cover { transform: translateY(-2px); }
.tile .cover { transition: transform .2s var(--ease-out), filter .25s; }
.tile.sm { width: 76px; }

.row { margin-top: 22px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--gutter); margin-bottom: 10px; }
.strip { display: flex; gap: var(--tile-gap); overflow-x: auto; padding: 0 var(--gutter) 8px; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 18px var(--tile-gap); padding: 0 var(--gutter); }
.grid .tile { width: auto; }

.landing { animation: land .7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes land { from { transform: translateX(46px); opacity: 0; } }

.placeholder { width: 100%; aspect-ratio: 2/3; border-radius: 4px; background: var(--raised); position: relative; overflow: hidden; }
.placeholder::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(232,230,227,.07) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 1.6s ease-in-out infinite; }
@keyframes sheen { to { transform: translateX(100%); } }
.cover.pending { background: var(--raised); }
.cover.pending::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(232,230,227,.08) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 1.6s ease-in-out infinite; }
.cover.reveal > * { animation: reveal .6s var(--ease-out) both; }
.toggle-tile .cover.reveal > .mark { animation: none; }
@keyframes reveal { from { opacity: 0; filter: blur(6px); } }
.btn-primary.busy { position: relative; overflow: hidden; }
.btn-primary.busy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 25%, rgba(232,230,227,.12) 50%, transparent 75%); transform: translateX(-100%); animation: sheen 1.2s ease-in-out infinite; }
.queued { width: 100%; aspect-ratio: 2/3; border-radius: 4px; border: 1px dashed var(--stroke); }

/* ---------- lift & dim ---------- */
.wall { transition: filter .3s var(--ease-out); }
body.lifted .wall .cover, body.lifted .wall .placeholder { filter: brightness(.5) saturate(.7); }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(11,14,19,.35); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.focus-card {
  width: 300px; flex: none; background: var(--raised); border-radius: 6px; box-shadow: var(--lift);
  overflow: hidden; scroll-snap-align: center; display: flex; flex-direction: column;
}
.focus-card .band { display: flex; gap: 14px; padding: 14px; position: relative; }
.focus-card .band::before { content: ""; position: absolute; inset: 0; background: var(--tint, var(--stroke)); opacity: .32; }
.focus-card .band > * { position: relative; }
.focus-card .band .cover { width: 92px; flex: none; aspect-ratio: 2/3; border-radius: 4px; overflow: hidden; box-shadow: var(--cover-rest); background: var(--surface); }
.focus-card .band .cover img, .focus-card .band .cover svg { width: 100%; height: 100%; object-fit: cover; }
.focus-card .meta { min-width: 0; align-self: end; }
.focus-card .ftitle { font: 700 25px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; margin: 0 0 6px; overflow-wrap: anywhere; }
.focus-card .fauthor { font-size: 14px; margin: 0 0 4px; }
.focus-card .edition { font-size: 12.5px; color: var(--text-2); margin: 0; }
.focus-card .body { padding: 12px 14px 14px; display: grid; gap: 10px; }
.focus-card .readas { font-size: 13px; font-style: italic; color: var(--text-2); margin: 0; }
.focus-card .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.focus-card .flag { font-size: 13px; color: var(--text-2); margin: 0; display: flex; gap: 6px; align-items: start; }
.focus-card .flag svg { width: 16px; height: 16px; flex: none; margin-top: 1px; stroke: var(--saffron); }
.alt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border: 1px solid var(--stroke); border-radius: 6px; text-align: left; width: 100%; transition: border-color .15s; }
.alt:hover { border-color: var(--text-2); }
.alt .thumb { width: 26px; aspect-ratio: 2/3; border-radius: 2px; overflow: hidden; flex: none; background: var(--surface); }
.alt .thumb img, .alt .thumb svg { width: 100%; height: 100%; object-fit: cover; }
.alt .t { font-size: 12.5px; line-height: 1.3; min-width: 0; }
.alt .t b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* change cover */
.picker { display: flex; gap: var(--tile-gap); overflow-x: auto; margin: 0 -14px; padding: 4px 14px 6px; scroll-snap-type: x mandatory; scroll-padding-inline: 14px; scrollbar-width: none; }
.picker::-webkit-scrollbar { display: none; }
.pick { width: 76px; flex: none; text-align: left; scroll-snap-align: start; }
.pick .cover { display: block; width: 100%; aspect-ratio: 2/3; border-radius: 4px; overflow: hidden; background: var(--surface); box-shadow: var(--cover-rest); transition: box-shadow .15s; }
.pick .cover img, .pick .cover svg { width: 100%; height: 100%; object-fit: cover; }
.pick .src { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.pick.on .cover { box-shadow: 0 0 0 2px var(--saffron), var(--cover-rest); }
.pick.on .src { color: var(--bone); }

/* shelf book detail */
.detail { position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%); z-index: 50; width: min(340px, calc(100vw - 32px)); animation: rise .35s var(--ease-out) both; }
.detail .focus-card { width: 100%; }
@keyframes rise { from { transform: translate(-50%, 24px); opacity: 0; } }
@keyframes drop { from { transform: translate(-50%, -16px); opacity: 0; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- shelf ---------- */
.empty { padding: 28px var(--gutter) 0; }
.empty .display { margin: 8px 0 12px; }
.empty p { max-width: 330px; color: var(--text-2); margin: 0 0 22px; }
.ghost-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--tile-gap); margin: 0 0 26px; }
.ghost-wall span { aspect-ratio: 2/3; border-radius: 4px; border: 1px dashed var(--stroke); }
.ghost-wall span:nth-child(2n) { transform: translateY(14px); }

/* ---------- add ---------- */
.hero { position: relative; height: 300px; overflow: hidden; margin-bottom: 4px; }
.hero .wallbg { position: absolute; inset: -20px -30px 0; display: grid; grid-template-columns: repeat(5, 76px); gap: var(--tile-gap); justify-content: center; filter: brightness(.42) saturate(.75); transform: rotate(-4deg); }
.hero .wallbg > * { aspect-ratio: 2/3; border-radius: 4px; overflow: hidden; box-shadow: var(--cover-rest); }
.hero .wallbg > :nth-child(5n+2), .hero .wallbg > :nth-child(5n+4) { transform: translateY(38px); }
.hero .wallbg img, .hero .wallbg svg { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(11,14,19,.15), rgba(11,14,19,.35) 45%, var(--ground) 96%); }
.hero .copy { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 14px; z-index: 1; }
.hero .copy p { margin: 10px 0 0; color: var(--text-2); max-width: 330px; }
.hero .close { position: absolute; top: calc(var(--safe-top) + 8px); left: 8px; z-index: 2; }
.options { display: grid; gap: 10px; padding: 0 var(--gutter); }
.option { display: flex; gap: 14px; align-items: center; text-align: left; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-height: 76px; transition: border-color .15s, background-color .15s; }
.option:hover { border-color: var(--stroke); background: #181c26; }
.option .ic { width: 40px; height: 40px; border-radius: 20px; background: var(--raised); display: grid; place-items: center; flex: none; }
.option .ic svg { width: 22px; height: 22px; }
.option b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.option span { font-size: 13px; color: var(--text-2); }
.option .chev { margin-left: auto; width: 18px; height: 18px; color: var(--text-3); flex: none; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--text-2); }
.input { height: 48px; border-radius: 6px; border: 1px solid var(--stroke); background: var(--surface); color: var(--bone); font: 400 16px var(--sans); padding: 0 14px; width: 100%; transition: border-color .15s; }
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--saffron); outline: none; }
.form { display: grid; gap: 14px; padding: 4px var(--gutter) 0; }
.error { color: var(--alert); font-size: 13px; margin: 0; }
.notice { margin: 12px var(--gutter) 0; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--text-2); }
.notice b { color: var(--bone); font-weight: 600; }

/* ---------- scan ---------- */
.scan { position: fixed; inset: 0; z-index: 35; background: #000; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan .topbar { background: linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,0)); position: relative; }
.reticle { position: absolute; left: 50%; top: 40%; width: min(78vw, 320px); height: 150px; transform: translate(-50%, -50%); border-radius: 8px; box-shadow: 0 0 0 100vmax rgba(11,14,19,.45); pointer-events: none; }
.reticle::before, .reticle::after { content: ""; position: absolute; inset: -2px; border-radius: 10px; border: 2px solid var(--bone); clip-path: polygon(0 0, 22% 0, 22% 100%, 0 100%, 0 0, 100% 0, 100% 100%, 78% 100%, 78% 0); opacity: .9; }
.reticle::after { border: 0; inset: auto 12px 50% 12px; height: 2px; background: var(--saffron); opacity: .85; clip-path: none; animation: scanline 2.2s ease-in-out infinite alternate; }
@keyframes scanline { from { transform: translateY(-44px); } to { transform: translateY(44px); } }
.reticle.hit::before { border-color: var(--saffron); }
.scan .caption { position: absolute; left: 0; right: 0; top: calc(40% + 92px); text-align: center; font-size: 14px; color: var(--bone); text-shadow: 0 1px 8px rgba(0,0,0,.8); padding: 0 24px; }
.tray { margin-top: auto; position: relative; background: var(--ground); border-top: 1px solid var(--line); padding: 14px 0 calc(12px + var(--safe-bottom)); }
.tray .row-head { margin-bottom: 10px; }
.tray .strip { min-height: 120px; }
.tray .tile { width: 64px; }
.tray .tile .name { font-size: 11.5px; }
.tray .bar { padding: 4px var(--gutter) 0; display: grid; gap: 8px; }
.camera-off { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 32px; gap: 12px; background: var(--ground); }
.camera-off p { color: var(--text-2); max-width: 300px; margin: 0 auto; }
.manual { display: flex; gap: 8px; padding: 0 var(--gutter); }
.manual .input { height: 44px; }

/* ---------- review ---------- */
.review-head { padding: 6px var(--gutter) 0; }
.review-head p { margin: 8px 0 0; color: var(--text-2); max-width: 330px; }
.checks { display: flex; gap: 14px; overflow-x: auto; padding: 6px var(--gutter) 30px; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.checks::-webkit-scrollbar { display: none; }
.checks .focus-card { scroll-snap-align: start; }
.toggle-tile { position: relative; }
.toggle-tile .tile-open { display: block; width: 100%; text-align: left; }
.toggle-tile .mark::before { content: ""; position: absolute; inset: -11px; }
.links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.detail .focus-card { max-height: calc(100dvh - 48px - var(--safe-top) - var(--safe-bottom)); overflow-y: auto; }
.toggle-tile.off .cover { filter: brightness(.4) saturate(.5); }
.toggle-tile .mark { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 11px; background: var(--bone); color: var(--ground); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.toggle-tile .mark svg { width: 14px; height: 14px; stroke-width: 2.6; }
.toggle-tile.off .mark { background: var(--raised); color: var(--text-2); border: 1px solid var(--stroke); }
.reason { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.done-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 2px 0; }
.done-check svg { width: 16px; height: 16px; stroke: var(--bone); }

.retry { display: flex; gap: 8px; }
.retry .input { height: 44px; font-size: 15px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; top: calc(var(--safe-top) + 14px); transform: translateX(-50%); z-index: 60; background: var(--bone); color: var(--ground); font-size: 14px; font-weight: 600; padding: 12px 16px; border-radius: 6px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.8); animation: drop .3s var(--ease-out) both; max-width: calc(100vw - 32px); }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 var(--gutter) calc(28px + var(--safe-bottom)); }
.login .wordmark { font-size: 56px; line-height: .92; }
.login p { color: var(--text-2); margin: 12px 0 28px; max-width: 320px; }
.login .ghost-wall { margin-bottom: 40px; }

/* ---------- you ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 var(--gutter); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.stat b { display: block; font: 700 28px/1 var(--display); }
.stat span { font-size: 12.5px; color: var(--text-2); }
.prose { padding: 0 var(--gutter); color: var(--text-2); font-size: 14px; max-width: 420px; }

@media (prefers-reduced-motion: reduce) {
  .landing, .placeholder::after, .cover.pending::after, .cover.reveal > *, .btn-primary.busy::after, .reticle::after, .detail, .toast, .scrim { animation: none !important; }
  .tile .cover, .wall { transition: none; }
}

/* ---- beta: welcome, ownership check, You tab extras */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; padding-top: var(--safe-top); }
.welcome-art { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px var(--gutter) 16px; overflow: hidden; }
.welcome-art > * { width: 100%; max-width: 420px; animation: welcomeIn .6s var(--ease-out) both; }
.welcome-art .wallbg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--tile-gap); }
.welcome-art .option { margin-bottom: 10px; }
.welcome-copy { padding: 0 var(--gutter) 140px; }
.welcome-copy p { color: var(--text-2); font-size: 16px; line-height: 1.5; max-width: 36ch; margin: 14px 0 0; }
.dots-step { display: flex; gap: 6px; margin-bottom: 18px; }
.dots-step i { width: 18px; height: 3px; border-radius: 2px; background: var(--stroke); transition: background .3s, width .3s var(--ease-out); }
.dots-step i.on { background: var(--bone); width: 30px; }
.welcome .actionbar { display: flex; flex-direction: column; align-items: center; }
@keyframes welcomeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.verdict { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 8px; background: var(--raised); animation: welcomeIn .4s var(--ease-out) both; }
.verdict.yes { box-shadow: 0 0 0 2px var(--saffron) inset; }
.verdict .cover { flex: none; }
.meter { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--bone); border-radius: 4px; transition: width .6s var(--ease-out); }
.user-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.user-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .small { grid-column: 1; }
.user-row .link-btn { grid-column: 2; grid-row: 1 / span 2; }
.invite { padding: 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); animation: welcomeIn .35s var(--ease-out) both; }
.danger { color: var(--alert) !important; }
details.owner summary { cursor: pointer; color: var(--text-2); min-height: 44px; display: flex; align-items: center; }
details.owner summary::-webkit-details-marker { display: none; }
@media (prefers-reduced-motion: reduce) { .welcome-art > *, .verdict, .invite { animation: none; } }
a.btn, a.btn-primary { text-decoration: none; }

/* ---- contents, recipes and bookmarks */
.contents-link { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; margin: 4px 0 2px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 56px; transition: border-color .15s; }
.contents-link:hover { border-color: var(--stroke); }
.contents-link svg { width: 20px; height: 20px; color: var(--text-2); }
.contents-link b { display: block; font-weight: 600; }
.contents-link span span { display: block; font-size: 13px; color: var(--text-2); }
.book-view { padding-bottom: 40px; }
.book-hero { display: flex; gap: 16px; align-items: center; padding: 8px var(--gutter) 18px; margin-bottom: 6px; background: linear-gradient(color-mix(in srgb, var(--tint) 22%, transparent), transparent); }
.book-hero .cover { width: 76px; flex: none; }
.toc-sec { padding: 0 var(--gutter); }
.toc-h { font-size: 17px; color: var(--text-2); margin: 22px 0 6px; }
.recipe-list { display: flex; flex-direction: column; }
.recipe-row { display: flex; gap: 12px; align-items: center; min-height: 52px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rr-cover { width: 34px; flex: none; padding: 0; }
.rr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rr-t { font-size: 15px; line-height: 1.3; }
.rr-b { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-p { font-size: 13px; color: var(--text-2); white-space: nowrap; font-feature-settings: "tnum"; }
.marks { display: flex; flex: none; }
.mark-btn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--text-3); border-radius: 22px; transition: color .2s, transform .2s var(--ease-out); }
.mark-btn svg { width: 20px; height: 20px; }
.mark-btn:hover { color: var(--bone); }
.mark-btn.on { color: var(--bone); }
.mark-btn.on svg { fill: currentColor; }
.mark-btn.pop { animation: markPop .4s var(--ease-out); }
@keyframes markPop { 40% { transform: scale(1.3); } }
.recipe-card { flex: none; width: 150px; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 0; }
.recipe-card .cover { width: 64px; margin-bottom: 4px; }
.rc-t { font-size: 13.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-b { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc-edit { padding: 0 var(--gutter); display: flex; flex-direction: column; gap: 8px; }
.te-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 44px; grid-template-areas: "t p a" "s s s"; gap: 6px; align-items: center; padding: 6px; border-radius: 8px; border: 1px solid transparent; transition: border-color .2s, background-color .2s; }
.te-row.flagged { border-color: var(--saffron); background: rgba(244, 182, 63, .06); }
.te-row .input { min-height: 44px; }
.te-p { text-align: center; }
.te-ok { color: var(--saffron); }
.te-x { color: var(--text-3); }
.te-s { grid-column: 1 / -1; font-size: 12px; color: var(--text-3); padding-left: 2px; }
@media (prefers-reduced-motion: reduce) { .mark-btn.pop { animation: none; } }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--raised); color: var(--bone); font-size: 12px; font-weight: 600; font-feature-settings: "tnum"; border-radius: 4px; padding: 5px 7px; white-space: nowrap; }
.chip-first { display: inline-flex; background: var(--rose-ground); color: var(--rose); font-size: 12px; font-weight: 600; border-radius: 4px; padding: 4px 6px; white-space: nowrap; }
/* ---- shelf space */
.spaces { display: flex; gap: 6px; }
.spaces i { flex: 1; max-width: 56px; height: 6px; border-radius: 3px; background: var(--raised); transition: background .4s; }
.spaces i.on { background: var(--saffron); }
.full-panel { margin: 18px var(--gutter); padding: 18px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.full-panel .spaces { margin-bottom: 14px; }
.earn { display: flex; gap: 8px; align-items: flex-start; color: var(--bone); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: 14px; }
.earn svg { width: 18px; height: 18px; flex: none; color: var(--saffron); margin-top: 1px; }
.celebrate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(11, 14, 19, .6); animation: celFade .3s ease-out both; }
.cel-card { position: relative; max-width: 320px; text-align: center; background: var(--raised); border-radius: 8px; padding: 26px 22px 22px; box-shadow: var(--lift); animation: celUp .5s var(--ease-out) both; }
.cel-burst { position: absolute; left: 50%; top: 0; width: 0; height: 0; }
.cel-burst i { position: absolute; width: 6px; height: 14px; border-radius: 2px; background: var(--saffron); opacity: 0; animation: burst .9s var(--ease-out) forwards; }
.cel-burst i:nth-child(odd) { background: var(--bone); }
.cel-burst i:nth-child(1) { --r: -80deg } .cel-burst i:nth-child(2) { --r: -60deg } .cel-burst i:nth-child(3) { --r: -40deg } .cel-burst i:nth-child(4) { --r: -20deg } .cel-burst i:nth-child(5) { --r: 0deg }
.cel-burst i:nth-child(6) { --r: 20deg } .cel-burst i:nth-child(7) { --r: 40deg } .cel-burst i:nth-child(8) { --r: 60deg } .cel-burst i:nth-child(9) { --r: 80deg } .cel-burst i:nth-child(10) { --r: 100deg }
@keyframes burst { 0% { opacity: 1; transform: rotate(var(--r)) translateY(0); } 100% { opacity: 0; transform: rotate(var(--r)) translateY(-70px); } }
@keyframes celFade { from { opacity: 0; } }
@keyframes celUp { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .celebrate, .cel-card, .cel-burst i { animation: none; } .cel-burst { display: none; } }
.book-hero .cover, .recipe-card .cover, .rr-cover .cover, .verdict .cover { aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; background: var(--raised); box-shadow: var(--cover-rest); position: relative; }
.book-hero .cover img, .book-hero .cover svg, .recipe-card .cover img, .recipe-card .cover svg, .rr-cover .cover img, .rr-cover .cover svg, .verdict .cover img, .verdict .cover svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.rr-cover .cover { width: 34px; }

/* ---- recipes and cooking mode */
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; padding: 4px 0; min-height: 44px; justify-content: center; }
.rr-main:hover .rr-t { color: var(--saffron-bright); }
.ready { display: inline-flex; vertical-align: -3px; margin-left: 4px; color: var(--text-2); white-space: nowrap; }
.ready svg { width: 16px; height: 16px; }
.recipe-view { padding-bottom: 120px; }
.recipe-hero { padding: 6px var(--gutter) 6px; }
.rec-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 3px; }
.seg button { min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 19px; color: var(--text-2); font-weight: 600; font-size: 14px; font-feature-settings: "tnum"; transition: background-color .2s, color .2s; }
.seg button.on { background: var(--bone); color: var(--ground); }
.rec-sec { padding: 22px var(--gutter) 0; }
.rec-sec .row-heading { margin-bottom: 10px; }
.grp { margin: 12px 0 4px; }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr); gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.35; }
.ia { font-weight: 700; font-feature-settings: "tnum"; white-space: nowrap; color: var(--bone); }
.in { color: var(--text-2); }
.approx { color: var(--text-2); font-weight: 400; margin-right: 2px; }
.step-list { margin: 0; padding: 0 0 0 22px; }
.step-list li { padding: 0 0 18px 6px; font-size: 16px; line-height: 1.55; }
.step-list li::marker { font: 700 18px var(--display); color: var(--text-2); }
.step-list p { margin: 0; max-width: 62ch; }
.uses { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.use { background: var(--raised); border-radius: 4px; padding: 3px 8px; font-size: 13.5px; color: var(--text-2); }
.use b { color: var(--bone); font-weight: 700; }
.step-timer { display: inline-flex; gap: 4px; align-items: center; margin-top: 8px; }
.step-timer svg { width: 15px; height: 15px; }
textarea.input { min-height: 88px; padding-top: 12px; padding-bottom: 12px; line-height: 1.45; resize: vertical; font: inherit; }
.ing-edit { padding: 0 var(--gutter); display: flex; flex-direction: column; gap: 6px; }
.ie-row { display: grid; grid-template-columns: 56px 60px minmax(0, 1fr) 44px; gap: 6px; align-items: center; }
.ie-row .input { min-height: 44px; }
.reading-lines { display: grid; gap: 10px; margin: 16px 0; }
.reading-lines i { height: 12px; border-radius: 3px; background: var(--raised); position: relative; overflow: hidden; }
.reading-lines i:nth-child(2) { width: 80%; } .reading-lines i:nth-child(4) { width: 55%; }
.reading-lines i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(232,230,227,.1) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 1.6s ease-in-out infinite; }
.cook { position: fixed; inset: 0; z-index: 50; background: var(--ground); display: flex; flex-direction: column; padding: calc(var(--safe-top) + 8px) var(--gutter) calc(var(--safe-bottom) + 16px); }
.cook-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cook-bar { height: 3px; background: var(--raised); border-radius: 2px; margin: 10px 0 0; overflow: hidden; }
.cook-bar i { display: block; height: 100%; background: var(--bone); transition: width .5s var(--ease-out); }
.cook-body { flex: 1; overflow-y: auto; padding: 28px 0 16px; animation: welcomeIn .45s var(--ease-out); }
.cook-text { font-size: clamp(24px, 6.4vw, 34px); line-height: 1.35; margin: 0 0 20px; max-width: 30ch; }
.uses.big .use { font-size: 17px; padding: 6px 10px; }
.cook-timer { display: inline-flex; align-items: center; gap: 10px; margin-top: 24px; min-height: 56px; padding: 0 22px; border-radius: 28px; border: 1px solid var(--stroke); background: var(--surface); color: var(--bone); font-weight: 600; font-size: 20px; font-feature-settings: "tnum"; }
.cook-timer svg { width: 22px; height: 22px; }
.cook-timer.run { border-color: var(--saffron); }
.cook-timer.done { background: var(--saffron); color: var(--saffron-ink); border-color: var(--saffron); animation: markPop .5s var(--ease-out) 3; }
.cook-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.cook-nav .btn, .cook-nav .btn-primary { min-height: 56px; }
@media (prefers-reduced-motion: reduce) { .cook-body, .cook-timer.done { animation: none; } }

/* ---- cook log, timing, shopping list */
.tabbar { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rec-actions { display: flex; gap: 8px; margin-top: 12px; }
.rec-actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.rec-actions .btn svg { width: 18px; height: 18px; }
.eat-row { display: flex; align-items: center; gap: 12px; }
.eat-row .input { width: 140px; font-feature-settings: "tnum"; }
.start-by { font-size: 17px; margin: 12px 0 10px; }
.start-by b { font: 700 28px/1 var(--display); letter-spacing: .02em; margin-left: 4px; }
.tl { display: flex; gap: 3px; height: 12px; }
.tl i { border-radius: 2px; background: var(--raised); min-width: 6px; }
.tl i.timed { background: var(--bone); }
.log-list { display: flex; flex-direction: column; }
.log-row { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.log-d { font-size: 14px; font-feature-settings: "tnum"; }
.log-w, .log-c { grid-column: 1 / -1; font-size: 14px; color: var(--text-2); }
.log-c { font-style: italic; color: var(--bone); }
.dots-r { display: inline-flex; gap: 2px; justify-self: end; }
.dots-r i { display: grid; color: var(--stroke); }
.dots-r svg { width: 13px; height: 13px; }
.dots-r i.f { color: var(--bone); }
.dots-r i.f svg { fill: currentColor; }
.sheet-wrap { position: fixed; inset: 0; z-index: 55; display: flex; align-items: flex-end; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(11, 14, 19, .7); }
.sheet { position: relative; width: 100%; max-width: 560px; margin: 0 auto; background: var(--raised); border-radius: 12px 12px 0 0; padding: 22px var(--gutter) calc(var(--safe-bottom) + 18px); animation: sheetUp .4s var(--ease-out); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
.who { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.who-chip { min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--stroke); color: var(--text-2); font-weight: 600; font-size: 14px; }
.who-chip.on { background: var(--bone); color: var(--ground); border-color: var(--bone); }
.who-in { width: 140px; height: 38px; border-radius: 19px; font-size: 14px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 18px; }
.list-recipes { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 var(--gutter) 6px; }
.lr-chip { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 19px; padding-left: 12px; }
.lr-open { font-size: 14px; font-weight: 600; min-height: 44px; }
.lr-x { width: 44px; height: 44px; display: grid; place-items: center; color: var(--text-3); }
.lr-x svg { width: 14px; height: 14px; }
.aisle { padding: 18px var(--gutter) 0; }
.aisle .row-heading { font-size: 17px; color: var(--text-2); margin-bottom: 4px; }
.li-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); cursor: pointer; }
.li-row input { position: absolute; opacity: 0; pointer-events: none; }
.li-box { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--stroke); display: grid; place-items: center; color: transparent; transition: background-color .15s, border-color .15s; }
.li-box svg { width: 16px; height: 16px; }
.li-row input:checked + .li-box { background: var(--bone); border-color: var(--bone); color: var(--ground); }
.li-row input:focus-visible + .li-box { outline: 2px solid var(--saffron); outline-offset: 2px; }
.li-name { font-size: 16px; text-transform: lowercase; }
.li-name::first-letter { text-transform: uppercase; }
.li-amt { font-weight: 700; font-feature-settings: "tnum"; color: var(--bone); white-space: nowrap; }
.li-row.got .li-name, .li-row.got .li-amt { color: var(--text-3); text-decoration: line-through; }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

/* ---- dishes: photos of what you could make (Phase 4) ---- */
.dish { flex: none; width: 150px; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 0; scroll-snap-align: start; }
.dish-img { display: block; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden; background: var(--raised); box-shadow: var(--cover-rest); }
.dish-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
.dish:active .dish-img img { transform: scale(.98); }
.dish .rc-t { font-weight: 600; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish .rc-b { color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px 12px; padding: 0 var(--gutter) 120px; }
.dish.big { width: auto; }
.dish-grid .dish:nth-child(3n+1) .dish-img { aspect-ratio: 4 / 5.6; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 var(--gutter) 16px; scrollbar-width: none; }
.chips .chip { min-height: 36px; padding: 0 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 14px; }
.chips .chip.on { background: var(--bone); border-color: var(--bone); color: var(--ground); }
.dish-hero { margin: 0 0 4px; aspect-ratio: 4 / 3; max-height: 52vh; overflow: hidden; background: var(--raised); }
.dish-hero img { display: block; width: 100%; height: 100%; object-fit: cover; animation: heroIn .7s var(--ease-out) both; }
@keyframes heroIn { from { opacity: 0; transform: scale(1.03); } }
.kept-photo { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; margin: 10px var(--gutter) 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.kept-photo img { width: 84px; height: 84px; object-fit: cover; border-radius: 4px; display: block; }
.kept-photo p { margin: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid figure { position: relative; margin: 0; }
.photo-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.photo-grid figcaption { margin-top: 4px; }
.ph-x { position: absolute; top: 0; right: 0; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(11,14,19,.72); color: var(--bone); }
.ph-x svg { width: 16px; height: 16px; }

/* ---- fit to my pan / what I have ---- */
.fit-btn { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.fit-btn svg { width: 18px; height: 18px; }
.fit-btn.on { background: var(--bone); color: var(--ground); border-color: var(--bone); }
.fit-note { margin: 10px 0 0; }
.fit-note .link-btn { display: inline; padding: 0; min-height: 0; color: var(--bone); text-decoration: underline; text-underline-offset: 3px; letter-spacing: .04em; }
.seg-wide { display: flex; width: 100%; }
.seg-wide button { flex: 1; }
.fit-out { font: 400 17px/1.3 var(--sans); color: var(--text-2); margin: 16px 0 6px; min-height: 24px; }
.fit-out b { font: 700 30px/1 var(--display); color: var(--bone); letter-spacing: .01em; margin-right: 4px; }
.have-row { display: flex; align-items: center; gap: 10px; }
.have-row .input { flex: 1; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

/* ---- Plus ---- */
.plus-list { margin: 0; padding: 0 0 0 18px; color: var(--bone); display: grid; gap: 4px; }
.plus-list li::marker { color: var(--text-3); }
.plus-tag { font-size: 11px; font-weight: 700; color: var(--ground); background: var(--bone); border-radius: 3px; padding: 1px 5px; margin-left: 4px; vertical-align: 1px; }
.user-row .ur-acts { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.user-row .ur-acts .link-btn { grid-column: auto; grid-row: auto; }

/* ---- Phase 5: planning tabs ---- */
.list-seg { margin: 0 var(--gutter) 16px; width: auto; }
.seg a { flex: 1; min-height: 44px; display: grid; place-items: center; padding: 0 10px; border-radius: 19px; color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: none; transition: background-color .2s, color .2s; }
.seg a.on { background: var(--bone); color: var(--ground); }
.make-cta { display: flex; align-items: center; gap: 12px; margin: 6px var(--gutter) 4px; padding: 14px 14px 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--bone); text-decoration: none; }
.make-cta > span { flex: 1; display: grid; gap: 2px; }
.make-cta b { font-size: 16px; }
.make-cta svg { width: 18px; height: 18px; color: var(--text-2); }
#res .make-cta { margin-top: 0; }

/* what can I make */
.pantry { padding: 4px var(--gutter) 0; }
.pantry-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.p-chip, .p-sugg { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 22px; font-size: 14px; font-weight: 600; }
.p-chip { background: var(--bone); color: var(--ground); }
.p-chip svg { width: 14px; height: 14px; }
.p-sugg { background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.p-sugg svg { width: 14px; height: 14px; }
.p-in { flex: 1 1 180px; min-height: 40px; }
.make-list { display: grid; gap: 4px; }
.make-row { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--bone); }
.make-row img, .mk-cover { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; overflow: hidden; display: block; background: var(--raised); }
.mk-cover svg, .mk-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk-t { display: grid; gap: 1px; min-width: 0; }
.mk-t b { font-weight: 600; font-size: 15px; }
.mk-need { color: var(--text-2); font-size: 13px; }
.mk-ok { color: var(--bone); font-size: 13px; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.mk-ok svg { width: 14px; height: 14px; }

/* freezer */
.frz-list { padding: 0 var(--gutter); }
.frz-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.frz-row.old .frz-name::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--alert); margin: 0 8px 2px 0; vertical-align: middle; }
.frz-main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.frz-name { text-align: left; font-weight: 600; font-size: 16px; color: var(--bone); padding: 0; min-height: 44px; display: inline-flex; align-items: center; }
.use-soon { color: var(--alert); font-weight: 700; }
.stepper { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.stepper button { width: 44px; height: 44px; font-size: 20px; color: var(--bone); }
.stepper b { min-width: 26px; text-align: center; font-size: 16px; }
.frz-add { padding: 18px var(--gutter) 0; }
.frz-two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.froze-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.froze-row .li-row { flex: 1; }
.froze-n { width: 64px; min-height: 40px; text-align: center; }

/* get-togethers */
.ev-list { padding: 0 var(--gutter); }
.ev-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--bone); text-decoration: none; }
.ev-row b { font-size: 16px; }
.ev-row .small { grid-column: 1; }
.ev-row svg { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 18px; height: 18px; color: var(--text-3); }
.ev-rec { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ev-t { flex: 1; text-align: left; display: grid; gap: 1px; color: var(--bone); font-weight: 600; padding: 0; min-width: 0; }
.ev-rec .seg button { min-height: 44px; padding: 0 10px; font-size: 13px; }
.picker { margin-top: 10px; display: grid; gap: 8px; }
.pick-list { display: grid; max-height: 46vh; overflow: auto; }
.pick-row { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 0 10px; padding: 10px 0; min-height: 52px; border-bottom: 1px solid var(--line); color: var(--bone); }
.pick-row b { font-weight: 600; }
.pick-row .small { grid-column: 1; }
.pick-row svg { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 18px; height: 18px; color: var(--text-2); }
.gantt { display: grid; gap: 12px; }
.g-row { display: grid; gap: 6px; }
.g-lab { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.g-lab b { font-weight: 600; font-size: 14px; }
.g-track { position: relative; height: 10px; background: var(--surface); border-radius: 5px; }
.g-track i { position: absolute; top: 0; bottom: 0; background: var(--bone); border-radius: 5px; animation: grow .7s var(--ease-out) both; transform-origin: right; }
@keyframes grow { from { transform: scaleX(0); } }
.g-eat .g-track { background: none; height: auto; border-top: 2px dashed var(--stroke); }
.g-eat .g-track span { position: absolute; right: 0; top: 6px; font-size: 13px; font-weight: 700; color: var(--bone); }

/* year in cooking */
.yr { padding: 4px var(--gutter) 0; }
.yr section { margin-top: 30px; }
.yr-big { display: grid; gap: 14px; }
.yr-big div { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.yr-big b { font: 700 64px/0.9 var(--display); color: var(--bone); min-width: 1.6em; }
.yr-big span { color: var(--text-2); font-size: 16px; }
.yr-months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 130px; align-items: end; }
.yr-months div { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 6px; }
.yr-months i { align-self: end; background: var(--stroke); border-radius: 3px 3px 0 0; animation: rise .8s var(--ease-out) both; transform-origin: bottom; }
.yr-months i.peak { background: var(--bone); }
.yr-months span { text-align: center; font-size: 11px; color: var(--text-3); }
@keyframes rise { from { transform: scaleY(0); } }
.yr-books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.yr-book { position: relative; display: grid; gap: 4px; text-align: left; padding: 0; color: var(--bone); }
.yr-book .cover { aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; box-shadow: var(--cover-rest); background: var(--raised); }
.yr-book .cover img, .yr-book .cover svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.yr-book b { font-weight: 600; font-size: 13px; line-height: 1.25; }
.yr-n { position: absolute; top: -8px; left: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--bone); color: var(--ground); font: 700 14px/26px var(--sans); text-align: center; }
.yr-rec { display: grid; grid-template-columns: 1fr auto; width: 100%; text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--bone); gap: 0 10px; }
.yr-rec b { font-weight: 600; }
.yr-rec .small { grid-column: 1; }
.yr-x { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: 700 24px/1 var(--display); color: var(--bone); }
.yr-stars { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.yr-people { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 12px 0 0; line-height: 1.5; }
.yr-people b { font-weight: 600; }
.yr-pick { width: auto; min-height: 38px; }
.opt-name { text-transform: none; }
.btn > svg, .btn-primary > svg { width: 18px; height: 18px; flex: none; }
.btn-wide { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.g-eat .g-track { height: 26px; }
.yr-big b { min-width: 0; }

/* ---- review fixes ---- */
.toast { display: flex; align-items: center; gap: 14px; }
.toast-act { min-height: 36px; padding: 0 12px; margin: -6px -8px -6px 0; border-radius: 6px; font-weight: 700; color: var(--ground); background: rgba(11,14,19,.1); letter-spacing: .02em; }
.toast-act:hover { background: rgba(11,14,19,.18); }
/* book card: Contents leads; Remove is a quiet link with a clear consequence */
.contents-link.lead { grid-template-columns: 22px minmax(0, 1fr) auto 16px; background: var(--bone); color: var(--ground); border-color: var(--bone); }
.contents-link.lead:hover { border-color: #fff; background: #fff; }
.contents-link.lead svg { color: var(--ground); }
.contents-link.lead span span { color: #4A4F59; }
.contents-link.lead .chip { background: var(--ground); color: var(--bone); }
.card-links { display: flex; justify-content: space-between; align-items: center; margin: -2px -2px 0; }
.rm-note { margin: 0; color: var(--alert); }
.detail .card-x { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(11,14,19,.6); }
.detail .card-x:hover { background: rgba(11,14,19,.85); }
/* want-to-make tiles show your dish when there is one */
.rc-photo { width: 64px; aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; margin-bottom: 4px; box-shadow: var(--cover-rest); background: var(--raised); }
.rc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* log a bake: stars first, details on request */
.stars { display: flex; gap: 4px; }
.stars button { width: 48px; height: 48px; display: grid; place-items: center; color: var(--stroke); border-radius: 24px; transition: color .15s, transform .2s var(--ease-out); }
.stars button svg { width: 34px; height: 34px; }
.stars button.on { color: var(--bone); }
.stars button.on svg { fill: currentColor; }
.stars button:active { transform: scale(.9); }
.log-more { margin-top: 18px; border-top: 1px solid var(--line); }
.log-more summary { list-style: none; cursor: pointer; display: grid; gap: 2px; padding: 14px 0 2px; font-weight: 600; min-height: 44px; }
.log-more summary::-webkit-details-marker { display: none; }
.log-more summary::after { content: ""; }
.log-more[open] summary .small { display: none; }
.who-chip { min-height: 44px; }
/* fit sheet: labels breathe */
.sheet .field + .field { margin-top: 14px; }
.sheet .field { gap: 8px; }
/* owner tools fold away */
.owner-tools { margin: 22px var(--gutter) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.owner-tools > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 14px 0; min-height: 44px; }
.owner-tools > summary::-webkit-details-marker { display: none; }
.owner-tools > summary .small { grid-column: 1; }
.owner-tools > summary svg { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 18px; height: 18px; color: var(--text-2); transition: transform .2s var(--ease-out); }
.owner-tools[open] > summary svg { transform: rotate(90deg); }
.owner-tools .row { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
@media (prefers-reduced-motion: reduce) { .stars button, .owner-tools > summary svg { transition: none; } }

/* ---- Ingredient check-offs and sub-recipe links */
.ing-list li { grid-template-columns: minmax(0, 1fr) auto; padding: 0; gap: 8px; align-items: center; }
.ing-b { display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr); gap: 14px; text-align: left; padding: 11px 0; min-height: 44px; font: inherit; color: var(--text); width: 100%; }
.ing-b .ii { color: var(--text); }
.ing-list li.got .ing-b .ia, .ing-list li.got .ing-b .ii, .ing-list li.got .ing-b .in { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.ing-b:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; border-radius: 4px; }
.sub-link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 2px 0 8px; font-size: 13px; font-weight: 600; color: var(--bone); text-decoration: none; white-space: nowrap; }
.sub-link svg { width: 14px; height: 14px; }
#clearGot { margin-top: 6px; }

/* ---- Step notes */
.step-note { display: block; margin-top: 8px; padding: 8px 12px; background: var(--surface); border-radius: 8px; font-style: italic; font-size: 15px; line-height: 1.45; color: var(--text-2); text-align: left; max-width: 62ch; }
.step-note::before { content: "Your note · "; font-style: normal; font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.step-note-add { display: flex; margin-top: 2px; color: var(--text-3); }
.step-note-edit { display: grid; gap: 4px; margin-top: 8px; max-width: 62ch; }
.step-note-edit textarea { min-height: 64px; }
.step-note-edit .link-btn { justify-self: end; }

/* ---- Paste and type */
.alt-ways { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin-top: 14px; }
.paste-box { min-height: 260px; font-size: 15px; }
.ie-x { color: var(--text-3); width: 44px; height: 44px; }
.ie-x svg { width: 16px; height: 16px; }
.step-lab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.step-lab .link-btn { color: var(--text-3); }

/* ---- Section editing in the contents review */
.te-head { display: flex; align-items: center; gap: 10px; margin: 18px 0 4px; padding: 0 6px; }
.te-head:first-child { margin-top: 4px; }
.te-hn { flex: 1; min-height: 44px; background: transparent; border-color: transparent; font: 700 17px var(--display); color: var(--bone); padding-left: 6px; }
.te-hn:hover, .te-hn:focus { border-color: var(--stroke); background: var(--surface); }
.te-head .small { white-space: nowrap; }
.te-t { grid-area: t; } .te-p { grid-area: p; } .te-ok, .te-x { grid-area: a; }
.te-sec { grid-area: s; min-height: 40px !important; font-size: 13px; color: var(--text-2); background: transparent; border-color: var(--line); }

/* ---- Cooking mode: get ready, notes, timers */
.cook-body.mise { padding-top: 22px; }
.mise-list { list-style: none; margin: 0; padding: 0; }
.mise-b { display: grid; grid-template-columns: 24px minmax(70px, auto) minmax(0, 1fr); gap: 14px; align-items: center; width: 100%; text-align: left; padding: 12px 0; min-height: 52px; border-bottom: 1px solid var(--line); font-size: 18px; color: var(--text); }
.mise-b .ia { font-size: 18px; }
.mise-b.on .li-box { background: var(--bone); border-color: var(--bone); color: var(--ground); }
.mise-b.on .ia, .mise-b.on .ii { color: var(--text-3); }
.mise-b:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; border-radius: 4px; }
.cook-note { margin: 18px 0 0; padding: 10px 14px; background: var(--surface); border-radius: 8px; font-style: italic; font-size: 17px; line-height: 1.45; color: var(--text-2); }
.cook-note::before { content: "Your note · "; font-style: normal; font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.timer-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.timer-row .link-btn { min-height: 56px; }
.cook-timer.pause { border-style: dashed; color: var(--text-2); }
.cook-tray { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 0; scrollbar-width: none; }
.tray-t { flex: none; display: inline-flex; gap: 6px; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--stroke); font-size: 14px; color: var(--text-2); }
.tray-t b { color: var(--bone); font-feature-settings: "tnum"; }
.tray-t.pause { border-style: dashed; }
.tray-t.done { background: var(--saffron); border-color: var(--saffron); color: var(--saffron-ink); }
.tray-t.done b { color: var(--saffron-ink); }

/* ---- Surprise me and Gathering dust */
.topbar .link-btn svg { width: 16px; height: 16px; margin-right: 4px; }
.row-sub { margin: -6px var(--gutter) 10px; }
.sup-out { min-height: 120px; padding: 16px 0 4px; }
.sup-card { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; align-items: center; }
.sup-card img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; }
.sup-card img.sup-cover { height: 112px; border-radius: 3px; }
.sup-card .small { margin: 2px 0 0; }
.sup-title { margin: 0; font: 700 20px/1.2 var(--display); color: var(--text); }
.surprise .seg-wide { display: flex; width: 100%; }
.surprise .seg-wide button { flex: 1; padding: 0 6px; }

/* ---- Recipe page: one row of controls */
.rec-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.adj-btn { gap: 8px; }
.adj-btn svg:last-child { width: 14px; height: 14px; opacity: .7; }
.am-fit { width: 100%; margin-top: 18px; text-align: left; }
.amounts .seg-wide { display: flex; width: 100%; }
.amounts .seg-wide button { flex: 1; padding: 0 6px; }
.start-by b { color: var(--bone); }
.rec-controls .btn { display: inline-flex; align-items: center; gap: 8px; }
.rec-controls .btn svg { width: 18px; height: 18px; }
.rec-controls .adj-btn svg:last-child { width: 14px; height: 14px; }

/* ---- Shelf: what's coming up */
.plan-cards { display: grid; gap: 8px; margin: 4px var(--gutter) 22px; }
.plan-card { display: grid; grid-template-columns: 22px minmax(0, 1fr) 16px; gap: 12px; align-items: center; min-height: 56px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.plan-card > svg:first-child { width: 20px; height: 20px; color: var(--text-2); }
.plan-card > svg:last-child { width: 14px; height: 14px; color: var(--text-3); }
.plan-card b { display: block; font-weight: 700; }
.plan-card .small { display: block; margin-top: 2px; }

/* ---- Make first, Used in */
.make-first { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; gap: 10px; align-items: center; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.make-first b { display: block; }
.make-first .small { display: block; margin-top: 2px; }
.make-first > svg { width: 14px; height: 14px; color: var(--text-3); }

/* ---- Base recipes */
.base-tag { display: inline-block; margin-right: 8px; padding: 2px 8px; border: 1px solid var(--stroke); border-radius: 4px; font-size: 12px; font-weight: 700; color: var(--bone); vertical-align: 1px; }
.rr-t .base-tag { margin: 0 0 0 8px; font-size: 11px; padding: 1px 6px; }
.base-ask { margin-top: 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.base-ask p { margin: 0; }
.base-ask .small { margin-top: 4px; }
.base-ask-b { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.rec-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-top: 18px; }
.ie-link { grid-column: 1 / -1; min-height: 36px; justify-self: start; color: var(--text-3); gap: 6px; }
.ie-link.on { color: var(--bone); }
.lk-list { display: grid; margin-top: 10px; max-height: 46vh; overflow-y: auto; }
.lk-row { display: grid; gap: 2px; text-align: left; min-height: 52px; padding: 8px 2px; border-bottom: 1px solid var(--line); color: var(--text); }
.lk-row .small { margin: 0; }
.lk-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }

/* ---- Contents: legend and find */
.toc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px var(--gutter) 6px; }
.toc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.toc-legend svg { width: 15px; height: 15px; color: var(--text-3); }
.toc-find { margin: 10px var(--gutter) 4px; }
.toc-find .small { margin: 6px 0 0; min-height: 18px; }
.empty-base { padding: 0 var(--gutter); }
.who-in { min-height: 44px; }
.who-chip { min-height: 44px; }
