@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=IBM+Plex+Mono:wght@400;500;600&family=Cinzel:wght@600&display=swap');

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --bg:       #f2ede3;
  --bg-warm:  #ece6d8;
  --bg-table: #e8e2d4;
  --nav-bg:   #1c110a;
  --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; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1rem;
  line-height: 1.55;
}
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);
}
.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: 'Cinzel', 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: 'EB Garamond', 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: 'IBM Plex Mono', monospace;
  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;
}
.nav-search input {
  background: #2c1c0a;
  border: 1px solid #5a3a20;
  color: #d4b888;
  padding: .2rem .5rem;
  font-family: 'EB Garamond', serif;
  font-size: .82rem;
  border-radius: 2px;
  width: 160px;
}
.nav-search input::placeholder { color: #6a4a2a; }
.nav-search input:focus { outline: none; border-color: var(--gold); }

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

/* 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: white;
  border: 1px solid var(--border);
  border-radius: 2px;
  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: 'IBM Plex Mono', monospace;
  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(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: .6rem .9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
}
.page-title-bar h1 {
  font-family: 'EB Garamond', serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}
.page-title-bar .subtitle {
  font-size: .88rem;
  color: var(--text-mid);
}

/* ── 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: 'IBM Plex Mono', monospace;
  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: 'IBM Plex Mono', monospace;
  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: 'IBM Plex Mono', monospace;
  font-size: .88rem;
  font-weight: 600;
  color: var(--gold);
  text-align: right;
  white-space: nowrap;
}
.data-table .count-cell {
  font-family: 'IBM Plex Mono', monospace;
  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: 'IBM Plex Mono', monospace;
  font-size: .65rem;
  font-weight: 500;
  padding: .1rem .38rem;
  border-radius: 2px;
  border: 1px solid var(--border);
  white-space: nowrap;
  text-decoration: none;
}
.tag:hover { background: var(--border); text-decoration: none; color: var(--text); }
.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: 'IBM Plex Mono', monospace;
  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: 'IBM Plex Mono', monospace;
  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;
}

/* Compact inline rating badge */
.score-badge {
  font-family: 'IBM Plex Mono', monospace;
  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: 'EB Garamond', 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: 140px 1fr;
  gap: 1rem;
  padding: .8rem;
  align-items: start;
}
@media (max-width: 500px) { .producer-hero { grid-template-columns: 1fr; } }
.producer-hero-img {
  width: 140px;
  height: 100px;
  object-fit: cover;
  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: 'EB Garamond', 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: 'IBM Plex Mono', monospace;
  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: 'IBM Plex Mono', monospace;
}

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

/* ── Rating form ─────────────────────────────────────────────────────────────── */
.rate-section { padding: .8rem; }
.rate-section h3 {
  font-family: 'IBM Plex Mono', monospace;
  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;
  background: linear-gradient(to right, var(--gold) 0%, var(--gold) calc((var(--val, 50) - 1) / 9 * 100%), var(--bg-table) calc((var(--val, 50) - 1) / 9 * 100%), var(--bg-table) 100%);
  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(--gold);
  border: 2px solid var(--bark);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform .1s, box-shadow .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(--gold);
  border: 2px solid var(--bark);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.score-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .62rem;
  color: var(--text-dim);
  padding: 0 .1rem;
  margin-top: .2rem;
}
.score-display {
  font-family: 'IBM Plex Mono', monospace;
  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: 'IBM Plex Mono', monospace;
  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: 'EB Garamond', 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: 'IBM Plex Mono', monospace;
  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: 'EB Garamond', 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: 2px;
  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 1fr;
  gap: .5rem .7rem;
}
.review-row:last-child { border-bottom: none; }
.review-score-col {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gold);
  min-width: 40px;
  text-align: right;
  padding-top: .1rem;
}
.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: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  color: var(--text-dim);
}
.review-stars { font-size: .85rem; color: var(--gold); }
.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: 'IBM Plex Mono', monospace;
  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; }
.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;
}
.activity-text { flex: 1; line-height: 1.4; }
.activity-score {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .78rem;
  font-weight: 600;
  color: var(--gold);
  flex-shrink: 0;
}
.activity-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .65rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ── Producers grid ─────────────────────────────────────────────────────────── */
.producers-list { }
.producer-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .45rem .7rem;
  border-bottom: 1px solid var(--bg-table);
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}
.producer-row:last-child { border-bottom: none; }
.producer-row:hover { background: var(--bg-warm); text-decoration: none; }
.producer-row-logo {
  width: 56px;
  height: 56px;
  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.3rem;
}
.producer-row-name { font-weight: 500; font-size: .95rem; }
.producer-row-meta { font-size: .8rem; color: var(--text-mid); }
.producer-row-stats {
  margin-left: auto;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.producer-row-stats .avg { color: var(--gold); font-weight: 600; font-size: .85rem; }

/* ── Forms (auth + admin) ───────────────────────────────────────────────────── */
.form-page {
  max-width: 420px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.form-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.form-box-header {
  background: var(--bg-table);
  border-bottom: 1px solid var(--border);
  padding: .5rem .8rem;
  font-family: 'IBM Plex Mono', monospace;
  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: 'IBM Plex Mono', monospace;
  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: 2px;
  font-family: 'EB Garamond', 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: 'EB Garamond', 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-row { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* ── 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: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--rating-bg);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--gold);
}
.profile-username {
  font-family: 'EB Garamond', serif;
  font-size: 1.3rem;
  font-weight: 500;
}
.profile-meta { font-size: .82rem; color: var(--text-dim); font-family: 'IBM Plex Mono', monospace; }
.profile-stats-row {
  display: flex;
  gap: 1.5rem;
  padding: .5rem .8rem;
  border-top: 1px solid var(--bg-table);
  flex-wrap: wrap;
}

/* ── Admin panel ─────────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: .8rem;
}
.admin-tab {
  font-family: 'IBM Plex Mono', monospace;
  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: 2px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
  color: var(--nav-link);
}
.home-hero-title {
  font-family: 'Cinzel', 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: 'IBM Plex Mono', monospace;
}
.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: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.site-header-inner::-webkit-scrollbar { display: none; }

.nav-search input {
  width: clamp(80px, 15vw, 200px);
}

/* Hide some nav links on very small screens, keep brand + user */
@media (max-width: 500px) {
  .nav-search { display: none; }
  .nav-sep    { display: none; }
}

/* ── 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; }
}

@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));
}

/* ── Review rows ──────────────────────────────────────────────────────────────── */
.review-row {
  grid-template-columns: 40px 1fr;
  gap: .4rem .5rem;
}

@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);
}

/* ── Rating number ────────────────────────────────────────────────────────────── */
.rating-num {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
}

/* ── 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;
  }
}