@import url('https://fonts.googleapis.com/css2?family=Slabo+27px&display=swap');

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --bg:       #eddea0;
  --bg-warm:  #f5e8b8;
  --bg-table: #eddea0;
  --nav-bg:   #3d1c08;
  --nav-link: #c8a06a;
  --border:   #c9bfa8;
  --border-dark: #a89880;
  --text:     #28180a;
  --text-mid: #5a3d1e;
  --text-dim: #8a7055;
  --link:     #7a3e0a;
  --link-hover: #b8600a;
  --gold:     #b8820f;
  --gold-light: #d4a83a;
  --rating-bg: #2c1c0a;
  --rating-fg: #f0d090;
  --tag-bg:   #ddd3be;
  --tag-text: #4a2e10;
  --green:    #3a6e3a;
  --red:      #8e2020;
  --shadow:   0 1px 4px rgba(0,0,0,.12);
}

/* ── Reset + base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 14px;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Slabo 27px', serif;
  font-size: 1rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img { max-width: 100%; display: block; }
p { margin-bottom: .6rem; }
strong { font-weight: 600; }

/* ── Top nav ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--nav-bg);
  border-bottom: 2px solid var(--gold);
  position: relative;
}
.site-header-inner {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  height: 50px;
  gap: .1rem;
  flex-wrap: wrap;
}
.site-brand {
  font-family: 'Slabo 27px', serif;
  font-size: .95rem;
  font-weight: 600;
  color: var(--gold-light);
  text-decoration: none;
  letter-spacing: .06em;
  margin-right: .5rem;
  white-space: nowrap;
}
.site-brand:hover { color: #f0c060; text-decoration: none; }
.nav-link {
  color: var(--nav-link);
  font-size: .84rem;
  font-family: 'Slabo 27px', serif;
  transition: color .12s;
  white-space: nowrap;
  padding: 0 .28rem;
}
.nav-link:hover { color: #f0c060; text-decoration: none; }
.nav-link-user {
  color: #e8c888;
  font-size: .84rem;
  font-family: 'Slabo 27px', serif;
  font-weight: 500;
  padding: 0 .28rem;
}
.nav-link-user:hover { color: #f0c060; text-decoration: none; }
.nav-sep { color: #5a3a20; font-size: .77rem; }
#nav-user { display: flex; align-items: center; margin-left: auto; gap: .05rem; }

/* Search bar in nav */
.nav-search {
  display: flex;
  align-items: center;
  margin-left: .5rem;
  gap: .3rem;
  position: relative;
}
.nav-search input {
  background: #5a2e10;
  border: 1px solid #7a4a28;
  border-radius: 20px;
  color: #d4b888;
  padding: .2rem .5rem;
  font-family: 'Slabo 27px', serif;
  font-size: .82rem;
  width: 320px;
}
.nav-search input::placeholder { color: #6a4a2a; }
.nav-search input:focus { outline: none; border-color: var(--gold); }

/* ── Page layout ──────────────────────────────────────────────────────────────── */
.page-wrap {
  max-width: 1800px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  flex: 1;
}

/* Two-column layout: main content + sidebar */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.2rem;
  align-items: start;
}
@media (max-width: 800px) {
  .content-layout { grid-template-columns: 1fr; }
}

/* ── Section boxes ────────────────────────────────────────────────────────────── */
.box {
  background: #fdf5dc;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}
.box-header {
  background: var(--bg-table);
  border-bottom: 1px solid var(--border);
  padding: .35rem .7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.box-title {
  font-family: 'Slabo 27px', serif;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-mid);
}
.box-body { padding: .7rem; }
.box-body p:last-child { margin-bottom: 0; }

/* ── Page title strip ────────────────────────────────────────────────────────── */
.page-title-bar {
  background: var(--nav-bg);
  border: 1px solid #4a2a10;
  border-radius: 12px;
  padding: .6rem .9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
}
.page-title-bar h1 {
  font-family: 'Slabo 27px', serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--gold-light);
  line-height: 1.2;
}
.page-title-bar .subtitle {
  font-size: .88rem;
  color: var(--nav-link);
}

/* ── Dense data tables ───────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.data-table th {
  background: var(--bg-table);
  border-bottom: 2px solid var(--border-dark);
  padding: .3rem .5rem;
  text-align: left;
  font-family: 'Slabo 27px', serif;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-mid);
  white-space: nowrap;
}
.data-table th.r { text-align: right; }
.data-table td {
  padding: .3rem .5rem;
  border-bottom: 1px solid var(--bg-table);
  vertical-align: middle;
}
.data-table td.r { text-align: right; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-warm); }
.data-table .rank {
  font-family: 'Slabo 27px', serif;
  font-size: .72rem;
  color: var(--text-dim);
  width: 28px;
  text-align: right;
}
.data-table .cheese-name-cell { font-weight: 500; }
.data-table .producer-cell { color: var(--text-mid); font-size: .85rem; }
.data-table .score-cell {
  font-family: 'Slabo 27px', serif;
  font-size: .88rem;
  font-weight: 600;
  color: var(--gold);
  text-align: right;
  white-space: nowrap;
}
.data-table .count-cell {
  font-family: 'Slabo 27px', serif;
  font-size: .75rem;
  color: var(--text-dim);
  text-align: right;
}

/* ── Tags ────────────────────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-family: 'Slabo 27px', serif;
  font-size: .65rem;
  font-weight: 500;
  padding: .1rem .38rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
  text-decoration: none;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), background .12s, color .12s;
}
.tag:hover { background: var(--border); text-decoration: none; color: var(--text); transform: scale(1.05); }
.tag.hardness { background: #e8d8b8; border-color: #c8b090; }
.tag.style    { background: #d8e8c8; border-color: #a8c890; color: #2a4a1a; }
.tag.milk     { background: #d8e0f0; border-color: #98aad0; color: #1a2a4a; }
.tag.country  { background: #f0d8d8; border-color: #d0a8a8; color: #4a1a1a; }

/* ── Rating display ──────────────────────────────────────────────────────────── */
.rating-count {
  font-family: 'Slabo 27px', serif;
  font-size: .75rem;
  color: var(--text-dim);
}
.score-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2.5px solid var(--c, var(--gold));
  color: var(--c, var(--gold));
  font-family: 'Slabo 27px', serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.score-circle.large {
  width: 144px;
  height: 144px;
  font-size: 56px;
  font-weight: 700;
  border-width: 6px;
}
/* Collapsing decimal after count-up lands on a whole number */
.score-dec {
  display: inline-block;
  overflow: hidden;
  max-width: 2em;
  transition: max-width .5s cubic-bezier(.4,0,.2,1) .15s, opacity .4s ease .15s;
}
.score-dec-hide {
  max-width: 0;
  opacity: 0;
}

/* Compact inline rating badge */
.score-badge {
  font-family: 'Slabo 27px', serif;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}
.score-badge.large { font-size: 1.1rem; }
.score-none { color: var(--text-dim); font-style: italic; font-size: .85rem; }

/* ── Cheese detail page ─────────────────────────────────────────────────────── */
.cheese-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.2rem;
  padding: .8rem;
  align-items: start;
}
@media (max-width: 600px) { .cheese-hero { grid-template-columns: 1fr; } }
.cheese-hero-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 2px;
}
.cheese-hero-placeholder {
  width: 180px;
  height: 180px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--border-dark);
}
.cheese-info-title {
  font-family: 'Slabo 27px', serif;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: .2rem;
}
.cheese-info-producer {
  font-size: 1rem;
  color: var(--text-mid);
  margin-bottom: .5rem;
}
.cheese-info-producer a { color: var(--link); font-style: italic; }
.cheese-tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .6rem; }
.cheese-rating-row {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  margin: .6rem 0;
  flex-wrap: wrap;
}
.cheese-desc {
  font-size: .92rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin-top: .4rem;
}

/* ── Producer detail page ───────────────────────────────────────────────────── */
.producer-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: .8rem;
  align-items: start;
}
@media (max-width: 500px) { .producer-hero { grid-template-columns: 1fr; } }
.producer-hero-img {
  max-width: 200px;
  max-height: 180px;
  width: auto;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: 2px;
}
.producer-hero-placeholder {
  width: 140px;
  height: 100px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
.producer-name {
  font-family: 'Slabo 27px', serif;
  font-size: 1.55rem;
  font-weight: 500;
}
.producer-meta {
  font-size: .88rem;
  color: var(--text-mid);
  margin: .2rem 0 .5rem;
}
.producer-desc { font-size: .92rem; color: var(--text-mid); line-height: 1.6; }
.producer-stats {
  display: flex;
  gap: 1.2rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-num {
  font-family: 'Slabo 27px', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  display: block;
}
.stat-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  font-family: 'Slabo 27px', serif;
}

/* ── Filter bar ─────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .5rem;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: .8rem;
  align-items: center;
}
.filter-bar label {
  font-family: 'Slabo 27px', serif;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
}
.filter-bar select, .filter-bar input[type=text] {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .2rem .4rem;
  font-family: 'Slabo 27px', serif;
  font-size: .88rem;
  border-radius: 6px;
  cursor: pointer;
}
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: var(--gold); }
.filter-count {
  margin-left: auto;
  font-family: 'Slabo 27px', serif;
  font-size: .7rem;
  color: var(--text-dim);
}

/* ── Rating form ─────────────────────────────────────────────────────────────── */
.rate-section { padding: .8rem; }
.rate-section h3 {
  font-family: 'Slabo 27px', serif;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-mid);
  margin-bottom: .6rem;
}
.score-slider-wrap { margin-bottom: .6rem; }
.score-slider-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: .3rem;
}
.score-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  --thumb-color: var(--gold);
  background: var(--bg-table);
  border-radius: 3px;
  border: 1px solid var(--border);
  outline: none;
  cursor: pointer;
  transition: none;
}
.score-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--thumb-color, var(--gold));
  border: 2px solid var(--bark);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform .1s, box-shadow .1s, background .1s;
}
.score-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.score-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--thumb-color, var(--gold));
  border: 2px solid var(--bark);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: background .1s;
}
.score-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'Slabo 27px', serif;
  font-size: .62rem;
  color: var(--text-dim);
  padding: 0 .1rem;
  margin-top: .2rem;
}
.score-display {
  font-family: 'Slabo 27px', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold);
  min-width: 46px;
  text-align: right;
}
.score-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'Slabo 27px', serif;
  font-size: .62rem;
  color: var(--text-dim);
  padding: 0 .1rem;
}
.rate-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: .4rem .5rem;
  font-family: 'Slabo 27px', serif;
  font-size: .95rem;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  min-height: 70px;
  margin-bottom: .5rem;
  line-height: 1.5;
}
.rate-textarea:focus { outline: none; border-color: var(--gold); }
.rate-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .5rem;
  margin-bottom: .5rem;
}
@media (max-width: 560px) { .rate-fields-grid { grid-template-columns: 1fr; } }
.rate-field label {
  display: block;
  font-family: 'Slabo 27px', serif;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: .2rem;
}
.rate-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: .3rem .4rem;
  font-family: 'Slabo 27px', serif;
  font-size: .9rem;
  background: var(--bg);
  resize: vertical;
  min-height: 55px;
}
.rate-field textarea:focus { outline: none; border-color: var(--gold); }
.login-prompt-box {
  background: var(--bg-warm);
  border: 1px dashed var(--border-dark);
  border-radius: 12px;
  padding: .7rem;
  text-align: center;
  font-size: .92rem;
  color: var(--text-mid);
}
.login-prompt-box a { font-weight: 500; }

/* ── Community reviews ─────────────────────────────────────────────────────── */
.review-list { padding: 0; }
.review-row {
  padding: .6rem .7rem;
  border-bottom: 1px solid var(--bg-table);
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: .5rem .7rem;
  align-items: start;
}
.review-row:last-child { border-bottom: none; }
.review-score-col {
  font-family: 'Slabo 27px', serif;
  font-size: 1.2rem;
  font-weight: 600;
  align-self: center;
  color: var(--gold);
  min-width: 40px;
  text-align: right;
}
.review-header {
  display: flex;
  gap: .5rem;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: .2rem;
}
.review-user { font-weight: 600; font-size: .9rem; }
.review-user a { color: var(--text); }
.review-user a:hover { color: var(--link-hover); text-decoration: none; }
.review-date {
  font-family: 'Slabo 27px', serif;
  font-size: .68rem;
  color: var(--text-dim);
}

.review-notes { font-size: .92rem; color: var(--text-mid); line-height: 1.5; margin-bottom: .3rem; }
.review-details-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.review-detail {
  font-size: .82rem;
}
.review-detail-label {
  font-family: 'Slabo 27px', serif;
  font-size: .62rem;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: .06em;
  display: block;
}

/* ── Activity feed ───────────────────────────────────────────────────────────── */
.activity-item {
  padding: .45rem .7rem;
  border-bottom: 1px solid var(--bg-table);
  font-size: .88rem;
  display: flex;
  gap: .5rem;
  align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; }

/* Card-list variant: individual bordered cards with gaps (home page) */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-list .activity-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-warm);
  align-items: center;
  padding: .25rem .7rem .25rem .25rem;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card-list .activity-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.14);
}
.card-list .activity-item,
.card-list .activity-item:last-child {
  border-bottom: 1px solid var(--border);
}
.card-list .activity-thumb {
  width: 110px;
  height: 110px;
  font-size: 2.8rem;
  overflow: hidden;
  border-radius: 8px;
  flex-shrink: 0;
}
.card-list .activity-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-list .score-circle {
  width: 82px;
  height: 82px;
  font-size: 30px;
  border-width: 4px;
}
.activity-thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 1px;
  background: var(--bg-warm);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  text-decoration: none;
  transition: opacity .12s;
}
a.activity-thumb:hover { opacity: .8; }
}
.activity-text { flex: 1; min-width: 0; line-height: 1.4; }

.activity-time {
  font-family: 'Slabo 27px', serif;
  font-size: .65rem;
  color: var(--text-dim);
  flex-shrink: 0;
}


/* ── Forms (auth + admin) ───────────────────────────────────────────────────── */
.form-page {
  max-width: 420px;
  margin: 2rem auto;
  padding: 0 1rem;
  flex: 1;
}
.form-box {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.form-box-header {
  background: var(--bg-table);
  border-bottom: 1px solid var(--border);
  padding: .5rem .8rem;
  font-family: 'Slabo 27px', serif;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-mid);
}
.form-box-body { padding: 1rem; }
.form-group { margin-bottom: .8rem; }
.form-group label {
  display: block;
  font-family: 'Slabo 27px', serif;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: .25rem;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: .4rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Slabo 27px', serif;
  font-size: .95rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--gold);
}
.form-group textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.form-row { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
.form-row-3 { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr 1fr; }
.form-switch {
  text-align: center;
  font-size: .88rem;
  color: var(--text-dim);
  margin-top: .8rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  background: var(--nav-bg);
  color: var(--nav-link);
  border: 1px solid #4a2a10;
  padding: .35rem .9rem;
  border-radius: 2px;
  font-family: 'Slabo 27px', serif;
  font-size: .92rem;
  cursor: pointer;
  transition: background .12s, color .12s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #2c1c0e; color: #f0c060; text-decoration: none; }
.btn.primary { background: var(--gold); color: #1c110a; border-color: #8a6010; font-weight: 600; }
.btn.primary:hover { background: var(--gold-light); color: #1c110a; }
.btn.danger { background: #5e1010; color: #f0c0c0; border-color: #8e3030; }
.btn.danger:hover { background: #7e1818; }
.btn.sm { padding: .2rem .5rem; font-size: .82rem; }
.btn.rounded { border-radius: 8px; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-loading { opacity: .75; cursor: default; }
.btn-loading::after {
  content: '';
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin .6s linear infinite;
  margin-left: .4rem;
  vertical-align: middle;
}
.btn-row { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.wishlist-btn, .wishlist-active { text-align: center; }
.wishlist-btn { background: transparent; border: 1px solid var(--gold); color: var(--gold-light); }
.wishlist-btn:hover { background: rgba(184,130,15,.12); color: var(--gold); text-decoration: none; }
.wishlist-active { background: var(--gold); color: #1c110a; border: 1px solid #8a6010; }
.wishlist-active:hover { background: var(--gold-light); color: #1c110a; text-decoration: none; }

/* ── Toast notifications ─────────────────────────────────────────────────────── */
@keyframes toast-in  { from { opacity: 0; transform: translateX(1.5rem); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(1.5rem); } }
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  pointer-events: none;
}
.toast {
  background: var(--nav-bg);
  color: var(--gold-light);
  border: 1px solid #5a3a20;
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: .55rem .9rem;
  font-family: 'Slabo 27px', serif;
  font-size: .95rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  max-width: 300px;
  animation: toast-in .25s ease-out both;
}
.toast.toast-out {
  animation: toast-out .22s ease-in both;
}

/* ── Alerts ──────────────────────────────────────────────────────────────────── */
.alert {
  padding: .45rem .7rem;
  border-radius: 2px;
  font-size: .88rem;
  margin-bottom: .6rem;
  border-left: 3px solid;
}
.alert.ok  { background: #e8f4e8; border-color: var(--green); color: #1a3a1a; }
.alert.err { background: #f4e8e8; border-color: var(--red);   color: #3a1a1a; }
.alert.info { background: #e8eef8; border-color: #4a6aa8;     color: #1a2a4a; }

/* ── Profile page ────────────────────────────────────────────────────────────── */
.profile-header-box {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .8rem;
}
.profile-avatar {
  width: 256px;
  height: 256px;
  border-radius: 16px;
  background: var(--rating-bg);
  color: var(--gold-light);
  font-family: 'Slabo 27px', serif;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--gold);
  object-fit: cover;
}

/* Nav avatar thumbnail */
.nav-avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  vertical-align: middle;
  border: 1px solid var(--gold);
  flex-shrink: 0;
}
.nav-avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--rating-bg);
  color: var(--gold-light);
  font-family: 'Slabo 27px', serif;
  font-size: .62rem;
  font-weight: 600;
}
.nav-user-link { display: inline-flex; align-items: center; gap: .32rem; }

/* Review avatars */
.review-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}
.review-avatar-initial {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-table);
  color: var(--text-mid);
  font-family: 'Slabo 27px', serif;
  font-size: .9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-username {
  font-family: 'Slabo 27px', serif;
  font-size: 1.95rem;
  font-weight: 500;
}
.profile-meta { font-size: .82rem; color: var(--text-dim); font-family: 'Slabo 27px', serif; }
.profile-stats-row {
  display: flex;
  gap: 1.5rem;
  padding: .5rem .8rem;
  border-top: 1px solid var(--bg-table);
  flex-wrap: wrap;
}

/* ── Profile box (dark nav-bar theme) ───────────────────────────────────────── */
.profile-box {
  background: var(--nav-bg);
  border-color: #4a2a10;
}
.profile-box .profile-username { color: var(--gold-light); }
.profile-box .profile-meta { color: var(--nav-link); }
.profile-box .profile-meta strong { color: var(--gold-light); }
.profile-box .profile-stats-row { border-top-color: #4a2a10; }
.profile-box .stat-num { color: var(--gold-light); }
.profile-box .stat-label { color: var(--nav-link); }

/* ── Admin panel ─────────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  border-bottom: 2px solid var(--gold);
  margin-bottom: .8rem;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding-top: .3rem;
}
.admin-tab {
  font-family: 'Slabo 27px', serif;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .4rem .8rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-mid);
  transition: color .12s;
}
.admin-tab.active { border-bottom-color: var(--gold); color: var(--text); font-weight: 600; }
.admin-tab:hover { color: var(--link-hover); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* ── Index homepage ──────────────────────────────────────────────────────────── */
.home-hero {
  background: var(--nav-bg);
  border: 1px solid #4a2a10;
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
  color: var(--nav-link);
}
.home-hero-title {
  font-family: 'Slabo 27px', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: .04em;
  margin-bottom: .3rem;
}
.home-hero p { font-size: .92rem; color: #c0a070; margin-bottom: .5rem; }
.home-hero p:last-child { margin-bottom: 0; }

/* ── Misc ───────────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-style: italic;
  font-size: .9rem;
}
.breadcrumb {
  font-size: .8rem;
  color: var(--text-dim);
  margin-bottom: .6rem;
  font-family: 'Slabo 27px', serif;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--link-hover); }
.show-more {
  text-align: center;
  padding: .5rem;
  font-size: .82rem;
  color: var(--link);
  cursor: pointer;
  border-top: 1px solid var(--bg-table);
}
.show-more:hover { background: var(--bg-warm); text-decoration: none; }



/* ── Responsive / Dynamic Sizing ─────────────────────────────────────────── */

/* Fluid font sizing — scales smoothly between screen sizes */
html {
  font-size: clamp(24px, 2.2vw, 29px);
}

/* ── Navigation ─────────────────────────────────────────────────────────────── */
.site-header-inner {
  flex-wrap: nowrap;
  overflow-x: hidden;
}

.nav-search input {
  width: clamp(80px, calc(100vw - 820px), 320px);
}

/* Smooth continuous scaling from full size (~1400px) down to the mobile breakpoint (769px).
   Formulas are linear interpolations: clamp(min, slope·vw + intercept, max) */
.nav-link, .nav-link-user {
  font-size: clamp(.68rem, .355vw + .485rem, .84rem);
  padding:   0 clamp(.04rem, .53vw - 3.5px, .28rem);
}
.nav-sep { font-size: clamp(.58rem, .377vw + .393rem, .77rem); }
.site-brand {
  font-size:    clamp(.78rem, .377vw + .573rem, .95rem);
  margin-right: clamp(.1rem, .89vw - 5.4px, .5rem);
}
.nav-search input { font-size: clamp(.74rem, .178vw + .603rem, .82rem); }

/* ── Page wrapper ────────────────────────────────────────────────────────────── */
.page-wrap {
  padding: clamp(.5rem, 2vw, 1.5rem);
}

/* ── Content layout (main + sidebar) ─────────────────────────────────────────── */
.content-layout {
  grid-template-columns: 1fr 420px;
}

@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Data tables — horizontal scroll on small screens ────────────────────────── */
.box {
  overflow-x: auto;
}

.data-table {
  min-width: 480px;
}

/* Hide less important columns on small screens */
@media (max-width: 700px) {
  .data-table .hide-sm { display: none; }
}

/* ── Card entrance animation ─────────────────────────────────────────────────── */
@keyframes card-enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-enter {
  animation: card-enter 0.3s ease-out both;
  will-change: opacity, transform;
}

.dist-bar {
  height: 100%;
  border-radius: 2px;
  width: 0;
  transition: width .6s cubic-bezier(.25, .46, .45, .94);
}

@media (max-width: 500px) {
  .data-table .hide-xs { display: none; }
}

/* ── Cheese hero (image + info) ───────────────────────────────────────────────── */
.cheese-hero {
  grid-template-columns: clamp(120px, 25vw, 200px) 1fr;
}

.cheese-hero-img,
.cheese-hero-placeholder {
  width: clamp(120px, 25vw, 200px);
  height: clamp(120px, 25vw, 200px);
}

@media (max-width: 520px) {
  .cheese-hero {
    grid-template-columns: 1fr;
  }
  .cheese-hero-img,
  .cheese-hero-placeholder {
    width: 100%;
    height: 200px;
  }
}

/* ── Producer hero ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .producer-hero {
    grid-template-columns: 1fr;
  }
}

/* ── Rating slider ────────────────────────────────────────────────────────────── */
.score-slider-row {
  gap: clamp(.4rem, 2vw, .8rem);
}

.score-display {
  font-size: clamp(1rem, 4vw, 1.3rem);
  min-width: 36px;
}

/* ── Rate fields grid ─────────────────────────────────────────────────────────── */
.rate-fields-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

@media (max-width: 400px) {
  .review-row {
    grid-template-columns: 1fr;
  }
  .review-score-col {
    font-size: 1rem;
  }
}

/* ── Profile stats ────────────────────────────────────────────────────────────── */
.profile-stats-row {
  gap: clamp(.8rem, 3vw, 1.5rem);
}

.stat-num {
  font-size: clamp(.9rem, 3vw, 1.5rem);
}

/* ── Producer stats ───────────────────────────────────────────────────────────── */
.producer-stats {
  gap: clamp(.8rem, 3vw, 1.5rem);
}

/* ── Filter bar ───────────────────────────────────────────────────────────────── */
.filter-bar {
  gap: clamp(.3rem, 1.5vw, .5rem);
}

.filter-bar select,
.filter-bar input[type=text] {
  font-size: clamp(.78rem, 1.8vw, .9rem);
  padding: .2rem clamp(.3rem, 1vw, .4rem);
  max-width: 100%;
}

/* ── Home hero ────────────────────────────────────────────────────────────────── */
.home-hero {
  padding: clamp(.8rem, 2vw, 1.4rem);
}

.home-hero-title {
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
}

/* ── Page title bar ───────────────────────────────────────────────────────────── */
.page-title-bar h1 {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
}

/* ── Box header ───────────────────────────────────────────────────────────────── */
.box-title {
  font-size: clamp(.6rem, 1.5vw, .72rem);
}

/* ── Tags ─────────────────────────────────────────────────────────────────────── */
.tag {
  font-size: clamp(.58rem, 1.3vw, .65rem);
}

/* ── Buttons ──────────────────────────────────────────────────────────────────── */
.btn {
  padding: clamp(.25rem, 1vw, .35rem) clamp(.6rem, 2vw, .9rem);
  font-size: clamp(.82rem, 2vw, .92rem);
}

/* ── Auth / form pages ────────────────────────────────────────────────────────── */
.form-page {
  max-width: min(420px, 95vw);
  margin: clamp(1rem, 4vw, 2rem) auto;
  padding: 0 clamp(.5rem, 2vw, 1rem);
}

.form-row {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.form-row-3 {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* ── Admin panel ──────────────────────────────────────────────────────────────── */
.admin-tabs {
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  white-space: nowrap;
  font-size: clamp(.62rem, 1.5vw, .72rem);
  padding: .4rem clamp(.4rem, 1.5vw, .8rem);
}

/* ── Activity feed ────────────────────────────────────────────────────────────── */
.activity-item {
  font-size: clamp(.78rem, 2vw, .88rem);
  padding: clamp(.3rem, 1vw, .45rem) clamp(.4rem, 1.5vw, .7rem);
}

/* ── Producer rows ────────────────────────────────────────────────────────────── */
.producer-row-name {
  font-size: clamp(.82rem, 2vw, .95rem);
}

.producer-row-meta {
  font-size: clamp(.7rem, 1.8vw, .8rem);
}

/* ── Cheese info title ────────────────────────────────────────────────────────── */
.cheese-info-title {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
}


/* ── Request page ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #cheese-form .form-row,
  #cheese-form .form-row-3,
  #producer-form .form-row {
    grid-template-columns: 1fr;
  }
}

/* ── Charts page sidebar ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  #producer-tbody td:last-child,
  #producer-tbody td:nth-child(3) {
    display: none;
  }
}

/* ── Filter bar: hide labels on narrow screens (selects have placeholder text) ── */
@media (max-width: 600px) {
  .filter-bar label { display: none; }
}

/* ── Nav: allow wrapping to two lines on very small screens ───────────────────── */
@media (max-width: 400px) {
  .site-header-inner {
    height: auto;
    padding: .3rem 1rem;
    flex-wrap: wrap;
    gap: .2rem;
  }
}

/* ── Skeleton loaders ──────────────────────────────────────────────────────── */
@keyframes skel-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skel {
  display: block;
  background: linear-gradient(90deg, #ddd3ad 25%, #ede8cc 50%, #ddd3ad 75%);
  background-size: 1200px 100%;
  animation: skel-shimmer 1.4s infinite linear;
  border-radius: 4px;
}
.skel-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-warm);
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .7rem .25rem .25rem;
}

/* ── Site footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--nav-bg);
  border-top: 1px solid #4a2a10;
  margin-top: 2.5rem;
  padding: 1.8rem 0 1.4rem;
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}
.footer-brand {
  font-family: 'Slabo 27px', serif;
  font-size: 1.25rem;
  color: var(--gold-light);
  font-weight: 600;
  flex-shrink: 0;
}
.footer-section-title {
  font-family: 'Slabo 27px', serif;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: .35rem;
}
.footer-link {
  color: var(--nav-link);
  font-size: .88rem;
  text-decoration: none;
}
.footer-link:hover { color: var(--gold-light); }

@media (max-width: 768px) {
  .site-footer-inner { flex-direction: column; gap: 1.2rem; }
}

/* ── Search suggestions dropdown ──────────────────────────────────────────────── */
.nav-suggestions {
  position: fixed;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  z-index: 9999;
  overflow: hidden;
  min-width: 280px;
}
.nav-suggestion-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-table);
  text-decoration: none;
  color: var(--text);
}
.nav-suggestion-item:last-child { border-bottom: none; }
.nav-suggestion-item:hover { background: var(--bg-table); text-decoration: none; }
.nav-suggestion-icon { font-size: 1rem; flex-shrink: 0; }
.nav-suggestion-thumb {
  width: 36px;
  height: 36px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.nav-suggestion-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--bg-table);
}
.nav-suggestion-name {
  flex: 1;
  min-width: 0;
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-suggestion-meta {
  font-size: .75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.nav-suggestion-score {
  font-family: 'Slabo 27px', serif;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.nav-suggestion-divider {
  font-family: 'Slabo 27px', serif;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mid);
  padding: .25rem .75rem .1rem;
  background: var(--bg-table);
}

/* ── Hamburger / mobile menu ──────────────────────────────────────────────────── */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hamburger-btn .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--nav-link);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.18s ease;
  transform-origin: center;
  will-change: transform, opacity;
}
.hamburger-btn.open .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.open .bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger-btn.open .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  border-top: 1px solid #4a2a10;
  border-bottom: 2px solid var(--gold);
  z-index: 200;
  transform: translateY(-6px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.18s ease, opacity 0.18s ease, visibility 0s linear 0.18s;
  will-change: transform, opacity;
}
.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition: transform 0.18s ease, opacity 0.18s ease, visibility 0s linear 0s;
}
.mobile-menu a {
  display: block;
  padding: 0.7rem 1.2rem;
  color: var(--nav-link);
  font-family: 'Slabo 27px', serif;
  font-size: 1.05rem;
  border-bottom: 1px solid #3a1a06;
  text-decoration: none;
}
.mobile-menu a:hover {
  background: #4a2208;
  color: var(--gold-light);
  text-decoration: none;
}
.mobile-menu-sep {
  height: 1px;
  background: var(--gold);
  opacity: 0.35;
}
@media (max-width: 768px) {
  .hamburger-btn { display: flex; margin-left: auto; }
  .nav-link, .nav-sep { display: none !important; }
  #nav-user { display: none !important; }
  .site-header-inner { overflow: visible; }
  .brand-wordmark { display: none; }
  .nav-search { display: flex !important; flex: 1; margin: 0 .5rem; }
  .nav-search input { width: 100%; font-size: .84rem; }
}
