/* ============================================================
   Kitchen Mate — shared design system
   Cream cookbook canvas + workspace components.
   Loaded by every page via <link rel="stylesheet" href="/assets/css/kitchenmate.css">.
   Consumes Fraunces (display + italic), Geist (body), Geist Mono.
   ============================================================ */

:root {
  /* ── Color tokens ───────────────────────────────────────── */
  --paper:        #F7F1E5;   /* warm cream canvas */
  --paper-2:      #F1E9D6;   /* raised panel surface */
  --paper-3:      #EFE6D2;   /* elevated chip / toolbar bg */
  --paper-4:      #E8DDC4;   /* deep panel / disabled */

  --ink:          #1A140E;   /* near-black warm */
  --ink-2:        #5A4F44;   /* soft text */
  --ink-3:        #8A7E6F;   /* faint text */

  --rule:         rgba(26, 20, 14, 0.12);
  --rule-2:       rgba(26, 20, 14, 0.22);
  --rule-strong:  rgba(26, 20, 14, 0.40);

  --accent:       #EA6A12;
  --accent-ink:   #B14A06;
  --accent-soft:  rgba(234, 106, 18, 0.10);
  --accent-glow:  rgba(234, 106, 18, 0.25);

  --saved:        #6BA539;
  --saved-soft:   rgba(107, 165, 57, 0.14);
  --warn:         #C58B14;
  --warn-soft:    rgba(197, 139, 20, 0.14);
  --danger:       #C5482D;
  --danger-soft:  rgba(197, 72, 45, 0.14);

  /* ── Type stack ─────────────────────────────────────────── */
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans:    'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:    'Geist Mono', 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* ── Layout tokens ──────────────────────────────────────── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-soft: 0 18px 48px -24px rgba(26, 20, 14, 0.18);
  --shadow-deep: 0 28px 60px -20px rgba(26, 20, 14, 0.25);
}

@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
}

* { box-sizing: border-box; }

/* ── Base body ─────────────────────────────────────────────── */
body.km-shell {
  background: var(--paper) !important;
  background-image:
    radial-gradient(1100px 600px at 100% -10%, rgba(234, 106, 18, 0.08), transparent 55%),
    radial-gradient(900px 500px at -10% 110%, rgba(234, 106, 18, 0.05), transparent 60%) !important;
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

.km-grain {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.22;
  mix-blend-mode: multiply;
}

/* Hide aprycot decorative artifacts on every page */
body.km-shell .user-img1 { display: none !important; }

/* ── Sidebar overrides (Aprycot in cream canvas) ───────────── */
body.km-shell .sidebar {
  background: rgba(247, 241, 229, 0.85) !important;
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--rule);
}
body.km-shell .sidebar .nav-link,
body.km-shell .sidebar .nav-link span,
body.km-shell .sidebar .item-name {
  color: var(--ink-2) !important;
}
body.km-shell .sidebar .nav-link:hover,
body.km-shell .sidebar .nav-link.active {
  color: var(--ink) !important;
  background: var(--accent-soft) !important;
}
body.km-shell .sidebar .nav-link.active i,
body.km-shell .sidebar .nav-link:hover i { color: var(--accent) !important; }
body.km-shell .sidebar .logo div { color: var(--ink) !important; }
body.km-shell .sidebar hr,
body.km-shell .sidebar .hr-horizontal {
  border-color: var(--rule) !important;
  background: var(--rule) !important;
}
body.km-shell .sidebar-toggle i { color: var(--ink-2) !important; }
body.km-shell .sidebar-toggle:hover i { color: var(--accent) !important; }

/* ── Main content scaffold ─────────────────────────────────── */
.km-main {
  background: transparent !important;
  position: relative;
  z-index: 2;
  padding: 24px 56px 120px 56px !important;
}
@media (min-width: 1500px) { .km-main { padding-left: 80px !important; padding-right: 80px !important; } }
@media (max-width: 720px)  { .km-main { padding: 16px 18px 140px 18px !important; } }

/* ── Topbar ────────────────────────────────────────────────── */
.km-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 22px 0;
  border-bottom: 1px solid var(--rule);
}
.km-mark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--ink) !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.km-mark::after {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  align-self: center;
}
.km-topbar .sidebar-toggle { color: var(--ink-2); cursor: pointer; }
.km-topbar .sidebar-toggle:hover { color: var(--accent); }

.km-account { margin-left: auto; }
.km-account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2) !important;
  text-decoration: none !important;
  transition: border-color .2s ease, color .2s ease;
}
.km-account-trigger:hover { color: var(--ink) !important; border-color: var(--rule-2); }
.km-account-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(234, 106, 18, 0.18);
}

.km-dropdown.dropdown-menu {
  background: var(--paper) !important;
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  padding: 6px 0;
  box-shadow: var(--shadow-soft);
}
.km-dropdown .dropdown-item {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink) !important;
  padding: 9px 16px;
}
.km-dropdown .dropdown-item:hover {
  background: var(--paper-3);
  color: var(--accent-ink) !important;
}
.km-dropdown .dropdown-divider { border-top-color: var(--rule); }

/* ── Masthead ──────────────────────────────────────────────── */
.km-masthead { padding: 60px 0 32px 0; }
@media (max-width: 720px) { .km-masthead { padding: 36px 0 24px 0; } }

.km-kicker {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-2);
  margin-bottom: 24px;
}
.km-kicker .pulse {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
  animation: km-ping 2.4s ease-out infinite;
}
@keyframes km-ping {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  80%  { box-shadow: 0 0 0 12px rgba(234,106,18,0); }
  100% { box-shadow: 0 0 0 0 rgba(234,106,18,0); }
}

.km-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(48px, 8vw, 120px);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.035em;
  line-height: 0.95;
  color: var(--ink);
  margin: 0 0 32px 0;
  max-width: 16ch;
}
.km-title em {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

.km-sub {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink-2);
  max-width: 56ch;
  margin: -8px 0 32px 0;
}

.km-rule {
  height: 1px;
  background: var(--ink);
  position: relative;
}
.km-rule::after {
  content: "";
  position: absolute;
  left: 0; top: -2px;
  width: 84px; height: 5px;
  background: var(--accent);
}

/* ── Two-column main grid ──────────────────────────────────── */
.km-grid-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 64px;
  padding: 48px 0 64px 0;
  align-items: start;
}
@media (max-width: 1100px) {
  .km-grid-2col { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 32px 0 56px 0; }
  .km-rail { order: -1; }
}
.km-rail {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 24px;
}
@media (max-width: 1100px) { .km-rail { position: static; } }

/* ── Tiles & cards ─────────────────────────────────────────── */
.km-tile {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.km-tile h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 24px;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.012em;
  font-variation-settings: "opsz" 60;
}
.km-tile p {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
  margin: 0;
  max-width: 32ch;
}
.km-tile-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.km-tile-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.km-tile-edit {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3) !important;
  text-decoration: none !important;
  transition: color .2s ease;
}
.km-tile-edit:hover { color: var(--accent) !important; }

/* Solid orange "primary" tile with concentric circles */
.km-tile-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  overflow: hidden;
  box-shadow: 0 14px 30px -22px var(--accent-glow);
}
.km-tile-primary::before {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 200px; height: 200px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  pointer-events: none;
}
.km-tile-primary::after {
  content: "";
  position: absolute;
  right: -120px; top: -120px;
  width: 320px; height: 320px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 50%;
  pointer-events: none;
}
.km-tile-primary .km-tile-eyebrow { color: rgba(255,255,255,0.78); }
.km-tile-primary h3 { color: white; }
.km-tile-primary p  { color: rgba(255,255,255,0.85); }

/* CTA buttons */
.km-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper) !important;
  border: 0;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .25s ease;
  text-decoration: none !important;
}
.km-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -12px rgba(26, 20, 14, 0.35); }
.km-cta-spark {
  width: 9px; height: 9px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(234, 106, 18, 0.22);
}

.km-cta-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--rule-2);
  color: var(--ink) !important;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none !important;
  transition: all .2s ease;
}
.km-cta-outline:hover { border-color: var(--accent); color: var(--accent) !important; }

.km-cta-on-orange {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: white !important;
  text-decoration: none !important;
  padding: 9px 18px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
  z-index: 1;
}
.km-cta-on-orange:hover { background: white; color: var(--accent) !important; }
.km-cta-on-orange.disabled-link {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.6) !important;
}

/* Icon buttons (round) */
.km-iconbtn {
  width: 36px; height: 36px;
  border: 1px solid var(--rule-2);
  background: transparent;
  color: var(--ink-2);
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.km-iconbtn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* Disabled-link compatibility (used in inline JS) */
.disabled-link { pointer-events: none; cursor: not-allowed; opacity: 0.55; }

/* ── Segmented control ─────────────────────────────────────── */
.km-segmented {
  display: inline-flex;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.km-segmented button {
  background: transparent;
  border: 0;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s ease;
}
.km-segmented button:hover { color: var(--ink); }
.km-segmented button.is-active {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px -6px var(--accent-glow);
}

/* ── Pills / chips ─────────────────────────────────────────── */
.km-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  transition: all .2s ease;
}
.km-chip:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.km-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Forms ─────────────────────────────────────────────────── */
.km-input,
input.km-input,
select.km-input,
textarea.km-input {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.km-input::placeholder { color: var(--ink-3); }
.km-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.km-input.is-mono { font-family: var(--mono); font-size: 13px; }

.km-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}

/* Checkbox tiles — used on always-on-hand and onboarding */
.km-checkgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.km-checktile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all .2s ease;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
}
.km-checktile:hover { border-color: var(--rule-2); background: var(--paper-3); }
.km-checktile input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.km-checktile-mark {
  width: 18px; height: 18px;
  border: 1.5px solid var(--rule-2);
  border-radius: 5px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
  background: var(--paper);
}
.km-checktile-mark::after {
  content: "";
  width: 9px; height: 5px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
  transition: opacity .15s ease;
}
.km-checktile input[type="checkbox"]:checked ~ .km-checktile-mark {
  background: var(--accent);
  border-color: var(--accent);
}
.km-checktile input[type="checkbox"]:checked ~ .km-checktile-mark::after { opacity: 1; }
.km-checktile input[type="checkbox"]:checked ~ .km-checktile-label { color: var(--ink); }
.km-checktile:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.km-checktile-label { color: var(--ink-2); transition: color .15s ease; }

/* ── Sticky save command bar ───────────────────────────────── */
.km-savebar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 18px;
  background: var(--paper);
  backdrop-filter: blur(20px);
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  box-shadow: var(--shadow-deep);
}
.km-savebar-status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  min-width: 90px;
  white-space: nowrap;
}
.km-savebar-status.text-warning { color: var(--warn) !important; }
.km-savebar-status.text-success { color: var(--saved) !important; }
.km-savebar-status.text-info    { color: var(--ink-2) !important; }
.km-savebar-status.text-danger  { color: var(--danger) !important; }
.km-savebar-status.text-muted   { color: var(--ink-3) !important; }
.km-savebar-actions { display: inline-flex; gap: 6px; align-items: center; }
.km-savebar-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: all .2s ease;
}
.km-savebar-icon:hover { border-color: var(--accent); color: var(--accent); }
.km-savebar-save {
  background: var(--accent);
  border: 0;
  color: white;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .25s ease;
  box-shadow: 0 8px 24px -8px var(--accent-glow);
}
.km-savebar-save:hover { background: var(--accent-ink); }
.km-savebar-save:disabled { opacity: 0.6; cursor: not-allowed; }
.km-savebar-save.btn-warning {
  background: var(--warn);
  color: white;
  animation: km-pulse-warn 2.4s infinite;
}
.km-savebar-save.btn-success { background: var(--saved); color: white; }
@keyframes km-pulse-warn {
  0%   { box-shadow: 0 0 0 0 rgba(197, 139, 20, 0.45); }
  70%  { box-shadow: 0 0 0 12px rgba(197, 139, 20, 0); }
  100% { box-shadow: 0 0 0 0 rgba(197, 139, 20, 0); }
}
@media (max-width: 720px) {
  .km-savebar { left: 12px; right: 12px; transform: none; bottom: 12px; padding: 8px 10px; }
  .km-savebar-status { display: none; }
}

/* ── Empty states ──────────────────────────────────────────── */
.km-empty {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.km-empty-line {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 30px);
  font-variation-settings: "opsz" 60, "SOFT" 80;
  color: var(--ink);
  margin: 0 0 12px 0;
}
.km-empty-sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

/* ── Footer ────────────────────────────────────────────────── */
.km-footer {
  border-top: 1px solid var(--rule);
  padding: 28px 0 12px 0;
  margin-top: 32px;
}
.km-footer ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.km-footer a {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3) !important;
  text-decoration: none !important;
}
.km-footer a:hover { color: var(--accent) !important; }

/* ── Misc ─────────────────────────────────────────────────── */
body.km-shell .navbar-toggler { border: 1px solid var(--rule) !important; }

/* Stagger animation utility */
@keyframes km-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.km-rise { animation: km-rise .55s cubic-bezier(.2,.7,.2,1) backwards; }

/* ── Recipe detail (shared by scraped + generated) ─────────── */
.rd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  margin: -8px 0 32px 0;
}
.rd-meta-item { display: inline-flex; align-items: baseline; gap: 8px; }
.rd-meta-key {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.rd-meta-val {
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: "opsz" 36;
}
.rd-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: var(--paper-2);
}
.rd-flag-emoji { font-size: 15px; line-height: 1; }
.rd-source {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none !important;
  transition: all .2s ease;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rd-source:hover { border-color: var(--accent); color: var(--accent) !important; }

.rd-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 64px;
  padding: 32px 0 64px 0;
  align-items: start;
}
@media (max-width: 1000px) {
  .rd-grid { grid-template-columns: 1fr; gap: 36px; padding: 24px 0 56px 0; }
}

.rd-section-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 18px 0;
  display: inline-flex;
  align-items: center;
}
.rd-section-title::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--accent);
  margin-right: 12px;
}

.rd-ingredients {
  position: sticky; top: 24px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px 28px;
}
@media (max-width: 1000px) { .rd-ingredients { position: static; } }
.rd-ingredients ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.rd-ingredients li {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.5;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--rule);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: color .2s ease, opacity .2s ease;
  user-select: none;
}
.rd-ingredients li:first-child { border-top: 1px dashed var(--rule); }
.rd-ingredients li:last-child  { border-bottom: 0; }
.rd-ingredients li::before {
  content: "";
  flex-shrink: 0;
  width: 16px; height: 16px;
  margin-top: 6px;
  border: 1.5px solid var(--rule-2);
  border-radius: 4px;
  background: transparent;
  transition: all .2s ease;
}
.rd-ingredients li:hover::before { border-color: var(--accent); }
.rd-ingredients li.is-checked {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: var(--rule-2);
  opacity: 0.7;
}
.rd-ingredients li.is-checked::before {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'><path d='M3 8.5l3 3 7-7' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.rd-instructions ol {
  list-style: none;
  padding: 0; margin: 0;
  counter-reset: step;
}
.rd-instructions ol li {
  position: relative;
  counter-increment: step;
  padding: 0 0 28px 56px;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  font-variation-settings: "opsz" 14;
  cursor: pointer;
  transition: color .2s ease, opacity .2s ease;
}
.rd-instructions ol li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding-top: 4px;
  transition: color .2s ease;
}
.rd-instructions ol li::after {
  content: "";
  position: absolute;
  left: 18px; top: 22px; bottom: 6px;
  width: 1px;
  background: linear-gradient(to bottom, var(--rule-2), transparent);
}
.rd-instructions ol li:last-child::after { display: none; }
.rd-instructions ol li.is-done {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: var(--rule);
  opacity: 0.65;
}
.rd-instructions ol li.is-done::before { color: var(--ink-3); }

.rd-empty {
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-3);
  font-size: 16px;
  padding: 12px 0;
}

.rd-notfound {
  padding: 120px 0 80px 0;
  text-align: center;
}
.rd-notfound .km-empty-line {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 16px;
}
.rd-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2) !important;
  text-decoration: none !important;
  padding: 9px 18px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  transition: all .2s ease;
}
.rd-back:hover { border-color: var(--accent); color: var(--accent) !important; }

.rd-back-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 24px 0 0 0;
  border-top: 1px solid var(--rule);
  margin-top: 32px;
}

/* ── Cookbook search toolbar ───────────────────────────────── */
.km-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin: 0 0 18px 0;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.km-toolbar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.km-toolbar-icon {
  flex-shrink: 0;
  width: 18px; height: 18px;
  color: var(--ink-3);
}
.km-search-input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  padding: 4px 0;
  min-width: 0;
}
.km-search-input::placeholder {
  color: var(--ink-3);
  font-style: italic;
}
.km-search-clear {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 999px;
  transition: color .2s ease, background .2s ease;
  display: none;
}
.km-search-clear:hover { color: var(--accent); background: var(--accent-soft); }
.km-toolbar.has-query .km-search-clear { display: inline-flex; }
.km-search-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.km-no-matches {
  display: none;
  padding: 40px 0;
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-3);
  font-size: 18px;
}
.km-no-matches.is-visible { display: block; }

/* ── Marketing variant (sign-in) ───────────────────────────── */
body.km-marketing {
  background: var(--paper) !important;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 500px at 100% -10%, rgba(234, 106, 18, 0.10), transparent 55%),
    radial-gradient(900px 500px at 0% 110%, rgba(234, 106, 18, 0.06), transparent 60%) !important;
}
.km-marketing-shell { max-width: 1240px; margin: 0 auto; padding: 36px 32px 80px 32px; }
@media (max-width: 720px) { .km-marketing-shell { padding: 24px 18px 64px 18px; } }
