*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg: #faf9f7;
  --surface: #fff;
  --border: rgba(0,0,0,0.16);        /* inputs, buttons, card hover */
  --border-light: rgba(0,0,0,0.11);  /* card and section outlines */
  --text: #1a1208;
  --text-muted: #7a6f63;
  --text-hint: #b0a699;
  --accent: #c0614a;
  --accent-bg: rgba(192,97,74,0.08);
  --accent-border: rgba(192,97,74,0.25);
  --accent-solid: #c0614a;  /* accent behind white text (badges, avatar, CTA) */
  --hero-bg: #130805;
  --btn-bg: #130805;        /* primary buttons (Search, Log in, Post review…) */
  --btn-bg-hover: #2a1210;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --radius: 8px;
  --radius-lg: 12px;
  color-scheme: light;
}

/* Dark mode: set by theme.js (html[data-theme="dark"]). The nav and page banners are dark in both
   themes; everything else reads from these variables. */
:root[data-theme="dark"] {
  --bg: #15110f;
  --surface: #211b18;
  --border: rgba(255,255,255,0.12);
  --border-light: rgba(255,255,255,0.07);
  --text: #efe8e1;
  --text-muted: #a99d91;
  --text-hint: #918579;
  --accent: #e07f66;
  --accent-bg: rgba(224,127,102,0.12);
  --accent-border: rgba(224,127,102,0.35);
  --accent-solid: #a84f3b;
  --hero-bg: #0d0806;
  --btn-bg: #a84f3b;
  --btn-bg-hover: #93432f;
  --danger: #f87171;
  --danger-bg: #3a1a1a;
  --danger-border: rgba(248,113,113,0.35);
  color-scheme: dark;   /* native controls, scrollbars and dropdown lists go dark too */
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Nav */
.site-nav {
  background: var(--hero-bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 200;
}
.nav-inner {
  max-width: calc(1200px + 4rem);  /* 1200px of content + padding, matching .filter-inner */
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--accent-solid);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: #fff;
  font-weight: 500;
}
.nav-logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.01em;
}
.nav-logo-text em {
  font-style: italic;
  color: var(--accent);
}
/* Logged in: collapse the logo to the round V mark */
body.logged-in .nav-logo-text { display: none; }
body.logged-in .nav-logo-mark { border-radius: 50%; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-link {
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-link.active { color: #fff; }
.nav-link-cta {
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  margin-left: 8px;
}
.nav-link-cta:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.35); }
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  transition: all 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  background: var(--hero-bg);
  padding: 2.5rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, transparent, transparent 40px, rgba(192,97,74,0.04) 40px, rgba(192,97,74,0.04) 41px);
  pointer-events: none;
}
.hero-inner { max-width: 1200px; margin: 0 auto; position: relative; }
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  color: #fff;
  line-height: 1.15;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: 13px; color: rgba(255,255,255,0.55); margin-top: 0.4rem; }

/* Filter bar */
.filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

/* Centred inner container — matches results-area width */
.filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Search row */
.search-row { display: flex; gap: 8px; align-items: center; }
.search-input-wrap { flex: 1; position: relative; }
.search-input-wrap input[type="text"] { padding-left: 34px; }  /* beat the site-wide input[type="text"] padding below, so text clears the icon */
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-hint);
  pointer-events: none;
}

/* Filter dropdowns row */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.filter-group label {
  display: block;
  font-size: 10px;
  color: var(--text-hint);
  margin-bottom: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Form elements */
select, input[type="text"], input[type="number"], input[type="email"], input[type="password"] {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s;
}
select:focus, input:focus {
  outline: none;
  border-color: var(--accent);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-color: var(--bg);
  padding-right: 28px;
}

/* Buttons */
.btn-search {
  height: 36px;
  padding: 0 1.4rem;
  background: var(--btn-bg);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-search:hover { background: var(--btn-bg-hover); }
.btn-clear {
  height: 36px;
  padding: 0 1rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: border-color 0.15s;
  white-space: nowrap;
}
.btn-clear:hover { border-color: var(--accent); color: var(--accent); }

/* Active filter chips */
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  gap: 5px;
}
.chip-x { cursor: pointer; opacity: 0.6; font-size: 14px; line-height: 1; }
.chip-x:hover { opacity: 1; }

/* Results */
.results-area { max-width: calc(1200px + 4rem); margin: 0 auto; padding: 1.5rem 2rem 3rem; }  /* 1200px of content + padding, matching .filter-inner */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.results-count { font-size: 13px; color: var(--text-muted); }
.sort-wrap { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.sort-wrap select { width: auto; height: 30px; font-size: 12px; }

/* Wine grid — 3 columns */
.wine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.wine-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.wine-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.07);
}

/* Left image column */
.wine-card-image {
  width: 64px;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.wine-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.wine-card-image .bottle-icon { opacity: 0.18; }

/* Right content column */
.wine-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.wine-name {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
}
.wine-winery { font-size: 12px; color: var(--text-muted); }
.wine-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.wine-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.wine-card-rating {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  line-height: 1.1;
}
.wine-card-rating-score {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: var(--accent);
}
.wine-card-rating-count { font-size: 10px; color: var(--text-hint); white-space: nowrap; }
/* Tags on the left, like/list buttons level with them on the right */
.wine-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.wine-card-meta-row .wine-meta { margin-top: 0; min-width: 0; }
.wine-card-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  background: var(--bg);
}

/* States */
.loading, .empty-state, .error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  font-size: 14px;
}
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 2rem; }
.page-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--btn-bg); color: #fff; border-color: var(--btn-bg); }
.page-btn:disabled { opacity: 0.3; cursor: default; }

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  padding: 2rem;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px 6px;
}
.modal-close:hover { color: var(--text); }
.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 4px;
}
.modal-winery { font-size: 13px; color: var(--text-muted); margin-bottom: 1.25rem; }
.modal-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1.25rem; }
.modal-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.modal-badge.accent {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 500;
}
.modal-section { margin-bottom: 1rem; }
.modal-section h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-hint);
  font-weight: 500;
  margin-bottom: 4px;
}
.modal-section p { font-size: 14px; line-height: 1.65; color: var(--text-muted); }
.modal-divider { border: none; border-top: 1px solid var(--border-light); margin: 1rem 0; }

/* Vintage blocks in modal */
.vintage-block { padding: 4px 0; }
.vintage-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.vintage-year {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
  margin-right: 4px;
}
.vintage-price { font-size: 14px; font-weight: 500; color: var(--text); }
.vintage-alc { font-size: 12px; color: var(--text-muted); }
.current-release {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-weight: 500;
}
.palate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
  margin: 8px 0;
}
.palate-item {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 6px 8px;
  text-align: center;
}
.palate-item span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-hint);
  margin-bottom: 2px;
}
.palate-item strong { font-size: 12px; font-weight: 500; color: var(--text); }

/* Responsive */
@media (max-width: 900px) {
  .wine-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .hero { padding: 1.5rem 1rem 1.25rem; }
  .filter-bar { padding: 1rem; }
  .results-area { padding: 1rem 1rem 2rem; }
  .wine-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-inner { padding: 0 1rem; }
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--hero-bg);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 10px 12px; }
  .nav-link-cta { margin-left: 0; margin-top: 4px; text-align: center; }
}
/* ── Nav user button & dropdown ───────────────────────────────────── */
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  color: #fff;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  padding: 5px 10px 5px 6px;
  cursor: pointer;
  transition: background 0.15s;
  margin-left: 8px;
}
.nav-user-btn:hover { background: rgba(255,255,255,0.14); }
.nav-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-solid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  flex-shrink: 0;
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 180px;
  padding: 6px;
  z-index: 300;
}
.nav-dropdown.open { display: block; }
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.nav-dropdown-item:hover { background: var(--bg); }
.nav-dropdown-divider { border: none; border-top: 1px solid var(--border-light); margin: 4px 0; }
.nav-dropdown-signout { color: var(--text-muted); }
.nav-dropdown-signout:hover { color: var(--accent); }

/* ── Heart / like button ──────────────────────────────────────────── */
.like-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
  margin-left: auto;
}
.like-btn:hover { background: var(--accent-bg); transform: scale(1.1); }
.like-btn svg { pointer-events: none; }
.like-btn.liked svg { fill: var(--accent); stroke: var(--accent); }
.like-btn:not(.liked) svg { fill: none; stroke: var(--text-hint); }

/* Heart in modal header */
.modal-like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px 5px 8px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 8px;
}
.modal-like-btn:hover { border-color: var(--accent); color: var(--accent); }
.modal-like-btn.liked { background: var(--accent-bg); border-color: var(--accent-border); color: var(--accent); }
.modal-like-btn.liked svg { fill: var(--accent); }
.modal-like-btn svg { pointer-events: none; }

/* ── Auth modal ───────────────────────────────────────────────────── */
.auth-modal { max-width: 400px; }
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
  margin-bottom: -1px;
}
.auth-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-hint { font-size: 11px; font-weight: 400; color: var(--text-hint); }
.form-group input {
  height: 40px;
  font-size: 14px;
}
.auth-error {
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  display: none;
}
.auth-error.visible { display: block; }
.btn-auth {
  height: 42px;
  background: var(--btn-bg);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}
.btn-auth:hover { background: var(--btn-bg-hover); }
.btn-auth:disabled { opacity: 0.6; cursor: default; }

/* 404 page */
.not-found-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 1rem 0 3rem; }
.not-found-links .btn-auth { display: inline-flex; align-items: center; padding: 0 1.5rem; text-decoration: none; margin-top: 0; }

/* ── Liked wines modal ────────────────────────────────────────────── */
.liked-modal { max-width: 700px; }
.liked-wines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.liked-wine-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.liked-wine-card:hover { border-color: var(--border); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.liked-wine-card-image {
  width: 44px;
  height: 56px;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.liked-wine-card-image .bottle-icon { opacity: 0.18; }
.liked-wine-card-content { flex: 1; min-width: 0; }
.liked-wine-card-name {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.liked-wine-card-producer { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.liked-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 14px;
}
.liked-empty svg { opacity: 0.2; margin-bottom: 12px; }

/* ── List button on wine card ─────────────────────────────────────────────── */
.list-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: background 0.15s;
  color: var(--text-hint);
  flex-shrink: 0;
}
.list-btn:hover { background: var(--accent-bg); color: var(--accent); }

/* ── Modal list button ────────────────────────────────────────────────────── */
.modal-list-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px 5px 8px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 0;
  margin-left: 6px;
}
.modal-list-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── List picker modal ────────────────────────────────────────────────────── */
.list-picker-modal { max-width: 400px; }

.list-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.12s;
  margin-bottom: 6px;
  background: var(--bg);
}
.list-picker-item:hover { border-color: var(--accent); background: var(--accent-bg); }
.list-picker-item.in-list { border-color: var(--accent-border); background: var(--accent-bg); }

.list-picker-icon { font-size: 18px; flex-shrink: 0; }
.list-picker-name { flex: 1; font-size: 14px; color: var(--text); font-weight: 500; }
.list-picker-count { font-size: 12px; color: var(--text-muted); }
.list-picker-check {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.list-picker-new-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.list-picker-new-btn:hover { border-color: var(--accent); color: var(--accent); }
.list-picker-error { margin-top: 10px; font-size: 13px; color: var(--danger); }

/* Review form fields (wine page form + quick review on search) */
.review-form-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.review-field { display: flex; flex-direction: column; gap: 6px; }
.review-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.review-score-value {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--accent);
  margin-left: auto;
}
.review-score-max { font-size: 12px; color: var(--text-hint); }
.review-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}
.review-score-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-hint);
}
.review-field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 72px;
}
.review-field textarea:focus { outline: none; border-color: var(--accent); }
.review-char-count {
  font-size: 11px;
  color: var(--text-hint);
  text-align: right;
}
@media (max-width: 600px) {
  .review-form-row { grid-template-columns: 1fr; gap: 1rem; }
}

/* Wine card menu (Add to list / Quick review) */
.card-menu {
  position: fixed;
  z-index: 300;
  display: none;
  flex-direction: column;
  min-width: 170px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.card-menu.open { display: flex; }
.card-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.card-menu-item:hover, .card-menu-item:focus-visible { background: var(--accent-bg); color: var(--accent); outline: none; }

/* Quick review modal */
.quick-review-modal { max-width: 460px; }
.quick-review-modal .review-field + .review-field,
.quick-review-modal .review-form-row { margin-bottom: 0.75rem; }
.quick-review-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 0.75rem;
}
.quick-review-actions .btn-auth { padding: 0 1.5rem; }
.quick-review-link { font-size: 13px; color: var(--accent); text-decoration: none; }
.quick-review-link:hover { text-decoration: underline; }

/* List icon dropdown */
.icon-select {
  width: 68px;
  flex-shrink: 0;
  font-size: 18px;
  padding-left: 10px;
  cursor: pointer;
}
.icon-select-lg { width: 76px; height: 44px; font-size: 20px; }

/* Dark mode switch (profile dropdown) */
.theme-toggle .theme-switch {
  position: relative;
  width: 28px;
  height: 16px;
  margin-left: auto;
  border-radius: 8px;
  background: var(--border);
  transition: background 0.15s;
  flex-shrink: 0;
}
.theme-toggle .theme-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transition: transform 0.15s;
}
.theme-toggle[aria-checked="true"] .theme-switch { background: var(--accent); }
.theme-toggle[aria-checked="true"] .theme-switch::after { transform: translateX(12px); }

/* Producer and region names that link to their pages */
.place-link { color: inherit; text-decoration: none; }
.place-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Member photos inside the round initial badges (nav, reviews, profile, shared lists) */
.has-photo { overflow: hidden; background: var(--bg); }
.has-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* Number of bottles: − [n] + (cellar pop-up and My Cellar rows) */
.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
  height: 36px;
}
.qty-btn {
  width: 32px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.qty-btn:hover:not(:disabled) { color: var(--accent); background: var(--accent-bg); }
.qty-btn:disabled { opacity: 0.35; cursor: default; }
.qty-stepper input[type="number"] {
  width: 52px;
  height: auto;
  border: none;
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  -moz-appearance: textfield;
}
.qty-stepper input[type="number"]::-webkit-outer-spin-button,
.qty-stepper input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper:focus-within { border-color: var(--accent); }
.qty-stepper input[type="number"]:focus { outline: none; }

/* Add to cellar pop-up */
.cellar-modal { max-width: 420px; }
.cellar-form-row { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.cellar-form-row .review-field:first-child { flex: 1; }
.cellar-done-text { font-size: 14px; line-height: 1.6; margin: 0.5rem 0 1rem; }

/* Grape tag on a search card that opens the variety page */
a.tag-link { text-decoration: none; transition: border-color 0.15s, color 0.15s; }
a.tag-link:hover { border-color: var(--accent); color: var(--accent); }

/* Suggest a wine / producer (suggest.js) */
.suggest-modal { max-width: 460px; }
.suggest-intro { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 1.25rem; }
.suggest-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.suggest-modal .form-group select { height: 40px; font-size: 14px; }
.suggest-modal textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.suggest-modal textarea:focus { outline: none; border-color: var(--accent); }
.suggest-modal .auth-error a { color: inherit; font-weight: 500; }
.suggest-login-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.suggest-done p { font-size: 14px; line-height: 1.6; color: var(--text-muted); margin-bottom: 0.75rem; }
.suggest-done strong { color: var(--text); font-weight: 500; }
.suggest-done .btn-auth { width: 100%; }
.suggest-line { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 2rem; }
.suggest-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.empty-state .suggest-btn { margin-top: 0.75rem; }
@media (max-width: 600px) { .suggest-row { grid-template-columns: 1fr; } }

/* Email links: confirm email, reset password (account.html) */
.account-card { max-width: 420px; padding: 1rem 0 3rem; }
.account-status { font-size: 15px; line-height: 1.6; color: var(--text-muted); margin-bottom: 1.25rem; }
.account-status strong { color: var(--text); font-weight: 500; }
.account-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.account-links[hidden] { display: none; }
.account-links .btn-auth { display: inline-flex; align-items: center; padding: 0 1.5rem; text-decoration: none; margin-top: 0; }
.auth-forgot { align-self: flex-end; background: none; border: none; padding: 0; margin-top: -8px; font: inherit; font-size: 12px; color: var(--text-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.auth-forgot:hover { color: var(--accent); }
.verify-banner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; padding: 9px 16px; font-size: 13px; background: linear-gradient(var(--accent-bg), var(--accent-bg)), var(--surface); color: var(--text); border-bottom: 1px solid var(--accent-border);  /* solid: the home page behind it is dark */ text-align: center; }
.verify-banner[hidden] { display: none; }
.verify-banner button { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.verify-banner button:disabled { color: var(--text-muted); text-decoration: none; cursor: default; }

/* Password strength meter (password-meter.js) */
.pw-meter { --pw-weak: #b91c1c; --pw-fair: #b45309; --pw-good: #4d7c0f; --pw-strong: #15803d;
  display: flex; align-items: center; gap: 10px; margin-top: 2px; }
:root[data-theme="dark"] .pw-meter { --pw-weak: #f87171; --pw-fair: #fbbf24; --pw-good: #a3e635; --pw-strong: #4ade80; }
.pw-meter-bar { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pw-meter-bar span { height: 4px; border-radius: 2px; background: var(--border-light); transition: background 0.15s; }
.pw-meter-label { min-width: 56px; text-align: right; font-size: 11px; font-weight: 500; color: var(--text-muted); }
.pw-meter[data-level="1"] .pw-meter-bar span:nth-child(-n+1) { background: var(--pw-weak); }
.pw-meter[data-level="2"] .pw-meter-bar span:nth-child(-n+2) { background: var(--pw-fair); }
.pw-meter[data-level="3"] .pw-meter-bar span:nth-child(-n+3) { background: var(--pw-good); }
.pw-meter[data-level="4"] .pw-meter-bar span { background: var(--pw-strong); }
.pw-meter[data-level="1"] .pw-meter-label { color: var(--pw-weak); }
.pw-meter[data-level="2"] .pw-meter-label { color: var(--pw-fair); }
.pw-meter[data-level="3"] .pw-meter-label { color: var(--pw-good); }
.pw-meter[data-level="4"] .pw-meter-label { color: var(--pw-strong); }
.pw-rules { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0; margin: 2px 0 0; font-size: 11px; color: var(--text-muted); }
.pw-rules li::before { content: '○'; margin-right: 4px; }
.pw-rules li.met { color: var(--text); }
.pw-rules li.met::before { content: '✓'; color: #15803d; font-weight: 600; }
:root[data-theme="dark"] .pw-rules li.met::before { color: #4ade80; }
