/* WeeklyMealPlan — Structural Layout & Components (Theme-Agnostic via CSS Tokens) */

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

html {
  color-scheme: var(--color-scheme);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin: 0;
  font-variation-settings: var(--font-display-variation);
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 0.75rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

strong {
  font-weight: 600;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}

code {
  padding: 0.1rem 0.35rem;
}

pre {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-hairline);
  overflow-x: auto;
  margin: 0.75rem 0 0;
}

pre code {
  padding: 0;
  background: transparent;
}

.muted-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Icons */
.icon {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-sm {
  width: 0.875rem;
  height: 0.875rem;
}

/* Layout Container & Semantic Content Sections */
.container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

main.container {
  padding-top: 0.5rem;
  padding-bottom: 3rem;
}

.content-section {
  background: var(--section-bg);
  border: var(--section-border);
  border-bottom: var(--section-divider);
  box-shadow: var(--section-shadow);
  padding: var(--section-padding);
  border-radius: var(--radius-md);
}

.content-section + .content-section {
  margin-top: var(--section-gap);
}

.content-section:last-child {
  border-bottom: var(--section-border);
}

.content-section h1,
.content-section h2 {
  margin-bottom: 0.65rem;
}

/* Header & De-Boxed Underline Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-hairline);
  padding: 0.5rem 0 0;
}

.site-header.site-header-minimal {
  padding-bottom: 0.5rem;
}

.site-header .container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 44px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-decoration: none;
  font-variation-settings: var(--font-display-variation-brand);
}

.brand-title:hover,
.brand-title:focus-visible {
  color: var(--text-primary);
  text-decoration: none;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  transition: color 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.icon-link:hover,
.icon-link:focus-visible,
.icon-link.active {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-hairline);
  text-decoration: none;
}

.logout-form {
  margin: 0;
}

.nav-links {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.25rem;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: -1px;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-height: 44px;
  padding: 0.5rem 0.35rem;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text-primary);
  text-decoration: none;
}

.nav-link.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-primary);
}

/* Focus Ring */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Forms & Inputs */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="date"],
select,
textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  margin-top: 0.3rem;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

details {
  margin-top: 1rem;
  border-top: 1px solid var(--border-hairline);
  padding-top: 0.75rem;
}

summary {
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Buttons */
button,
[role="button"] {
  font-family: var(--font-body);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  border-radius: var(--button-radius);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  background-color: transparent;
  color: var(--text-primary);
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-compact {
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  width: auto;
}

.primary-action-btn {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-on-accent);
  margin-bottom: 0;
}

.primary-action-btn:hover,
.primary-action-btn:focus-visible {
  background-color: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  color: var(--text-on-accent);
  text-decoration: none;
}

.btn-outline-secondary {
  background-color: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  background-color: var(--bg-surface-elevated);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  text-decoration: none;
}

.btn-outline-danger {
  background-color: transparent;
  border: 1px solid var(--accent-danger-border);
  color: var(--accent-danger);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus-visible {
  background-color: var(--accent-danger-tint);
  border-color: var(--accent-danger);
  color: var(--text-primary);
  text-decoration: none;
}

.btn-utility {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  padding: 0.5rem 0.25rem;
  min-height: 44px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
}

.btn-utility:hover,
.btn-utility:focus-visible {
  color: var(--text-primary);
  text-decoration: none;
}

/* Git Backup Reminder Banner */
.backup-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background-color: var(--accent-warm-tint);
  border: 1px solid var(--accent-warm-border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.backup-banner form {
  margin: 0;
}

/* Alerts */
.alert {
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  margin: 0.75rem 0;
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 0.92rem;
  scroll-margin-top: 7.5rem;
}

.alert-error {
  background-color: var(--accent-danger-tint);
  border-color: var(--accent-danger-border);
  color: var(--text-primary);
}

.alert-success {
  background-color: var(--accent-herb-tint);
  border-color: var(--accent-herb-border);
  color: var(--text-primary);
}

.alert ul {
  margin: 0.4rem 0 0 1.15rem;
  padding: 0;
}

/* Sharp Small-Caps Taxonomy Tags (No Capsule Pills) */
.tag-list,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.tag,
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border: 1px solid var(--border-hairline);
  background-color: transparent;
  color: var(--text-secondary);
  text-decoration: none;
}

.tag-primary,
.badge-number {
  border-color: var(--accent-primary-border);
  background-color: var(--accent-primary-tint);
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
}

.tag-herb,
.badge-diners,
.badge-cooked {
  border-color: var(--accent-herb-border);
  background-color: var(--accent-herb-tint);
  color: var(--accent-herb);
}

.tag-warm,
.badge-leftover,
.badge-batch {
  border-color: var(--accent-warm-border);
  background-color: var(--accent-warm-tint);
  color: var(--accent-warm);
}

.tag-danger,
.badge-skipped {
  border-color: var(--accent-danger-border);
  background-color: var(--accent-danger-tint);
  color: var(--accent-danger);
}

.tag-muted,
.badge-muted {
  border-color: var(--border-hairline);
  color: var(--text-muted);
}

a.tag:hover,
a.tag:focus-visible,
a.badge:hover,
a.badge:focus-visible {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  text-decoration: none;
}

/* Custom Editorial Square Checkbox (18px x 18px, 2px radius) */
.spec-check,
.grocery-check {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-elevated);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.spec-check::after,
.grocery-check::after {
  content: "";
  width: 5px;
  height: 9px;
  border-right: 2px solid var(--text-on-accent);
  border-bottom: 2px solid var(--text-on-accent);
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  margin-top: -2px;
  transition: transform 0.1s ease;
}

.spec-check:checked,
.grocery-check:checked {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.spec-check:checked::after,
.grocery-check:checked::after {
  transform: rotate(45deg) scale(1);
}

/* Shared Section Header */
.schedule-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.schedule-header h1,
.schedule-header h2 {
  margin-bottom: 0;
}

.week-input-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.week-input-label input[type="date"] {
  margin: 0;
  min-height: 44px;
  padding: 0.35rem 0.6rem;
  width: auto;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

/* Compact 7-Day Schedule Grid */
.schedule-grid {
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.45rem 0.5rem;
  align-items: center;
  margin-bottom: 1.15rem;
}

.schedule-col-head {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-align: center;
}

.schedule-day-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.diner-pill {
  position: relative;
  display: inline-flex;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.diner-pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.diner-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background-color: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.diner-pill input[type="checkbox"]:checked + span {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-on-accent);
}

.diner-pill input[type="checkbox"]:focus-visible + span {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Calendar Weekday Grouping (Plan Board & History) */
.calendar-week {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.9rem;
}

.calendar-day-group {
  min-width: 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border-strong);
}

.calendar-day-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background-color: var(--calendar-day-bg);
  border: 1px solid var(--calendar-day-border);
  border-bottom-color: var(--calendar-day-border-bottom);
  border-left: 3px solid var(--calendar-day-accent);
  border-radius: var(--radius-sm);
}

.calendar-day-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0;
}

.calendar-day-date {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--accent-warm);
  white-space: nowrap;
  flex-shrink: 0;
}

.calendar-day-meals {
  padding-left: 0.75rem;
  margin-left: 1px;
  border-left: 1px solid var(--calendar-day-rail);
  min-width: 0;
}

.meal-slot-label {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border-strong);
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
}

.meal-slot-lunch {
  border-color: var(--accent-warm-border);
  background-color: var(--accent-warm-tint);
  color: var(--accent-warm);
}

.meal-slot-dinner {
  border-color: var(--accent-primary-border);
  background-color: var(--accent-primary-tint);
  color: var(--accent-primary);
}

/* Plan Board Meal Rows */
.meal-card {
  padding: 0.95rem 0;
  min-width: 0;
  scroll-margin-top: 7.5rem;
}

.meal-card.is-just-swapped {
  border-radius: var(--radius-sm);
  animation: meal-swap-flash 1.1s ease-out;
}

.meal-card:last-of-type {
  padding-bottom: 0.35rem;
}

.meal-card .badge-row {
  margin-bottom: 0.5rem;
}

.meal-card-title {
  margin: 0.25rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
}

.meal-card-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.meal-card-title a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.meal-card.is-just-swapped .meal-card-title,
.meal-card.is-just-swapped .meal-card-title a {
  animation: meal-title-flash 1.1s ease-out;
}

.meal-card form.htmx-request button {
  opacity: 0.65;
  cursor: wait;
}

.meal-card form[action="/plan/swap"].htmx-request .icon,
.meal-card form[action="/plan/swap-side"].htmx-request .icon {
  animation: meal-spin 0.7s linear infinite;
}

@keyframes meal-swap-flash {
  0% {
    background-color: var(--accent-primary-tint);
  }
  100% {
    background-color: transparent;
  }
}

@keyframes meal-title-flash {
  0% {
    color: var(--accent-primary);
  }
  100% {
    color: var(--text-primary);
  }
}

@keyframes meal-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .meal-card.is-just-swapped,
  .meal-card.is-just-swapped .meal-card-title,
  .meal-card.is-just-swapped .meal-card-title a,
  .meal-card form[action="/plan/swap"].htmx-request .icon,
  .meal-card form[action="/plan/swap-side"].htmx-request .icon {
    animation: none;
  }
}

.sides-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.75rem 0;
  padding: 0.35rem 0 0.35rem 0.85rem;
  border-left: 2px solid var(--border-strong);
}

.side-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.side-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.94rem;
}

.side-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.meal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
  align-items: stretch;
}

.meal-actions form {
  margin: 0;
}

.meal-actions button {
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  margin: 0;
  width: auto;
}

.pick-form {
  display: flex;
  flex: 1 1 13rem;
  min-width: 0;
  gap: 0.35rem;
  align-items: stretch;
}

.pick-form select {
  margin: 0;
  min-height: 44px;
  min-width: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.88rem;
  flex: 1 1 auto;
}

.commit-bar {
  margin-top: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-hairline);
}

.commit-bar form {
  margin: 0;
}

/* Grocery Prep Sheet */
.grocery-store-title {
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-primary);
}

.grocery-category-title {
  font-family: var(--font-body);
  margin: 1.1rem 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-warm);
}

.grocery-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.grocery-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.65rem 0.25rem;
  margin: 0;
  border-bottom: 1px solid var(--border-hairline);
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.grocery-row:hover {
  background-color: var(--bg-surface-elevated);
}

.grocery-list li:last-child .grocery-row {
  border-bottom: none;
}

.grocery-row .grocery-check {
  margin-top: 0.2rem;
}

.grocery-text {
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.grocery-qty {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent-warm);
}

.grocery-context {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.grocery-check:checked + .grocery-text {
  text-decoration: line-through;
  color: var(--text-disabled);
}

.grocery-check:checked + .grocery-text .grocery-qty,
.grocery-check:checked + .grocery-text .grocery-context {
  color: var(--text-disabled);
}

/* Recipes Index */
.recipe-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.recipe-filter-form input,
.recipe-filter-form select {
  margin: 0;
  min-height: 44px;
  flex: 1 1 9rem;
}

.recipe-list {
  display: flex;
  flex-direction: column;
}

.recipe-item-card {
  display: block;
  text-decoration: none;
  padding: 1rem 0.25rem;
  border-bottom: 1px solid var(--border-hairline);
  color: inherit;
  transition: background-color 0.1s ease;
}

.recipe-item-card:last-child {
  border-bottom: none;
}

.recipe-item-card:hover,
.recipe-item-card:focus-visible {
  background-color: var(--bg-surface-elevated);
  text-decoration: none;
}

.recipe-item-card h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.recipe-item-card:hover h3 {
  color: var(--accent-primary);
}

/* Recipe Detail Benchmark (Section 6) */
.utility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-hairline);
}

.recipe-hero h1 {
  margin-bottom: 0.65rem;
}

.meta-strip {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

.spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spec-row {
  display: grid;
  grid-template-columns: 28px 5.5rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  min-height: 44px;
  padding: 0.65rem 0.25rem;
  margin: 0;
  border-bottom: 1px solid var(--border-hairline);
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.spec-list li:last-child .spec-row {
  border-bottom: none;
}

.spec-row:hover {
  background-color: var(--bg-surface-elevated);
}

.spec-qty {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent-warm);
}

.spec-name {
  color: var(--text-primary);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.spec-row.is-checked .spec-qty,
.spec-row.is-checked .spec-name,
.spec-row:has(.spec-check:checked) .spec-qty,
.spec-row:has(.spec-check:checked) .spec-name {
  color: var(--text-disabled);
  text-decoration: line-through;
}

.instructions-body h2,
.instructions-body h3 {
  margin-bottom: 0.9rem;
}

.instructions-body h3 {
  margin-top: 1.25rem;
}

.instructions-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.instructions-list li {
  counter-increment: step-counter;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.5rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.instructions-list li::before {
  content: counter(step-counter) ".";
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent-warm);
}

.instructions-bullets {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.instructions-bullets li {
  line-height: 1.6;
}

/* Recipe Markdown Editor & Import */
.import-textarea {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  min-height: 18rem;
  line-height: 1.5;
  padding: 0.85rem;
  background-color: var(--bg-surface-subtle);
  margin-bottom: 0.85rem;
}

.recipe-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.recipe-edit-actions .primary-action-btn {
  flex: 1 1 12rem;
  width: auto;
}

.recipe-edit-actions .btn-compact {
  min-height: 48px;
}

.store-map-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-hairline);
}

.store-map-row:last-of-type {
  border-bottom: none;
}

.store-map-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.store-map-selects select {
  margin: 0;
  min-height: 44px;
}

/* History */
.history-legacy-list {
  margin-top: 0.5rem;
}

.history-meal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-hairline);
}

.history-meal-row:last-child {
  border-bottom: none;
}

.calendar-day-meals .history-meal-row {
  border-bottom: none;
}

.calendar-day-meals .history-meal-row:last-child {
  padding-bottom: 0.35rem;
}

.history-meal-row.is-skipped {
  opacity: 0.65;
}

.history-meal-info {
  flex: 1 1 12rem;
}

.history-meal-info .badge-row {
  margin-bottom: 0.35rem;
}

.history-meal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.history-meal-actions form {
  margin: 0;
}

.history-meal-actions button {
  min-height: 44px;
  padding: 0.35rem 0.8rem;
  margin: 0;
  width: auto;
}

/* Settings Theme Selector */
.theme-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.theme-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-elevated);
  cursor: pointer;
}

.theme-option.is-active {
  border-color: var(--accent-primary);
}

.theme-option.is-disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.theme-option.is-disabled .theme-option-title,
.theme-option.is-disabled .theme-option-desc {
  color: var(--text-disabled);
}

.theme-option-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-primary);
}

.theme-option-title {
  font-weight: 600;
  color: var(--text-primary);
}

.theme-option-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Login Shell */
.login-shell {
  max-width: 26rem;
  margin: 2rem auto 0;
}

.login-shell form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

@media (min-width: 600px) {
  .store-map-row {
    grid-template-columns: 12rem minmax(0, 1fr);
    align-items: center;
  }
}
