/* ─── Reset + tokens ──────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: 100%; }
img, picture, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }

:root {
  --bg:        #fcfaf6;
  --surface:   #ffffff;
  --ink:       #1a1612;
  --ink-soft:  #4a423d;
  --muted:     #8a817c;
  --rule:      #e8e3da;
  --rule-soft: #f1ede5;
  --accent:    #b8412c;
  --accent-ink:#7a2a1c;

  --serif:     'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, 'Times New Roman', serif;
  --sans:      -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;

  --w-page: 1180px;
  --w-read: 720px;
  --r:      4px;
  --shadow: 0 1px 2px rgba(26,22,18,.04), 0 8px 24px -16px rgba(26,22,18,.18);
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); }
h3 { font-size: 1.25rem; }
.eyebrow { font-family: var(--sans); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* ─── Layout ──────────────────────────────────────────────────────── */
.page  { max-width: var(--w-page); margin: 0 auto; padding: 0 24px; }
.read  { max-width: var(--w-read); margin: 0 auto; padding: 0 24px; }

/* ─── Header ──────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(8px);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
}
.brand {
  font-family: var(--serif); font-size: 1.55rem; font-weight: 700;
  color: var(--ink); text-decoration: none; letter-spacing: -.01em;
}
.brand em { font-style: italic; color: var(--accent); font-weight: 500; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
.nav-links a:hover { color: var(--accent); }
.nav-links .pill {
  padding: 6px 14px; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--surface);
}

/* ─── Buttons / inputs ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r);
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  cursor: pointer; text-decoration: none; font-size: .95rem; font-weight: 500;
  transition: transform .05s ease, background .15s ease, color .15s ease;
}
.btn:hover { background: #000; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.ghost  { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--rule-soft); color: var(--ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.accent:hover { background: var(--accent-ink); }
.btn.small  { padding: 6px 12px; font-size: .85rem; }
.btn.danger { background: transparent; color: var(--accent-ink); border-color: var(--rule); }
.btn.danger:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

input[type=text], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  font-family: var(--sans); font-size: .95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--ink-soft);
  box-shadow: 0 0 0 3px rgba(26,22,18,.06);
}
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-size: .82rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }

/* ─── Landing (home) — Option C redesign ─────────────────────────── */
:root {
  --cream-deep: #ede7d9;
}

/* Banner */
.kn-banner {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px;
  padding: 32px 0 18px;
}
.kn-banner .eyebrow { display: inline-block; }
.kn-banner .byline-name {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  color: var(--accent); font-size: .8rem; letter-spacing: 0; text-transform: none;
}
.kn-banner h1 {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  max-width: 28ch;
  margin-top: 10px;
}
.kn-banner h1 em {
  color: var(--accent); font-style: italic; font-weight: 500;
}
.kn-banner-meta {
  font-size: .82rem; color: var(--muted); white-space: nowrap;
  padding-bottom: 6px;
}
@media (max-width: 700px) {
  .kn-banner { flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px 0 8px; }
  .kn-banner-meta { padding-bottom: 0; }
}

/* Oversized search */
.kn-search-wrap { padding: 8px 0 18px; }
.kn-search {
  display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 22px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.kn-search:focus-within {
  border-color: var(--ink-soft);
  box-shadow: 0 0 0 3px rgba(26,22,18,.06);
}
.kn-search-icon { color: var(--muted); flex: 0 0 auto; }
.kn-search input {
  flex: 1 1 auto;
  width: auto;
  border: none; outline: none; background: transparent;
  padding: 0;
  font-family: var(--serif); font-size: 1.1rem; color: var(--ink);
}
.kn-search input:focus { border: none; box-shadow: none; }
.kn-search input::placeholder { color: var(--muted); font-style: normal; opacity: 1; }
.kn-kbd {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .7rem; color: var(--muted);
  padding: 5px 8px; border: 1px solid var(--rule); border-radius: 4px;
  background: var(--bg);
  flex: 0 0 auto;
}
.kn-result-count {
  font-family: var(--serif);
  font-style: italic;
  font-size: .9rem;
  color: var(--muted);
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .kn-search { height: 52px; padding: 0 16px; gap: 10px; }
  .kn-search input { font-size: 1rem; }
  .kn-kbd { display: none; }
}

/* Mood chips row */
.kn-moods-row {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.kn-moods-label { flex: 0 0 auto; }
.kn-moods-row .moods {
  display: flex; flex-wrap: wrap; gap: 8px;
}
@media (max-width: 600px) {
  .kn-moods-row { gap: 8px; }
  .kn-moods-row .moods {
    flex-wrap: nowrap; overflow-x: auto;
    width: 100%; padding-bottom: 4px;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .kn-moods-row .moods::-webkit-scrollbar { display: none; }
}

/* Tonight, try… */
.kn-tonight {
  display: grid; grid-template-columns: 5fr 7fr; gap: 32px;
  background: var(--cream-deep);
  border-radius: 6px;
  padding: 24px;
  margin: 28px 0 8px;
  align-items: stretch;
  max-height: 800px;
}
.kn-tonight-photo-link { display: block; text-decoration: none; }
.kn-tonight-photo {
  aspect-ratio: 4 / 5;
  background: var(--rule-soft) center/cover no-repeat;
  border-radius: 4px;
  min-height: 320px;
  height: 100%;
}
.kn-tonight-photo.empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-family: var(--serif); font-style: italic;
}
.kn-tonight-body {
  display: flex; flex-direction: column; justify-content: center;
  padding-right: 8px; min-width: 0;
}
.kn-tonight-kicker {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.kn-tonight-kicker .dice { font-size: 1.1rem; line-height: 1; }
.kn-tonight-sep { width: 24px; height: 1px; background: var(--rule); flex: 0 0 24px; }
.kn-tonight-mini {
  font-family: var(--serif); font-style: italic; font-size: .85rem;
  color: var(--muted);
}
.kn-tonight h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -.02em;
  margin: 12px 0 8px;
}
.kn-tonight-tagline {
  font-family: var(--serif); font-style: italic;
  font-size: 1.02rem; line-height: 1.5;
  color: var(--ink-soft);
  margin: 0; max-width: 52ch;
}
.kn-tonight-tagline:empty { display: none; }
.kn-tonight-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 18px;
  font-size: .88rem; color: var(--muted); font-weight: 500;
}
.kn-tonight-meta .kn-sep {
  width: 1px; height: 12px; background: var(--rule); display: inline-block;
}
.kn-tonight-meta:empty { display: none; }
.kn-tonight-actions {
  display: flex; align-items: center; gap: 10px;
  margin-top: 22px; flex-wrap: wrap;
}
.kn-tonight-browse {
  margin-left: auto;
  font-size: .82rem; color: var(--muted); text-decoration: none;
}
.kn-tonight-browse:hover { color: var(--ink); }
@media (max-width: 760px) {
  .kn-tonight { grid-template-columns: 1fr; gap: 0; padding: 0; overflow: hidden; }
  .kn-tonight-photo { aspect-ratio: 4 / 3; min-height: 0; border-radius: 0; }
  .kn-tonight-body { padding: 18px; }
  .kn-tonight h2 { font-size: 1.6rem; margin: 6px 0 6px; }
  .kn-tonight-mini, .kn-tonight-sep { display: none; }
  .kn-tonight-actions { gap: 8px; }
  .kn-tonight-actions .btn { flex: 1 1 auto; justify-content: center; }
  .kn-tonight-browse { display: none; }
}

/* From the kitchen notes — quiet one-line band */
.kn-tipline {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 0 22px;
  margin: 18px 0 0;
  border-bottom: 1px dashed var(--rule);
  max-height: 200px;
}
.kn-tipline .eyebrow {
  flex: 0 0 auto; white-space: nowrap;
}
.kn-tipline #tip {
  font-family: var(--serif); font-style: italic;
  font-size: 1.05rem; line-height: 1.45;
  color: var(--ink-soft); margin: 0; flex: 1 1 auto;
}
.kn-tipline #tip::before { content: '“'; color: var(--accent); }
.kn-tipline #tip::after  { content: '”'; color: var(--accent); }
.kn-tip-another {
  background: transparent; border: none; cursor: pointer;
  font-family: var(--sans); font-size: .82rem;
  color: var(--muted);
  padding: 4px 8px; border-radius: var(--r);
  transition: color .15s ease, background .15s ease;
  flex: 0 0 auto; white-space: nowrap;
}
.kn-tip-another:hover { color: var(--ink); background: var(--rule-soft); }
@media (max-width: 700px) {
  .kn-tipline { flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 0 18px; }
  .kn-tipline #tip { font-size: 1rem; }
  .kn-tip-another { align-self: flex-start; padding-left: 0; }
}

/* Just added — 3-up strip */
.kn-just-added { padding: 28px 0 8px; max-height: 800px; }

/* Smooth collapse/expand for the three discovery sections.
 * Toggled via the .kn-collapsed class from JS (search query or active mood chip). */
.kn-tonight, .kn-tipline, .kn-just-added {
  overflow: hidden;
  transition:
    max-height 320ms cubic-bezier(.4, 0, .2, 1),
    opacity 220ms ease,
    margin 320ms cubic-bezier(.4, 0, .2, 1),
    padding 320ms cubic-bezier(.4, 0, .2, 1),
    border-color 220ms ease;
}
.kn-tonight.kn-collapsed,
.kn-tipline.kn-collapsed,
.kn-just-added.kn-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom-color: transparent;
  pointer-events: none;
}
@media (max-width: 760px) {
  .kn-tonight    { max-height: 1100px; }
  .kn-just-added { max-height: 1400px; }
}
@media (prefers-reduced-motion: reduce) {
  .kn-tonight, .kn-tipline, .kn-just-added { transition: none; }
}
.kn-just-added-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.kn-this-week {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); font-weight: 600;
  text-decoration: none;
}
.kn-this-week:hover { color: var(--accent); }
.kn-just-added-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.kn-ja-card {
  display: flex; gap: 14px; align-items: center;
  text-decoration: none; color: inherit;
  transition: transform .2s ease;
}
.kn-ja-card:hover { transform: translateY(-1px); }
.kn-ja-photo {
  width: 88px; height: 88px; flex: 0 0 88px;
  background: var(--rule-soft) center/cover no-repeat;
  border-radius: 4px;
}
.kn-ja-photo.empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-family: var(--serif); font-style: italic; font-size: .72rem;
}
.kn-ja-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kn-ja-body .eyebrow { font-size: .64rem; }
.kn-ja-body h3 { font-size: 1.05rem; line-height: 1.2; margin: 2px 0 2px; }
.kn-ja-body .meta { color: var(--muted); font-size: .85rem; }
@media (max-width: 860px) {
  .kn-just-added-grid { grid-template-columns: 1fr; gap: 0; }
  .kn-just-added-grid .kn-ja-card { padding: 12px 0; border-top: 1px solid var(--rule-soft); }
  .kn-just-added-grid .kn-ja-card:first-child { border-top: none; }
  .kn-ja-photo { width: 72px; height: 72px; flex: 0 0 72px; }
}

/* All recipes section head — restyle the separator into a real divider */
#all-recipes { border-top: 1px solid var(--rule); padding-top: 24px; margin-top: 20px; }

.tag {
  display: inline-block; padding: 4px 12px;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--bg); color: var(--ink-soft);
  font-size: .82rem; text-decoration: none; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tag:hover { border-color: var(--ink); color: var(--ink); }
.tag.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ─── Recipe grid ─────────────────────────────────────────────────── */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 36px 0 16px;
  gap: 16px; flex-wrap: wrap;
}
.section-head .count { color: var(--muted); font-size: .9rem; }
.head-meta {
  display: flex; align-items: baseline; gap: 18px;
}
.sort-controls {
  display: flex; align-items: baseline; gap: 8px;
  font-size: .92rem;
}
.sort-label {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-right: 4px;
}
.sort-opt {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--sans); font-size: .92rem;
  color: var(--muted);
  transition: color .15s ease;
}
.sort-opt:hover { color: var(--ink); }
.sort-opt.active {
  color: var(--ink); font-weight: 600;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.sort-sep { color: var(--rule); }

.grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  padding-bottom: 64px;
}
.card {
  display: block; text-decoration: none; color: inherit;
  background: transparent;
  transition: transform .2s ease;
}
.card:hover { transform: translateY(-2px); }
.card .img {
  aspect-ratio: 4/3;
  background: var(--rule-soft) center/cover no-repeat;
  border-radius: var(--r);
  margin-bottom: 14px;
}
.card .img.empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-family: var(--serif); font-style: italic;
}
.card h3 { font-size: 1.2rem; line-height: 1.2; margin-bottom: 6px; }
.card .meta { color: var(--muted); font-size: .85rem; }

.empty-state {
  text-align: center; padding: 80px 20px;
  border: 1px dashed var(--rule); border-radius: var(--r);
  color: var(--muted);
}

/* ─── Recipe detail ──────────────────────────────────────────────── */
.recipe-hero {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px;
  padding: 48px 0;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 860px) { .recipe-hero { grid-template-columns: 1fr; gap: 28px; } }

.recipe-hero .photo {
  aspect-ratio: 4/3;
  background: var(--rule-soft) center/cover no-repeat;
  border-radius: var(--r);
}
.recipe-hero h1 { margin-bottom: 16px; }
.recipe-hero .lede { color: var(--ink-soft); font-size: 1.15rem; margin-bottom: 24px; max-width: 50ch; }
.recipe-hero .meta-row { display: flex; flex-wrap: wrap; gap: 22px; padding-top: 18px; border-top: 1px solid var(--rule); margin-top: 18px; }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-item .k { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.meta-item .v { font-family: var(--serif); font-size: 1.1rem; }

.servings-control {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 2px;
}
.servings-control button {
  width: 28px; height: 28px; border: none; background: transparent;
  cursor: pointer; font-size: 1rem; color: var(--ink); border-radius: 3px;
}
.servings-control button:hover:not(:disabled) { background: var(--rule-soft); }
.servings-control button:disabled { color: var(--muted); cursor: not-allowed; }
.servings-control .val { font-family: var(--serif); font-size: 1.1rem; min-width: 2ch; text-align: center; }

.recipe-body {
  display: grid; grid-template-columns: 1fr 2fr; gap: 64px;
  padding: 48px 0 80px;
}
@media (max-width: 860px) { .recipe-body { grid-template-columns: 1fr; gap: 40px; } }

.ingredients h2, .steps h2, .notes h2 { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.ingredients ul { list-style: none; padding: 0; }
.ingredients li {
  display: grid; grid-template-columns: auto 1fr;
  gap: 14px; padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
}
.ingredients .amt {
  font-family: var(--serif); font-weight: 600; color: var(--ink);
  white-space: nowrap;
}
.ingredients .item { color: var(--ink-soft); }

.steps ol { list-style: none; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 48px 1fr; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--rule-soft);
  font-family: var(--serif); font-size: 1.18rem; line-height: 1.55;
}
.steps li::before {
  content: counter(step);
  font-family: var(--serif); font-size: 2rem; color: var(--accent);
  font-weight: 600; line-height: 1;
}

.notes { margin-top: 48px; padding: 24px; background: var(--rule-soft); border-radius: var(--r); }
.notes p { font-family: var(--serif); font-style: italic; color: var(--ink-soft); }

/* Wake-lock indicator */
.wake-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--rule-soft); border-radius: 999px;
  font-size: .78rem; color: var(--muted);
}
.wake-indicator.on { background: rgba(184,65,44,.1); color: var(--accent-ink); }
.wake-indicator .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
}
.wake-indicator.on .dot { background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ─── Admin / forms ──────────────────────────────────────────────── */
.admin-bar {
  background: var(--ink); color: #fff;
  padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .9rem;
}
.admin-bar a { color: #fff; }

.form-grid { display: grid; gap: 18px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .form-row-2, .form-row-3 { grid-template-columns: 1fr; } }

.ing-row, .step-row {
  display: grid; gap: 8px; align-items: start;
  margin-bottom: 8px;
}
.ing-row { grid-template-columns: 80px 80px 1fr 32px; }
.step-row { grid-template-columns: 1fr 32px; }
.row-del {
  width: 32px; height: 38px; border: 1px solid var(--rule); background: var(--surface);
  border-radius: var(--r); cursor: pointer; color: var(--muted);
}
.row-del:hover { color: var(--accent); border-color: var(--accent); }

.photo-upload {
  border: 2px dashed var(--rule); border-radius: var(--r);
  padding: 24px; text-align: center; color: var(--muted);
  cursor: pointer; background: var(--surface);
  transition: border-color .15s ease, color .15s ease;
}
.photo-upload:hover, .photo-upload.drag { border-color: var(--ink); color: var(--ink); }
.photo-upload img { max-height: 220px; margin: 0 auto 12px; border-radius: var(--r); }

.admin-list {
  display: grid; gap: 0;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface);
}
.admin-row {
  display: grid; grid-template-columns: 60px 1fr auto;
  gap: 16px; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule-soft);
}
.admin-row:last-child { border-bottom: none; }
.admin-row .thumb { width: 60px; height: 45px; background: var(--rule-soft) center/cover no-repeat; border-radius: 3px; }
.admin-row .title-cell { min-width: 0; }
.admin-row .title-cell strong { font-family: var(--serif); font-weight: 600; }
.admin-row .title-cell .sub { color: var(--muted); font-size: .85rem; }
.admin-row .actions { display: flex; gap: 8px; }

/* Login screen */
.login-card {
  max-width: 380px; margin: 80px auto;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 36px; box-shadow: var(--shadow);
}
.login-card h1 { margin-bottom: 8px; }
.login-card p { color: var(--muted); margin-bottom: 24px; }
.login-card .form-grid { gap: 14px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: var(--r);
  box-shadow: var(--shadow);
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.toast.error { background: var(--accent); }

/* ─── Tools page ─────────────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 32px 0 80px;
}
@media (max-width: 760px) { .tools-grid { grid-template-columns: 1fr; } }

.tool-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 28px;
  display: grid; gap: 18px;
}
.tool-card.wide { grid-column: 1 / -1; }
.tool-card h2 { font-size: 1.4rem; line-height: 1; }
.tool-body { display: grid; gap: 18px; }
.tool-hint { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: .92rem; line-height: 1.5; }

.tool-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-soft);
}
.tool-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--rule-soft); color: var(--ink);
  border-radius: 50%;
}
.tool-titles { display: grid; gap: 4px; }
.tool-titles .eyebrow { font-size: .68rem; }
.tool-reset {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--rule);
  border-radius: 50%; color: var(--muted); cursor: pointer;
  transition: color .15s ease, border-color .15s ease, transform .25s ease;
}
.tool-reset:hover { color: var(--ink); border-color: var(--ink); transform: rotate(-180deg); }

/* Number input cells (the bordered tile look) */
.num-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.num-quad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 480px) {
  .num-trio { grid-template-columns: 1fr 1fr; }
  .num-quad { grid-template-columns: 1fr 1fr; }
}
.num-cell {
  display: grid; gap: 4px;
  margin-bottom: 0; /* override default label margin */
}
.num-cell > span {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.num-cell input,
.num-cell select {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--serif); font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  background: var(--bg); border: 1px solid var(--rule);
  border-radius: var(--r);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.num-cell select { font-size: .95rem; padding: 11px 12px; }
.num-cell input:focus, .num-cell select:focus {
  background: var(--surface); border-color: var(--ink-soft);
  box-shadow: 0 0 0 3px rgba(26,22,18,.06); outline: none;
}

/* Quick-pick chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px; border-radius: 999px;
  background: var(--bg); color: var(--ink-soft);
  border: 1px solid var(--rule); cursor: pointer;
  font-family: var(--sans); font-size: .82rem;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Weight ↔ Volume */
.ing-picker {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: stretch;
}
.ing-picker select {
  padding: 12px; font-size: 1rem;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface);
}
.ing-stat {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  padding: 6px 16px;
  background: var(--rule-soft); border-radius: var(--r);
  text-align: right;
}
.ing-stat-label { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ing-stat-value { font-family: var(--serif); font-size: 1.4rem; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 540px) {
  .ing-picker { grid-template-columns: 1fr; }
  .ing-stat { align-items: flex-start; text-align: left; }
}

/* Salt comparison cards */
.salt-input-row {
  display: grid; grid-template-columns: .8fr 1fr 1.6fr; gap: 12px;
}
@media (max-width: 540px) {
  .salt-input-row { grid-template-columns: 1fr 1fr; }
  .salt-input-row > :last-child { grid-column: 1 / -1; }
}
.salt-results { display: grid; gap: 10px; }
.salt-empty {
  text-align: center; color: var(--muted); font-style: italic; font-family: var(--serif);
  padding: 20px;
}
.salt-card {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--bg);
  align-items: center;
}
.salt-card.you {
  background: rgba(184,65,44,.05);
  border-color: var(--accent);
  border-left-width: 3px; padding-left: 16px;
}
.salt-badge {
  position: absolute; top: -10px; left: 14px;
  background: var(--accent); color: #fff;
  font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
}
.salt-name {
  display: grid; gap: 2px;
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600;
}
.salt-name span {
  font-family: var(--sans); font-weight: 400; font-size: .78rem;
  color: var(--muted); text-transform: lowercase;
}
.salt-figures {
  display: flex; gap: 18px; align-items: baseline;
}
.salt-fig { display: flex; flex-direction: column; align-items: flex-end; }
.salt-fig .v {
  font-family: var(--serif); font-size: 1.35rem; font-variant-numeric: tabular-nums;
  line-height: 1;
}
.salt-fig .u {
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-top: 2px;
}
.salt-card.you .salt-fig .v { color: var(--accent-ink); }
@media (max-width: 540px) {
  .salt-card { grid-template-columns: 1fr; gap: 8px; }
  .salt-figures { gap: 14px; }
}

/* Meat doneness */
.protein-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  border-bottom: 1px solid var(--rule); padding-bottom: 0;
}
.tab {
  padding: 8px 16px;
  background: transparent; border: none; cursor: pointer;
  font-family: var(--sans); font-size: .92rem; color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s ease, border-color .15s ease;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

.doneness-list { display: grid; gap: 0; }
.done-row {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 16px; align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.done-row:last-child { border-bottom: none; }
.done-band { width: 6px; height: 38px; border-radius: 3px; }
.done-label { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.done-temps { display: flex; gap: 28px; }
.done-temp { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.dt-key { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dt-val {
  font-family: var(--serif); font-size: 1.2rem; font-variant-numeric: tabular-nums;
}
.dt-val small { font-size: .78rem; color: var(--muted); margin-left: 2px; font-family: var(--sans); }
@media (max-width: 540px) {
  .done-temps { gap: 14px; }
  .dt-val { font-size: 1.05rem; }
}

/* Pan size */
.pan-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
@media (max-width: 700px) { .pan-grid { grid-template-columns: 1fr; } }
.pan-col { display: grid; gap: 8px; }
.pan-row {
  display: grid; grid-template-columns: 1.1fr .8fr .8fr .6fr; gap: 8px;
  align-items: end;
}
.pan-row > select, .pan-row > input {
  padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r);
  font-family: var(--serif); font-size: 1rem;
}
.pan-row input[hidden] { display: none; }

.pan-visual {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 16px;
  min-height: 130px;
  display: flex; align-items: center; justify-content: center;
}
.pan-visual:empty { display: none; }
.pan-visual svg { width: 100%; max-width: 460px; height: auto; }

.pan-result {
  background: var(--rule-soft); border-radius: var(--r);
  padding: 16px 20px;
  display: grid; gap: 12px;
}
.pan-result .muted { color: var(--muted); font-style: italic; font-family: var(--serif); }
.pan-figures {
  display: flex; gap: 32px; flex-wrap: wrap;
}
.pan-figures > div { display: flex; flex-direction: column; gap: 2px; }
.pf-key { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pf-val { font-family: var(--serif); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.pan-advice { font-family: var(--serif); font-size: 1rem; color: var(--ink-soft); margin: 0; }
.pan-advice strong { font-family: var(--sans); font-weight: 600; color: var(--ink); }

/* Multi-timer */
.timer-add {
  display: grid; grid-template-columns: 2fr .6fr .6fr auto; gap: 10px;
  align-items: stretch;
}
.timer-add input {
  padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--rule);
  border-radius: var(--r); font-size: .95rem;
}
.timer-add button { align-self: stretch; }
@media (max-width: 600px) {
  .timer-add { grid-template-columns: 1fr 1fr; }
  .timer-add input:first-child { grid-column: 1 / -1; }
  .timer-add button { grid-column: 1 / -1; }
}
.timer-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.timer-list:empty::before {
  content: 'No timers running. Tap a preset above or add your own.';
  display: block; text-align: center;
  color: var(--muted); font-family: var(--serif); font-style: italic;
  padding: 14px; border: 1px dashed var(--rule); border-radius: var(--r);
}
.timer-item {
  border: 1px solid var(--rule); border-radius: var(--r);
  padding: 14px 18px;
  background: var(--bg);
  display: grid; gap: 10px;
}
.timer-item .t-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px;
}
.timer-item .t-name { font-family: var(--serif); font-size: 1.05rem; }
.timer-item .t-time {
  font-family: var(--serif); font-size: 1.8rem; font-variant-numeric: tabular-nums;
  color: var(--ink); line-height: 1;
}
.timer-item .t-bar {
  width: 100%; height: 4px; background: var(--rule);
  border-radius: 2px; overflow: hidden;
}
.timer-item .t-bar-fill {
  height: 100%; width: 0%; background: var(--ink);
  transition: width .25s linear;
}
.timer-item .t-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.timer-item.done {
  background: rgba(184,65,44,.08);
  border-color: var(--accent);
}
.timer-item.done .t-time { color: var(--accent-ink); font-style: italic; }
.timer-item.done .t-bar-fill { background: var(--accent); }

@media print {
  .site-header, .nav-links, .servings-control, .wake-indicator, .admin-bar, .btn { display: none !important; }
  body { background: #fff; }
  .recipe-hero .photo { display: none; }
  .recipe-body { grid-template-columns: 1fr 2fr; gap: 32px; }
}
