/* ==========================================================================
   Larderly — Design System
   Dark-first. All colour tokens live here; no magic values in components.
   ========================================================================== */

/* ── Colour tokens ─────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  /* Backgrounds — layered depth */
  --bg:             #111110;
  --surface:        #1a1a18;
  --surface-raised: #232321;
  --surface-hover:  #2a2a28;

  /* Borders */
  --border:         #2e2e2b;
  --border-strong:  #3e3e3a;

  /* Text */
  --text:           #f2f0eb;
  --text-muted:     #a8a49e;
  --text-faint:     #636058;

  /* Accent — green */
  --accent:         #4ade80;
  --accent-dim:     #22c55e;
  --accent-text:    #0a1f10;
  --accent-subtle:  rgba(74, 222, 128, 0.08);
  --accent-glow:    rgba(74, 222, 128, 0.18);

  /* Danger */
  --danger:         #f87171;
  --danger-solid:   #dc2626;

  /* Warning */
  --warn-bg:        #1e1500;
  --warn-border:    #5a4200;

  /* Navigation (stays dark in both themes) */
  --nav-bg:         #0d0d0c;
  --nav-text:       #e8e5de;
  --nav-muted:      #8a8780;

  /* Misc */
  --radius:         10px;
  --radius-sm:      6px;
  --max-width:      960px;
  --transition:     0.15s ease;
}

[data-theme="light"] {
  color-scheme: light;

  --bg:             #f4f3f0;
  --surface:        #ffffff;
  --surface-raised: #faf9f7;
  --surface-hover:  #f0eeeb;

  --border:         #e2dfd9;
  --border-strong:  #ccc9c3;

  --text:           #1c1a17;
  --text-muted:     #65625c;
  --text-faint:     #b0ada6;

  --accent:         #16a34a;
  --accent-dim:     #15803d;
  --accent-text:    #ffffff;
  --accent-subtle:  rgba(22, 163, 74, 0.08);
  --accent-glow:    rgba(22, 163, 74, 0.15);

  --danger:         #dc2626;
  --danger-solid:   #dc2626;

  --warn-bg:        #fef9c3;
  --warn-border:    #fde047;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */

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

/* ── Base ───────────────────────────────────────────────────────────────────── */

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text);
}

img,
video {
  max-width: 100%;
  display: block;
}

/* ── Typography ─────────────────────────────────────────────────────────────── */

h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--accent);
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

p {
  color: var(--text);
}

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

a:hover {
  color: var(--accent-dim);
  text-decoration: underline;
}

/* ── Form elements — base styles apply everywhere ───────────────────────────── */

input,
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

/* Checkboxes and radios must keep their native look — the base rule
   above strips their chrome and stretches them to 100% width, which
   turns them into blank rectangles. */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  margin: 0;
  appearance: auto;
  -webkit-appearance: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  accent-color: var(--accent);
}

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

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

textarea {
  resize: vertical;
  min-height: 5rem;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a8780' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
  cursor: pointer;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ── App layout ─────────────────────────────────────────────────────────────── */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

@media (min-width: 640px) {
  .content {
    padding: 2rem 1.5rem;
  }
}

/* ── Navbar ─────────────────────────────────────────────────────────────────── */

.navbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  height: 3.25rem;
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar-brand a {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  text-decoration: none;
}

.navbar-brand a:hover {
  color: var(--accent-dim);
  text-decoration: none;
  opacity: 1;
}

.navbar-links {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.navbar-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--nav-muted);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.navbar-links a:hover {
  color: var(--nav-text);
  background: rgba(255, 255, 255, 0.07);
  text-decoration: none;
}

.navbar-search {
  position: relative;
  flex: 1;
  max-width: 22rem;
}

.navbar-search-input {
  width: 100%;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.navbar-search-input::placeholder {
  color: var(--text-faint);
}

.navbar-search-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

.navbar-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 200;
  overflow: hidden;
}

.navbar-search-results-open {
  display: block;
}

.navbar-search-result {
  display: block;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.navbar-search-result:hover,
.navbar-search-result:focus,
.navbar-search-result.navbar-search-result-active,
.navbar-search-result[aria-selected="true"] {
  background: var(--accent-subtle);
  color: var(--accent);
  text-decoration: none;
  outline: none;
}

.navbar-search-result:focus,
.navbar-search-result.navbar-search-result-active,
.navbar-search-result[aria-selected="true"] {
  box-shadow: inset 3px 0 0 var(--accent);
}

[data-theme="light"] .navbar-search-input {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--text);
}

[data-theme="light"] .navbar-search-input:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .navbar-search-results {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.navbar-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.navbar-sign-in {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--nav-muted) !important;
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.navbar-sign-in:hover {
  color: var(--nav-text) !important;
  background: rgba(255, 255, 255, 0.07);
  text-decoration: none;
}

/* User dropdown (native <details> element) */
.navbar-user-menu {
  position: relative;
}

.navbar-user-menu[open] .navbar-dropdown {
  display: block;
}

.navbar-username-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--nav-text);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  list-style: none;
  transition: background var(--transition);
  user-select: none;
}

.navbar-username-btn::-webkit-details-marker {
  display: none;
}

.navbar-username-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}

.navbar-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  min-width: 170px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  overflow: hidden;
  animation: dropdown-in 0.1s ease;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.navbar-dropdown a,
.navbar-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  text-align: left;
  color: var(--text);
  font-size: 0.875rem;
  text-decoration: none;
  background: none;
  border: none;
  transition: background var(--transition);
}

.navbar-dropdown a:hover,
.navbar-dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--text);
  text-decoration: none;
}

/* Theme toggle button */
.theme-toggle-btn {
  background: none;
  border: none;
  font-size: 1rem;
  line-height: 1;
  color: var(--nav-muted);
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--nav-text);
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */

.footer {
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), transform 0.1s;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-dim);
  color: var(--accent-text);
  text-decoration: none;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
  text-decoration: none;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-danger:hover {
  background: var(--danger-solid);
  color: #fff;
  border-color: var(--danger-solid);
}

/* ── Page shell ─────────────────────────────────────────────────────────────── */

/* Shared heading + subtitle at the top of a page */
.page-title {
  margin-bottom: 0.25rem;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border-strong);
}

/* ── Forms ──────────────────────────────────────────────────────────────────── */

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.form-section-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.5rem;
}

.form-section-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.form-feedback {
  font-size: 0.875rem;
}

.form-feedback.success { color: var(--accent); }
.form-feedback.error   { color: var(--danger); }

/* Recipe/remix form max-width on larger screens */
.recipe-form,
.remix-form,
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .recipe-form,
  .remix-form {
    max-width: 640px;
  }

  .profile-form {
    max-width: 480px;
  }
}

/* ── Step and ingredient rows ───────────────────────────────────────────────── */

.steps-list,
.ingredients-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.step-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-faint);
  width: 1.4rem;
  flex-shrink: 0;
  text-align: right;
}

.step-input {
  flex: 1;
  /* visual styles from base input rule */
}

.ingredient-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ingredient-name { flex: 2; }
.ingredient-qty  { flex: 1; min-width: 0; }

.ingredient-unit {
  flex: 0 0 auto;
  width: auto;
  padding-left: 0.5rem;
  padding-right: 1.8rem;
}

.remove-row-btn {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  visibility: hidden; /* shown by JS when >1 row */
  transition: border-color var(--transition), color var(--transition);
}

.remove-row-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.add-row-btn {
  align-self: flex-start;
  margin-top: 0.25rem;
  padding: 0.4rem 0.9rem;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.add-row-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Hero ───────────────────────────────────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 5rem 1rem 4rem;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

/* Radial blue glow behind the hero text — complements the green letters */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 50% at 50% 30%,
    rgba(56, 120, 220, 0.22) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2.5rem, 9vw, 3.75rem);
  color: var(--accent);
  position: relative;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  position: relative;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.75rem;
  position: relative;
}

/* ── Login page ─────────────────────────────────────────────────────────────── */

.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1rem;
  max-width: 400px;
  margin: 0 auto;
  gap: 0.5rem;
}

.login-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.provider-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.5rem;
}

.provider-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  transition: filter var(--transition);
}

.provider-button:hover {
  filter: brightness(1.1);
  text-decoration: none;
  color: #fff;
}

.provider-google    { background: #4285f4; }
.provider-microsoft { background: #00a4ef; }
.provider-mock      { background: #52525b; }

/* ── 404 page ───────────────────────────────────────────────────────────────── */

.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4rem 1rem;
  gap: 0.75rem;
}

.not-found p { color: var(--text-muted); }

/* ── Profile page ───────────────────────────────────────────────────────────── */

.profile-page {
  padding: 1.5rem 0;
}

.profile-email {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ── Recipes listing ────────────────────────────────────────────────────────── */

.recipes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  border-bottom-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}

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

@media (min-width: 640px) {
  .recipe-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* ── Recipe card — shared by the recipes list and home page carousels ────────── */

.recipe-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-top: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition);
}

.recipe-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  border-top-color: var(--accent);
  background: color-mix(in srgb, var(--accent-subtle) 60%, var(--surface-raised));
  text-decoration: none;
}

.recipe-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.3;
}

.recipe-card:hover .recipe-card-name {
  color: var(--accent-dim);
}

.recipe-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

.recipe-card-rating {
  color: #f59e0b;
}

.recipes-empty,
.recipes-loading,
.recipes-error {
  color: var(--text-muted);
  padding: 2.5rem 0;
  text-align: center;
}

/* ── New recipe / remix pages ───────────────────────────────────────────────── */

.recipe-new-page,
.remix-new-page {
  padding-top: 0.5rem;
}

/* Green rule under the page title */
.recipe-new-page h1,
.remix-new-page h1 {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  margin-bottom: 0.4rem;
}

.recipe-new-subtitle,
.remix-new-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.duplicate-warning {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  max-width: 640px;
}

.duplicate-warning-title {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.duplicate-list {
  margin: 0.4rem 0 0.6rem 1.2rem;
}

.duplicate-similarity {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Recipe detail ──────────────────────────────────────────────────────────── */

.recipe-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
}

.recipe-detail-header h1 {
  flex: 1;
  min-width: 0;
}

.recipe-overall-rating {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.no-remixes {
  color: var(--text-muted);
  padding: 2rem 0;
  text-align: center;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────────── */

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

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

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--text-faint);
  margin: 0 0.15rem;
}

/* ── Remix detail page ───────────────────────────────────────────────────────── */

.remix-detail-page {
  max-width: 48rem;
  margin: 0 auto;
}

.remix-detail-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
}

.remix-detail-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.remix-detail-rating {
  color: var(--accent);
  font-weight: 600;
}

.remix-detail-description {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.remix-detail-section {
  margin-bottom: 1.75rem;
}

.remix-detail-ingredients {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0;
}

.remix-detail-ingredients li {
  font-size: 0.95rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.ingredient-name {
  font-weight: 500;
  color: var(--text);
}

.ingredient-qty {
  color: var(--text-muted);
}

.ingredient-optional {
  font-size: 0.8rem;
  color: var(--text-faint);
  font-style: italic;
}

.remix-detail-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-left: 1.5rem;
}

.remix-detail-steps li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  padding-left: 0.5rem;
}

.remix-detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── Remix list ─────────────────────────────────────────────────────────────── */

.remix-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.remix-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color var(--transition), background var(--transition);
}

.remix-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent-subtle) 60%, var(--surface-raised));
}

.remix-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.remix-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.remix-card-title:hover {
  color: var(--accent-dim);
  text-decoration: underline;
}

.version-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-dim);
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
}

.version-badge-clickable {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.version-badge-clickable::-webkit-details-marker {
  display: none;
}

.version-dropdown {
  position: relative;
  display: inline-block;
}

.version-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 9rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.version-dropdown-item {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

a.version-dropdown-item:hover {
  background: rgba(74, 222, 128, 0.1);
  color: var(--accent);
  text-decoration: none;
}

.version-dropdown-current {
  color: var(--text-faint);
  font-style: italic;
  border-bottom: 1px solid var(--border);
}

.version-snapshot-notice {
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  margin-bottom: 1.5rem;
}

.version-snapshot-notice a {
  color: var(--accent);
}

.version-snapshot-label {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-style: italic;
}

.remix-card-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.remix-card-meta {
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ── Star display (read-only) ───────────────────────────────────────────────── */

.star-display {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 0.95rem;
}

.star-filled { color: #f59e0b; }
.star-empty  { color: var(--border-strong); }

.star-count {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-left: 3px;
}

/* ── Star rating form ───────────────────────────────────────────────────────── */

.star-rating-form {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-top: 0.1rem;
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  padding: 0.15rem 0.1rem;
  line-height: 1;
  color: var(--border-strong);
  transition: color var(--transition);
}

.star-btn-filled { color: #f59e0b; }

.star-btn:hover,
.star-btn:focus {
  color: #f59e0b;
  outline: none;
}

.star-rating-hint {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-left: 0.4rem;
}

/* ── Home page sections ─────────────────────────────────────────────────────── */

.home-section {
  margin-bottom: 2.5rem;
}

.home-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
}

.home-section-headings {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.home-section-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.home-section-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.home-section-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Carousel ───────────────────────────────────────────────────────────────── */

.carousel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.carousel-viewport {
  /* Pages are stacked; only the active one is shown */
}

.carousel-page {
  display: none;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.carousel-page-active {
  display: grid;
}

@media (min-width: 480px) {
  .carousel-page {
    grid-template-columns: repeat(3, 1fr);
  }
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.carousel-btn {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition);
}

.carousel-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-indicator {
  font-size: 0.8rem;
  color: var(--text-faint);
  min-width: 3rem;
  text-align: center;
}

/* ── Carousel cards ─────────────────────────────────────────────────────────── */


/* ── Followed recipes ───────────────────────────────────────────────────────── */

.followed-recipe {
  margin-bottom: 1.75rem;
}

.followed-recipe-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.followed-recipe-title a {
  color: var(--text);
  text-decoration: none;
}

.followed-recipe-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.followed-recipe-empty {
  font-size: 0.875rem;
  color: var(--text-faint);
}

/* ── Misc loading / status states ───────────────────────────────────────────── */

.recipe-loading,
.profile-loading,
.recipes-loading,
.profile-error,
.recipes-error {
  color: var(--text-muted);
  padding: 2rem 0;
  text-align: center;
}

/* ── Profile meta ───────────────────────────────────────────────────────────── */

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}

.profile-email {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Remix card author ───────────────────────────────────────────────────────── */

.remix-card-author {
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ── Notification bell ───────────────────────────────────────────────────────── */

.navbar-notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
  text-decoration: none;
  font-size: 1.1rem;
}

.navbar-notification-badge {
  position: absolute;
  top: -0.4rem;
  right: -0.6rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.2rem;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}

/* ── Recipe book page ────────────────────────────────────────────────────────── */

.recipe-book-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.recipe-book-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.recipe-book-alert {
  background: var(--surface-alt, #2a2a3a);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text);
}

.recipe-book-section {
  margin-bottom: 2.5rem;
}

.recipe-book-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.recipe-book-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

/* ── Followed recipes list (recipe book) ────────────────────────────────────── */

.recipe-book-followed-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recipe-book-followed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.recipe-book-followed-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.recipe-book-followed-name {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-book-followed-name:hover {
  color: var(--accent);
}

.recipe-book-followed-meta {
  font-size: 0.8rem;
  color: var(--text-faint);
}

.recipe-book-followed-actions {
  flex-shrink: 0;
}

/* ── Saved remixes list (recipe book) ───────────────────────────────────────── */

.recipe-book-favourites-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recipe-book-fav-item {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.recipe-book-fav-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}

.recipe-book-fav-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.recipe-book-fav-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

.recipe-book-fav-title:hover {
  color: var(--accent);
}

.recipe-book-fav-deleted {
  color: var(--text-muted);
  text-decoration: line-through;
}

.recipe-book-fav-meta {
  font-size: 0.8rem;
  color: var(--text-faint);
}

.recipe-book-fav-meta a {
  color: var(--text-faint);
  text-decoration: none;
}

.recipe-book-fav-meta a:hover {
  color: var(--accent);
}

.recipe-book-fav-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0.75rem;
}

.recipe-book-fav-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* ── Status badges ───────────────────────────────────────────────────────────── */

.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pending-update {
  background: #7c5a1a;
  color: #ffd980;
}

.status-pending-deletion {
  background: #5a1a1a;
  color: #ffb0b0;
}

.status-kept {
  background: var(--surface-alt, #2a2a3a);
  color: var(--text-muted);
}

/* ── Small button variant ────────────────────────────────────────────────────── */

.btn-sm {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ── Saved remix button ──────────────────────────────────────────────────────── */

.btn-saved {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
}

.btn-saved:hover {
  opacity: 0.85;
}

/* ── Larder page ───────────────────────────────────────────────────────────── */

.larder-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.larder-title {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}

.larder-subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

.larder-add-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  position: relative;
}

.larder-add-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.larder-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.larder-add-input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.larder-add-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.larder-suggest-results {
  position: absolute;
  top: calc(100% - 0.5rem);
  left: 1.25rem;
  right: 1.25rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  max-height: 260px;
  overflow-y: auto;
  z-index: 20;
  display: none;
}

.larder-suggest-results.larder-suggest-open {
  display: block;
}

.larder-suggest-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.larder-suggest-item:hover,
.larder-suggest-item:focus,
.larder-suggest-item[aria-selected="true"] {
  background: var(--surface-hover);
  outline: none;
}

.larder-suggest-item:focus,
.larder-suggest-item[aria-selected="true"] {
  box-shadow: inset 3px 0 0 var(--accent);
}

/* "Did you mean?" panel shown after submitting an unknown ingredient. */
.larder-suggest-panel {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.larder-suggest-title {
  margin: 0 0 0.75rem;
  color: var(--text);
}

.larder-suggest-options {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.larder-suggest-pick {
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  /* Inherits display: inline-flex from .btn-primary — keep a small gap
     between the "Add" label and the ingredient name span so they don't
     collide visually. */
  gap: 0.3em;
}

.larder-suggest-pick-name {
  text-transform: capitalize;
  font-weight: 600;
}

.larder-suggest-fallback {
  margin: 0.75rem 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.larder-suggest-add-new-form {
  margin: 0;
}

.larder-items-section {
  margin-top: 1rem;
}

.larder-items-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.larder-sort-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.larder-sort-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.larder-sort-label-text {
  white-space: nowrap;
}

.larder-sort-select {
  width: auto;
  padding: 0.3rem 1.8rem 0.3rem 0.6rem;
  font-size: 0.85rem;
  /* Re-add a chevron since the global input rule strips
     appearance: none off every form control. */
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.larder-items-heading {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.larder-items-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}

.larder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

.larder-item-name {
  font-weight: 500;
  text-transform: capitalize;
}

.larder-item-remove-form {
  margin: 0;
}

.larder-item-remove {
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
}

.larder-item-remove:hover {
  color: var(--danger);
}

.larder-empty {
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

.larder-cta {
  margin-top: 1.25rem;
  text-align: right;
}

/* ── Search page ───────────────────────────────────────────────────────────── */

.search-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.search-title {
  margin: 0 0 1rem;
  font-size: 1.75rem;
}

.search-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-form-row {
  display: flex;
  gap: 0.5rem;
}

.search-form-input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.search-form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.search-form-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

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

.search-form-signin {
  margin: 0;
}

.search-results-count {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.search-result-item {
  display: block;
}

.search-empty {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.search-empty-text {
  margin: 0 0 0.5rem;
}

.search-empty-action {
  margin: 0;
  color: var(--text-muted);
}

.search-hint {
  color: var(--text-muted);
}

/* ── Image upload field (recipe / remix submit & edit forms) ───────────────── */

.image-upload {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.image-upload-input {
  cursor: pointer;
  font-size: 0.95rem;
}

.image-upload-input:disabled {
  opacity: 0.6;
  cursor: progress;
}

.image-upload-preview {
  min-height: 0;
}

.image-upload-preview-img {
  display: block;
  max-width: 320px;
  max-height: 240px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.image-upload-status {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-height: 1.2em;
  margin: 0;
}

.image-upload-status-ok {
  color: var(--accent, var(--text-primary));
}

.image-upload-status-error {
  color: #c53030;
}

/* ── Image rendering: remix detail, recipe-card thumb, carousel thumb ──────── */

.remix-detail-image {
  margin: 0 0 1.25rem;
}

.remix-detail-image img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.remix-card-thumb {
  display: block;
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-right: 0.75rem;
  float: left;
}

.remix-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recipe-card-thumb {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 6px 6px 0 0;
  display: block;
  margin: -0.5rem -0.5rem 0.5rem;
}

/* ── AI ingredient scanner ─────────────────────────────────────────────────── */

.scanner-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

.scanner-title {
  margin: 0 0 0.25rem;
}

.scanner-subtitle {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.scanner-camera-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.scanner-video {
  width: 100%;
  max-width: 640px;
  height: auto;
  background: #000;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.scanner-canvas {
  display: none;
}

.scanner-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.scanner-status {
  margin: 0;
  min-height: 1.4em;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.scanner-status-ok {
  color: var(--accent, var(--text-primary));
}

.scanner-status-warn {
  color: #b7791f;
}

.scanner-status-error {
  color: #c53030;
}

.scanner-results-section {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.scanner-no-results {
  margin: 0;
  color: var(--text-muted);
}

.scanner-no-results-hidden {
  display: none;
}

.scanner-results-form-hidden {
  display: none;
}

.scanner-results-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.scanner-results-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.scanner-result {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: var(--surface, transparent);
  border: 1px solid var(--border);
}

.scanner-result-fuzzy {
  border-left: 3px solid #b7791f;
}

.scanner-result-unknown {
  border-left: 3px solid #c53030;
}

.scanner-result-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.scanner-result-checkbox {
  margin: 0;
}

.scanner-result-name {
  flex: 1;
}

/* ── Share panel ──────────────────────────────────────────────────────────── */

.share-panel {
  display: inline-block;
  margin: 0.5rem 0;
}

.share-panel-summary {
  cursor: pointer;
  user-select: none;
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
}

.share-panel-summary::-webkit-details-marker {
  display: none;
}

.share-panel[open] .share-panel-summary {
  margin-bottom: 0.5rem;
}

.share-panel-body {
  background: var(--surface, transparent);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 240px;
}

.share-panel-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.share-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-primary);
}

.share-btn:hover {
  background: var(--surface, rgba(0, 0, 0, 0.05));
}

.share-btn-copy {
  border-color: var(--accent, var(--text-primary));
}

.share-panel-status {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.share-panel-status-ok {
  color: var(--accent, var(--text-primary));
}

.share-panel-status-warn {
  color: #b7791f;
}

.share-panel-status-error {
  color: #c53030;
}

/* ── Community moderation ─────────────────────────────────────────────────── */

.moderation-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
}

.moderation-title {
  margin: 0 0 0.25rem;
}

.moderation-subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

.moderation-empty {
  color: var(--text-muted);
  font-style: italic;
}

.moderation-cases-list,
.moderation-report-list,
.moderation-vote-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.moderation-case-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--surface, transparent);
}

.moderation-case-row-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.moderation-case-target {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.moderation-case-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.moderation-case-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.moderation-section {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1.25rem;
}

.moderation-banner {
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.moderation-banner-open {
  background: rgba(183, 121, 31, 0.15);
  border-left: 3px solid #b7791f;
}

.moderation-banner-kept {
  background: rgba(34, 139, 34, 0.12);
  border-left: 3px solid #228b22;
}

.moderation-banner-removed {
  background: rgba(197, 48, 48, 0.12);
  border-left: 3px solid #c53030;
}

.moderation-report-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  background: var(--surface, transparent);
}

.moderation-report-reason {
  margin: 0;
  white-space: pre-wrap;
}

.moderation-vote-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.35rem 0.5rem;
}

.moderation-vote-keep {
  color: #228b22;
}

.moderation-vote-remove {
  color: #c53030;
}

.moderation-vote-form-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.moderation-vote-form {
  display: inline;
}

.moderation-vote-form + .moderation-vote-form {
  margin-left: 0.6rem;
}

.moderation-form-blocked {
  color: var(--text-muted);
  font-style: italic;
}

.moderation-view-content {
  display: inline-block;
  margin: 0.5rem 0;
}

/* ── Report panel (recipe / remix detail pages) ───────────────────────────── */

.report-panel {
  display: inline-block;
  margin: 0.4rem 0;
}

.report-panel-summary {
  cursor: pointer;
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
}

.report-panel-summary::-webkit-details-marker {
  display: none;
}

.report-panel[open] .report-panel-summary {
  margin-bottom: 0.5rem;
}

.report-panel-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  min-width: 320px;
}

.report-panel-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.report-panel-form textarea {
  resize: vertical;
  min-height: 4em;
}

.recipe-under-review {
  text-align: center;
  padding-top: 4rem;
  color: var(--text-muted);
}

.recipe-under-review h1 {
  margin-bottom: 1rem;
}

/* ── Cookie consent banner ─────────────────────────────────────────────────── */

.consent-banner {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  background: var(--surface, #fff);
  color: var(--text, #1a1a1a);
  border: 1px solid var(--border, #ccc);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  font-size: 0.95rem;
  line-height: 1.4;
}

.consent-banner-copy {
  margin: 0 0 0.75rem 0;
}

.consent-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.consent-banner-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
  /* UK ICO requires reject to be as easy as accept — keep both buttons
     visually equivalent by default; differentiate only by accent colour. */
  min-width: 9rem;
}

.consent-banner-accept {
  background: var(--accent, #1f6feb);
  color: #fff;
  border-color: var(--accent, #1f6feb);
}

.consent-banner-reject {
  background: transparent;
  color: var(--text, #1a1a1a);
}

.footer-consent-link {
  background: none;
  border: none;
  padding: 0;
  margin-left: 0.5rem;
  color: var(--text-muted, #666);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

/* ── AdSense slot ──────────────────────────────────────────────────────────── */

.recipe-ad-slot {
  margin: 0 0 1.5rem 0;
  padding: 0;
  border: 1px solid var(--border-subtle, #e0e0e0);
  border-radius: 4px;
  overflow: hidden;
  /* Reserve a minimum height so the page doesn't reflow when AdSense
     paints — the actual ad is responsive (`data-ad-format=auto`). */
  min-height: 90px;
}

.recipe-ad-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #888);
  text-align: center;
  padding: 0.25rem 0;
  background: var(--surface-subtle, #f7f7f7);
}

.recipe-ad-slot ins.adsbygoogle {
  display: block;
  width: 100%;
}
