:root {
  --cream: #FAF5EA;
  --cream-2: #F2E9D8;
  --paper: #FFFFFF;
  --border: #E7DBC3;
  --ink: #2B241D;
  --ink-soft: #5B4F41;
  --ink-mute: #8A7C69;
  --teal: #1F5C52;
  --teal-dark: #153F38;
  --teal-soft: #E3EEEA;
  --terracotta: #B1512F;
  --terracotta-soft: #F6E3DA;
  --gold: #C98A2C;
  --success: #3F7A4E;
  --shadow: 0 10px 28px -16px rgba(43, 36, 29, .35);
  --radius: 16px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --top-h: 52px;
  --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #14201D;
    --cream-2: #1C2B27;
    --paper: #1F302B;
    --border: #2E433D;
    --ink: #F3ECDF;
    --ink-soft: #CFC4B2;
    --ink-mute: #9A8F7E;
    --teal: #7FC4B4;
    --teal-dark: #A6DCCF;
    --teal-soft: #22403A;
    --terracotta: #E48A68;
    --terracotta-soft: #3A2A23;
    --gold: #E2B05E;
    --shadow: 0 10px 28px -16px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }

/* ---------- chrome ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 8px 0;
  display: flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar-title { flex: 1; min-width: 0; font-weight: 600; font-size: 17px; padding-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title img { height: 22px; display: block; }
.topbar-actions { display: flex; gap: 2px; }
.icon-btn {
  width: 44px; height: 44px; border: 0; background: none; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--teal);
}
.lang-btn {
  height: 32px; min-width: 44px; padding: 0 10px; margin-right: 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--paper); color: var(--teal); font-weight: 700; font-size: 13px; letter-spacing: .04em;
}
.icon-btn:active { background: var(--cream-2); }
.icon-btn.on svg { fill: var(--terracotta); stroke: var(--terracotta); }

main { padding: 4px 16px calc(var(--tab-h) + var(--safe-b) + 28px); max-width: 720px; margin: 0 auto; outline: none; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--border);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 500; color: var(--ink-mute); }
.tabbar a.active { color: var(--teal); }
.tabbar a.active svg { stroke-width: 2.2; }
body.cooking .tabbar, body.cooking .topbar { display: none; }

/* ---------- home ---------- */
.hero { padding: 12px 0 18px; }
.hero h1 { font-size: 30px; }
.hero h1 em { font-style: italic; color: var(--terracotta); }
.hero p { margin: 6px 0 0; color: var(--ink-soft); }
.searchbox {
  display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: 1px solid var(--border); border-radius: 14px;
  padding: 0 14px; height: 48px; box-shadow: var(--shadow);
}
.searchbox svg { color: var(--ink-mute); width: 20px; height: 20px; }
.searchbox input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; min-width: 0; }
.searchbox input::placeholder { color: var(--ink-mute); }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.section-h h2 { font-size: 21px; }
.section-h a { font-size: 14px; font-weight: 600; color: var(--teal); }

.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 14px; min-height: 96px;
  background: var(--c-bg); color: var(--c-fg); display: flex; flex-direction: column; justify-content: space-between;
}
.cat .cat-ico { width: 34px; height: 34px; stroke-width: 1.6; }
.cat strong { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.cat small { display: block; font-size: 12.5px; opacity: .8; }
.cat::after { content: ""; position: absolute; right: -22px; top: -22px; width: 86px; height: 86px; border-radius: 50%; background: currentColor; opacity: .07; }

.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: 0 0 74%; max-width: 280px; }

/* ---------- cards ---------- */
.card {
  display: flex; gap: 14px; align-items: center; background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 10px; }
.thumb {
  width: 64px; height: 64px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--c-bg); color: var(--c-fg);
}
.thumb svg { width: 30px; height: 30px; stroke-width: 1.6; }
.card-body { min-width: 0; flex: 1; }
.card-body h3 { font-size: 16.5px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 13px; color: var(--ink-mute); }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta svg { width: 14px; height: 14px; }

.feature { display: block; background: var(--c-bg); color: var(--c-fg); border-radius: 20px; padding: 18px; min-height: 168px; position: relative; overflow: hidden; }
.feature .eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.feature h3 { font-size: 21px; margin-top: 30px; }
.feature p { margin: 6px 0 0; font-size: 13.5px; opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feature > svg { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; stroke-width: 1.4; opacity: .9; }

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 14px -16px 4px; padding: 0 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--border); background: var(--paper); color: var(--ink-soft);
  border-radius: 999px; padding: 7px 13px; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--teal); border-color: var(--teal); color: var(--cream); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); }
.result-count { color: var(--ink-mute); font-size: 13.5px; margin: 14px 0 10px; }

/* ---------- recipe ---------- */
.r-hero { background: var(--c-bg); color: var(--c-fg); margin: 0 -16px; padding: 22px 20px 26px; position: relative; overflow: hidden; }
.r-hero > svg { position: absolute; right: -14px; bottom: -18px; width: 150px; height: 150px; stroke-width: 1; opacity: .16; }
.r-hero .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.r-hero h1 { font-size: 30px; margin-top: 6px; max-width: 92%; }
.r-hero p { margin: 10px 0 0; max-width: 92%; opacity: .9; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); margin: -14px 0 0; position: relative; box-shadow: var(--shadow); }
.stats div { padding: 12px 6px; text-align: center; }
.stats div + div { border-left: 1px solid var(--border); }
.stats b { display: block; font-size: 15px; }
.stats small { color: var(--ink-mute); font-size: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; }
.r-section { margin-top: 28px; }
.r-section > h2 { font-size: 22px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; }
.r-section > h2 small { font-family: var(--sans); font-size: 13px; color: var(--ink-mute); font-weight: 500; }
.ing-group { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--terracotta); margin: 16px 0 4px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.checklist li:last-child { border-bottom: 0; }
.box { width: 22px; height: 22px; border-radius: 7px; border: 1.8px solid var(--border); flex: none; display: grid; place-items: center; margin-top: 1px; transition: .15s; }
.box svg { width: 14px; height: 14px; stroke-width: 3; opacity: 0; color: #fff; }
.checklist li.done .box { background: var(--success); border-color: var(--success); }
.checklist li.done .box svg { opacity: 1; }
.checklist li.done .txt { color: var(--ink-mute); text-decoration: line-through; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 14px; padding: 10px 0; }
.steps li::before {
  content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: var(--cream);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-top: -1px;
}
.tip { background: var(--terracotta-soft); border-radius: 14px; padding: 12px 14px; margin-top: 8px; font-size: 15px; display: flex; gap: 10px; }
.tip svg { color: var(--terracotta); width: 20px; height: 20px; margin-top: 1px; }
.review-note { font-size: 13px; color: var(--ink-mute); margin-top: 20px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border-radius: 14px;
  border: 0; background: var(--teal); color: var(--cream); font-weight: 600; font-size: 16px; cursor: pointer;
}
.btn.secondary { background: var(--paper); color: var(--teal); border: 1.5px solid var(--teal); }
.btn:active { transform: scale(.985); }
.btn svg { width: 20px; height: 20px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }

/* ---------- cook mode ---------- */
.cook { position: fixed; inset: 0; z-index: 50; background: var(--cream); display: flex; flex-direction: column; padding: calc(var(--safe-t) + 10px) 20px calc(var(--safe-b) + 16px); }
.cook-top { display: flex; align-items: center; gap: 10px; }
.cook-top .title { flex: 1; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 4px; background: var(--cream-2); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--terracotta); transition: width .25s; }
.cook-body { flex: 1; display: flex; flex-direction: column; justify-content: center; overflow-y: auto; }
.cook-body .n { font-family: var(--serif); color: var(--terracotta); font-size: 18px; font-weight: 600; }
.cook-body p { font-family: var(--serif); font-size: clamp(24px, 6.5vw, 34px); line-height: 1.3; margin: 10px 0 0; }
.cook-body .done-h { text-align: center; }
.cook-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.wake { font-size: 12.5px; color: var(--ink-mute); text-align: center; margin-top: 10px; }

/* ---------- shopping / lists ---------- */
.empty { text-align: center; padding: 56px 24px; color: var(--ink-soft); }
.empty svg { width: 52px; height: 52px; color: var(--gold); stroke-width: 1.3; }
.empty h2 { font-size: 22px; margin: 12px 0 6px; color: var(--ink); }
.panel { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 16px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 14px; }
.panel-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 4px; }
.panel-h h3 { font-size: 17px; }
.panel-h button { border: 0; background: none; color: var(--ink-mute); font-size: 13px; cursor: pointer; padding: 6px; }
.add-row { display: flex; gap: 8px; margin: 12px 0 16px; }
.add-row input { flex: 1; height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--paper); padding: 0 14px; outline: 0; min-width: 0; }
.add-row button { width: 46px; height: 46px; border-radius: 12px; border: 0; background: var(--teal); color: var(--cream); display: grid; place-items: center; }
.link-btn { border: 0; background: none; color: var(--terracotta); font-weight: 600; font-size: 14px; padding: 8px 0; cursor: pointer; }

/* ---------- guides ---------- */
.guide-card { display: block; background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.guide-card + .guide-card { margin-top: 10px; }
.guide-card h3 { font-size: 19px; }
.guide-card p { margin: 4px 0 0; color: var(--ink-soft); font-size: 14.5px; }
.prose h2 { font-size: 21px; margin: 26px 0 8px; }
.prose h3 { font-size: 17px; margin: 18px 0 6px; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose strong { color: var(--ink); }
.table-wrap { overflow-x: auto; margin: 10px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--paper); }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--cream-2); font-weight: 600; color: var(--ink); }
.prose tr:last-child td { border-bottom: 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--cream); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: calc(100% - 32px); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.more { margin: 16px auto 0; }
.fade-in { animation: fade .22s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }

/* dark mode: category colors become tinted surfaces with light accents (must come after the base rules) */
@media (prefers-color-scheme: dark) {
  .cat, div.thumb, .feature:not(.has-photo), .r-hero { background: color-mix(in srgb, var(--c-bg) 16%, var(--paper)); color: var(--c-bg); }
}

/* ---------- photos ---------- */
img.thumb { object-fit: cover; background: var(--cream-2); }
.feature.has-photo { background-size: cover; background-position: center; color: #fff; min-height: 210px; display: flex; flex-direction: column; justify-content: flex-end; }
.feature.has-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,16,12,.38) 0%, rgba(0,0,0,0) 28%, rgba(0,0,0,0) 40%, rgba(20,16,12,.74) 100%); }
.feature.has-photo > * { position: relative; }
.feature.has-photo h3 { margin-top: 0; }
.r-photo { margin: 0 -16px; aspect-ratio: 4 / 3; overflow: hidden; background: var(--cream-2); }
.r-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- install card + sheet ---------- */
.install-card { display: grid; grid-template-columns: 52px 1fr; gap: 12px 14px; align-items: center; background: var(--teal-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 0 0 18px; }
.install-card img { border-radius: 12px; }
.install-txt strong { display: block; font-family: var(--serif); font-size: 17px; color: var(--teal-dark); }
.install-txt span { display: block; font-size: 13.5px; color: var(--ink-soft); line-height: 1.4; margin-top: 2px; }
.install-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; }
.install-actions .btn { width: auto; height: 44px; padding: 0 18px; }
.install-actions .link-btn { color: var(--ink-mute); font-weight: 500; }
.sheet-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(20,16,12,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 22px 20px calc(var(--safe-b) + 20px); text-align: center; animation: fade .2s ease-out; }
.sheet img { border-radius: 14px; }
.sheet h2 { font-size: 21px; margin: 12px 0 6px; }
.sheet-note { color: var(--terracotta); font-size: 14px; margin: 0 0 6px; }
.sheet ol { list-style: none; padding: 0; margin: 14px 0 20px; text-align: left; }
.sheet li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.sheet li:last-child { border-bottom: 0; }
.sheet li > span { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: var(--cream); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.sheet li svg { width: 20px; height: 20px; color: var(--teal); }

/* ---------- transform (flagship) ---------- */
.tabbar a.tab-cta svg { background: var(--teal); color: var(--cream); border-radius: 12px; padding: 5px; width: 34px; height: 30px; stroke-width: 2; margin: -6px 0 0; }
.tabbar a.tab-cta.active svg { background: var(--terracotta); }
.tf-banner { display: flex; align-items: center; gap: 14px; background: var(--teal); color: var(--cream); border-radius: var(--radius); padding: 16px; margin: 0 0 18px; }
.tf-banner > svg { width: 28px; height: 28px; flex: none; }
.tf-banner > svg:last-child { opacity: .7; width: 24px; }
.tf-banner div { flex: 1; min-width: 0; }
.tf-banner strong { display: block; font-family: var(--serif); font-size: 18px; }
.tf-banner span { display: block; font-size: 13.5px; opacity: .85; margin-top: 2px; }
.tf-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tf-mode { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--paper); color: var(--ink-soft); font-size: 13px; font-weight: 500; cursor: pointer; }
.tf-mode.on { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-dark); }
.tf-hint { color: var(--ink-mute); font-size: 14px; margin: 12px 0 10px; }
.tf-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 170px; border: 1.5px dashed var(--border); border-radius: var(--radius); background: var(--paper); color: var(--teal); font-weight: 600; cursor: pointer; }
.tf-drop svg { width: 38px; height: 38px; stroke-width: 1.5; }
.tf-preview { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--cream-2); }
.tf-preview img { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.tf-preview .link-btn { position: absolute; right: 10px; bottom: 8px; background: var(--paper); border-radius: 999px; padding: 6px 14px; box-shadow: var(--shadow); }
.tf-field { width: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--paper); padding: 12px 14px; font-size: 16px; outline: 0; resize: vertical; }
.tf-field:focus { border-color: var(--teal); }
.tf-h { font-size: 17px; margin: 22px 0 0; }
.tf-err { color: var(--terracotta); font-size: 14px; min-height: 20px; margin: 10px 0 4px; }
.tf-go svg { width: 22px; height: 22px; }
.tf-loading { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.tf-loading img { width: 140px; border-radius: 14px; opacity: .85; }
.tf-loading p { font-family: var(--serif); font-size: 20px; margin: 0; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--teal-soft); border-top-color: var(--teal); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tf-orig-title { color: var(--ink-mute); font-size: 13.5px; margin: 14px 0 4px; }
.tf-title { font-size: 30px; }
.tf-version { color: var(--teal); font-weight: 600; margin: 6px 0 0; }
.tf-desc { color: var(--ink-soft); margin: 8px 0 0; }
.tf-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 10px; }
.tf-stat { border-radius: 14px; padding: 12px; text-align: center; background: var(--teal-soft); color: var(--teal-dark); }
.tf-stat small { display: block; font-size: 12.5px; opacity: .85; }
.tf-stat b { display: block; font-size: 18px; margin-top: 2px; }
.tf-stat.light-green { background: #DDEFD9; color: #2F5A22; }
.tf-stat.light-yellow { background: #F6E7C4; color: #6E4E10; }
.tf-stat.light-red { background: #F6DCD3; color: #8F3F22; }
.tf-changes { list-style: none; margin: 0; padding: 0; }
.tf-changes li { padding: 11px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.tf-changes s { color: var(--ink-mute); }
.tf-changes .to { color: var(--teal-dark); font-weight: 600; }
.tf-changes small { color: var(--ink-soft); font-size: 13.5px; }
.tf-warn { margin-top: 12px; }
.tf-original { margin-top: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--paper); padding: 12px 14px; }
.tf-original summary { cursor: pointer; font-weight: 600; color: var(--teal); }
.tf-original img { display: block; width: 100%; border-radius: 10px; margin-top: 10px; }
.tf-result .btn-row .btn svg { width: 20px; height: 20px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--cream-2); border-radius: 12px; padding: 3px; margin: 10px 0 4px; }
.seg a { text-align: center; padding: 9px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-mute); }
.seg a.on { background: var(--paper); color: var(--teal-dark); box-shadow: var(--shadow); }
.fam-thumb { background: var(--terracotta-soft); color: var(--terracotta); }
@media (prefers-color-scheme: dark) {
  .tf-stat.light-green { background: #24392A; color: #BFE3B4; }
  .tf-stat.light-yellow { background: #3D3420; color: #F2D79A; }
  .tf-stat.light-red { background: #3F2A23; color: #F2B9A3; }
}

/* ---------- free tier, gate, paywall ---------- */
.lock-pill, .free-pill { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; padding: 1px 8px; border-radius: 999px; }
.lock-pill { background: var(--cream-2); color: var(--ink-soft); }
.lock-pill svg { width: 12px; height: 12px; }
.free-pill { background: var(--teal-soft); color: var(--teal-dark); }
.card.is-locked .thumb { filter: saturate(.75); }
.gate, .pw { text-align: center; padding-top: 6px; }
.gate h1, .pw h1 { font-size: 27px; margin: 18px 0 8px; }
.gate > p, .pw-reason { color: var(--ink-soft); margin: 0 auto 18px; max-width: 420px; }
.gate-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 360px; margin: 0 auto; }
.gate-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.gate form { max-width: 420px; margin: 0 auto; text-align: left; }
.gate input { width: 100%; height: 50px; border: 1px solid var(--border); border-radius: 14px; background: var(--paper); padding: 0 16px; font-size: 16px; outline: 0; }
.gate input:focus { border-color: var(--teal); }
.gate-fine { color: var(--ink-mute); font-size: 12.5px; margin: 10px auto; max-width: 420px; }
.pw-crown { width: 64px; height: 64px; margin: 0 auto; border-radius: 20px; background: var(--terracotta-soft); color: var(--terracotta); display: grid; place-items: center; }
.pw-crown svg { width: 34px; height: 34px; }
.pw-benefits { list-style: none; padding: 0; margin: 0 auto 18px; max-width: 420px; text-align: left; }
.pw-benefits li { display: flex; gap: 10px; align-items: center; padding: 7px 0; font-weight: 500; }
.pw-benefits svg { width: 20px; height: 20px; color: var(--success); flex: none; stroke-width: 2.5; }
.pw-cta { width: 100%; margin: 14px 0 0; }
.pw-cta svg { width: 18px; height: 18px; }
.pw-price { max-width: 420px; margin: 0 auto 8px; background: var(--paper); border: 1.5px solid var(--teal); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pw-once { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--terracotta); }
.pw-price b { font-family: var(--serif); font-size: 38px; line-height: 1.1; color: var(--teal-dark); }
.pw-price small { color: var(--ink-soft); font-size: 13.5px; }
.pw-welcome { display: flex; gap: 12px; align-items: center; text-align: left; max-width: 420px; margin: 4px auto 0; background: var(--teal-soft); border-radius: 16px; padding: 12px 14px; }
.pw-welcome > svg { width: 30px; height: 30px; flex: none; color: #fff; background: var(--success); border-radius: 50%; padding: 6px; stroke-width: 3; }
.pw-welcome strong { display: block; font-size: 15.5px; }
.pw-welcome .link-btn { padding: 2px 0 0; margin: 0; font-size: 14.5px; }
.pw-demo { max-width: 420px; margin: 4px auto 18px; text-align: left; background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.pw-demo h2 { display: flex; align-items: center; gap: 8px; font-size: 19px; margin: 0 0 12px; }
.pw-demo h2 svg { width: 22px; height: 22px; color: var(--terracotta); flex: none; }
.pw-demo figure { margin: 0; }
.pw-demo figure img { width: 100%; border-radius: 12px; display: block; }
.pw-demo figcaption, .pw-demo-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); margin-top: 6px; display: block; }
.pw-demo-magic { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0; color: var(--terracotta); font-weight: 600; font-size: 14px; }
.pw-demo-magic svg { width: 18px; height: 18px; }
.pw-demo-after { background: var(--teal-soft); border-radius: 14px; padding: 12px 14px 4px; }
.pw-demo-after .pw-demo-label { margin: 0 0 4px; color: var(--teal-dark); }
.pw-demo-after h3 { font-size: 17px; margin: 0 0 8px; }
.pw-demo-tags { display: flex; gap: 6px; margin-bottom: 4px; }
.pw-demo-tags .tag { background: var(--paper); }
.pw-demo-after .tf-changes li { padding: 8px 0; }
.pw-demo-after .tf-changes li:last-child { border-bottom: 0; }
.pw-demo > p { color: var(--ink-soft); font-size: 14.5px; margin: 12px 0 0; }
.pw-try { width: 100%; margin-top: 12px; }
.pw-try svg { width: 18px; height: 18px; }
.pw-inside { font-size: 21px; max-width: 420px; margin: 26px auto 12px; }
.pw-sec { max-width: 420px; margin: 0 auto 12px; text-align: left; background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.pw-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pw-sec h3 { margin: 0; font-size: 18px; }
.pw-sec-head span { color: var(--terracotta); font-weight: 700; font-size: 14px; white-space: nowrap; }
.pw-sec p { color: var(--ink-soft); margin: 6px 0 10px; font-size: 14.5px; }
.pw-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pw-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--teal-soft); }
.pw-sec .free-pill { margin-top: 10px; }
.pw-tools ul { list-style: none; padding: 0; margin: 10px 0 0; }
.pw-tools li { display: flex; gap: 12px; padding: 8px 0; }
.pw-tools li p { margin: 2px 0 0; }
.pw-tool-ico { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--terracotta-soft); color: var(--terracotta); display: grid; place-items: center; }
.pw-tool-ico svg { width: 20px; height: 20px; }
.pw { padding-bottom: 64px; }
.pw-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 19; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--paper) 96%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border); box-shadow: 0 -6px 18px rgba(0,0,0,.06); transform: translateY(110%); opacity: 0; pointer-events: none; transition: transform .28s ease, opacity .2s ease; }
.pw-bar.show { transform: none; opacity: 1; pointer-events: auto; }
.pw-bar strong { display: block; font-size: 14.5px; }
.pw-bar span { font-size: 13px; color: var(--ink-soft); }
.pw-bar .btn { width: auto; flex: none; height: 44px; padding: 0 20px; margin: 0; }
.pw-later { display: block; margin: 6px auto 0; }
.pw-pack { color: var(--teal-dark); font-weight: 600; font-size: 14px; margin: 16px 0 0; }

/* ---------- ad welcome screen ---------- */
body.focus .tabbar { display: none; }
body.focus main { padding-bottom: calc(var(--safe-b) + 28px); }
.wel { text-align: center; padding-top: 4px; }
.wel h1 { font-size: clamp(28px, 8vw, 36px); line-height: 1.1; margin: 8px auto 10px; max-width: 420px; }
.wel-sub { color: var(--ink-soft); font-size: 16.5px; margin: 0 auto 16px; max-width: 420px; }
.wel-form { max-width: 420px; margin: 16px auto 0; text-align: left; }
.wel-form input { width: 100%; height: 52px; border: 1px solid var(--border); border-radius: 14px; background: var(--paper); padding: 0 16px; font-size: 16px; outline: 0; }
.wel-form input:focus { border-color: var(--teal); }
.wel-form .btn { width: 100%; margin-top: 10px; }
.wel-form .tf-err:empty { display: none; }
.wel .pw-demo { margin-top: 22px; }
.wel-browse { display: block; margin: 4px auto 0; }

/* purchase: guarantee + local price in the offer, thank-you and restore screens */
.pw-price .pw-local { color: var(--teal-dark); font-weight: 600; }
.pw-price .pw-guarantee { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--teal-dark); font-weight: 600; }
.pw-guarantee svg { width: 15px; height: 15px; }
.thx { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.thx .btn { max-width: 280px; }
.wel-form input + input { margin-top: 10px; }

/* offer: photos of the complete cookbook gliding by (two rows, opposite directions) */
.pw-marquee { margin: 6px -16px 18px; display: flex; flex-direction: column; gap: 8px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.pw-track { display: flex; width: max-content; animation: pw-glide 42s linear infinite; }
.pw-track.rev { animation-direction: reverse; animation-duration: 48s; }
.pw-track img { width: 104px; height: 104px; margin-right: 8px; border-radius: 16px; object-fit: cover; flex: none; background: var(--teal-soft); }
@keyframes pw-glide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .pw-track { animation: none; } }

/* "Already bought?" on the email gate: a comfortable tap target, clear of the tab bar */
#gateHave { display: block; margin: 10px auto 24px; padding: 12px 18px; min-height: 44px; }
