/* Affirmer: poster-style recipes & diets */

:root {
  --bg: #7A0F2E;
  --soft: #8E1A3D;
  --accent: #E0245E;
  --card: #FFE9EE;
  --paper: #FFF7F9;
  --ink: #2A0614;
  --line: color-mix(in srgb, var(--ink) 14%, transparent);
  --muted: color-mix(in srgb, var(--ink) 78%, var(--paper));

  --protein: #E0245E;
  --carbs: #B07D00;
  --fat: #16897F;

  --display: "Bagel Fat One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .45s ease;
  overflow: hidden;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Backdrop: giant poster words behind the app on wide screens ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: 0 4vw;
  font-family: var(--display);
  font-size: min(21vw, 30vh);
  line-height: .8;
  letter-spacing: -.02em;
  color: var(--soft);
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  transition: color .45s ease;
}
.backdrop span:nth-child(even) { align-self: flex-end; }

@media (min-width: 760px) {
  .backdrop { display: flex; }
}

/* ---------- App frame ---------- */

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
  transition: background-color .45s ease;
}

@media (min-width: 760px) {
  .app {
    height: calc(100dvh - 48px);
    max-height: 920px;
    margin-top: max(24px, calc((100dvh - 920px) / 2));
    border-radius: 44px;
    box-shadow: 0 0 0 10px color-mix(in srgb, #000 30%, var(--bg)), 0 30px 80px rgba(0, 0, 0, .35);
  }
}

.view {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(16px + env(safe-area-inset-top)) 20px 32px;
  scrollbar-width: thin;
}
.view:focus { outline: none; }

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  justify-content: space-around;
  gap: 4px;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
  transition: background-color .45s ease;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  max-width: 84px;
  padding: 6px 2px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.tab svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.tab[aria-current="page"] {
  color: var(--bg);
  background: color-mix(in srgb, var(--bg) 10%, transparent);
}

body[data-route="cook"] .tabs { display: none; }

/* ---------- Shared bits ---------- */

.screen-title {
  margin: 4px 0 16px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 48px;
  line-height: .9;
  letter-spacing: -.02em;
  color: var(--bg);
}

.block { margin-top: 28px; }

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.block-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.block-head .block-title { margin: 0; }
.block > .block-title { margin-bottom: 12px; }

.link {
  font-size: 14px;
  font-weight: 600;
  color: var(--bg);
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 6px 0;
}

.muted { color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.pill:focus-visible { border-radius: 999px; }
.pill--solid { background: var(--bg); color: #fff; }
.pill--outline { background: transparent; color: var(--bg); box-shadow: inset 0 0 0 2px var(--bg); }
.pill--light { background: var(--card); color: var(--bg); }
.pill--small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.pill--wide { width: 100%; }
.pill:active { transform: scale(.97); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 10%, transparent);
  color: var(--bg);
  text-decoration: none;
}
.icon-btn:focus-visible { border-radius: 50%; }
.icon-btn svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon-btn[aria-pressed="true"] svg { fill: currentColor; }
.icon-btn--sm { width: 36px; height: 36px; }
.icon-btn--sm svg { width: 18px; height: 18px; }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -20px;
  padding: 2px 20px 6px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.chip:focus-visible { border-radius: 999px; }
.chip[aria-pressed="true"] { background: var(--bg); color: #fff; box-shadow: none; }

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.stepper button {
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 10%, transparent);
  color: var(--bg);
  font-size: 18px; font-weight: 700; line-height: 1;
}
.stepper button:focus-visible { border-radius: 50%; }
.stepper output { min-width: 96px; text-align: center; font-size: 14px; font-weight: 600; }

/* ---------- Poster (the signature element) ---------- */

.poster {
  display: block;
  padding: 8px;
  border-radius: 34px;
  background: var(--p-bg);
  color: var(--p-ink);
  text-decoration: none;
  container-type: inline-size;
}
.poster:focus-visible { border-radius: 34px; outline-color: var(--p-bg); outline-offset: 3px; }

.poster-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: 22px 20px 18px;
  border-radius: 26px;
  background: var(--p-card);
  overflow: hidden;
}

.poster-name {
  position: relative;
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: min(calc(150cqi / var(--len)), 108px);
  line-height: .8;
  letter-spacing: -.025em;
  color: var(--p-bg);
}
.poster-name [aria-hidden] > span { display: block; }

.poster-dish {
  position: absolute;
  right: 3%;
  top: 24%;
  z-index: 1;
  font-size: 40cqi;
  line-height: 1;
  transform: rotate(-12deg);
  filter: drop-shadow(0 10px 0 color-mix(in srgb, var(--p-ink) 22%, transparent));
}
.poster-garnish {
  position: absolute;
  right: 7%;
  top: 5%;
  z-index: 1;
  font-size: 12cqi;
  line-height: 1;
  transform: rotate(16deg);
}

.poster-meta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
}
.poster-meta span {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--p-bg);
  color: var(--p-card);
  font-size: 12px;
  font-weight: 600;
}

.poster--hero .poster-inner { min-height: 350px; }
.poster--hero .poster-dish { font-size: 44cqi; top: 22%; }

@media (prefers-reduced-motion: no-preference) {
  .poster--hero .poster-dish { animation: plop .7s cubic-bezier(.3, 1.6, .5, 1) both .08s; }
  .poster--hero .poster-garnish { animation: plop .6s cubic-bezier(.3, 1.6, .5, 1) both .28s; }
}
@keyframes plop {
  from { opacity: 0; transform: translateY(-40px) rotate(18deg) scale(.6); }
}

.poster-list { display: grid; gap: 16px; }

/* ---------- Today ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.greet { margin: 0; font-weight: 600; font-size: 15px; }

.diet-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
}
.diet-btn:focus-visible { border-radius: 999px; }

.affirm {
  padding: 26px 22px 20px;
  border-radius: 30px;
  background: var(--bg);
  color: var(--card);
}
.affirm-text {
  margin: 0 0 22px;
  font-family: var(--display);
  font-size: 38px;
  line-height: .95;
  letter-spacing: -.015em;
  text-transform: lowercase;
  text-wrap: balance;
}
.affirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.affirm-streak { font-size: 14px; font-weight: 600; opacity: .85; }
.affirm .pill[aria-pressed="true"] { background: transparent; color: var(--card); box-shadow: inset 0 0 0 2px var(--card); }

.numbers {
  display: grid;
  grid-template-columns: 124px 1fr;
  align-items: center;
  gap: 20px;
}
.ring { position: relative; width: 124px; height: 124px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring .ring-track { stroke: color-mix(in srgb, var(--bg) 12%, transparent); }
.ring .ring-fill { stroke: var(--bg); stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ring-label {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center;
}
.ring-label strong { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1; color: var(--bg); }
.ring-label span { font-size: 12px; color: var(--muted); }

.bars { display: grid; gap: 12px; margin: 0; }
.bar dt { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.bar dt span { font-weight: 500; color: var(--muted); }
.bar dd { margin: 5px 0 0; height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 9%, transparent); overflow: hidden; }
.bar dd i { display: block; height: 100%; border-radius: inherit; background: var(--c); transition: width .6s ease; }

/* ---------- Meal slots ---------- */

.slots { display: grid; gap: 10px; }

.slot { display: grid; gap: 6px; }
.slot-meal { font-size: 13px; font-weight: 600; color: var(--muted); }
.slot-body { display: flex; align-items: center; gap: 8px; }

.slot-recipe {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 14px 8px 8px;
  border-radius: 22px;
  background: var(--p-card);
  color: var(--p-ink);
  text-decoration: none;
}
.slot-recipe:focus-visible { border-radius: 22px; }
.slot-emoji {
  flex: none;
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 16px;
  background: var(--p-bg);
  font-size: 30px;
}
.slot-text { display: grid; min-width: 0; }
.slot-name { font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-kcal { font-size: 13px; opacity: .8; }

.slot-add {
  flex: 1;
  min-height: 68px;
  border: 2px dashed color-mix(in srgb, var(--bg) 35%, transparent);
  border-radius: 22px;
  background: transparent;
  color: var(--bg);
  font-weight: 600;
}
.slot-add:focus-visible { border-radius: 22px; }

.empty {
  padding: 24px 20px;
  border-radius: 24px;
  background: var(--card);
  text-align: left;
}
.empty p { margin: 0 0 16px; }

/* ---------- Recipes list ---------- */

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 12px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--card);
  color: var(--bg);
}
.search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; outline: none;
  color: var(--ink);
  font-size: 16px;
}
.search input::placeholder { color: var(--muted); }
.search:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

.count { margin: 10px 0 14px; font-size: 14px; color: var(--muted); }

/* ---------- Recipe detail ---------- */

.detail-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.blurb { margin: 18px 0 0; font-size: 17px; line-height: 1.5; text-wrap: pretty; }

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 20px 0 0;
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg) 9%, transparent);
}
.facts div { padding: 14px 6px; text-align: center; }
.facts div + div { border-left: 1px solid color-mix(in srgb, var(--bg) 14%, transparent); }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-family: var(--display); font-size: 24px; line-height: 1.1; color: var(--bg); }
.facts dd small { font-family: var(--text); font-size: 13px; font-weight: 600; }
.facts-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bg) 40%, transparent);
  font-size: 13px;
  font-weight: 600;
  color: var(--bg);
}

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li + li { border-top: 1px solid var(--line); }
.check {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 8px 0;
  cursor: pointer;
}
.check input {
  appearance: none;
  flex: none;
  width: 24px; height: 24px;
  margin: 0;
  border: 2px solid var(--bg);
  border-radius: 50%;
  display: grid; place-items: center;
}
.check input:checked {
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.check input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.check-text { flex: 1; min-width: 0; }
.check-text small { display: block; font-size: 12px; color: var(--muted); }
.qty { font-weight: 700; }
.check input:checked + .check-text { text-decoration: line-through; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 18px; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
}
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--card);
  font-family: var(--display);
  font-size: 18px;
}
.steps p { margin: 6px 0 0; }
.step-time { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--bg); }

/* ---------- Cook mode ---------- */

.cook {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  color: var(--card);
}
.cook .icon-btn { background: color-mix(in srgb, var(--card) 16%, transparent); color: var(--card); }
.cook-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cook-name { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1; text-transform: lowercase; }
.cook-progress { display: flex; gap: 5px; margin: 20px 0 28px; }
.cook-progress i { flex: 1; height: 5px; border-radius: 9px; background: color-mix(in srgb, var(--card) 25%, transparent); }
.cook-progress i.done { background: var(--card); }
.cook-count { margin: 0; font-weight: 600; opacity: .8; }
.cook-text {
  margin: 10px 0 0;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-wrap: pretty;
}
.cook-dish { font-size: 96px; line-height: 1; margin: auto 0 0; transform: rotate(-10deg); align-self: flex-end; }
.cook-timer { display: flex; align-items: center; gap: 14px; margin-top: 28px; }
.cook-clock { font-family: var(--display); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.cook-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 24px; }
.cook .pill--ghost-light { background: transparent; color: var(--card); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--card) 50%, transparent); }
.cook .pill--ghost-light:disabled { opacity: .4; cursor: default; }

/* ---------- Plan ---------- */


.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 18px 0 20px;
}
.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 0 9px;
  border: 0;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 8%, transparent);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.day:focus-visible { border-radius: 16px; }
.day.is-today { box-shadow: inset 0 0 0 2px var(--bg); }
.day[aria-pressed="true"] { background: var(--bg); color: #fff; }
.day-dots { display: flex; gap: 3px; height: 5px; }
.day-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }

.day-total { margin: 0 0 6px; font-size: 14px; }
.day-total strong { font-weight: 700; }
.day-meter { height: 8px; margin-bottom: 20px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 9%, transparent); overflow: hidden; }
.day-meter i { display: block; height: 100%; border-radius: inherit; background: var(--bg); }
.day-meter.is-over i { background: var(--accent); }

.plan-foot { display: flex; justify-content: center; margin-top: 18px; }

/* ---------- Groceries ---------- */

.shop-for { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.shop-for span { font-weight: 600; font-size: 14px; }
.aisle { margin-top: 22px; }
.aisle h2 { margin: 0 0 2px; font-size: 15px; font-weight: 700; color: var(--bg); }

/* ---------- Sheet ---------- */

.sheet {
  width: min(440px, 100%);
  max-width: 100%;
  max-height: 86dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 30px 30px 0 0;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: color-mix(in srgb, #000 45%, transparent); }
@media (min-width: 760px) {
  .sheet { margin: auto; border-radius: 30px; }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: rise .32s cubic-bezier(.2, .9, .3, 1); }
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 8px;
}
.sheet-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; color: var(--bg); text-transform: lowercase; }
.sheet-body { padding: 8px 20px 20px; overflow-y: auto; }
.sheet-foot { padding: 12px 20px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet-label { margin: 16px 0 8px; font-size: 14px; font-weight: 700; }
.sheet .chips { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; }

.diet-list { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.diet-opt {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1.5px var(--line);
  cursor: pointer;
}
.diet-opt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--bg); background: color-mix(in srgb, var(--bg) 6%, transparent); }
.diet-opt input { accent-color: var(--bg); width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.diet-opt strong { display: block; }
.diet-opt small { display: block; color: var(--muted); font-size: 13px; }

.kcal-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; font-weight: 700; }
.macro-preview { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pick-list .slot-recipe { width: 100%; border: 0; text-align: left; font: inherit; cursor: pointer; }
.toggle-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; font-size: 14px; font-weight: 600; }
.toggle-row input { accent-color: var(--bg); width: 18px; height: 18px; }

/* ---------- Screen head (title + action) ---------- */

.screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.screen-head .screen-title { margin: 4px 0 0; }
.screen-title--inline { flex: 1; font-size: 40px; }

/* ---------- Mood + feel ---------- */

.mood-line {
  margin: 14px 0 12px;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  color: var(--bg);
  text-transform: lowercase;
  text-wrap: balance;
}

.log-btn {
  flex: none;
  min-width: 64px;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 10%, transparent);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
}
.log-btn:focus-visible { border-radius: 999px; }
.log-btn.is-logged { min-width: 44px; padding: 0; font-size: 22px; background: var(--card); }

.icon-btn--on-dark { background: color-mix(in srgb, var(--card) 18%, transparent); color: var(--card); }

.feel-intro { margin: 0 0 16px; color: var(--muted); }
.feel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feel-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 10px;
  border: 0;
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg) 8%, transparent);
  font-weight: 700;
  color: var(--ink);
}
.feel-opt:focus-visible { border-radius: 22px; }
.feel-opt[aria-pressed="true"] { background: var(--bg); color: #fff; }
.feel-emoji { font-size: 40px; line-height: 1; }

.feel-score {
  margin: 14px 0 0;
  padding: 12px 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg) 9%, transparent);
  font-size: 14px;
}

.warn {
  margin: 14px 0 0;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--bg);
  color: var(--card);
  font-size: 14px;
  font-weight: 600;
}

.detail-tools { display: flex; gap: 8px; }

/* ---------- Fridge ---------- */

.fridge-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 12px 12px 18px;
  border-radius: 22px;
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
}
.fridge-item .missing { margin: 8px 6px 0; font-size: 14px; color: var(--muted); }
.fridge-item .missing strong { color: var(--ink); }
.search--sheet { margin: 4px 0 8px; border: 2px solid var(--line, rgba(0, 0, 0, .12)); }
.fridge-browse [hidden] { display: none !important; }
.fridge-none { margin: 16px 0; color: var(--muted); }
.fridge-count { margin: 0 0 10px; font-size: 14px; font-weight: 600; text-align: center; }
.fridge-all { display: block; margin: 12px auto 0; }

.sheet-help { margin-top: 0; }
.sheet-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-foot-row .pill { flex: 1; }
.sheet-foot-row .link { flex: none; }
.link:disabled { opacity: .4; cursor: default; }

.field { display: grid; gap: 6px; margin-top: 16px; font-size: 14px; font-weight: 700; }
.field input {
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1.5px var(--line);
  background: transparent;
  font-size: 16px;
  font-weight: 400;
}
.field input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Swipe deck ---------- */

body[data-route="swipe"] .view { display: flex; flex-direction: column; }
.swipe { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.deck-count { font-size: 14px; font-weight: 600; color: var(--muted); }

.deck { position: relative; flex: 1; min-height: 360px; }
.deck-card {
  position: absolute;
  inset: 0;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.deck-card:active { cursor: grabbing; }
.deck-card .poster { height: 100%; }
.deck-card .poster-inner { height: 100%; }
.deck-card .poster-dish { top: 30%; font-size: 46cqi; }
.deck-card.is-next { transform: translateY(14px) scale(.94); opacity: .75; pointer-events: none; }

@media (prefers-reduced-motion: no-preference) {
  .deck-card.is-arriving { animation: arrive .3s cubic-bezier(.2, .9, .3, 1); }
}
@keyframes arrive { from { transform: translateY(14px) scale(.94); } }

.stamp {
  position: absolute;
  z-index: 3;
  padding: 6px 18px 10px;
  border-radius: 18px;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
}
.stamp--yes { top: 34px; left: 28px; background: var(--p-bg, var(--bg)); color: #fff; transform: rotate(-10deg); }
.stamp--no { top: 34px; right: 28px; background: #fff; color: var(--ink); transform: rotate(10deg); box-shadow: inset 0 0 0 3px var(--ink); }
.stamp--up { bottom: 90px; left: 50%; background: var(--ink); color: #fff; transform: translateX(-50%); }

.deck-hint { margin: 14px 0 10px; text-align: center; font-size: 13px; color: var(--muted); }
.deck-actions { display: flex; justify-content: center; align-items: center; gap: 18px; }
.round-btn {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
}
.round-btn:focus-visible { border-radius: 50%; }
.round-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.round-btn--sm { width: 50px; height: 50px; }
.round-btn--sm svg { width: 22px; height: 22px; }
.round-btn--yes { background: var(--bg); color: #fff; box-shadow: none; }
.round-btn:active { transform: scale(.94); }

/* ---------- Share ---------- */

.share-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 56dvh;
  object-fit: contain;
  border-radius: 20px;
}

/* ---------- Tbilisi shopping ---------- */

:lang(ka) { font-family: "Noto Sans Georgian", var(--text); }

.actions-wide { grid-column: 1 / -1; }

.tag--solid { background: var(--bg); color: var(--card); box-shadow: none; }

.basket {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 18px 18px 16px;
  border-radius: 26px;
  background: var(--card);
}
.basket .chips { margin: 0 -18px; padding: 2px 18px 4px; }
.basket-note { margin: 0; font-size: 14px; color: var(--muted); text-wrap: pretty; }
.basket-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.basket-total strong { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; color: var(--bg); }
.sheet .basket-total { margin: 14px 0 12px; }
.sheet .basket-note { margin-top: 4px; }

.list-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.list-actions .pill { flex: 1; }

.shop-row { display: flex; align-items: center; gap: 10px; }
.shop-row .check { flex: 1; min-width: 0; }
.check--static { cursor: default; }
.shop-side { display: flex; align-items: center; gap: 8px; flex: none; }
.price { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price--pack { color: var(--muted); font-weight: 600; }
.price--est { color: var(--muted); font-weight: 600; }
.check-text small.source { margin-top: 2px; }
.check-text small.source--est { font-style: italic; }
.price--pack { color: var(--ink); font-weight: 700; text-align: right; }
.price--pack small { margin-left: 4px; font-size: 11px; }
.price--pack small.jar { display: block; margin: 1px 0 0; color: var(--muted); font-weight: 600; }
.find {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--bg);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.find:focus-visible { border-radius: 999px; }
.price-col { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.have-btn {
  min-height: 28px;
  padding: 0 10px;
  border: 2px solid var(--line, rgba(0, 0, 0, .14));
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.sheet-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sheet-label-row .link { font-size: 14px; }

.ka { color: var(--muted); font-size: 13px; }
.shop--bazaar .ka { display: block; color: var(--ink); font-size: 16px; font-weight: 600; }

.fineprint { margin: 22px 0 0; font-size: 12px; color: var(--muted); text-wrap: pretty; }

/* ---------- Filters, allergens, equipment ---------- */

.search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.search-row .search { flex: 1; min-width: 0; margin-bottom: 0; }
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
}
.filter-btn:focus-visible { border-radius: 999px; }
.filter-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.filter-btn b {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 2px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--card);
  color: var(--bg);
  font-size: 12px;
}
.filter-btn.is-on { background: var(--bg); color: #fff; }

.active-filters { display: grid; gap: 2px; margin: -2px 0 10px; font-size: 13px; color: var(--muted); }
.active-filters p { margin: 0; }
.active-filters strong { color: var(--ink); }
.active-filters .link { padding: 0; font-size: 13px; text-decoration: underline; }

.toggle-row--top { margin-top: 14px; }

.allergens { margin: 12px 0 0; font-size: 13px; color: var(--muted); text-wrap: pretty; }
.allergens strong { color: var(--ink); }

.tool-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.tool {
  display: grid;
  padding: 8px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 9%, transparent);
  font-size: 14px;
  font-weight: 600;
}
.tool small { font-size: 11px; font-weight: 600; color: var(--bg); }
.tool.is-missing { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bg); }
.tool-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- TikTok ---------- */

.trend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 14px 14px 18px;
  border-radius: 22px;
  background: var(--bg);
  color: var(--card);
}
.trend p { margin: 0; font-size: 14px; text-wrap: pretty; }
.trend .pill--solid { flex: none; background: var(--card); color: var(--bg); }

/* ---------- First-visit call to action, footer ---------- */

.start {
  margin-bottom: 18px;
  padding: 20px 20px 18px;
  border-radius: 28px;
  background: var(--card);
}
.start-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 32px;
  line-height: .95;
  color: var(--bg);
  text-wrap: balance;
}
.start p { margin: 0 0 16px; color: var(--muted); }

.app-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.app-foot a { color: var(--muted); text-underline-offset: 3px; padding: 6px 0; }

.noscript { margin: 24px; color: #fff; font: 16px/1.5 system-ui, sans-serif; }

.field-error { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--bg); }
.field input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--bg); }

/* ---------- Chamiko calorie diary ---------- */

.chamiko-card {
  margin-bottom: 18px;
  padding: 2px 16px 16px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--bg) 7%, transparent);
}
.chamiko-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kcal-line { margin: 14px 0 0; font-size: 14px; }
.source-line { margin: 4px 0 0; font-size: 13px; color: var(--muted); text-wrap: pretty; }
.source-line .link { padding: 0; font-size: 13px; text-decoration: underline; }
.ring--over .ring-fill { stroke: var(--accent); }
.ring--over .ring-label strong { color: var(--accent); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100% - 40px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .25s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
.block-links { display: flex; gap: 14px; }

/* ---------- Pantry tab ---------- */

.seg {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 999px;
  background: var(--card);
}
.seg-btn {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.seg-btn b { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; }
.seg-btn[aria-selected="true"] { background: var(--bg); color: #fff; }
.seg-btn[aria-selected="true"] b { background: #fff; color: var(--bg); }
.kitchen-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 22px;
  background: var(--card);
}
.kitchen-summary p { flex: 1 1 200px; margin: 0; font-size: 14px; }
.kitchen-have { margin-bottom: 8px; }
body[data-route="pantry"] .chips { margin: 0; padding: 2px 0 6px; flex-wrap: wrap; overflow: visible; }
.kitchen-have { margin: 4px 0 14px; padding: 14px 16px 8px; border-radius: 22px; background: var(--card); }
.kitchen-have .block-title { margin: 0 0 6px; }
.home-count { margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; vertical-align: middle; }
.home-row + .home-row { margin-top: 6px; }

/* ---------- Timer island ---------- */
/* A black pill at the top of every screen while a cooking timer runs. It opens into a large card. */

.island {
  --orange: #FF9F0A;
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: 50%;
  z-index: 60;
  transform: translateX(-50%);
  color: #fff;
  font-family: system-ui, -apple-system, "SF Pro Text", sans-serif;
}
.island[hidden] { display: none; }
.island button { font: inherit; color: inherit; cursor: pointer; }

.island-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  min-width: 190px;
  height: 40px;
  padding: 0 16px 0 9px;
  border: 0;
  border-radius: 999px;
  background: #000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  animation: island-in .45s cubic-bezier(.2, .9, .3, 1.2);
}
.island-ring { width: 26px; height: 26px; transform: rotate(-90deg); }
.island-ring circle { fill: none; stroke-width: 3; }
.ring-bg { stroke: rgba(255, 159, 10, .25); }
.ring-fg { stroke: var(--orange); stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.island-pill .island-time { color: var(--orange); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

.island--open { width: min(360px, calc(100vw - 24px)); }
.island-scrim {
  position: fixed;
  inset: -100vh -100vw;
  z-index: -1;
  border: 0;
  background: rgba(0, 0, 0, .15);
}
.island-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  height: 132px;
  padding: 0 20px;
  border-radius: 44px;
  background: #000;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  animation: island-grow .4s cubic-bezier(.2, .9, .3, 1.1);
}
.island-edge { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.island-edge path { fill: none; stroke-width: 7; }
.edge-track { stroke: #2c2c2e; }
.edge-fill { stroke: var(--orange); stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray .5s linear; }

.island-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
}
.island-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.island-btn--pause { background: #2c2c2e; color: #fff; }
.island-btn--pause svg path[d^="M8 5.5"] { fill: currentColor; stroke-width: 1.5; }
.island-btn--stop { background: #5a1414; color: #ff453a; }

.island-mid {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
}
.island-ends { display: flex; align-items: center; gap: 4px; color: #8e8e93; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.island-ends svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.island-time--big { font-size: 46px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.island-label { max-width: 100%; overflow: hidden; color: #8e8e93; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.island--done .island-pill,
.island--done .island-card { animation: island-shake .6s ease 2; }
.island--done .island-ends { color: var(--orange); }

/* Room for the pill so it never covers a screen title. */
body.has-island .view { padding-top: calc(60px + env(safe-area-inset-top)); }

@keyframes island-in { from { transform: scale(.6); opacity: 0; } }
@keyframes island-grow { from { transform: scale(.55, .35); opacity: .4; border-radius: 999px; } }
@keyframes island-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) {
  .island-pill, .island-card { animation: none !important; }
  .ring-fg, .edge-fill { transition: none; }
}
