/* TIIC — pastel cartoon, sky & coral palette */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700;9..144,900&family=Nunito:wght@500;600;700;800&family=Gloock&family=Fraunces:ital,opsz,wght@1,9..144,500;1,9..144,600&family=DM+Serif+Display:ital@0;1&display=swap");

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Nunito", system-ui, sans-serif;
  background: #f3f8fb;
  color: #1f3144;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
#root { min-height: 100vh; display: flex; flex-direction: column; }

/* App container */
.tiic-app {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 600px 400px at 10% 10%, #e9f3f8 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 95% 90%, #ffeae3 0%, transparent 60%),
    #f3f8fb;
  font-size: 16px;
}
.tiic-app.variant-mobile { font-size: 15px; }
.tiic-app.variant-tablet { font-size: 16px; }

/* Blobs (subtle) */
.blobs { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.35;
  filter: blur(40px);
  animation: float 16s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(15px, -12px) scale(1.04); }
}

/* Topbar */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 48px);
  flex-shrink: 0;
}
.topbar-right { display: flex; align-items: center; gap: 18px; }
.topnav { display: flex; gap: 8px; }
.topnav a {
  color: #1f3144;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9em;
  opacity: 0.65;
  padding: 7px 14px;
  border-radius: 999px;
  transition: all 0.2s;
}
.topnav a:hover { opacity: 1; background: rgba(255,255,255,0.6); }
.topnav a.is-active { background: rgba(255,255,255,0.85); opacity: 1; }

.lang-toggle {
  border: 1.5px solid rgba(31,49,68,0.12);
  background: rgba(255,255,255,0.6);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit; font-weight: 700; font-size: 0.8em;
  color: #1f3144;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background 0.15s;
}
.lang-toggle:hover { background: white; }
.lang-toggle span { opacity: 0.4; transition: opacity 0.15s; }
.lang-toggle span.is-on { opacity: 1; }
.lang-sep { opacity: 0.25 !important; }

/* Logo */
.logo-wrap {
  display: inline-flex;
  gap: 1px;
  font-family: "Fraunces", serif;
  font-weight: 900;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.balloon-letter {
  display: inline-block;
  color: var(--c);
  text-shadow:
    0 1px 0 rgba(255,255,255,0.95),
    0 -0.5px 0 rgba(0,0,0,0.06),
    0 3px 6px rgba(31,49,68,0.15);
  filter: drop-shadow(0 1px 1px rgba(31,49,68,0.06));
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
}
.balloon-letter:nth-child(1) { transform: rotate(-3deg); }
.balloon-letter:nth-child(2) { transform: rotate(2deg) translateY(-1px); }
.balloon-letter:nth-child(3) { transform: rotate(-1deg) translateY(1px); }
.balloon-letter:nth-child(4) { transform: rotate(2deg); }
.logo-wrap:hover .balloon-letter { transform: translateY(-2px) rotate(0); }

/* Stage */
.stage {
  position: relative; z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2vw, 24px) clamp(20px, 4vw, 48px);
  min-height: 0;
}
.stage.is-scroll {
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding-top: clamp(8px, 1.5vw, 16px);
  padding-bottom: clamp(20px, 3vw, 40px);
  gap: 20px;
}

.hero {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}
.variant-mobile .hero { gap: 14px; max-width: 100%; }
.variant-tablet .hero { gap: 16px; }

.hero-title {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.variant-mobile .hero-title { font-size: 1.7rem; }
.variant-tablet .hero-title { font-size: 2.4rem; }

.title-accent {
  display: inline-block;
  padding: 0 0.3em;
  border-radius: 999px;
  background: #bde6f3;
  transform: rotate(-1.5deg);
}

.hero-sub {
  margin: 0;
  font-family: "DM Serif Display", "Fraunces", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  opacity: 0.78;
  max-width: 580px;
  text-wrap: pretty;
  line-height: 1.4;
  color: #2a4660;
  letter-spacing: -0.005em;
}
.variant-mobile .hero-sub { font-size: 1rem; }

/* Rotating word */
.rotating-word {
  display: inline-flex; align-items: baseline;
  vertical-align: baseline;
  position: relative; overflow: hidden;
  padding-bottom: 0.18em; margin-bottom: -0.18em;
  min-width: 5.5ch; text-align: left;
  line-height: inherit;
}
.rotating-word-inner {
  display: inline-block;
  animation: rw-slide 0.5s cubic-bezier(.34,1.4,.5,1) both;
  will-change: transform, opacity;
}
@keyframes rw-slide {
  0%   { transform: translateY(105%); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: translateY(0);    opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .rotating-word-inner { animation: none; } }

/* Mode toggle */
.mode-toggle {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  background: rgba(255,255,255,0.7);
  border: 1.5px solid rgba(31,49,68,0.06);
  border-radius: 999px;
  padding: 4px;
  width: min(480px, 100%);
  box-shadow: inset 0 2px 4px rgba(31,49,68,0.04), 0 4px 16px rgba(31,49,68,0.04);
}
.mode-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc(33.33% - 4px);
  background: #bde6f3;
  border-radius: 999px;
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 3px 8px rgba(31,49,68,0.1);
}
.mode-btn--nav {
  text-decoration: none;
  border-left: 1.5px solid rgba(31,49,68,0.08);
  border-radius: 0 999px 999px 0;
}
.mode-btn {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; background: transparent;
  padding: 10px 14px;
  font: inherit; font-weight: 700;
  color: #1f3144; opacity: 0.55;
  border-radius: 999px; cursor: pointer;
  transition: opacity 0.25s; font-size: 0.92em;
}
.mode-btn.is-active { opacity: 1; }

/* Input card */
.input-stage { width: 100%; }
.input-card {
  background: white;
  border-radius: 28px;
  padding: clamp(16px, 2vw, 22px);
  box-shadow:
    0 1px 0 white inset,
    0 1px 3px rgba(31,49,68,0.04),
    0 14px 40px -10px rgba(31,49,68,0.18);
  border: 1.5px solid rgba(31,49,68,0.04);
  display: flex; flex-direction: column; gap: 10px;
  text-align: left;
}
.field-label {
  font-family: "DM Serif Display", "Fraunces", serif;
  font-style: italic; font-weight: 400; font-size: 1.15em;
  opacity: 0.78; color: #2a4660; line-height: 1;
}
.inci-textarea {
  width: 100%; resize: vertical;
  border: 1.5px solid rgba(31,49,68,0.06);
  background: #f3f8fb; border-radius: 18px;
  padding: 13px 16px; font: inherit; color: #1f3144;
  outline: none; min-height: 90px; line-height: 1.5;
  transition: border-color 0.2s, background 0.2s;
}
.inci-textarea:focus { border-color: rgba(31,49,68,0.2); background: white; }
.inci-textarea::placeholder { color: rgba(31,49,68,0.32); }

.barcode-row { display: flex; gap: 10px; flex-wrap: wrap; }
.barcode-input {
  flex: 1; min-width: 0;
  border: 1.5px solid rgba(31,49,68,0.06);
  background: #f3f8fb; border-radius: 18px;
  padding: 13px 18px; font: inherit; font-size: 1.05em;
  font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
  color: #1f3144; outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.barcode-input:focus { border-color: rgba(31,49,68,0.2); background: white; }
.barcode-input::placeholder { color: rgba(31,49,68,0.3); }

.input-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; font-size: 0.85em;
}
.char-count { opacity: 0.6; }
.char-count .err { color: #c8503e; opacity: 1; font-weight: 600; }

.examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.85em; }
.examples-label { opacity: 0.5; font-weight: 600; }
.example-chip {
  border: 1px solid rgba(31,49,68,0.08); background: #f3f8fb;
  padding: 5px 12px; border-radius: 999px;
  font: inherit; font-size: 0.92em; color: #1f3144;
  opacity: 0.75; cursor: pointer; transition: all 0.15s;
}
.example-chip:hover { opacity: 1; background: white; transform: translateY(-1px); }

.cta-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; background: #f6b3a4; border-radius: 999px;
  padding: 11px 22px; font: inherit; font-weight: 800;
  color: #1f3144; cursor: pointer;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.55),
    inset 0 -3px 0 rgba(31,49,68,0.08),
    0 5px 12px -2px rgba(31,49,68,0.18);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  font-size: 0.92em;
}
.cta-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.65),
    inset 0 -3px 0 rgba(31,49,68,0.08),
    0 9px 18px -4px rgba(31,49,68,0.22);
}
.cta-btn:active:not(:disabled) { transform: translateY(1px); }
.cta-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* History */
.history-strip {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 4px 8px; flex-wrap: wrap;
  font-size: 0.85em; min-height: 30px;
}
.history-label { font-weight: 700; opacity: 0.55; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0; }
.history-strip.is-empty .history-empty { opacity: 0.4; font-style: italic; }
.history-items { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.history-item {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.65); border: 1px solid rgba(31,49,68,0.06);
  border-radius: 999px; padding: 4px 12px 4px 4px;
  font: inherit; font-size: 0.95em; font-weight: 600;
  color: #1f3144; cursor: pointer; transition: all 0.15s; max-width: 220px;
}
.history-item:hover { background: white; transform: translateY(-1px); }
.history-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Footer */
.footer {
  position: relative; z-index: 2;
  text-align: center; padding: 14px 20px;
  font-size: 0.8em; opacity: 0.45; flex-shrink: 0;
}

/* ── Results ── */
.hero--compact { gap: 12px; }

/* Results view toggle */
.results-view-toggle {
  display: inline-flex; gap: 4px;
  background: #f0f5f9;
  border-radius: 999px; padding: 4px;
  align-self: flex-start;
}
.results-view-btn {
  border: 0; background: transparent;
  border-radius: 999px; padding: 7px 16px;
  font: inherit; font-weight: 700; font-size: 0.84em; color: #1f3144;
  opacity: 0.5; cursor: pointer; transition: all 0.18s;
}
.results-view-btn.is-active {
  background: white; opacity: 1;
  box-shadow: 0 2px 8px rgba(31,49,68,0.1);
}
.results-view-btn:hover:not(.is-active) { opacity: 0.75; }

/* Raw INCI view */
.inci-raw-view {
  margin: 0; padding: 16px 20px;
  background: #f7fafc; border-radius: 18px;
  font-family: ui-monospace, monospace; font-size: 0.82em;
  line-height: 1.7; color: #2a4660;
  white-space: pre-wrap; word-break: break-word;
  border: 1.5px solid rgba(31,49,68,0.06);
}

.results-card {
  width: 100%; max-width: 100%;
  background: white; border-radius: 32px;
  padding: clamp(18px, 2vw, 28px);
  box-shadow:
    0 1px 0 white inset,
    0 1px 3px rgba(31,49,68,0.04),
    0 20px 50px -10px rgba(31,49,68,0.22);
  border: 1.5px solid rgba(31,49,68,0.04);
  display: flex; flex-direction: column; gap: clamp(14px, 1.8vw, 20px);
  animation: pop-in 0.5s cubic-bezier(.34,1.56,.64,1);
  text-align: left;
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.results-head {
  display: flex; align-items: center; gap: clamp(14px, 1.8vw, 20px); flex-wrap: wrap;
}
.results-title-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.prod-name { font-weight: 700; font-size: 1em; }
.prod-meta { opacity: 0.55; font-size: 0.88em; }
.ing-count { font-size: 0.85em; font-weight: 600; opacity: 0.65; margin-top: 4px; }

.reset-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f3f8fb; border: 1.5px solid rgba(31,49,68,0.05);
  border-radius: 999px; padding: 8px 14px;
  font: inherit; font-weight: 700; color: #1f3144;
  cursor: pointer; transition: all 0.15s; font-size: 0.85em; flex-shrink: 0;
}
.reset-btn:hover { background: white; transform: translateY(-1px); }

/* "Contains:" summary bar above ingredient pills */
.contains-bar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 10px; margin: 4px 0 14px;
  padding: 10px 14px;
  background: #f3f8fb; border: 1px solid rgba(31,49,68,0.06);
  border-radius: 16px;
}
.contains-label {
  font-family: ui-monospace, monospace; font-size: 0.78rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(31,49,68,0.55);
}
.cat-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; border: 1px solid rgba(31,49,68,0.08);
  border-radius: 999px; padding: 2px 4px 2px 4px;
  transition: background 0.15s, border-color 0.15s;
}
.cat-chip.is-active { background: #fde9b0; border-color: rgba(31,49,68,0.18); }
.cat-eye {
  background: transparent; border: 0; padding: 4px 6px;
  border-radius: 999px; cursor: pointer; line-height: 1;
  font-size: 0.95em; opacity: 0.5;
  transition: opacity 0.15s, background 0.15s;
}
.cat-eye:hover { opacity: 1; background: rgba(31,49,68,0.06); }
.cat-eye[aria-pressed="true"] { opacity: 1; background: rgba(255,200,90,0.35); }
.cat-link {
  text-decoration: none; color: #1f3144;
  font-size: 0.85em; font-weight: 600;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  transition: background 0.15s;
}
.cat-link:hover { background: rgba(31,49,68,0.06); }
.cat-count {
  display: inline-block; min-width: 1.4em; padding: 1px 6px;
  background: rgba(31,49,68,0.08); border-radius: 999px;
  font-family: ui-monospace, monospace; font-size: 0.85em;
  font-weight: 700; text-align: center; margin-right: 4px;
}

/* Ingredient pills */
.ing-list { display: flex; flex-wrap: wrap; gap: 7px; }
.ing-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; border-radius: 999px; padding: 8px 14px;
  background: #eef4f8;
  font: inherit; font-weight: 600; font-size: 0.86em; color: #1f3144;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 -2px 0 rgba(31,49,68,0.05),
    0 1px 4px rgba(31,49,68,0.05);
}
.ing-pill:hover { background: #e3edf4; transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -2px 0 rgba(31,49,68,.05), 0 4px 10px rgba(31,49,68,0.1); }
.ing-pill.is-open { transform: translateY(-1px) scale(1.02); }
.ing-pill.is-fam-active {
  background: #fde9b0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 -2px 0 rgba(31,49,68,0.08),
    0 0 0 2px rgba(255,180,80,0.6);
}
.ing-pill.is-fam-dim { opacity: 0.32; }
.ing-pill.is-fam-dim:hover { opacity: 0.65; }
.ing-stub-mark {
  color: #c8503e; font-weight: 800; font-size: 0.9em;
  line-height: 1; align-self: flex-start; margin-top: 1px;
}

/* Detail panel */
.ing-detail {
  border-radius: 22px; padding: 14px 18px;
  background: #eef4f8;
  display: flex; flex-direction: column; gap: 5px;
  animation: pop-in 0.3s cubic-bezier(.34,1.56,.64,1);
}
.ing-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ing-detail-name { font-weight: 800; font-size: 1.02em; }
.ing-detail-tag { font-weight: 700; font-size: 0.75em; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.7); }
.ing-detail-note { line-height: 1.5; font-size: 0.93em; }
.ing-detail-inci { font-size: 0.78em; opacity: 0.55; margin-top: 2px; }
.ing-detail-inci code { font-family: ui-monospace, monospace; background: rgba(255,255,255,0.6); padding: 2px 6px; border-radius: 6px; }
.ing-detail-link {
  display: inline-block; margin-top: 6px;
  font-weight: 700; color: #1f3144; opacity: 0.7;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(31,49,68,0.25); font-size: 0.88em;
}
.ing-detail-link:hover { opacity: 1; }

/* ── Mobile tweaks ── */
.variant-mobile .topbar { padding: 14px 18px; }
.variant-mobile .topnav { gap: 2px; }
.variant-mobile .topnav a { padding: 6px 8px; font-size: 0.78em; }
.variant-mobile .stage { padding: 8px 18px; }
.variant-mobile .results-head { gap: 12px; }
.variant-mobile .reset-btn { font-size: 0.78em; padding: 7px 12px; }
.variant-mobile .barcode-row { flex-direction: column; }
.variant-mobile .barcode-row .cta-btn { width: 100%; }
.variant-mobile .input-footer { flex-direction: column; align-items: flex-start; gap: 4px; }
.variant-mobile .examples { font-size: 0.8em; }
.variant-mobile .footer { padding: 10px; font-size: 0.72em; }

/* ── Fiches / Ingredients / Resources pages ── */
.fiches-page, .ing-page, .res-page, .about-page {
  width: 100%; max-width: 920px;
  display: flex; flex-direction: column; gap: 18px;
  text-align: left; color: #1f3144;
  animation: pop-in 0.4s cubic-bezier(.34,1.56,.64,1);
}
.about-page { max-width: 880px; gap: 24px; }

.fiches-head { display: flex; flex-direction: column; gap: 6px; position: relative; }
.back-btn {
  align-self: flex-start; background: rgba(255,255,255,0.6);
  border: 1.5px solid rgba(31,49,68,0.06); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-weight: 700; color: #1f3144;
  cursor: pointer; font-size: 0.85em; transition: all 0.15s; margin-bottom: 4px;
  text-decoration: none; display: inline-block;
}
.back-btn:hover { background: white; transform: translateX(-2px); }

.fiches-title {
  font-family: "Fraunces", serif; font-weight: 700;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.1;
  letter-spacing: -0.02em; margin: 0; color: #1f3144;
}
.fiches-accent { background: #fde9b0; padding: 0 0.4em 0.05em; display: inline-block; }
.fiches-sub {
  font-family: "DM Serif Display", serif; font-style: italic;
  font-size: clamp(1rem, 1.3vw, 1.2rem); margin: 0; opacity: 0.78;
  color: #2a4660; max-width: 600px; line-height: 1.4;
}

.fiches-controls {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: white; border-radius: 24px; padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(31,49,68,0.04), 0 8px 24px -8px rgba(31,49,68,0.12);
  border: 1.5px solid rgba(31,49,68,0.04);
}
.search-wrap {
  flex: 1; min-width: 220px;
  display: flex; align-items: center; gap: 8px;
  background: #f3f8fb; border: 1.5px solid rgba(31,49,68,0.05);
  border-radius: 14px; padding: 9px 14px;
  color: rgba(31,49,68,0.55); transition: border-color 0.2s, background 0.2s;
}
.search-wrap:focus-within { border-color: rgba(31,49,68,0.2); background: white; }
.search-input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 0.95em; color: #1f3144;
}
.search-input::placeholder { color: rgba(31,49,68,0.35); }

.filter-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-pill {
  border: 1.5px solid rgba(31,49,68,0.06); background: #f3f8fb;
  border-radius: 999px; padding: 7px 13px;
  font: inherit; font-weight: 700; color: #1f3144;
  cursor: pointer; font-size: 0.82em; transition: all 0.15s;
}
.filter-pill:hover { background: white; }
.filter-pill.is-active { background: #1f3144; color: white; border-color: #1f3144; }
.filter-pill.is-restricted { border-color: rgba(192,57,43,.2); color: #c0392b; }
.filter-pill.is-restricted:hover { background: #fde8e8; }
.filter-pill.is-restricted.is-active { background: #c0392b; border-color: #c0392b; color: white; }

.fiches-meta { display: flex; align-items: center; gap: 12px; width: 100%; font-size: 0.82em; padding-top: 8px; border-top: 1px dashed rgba(31,49,68,0.08); margin-top: 2px; }
.fiches-count { opacity: 0.55; font-weight: 600; }

.empty-state {
  background: white; border-radius: 24px; padding: 40px; text-align: center;
  font-style: italic; font-family: "DM Serif Display", serif;
  font-size: 1.1rem; color: rgba(31,49,68,0.5);
}

/* Ingredient cards grid */
.ing-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ing-card {
  display: flex; align-items: center; gap: 10px;
  background: white; border-radius: 14px; padding: 10px 14px;
  border: 1.5px solid rgba(31,49,68,0.05);
  text-decoration: none; color: #1f3144;
  transition: all 0.15s; box-shadow: 0 1px 2px rgba(31,49,68,.03);
}
.ing-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(31,49,68,.18); }
.ing-card-body { display: flex; flex-direction: column; min-width: 0; flex: 1; overflow: hidden; }
.ing-card-name { font-family: "Fraunces", serif; font-weight: 700; font-size: 0.98rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ing-card-inci { font-family: ui-monospace, monospace; font-size: 0.72em; opacity: 0.55; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Ingredient detail card */
.ing-detail-card {
  background: white; border-radius: 24px; padding: 24px;
  border: 1.5px solid rgba(31,49,68,0.05);
  box-shadow: 0 10px 28px -10px rgba(31,49,68,.14);
}
.ing-detail-top { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.ing-detail-title { flex: 1; min-width: 0; color: #1f3144; }
.ing-detail-title h1 { font-family: "Fraunces", serif; font-size: 1.6rem; margin: 0; color: #1f3144; }
.ing-detail-inci-name { font-family: ui-monospace, monospace; font-size: 0.85em; opacity: 0.6; }
.ing-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; color: #1f3144; }
.ing-detail-grid section h3 { font-family: "Fraunces", serif; font-size: 0.88rem; margin: 0 0 5px; color: #1f3144; opacity: 0.85; }
.ing-detail-grid section p  { margin: 0; line-height: 1.6; opacity: 0.78; color: #1f3144; }


.family-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  text-decoration: none; color: #1f3144;
  font-weight: 700; font-size: 0.9em;
}
.family-chip.is-coral  { background: #fbdcd3; }
.family-chip.is-yellow { background: #fdf3d8; }
.family-chip.is-sky    { background: #e3f1f8; }
.family-chip.is-mint   { background: #dff0e2; }
.family-icon { font-family: "Fraunces", serif; }

/* Share button */
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 10px;
  background: #f3f8fb; color: rgba(31,49,68,0.6);
  cursor: pointer; transition: all 0.15s; flex-shrink: 0;
  border: 1px solid rgba(31,49,68,0.06);
}
.share-btn:hover { background: white; color: #1f3144; transform: translateY(-1px); }
.share-btn.is-done { background: #dff0e2; color: #3f7f4a; border-color: rgba(95,168,106,0.3); }

/* ── Resources page ── */
.res-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.res-tile {
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px; border-radius: 22px;
  text-decoration: none; color: #1f3144;
  border: 1.5px solid rgba(31,49,68,.04);
  transition: all 0.2s; min-height: 130px;
}
.res-tile:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -10px rgba(31,49,68,.2); }
.res-tile.is-coral  { background: #fbdcd3; }
.res-tile.is-yellow { background: #fdf3d8; }
.res-tile.is-sky    { background: #e3f1f8; }
.res-tile.is-mint   { background: #dff0e2; }
.res-tile-icon {
  font-family: "Fraunces", serif; font-size: 1.6rem;
  width: 44px; height: 44px; border-radius: 14px; background: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(31,49,68,.06);
}
.res-tile-body { margin-top: auto; }
.res-tile-title { font-family: "Fraunces", serif; font-weight: 700; font-size: 1.1rem; line-height: 1.2; color: #1f3144; }
.res-tile-count { font-size: 0.82em; opacity: 0.6; margin-top: 4px; }

.res-detail-hero {
  border-radius: 24px; padding: 28px;
  display: flex; align-items: center; gap: 18px;
}
.res-detail-hero.is-coral  { background: #fbdcd3; }
.res-detail-hero.is-yellow { background: #fdf3d8; }
.res-detail-hero.is-sky    { background: #e3f1f8; }
.res-detail-hero.is-mint   { background: #dff0e2; }
.res-detail-icon {
  width: 60px; height: 60px; border-radius: 18px; background: white;
  display: flex; align-items: center; justify-content: center;
  font-family: "Fraunces", serif; font-size: 2rem; color: #1f3144;
  box-shadow: 0 3px 8px rgba(31,49,68,.08);
}
.res-detail-hero h1 { flex: 1; font-family: "Fraunces", serif; font-size: 1.8rem; margin: 0; color: #1f3144; }
.res-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.res-detail-body { display: flex; flex-direction: column; gap: 12px; }

/* ── Feedback / comments / report ── */
.feedback-area { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }

.report-btn {
  align-self: flex-end;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: white; border: 1.5px solid rgba(31,49,68,.12);
  font-family: inherit; font-size: 0.85em; font-weight: 600;
  color: #1f3144; cursor: pointer; transition: all 0.15s;
}
.report-btn:hover { background: #fbf6ee; transform: translateY(-1px); border-color: rgba(31,49,68,.25); }
.report-icon {
  width: 18px; height: 18px; border-radius: 50%; background: #1f3144; color: white;
  font-family: "Fraunces", serif; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 0.75em;
}

/* Comments — sits flush inside the white .ing-detail-card,
   separated by a soft dashed rule rather than a beige block. */
.comments-block {
  margin-top: 4px;
  padding-top: 22px;
  border-top: 1px dashed rgba(31,49,68,0.12);
  display: flex; flex-direction: column; gap: 16px;
  color: #1f3144;
}
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.comments-title {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 14px 5px 6px; border-radius: 999px;
  background: #fbf6ee;
  font-family: "Nunito", sans-serif;
  font-size: 0.82em; font-weight: 700; letter-spacing: 0.01em;
  color: #1f3144; margin: 0;
}
.comments-count {
  width: 22px; height: 22px; border-radius: 50%;
  background: #1f3144; color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Fraunces", serif; font-weight: 700; font-size: 0.78em;
  font-feature-settings: "tnum";
}
.comments-sub   { margin: 0; font-size: 0.92em; opacity: 0.65; line-height: 1.5; max-width: 56ch; color: #1f3144; }
.comments-empty {
  padding: 14px 0 4px; margin: 0;
  font-style: italic; font-size: 0.92em;
  opacity: 0.5; color: #1f3144;
  background: transparent; text-align: left;
}
.comments-list  { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.comment-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-areas: "avatar meta" "avatar text";
  column-gap: 14px; row-gap: 2px;
  padding: 14px 4px;
  background: transparent; border-radius: 0;
  border-bottom: 1px solid rgba(31,49,68,0.06);
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  grid-area: avatar;
  width: 36px; height: 36px; border-radius: 50%;
  background: #fbdcd3; color: #1f3144;
  font-family: "Fraunces", serif; font-weight: 700; font-size: 0.95em;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1.5px rgba(31,49,68,0.06);
}
/* rotate avatar tints through the ingredient-family palette */
.comment-item:nth-child(4n+1) .comment-avatar { background: #fbdcd3; }
.comment-item:nth-child(4n+2) .comment-avatar { background: #e3f1f8; }
.comment-item:nth-child(4n+3) .comment-avatar { background: #fdf3d8; }
.comment-item:nth-child(4n+4) .comment-avatar { background: #dff0e2; }

.comment-body { display: contents; }
.comment-meta {
  grid-area: meta;
  display: flex; align-items: baseline; gap: 8px;
  font-size: 0.86em; margin-bottom: 0;
}
.comment-name   { font-weight: 800; font-size: 1em; color: #1f3144; }
.comment-time   {
  font-size: 0.92em; opacity: 0.5; color: #1f3144;
  position: relative; padding-left: 12px;
}
.comment-time::before {
  content: "·"; position: absolute; left: 2px; opacity: 0.6;
}
.comment-text {
  grid-area: text; margin: 2px 0 0;
  font-size: 0.95em; line-height: 1.6; color: #1f3144;
  opacity: 0.86;
  text-wrap: pretty;
}

.comment-form {
  margin-top: 4px;
  padding: 16px;
  background: #fbf6ee;
  border-radius: 18px;
  display: flex; flex-direction: column; gap: 10px;
  grid-template-columns: none;
  align-items: stretch;
}
.comment-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: white;
  font-family: inherit; font-size: 0.95em; color: #1f3144;
  line-height: 1.5;
  resize: vertical; min-height: 64px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.comment-textarea::placeholder { color: rgba(31,49,68,0.42); }
.comment-textarea:focus {
  border-color: rgba(31,49,68,0.4);
  box-shadow: 0 0 0 4px rgba(31,49,68,0.06);
}
.comment-form-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.comment-name-input {
  flex: 1 1 200px; min-width: 0;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background: white;
  font-family: inherit; font-size: 0.88em; color: #1f3144;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.comment-name-input::placeholder { color: rgba(31,49,68,0.42); }
.comment-name-input:focus {
  border-color: rgba(31,49,68,0.4);
  box-shadow: 0 0 0 4px rgba(31,49,68,0.06);
}
.comment-post {
  padding: 9px 18px;
  border-radius: 999px;
  border: none;
  background: #1f3144; color: white;
  font-family: inherit; font-weight: 700; font-size: 0.88em;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  align-self: auto;
  transition: transform 0.15s, background 0.15s, opacity 0.15s;
}
.comment-post:hover:not(:disabled) { background: #2a4259; transform: translateY(-1px); }
.comment-post:disabled { opacity: 0.35; cursor: not-allowed; }
.comment-post .arrow {
  font-family: "Fraunces", serif; font-size: 1.05em; line-height: 1;
  transform: translateY(-1px);
}

/* Modal (report) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(31,49,68,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 20px;
  animation: fade-in 0.2s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: #fbf6ee; border-radius: 22px; padding: 26px;
  width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow-y: auto;
  box-shadow: 0 20px 60px -10px rgba(31,49,68,.4);
  animation: pop-in 0.3s cubic-bezier(.34,1.56,.64,1); color: #1f3144;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.modal-head h3 { font-family: "Fraunces", serif; font-size: 1.3rem; margin: 0; color: #1f3144; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%; background: white; border: none; color: #1f3144;
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.modal-close:hover { background: #1f3144; color: white; }
.modal-sub     { margin: 0 0 8px; font-size: 0.92em; opacity: 0.75; line-height: 1.55; }
.modal-context { margin: 0 0 16px; font-size: 0.88em; opacity: 0.7; }
.modal-label   { display: block; font-size: 0.82em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 14px; margin-bottom: 6px; opacity: 0.7; }
.modal-types   { display: flex; gap: 6px; flex-wrap: wrap; }
.modal-type {
  padding: 8px 14px; border-radius: 999px; background: white;
  border: 1.5px solid rgba(31,49,68,.1); font-family: inherit;
  font-size: 0.86em; font-weight: 600; color: #1f3144; cursor: pointer; transition: all 0.15s;
}
.modal-type:hover { border-color: rgba(31,49,68,.3); }
.modal-type.is-active { background: #1f3144; color: white; border-color: #1f3144; }
.modal-textarea, .modal-input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid rgba(31,49,68,.1); background: white;
  font-family: inherit; font-size: 0.95em; color: #1f3144;
  outline: none; transition: border-color 0.15s;
}
.modal-textarea { resize: vertical; min-height: 90px; }
.modal-textarea:focus, .modal-input:focus { border-color: #1f3144; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-cancel, .modal-submit {
  padding: 10px 20px; border-radius: 12px;
  font-family: inherit; font-weight: 700; font-size: 0.92em;
  cursor: pointer; transition: all 0.15s; border: none;
}
.modal-cancel { background: transparent; color: #1f3144; }
.modal-cancel:hover { background: rgba(31,49,68,.06); }
.modal-submit { background: #1f3144; color: white; }
.modal-submit:hover:not(:disabled) { background: #2a4259; transform: translateY(-1px); }
.modal-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.modal-sent { padding: 30px 0; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.modal-sent-check {
  width: 56px; height: 56px; border-radius: 50%; background: #5fa86a; color: white;
  font-size: 2rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  animation: pop-in 0.4s cubic-bezier(.34,1.56,.64,1);
}
.modal-sent-text { font-family: "Fraunces", serif; font-size: 1.2rem; }

.fiche-empty { font-style: italic; opacity: 0.45 !important; font-size: 0.88em; }

/* ── About page ── */
.about-accent { background: #f6b3a4; }
.about-hero {
  font-size: clamp(1.15rem, 1.5vw, 1.4rem) !important;
  max-width: 640px !important;
}
.about-block {
  background: white; border-radius: 28px; padding: clamp(20px, 2.4vw, 32px);
  border: 1.5px solid rgba(31,49,68,0.04);
  box-shadow: 0 1px 3px rgba(31,49,68,0.03), 0 10px 28px -10px rgba(31,49,68,0.14);
  display: flex; flex-direction: column; gap: 12px; color: #1f3144;
}
.about-block, .about-block * { color: #1f3144; }
.about-block .about-eyebrow { color: rgba(31,49,68,0.6); }
.about-block .source-desc, .about-block .step-content p, .about-block .about-value p { color: rgba(31,49,68,0.78); }
.about-eyebrow { font-family: ui-monospace, monospace; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(31,49,68,0.55); }
.about-block h4 { font-family: "Fraunces", serif; font-weight: 700; font-size: 1.05rem; margin: 0 0 4px; letter-spacing: -0.005em; }
.about-block p  { margin: 0; line-height: 1.6; opacity: 0.78; text-wrap: pretty; }
.about-lede { font-family: "DM Serif Display", serif; font-style: italic; font-size: clamp(1.1rem, 1.4vw, 1.3rem) !important; opacity: 0.85 !important; color: #2a4660; }
.about-intro { font-size: 0.95em; opacity: 0.7; }

.about-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
.about-step { display: flex; gap: 14px; background: #f3f8fb; border-radius: 20px; padding: 16px; border: 1.5px solid rgba(31,49,68,0.04); }
.about-step.is-yellow { background: #fdf3d8; border-color: rgba(217,154,44,0.15); }
.about-step.is-sky    { background: #e3f1f8; border-color: rgba(125,175,200,0.18); }
.about-step.is-coral  { background: #fbdcd3; border-color: rgba(200,80,62,0.15); }
.step-num { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; font-family: "Fraunces", serif; font-weight: 800; font-size: 1rem; color: #1f3144; box-shadow: 0 2px 4px rgba(31,49,68,0.08); }
.step-content h4 { font-size: 0.98rem; }
.step-content p  { font-size: 0.88em; line-height: 1.5; }

.about-sources { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 4px; }
.about-source  { border-left: 3px solid #bde6f3; padding: 6px 14px; background: rgba(189,230,243,0.08); border-radius: 0 12px 12px 0; }
.about-source:nth-child(2) { border-left-color: #f6b3a4; background: rgba(246,179,164,0.1); }
.about-source:nth-child(3) { border-left-color: #bfe5cc; background: rgba(191,229,204,0.1); }
.about-source:nth-child(4) { border-left-color: #fde9b0; background: rgba(253,233,176,0.15); }
.source-name { font-family: "Fraunces", serif; font-weight: 700; font-size: 0.98rem; }
.source-desc { font-size: 0.85em; opacity: 0.65; line-height: 1.45; margin-top: 2px; }

.about-values { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 4px; }
.about-value  { background: #f3f8fb; border-radius: 20px; padding: 18px; border: 1.5px solid rgba(31,49,68,0.04); }
.value-icon   { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 12px; background: white; font-family: "Fraunces", serif; font-size: 1.2rem; margin-bottom: 10px; color: #1f3144; box-shadow: 0 2px 4px rgba(31,49,68,0.06); }
.about-value p { font-size: 0.9em; }

.about-limits { background: #fbecc8; border-color: rgba(217,154,44,0.18); }
.about-limits p { font-style: italic; font-family: "DM Serif Display", serif; font-size: 1.05rem !important; color: #5a4319; opacity: 0.9 !important; }

.about-cta { text-align: center; padding: 24px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; color: #1f3144; }
.about-cta, .about-cta h3 { color: #1f3144; }
.about-cta h3  { font-family: "Fraunces", serif; font-weight: 700; font-size: clamp(1.2rem, 1.8vw, 1.5rem); margin: 0; letter-spacing: -0.01em; }
.about-cta-btn { text-decoration: none; padding: 14px 28px; color: white !important; }

/* ── Responsive ── */
.variant-tablet .about-steps,
.variant-tablet .about-sources,
.variant-tablet .about-values { grid-template-columns: 1fr 1fr; }
.variant-mobile .about-steps,
.variant-mobile .about-sources,
.variant-mobile .about-values { grid-template-columns: 1fr; }
.variant-mobile .about-block  { padding: 18px; border-radius: 22px; }
.variant-mobile .fiches-title { font-size: 1.7rem; }
.variant-mobile .ing-grid,
.variant-mobile .res-grid     { grid-template-columns: 1fr; }
.variant-mobile .ing-detail-grid,
.variant-mobile .res-detail-grid { grid-template-columns: 1fr; }
.variant-mobile .comment-form-row { flex-direction: column; align-items: stretch; }
.variant-mobile .comment-post { justify-content: center; }
.variant-tablet .res-detail-grid { grid-template-columns: 1fr; }

/* ── Regulation badges ── */
.reg-badge { display: inline-block; font-size: 0.78em; font-weight: 700; padding: 4px 12px; border-radius: 999px; margin-bottom: 8px; }
.reg-badge.is-banned  { background: #fde8e8; color: #c0392b; }
.reg-badge.is-limited { background: #fef3e2; color: #a87018; }
.reg-badge.is-ok      { background: #dff0e2; color: #3f7f4a; }
.reg-date { font-size: 0.82em; opacity: 0.65; margin: 4px 0 2px; }
.reg-ref  { font-family: ui-monospace, monospace; font-size: 0.78em; opacity: 0.55; white-space: pre-line; margin-top: 6px; }

/* ── Admin page ── */
.admin-page { width: 100%; max-width: 980px; display: flex; flex-direction: column; gap: 18px; text-align: left; color: #1f3144; animation: pop-in 0.4s cubic-bezier(.34,1.56,.64,1); }
.admin-accent { background: #d4dbf2; padding: 0 0.4em 0.05em; display: inline-block; }
.admin-top-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.admin-tabs { display: flex; gap: 2px; border-bottom: 2px solid rgba(31,49,68,.1); margin-bottom: 4px; }
.admin-tab { font-size: 0.9em; font-weight: 600; padding: 8px 20px; border: none; background: none; cursor: pointer; color: rgba(31,49,68,.45); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color 0.15s, border-color 0.15s; border-radius: 6px 6px 0 0; }
.admin-tab:hover { color: #1f3144; background: rgba(31,49,68,.04); }
.admin-tab.is-active { color: #1f3144; border-bottom-color: #1f3144; }
.admin-stats-row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-stat { font-size: 0.82em; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: rgba(31,49,68,.06); }
.admin-stat.is-mod { background: #fbecc8; color: #a87018; }
.admin-stat.is-new { background: #dff0e2; color: #3f7f4a; }
.admin-action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-add-btn { font-size: 0.88em; padding: 10px 18px; }
.admin-export-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f3f8fb; border: 1.5px solid rgba(31,49,68,.08);
  border-radius: 999px; padding: 9px 16px;
  font: inherit; font-size: 0.85em; font-weight: 700; color: #1f3144;
  cursor: pointer; transition: all 0.15s;
}
.admin-export-btn:hover { background: white; }

/* Table */
.admin-table { display: flex; flex-direction: column; gap: 4px; }
.admin-table-head {
  display: grid; grid-template-columns: 20px minmax(0,2.5fr) minmax(0,2fr) 60px 90px auto;
  gap: 10px; padding: 6px 14px;
  font-size: 0.74em; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; opacity: 0.45;
}
.admin-row {
  display: grid; grid-template-columns: 20px minmax(0,2.5fr) minmax(0,2fr) 60px 90px auto;
  gap: 10px; align-items: center;
  background: white; border-radius: 12px; padding: 10px 14px;
  border: 1.5px solid rgba(31,49,68,.04);
  transition: box-shadow 0.15s;
}
.admin-row:hover { box-shadow: 0 4px 14px -6px rgba(31,49,68,.14); }
.admin-row.is-mod { border-color: rgba(217,154,44,.25); background: #fffdf5; }
.admin-row.is-new-row { border-color: rgba(95,168,106,.25); background: #f6fbf7; }
.admin-row.is-selected { background: #eef5fb; border-color: rgba(31,49,68,.15); }
.admin-checkbox { width: 15px; height: 15px; cursor: pointer; accent-color: #1f3144; }
.admin-inci { font-family: ui-monospace,monospace; font-size: 0.78em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.75; }
.admin-label-fr { font-size: 0.88em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-func-count { font-size: 0.8em; opacity: 0.55; text-align: center; }
.admin-badge { font-size: 0.72em; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(31,49,68,.06); white-space: nowrap; }
.admin-badge.is-mod { background: #fbecc8; color: #a87018; }
.admin-badge.is-new { background: #dff0e2; color: #3f7f4a; }
.admin-edit-btn {
  font: inherit; font-size: 0.8em; font-weight: 700;
  background: #f3f8fb; border: 1.5px solid rgba(31,49,68,.06);
  border-radius: 8px; padding: 5px 12px; color: #1f3144;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.admin-edit-btn:hover { background: #1f3144; color: white; }
.admin-delete-btn {
  font: inherit; font-size: 0.8em; font-weight: 700;
  background: #fdf3f2; border: 1.5px solid rgba(200,80,62,.15);
  border-radius: 8px; padding: 5px 12px; color: #c8503e;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.admin-delete-btn:hover { background: #c8503e; color: white; }
.admin-row-actions { display: flex; gap: 6px; align-items: center; }

/* ── Admin functions tab ── */
.admin-fn-list { display: flex; flex-direction: column; gap: 4px; }
.admin-fn-row {
  background: white; border-radius: 12px;
  border: 1.5px solid rgba(31,49,68,.04);
  overflow: hidden; transition: box-shadow 0.15s;
}
.admin-fn-row:hover { box-shadow: 0 4px 14px -6px rgba(31,49,68,.14); }
.admin-fn-row.is-expanded { border-color: rgba(31,49,68,.12); }
.admin-fn-main {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
}
.admin-fn-toggle {
  font: inherit; background: none; border: none; cursor: pointer;
  color: #9aa6b2; font-size: 0.9em; padding: 0 2px; flex-shrink: 0;
  transition: color 0.1s;
}
.admin-fn-toggle:hover { color: #1f3144; }
.admin-fn-name { font-size: 0.88em; font-weight: 600; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.admin-fn-en { font-size: 0.78em; font-weight: 400; opacity: 0.4; font-family: ui-monospace, monospace; }
.admin-fn-edit-input { flex: 1; min-width: 0; }
.admin-fn-count { font-size: 0.75em; opacity: 0.45; white-space: nowrap; }
.admin-fn-ingredients {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 14px 12px 36px;
  border-top: 1px solid rgba(31,49,68,.05);
  background: #f7fbfd;
}
.admin-fn-ing-chip {
  font-size: 0.78em; font-weight: 600;
  background: #e7f0f7; border-radius: 999px; padding: 3px 10px;
  color: #1f3144; text-decoration: none; white-space: nowrap;
  transition: background 0.12s;
}
.admin-fn-ing-chip:hover { background: #bde6f3; }
.admin-fn-ing-empty { font-size: 0.82em; opacity: 0.45; padding: 2px 0; }

/* Admin modal */
.admin-modal { max-width: 680px; width: 96vw; max-height: 90vh; overflow-y: auto; }
.admin-form { display: flex; flex-direction: column; gap: 14px; }
.admin-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-input {
  display: block; width: 100%; margin-top: 5px;
  padding: 9px 12px; border-radius: 10px;
  border: 1.5px solid rgba(31,49,68,.1); background: #f9fbfd;
  font: inherit; font-size: 0.9em; color: #1f3144;
  transition: border-color 0.15s;
}
.admin-input:focus { outline: none; border-color: #bde6f3; background: white; }
.admin-check-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.88em; font-weight: 600; cursor: pointer; user-select: none;
}
.admin-check-label input { width: 16px; height: 16px; cursor: pointer; }
.admin-reset-btn {
  font: inherit; font-size: 0.85em; font-weight: 700;
  background: #fbe1dc; border: 1.5px solid transparent;
  border-radius: 999px; padding: 8px 16px; color: #a73c2c;
  cursor: pointer; transition: all 0.15s;
}
.admin-reset-btn:hover { background: #f8c8bd; }

/* Functions editor */
.admin-funcs-editor { margin-top: 6px; display: flex; flex-direction: column; gap: 8px; }
.admin-chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; }
.admin-chips-empty { font-size: 0.82em; opacity: 0.4; font-style: italic; align-self: center; }
.admin-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #eef4f8; border-radius: 8px; padding: 4px 8px 4px 10px;
  font-family: ui-monospace,monospace; font-size: 0.75em; color: #1f3144;
}
.admin-chip button {
  background: none; border: none; cursor: pointer; color: inherit;
  font-size: 1em; line-height: 1; padding: 0; opacity: 0.5;
}
.admin-chip button:hover { opacity: 1; }
.admin-func-input-wrap { position: relative; }
.admin-suggestions {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20;
  background: white; border-radius: 12px;
  border: 1.5px solid rgba(31,49,68,.08);
  box-shadow: 0 8px 24px -8px rgba(31,49,68,.18);
  overflow: hidden;
}
.admin-suggestion {
  display: block; width: 100%; text-align: left;
  font: inherit; font-size: 0.82em; padding: 9px 14px;
  background: none; border: none; cursor: pointer; color: #1f3144;
  font-family: ui-monospace,monospace;
}
.admin-suggestion:hover { background: #eef4f8; }

@media (max-width: 640px) {
  .admin-table-head { display: none; }
  .admin-row { grid-template-columns: 20px 1fr auto; grid-template-rows: auto auto; gap: 4px 10px; }
  .admin-checkbox { grid-column: 1; grid-row: 1 / 3; }
  .admin-inci { grid-column: 2; }
  .admin-row-actions { grid-column: 3; grid-row: 1 / 3; }
  .admin-label-fr { grid-column: 2; }
  .admin-func-count, .admin-badge { display: none; }
  .admin-two-col { grid-template-columns: 1fr; }
}

/* ── Admin CFR grouped view ── */
.admin-cfr-group {
  border: 1px solid rgba(31,49,68,.08);
  border-radius: 10px;
  margin-bottom: 6px;
  overflow: hidden;
  background: #fff;
}
.admin-cfr-group.is-mod { border-color: rgba(217,154,44,.3); background: #fffdf5; }
.admin-cfr-group.is-editing { border-color: rgba(31,49,68,.2); box-shadow: 0 2px 10px -4px rgba(31,49,68,.1); }

.admin-cfr-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  background: rgba(31,49,68,.03);
  border-bottom: 1px solid rgba(31,49,68,.06);
}
.admin-cfr-group.is-editing .admin-cfr-group-header { background: rgba(31,49,68,.06); }
.admin-cfr-canon {
  font-family: ui-monospace,monospace; font-size: 0.82em;
  font-weight: 600; color: #1f3144;
}
.admin-cfr-form-count { font-size: 0.75em; color: #8a9aaa; margin-right: auto; }

.admin-cfr-form-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 28px;
  border-top: 1px solid rgba(31,49,68,.04);
  min-height: 34px;
}
.admin-cfr-form-row.is-mod { background: #fffdf5; }
.admin-cfr-form-row.is-new-row { background: #f6fbf7; }
.admin-cfr-suffix {
  font-family: ui-monospace,monospace; font-size: 0.76em;
  color: #8a9aaa; min-width: 140px; flex-shrink: 0;
}
.admin-cfr-val { font-size: 0.88em; color: #2c4a6a; flex: 1; }

.admin-cfr-inline-edit {
  display: flex; align-items: center; gap: 6px; flex: 1;
}
.admin-cfr-input {
  flex: 1; padding: 4px 8px; font-size: 0.85em;
  border: 1px solid rgba(31,49,68,.18); border-radius: 6px;
  background: #fff; color: #1f3144;
  font-family: inherit;
}
.admin-cfr-input:focus { outline: none; border-color: #3d7aba; }

.admin-inline-save {
  padding: 3px 8px; border-radius: 5px; border: none; cursor: pointer;
  background: #e8f5ea; color: #3a7d44; font-size: 0.9em;
  transition: background .15s;
}
.admin-inline-save:hover { background: #3a7d44; color: #fff; }
.admin-inline-reset {
  padding: 3px 8px; border-radius: 5px; border: none; cursor: pointer;
  background: #faeae8; color: #a73c2c; font-size: 0.85em;
}
.admin-inline-reset:hover { background: #a73c2c; color: #fff; }
.admin-inline-close {
  padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(31,49,68,.15);
  cursor: pointer; background: transparent; color: #5a6a7a; font-size: 0.82em;
}
.admin-inline-close:hover { background: rgba(31,49,68,.06); }

.admin-cfr-add-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 10px 28px;
  border-top: 1px dashed rgba(31,49,68,.1);
  background: rgba(31,49,68,.02);
}
.admin-cfr-canon-hint {
  font-family: ui-monospace,monospace; font-size: 0.75em;
  color: #aab; white-space: nowrap;
}
.admin-cfr-suffix-input { width: 170px; flex-shrink: 0; }
.admin-cfr-arrow { color: #aab; font-size: 0.85em; }

.admin-cfr-new-row {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 0 8px; margin-bottom: 4px;
}
.admin-cfr-new-row .admin-input { flex: 1; }

.admin-section-label {
  font-size: 0.78em; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: #8a9aaa;
  padding: 14px 0 6px; margin: 0;
}
.admin-cfr-flat-section { margin-top: 8px; }
.admin-cfr-flat-add-row {
  border-top: none;
  border-left: 3px solid #bde6f3;
  margin: 0 0 2px 8px;
  background: #f5fbfe;
  border-radius: 0 10px 10px 0;
}
.admin-cfr-head { grid-template-columns: 1fr 1fr 90px 100px; }
.admin-cfr-row { grid-template-columns: 1fr 1fr 90px 100px; }
.admin-cfr-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ── Pagination ───────────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 20px 0 8px;
}
.pagination-btn {
  padding: 6px 14px; border-radius: 8px; border: 1.5px solid rgba(31,49,68,.12);
  background: #fff; cursor: pointer; font-size: 0.9em; color: #1f3144;
  transition: background 0.15s;
}
.pagination-btn:disabled { opacity: 0.35; cursor: default; }
.pagination-btn:not(:disabled):hover { background: #f3f8fb; }
.pagination-info { font-size: 0.82em; color: #6b7e8e; }

/* ── Loading spinner ──────────────────────────────────────────────────── */
.loading-spinner {
  text-align: center; padding: 40px 20px; color: #8a9aaa;
  font-size: 0.9em; letter-spacing: 0.02em;
}

/* ── Admin key gate ───────────────────────────────────────────────────── */
.admin-key-gate {
  max-width: 520px; margin: 40px auto; padding: 24px 28px;
  background: #fff; border-radius: 14px;
  border: 1.5px solid rgba(31,49,68,.08);
  box-shadow: 0 2px 12px rgba(31,49,68,.06);
}
