/* Recipe Keeper — black, chrome & silver-blue */
:root {
  color-scheme: dark;
  --bg: #030509;
  --panel: rgba(14, 20, 30, 0.62);
  --panel-solid: #0e141e;
  --panel-hi: rgba(28, 38, 54, 0.7);
  --ink: #eef3fa;
  --muted: #95a7bd;
  --line: rgba(160, 190, 225, 0.14);
  --line-strong: rgba(175, 205, 240, 0.32);
  --silver: #e2e9f3;
  --steel: #9db4cf;
  --accent: #7cc4ff;
  --accent-2: #b9d8f5;
  --ice: #d9f0ff;
  --chrome: linear-gradient(135deg, #ffffff 0%, #c9d8ea 30%, #8ea8c6 55%, #dfe9f4 78%, #a9bed6 100%);
  --edge: linear-gradient(135deg, rgba(230, 240, 252, .55), rgba(120, 150, 190, .12) 40%, rgba(124, 196, 255, .45));
  --glow: 0 0 0 1px rgba(124, 196, 255, .28), 0 10px 40px -10px rgba(124, 196, 255, .45);
  --ok: #6fe3b0;
  --warn: #ffc97a;
  --danger: #ff8f8f;
  --radius: 20px;
  --head: "Exo 2", system-ui, sans-serif;
  --logo: Orbitron, "Exo 2", sans-serif;
  --tabbar-h: 84px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden]:not(.back) { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font: 20px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; padding: 18px 16px calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
body.no-tabs main { padding-bottom: 60px; }
.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- living background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora i {
  position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  filter: blur(80px); opacity: .32; mix-blend-mode: screen;
  animation: drift 38s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { background: radial-gradient(circle, #3d7dc7, transparent 65%); top: -35vmax; right: -25vmax; }
.aurora i:nth-child(2) { background: radial-gradient(circle, #7a92b8, transparent 65%); bottom: -40vmax; left: -30vmax; animation-duration: 46s; opacity: .22; }
.aurora i:nth-child(3) { background: radial-gradient(circle, #1fa3ff, transparent 60%); top: 30%; left: 40%; width: 40vmax; height: 40vmax; animation-duration: 30s; opacity: .14; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6vmax, 4vmax) scale(1.08); }
  100% { transform: translate(5vmax, -3vmax) scale(.95); }
}
.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(160, 200, 240, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 200, 240, .06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  min-height: 60px;
  background: rgba(3, 5, 9, .72);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .6;
}
.topbar h1 {
  flex: 1; min-width: 0; margin: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 800 clamp(.62em, 3.6vw, .82em)/1.2 var(--logo); letter-spacing: .16em; text-transform: uppercase;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.back, .back-spacer { width: 84px; flex: none; }
.back {
  display: flex; align-items: center; gap: 2px;
  background: none; border: 0; color: var(--accent-2); font: 600 .85em var(--head);
  padding: 10px 4px; cursor: pointer; letter-spacing: .03em;
}
.back[hidden] { display: flex; visibility: hidden; }

/* ---------- screen transition ---------- */
.screen:not([hidden]) { animation: enter .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- glass surfaces ---------- */
.glass, .big, .tile, .card, .banner, .result, .mid, .scan-hero, .stats, .codes div, dialog, .rail-card {
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--edge) border-box;
  border: 1px solid transparent;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}

/* ---------- buttons ---------- */
button, .filebtn { font: inherit; color: inherit; cursor: pointer; }
.big {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px;
  width: 100%; min-height: 80px; margin: 0 0 14px; padding: 12px 20px 12px 14px;
  font: 600 1.08em/1.25 var(--head); letter-spacing: .02em; text-align: left;
  color: var(--ink); border-radius: var(--radius);
  transition: transform .1s, box-shadow .25s;
}
.big > span:not(.bi) { flex: 1; }
.bi {
  display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 15px;
  background: rgba(124, 196, 255, .1); color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(124, 196, 255, .22);
}
.bi .ic { width: 28px; height: 28px; }
.big:hover { box-shadow: var(--glow); }
.big:active, .tile:active, .mid:active, .scan-hero:active { transform: scale(.98); }
.big.primary { color: #06101a; background: var(--chrome); border-color: transparent; box-shadow: 0 14px 40px -14px rgba(160, 200, 240, .8), inset 0 1px 0 #fff; }
.big.primary .bi { background: rgba(6, 16, 26, .1); color: #06101a; box-shadow: inset 0 0 0 1px rgba(6, 16, 26, .15); }
.big.go { color: #03111c; background: linear-gradient(135deg, #c4ecff, #6ec0ff 55%, #3d9be8); border-color: transparent; box-shadow: 0 14px 40px -12px rgba(80, 170, 245, .9); }
.big.go .bi { background: rgba(3, 17, 28, .12); color: #03111c; box-shadow: none; }
.big:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.shine::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .65) 50%, transparent 65%);
  transform: translateX(-120%); animation: shine 5s ease-in-out infinite 1.5s;
}
@keyframes shine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.filebtn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.mid {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  flex: 1; min-height: 58px; padding: 10px 14px;
  font: 600 .92em var(--head); letter-spacing: .03em; color: var(--ink); border-radius: 15px;
}
.mid.primary { background: var(--chrome); color: #06101a; border-color: transparent; }
.mid.danger { color: var(--danger); }
.mid.wide { width: 100%; margin-top: 8px; }
.mid:disabled { opacity: .5; }
.row, .actions { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.link {
  display: flex; align-items: center; gap: 8px; margin: 10px auto; padding: 12px;
  background: none; border: 0; color: var(--steel); text-decoration: underline; text-underline-offset: 4px; font-size: .92em;
}
.link.danger { color: var(--danger); }

/* ---------- typography bits ---------- */
.eyebrow { font: 700 .72em var(--head); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 6px 0 12px; }
.eyebrow:empty { display: none; }
.section-title { font: 700 .8em var(--head); letter-spacing: .18em; text-transform: uppercase; color: var(--steel); margin: 28px 0 12px; }
.lead { font-size: 1.06em; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .84em; }
.chrome-text { background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- welcome ---------- */
.hero { text-align: center; padding: 26px 0 20px; }
.hero-ring {
  position: relative; width: 132px; height: 132px; margin: 0 auto; border-radius: 36px; padding: 2px;
  background: conic-gradient(from var(--a, 0deg), #fff, #7cc4ff, #3b5f8a, #dfe9f4, #7cc4ff, #fff);
  animation: spin 6s linear infinite; box-shadow: var(--glow);
}
.hero-icon { display: block; width: 100%; height: 100%; border-radius: 34px; background: #070a10; }
@property --a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --a: 360deg; } }
.hero-title {
  margin: 22px 0 10px; font: 800 clamp(1.25em, 6.4vw, 1.9em)/1.1 var(--logo); letter-spacing: .14em; text-transform: uppercase;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--muted); margin: 0 auto; max-width: 32ch; }
.features { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; color: var(--steel); font-size: .82em; }
.features li { display: flex; align-items: center; gap: 6px; }
.features .ic { color: var(--accent); width: 18px; height: 18px; }

/* ---------- home dashboard ---------- */
.greet { margin: 4px 0 14px; }
.greet .eyebrow { margin-bottom: 2px; }
.hello { margin: 0; font: 800 clamp(1.6em, 8vw, 2.2em)/1.1 var(--head); letter-spacing: .01em; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; word-break: break-word; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: var(--radius); margin: 0 0 16px; overflow: hidden; }
.stats div { padding: 14px 6px; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats b { display: block; font: 700 1.6em/1.1 var(--head); color: var(--silver); }
.stats span { font: 600 .66em var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.scan-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; width: 100%;
  padding: 22px 20px; margin: 0 0 14px; border-radius: 24px; text-align: left; color: var(--ink);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(124, 196, 255, .28), transparent 55%),
    linear-gradient(var(--panel-hi), var(--panel-hi)) padding-box,
    conic-gradient(from var(--a, 0deg), #ffffff, #7cc4ff, #2c4a70, #cfe0f2, #7cc4ff, #ffffff) border-box;
  border: 1.5px solid transparent;
  animation: spin 8s linear infinite;
  box-shadow: 0 20px 50px -20px rgba(124, 196, 255, .6);
}
.scan-hero::before {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; top: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 14px 2px rgba(124, 196, 255, .6); opacity: .7;
  animation: sweep 3.2s ease-in-out infinite;
}
@keyframes sweep { 0% { top: 0; } 50% { top: calc(100% - 2px); } 100% { top: 0; } }
.scan-hero-icon {
  display: grid; place-items: center; width: 66px; height: 66px; flex: none; border-radius: 20px;
  background: var(--chrome); color: #06101a; box-shadow: 0 8px 24px -6px rgba(160, 200, 240, .8);
}
.scan-hero-icon .ic { width: 34px; height: 34px; stroke-width: 2; }
.scan-hero-text { flex: 1; }
.scan-hero-text b { display: block; font: 700 1.2em/1.2 var(--head); }
.scan-hero-text small { color: var(--muted); font-size: .8em; }
.scan-hero .arrow { color: var(--accent); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; min-height: 128px;
  border-radius: var(--radius); text-align: left; color: var(--ink); transition: transform .1s, box-shadow .25s;
}
.tile:hover { box-shadow: var(--glow); }
.tile .ic { width: 30px; height: 30px; color: var(--accent); margin-bottom: auto; }
.tile b { font: 700 .95em/1.2 var(--head); margin-top: 12px; }
.tile small { color: var(--muted); font-size: .72em; }

.rail { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-card {
  flex: none; width: 150px; scroll-snap-align: start; border-radius: 16px; overflow: hidden; padding: 0; text-align: left; color: var(--ink);
}
.rail-card .cover { aspect-ratio: 4/3; }
.rail-card b { display: block; padding: 10px 12px 12px; font: 600 .8em/1.25 var(--head); }

/* ---------- covers (recipe photos) ---------- */
.cover {
  position: relative; width: 100%; background: linear-gradient(135deg, #142033, #0a1019);
  display: grid; place-items: center; overflow: hidden;
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .initial { font: 800 2em var(--logo); color: rgba(185, 216, 245, .35); }
.cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .08) 50%, transparent 60%);
}

/* ---------- banners & cards ---------- */
.banner { display: flex; gap: 12px; align-items: flex-start; border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; }
.banner > .ic { margin-top: 2px; color: var(--accent); }
.banner.warn > .ic { color: var(--warn); }
.banner.ok > .ic { color: var(--ok); }
.banner:empty { display: none; }
.banner b { color: var(--silver); }
.card { border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card p { margin: 0; }
.acct { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 64px; height: 64px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font: 800 1.5em var(--logo); color: #06101a; background: var(--chrome); box-shadow: var(--glow);
}
.acct-name { font: 700 1.4em var(--head); color: var(--silver); }

/* ---------- forms ---------- */
.field { display: block; font: 600 .95em var(--head); letter-spacing: .02em; margin: 0 0 18px; color: var(--silver); }
.field .hint { display: block; font: 400 .85em Inter, sans-serif; letter-spacing: 0; color: var(--muted); }
.field input, .field select, .field textarea, .searchbox {
  display: block; width: 100%; margin-top: 6px;
  font: 400 1.05em/1.45 Inter, sans-serif; color: var(--ink);
  background: rgba(4, 7, 12, .78);
  border: 1px solid var(--line-strong); border-radius: 14px; padding: 13px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.field select {
  appearance: none; padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, var(--steel) 50%), linear-gradient(135deg, var(--steel) 50%, transparent 50%);
  background-position: calc(100% - 22px) 55%, calc(100% - 16px) 55%; background-size: 6px 6px; background-repeat: no-repeat;
}
.field textarea { min-height: 9em; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .searchbox:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.pw { display: flex; gap: 8px; margin-top: 6px; }
.pw input { margin-top: 0; }
.showpw { flex: none; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--accent-2); font: 600 .8em var(--head); }
.formerr { color: var(--danger); font-weight: 600; margin: -4px 0 14px; }
.formerr:empty { display: none; }
.check {
  display: flex; gap: 14px; align-items: flex-start; font-weight: 600; margin: 0 0 16px; padding: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.check input { width: 28px; height: 28px; flex: none; margin-top: 1px; accent-color: var(--accent); }

.searchwrap { position: relative; margin-bottom: 12px; }
.searchwrap .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--steel); }
.searchbox { margin: 0; padding: 16px 18px 16px 54px; font-size: 1.02em; border-radius: 18px; }

/* ---------- recovery codes ---------- */
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.codes div {
  text-align: center; padding: 14px 6px; border-radius: 14px;
  font: 700 1.08em ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .12em; color: var(--ice);
}

/* ---------- add / working ---------- */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; margin: 6px 0 18px; }
.thumbs figure { position: relative; margin: 0; aspect-ratio: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; border: 1px solid var(--line-strong); }
.thumbs button {
  position: absolute; top: -8px; right: -8px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--bg); background: #2a1316; color: var(--danger);
}

/* recipe boxes on the Scan screen (one box per recipe, pages in order) */
.pages-help ol { margin: 6px 0; padding-left: 1.2em; }
.pages-help li { margin-bottom: 4px; }
.group {
  margin: 0 0 14px; padding: 14px; border-radius: var(--radius);
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--edge) border-box;
  border: 1px solid transparent; animation: enter .3s ease-out;
}
.group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.group-head b { font: 700 1em var(--head); color: var(--silver); }
.group-head .muted { flex: 1; }
.group-x { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255, 143, 143, .3); background: none; color: var(--danger); }
.pages { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 8px 2px 10px; scrollbar-width: none; }
.pages figure { position: relative; flex: none; width: 92px; margin: 0; }
.pages img { display: block; width: 92px; height: 116px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-strong); }
.pages figcaption, .gallery figcaption { text-align: center; font: 600 .68em var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); margin-top: 4px; }
.pages figure button, .gallery figure button {
  position: absolute; top: -8px; right: -8px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--bg); background: #2a1316; color: var(--danger);
}
.pages figure button .ic, .gallery figure button .ic { width: 16px; height: 16px; }
.page-join { flex: none; color: var(--accent); opacity: .7; }
.page-join .ic { width: 18px; height: 18px; }
.addpage { width: 100%; margin-top: 4px; border-style: dashed; }

/* food photo picker & photo galleries */
.foodpick { margin: 4px 0 20px; }
.field-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 600 .95em var(--head); color: var(--silver); margin: 0 0 8px; }
.field-label .ic { color: var(--accent); }
.field-label .hint { font: 400 .85em Inter, sans-serif; color: var(--muted); }
.food-thumbs:empty { display: none; }
.gallery { display: flex; gap: 12px; overflow-x: auto; padding: 8px 2px 6px; scrollbar-width: none; }
.gallery:empty { display: none; }
.gallery figure { position: relative; flex: none; width: 130px; margin: 0; }
.gallery .cover { width: 130px; height: 104px; border-radius: 12px; border: 1px solid var(--line-strong); cursor: zoom-in; }
.gallery .cover .initial { font-size: 1.2em; }
.page-strip { display: flex; gap: 10px; overflow-x: auto; margin: -4px 0 16px; padding-bottom: 4px; }
.page-strip button { flex: none; padding: 0; border: 0; background: none; color: var(--accent-2); font: 600 .68em var(--head); letter-spacing: .08em; text-transform: uppercase; }
.page-strip img { display: block; width: 70px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-strong); margin-bottom: 3px; }

.scanframe {
  position: relative; width: min(100%, 360px); aspect-ratio: 3/4; margin: 10px auto 22px;
  border-radius: 18px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 1px var(--line-strong), 0 20px 60px -20px rgba(124, 196, 255, .7);
}
.scanframe img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.6) contrast(1.05) brightness(.85); }
.scanframe::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: repeating-linear-gradient(0deg, rgba(124, 196, 255, .07) 0 1px, transparent 1px 4px);
}
.corner { position: absolute; z-index: 2; width: 34px; height: 34px; border: 3px solid var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.corner.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.corner.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.corner.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.corner.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.beam {
  position: absolute; z-index: 2; left: 0; right: 0; height: 90px; top: -90px;
  background: linear-gradient(180deg, transparent, rgba(124, 196, 255, .28) 85%, rgba(220, 245, 255, .95) 100%);
  border-bottom: 2px solid #dff4ff; box-shadow: 0 6px 22px 2px rgba(124, 196, 255, .7);
  animation: beam 2.2s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes beam { from { top: -90px; } to { top: 100%; } }
.progress { height: 10px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--steel), var(--accent), #fff); box-shadow: 0 0 14px var(--accent); transition: width .4s; }

.photo { width: 100%; max-height: 48vh; object-fit: contain; margin-bottom: 16px; background: #000; border-radius: 16px; border: 1px solid var(--line-strong); cursor: zoom-in; }

.done-badge {
  width: 110px; height: 110px; margin: 26px auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: var(--chrome); color: #06101a; box-shadow: 0 0 0 10px rgba(124, 196, 255, .08), 0 0 60px rgba(124, 196, 255, .5);
  animation: pop .5s cubic-bezier(.2, 1.6, .4, 1);
}
.done-badge .ic { width: 56px; height: 56px; stroke-width: 2.6; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* ---------- chips & result cards ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--panel); font: 600 .8em var(--head); letter-spacing: .04em;
}
.chips button[aria-pressed="true"] { background: var(--chrome); color: #06101a; border-color: transparent; }
.chips .ic { width: 16px; height: 16px; }
.cards { display: grid; gap: 12px; }
.result {
  display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; color: var(--ink);
  border-radius: 18px; padding: 10px; min-height: 92px; transition: box-shadow .25s, transform .1s;
}
.result:hover { box-shadow: var(--glow); }
.result:active { transform: scale(.99); }
.result .cover { width: 76px; height: 76px; flex: none; border-radius: 12px; }
.result .cover .initial { font-size: 1.3em; }
.result .rt { flex: 1; min-width: 0; }
.result b { display: block; font: 600 1em/1.25 var(--head); }
.result small { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .76em; margin-top: 4px; }
.result small span { display: inline-flex; align-items: center; gap: 4px; }
.result small .ic { width: 15px; height: 15px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty .ic { width: 48px; height: 48px; color: var(--steel); opacity: .6; display: block; margin: 0 auto 10px; }

/* ---------- recipe page ---------- */
.recipe .hero-cover { border-radius: 22px; aspect-ratio: 16/10; margin-bottom: 18px; cursor: zoom-in; box-shadow: 0 20px 50px -24px rgba(124, 196, 255, .6); border: 1px solid var(--line-strong); }
.recipe .hero-cover .initial { font-size: 3em; }
.recipe h2 { font: 800 1.65em/1.15 var(--head); margin: 0 0 10px; color: var(--silver); }
.byline { display: flex; align-items: center; gap: 8px; color: var(--steel); font-size: .88em; margin: -2px 0 12px; }
.byline .avatar { width: 30px; height: 30px; font-size: .7em; box-shadow: none; }
.metas { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.metas span { padding: 6px 12px; border-radius: 999px; font: 600 .74em var(--head); letter-spacing: .05em; color: var(--accent-2); background: rgba(124, 196, 255, .08); border: 1px solid rgba(124, 196, 255, .22); }
.recipe h3 { display: flex; align-items: center; gap: 10px; font: 700 .78em var(--head); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 26px 0 10px; }
.recipe h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none;
}
.ingredients li::before {
  content: ""; flex: none; width: 22px; height: 22px; margin-top: 3px; border-radius: 7px; border: 1.5px solid var(--steel);
  transition: background .2s, border-color .2s;
}
.ingredients li.done { color: var(--muted); text-decoration: line-through; }
.ingredients li.done::before {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306101a' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/70% no-repeat;
}
.stepslist { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.stepslist li { counter-increment: step; display: flex; gap: 14px; padding: 10px 0; }
.stepslist li::before {
  content: counter(step); flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font: 800 .9em var(--logo); color: #06101a; background: var(--chrome);
}
.story { margin: 4px 0 8px; padding: 14px 18px; border-left: 3px solid var(--accent); background: rgba(124, 196, 255, .06); border-radius: 0 14px 14px 0; font-style: italic; color: var(--silver); }
.recipe .photos { display: flex; gap: 10px; overflow-x: auto; margin-top: 8px; }
.recipe .photos img { height: 120px; border-radius: 12px; border: 1px solid var(--line-strong); cursor: zoom-in; }
.source { color: var(--muted); font-style: italic; margin-top: 16px; }
.unclear { background: rgba(255, 201, 122, .18); color: var(--warn); border-radius: 4px; padding: 0 3px; }
.steps { padding-left: 1.4em; }
.steps li { margin-bottom: .6em; }

.heart-btn.on { color: #ff7da8; border-color: transparent; background: linear-gradient(rgba(255, 125, 168, .14), rgba(255, 125, 168, .14)) padding-box, linear-gradient(135deg, #ff9cc0, #ff5f93) border-box; }
.heart-btn.on .ic { fill: currentColor; }

.comm-hero { margin: 4px 0 16px; }
.comm-hero h2 { margin: 0 0 6px; font: 800 1.5em/1.15 var(--head); background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.comm-hero p { margin: 0; }

/* ---------- recipe tools ---------- */
.cook-cta { margin: 16px 0 10px; }
.tools { display: grid; gap: 10px; margin: 0 0 6px; }
.seg {
  display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 16px;
  background: rgba(4, 7, 12, .7); border: 1px solid var(--line-strong);
}
.seg-label { padding: 0 8px 0 10px; font: 700 .7em var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.seg button {
  flex: 1; min-height: 48px; border: 0; border-radius: 12px; background: none; color: var(--ink);
  font: 700 .95em var(--head);
}
.seg button[aria-pressed="true"] { background: var(--chrome); color: #06101a; box-shadow: 0 4px 14px -4px rgba(160, 200, 240, .7); }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chipbtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px; border-radius: 999px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); font: 600 .82em var(--head);
}
.chipbtn .ic { color: var(--accent); }
.chipbtn[aria-pressed="true"] { background: rgba(124, 196, 255, .16); border-color: var(--accent); color: var(--ice); }
.scaled { color: var(--ice); background: rgba(124, 196, 255, .14); border-radius: 6px; padding: 0 4px; }
.hint-old {
  margin: 0 3px 0 4px; padding: 1px 7px; border-radius: 6px; white-space: nowrap;
  font: 600 .7em var(--head); color: var(--ice); background: rgba(124, 196, 255, .16);
  border: 1px solid rgba(124, 196, 255, .35); -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hint-old::before { content: "= "; opacity: .7; }

/* ---------- "From whom" badge & people filter ---------- */
.from-whom {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 14px; border-radius: 999px;
  background: rgba(124, 196, 255, .08); border: 1px solid rgba(124, 196, 255, .3); color: var(--accent-2); font: 600 .85em var(--head);
}
.from-whom b { color: var(--ice); }
.from-whom small { margin-left: 4px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
button.from-whom { cursor: pointer; }
.chips.people { margin-top: -4px; }
.chips.people button[aria-pressed="true"] { background: rgba(124, 196, 255, .2); color: var(--ice); border-color: var(--accent); }

/* ---------- voice notes ---------- */
.voices { display: grid; gap: 10px; margin-bottom: 10px; }
.voices:empty { display: none; }
.voice {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--edge) border-box; border: 1px solid transparent;
}
.voice-play { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 50%; border: 0; background: var(--chrome); color: #06101a; }
.voice-play .ic { width: 24px; height: 24px; fill: currentColor; stroke: none; }
.voice-meta { flex: 1; min-width: 0; }
.voice-meta b { display: block; font: 600 .95em var(--head); }
.voice-meta small { color: var(--muted); font-size: .76em; }
.voice-bar { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--line); overflow: hidden; }
.voice-bar i { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.voice-x { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255, 143, 143, .3); background: none; color: var(--danger); }
.rec-stage { text-align: center; margin: 14px 0; }
.rec-btn {
  display: inline-grid; place-items: center; width: 108px; height: 108px; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 35% 30%, #ff8a8a, #d42c3c); color: #fff;
  box-shadow: 0 0 0 8px rgba(255, 90, 100, .14), 0 14px 30px -8px rgba(255, 80, 90, .7);
}
.rec-btn .ic { width: 46px; height: 46px; }
.rec-btn.on { animation: recpulse 1.2s ease-in-out infinite; }
.rec-stop { width: 34px; height: 34px; border-radius: 8px; background: #fff; }
@keyframes recpulse { 50% { box-shadow: 0 0 0 18px rgba(255, 90, 100, .05), 0 14px 30px -8px rgba(255, 80, 90, .7); } }
.rec-time { font: 700 1em var(--head); color: var(--silver); margin: 12px 0 0; }
#recPreview audio { width: 100%; margin-bottom: 12px; }

/* ---------- family cookbooks ---------- */
.fam-cover { color: var(--accent); }
.fam-cover .ic { width: 34px; height: 34px; }
.invite-card { text-align: center; }
.invite-code {
  margin: 4px 0 6px; text-align: center; font: 800 1.7em ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .18em;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.invite-text { padding: 12px; border-radius: 12px; background: rgba(4, 7, 12, .8); border: 1px solid var(--line-strong); user-select: all; }
.members { display: grid; gap: 8px; }
.member { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.member .avatar { width: 40px; height: 40px; font-size: .8em; box-shadow: none; }
.member b { font-family: var(--head); }
.member small { color: var(--muted); font-size: .74em; flex: 1; }
.member .link { margin: 0 0 0 auto; padding: 8px; }
.pick-list { max-height: 50vh; overflow-y: auto; margin: 10px 0; }
.pick-list .check { margin-bottom: 8px; }

/* ---------- privacy/contact links, human check, admin inbox ---------- */
a.big { text-decoration: none; }
.footer-links { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 26px 0 0; font-size: .85em; color: var(--muted); }
.footer-links a, .link.inline { color: var(--steel); text-decoration: underline; text-underline-offset: 4px; }
.link.inline { display: inline; margin: 0; padding: 0; font-size: 1em; }
.ts-box { min-height: 70px; margin: 4px 0 12px; }
.ts-box:empty::before { content: "Loading the “I'm human” check…"; display: block; padding: 22px 0; color: var(--muted); font-size: .85em; }
.msg { padding: 14px 16px; border-radius: 16px; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--edge) border-box; border: 1px solid transparent; }
.msg.handled { opacity: .55; }
.msg p { margin: 0 0 8px; }
.msg-top { display: flex; justify-content: space-between; gap: 10px; }
.msg-top small, .msg-from { color: var(--muted); font-size: .82em; }
.msg-from .sel { user-select: all; }
.msg-body { white-space: normal; }
.msg .row { margin: 6px 0 0; }

/* ---------- tags ---------- */
.metas .tag { display: inline-flex; align-items: center; gap: 5px; color: var(--ice); background: rgba(124, 196, 255, .14); }
.metas .tag .ic { width: 13px; height: 13px; }
.tagpick { display: flex; flex-wrap: wrap; gap: 8px; }
.tagchip { position: relative; cursor: pointer; }
.tagchip input { position: absolute; opacity: 0; pointer-events: none; }
.tagchip span {
  display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--panel); font: 600 .78em var(--head); color: var(--ink);
}
.tagchip input:checked + span { background: var(--chrome); color: #06101a; border-color: transparent; }
.tagchip input:focus-visible + span { box-shadow: var(--glow); }
.chips.wrap { flex-wrap: wrap; overflow: visible; }

/* ---------- AI fix suggestions ---------- */
.banner.fixes { display: block; }
.banner.fixes > .ic { display: none; }
.fixes > div > b { display: block; margin-bottom: 6px; }
.fix { margin: 10px 0 4px; padding: 12px; border-radius: 12px; background: rgba(4, 7, 12, .55); border: 1px solid var(--line-strong); }
.fix p { margin: 0 0 8px; display: flex; gap: 8px; align-items: flex-start; }
.fix p .ic { color: var(--warn); margin-top: 3px; }
.fix-diff { display: block !important; padding-left: 28px; font-size: .92em; }
.fix-diff s { color: var(--muted); }
.fix-diff b { color: var(--ok); }
.fix-use { width: 100%; min-height: 48px; }

/* ---------- shopping list ---------- */
.shop-add { display: flex; gap: 8px; margin-bottom: 8px; }
.shop-add input {
  flex: 1; min-width: 0; font: inherit; color: var(--ink); background: rgba(4, 7, 12, .78);
  border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 14px;
}
.shop-add input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.shop-add .mid { flex: none; }
.shop-group { border-radius: 16px; overflow: hidden; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--edge) border-box; border: 1px solid transparent; }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--line); }
.shop-item:last-child { border-bottom: 0; }
.shop-check { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; border: 2px solid var(--steel); background: none; color: #06101a; }
.shop-check .ic { width: 22px; height: 22px; stroke-width: 3; }
.shop-item.done .shop-check { background: var(--accent); border-color: var(--accent); }
.shop-text { flex: 1; min-width: 0; cursor: pointer; }
.shop-text b { display: block; font-weight: 500; }
.shop-text small { color: var(--muted); font-size: .74em; }
.shop-item.done .shop-text b { color: var(--muted); text-decoration: line-through; }
.shop-x { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; background: none; color: var(--muted); }

/* ---------- what can I make ---------- */
.have-card { display: grid; }
.have-card .link { margin: -4px 0 6px; justify-content: flex-start; padding-left: 4px; }
.result .miss { color: var(--warn); }
.result .ok { color: var(--ok); }

/* ---------- update banner ---------- */
#updateBanner {
  position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); top: calc(70px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 16px; border: 0;
  background: var(--chrome); color: #06101a; font: 600 .9em var(--head); box-shadow: var(--glow);
  width: min(calc(100% - 24px), 440px);
}

/* ---------- printed cookbook (preview on screen + real pages when printed) ---------- */
body.book-open { overflow: hidden; }
#bookView { position: fixed; inset: 0; z-index: 58; overflow-y: auto; background: #2b2f36; padding-bottom: 40px; }
.book-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: rgba(3, 5, 9, .9); backdrop-filter: blur(10px);
}
.book-bar > span { flex: 1; min-width: 0; text-align: center; font: 700 .85em var(--head); color: var(--steel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-bar .mid { flex: none; }
.book-tip { max-width: 760px; margin: 12px auto; padding: 0 16px; color: #c9d3de; font-size: .8em; }
.book { --ink-bk: #22201c; --accent-bk: #8a6a3b; color: var(--ink-bk); font: 15px/1.6 Lora, Georgia, serif; }
.bk-page {
  position: relative; max-width: 760px; margin: 16px auto; padding: 56px 60px; background: #fffdf8;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); border-radius: 4px; overflow: hidden;
}
@media (max-width: 600px) { .bk-page { margin: 10px 8px; padding: 32px 22px; } }
.bk-cover { text-align: center; min-height: 860px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.bk-cover h1 { font: 800 3.1em/1.1 "Playfair Display", Georgia, serif; margin: 26px 0 10px; letter-spacing: -.01em; }
.bk-cover-photo { width: 78%; aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.bk-cover-orn { font-size: 3em; color: var(--accent-bk); }
.bk-sub { font-style: italic; font-size: 1.15em; color: #5b5346; }
.bk-year { margin-top: 40px; letter-spacing: .3em; font-size: .85em; color: var(--accent-bk); }
.bk-rule { height: 1px; background: linear-gradient(90deg, transparent, var(--accent-bk), transparent); margin: 18px 0; }
.bk-rule.short { width: 120px; margin: 14px auto; }
.bk-dedication { min-height: 600px; display: flex; align-items: center; justify-content: center; text-align: center; font: italic 1.4em/1.7 "Playfair Display", Georgia, serif; color: #4a4339; }
.bk-toc h2, .bk-divider h2 { font: 800 2.3em "Playfair Display", Georgia, serif; text-align: center; margin: 0 0 20px; }
.bk-toc-ch h3 { font: 600 .8em Lora, serif; letter-spacing: .25em; text-transform: uppercase; color: var(--accent-bk); margin: 22px 0 6px; border-bottom: 1px solid #e6dccb; padding-bottom: 4px; }
.bk-toc-ch ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.bk-toc-ch li { break-inside: avoid; padding: 3px 0; }
.bk-toc-ch li span { display: block; font-size: .8em; font-style: italic; color: #8b8172; }
.bk-divider { min-height: 600px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.bk-divider h2 { font-size: 3.2em; margin: 6px 0; }
.bk-divider p { color: #8b8172; font-style: italic; }
.bk-cat { margin: 0; font: 600 .75em Lora, serif; letter-spacing: .3em; text-transform: uppercase; color: var(--accent-bk); text-align: center; }
.bk-title { font: 800 2.3em/1.15 "Playfair Display", Georgia, serif; text-align: center; margin: 8px 0 4px; }
.bk-from { text-align: center; font-style: italic; color: #6b6253; margin: 0; }
.bk-meta { text-align: center; font-size: .82em; letter-spacing: .08em; color: #6b6253; margin: 8px 0 0; }
.bk-meta i { margin: 0 10px; color: var(--accent-bk); font-style: normal; }
.bk-photo { display: block; width: 100%; max-height: 330px; object-fit: cover; border-radius: 3px; margin: 20px 0 24px; }
.bk-cols { display: grid; grid-template-columns: 38% 1fr; gap: 34px; }
@media (max-width: 600px) { .bk-cols { grid-template-columns: 1fr; gap: 10px; } }
.bk-cols h3, .bk-notes h3 { font: 600 .78em Lora, serif; letter-spacing: .25em; text-transform: uppercase; color: var(--accent-bk); margin: 0 0 10px; }
.bk-ings { background: #f7f1e6; padding: 18px 20px; border-radius: 3px; align-self: start; }
.bk-ings ul { list-style: none; margin: 0; padding: 0; }
.bk-ings li { padding: 4px 0; border-bottom: 1px dotted #d8cbb3; }
.bk-ings li:last-child { border-bottom: 0; }
.bk-steps ol { margin: 0; padding-left: 1.3em; }
.bk-steps li { margin-bottom: 10px; padding-left: 4px; }
.bk-steps li::marker { font: 800 1em "Playfair Display", serif; color: var(--accent-bk); }
.bk-notes { margin-top: 22px; padding: 16px 20px; border-left: 3px solid var(--accent-bk); background: #fbf6ec; font-style: italic; }
.bk-notes p { margin: 0; }
.bk-cards { display: flex; gap: 16px; margin-top: 22px; }
.bk-cards figure { flex: 1; margin: 0; text-align: center; }
.bk-cards img { width: 100%; max-height: 260px; object-fit: contain; background: #f3ede2; border: 1px solid #e3d8c4; transform: rotate(-1deg); }
.bk-cards figcaption { font-size: .78em; font-style: italic; color: #8b8172; margin-top: 6px; }

/* ---------- cooking mode ---------- */
body.cooking { overflow: hidden; }
body.cooking .tabbar { display: none; }
#cook {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 80% at 50% 0%, #0f1a2a, #030509 70%);
  animation: enter .3s ease-out;
}
.cook-top { display: flex; align-items: center; gap: 10px; }
.cook-title { flex: 1; min-width: 0; text-align: center; font: 700 .9em var(--head); color: var(--steel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-x, .cook-voice {
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--ink); font: 600 .82em var(--head);
}
.cook-voice.on { background: var(--chrome); color: #06101a; border-color: transparent; }
.cook-dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0 6px; flex-wrap: wrap; }
.cook-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.cook-dots i.past { background: var(--steel); }
.cook-dots i.on { background: var(--accent); box-shadow: 0 0 10px var(--accent); width: 26px; border-radius: 6px; }
.cook-body { flex: 1; overflow-y: auto; padding: 10px 2px; display: flex; flex-direction: column; justify-content: center; }
.cook-kicker { font: 700 .8em var(--head); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.cook-step { margin: 0; font: 600 clamp(1.4em, 6.5vw, 2.1em)/1.4 var(--head); color: var(--ink); cursor: pointer; }
.cook-ings { list-style: none; margin: 0; padding: 0; font-size: 1.15em; }
.cook-ings li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.cook-ings li::before { content: ""; flex: none; width: 26px; height: 26px; margin-top: 3px; border-radius: 8px; border: 2px solid var(--steel); }
.cook-ings li.done { color: var(--muted); text-decoration: line-through; }
.cook-ings li.done::before { border-color: var(--accent); background: var(--accent); }
.cook-timer { margin-top: 24px; }
.cook-nav { display: flex; gap: 10px; padding-top: 10px; }
.cook-nav .mid { min-height: 68px; font-size: 1.05em; }
.cook-nav .mid.primary { flex: 2; }

/* ---------- timers (float above everything) ---------- */
#timers { position: fixed; z-index: 60; top: calc(68px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: grid; gap: 6px; width: min(calc(100% - 24px), 420px); }
body.cooking #timers { top: auto; bottom: calc(100px + env(safe-area-inset-bottom)); }
.timer {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 16px;
  background: rgba(10, 16, 26, .92); border: 1px solid var(--accent); box-shadow: var(--glow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.timer .ic { color: var(--accent); }
.timer .t-label { flex: 1; font: 600 .82em var(--head); color: var(--muted); }
.timer b { font: 800 1.2em var(--logo); color: var(--ice); letter-spacing: .04em; }
.timer button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .06); color: var(--ink); }
.timer.done { background: linear-gradient(135deg, #ffd27a, #ff9a5a); border-color: transparent; animation: ring .6s ease-in-out infinite alternate; }
.timer.done, .timer.done b, .timer.done .ic, .timer.done .t-label { color: #2a1405; }
@keyframes ring { from { transform: scale(1); } to { transform: scale(1.03); } }

/* ---------- photo viewer ---------- */
#viewer { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; background: rgba(0, 0, 0, .96); padding: calc(10px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); }
.v-top { display: flex; align-items: center; gap: 12px; }
.v-label { flex: 1; text-align: right; color: var(--steel); font: 600 .85em var(--head); }
.v-stage { flex: 1; overflow: auto; margin: 10px 0; display: flex; align-items: flex-start; justify-content: flex-start; touch-action: pan-x pan-y pinch-zoom; }
.v-stage img { flex: none; max-width: none; margin: auto; border-radius: 6px; }
.v-bar { display: flex; align-items: center; gap: 8px; justify-content: center; }
.v-bar .mid { flex: 0 0 auto; min-width: 64px; font-size: 1.3em; }
.v-zoom { min-width: 60px; text-align: center; font: 700 .85em var(--head); color: var(--steel); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom)); width: min(calc(100% - 20px), 560px);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: 72px; padding: 0 6px 8px; border-radius: 26px;
  background: linear-gradient(rgba(10, 15, 24, .82), rgba(10, 15, 24, .82)) padding-box, var(--edge) border-box;
  border: 1px solid transparent;
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .9);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; padding: 6px 0 0;
  color: var(--muted); font: 600 .6em var(--head); letter-spacing: .05em; transition: color .2s;
}
.tabbar button .ic { width: 26px; height: 26px; }
.tabbar button.active { color: var(--ice); }
.tabbar button.active:not(.fab) .ic { filter: drop-shadow(0 0 8px var(--accent)); }
.tabbar .fab { position: relative; }
.fab-core {
  display: grid; place-items: center; width: 64px; height: 64px; margin-top: -30px; border-radius: 22px;
  background: var(--chrome); color: #06101a;
  box-shadow: 0 0 0 5px rgba(3, 5, 9, .9), 0 10px 30px -4px rgba(124, 196, 255, .8);
}
.fab-core::after {
  content: ""; position: absolute; top: -30px; width: 64px; height: 64px; border-radius: 22px;
  box-shadow: 0 0 0 0 rgba(124, 196, 255, .6); animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse { to { box-shadow: 0 0 0 16px rgba(124, 196, 255, 0); } }
.fab-core .ic { width: 30px; height: 30px; stroke-width: 2.1; }

/* ---------- dialog & toast ---------- */
dialog {
  border-radius: 24px; padding: 22px; max-width: 520px; width: calc(100% - 32px); color: var(--ink);
  background: linear-gradient(#0d131d, #0d131d) padding-box, var(--edge) border-box; box-shadow: var(--glow);
}
dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px); }
dialog img { max-width: 100%; border-radius: 12px; }
#dialogBody p:first-child { margin-top: 0; }
#dialogBody .field { margin-bottom: 12px; }
#dialogBody .big-ic { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 50%; background: var(--chrome); color: #06101a; }
#dialogBody .big-ic .ic { width: 38px; height: 38px; stroke-width: 2.4; }

#toast {
  position: fixed; z-index: 30; left: 50%; transform: translate(-50%, 10px);
  bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom));
  background: var(--chrome); color: #06101a; padding: 14px 22px; border-radius: 999px;
  font: 700 .9em var(--head); opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none;
  max-width: calc(100% - 32px); box-shadow: var(--glow);
}
body.no-tabs #toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .beam { top: 45%; }
}
@media print {
  /* Printing a cookbook: only the book pages, one per sheet. */
  body.book-open > *:not(#bookView), body.book-open .noprint { display: none !important; }
  html, body.book-open { height: auto !important; min-height: 0 !important; overflow: visible !important; background: #fff !important; }
  body.book-open #bookView { position: static; overflow: visible; background: #fff; padding: 0; }
  /* Each page starts a new sheet. No fixed heights: phones add their own margins, and a page
     that's even slightly too tall spills onto an extra blank sheet. */
  body.book-open .bk-page {
    max-width: none; margin: 0; padding: 0; box-shadow: none; border-radius: 0; overflow: visible; min-height: 0 !important;
    break-before: page; page-break-before: always; break-after: auto; page-break-after: auto;
  }
  body.book-open .bk-page:first-child { break-before: auto; page-break-before: auto; }
  body.book-open .bk-cover, body.book-open .bk-dedication, body.book-open .bk-divider {
    display: block; text-align: center; break-inside: avoid; page-break-inside: avoid;
  }
  body.book-open .bk-cover { padding-top: .3in; }
  body.book-open .bk-cover-photo { display: block; margin: 0 auto; width: 72%; max-height: 4.4in; }
  body.book-open .bk-dedication { padding-top: 3in; }
  body.book-open .bk-divider { padding-top: 2.6in; }
  body.book-open .bk-cols { grid-template-columns: 38% 1fr; }
  body.book-open .bk-ings, body.book-open .bk-notes, body.book-open .bk-cards figure { break-inside: avoid; page-break-inside: avoid; }
  body.book-open .bk-photo { max-height: 2.7in; margin: 14px 0 18px; }
  body.book-open .bk-cards { margin-top: 16px; }
  body.book-open .bk-cards img { max-height: 2.1in; }
  body.book-open .bk-title { font-size: 2em; }
  @page { size: letter; margin: 0.6in; }
  body { background: #fff !important; color: #000; font-size: 13pt; }
  .aurora, .grid-bg, .topbar, .tabbar, .noprint, #toast, .screen:not(.printing) { display: none !important; }
  .recipe h2, .recipe h3, .field, .banner b, .stepslist li::before { color: #000 !important; -webkit-text-fill-color: #000; }
  .stepslist li::before { background: #eee; }
  .recipe .photos, .hero-cover, .screen.printing button, .screen.printing .check { display: none !important; }
  .banner, .codes div, .metas span { background: #fff !important; color: #000 !important; border: 1px solid #999 !important; backdrop-filter: none; }
}
