/* ==========================================================================
   Sodexo Desserts — Material Design 3 (M3) styling
   Seed color: Sodexo blue #283897. Light + dark schemes.
   ========================================================================== */

/* ---------- M3 color roles ---------- */
:root {
  /* scheme (light) */
  --md-primary: #283897;
  --md-on-primary: #FFFFFF;
  --md-primary-container: #DEE2FF;
  --md-on-primary-container: #001159;
  --md-secondary-container: #E1E2EC;
  --md-on-secondary-container: #1B1B21;
  --md-outline: #767680;
  --md-outline-variant: #C7C5D0;
  --md-error: #B3261E;

  /* mapped component tokens */
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #FAFAFC;          /* app bar / drawer */
  --surface-3: #F5F5FA;          /* search fill */
  --text: #1B1B21;
  --text-2: #63667A;
  --border: #E8E8F0;
  --border-strong: #C9CBDA;
  --accent: #283897;             /* primary */
  --accent-deep: #283897;        /* primary (text) */
  --accent-soft: #EDF1FF;
  --link: #283897;
  --danger: #B3261E;
  --danger-soft: #FBEDEC;
  --btn-bg: #283897;
  --btn-bg-hover: #3D4CB0;
  --btn-on: #FFFFFF;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 4px 14px rgba(16, 24, 40, 0.07);
  --shadow-xl: 0 10px 28px rgba(16, 24, 40, 0.10);
  --diff-easy: #2E6B4F;
  --diff-medium: #9A6B00;
  --diff-hard: #B3261E;
}
[data-theme="dark"] {
  --md-primary: #BAC3FF;
  --md-on-primary: #232F67;
  --md-primary-container: #3F4BA9;
  --md-on-primary-container: #DEE2FF;
  --md-secondary-container: #3B3B47;
  --md-on-secondary-container: #E1E2EC;
  --md-outline: #90909A;
  --md-outline-variant: #46464F;
  --md-error: #F2B8B5;

  --bg: #16171D;
  --surface: #1F2129;
  --surface-2: #1F2129;
  --surface-3: #262933;
  --text: #E3E1EC;
  --text-2: #B9BAC7;
  --border: #2E3038;
  --border-strong: #4A4D5C;
  --accent: #BAC3FF;
  --accent-deep: #C3CBFF;
  --accent-soft: #3F4BA9;
  --link: #BAC3FF;
  --danger: #F2B8B5;
  --danger-soft: #5C1A16;
  --btn-bg: #BAC3FF;
  --btn-bg-hover: #D3D9FF;
  --btn-on: #232F67;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.30);
  --shadow-xl: 0 10px 28px rgba(0, 0, 0, 0.40);
  --diff-easy: #7FD8A0;
  --diff-medium: #F5C06B;
  --diff-hard: #F2B8B5;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.5;
  background: var(--bg); color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}
img { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--accent-deep); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--md-primary); color: var(--md-on-primary); padding: 8px 14px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.18em; }
.text-2 { color: var(--text-2); }

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

/* ---------- Material ripple ---------- */
.btn, .icon-btn, .chip, .page-link, .az-letter, .cat-tile, .menu-overlay a, .menu-theme {
  position: relative; overflow: hidden;
}
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: currentColor; opacity: 0.14;
  transform: scale(0); animation: md-ripple 0.5s ease-out forwards;
}
@keyframes md-ripple { to { transform: scale(1); opacity: 0; } }

/* ==========================================================================
   Top app bar (M3)
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.header-inner { display: flex; align-items: center; gap: 10px; height: 64px; }

.logo { display: inline-flex; align-items: center; color: var(--md-primary); }
.logo:hover { text-decoration: none; }
.logo-img { height: 38px; width: auto; display: block; filter: drop-shadow(0 1px 2px rgba(16, 24, 40, 0.18)); }
@media (min-width: 820px) { .logo-img { height: 44px; } }

.header-actions { margin-left: auto; display: flex; gap: 8px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  border: 0; background: transparent; color: var(--text-2);
  display: grid; place-items: center; cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.icon-btn .ic { width: 20px; height: 20px; }

.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

.nav-toggle .i-close { display: none; }
.nav-toggle.open .i-menu { display: none; }
.nav-toggle.open .i-close { display: block; }

/* ==========================================================================
   Full-page menu (M3 navigation drawer)
   ========================================================================== */
.menu-overlay {
  display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
  background: var(--bg); z-index: 45;
  padding: 20px 16px 36px; overflow-y: auto;
}
.menu-overlay[data-open="true"] { display: block; }
.menu-eyebrow {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-2); margin: 2px 4px 14px;
}
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-card {
  position: relative; display: flex; align-items: flex-end;
  aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden;
  color: #26243A; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.menu-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16, 24, 40, 0.14); text-decoration: none; }
.card-hero { aspect-ratio: auto; height: 96px; width: 100%; margin-bottom: 12px; align-items: center; }
.card-hero .mc-emoji { position: static; margin: 0 0 0 22px; font-size: 2rem; }
.card-hero .mc-num { position: static; margin: 0 14px 0 18px; }
.card-hero .mc-title {
  padding: 0 20px 0 0; font-size: 1.3rem; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-emoji { position: absolute; top: 10px; right: 14px; font-size: 1.7rem; z-index: 1; }
.mc-num {
  position: absolute; left: 16px; bottom: 42px; z-index: 1;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; opacity: 0.7;
}
.mc-num::before { content: '\2014  '; }
.mc-title { position: relative; z-index: 1; padding: 0 16px 14px; font-size: 1.3rem; font-weight: 600; letter-spacing: 0; }
.g-all      { background: linear-gradient(135deg, #E3E7FF 0%, #C9D2FF 100%); }
.g-slices   { background: linear-gradient(135deg, #FFEDD9 0%, #FFD9A3 100%); }
.g-biscuits { background: linear-gradient(135deg, #F5E9D7 0%, #E8CFA8 100%); }
.g-cakes    { background: linear-gradient(135deg, #FFE3EF 0%, #FFC6DF 100%); }
.g-hot      { background: linear-gradient(135deg, #FFE7DC 0%, #FFC9AE 100%); }
.g-sauces   { background: linear-gradient(135deg, #F6ECD6 0%, #EAD3A2 100%); }
.g-about    { background: linear-gradient(135deg, #E7ECF4 0%, #CCD8E8 100%); }
.g-contact  { background: linear-gradient(135deg, #E0F3E9 0%, #BFE7D2 100%); }
.menu-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.menu-links a {
  text-align: center; padding: 8px 0; font-weight: 500; font-size: 0.9rem;
  color: var(--text-2);
}
.menu-links a:hover { color: var(--accent-deep); text-decoration: none; }
.menu-admin {
  display: block; text-align: center; margin-top: 18px;
  color: var(--text-2); font-size: 0.85rem; font-weight: 500;
}
.menu-theme {
  margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 48px; background: none; border: 0; cursor: pointer;
  font-weight: 500; font-size: 0.95rem; color: var(--text-2); border-radius: 10px;
}
.menu-theme:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.menu-theme .ic { width: 18px; height: 18px; }

/* ==========================================================================
   Buttons (M3 filled / outlined / text)
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 24px; border-radius: 10px;
  border: 0; cursor: pointer;
  font-weight: 500; font-size: 0.9rem; letter-spacing: 0.01em; white-space: nowrap;
  transition: box-shadow 0.15s, background-color 0.15s, color 0.15s;
}
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--btn-bg); color: var(--btn-on); }
.btn-primary:hover { background: var(--btn-bg-hover); }
.btn-ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--accent-deep); }
.btn-ghost:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-sm { height: 36px; padding: 0 18px; font-size: 0.82rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips-scroll { flex-wrap: wrap; overflow-x: visible; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent; color: var(--text-2);
  font-size: 0.85rem; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); text-decoration: none; }
.chip.active { background: var(--accent-soft); border-color: transparent; color: var(--accent-deep); font-weight: 600; }
.chips-label { font-size: 0.8rem; color: var(--text-2); font-weight: 500; margin-right: 2px; flex: none; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 12px;
  border-radius: 8px; background: var(--surface-3); color: var(--text-2);
  font-size: 0.75rem; font-weight: 500; white-space: nowrap;
}
.badge.amber { background: var(--accent-soft); color: var(--accent-deep); }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--text-2); flex: none; }
.diff-easy .dot { background: var(--diff-easy); }
.diff-medium .dot { background: var(--diff-medium); }
.diff-hard .dot { background: var(--diff-hard); }

/* ==========================================================================
   Hero + M3 search view
   ========================================================================== */
.hero { padding: 36px 0 8px; text-align: center; }
@media (min-width: 720px) { .hero { padding: 56px 0 10px; } }
.hero-title { font-size: 1.5rem; font-weight: 500; letter-spacing: 0; margin-bottom: 10px; }
.hero-sub { margin-top: 8px; color: var(--text-2); font-size: 0.95rem; }

.type-word { color: var(--accent-deep); }
.type-caret {
  display: inline-block; width: 2px; height: 0.95em;
  background: var(--accent); margin-left: 3px; vertical-align: -0.08em;
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* homepage: search centred, category tiles pinned at the bottom */
.home-wrap {
  min-height: calc(100vh - 65px);
  min-height: calc(100svh - 65px);
  display: flex; flex-direction: column;
}
.hero-search { text-align: center; margin: auto 0; padding: 24px 0 8px; transition: margin 0.15s ease; }
/* when the search is active it pins to the top so results have room */
.home-wrap.search-active .hero-search { margin: 14px 0 8px; }
.home-cats { margin-top: auto; padding: 8px 0 20px; }


.token-search { position: relative; max-width: 640px; margin: 0 auto; text-align: left; }
.ts-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 56px; padding: 8px 8px 8px 20px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 14px;
  transition: background-color 0.15s, border-color 0.15s;
}
.ts-bar:focus-within { background: var(--surface); border-color: var(--accent); }
.ts-tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.token {
  display: inline-flex; align-items: center; gap: 4px; height: 32px;
  padding: 0 5px 0 14px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-size: 0.85rem; font-weight: 500;
}
.tok-x {
  width: 22px; height: 22px; border: 0; border-radius: 10px;
  background: transparent; color: inherit; cursor: pointer;
  font-size: 15px; line-height: 1; display: grid; place-items: center;
}
.tok-x:hover { background: color-mix(in srgb, currentColor 18%, transparent); }
.ts-input {
  flex: 1; min-width: 130px; height: 40px; border: 0; outline: 0;
  background: transparent; font-size: 1rem;
}
.ts-input::placeholder { color: var(--text-2); opacity: 0.8; }
.ts-go { height: 40px; }
@media (max-width: 480px) { .ts-go span { display: none; } .ts-go { padding: 0 13px; } }

.ts-drop {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 0; border-radius: 8px;
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 340px; overflow-y: auto;
}
.ts-drop[data-open] { display: block; }
.ts-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 16px; border: 0;
  background: transparent; color: var(--text); font-size: 0.92rem; text-align: left; cursor: pointer;
}
.ts-item:hover, .ts-item.active { background: color-mix(in srgb, var(--text) 8%, transparent); }
.ts-term { font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-kind {
  flex: none; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 10px; background: var(--surface-3); color: var(--text-2);
}
.ts-kind.kind-ingredient { background: var(--accent-soft); color: var(--accent-deep); }
.ts-meta { flex: none; font-size: 0.75rem; color: var(--text-2); }
.ts-foot {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 12px 16px; border-top: 1px solid var(--border);
  background: var(--surface-2); color: var(--accent-deep);
  font-size: 0.88rem; font-weight: 600; text-decoration: none;
}
.ts-foot:hover { background: var(--accent-soft); text-decoration: none; }
.ts-foot strong { font-weight: 700; }

.ts-hint { margin-top: 12px; font-size: 0.82rem; color: var(--text-2); text-align: center; }
.hint-chip {
  display: inline-block; margin: 0 1px; padding: 1px 8px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text-2);
  background: transparent; cursor: pointer; font-size: 0.8rem;
}
.hint-chip:hover { color: var(--accent-deep); border-color: var(--accent); }

.live-results { margin-top: 26px; text-align: left; }
.live-count { font-size: 0.88rem; color: var(--text-2); margin-bottom: 12px; }
.live-count .lc-toks { color: var(--accent-deep); font-weight: 600; }
.live-more { margin-top: 14px; }

/* ==========================================================================
   Sections & cards (M3 elevated + outlined cards)
   ========================================================================== */
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 1.15rem; font-weight: 500; letter-spacing: 0; }
.section-link { font-size: 0.85rem; color: var(--accent-deep); font-weight: 500; white-space: nowrap; }
.section-link .ic { width: 13px; height: 13px; }

.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }
.cat-tile {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); transition: background-color 0.15s, border-color 0.15s;
}
.cat-tile:hover { border-color: var(--border-strong); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); text-decoration: none; }
.cat-ico {
  width: 40px; height: 40px; flex: none; border-radius: 10px;
  background: var(--accent-soft); display: grid; place-items: center; font-size: 19px;
}
.cat-name { font-weight: 500; font-size: 0.92rem; line-height: 1.2; }
.cat-count { display: block; color: var(--text-2); font-size: 0.76rem; margin-top: 2px; }

.feature {
  display: grid; overflow: hidden; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
}
@media (min-width: 720px) { .feature { grid-template-columns: 1.05fr 1fr; } }
.feature-img, .feature-fallback { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
@media (min-width: 720px) { .feature-img, .feature-fallback { height: 100%; aspect-ratio: auto; min-height: 220px; } }
.feature-fallback {
  display: grid; place-items: center; font-size: 3rem; font-weight: 500;
  color: var(--accent-deep); background: var(--accent-soft);
}
.feature-body { padding: 20px; }
.kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-deep);
}
.feature-body h3 { font-size: 1.35rem; font-weight: 500; letter-spacing: 0; margin: 6px 0 4px; }
.feature-body h3 a { color: var(--text); }
.feature-body h3 a:hover { color: var(--accent-deep); text-decoration: none; }
.feature-desc { color: var(--text-2); font-size: 0.92rem; margin: 6px 0 12px; }
.feature-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }
.recipe-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.recipe-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); text-decoration: none; }
.rc-img, .rc-fallback { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.rc-fallback {
  display: grid; place-items: center; font-size: 1.9rem; font-weight: 500;
  color: var(--accent-deep); background: var(--accent-soft);
}
.rc-body { padding: 12px 14px 14px; }
.rc-title {
  font-weight: 500; font-size: 0.95rem; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rc-stats { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.stat { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 0.78rem; }
.stat .ic { width: 14px; height: 14px; color: var(--accent); }

.rank-list { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.rank-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-top: 1px solid var(--border); color: var(--text);
}
.rank-item:first-child { border-top: 0; }
.rank-item:hover { background: color-mix(in srgb, var(--text) 6%, transparent); text-decoration: none; }
.rank-num {
  width: 26px; text-align: center; flex: none;
  font-size: 1.2rem; font-weight: 500; color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.rank-thumb {
  width: 44px; height: 44px; flex: none; border-radius: 10px; object-fit: cover;
  display: grid; place-items: center; font-weight: 500; color: var(--accent-deep);
  background: var(--accent-soft);
}
.rank-title { flex: 1; min-width: 0; font-weight: 500; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-meta { flex: none; color: var(--text-2); font-size: 0.76rem; text-align: right; }

.az-row { display: flex; flex-wrap: wrap; gap: 8px; }
.az-letter {
  min-width: 40px; height: 40px; padding: 0 8px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 8px; background: transparent;
  color: var(--accent-deep); font-weight: 500; font-size: 0.9rem;
}
.az-letter:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); text-decoration: none; }

.empty-state {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 34px 16px; text-align: center; color: var(--text-2);
  background: var(--surface);
}
.es-icon { font-size: 24px; margin-bottom: 8px; color: var(--accent-deep); }
.es-title { font-weight: 500; color: var(--text); margin-bottom: 4px; font-size: 1rem; }
.es-sub { font-size: 0.85rem; }
.empty-state .btn { margin-top: 16px; }

/* ==========================================================================
   Browse page (M3 search view + outlined fields)
   ========================================================================== */
.page-head { margin: 28px 0 16px; }
.page-head h1 { font-size: 1.85rem; font-weight: 500; letter-spacing: 0; }
.page-sub { color: var(--text-2); font-size: 0.9rem; margin-top: 4px; }

.filter-bar {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; margin-bottom: 8px;
}
.filter-bar .token-search { margin: 0; max-width: none; }
.filters-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; }
.select {
  height: 48px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text);
  font-size: 0.92rem; min-width: 0;
}
.select:focus { border-color: var(--accent); outline: none; box-shadow: inset 0 0 0 1px var(--accent); }
.filters-row .select { flex: 1 1 150px; }
.filters-row .btn { flex: none; margin-left: auto; }
.filter-chips { margin-top: 12px; }

.result-count { color: var(--text-2); font-size: 0.88rem; margin: 16px 0 12px; }
.result-count b { color: var(--text); }

.pager { display: flex; justify-content: center; gap: 8px; margin: 26px 0 8px; flex-wrap: wrap; }
.page-link {
  min-width: 40px; height: 40px; padding: 0 10px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--text-2); font-weight: 500; font-size: 0.88rem;
}
.page-link:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); text-decoration: none; }
.page-link.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.page-link.disabled { opacity: 0.4; pointer-events: none; }
.page-dots { min-width: 36px; text-align: center; color: var(--text-2); align-self: center; }

/* ==========================================================================
   Recipe detail (M3)
   ========================================================================== */
.crumb { margin: 18px 0 14px; font-size: 0.8rem; color: var(--text-2); }
.crumb a { color: var(--text-2); }
.crumb a:hover { color: var(--accent-deep); }

.recipe-hero { display: grid; gap: 20px; }
.recipe-hero.no-image { display: block; }
@media (min-width: 820px) { .recipe-hero { grid-template-columns: minmax(300px, 430px) 1fr; gap: 28px; } }
.recipe-img, .recipe-fallback {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border: 0; border-radius: 8px; box-shadow: var(--shadow);
}
@media (min-width: 820px) { .recipe-img, .recipe-fallback { position: sticky; top: 84px; align-self: start; } }
.recipe-fallback {
  display: grid; place-items: center; font-size: 4rem; font-weight: 500;
  color: var(--accent-deep); background: var(--accent-soft);
}
.recipe-info h1 { font-size: 1.75rem; font-weight: 500; line-height: 1.25; letter-spacing: 0; }

.title-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 10px 0 14px;
}
.title-meta .recipe-desc { margin: 0; }
.recipe-desc { color: var(--text-2); margin: 10px 0 16px; font-size: 0.95rem; }

.stat-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-box {
  display: inline-flex; flex-direction: column; gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 14px;
}
.stat-box .sb-label {
  font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-2); font-weight: 500; white-space: nowrap;
}
.stat-box .sb-value { font-size: 0.9rem; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.stat-box .sb-value .ic { width: 13px; height: 13px; color: var(--accent); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.allergen-block {
  margin-top: 16px; padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  background: var(--danger-soft); border-radius: 12px;
  display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap;
}
.allergen-block .al-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--danger); padding-top: 3px; white-space: nowrap;
}
.allergen-block .al-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.al-chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: 999px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); font-size: 0.75rem; font-weight: 500; white-space: nowrap;
}

.recipe-cols { display: grid; gap: 26px; margin-top: 30px; }
@media (min-width: 820px) { .recipe-cols { grid-template-columns: minmax(300px, 380px) 1fr; gap: 34px; } }
.recipe-cols h2 { font-size: 1.15rem; font-weight: 500; margin-bottom: 12px; letter-spacing: 0; }

.ing-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.ing-table th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-2); padding: 12px 16px; background: var(--surface-3);
  border-bottom: 1px solid var(--border); font-weight: 500;
}
.ing-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 0.92rem; vertical-align: top; }
.ing-table tr:last-child td { border-bottom: 0; }
.ing-table .qty { font-weight: 500; white-space: nowrap; width: 1%; }
.ing-table .unit { color: var(--text-2); white-space: nowrap; width: 1%; }

.steps { list-style: none; padding: 0; }
.steps li { position: relative; padding-left: 40px; margin-bottom: 16px; font-size: 0.95rem; line-height: 1.6; }
.step-n {
  position: absolute; left: 0; top: 1px; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-weight: 500; font-size: 0.8rem;
}

.recipe-meta {
  margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  color: var(--text-2); font-size: 0.8rem; align-items: center;
}

/* ==========================================================================
   Admin & forms (M3 outlined text fields)
   ========================================================================== */
.login-wrap { min-height: 60vh; display: grid; place-items: center; padding: 30px 0; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; text-align: center; }
.login-card .logo-img { height: 64px; }
.login-card h1 { font-size: 1.3rem; font-weight: 500; text-align: center; }
.login-sub { text-align: center; color: var(--text-2); font-size: 0.85rem; margin: 4px 0 18px; }
.login-card .btn { width: 100%; margin-top: 16px; }

.admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 26px 0 16px; }
.admin-head h1 { font-size: 1.6rem; font-weight: 500; letter-spacing: 0; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.flash { padding: 12px 16px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 14px; }
.flash-error { background: var(--danger-soft); color: var(--danger); border: 0; }
.flash-ok { background: var(--accent-soft); color: var(--accent-deep); border: 0; }

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.admin-table th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-2); padding: 12px 16px; background: var(--surface-3);
  border-bottom: 1px solid var(--border); white-space: nowrap; font-weight: 500;
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.9rem; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .t-title { font-weight: 500; }
.admin-table .t-title a { color: var(--text); }
.admin-table .t-title a:hover { color: var(--accent-deep); }
.admin-table .num { font-variant-numeric: tabular-nums; color: var(--text-2); }
.admin-table .actions { white-space: nowrap; display: flex; gap: 6px; justify-content: flex-end; }
.star-on { color: var(--accent); }
.star-off { color: var(--border-strong); }

.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-top: 18px; }
@media (min-width: 720px) { .form-card { padding: 26px; } }
.form-section { padding: 18px 0; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section h3 { font-size: 1rem; font-weight: 500; margin-bottom: 12px; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }

.field label { display: block; font-weight: 500; font-size: 0.8rem; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--text-2); font-size: 0.74rem; }
.input, .textarea, .select-field {
  width: 100%; min-height: 52px; padding: 14px 16px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: transparent; color: var(--text); font-size: 0.94rem;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.input:focus, .textarea:focus, .select-field:focus {
  border-color: var(--accent); outline: none; box-shadow: inset 0 0 0 1px var(--accent);
}

.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { position: relative; }
.check-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.check-pill span {
  display: inline-flex; align-items: center; height: 32px; padding: 0 16px;
  border-radius: 8px; border: 1px solid var(--border); background: transparent;
  color: var(--text-2); font-size: 0.85rem; font-weight: 500; cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.check-pill input:checked + span { background: var(--accent-soft); border-color: transparent; color: var(--accent-deep); font-weight: 600; }
.check-pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.check-inline { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; height: 42px; cursor: pointer; }
.check-inline input { width: 18px; height: 18px; accent-color: var(--accent); }

.dyn-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: stretch; }
.dyn-row .w-qty { width: 80px; flex: none; }
.dyn-row .w-unit { width: 100px; flex: none; }
.dyn-row .w-grow { flex: 1; min-width: 0; }
.dyn-row .btn-x { flex: none; width: 42px; height: 42px; padding: 0; justify-content: center; }
@media (max-width: 640px) {
  .dyn-row { flex-wrap: wrap; }
  .dyn-row .w-grow { flex: 1 1 100%; order: 3; }
}
.form-actions { display: flex; gap: 10px; padding-top: 18px; margin-top: 6px; border-top: 1px solid var(--border); flex-wrap: wrap; }

.hp-field { position: absolute; left: -9999px; }
.cf-turnstile { margin-bottom: 4px; }

/* collapsible OCR source text */
.ocr-details {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); margin-top: 18px;
}
.ocr-details summary {
  cursor: pointer; padding: 14px 16px;
  font-weight: 500; font-size: 0.92rem; color: var(--accent-deep);
  list-style: none;
}
.ocr-details summary::-webkit-details-marker { display: none; }
.ocr-details summary::before {
  content: '\203A'; display: inline-block; margin-right: 8px;
  transition: transform 0.15s ease; color: var(--text-2);
}
.ocr-details[open] summary::before { transform: rotate(90deg); }
.ocr-details[open] summary { border-bottom: 1px solid var(--border); }
.ocr-text { padding: 14px 16px; color: var(--text-2); font-size: 0.92rem; line-height: 1.6; }
.ocr-text p { margin-bottom: 10px; }
.ocr-text p:last-child { margin-bottom: 0; }

/* floating theme toggle (unused while toggle lives in the menu) */
.theme-float {
  position: fixed; bottom: 14px; right: 14px; z-index: 60;
  box-shadow: var(--shadow-lg);
}
