/* Sift — flour, herbs and paprika. Mobile first; the phone is in a floury hand. */

:root {
  --bg: #f6f1e8;
  --surface: #fffcf6;
  --surface-2: #efe8db;
  --surface-3: #e6dccb;
  --ink: #1f2621;
  --ink-2: #5d655e;
  --ink-3: #8b918a;
  --line: #e3d9c8;
  --herb: #2e5e4e;
  --herb-ink: #ffffff;
  --herb-soft: #dfeae2;
  --paprika: #d9622b;
  --paprika-soft: #fbe3d4;
  --saffron: #e6a434;
  --saffron-soft: #fbefd4;
  --berry: #a8435b;
  --sky: #3b6fa8;
  --plum: #7a5aa6;
  --danger: #b8402c;
  --shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 6px 20px rgba(60, 45, 20, .07);
  --shadow-lg: 0 10px 40px rgba(40, 30, 10, .18);
  --radius: 22px;
  --radius-sm: 14px;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121512;
    --surface: #1b1f1b;
    --surface-2: #232823;
    --surface-3: #2d332d;
    --ink: #eef0e9;
    --ink-2: #a9b0a7;
    --ink-3: #757d74;
    --line: #2c322c;
    --herb: #8cc7a6;
    --herb-ink: #10221a;
    --herb-soft: #20332a;
    --paprika: #f08a52;
    --paprika-soft: #3a2519;
    --saffron: #f0bb57;
    --saffron-soft: #382d18;
    --berry: #e07b93;
    --sky: #7fb0e6;
    --plum: #b69ae0;
    --danger: #ef7d68;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0; }
p { margin: 0; }
.i { width: 22px; height: 22px; flex: none; }
.i--sm { width: 16px; height: 16px; }
.i--lg { width: 28px; height: 28px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* --- Layout --------------------------------------------------------------- */

.app { max-width: 760px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.main { padding: 0 16px calc(120px + var(--safe-bottom)); }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 10px;
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar__title { font-family: var(--display); font-weight: 600; font-size: 17px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: 1; }
.brand__mark { width: 34px; height: 34px; color: var(--herb); }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -.03em; }
.page-title { font-size: clamp(30px, 8vw, 40px); margin: 6px 0 4px; }

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--herb); color: var(--herb-ink);
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:hover { filter: brightness(1.06); }
.btn--paprika { background: var(--paprika); color: #fff; }
.btn--soft { background: var(--surface-2); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 14.5px; }
.btn--lg { min-height: 58px; font-size: 17px; padding: 0 26px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none;
  display: inline-grid; place-items: center; cursor: pointer; text-decoration: none;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn--flat { background: transparent; box-shadow: none; }
.icon-btn.is-on { color: var(--berry); }
.link-btn { background: none; border: 0; padding: 0; color: var(--herb); font-weight: 600; cursor: pointer; text-decoration: none; }

/* --- Cards & surfaces ----------------------------------------------------- */

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card--flat { box-shadow: none; background: var(--surface-2); }
.section { margin-top: 30px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section__title { font-size: 24px; }
.eyebrow { font-size: 12.5px; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }

/* --- Paste box (home hero) ------------------------------------------------ */

.paste {
  margin-top: 8px; padding: 18px; border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--saffron-soft) 0%, transparent 55%),
    radial-gradient(120% 140% at 0% 100%, var(--herb-soft) 0%, transparent 60%),
    var(--surface);
  box-shadow: var(--shadow);
}
.paste__label { font-family: var(--display); font-weight: 600; font-size: 19px; margin-bottom: 4px; }
.paste__hint { color: var(--ink-2); font-size: 14.5px; margin-bottom: 14px; }
.paste__row { display: flex; gap: 8px; }
.paste__row .field__input { flex: 1; min-width: 0; }
.paste__row [data-paste-button] { width: 50px; padding: 0; flex: none; }
.paste__row [data-paste-button] span { display: none; }
.paste__more { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px 8px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1.5px solid var(--line);
  font-size: 14.5px; font-weight: 500; text-decoration: none; color: var(--ink); cursor: pointer;
}
.chip-btn .i { width: 18px; height: 18px; color: var(--ink-2); }

/* --- Fields --------------------------------------------------------------- */

.field { display: block; }
.field + .field { margin-top: 16px; }
.field__label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.field__help { display: block; color: var(--ink-3); font-size: 13px; margin-top: 6px; }
.field__input, .field input[type=text], .field input[type=url], .field input[type=number], .field input[type=password],
.field textarea, .field select {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s; font-size: 16px;
}
.field textarea { min-height: 120px; line-height: 1.55; resize: vertical; }
.field__input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--herb); box-shadow: 0 0 0 4px color-mix(in srgb, var(--herb) 18%, transparent);
}
.field__input--pill { border-radius: 999px; }
.errorlist { color: var(--danger); font-size: 14px; margin: 6px 0 0; padding: 0; list-style: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 360px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field input, .field select, .field textarea { min-width: 0; }
.grid-2 .field + .field, .grid-4 .field + .field { margin-top: 0; }

.search { position: relative; margin-top: 18px; }
.search .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search input { padding-left: 48px; border-radius: 999px; background: var(--surface-2); border-color: transparent; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 15px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
  font-size: 14.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.chip.is-on { background: var(--ink); color: var(--bg); }

/* --- Recipe grid ---------------------------------------------------------- */

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { text-decoration: none; display: block; position: relative; }
.tile__img {
  aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--surface-2);
  position: relative; box-shadow: var(--shadow);
}
.tile__img img { width: 100%; height: 100%; object-fit: cover; }
.tile__fav { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.9); color: var(--berry); display: grid; place-items: center; }
.tile__fav .i { width: 17px; height: 17px; }
.tile__meta { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px;
  background: rgba(20, 22, 18, .62); color: #fff; font-size: 12.5px; font-weight: 600;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pill .i { width: 14px; height: 14px; }
.tile__title { font-weight: 600; font-size: 15.5px; line-height: 1.3; margin-top: 9px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile__sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.placeholder {
  width: 100%; height: 100%; display: grid; place-items: center; color: var(--herb);
  background:
    radial-gradient(circle at 30% 25%, var(--saffron-soft) 0 18%, transparent 19%),
    radial-gradient(circle at 75% 70%, var(--herb-soft) 0 24%, transparent 25%),
    var(--surface-2);
}
.placeholder span { font-family: var(--display); font-size: 40px; font-weight: 700; opacity: .85; }

/* --- Pending imports ------------------------------------------------------ */

.pending { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.pending__row { display: flex; align-items: center; gap: 6px; }
.pending__row .pending__item { flex: 1; min-width: 0; }
.pending__item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow); text-decoration: none; }
.pending__thumb { width: 54px; height: 54px; border-radius: 13px; overflow: hidden; flex: none; background: var(--surface-2);
  display: grid; place-items: center; color: var(--ink-3); }
.pending__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pending__title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.status--waiting { color: var(--saffron); }
.status--failed { color: var(--danger); }
.status--fetching, .status--parsing { color: var(--herb); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Empty state ---------------------------------------------------------- */

.empty { text-align: center; padding: 34px 18px 10px; }
.empty__art { width: 96px; height: 96px; margin: 0 auto 14px; color: var(--herb); }
.empty h2 { font-size: 22px; margin-bottom: 8px; }
.empty p { color: var(--ink-2); max-width: 34ch; margin: 0 auto; }

/* --- Tab bar -------------------------------------------------------------- */

.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-bottom)); z-index: 40;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px;
  width: min(420px, calc(100% - 28px)); padding: 7px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-radius: 999px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0; border-radius: 999px;
  text-decoration: none; color: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.tab.is-on { color: var(--herb); background: var(--herb-soft); }
.tab__icon { position: relative; display: inline-flex; }
.badge { position: absolute; top: -5px; right: -10px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--paprika); color: #fff; font-size: 11px; display: grid; place-items: center; font-style: normal; }
.tab--add { padding: 0 6px; }
.tab__plus { width: 56px; height: 56px; border-radius: 50%; background: var(--paprika); color: #fff;
  display: grid; place-items: center; box-shadow: 0 6px 18px color-mix(in srgb, var(--paprika) 45%, transparent);
  transition: transform .15s; }
.tab__plus .i { width: 28px; height: 28px; }
.tab--add:active .tab__plus { transform: scale(.92) rotate(90deg); }

/* --- Toasts --------------------------------------------------------------- */

.toasts { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 28px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 13px 18px; border-radius: 16px; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: toast-in .25s ease, toast-out .3s ease 3.6s forwards; }
.toast--error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* --- Recipe page ---------------------------------------------------------- */

.hero { margin: 0 -16px; position: relative; }
.hero__img { aspect-ratio: 4 / 3.4; max-height: 62vh; overflow: hidden; background: var(--surface-2); }
@media (min-width: 760px) { .hero { margin: 0; } .hero__img { border-radius: var(--radius); } }
.hero__img img { width: 100%; height: 100%; object-fit: cover; }
.hero__bar { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: 16px; right: 16px;
  display: flex; gap: 10px; align-items: center; }
.hero__bar .icon-btn { background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hero--noimg .hero__img { aspect-ratio: auto; height: calc(76px + env(safe-area-inset-top, 0px)); background: transparent; }
.recipe-head { position: relative; margin: -34px -16px 0; background: var(--bg); border-radius: 28px 28px 0 0; padding: 24px 16px 0; }
.hero--noimg + .recipe-head { margin-top: 0; padding-top: 4px; }
@media (min-width: 760px) { .recipe-head { margin: 0; padding: 22px 0 0; } }
.recipe-title { font-size: clamp(27px, 7.4vw, 38px); }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; color: var(--ink-2); font-size: 15px; }
.byline a { color: var(--paprika); font-weight: 600; text-decoration: none; }
.byline__item { display: inline-flex; align-items: center; gap: 5px; }
.byline__item .i { width: 18px; height: 18px; }
.diff--easy { color: var(--herb); font-weight: 600; }
.diff--medium { color: var(--saffron); font-weight: 600; }
.diff--hard { color: var(--danger); font-weight: 600; }
.recipe-desc { margin-top: 12px; color: var(--ink-2); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--saffron-soft); margin-top: 16px; font-size: 14.5px; }
.banner .i { color: var(--saffron); margin-top: 1px; }
.banner--herb { background: var(--herb-soft); }
.banner--herb .i { color: var(--herb); }

.nutri { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nutri__val { font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.1; }
.nutri__lbl { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.nutri__bar { height: 5px; border-radius: 3px; background: var(--surface-3); margin-top: 10px; overflow: hidden; }
.nutri__bar i { display: block; height: 100%; border-radius: 3px; }
.c-kcal { color: var(--paprika); } .b-kcal { background: var(--paprika); }
.c-prot { color: var(--sky); } .b-prot { background: var(--sky); }
.c-fat { color: var(--saffron); } .b-fat { background: var(--saffron); }
.c-carb { color: var(--plum); } .b-carb { background: var(--plum); }

.servings { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.servings__val { font-family: var(--display); font-size: 30px; font-weight: 600; }
.servings__val small { font-family: var(--text); font-size: 16px; color: var(--ink-2); font-weight: 500; }
.stepper { display: flex; gap: 10px; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--paprika-soft); color: var(--paprika); display: grid; place-items: center; }
.stepper button:active { transform: scale(.93); }

.ing-group + .ing-group { margin-top: 18px; }
.ing-group__title { font-weight: 700; font-size: 14px; color: var(--ink-2); margin: 0 4px 8px; }
.ing-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ing { display: flex; align-items: center; gap: 12px; padding: 13px 14px 13px 16px; position: relative; }
.ing + .ing::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; border-top: 1px solid var(--line); }
/* A 44px tap target around a 26px circle — fingers in the kitchen are floury. */
.ing__check { width: 44px; height: 44px; margin: -9px; border: 0; flex: none; position: relative;
  display: grid; place-items: center; background: none; cursor: pointer; color: transparent; padding: 0; }
.ing__check::before { content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--surface-3); box-sizing: border-box; transition: background .15s, border-color .15s; }
.ing__check .i { width: 16px; height: 16px; position: relative; }
.ing.is-done .ing__check { color: var(--herb-ink); }
.ing.is-done .ing__check::before { background: var(--herb); border-color: var(--herb); }
[data-ing] .ing__body { cursor: pointer; -webkit-user-select: none; user-select: none; }
.ing.is-done .ing__name, .ing.is-done .ing__amt { text-decoration: line-through; color: var(--ink-3); }
.ing__body { flex: 1; min-width: 0; }
.ing__name { font-size: 17px; font-weight: 500; }
.ing__amt { color: var(--ink-2); font-size: 15px; font-variant-numeric: tabular-nums; }
.ing__note { color: var(--ink-3); font-size: 13.5px; }
.tag-home { font-size: 12px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.ing__add { width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none; cursor: pointer;
  background: var(--paprika); color: #fff; display: grid; place-items: center; transition: transform .15s, background .2s; }
.ing__add:active { transform: scale(.9); }
.ing__add.is-pantry { background: var(--surface-2); color: var(--ink-3); }
.ing__add.is-added { background: var(--herb-soft); color: var(--herb); }

.steps { display: flex; flex-direction: column; gap: 12px; }
.step { display: grid; grid-template-columns: 38px 1fr; gap: 6px 10px; padding: 18px 16px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); }
.step__n { font-family: var(--display); font-size: 26px; font-weight: 600; color: var(--paprika); line-height: 1.1; }
.step__text { font-size: 17px; line-height: 1.5; }
.step--img { grid-template-columns: 38px 1fr 96px; }
.step__extra { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.step__img { grid-column: 3; grid-row: 1 / span 2; align-self: start; width: 96px; height: 96px; border-radius: 16px; overflow: hidden; }
.step__img img { width: 100%; height: 100%; object-fit: cover; }
.mini { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 600; border: 0; cursor: pointer; }
.mini .i { width: 15px; height: 15px; }
.mini--timer { background: var(--saffron-soft); color: color-mix(in srgb, var(--saffron) 70%, var(--ink)); }
.step-group__title { font-weight: 700; color: var(--ink-2); font-size: 14px; margin: 8px 4px 0; }

.cook-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-bottom)); z-index: 30;
  width: min(520px, calc(100% - 28px)); display: flex; gap: 10px; align-items: center; padding: 7px;
  border-radius: 999px; background: color-mix(in srgb, var(--surface) 86%, transparent); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); }
.cook-bar .btn { box-shadow: 0 6px 18px color-mix(in srgb, var(--paprika) 40%, transparent); }
.cook-bar .icon-btn { box-shadow: none; background: var(--surface-2); width: 52px; height: 52px; }
.notes { white-space: pre-line; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag { padding: 4px 11px; border-radius: 999px; background: var(--herb-soft); color: var(--herb); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.source-card { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.source-card__icon { width: 44px; height: 44px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; flex: none; }

/* Wide screens — a tablet on the counter: ingredients beside the method. */
@media (min-width: 1000px) {
  body:has(.recipe-cols) .app { max-width: 1120px; }
  .recipe-cols { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .recipe-cols > [data-ingredients] { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto;
    padding-bottom: 90px; scrollbar-width: thin; }
  .hero__img { max-height: 46vh; }
}

/* Menu */
.menu { position: relative; }
.menu__list { position: absolute; right: 0; top: 52px; min-width: 220px; background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; border: 1px solid var(--line); }
.menu__list form { margin: 0; }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border: 0; background: none;
  border-radius: 12px; cursor: pointer; text-decoration: none; font-size: 15.5px; text-align: left; color: var(--ink); }
.menu__item:hover { background: var(--surface-2); }
.menu__item--danger { color: var(--danger); }

/* --- Cooking mode --------------------------------------------------------- */

.cook { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.cook__top { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 8px; }
.cook__progress { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.cook__progress i { display: block; height: 100%; background: var(--paprika); border-radius: 3px; transition: width .3s ease; }
.cook__count { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 15px; min-width: 52px; text-align: right; }
.cook__body { flex: 1; overflow-y: auto; padding: 10px 22px 20px; max-width: 760px; width: 100%; margin: 0 auto; }
.cook__section { color: var(--ink-3); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.cook__n { font-family: var(--display); font-weight: 700; font-size: 64px; color: var(--paprika); line-height: 1; margin: 8px 0 14px; }
.cook__text { font-size: clamp(22px, 5.8vw, 30px); line-height: 1.38; font-weight: 500; }
.cook__img { margin-top: 18px; border-radius: var(--radius); overflow: hidden; max-height: 34vh; }
.cook__img img { width: 100%; max-height: 34vh; object-fit: cover; }
.cook__ings { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.cook__ing { padding: 9px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 16px; }
.cook__ing b { color: var(--paprika); font-weight: 700; }
.cook__timer { margin-top: 22px; }
.timer { display: inline-flex; align-items: center; gap: 12px; padding: 10px 12px 10px 20px; border-radius: 999px;
  background: var(--saffron-soft); }
.timer__time { font-family: var(--display); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 4.2ch; }
.timer.is-done { background: var(--paprika); color: #fff; animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.cook__nav { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 16px calc(14px + var(--safe-bottom));
  max-width: 760px; width: 100%; margin: 0 auto; }
.cook__nav .btn { min-height: 62px; font-size: 18px; }
.cook__ingredients-sheet { position: fixed; inset: auto 0 0 0; max-height: 75vh; overflow-y: auto; background: var(--surface);
  border-radius: 26px 26px 0 0; padding: 18px 18px calc(24px + var(--safe-bottom)); box-shadow: var(--shadow-lg); z-index: 60;
  transform: translateY(105%); transition: transform .28s ease; }
.cook__ingredients-sheet.is-open { transform: none; }
.timers-dock { position: fixed; right: 14px; top: calc(64px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 8px; z-index: 55; }
.timers-dock .timer { padding: 6px 8px 6px 14px; box-shadow: var(--shadow); }
.timers-dock .timer__time { font-size: 18px; }

/* --- Add page ------------------------------------------------------------- */

.option { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); cursor: pointer; text-decoration: none; border: 0; width: 100%; text-align: left; }
.option + .option { margin-top: 10px; }
.option__icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.option__icon--link { background: var(--herb-soft); color: var(--herb); }
.option__icon--camera { background: var(--saffron-soft); color: color-mix(in srgb, var(--saffron) 75%, var(--ink)); }
.option__icon--text { background: var(--surface-2); color: var(--ink-2); }
.option__icon--pen { background: var(--paprika-soft); color: var(--paprika); }
.option__title { font-weight: 650; font-size: 17px; }
.option__sub { color: var(--ink-2); font-size: 14px; }
.panel { margin-top: 10px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); }
.platforms { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.platforms span { font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 3px 9px; border-radius: 999px; background: var(--surface); }
.dropzone { display: grid; place-items: center; gap: 8px; text-align: center; padding: 26px 14px; border-radius: var(--radius-sm);
  border: 2px dashed var(--line); background: var(--surface); cursor: pointer; }
.dropzone input { display: none; }

/* --- Import status -------------------------------------------------------- */

.import-card { text-align: center; padding: 26px 18px; overflow-wrap: anywhere; }
.import-card__thumb { width: 150px; aspect-ratio: 4 / 5; margin: 0 auto 18px; border-radius: 20px; overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink-3); }
.import-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.progress-steps { display: flex; justify-content: center; gap: 6px; margin: 18px 0 6px; }
.progress-steps i { width: 38px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.progress-steps i.is-on { background: var(--herb); }
.progress-steps i.is-now { background: linear-gradient(90deg, var(--herb), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.source-text { white-space: pre-wrap; font-size: 14.5px; max-height: 340px; overflow: auto; padding: 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); text-align: left; }

/* --- Editor --------------------------------------------------------------- */

.editor-split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.editor-split > * { min-width: 0; }
@media (min-width: 900px) { .page-edit .app { max-width: 1180px; } .editor-split { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .editor-split aside { position: sticky; top: 80px; } }
.preview-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.preview-list div { display: flex; gap: 8px; }
.preview-list b { min-width: 76px; color: var(--paprika); font-weight: 600; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--herb); padding: 6px 0; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
.savebar { position: sticky; bottom: calc(12px + var(--safe-bottom)); margin-top: 22px; display: flex; gap: 10px; z-index: 10; }
.savebar .btn { flex: 1; box-shadow: var(--shadow-lg); }

/* --- Shopping ------------------------------------------------------------- */

.shop-add { display: flex; gap: 8px; margin-top: 14px; }
.shop-add .field__input { flex: 1; }
.aisle + .aisle { margin-top: 18px; }
.aisle__title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--ink-2); margin: 0 4px 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 16px; position: relative; }
.item + .item::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; border-top: 1px solid var(--line); }
.item__name { font-size: 17px; font-weight: 500; }
.item__amt { color: var(--ink-2); font-size: 15px; }
.item__from { color: var(--ink-3); font-size: 12.5px; }
.item.is-done .item__name { text-decoration: line-through; color: var(--ink-3); }
.item__del { opacity: .55; }
.recipe-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.recipe-chip { flex: none; display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow); text-decoration: none; font-size: 14px; font-weight: 600; max-width: 230px; }
.recipe-chip img, .recipe-chip .dot { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.recipe-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Profile & auth ------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat span { overflow-wrap: anywhere; hyphens: auto; }
.stat { background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--display); font-size: 26px; font-weight: 600; }
.stat span { color: var(--ink-2); font-size: 13px; }
.list-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-card > * + * { border-top: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 15px 16px; text-decoration: none; }
.lang-switch { display: flex; gap: 6px; }
.auth { max-width: 420px; margin: 0 auto; padding: 8vh 4px 40px; }
.auth__brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 28px; text-align: center; }
.auth__brand .brand__mark { width: 70px; height: 70px; }
.auth__brand h1 { font-size: 36px; letter-spacing: -.03em; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.field input[type=file] { max-width: 100%; font-size: 14px; }
