/* Wine DB — New Theme */

/* ── Design tokens ─────────────────────────────────────── */
:root {
  --clr-burgundy:    #8B1A2F;
  --clr-burgundy-dk: #6E1425;
  --clr-burgundy-md: #A83245;
  --clr-cream:       #F8F4EF;
  --clr-gold:        #C9A06B;
  --clr-gold-dk:     #a0824a;
  --clr-gold-lt:     #e8d5a8;

  /* Status colours */
  --clr-status-red:   #dc3545;
  --clr-status-amber: #f0ad4e;
  --clr-status-green: #28a745;
  --clr-status-grey:  #6c757d;
  --clr-status-blue:  #1D5FA0;

  /* Typography */
  --font-serif: Georgia, "Times New Roman", serif;

  /* Spacing / radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-card: 10px;
  --radius-lg:   12px;

  /* Shadows (burgundy-tinted) */
  --shadow-sm: 0 1px 6px rgba(139,26,47,0.07);
  --shadow-md: 0 2px 12px rgba(139,26,47,0.08);
  --shadow-lg: 0 4px 20px rgba(139,26,47,0.14);

  /* Pico overrides */
  --pico-primary:               var(--clr-gold);
  --pico-primary-hover:         var(--clr-gold-dk);
  --pico-primary-focus:         rgba(201,160,107,0.25);
  --pico-background-color:      var(--clr-cream);
  --pico-card-background-color: #ffffff;
}

/* ── Pico CSS specificity fix ───────────────────────────
   Pico sets --pico-primary: #0172ad inside [data-theme="light"],
   which wins over :root. Override with equal specificity here.   */
[data-theme="light"],
[data-theme="light"] *,
:root {
  --pico-primary:                          var(--clr-burgundy);
  --pico-primary-hover:                    var(--clr-burgundy-dk);
  --pico-primary-focus:                    rgba(139,26,47,0.25);
  --pico-form-element-active-border-color: var(--clr-burgundy);
  --pico-form-element-focus-color:         rgba(139,26,47,0.25);
  --pico-outline-color:                    var(--clr-burgundy);
  --pico-color:                            #333333;
  --pico-h1-color:                         var(--clr-burgundy);
}

@media (prefers-color-scheme: dark) {
  /* Guard matches Pico's own pattern — skipped when data-theme="light" is set */
  :root:not([data-theme="light"]) {
    --pico-background-color:      #120808;
    --pico-card-background-color: #1e0e0e;
    --clr-cream:                  #120808;
  }

  :root:not([data-theme="light"]) .ideal-buy-card {
    background: var(--pico-card-background-color);
  }
}

/* ── Direct button/submit overrides (beat Pico's [data-theme] rules) */
button[type="submit"]:not(.sidebar-signout):not(.pairing-fav-btn):not(.wishlist-add-btn),
input[type="submit"],
[type="submit"]:not(.sidebar-signout):not(.pairing-fav-btn):not(.wishlist-add-btn) {
  background-color: var(--clr-burgundy) !important;
  border-color:     var(--clr-burgundy) !important;
  color:            #fff !important;
}
button[type="submit"]:not(.sidebar-signout):not(.pairing-fav-btn):not(.wishlist-add-btn):hover,
input[type="submit"]:hover,
[type="submit"]:not(.sidebar-signout):not(.pairing-fav-btn):not(.wishlist-add-btn):hover {
  background-color: var(--clr-burgundy-dk) !important;
  border-color:     var(--clr-burgundy-dk) !important;
}

/* ── Body font ──────────────────────────────────────────── */
body {
  font-family: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.6;
}

/* ── Global link colour override ───────────────────────── */
a { color: var(--clr-burgundy); }
a:hover { color: var(--clr-burgundy-dk); }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
}

h1 {
  color: var(--clr-burgundy);
}

.sidebar-brand span {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.sidebar-brand-img {
  width: 140px;
  height: auto;
  display: block;
  /* Render dark burgundy ink as cream on the burgundy sidebar */
  filter: brightness(0) invert(1) sepia(0.2) saturate(0.6);
}

hgroup p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--pico-muted-color);
}

/* ── App shell ──────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: 200px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background: linear-gradient(180deg, var(--clr-burgundy) 0%, var(--clr-burgundy-dk) 100%);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.main-wrapper {
  flex: 1;
  margin-left: 200px;
  min-width: 0;
}

.sidebar-brand {
  padding: 1.5rem 1rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--clr-gold);
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  min-height: 44px;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover,
.nav-item:focus {
  background: rgba(255, 255, 255, 0.08);
  color: var(--clr-gold);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.35rem;
}

.sidebar-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--clr-gold);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0;
}

.sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.sidebar-signout {
  background: none !important;
  border: none !important;
  color: rgba(255,255,255,0.55) !important;
  cursor: pointer;
  width: 100%;
  text-align: left;
  padding: 0.25rem 0;
  font-size: 0.82rem;
  margin: 0.25rem 0 0;
  transition: color 0.15s;
}
.sidebar-signout:hover {
  color: rgba(255,255,255,0.9) !important;
  background: none !important;
}

.nav-item-add {
  display: block;
  text-align: center;
  padding: 0.6rem 1rem;
  background: var(--clr-gold);
  color: var(--clr-burgundy);
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  line-height: 1.8;
  transition: background 0.15s;
}

.nav-item-add:hover,
.nav-item-add:focus {
  background: var(--clr-gold-dk);
  color: #fff;
}

.theme-toggle {
  display: block;
  text-align: center;
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75em;
  text-decoration: none;
  padding: 0.4rem;
  min-height: 44px;
  line-height: 2.5;
}

.theme-toggle:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ── Mobile top bar ─────────────────────────────────────── */
.mobile-top-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  /* Grow to accommodate the iPhone status bar */
  height: calc(52px + env(safe-area-inset-top, 0px));
  background: white;
  border-bottom: 1px solid #ece8e4;
  z-index: 90;
  align-items: flex-end;  /* pin brand/avatar to bottom of bar, above safe area */
  justify-content: space-between;
  padding: 0 1rem calc(8px);
  padding-top: env(safe-area-inset-top, 0px);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.mobile-top-bar-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--clr-burgundy);
  letter-spacing: 0.01em;
}
.mobile-avatar-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--clr-burgundy);
  color: white;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  min-height: unset;
  flex-shrink: 0;
}

/* ── Avatar bottom sheet ────────────────────────────────── */
.mobile-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s;
}
.mobile-sheet-overlay.open {
  display: block;
  opacity: 1;
}
.mobile-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-radius: 20px 20px 0 0;
  z-index: 201;
  padding-bottom: env(safe-area-inset-bottom, 16px);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.mobile-sheet.open {
  transform: translateY(0);
}
.mobile-sheet-handle {
  width: 40px; height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 14px auto 0;
}
.mobile-sheet-user {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.25rem 0.9rem;
  border-bottom: 1px solid #f3f4f6;
}
.mobile-sheet-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--clr-burgundy);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 700;
  flex-shrink: 0;
}
.mobile-sheet-name { font-weight: 600; font-size: 0.92rem; color: #111; }
.mobile-sheet-email { font-size: 0.78rem; color: #6b7280; margin-top: 1px; }
.mobile-sheet-items { padding: 0.4rem 0 0.5rem; }
.mobile-sheet-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.25rem;
  color: #1f2937;
  text-decoration: none;
  font-size: 0.95rem;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
  min-height: unset;
}
.mobile-sheet-item:hover,
.mobile-sheet-item:active { background: #f9fafb; }
.mobile-sheet-item--danger { color: #dc2626; }

/* ── Bottom tab bar (mobile only) ───────────────────────── */
.bottom-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(68px + env(safe-area-inset-bottom, 0px));
  background: var(--clr-burgundy);
  border-top: 1px solid var(--clr-burgundy-md);
  z-index: 100;
  overflow: visible;
  align-items: flex-end;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  /* Force GPU compositing layer — prevents iOS Safari from dropping
     the bar off-screen when the dynamic address bar animates */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
  /* Ensure it always paints above scroll content */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.78em;
  gap: 3px;
  padding-bottom: 0;
  transition: color 0.15s;
}

.tab-item:hover,
.tab-item:focus {
  color: rgba(255, 255, 255, 0.9);
}

.tab-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 3px 10px;
  transition: background 0.15s;
}

.tab-item--active {
  color: var(--clr-gold) !important;
}
.tab-item--active .tab-icon-wrap {
  background: rgba(255, 255, 255, 0.13);
}

/* ── Raised Scan FAB ─────────────────────────────────────── */
.tab-item--scan {
  position: relative;
  justify-content: flex-end;
  padding-bottom: 0;
}
.scan-fab {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(38%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 -3px 14px rgba(139, 26, 47, 0.22), 0 4px 10px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-burgundy);
  transition: box-shadow 0.15s, transform 0.15s;
}
.tab-item--scan.tab-item--active .scan-fab {
  box-shadow: 0 -3px 14px rgba(139, 26, 47, 0.22), 0 4px 10px rgba(0, 0, 0, 0.12), 0 0 0 3px var(--clr-gold);
  color: var(--clr-burgundy);
}
.tab-item--scan .scan-label {
  font-size: 0.78em;
  padding-bottom: 0;
  margin-top: 2px;
}
.tab-item--scan.tab-item--active .scan-label {
  color: var(--clr-gold);
}

.tab-item-add {
  background: var(--clr-gold);
  color: var(--clr-burgundy);
  font-size: 1.5em;
  font-weight: 700;
}

.tab-item-add:hover,
.tab-item-add:focus {
  background: var(--clr-gold-dk);
  color: #fff;
}

/* ── Home screen hero ───────────────────────────────────── */
.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding: 2rem 2rem 2rem 0;
  border-bottom: 1px solid rgba(201,166,107,0.2);
}

.home-title {
  font-size: 2rem;
  font-family: var(--font-serif);
  color: var(--clr-burgundy);
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.home-sub {
  color: var(--pico-muted-color);
  margin: 0 0 1.25rem;
  font-size: 1rem;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 600;
}

/* Primary: gold fill */
.hero-actions a:not(.outline) {
  background: var(--clr-gold);
  border-color: var(--clr-gold);
  color: #fff;
}

.hero-actions a:not(.outline):hover {
  background: var(--clr-gold-dk);
  border-color: var(--clr-gold-dk);
  color: #fff;
}

/* Secondary: burgundy outline */
.hero-actions a.outline {
  background: transparent;
  border-color: var(--clr-burgundy);
  color: var(--clr-burgundy);
}

.hero-actions a.outline:hover {
  background: rgba(139,26,47,0.06);
  border-color: var(--clr-burgundy);
  color: var(--clr-burgundy);
}

/* ── Feature quick-link cards ───────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--pico-card-background-color);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(201,166,107,0.18);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--clr-gold);
  transform: translateY(-2px);
}

.feature-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--clr-burgundy), var(--clr-burgundy-md));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-gold);
  flex-shrink: 0;
}

.feature-card strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--clr-burgundy);
  margin-bottom: 0.3rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.82em;
  color: var(--pico-muted-color);
  line-height: 1.5;
}

/* ── Stat cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--pico-card-background-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--clr-gold);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

/* Status-tinted left borders */
.stat-card-red   { border-left-color: var(--clr-status-red); }
.stat-card-amber { border-left-color: var(--clr-status-amber); }
.stat-card-green { border-left-color: var(--clr-status-green); }
.stat-card-grey  { border-left-color: var(--clr-status-grey); }

.stat-label {
  font-size: 13px;
  color: var(--pico-muted-color);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.stat-number {
  font: 700 1.875rem var(--font-serif);
  line-height: 1;
  color: var(--clr-burgundy);
  margin-bottom: 0.3rem;
}

/* Number colour matches status */
.stat-card-red   .stat-number { color: #c0392b; }
.stat-card-amber .stat-number { color: #b7770d; }
.stat-card-green .stat-number { color: #1e7e34; }
.stat-card-grey  .stat-number { color: #555; }

.stat-sublabel {
  font-size: 12px;
  color: var(--pico-muted-color);
}

/* ── Action lists ───────────────────────────────────────── */
.action-lists {
  margin-bottom: 2rem;
}

.action-section {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
  background: var(--pico-card-background-color);
  box-shadow: var(--shadow-sm);
}

.action-section-red {
  border-left: 4px solid var(--clr-status-red);
}

.action-section-amber {
  border-left: 4px solid var(--clr-status-amber);
}

.action-header {
  padding: 0.6rem 1rem;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-section-red .action-header   { color: #991b1b; }
.action-section-amber .action-header { color: #92400e; }

.action-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.action-dot-red   { background: var(--clr-status-red); }
.action-dot-amber { background: var(--clr-status-amber); }

.action-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
  transition: background 0.1s;
}

.action-section-red .action-row:hover   { background: #fee2e2; }
.action-section-amber .action-row:hover { background: #fef3c7; }

.action-section-red .action-row + .action-row   { border-top: 1px solid #fecaca; }
.action-section-amber .action-row + .action-row { border-top: 1px solid #fde68a; }

.action-vintage {
  font-variant-numeric: tabular-nums;
  color: var(--pico-muted-color);
  flex-shrink: 0;
  min-width: 2.5em;
}

.action-name {
  flex: 1;
  font-weight: 500;
}

.action-count {
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 0.1em 0.6em;
  font-size: 0.85em;
  font-weight: 600;
  min-width: 1.5em;
  text-align: center;
}

/* ── Chart section ──────────────────────────────────────── */
.chart-section {
  margin-bottom: 2rem;
}

/* ── Wine cards ─────────────────────────────────────────── */
.wine-cards {
  display: none;
}

.wine-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.wine-card article {
  margin-bottom: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-card);
  border: 1px solid rgba(201, 166, 107, 0.2);
  box-shadow: var(--shadow-sm);
}

.wine-card strong {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.2rem;
}

.wine-card small {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  line-height: 1.4;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.card-qty {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--pico-muted-color);
}

.card-score {
  font-size: 0.82rem;
  color: var(--clr-gold-dk);
  font-weight: 600;
  margin-top: 0.2rem;
}

/* ── Status badges ──────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
  white-space: nowrap;
}

.badge-red   { background: var(--clr-status-red);   color: #fff; }
.badge-amber { background: var(--clr-status-amber); color: #000; }
.badge-green { background: var(--clr-status-green); color: #fff; }
.badge-grey  { background: var(--clr-status-blue);   color: #fff; }

.badge-lg {
  font-size: 1.1em;
  padding: 0.3em 0.8em;
}

/* ── Wine detail ────────────────────────────────────────── */
.detail-status {
  margin: 1rem 0;
}

.detail-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.btn-consume {
  min-height: 44px;
  font-size: 1em;
  font-weight: 600;
  white-space: nowrap;
}

/* Qty stepper: [− qty +] grouped as one control */
.qty-stepper {
  display: inline-flex !important;
  align-items: stretch;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 6px;
  overflow: hidden;
  gap: 0 !important;
}

.btn-qty {
  min-height: 44px;
  min-width: 40px;
  padding: 0 0.875rem;
  font-size: 1.15em;
  font-weight: 700;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  margin: 0;
  color: inherit;
}

.btn-qty:hover:not([disabled]) { background: var(--pico-muted-background-color); }
.btn-qty:disabled { opacity: 0.35; cursor: default; }

.qty-label {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-size: 0.95em;
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
  border-left: 1px solid var(--pico-muted-border-color);
  border-right: 1px solid var(--pico-muted-border-color);
  min-width: 90px;
  justify-content: center;
}

.detail-table td:first-child {
  width: 160px;
  color: var(--pico-muted-color);
  font-size: 0.9em;
}

/* ── Wine detail: unified action area ──────────────────── */
.detail-action-area {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.75rem 0 1.25rem;
}

.detail-action-row1 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.detail-action-secondary-group {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
  flex: 1;
}

.detail-action-secondary-group .inline-form {
  display: flex;
  align-items: stretch;
  flex: 1;
}

.detail-btn-uncork {
  width: 100%;
}

/* ── Desktop overrides (≥ 768px) ────────────────────────── */
@media (min-width: 768px) {
  .detail-action-row1 {
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .detail-action-secondary-group {
    flex: 0 0 auto;
  }

  .detail-action-secondary-group .inline-form {
    flex: 0 0 auto;
  }

  .detail-btn-secondary,
  .detail-btn-enrich {
    flex: 0 0 auto;
    width: auto;
  }

  .detail-btn-uncork {
    width: auto;
    align-self: flex-start;
    min-width: 180px;
    padding: 0 2.5rem !important;
  }
}

.detail-btn-primary {
  background: var(--clr-gold);
  border: none;
  color: #fff;
  font-weight: 600;
  height: 44px !important;
  min-height: unset !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 1.5rem !important;
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  line-height: 1;
}

.detail-btn-primary:hover {
  background: var(--clr-gold-dk);
  border-color: var(--clr-gold-dk);
  color: #fff;
}

.detail-btn-secondary {
  background: transparent;
  border: 1.5px solid var(--clr-burgundy);
  color: var(--clr-burgundy);
  font-weight: 600;
  height: 44px !important;
  min-height: unset !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 1.25rem !important;
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  flex: 1;
  box-sizing: border-box;
  line-height: 1;
}

.detail-btn-secondary:hover {
  background: rgba(139,26,47,0.06);
  color: var(--clr-burgundy);
}

/* Enrich with AI — gold star accent, gold border */
.detail-btn-enrich {
  background: transparent;
  border: 1.5px solid var(--clr-gold);
  color: var(--clr-burgundy);
  font-weight: 700;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 1.1rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
  cursor: pointer;
  flex: 1;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.detail-btn-enrich:hover {
  background: rgba(201,160,107,0.1);
  border-color: var(--clr-gold-dk);
  color: var(--clr-burgundy);
}

.detail-btn-enrich:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.detail-action-area .inline-form {
  display: flex;
  align-items: stretch;
}

.detail-delete-zone {
  margin: 2rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(139,26,47,0.1);
}

.detail-btn-danger {
  background: transparent;
  border: 1.5px solid #dc3545;
  color: #dc3545;
  font-weight: 600;
  min-height: 44px;
  padding: 0 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  width: auto;
}

.detail-btn-danger:hover {
  background: rgba(220,53,69,0.06);
  color: #dc3545;
}

.detail-actions-secondary {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.detail-actions-secondary > a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  white-space: nowrap;
}

.detail-actions-secondary > .inline-form {
  display: flex;
  align-items: stretch;
}

.detail-actions-secondary > .inline-form > button {
  min-height: 44px;
  white-space: nowrap;
}

/* ── Active nav states ──────────────────────────────────── */
.nav-item--active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--clr-gold) !important;
}

/* ── Filter / search bar ────────────────────────────────── */
.filter-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  background: var(--pico-card-background-color);
  border: 1px solid rgba(201, 166, 107, 0.3);
  border-radius: 4px;
}

.filter-sep {
  color: var(--pico-muted-color);
}

.filter-bar {
  margin-bottom: 1.5rem;
}

.filter-bar select {
  min-height: 44px;
}

/* ── Filter form with collapsible drawer ────────────────── */
.filter-form {
  margin-bottom: 1.5rem;
}

.filter-top-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.filter-search {
  flex: 1;
  min-width: 140px;
  margin: 0;
  height: 44px !important;
  min-height: unset !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-sizing: border-box !important;
  line-height: 44px !important;
}

.wines-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.wines-add-btn {
  background: var(--clr-gold) !important;
  border-color: var(--clr-gold) !important;
  color: #fff !important;
  font-weight: 600;
  height: 36px !important;
  min-height: unset !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 1rem !important;
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.88rem;
  flex-shrink: 0;
  box-sizing: border-box;
  line-height: 1;
}

.wines-add-btn:hover {
  background: var(--clr-gold-dk) !important;
  border-color: var(--clr-gold-dk) !important;
  color: #fff !important;
}

.filter-search-btn {
  flex: 0 0 auto;
  width: auto !important;
  min-height: unset !important;
  height: 44px !important;
  margin: 0;
  white-space: nowrap;
  background: var(--clr-burgundy) !important;
  border-color: var(--clr-burgundy) !important;
  color: #fff !important;
  padding: 0 1.1rem !important;
  box-sizing: border-box;
}

.filter-form {
  margin-bottom: 1rem;
}

/* Desktop: drawer always open, inline */
@media (min-width: 769px) {
  .filter-toggle { display: none; }
  details.filter-drawer { display: contents; }
  .filter-drawer-body {
    display: flex !important;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
  }
  .filter-drawer-body select {
    width: auto !important;
    min-width: 130px;
    margin: 0;
  }
}

/* Mobile: collapsible drawer */
@media (max-width: 768px) {
  details.filter-drawer { width: 100%; }
  .filter-toggle {
    list-style: none;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--pico-border-color);
    border-radius: var(--pico-border-radius);
    font-size: 0.9rem;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .filter-drawer-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0 0.25rem;
  }
  .filter-drawer-body select { margin: 0; }
}

.log-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  margin: 0;
  font-weight: normal;
}

.log-filter-chip input[type="checkbox"] {
  min-height: unset;
  width: 1rem;
  height: 1rem;
  margin: 0;
}

/* ── Form actions ───────────────────────────────────────── */
.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.form-actions button,
.form-actions a {
  min-height: 44px;
}

/* ── Food pairing checkboxes ────────────────────────────── */
.pairing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.pairing-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9em;
  min-height: unset;
  cursor: pointer;
}

.pairing-check input[type="checkbox"] {
  min-height: unset;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ── Food pairing tags ──────────────────────────────────── */
.pairing-tags {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(201, 166, 107, 0.3);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.badge-pairing {
  background: rgba(201,166,107,0.15);
  color: var(--clr-burgundy);
  border: 1px solid rgba(201,166,107,0.4);
  font-weight: 500;
}

/* ── Pairing planner ────────────────────────────────────── */
.pairing-page {
  max-width: 680px;
}

.pairing-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pairing-hero-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.pairing-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--clr-burgundy);
  margin: 0 0 0.2rem;
}

.pairing-subtitle {
  color: var(--pico-muted-color);
  font-size: 0.95rem;
  margin: 0;
}

.pairing-form-card {
  background: #fff;
  border: 1px solid rgba(139,26,47,0.12);
  border-radius: var(--radius-lg);
  padding: 1rem 1rem 0.85rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.pairing-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--clr-burgundy);
  margin-bottom: 0.85rem;
}

.pairing-label textarea {
  margin-top: 0.4rem;
  font-weight: normal;
  color: inherit;
}

.pairing-filter-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
  margin-bottom: 1rem;
  overflow: hidden;
}

.pairing-filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pico-muted-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.pairing-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px; /* prevent clipping descenders on scroll */
}
.pairing-chips::-webkit-scrollbar { display: none; }

.pairing-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
  font-weight: normal;
}

.pairing-chip input[type="radio"] {
  display: none;
}

.pairing-chip span {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(139,26,47,0.25);
  font-size: 0.85rem;
  color: var(--clr-burgundy);
  background: #fff;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.pairing-chip input[type="radio"]:checked + span {
  background: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
  color: var(--clr-cream);
}

.pairing-chip:hover span {
  border-color: var(--clr-burgundy);
  background: rgba(139,26,47,0.06);
}

.pairing-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--clr-gold);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.6rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  width: auto;
}

.pairing-btn:hover:not(:disabled) {
  background: var(--clr-gold-dk);
}

.pairing-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.pairing-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--clr-burgundy);
  margin: 1.5rem 0 0.75rem;
}

.pairing-section-title svg {
  color: var(--clr-gold);
  flex-shrink: 0;
}

.pairing-pick {
  margin-bottom: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-card);
  border: 1px solid rgba(139,26,47,0.1);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.pairing-pick-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

.pairing-pick-meta {
  color: var(--pico-muted-color);
  font-size: 0.85em;
  display: block;
  margin-bottom: 0.5rem;
}

.pairing-pick-reason {
  color: var(--pico-muted-color);
  font-size: 0.9em;
  margin: 0;
  line-height: 1.5;
}

.ideal-buy-card {
  background: var(--clr-cream);
  border: 1px solid var(--clr-gold);
  border-radius: var(--radius-card);
}

.ideal-buy-title {
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--clr-gold-lt);
}

.pairing-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.75rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(139,26,47,0.1);
}

.pairing-sort {
  min-height: unset;
  padding: 0.3rem 0.6rem;
  font-size: 0.85em;
  border-radius: var(--radius-sm);
}

.pairing-history-card {
  margin-bottom: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-card);
  border: 1px solid rgba(139,26,47,0.1);
  background: #fff;
}

.pairing-history-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.pairing-history-date {
  color: var(--pico-muted-color);
  font-size: 0.8em;
}

.pairing-history-meal {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.pairing-history-pick {
  color: var(--pico-muted-color);
  font-size: 0.82em;
}

.pairing-delete-btn {
  background: none;
  border: 1px solid rgba(139,26,47,0.2);
  color: var(--pico-muted-color);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  line-height: 1.4;
  min-height: unset;
  width: auto;
  transition: border-color 0.15s, color 0.15s;
}

.pairing-delete-btn:hover {
  border-color: var(--clr-burgundy);
  color: var(--clr-burgundy);
  background: none;
}

/* ── Loading spinner ────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  vertical-align: -0.15em;
  margin-right: 0.4em;
}

/* ── Touch targets ──────────────────────────────────────── */
button, select, input[type="submit"], [role="button"],
.nav-item, .tab-item, .action-row {
  min-height: 44px;
}

input, select, textarea {
  font-size: 16px; /* Prevent iOS zoom on focus */
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .mobile-top-bar {
    display: flex;
  }

  .main-wrapper {
    margin-left: 0;
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  main.container {
    padding-top: 0.5rem;
  }

  .bottom-tab-bar {
    display: flex;
  }

  .home-hero {
    padding: 1.25rem 0 1.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .home-title {
    font-size: 1.5rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
  }

  .feature-card {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .stat-card {
    padding: 0.85rem 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  main.container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 1rem;
  }

  /* Switch from table to cards */
  .wine-table {
    display: none;
  }

  .wine-cards {
    display: block;
  }

  .btn-consume {
    width: 100%;
  }

  .detail-btn-danger {
    width: 100%;
  }

  .detail-actions {
    flex-wrap: wrap;
  }

  .detail-actions-secondary {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-actions-secondary a,
  .detail-actions-secondary button {
    width: 100%;
  }

  /* Full-width form actions */
  .form-actions {
    flex-direction: column;
  }

  .form-actions button,
  .form-actions a {
    width: 100%;
    text-align: center;
  }

  /* Compact footer */
  footer.container {
    padding: 0.5rem 0.75rem;
  }

  /* Action rows */
  .action-row {
    padding: 0.4rem 0.75rem;
  }

  .action-lists {
    margin-bottom: 1rem;
  }
}

/* ── Admin / Settings shared ─────────────────────────────── */

.admin-top-bar {
  background: var(--clr-burgundy);
  color: white;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-top-bar h1 {
  color: white;
  margin: 0;
  font-size: 1.15rem;
  font-family: var(--font-serif);
}

.admin-section-header {
  background: var(--pico-muted-background-color);
  padding: 0.35rem 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--pico-muted-color);
  text-transform: uppercase;
  margin: 1.5rem 0 0.6rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.admin-stat-grid {
  display: grid;
  gap: 1px;
  background: var(--pico-muted-border-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.admin-stat-card {
  background: white;
  padding: 1rem 0.75rem;
  text-align: center;
}

.admin-stat-number {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-blue   { color: #2563eb; }
.stat-green  { color: #16a34a; }
.stat-orange { color: #d97706; }

.admin-stat-label {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-suggestion-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
  gap: 0.75rem;
}

.admin-badge {
  background: #f97316;
  color: white;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* Settings top bar (uses header template so sits inside main) */
.settings-top-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.settings-title {
  margin: 0;
  font-size: 1.6rem;
}

.settings-back {
  font-size: 0.9rem;
  color: var(--pico-muted-color);
  text-decoration: none;
}

.settings-back:hover { text-decoration: underline; }

/* Dashboard chart section */
.chart-section {
  margin: 1.5rem 0;
}

.analysis-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.analysis-table-wrap h3 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pico-muted-color);
  margin: 0 0 0.4rem;
}

.analysis-table-wrap table {
  width: 100%;
  font-size: 0.85rem;
}

.analysis-table-wrap th {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  font-weight: 600;
  text-align: right;
  padding-right: 0.5rem;
}

.analysis-table-wrap th:first-child {
  text-align: left;
}

.analysis-table-wrap td:last-child {
  text-align: right;
  color: var(--pico-muted-color);
}

/* Wine detail card sections */
.detail-back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--pico-muted-color);
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.detail-back:hover { text-decoration: underline; }

.detail-section-card {
  margin-bottom: 0.75rem;
}

.detail-section-card header {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pico-muted-color);
}

/* Scan step labels */
.scan-step-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pico-muted-color);
  margin: 0.75rem 0 0.25rem;
}

.scan-step-label:first-of-type {
  margin-top: 0;
}

/* ── Label scan illustration (shared: assess + add wine) ── */
.assess-illus {
  text-align: center;
  margin: 0.25rem 0 1.5rem;
  padding: 1rem 0 0.25rem;
}

/* Tappable illustration wrapper */
.illus-tap-btn {
  display: inline-block;
  position: relative;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}
.illus-tap-btn:active .assess-illus-svg { opacity: 0.85; transform: scale(0.97); }
.illus-tap-btn .assess-illus-svg { transition: opacity 0.12s, transform 0.12s; }

/* "Tap to scan" badge overlaid on illustration */
.illus-tap-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  background: var(--clr-burgundy);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 20px;
  box-shadow: 0 3px 10px rgba(139,26,47,0.35);
  white-space: nowrap;
  pointer-events: none;
  animation: illus-pulse 2.4s ease-in-out infinite;
}
@keyframes illus-pulse {
  0%, 100% { box-shadow: 0 3px 10px rgba(139,26,47,0.35); }
  50%       { box-shadow: 0 4px 18px rgba(139,26,47,0.55); transform: translateX(-50%) translateY(-2px); }
}
.assess-illus-svg {
  width: 100%;
  max-width: 260px;
  height: auto;
}
.assess-illus-caption {
  font-size: 0.88rem;
  color: var(--pico-muted-color);
  margin: 0.4rem 0 0;
  line-height: 1.5;
}
@keyframes assess-scan {
  0%   { transform: translateY(-38px); opacity: 0; }
  12%  { opacity: 0.5; }
  50%  { transform: translateY(38px); opacity: 0.45; }
  88%  { opacity: 0; }
  100% { transform: translateY(-38px); opacity: 0; }
}
.assess-scan-line { animation: assess-scan 2.8s ease-in-out infinite; }
@keyframes assess-pulse {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50%       { opacity: 0.9; transform: scale(1.6); }
}
.assess-dot { animation: assess-pulse 2.2s ease-in-out infinite; }
.assess-dot-1 { animation-delay: 0s; }
.assess-dot-2 { animation-delay: 0.75s; }
.assess-dot-3 { animation-delay: 1.5s; }

/* ── Label upload card buttons ─────────────────────────── */
.assess-upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0;
}
.assess-upload-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.9rem 0.5rem;
  background: transparent;
  border: 1.5px solid var(--clr-burgundy);
  border-radius: var(--radius-md);
  color: var(--clr-burgundy);
  cursor: pointer;
  width: 100%;
  margin: 0;
  transition: background 0.15s;
}
.assess-upload-btn:hover { background: rgba(139,26,47,0.05); }
.assess-upload-btn.ready { background: rgba(139,26,47,0.08); }
.assess-upload-label { font-size: 0.9rem; font-weight: 600; }
.assess-upload-hint  { font-size: 0.78rem; color: var(--pico-muted-color); font-weight: 400; }
.assess-upload-btn.ready .assess-upload-hint { color: var(--clr-burgundy); font-weight: 600; }

/* ── Scan action button ─────────────────────────────────── */
.btn-scan {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #e8e0d8;
  border: 1.5px solid #ccc4b8;
  border-radius: var(--radius-md);
  color: #a09080;
  font-size: 1rem;
  font-weight: 600;
  cursor: not-allowed;
  margin: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-scan:not(:disabled) {
  background: var(--clr-burgundy) !important;
  border-color: var(--clr-burgundy) !important;
  color: #fff !important;
  cursor: pointer !important;
}
.btn-scan:not(:disabled):hover {
  background: var(--clr-burgundy-dk) !important;
  border-color: var(--clr-burgundy-dk) !important;
}

/* Star rating (log-bottle form) */
.star-rating {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.star-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  gap: 0.1rem;
}
.star-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.star-label .star {
  font-size: 1.6rem;
  color: #d1d5db;
  transition: color 0.15s;
  line-height: 1;
}
.star-label:hover .star,
.star-label input[type="radio"]:checked ~ .star {
  color: var(--clr-gold);
}
.star-label .star-num {
  font-size: 0.65rem;
  color: var(--pico-muted-color);
}

/* ── Install / Add-to-Home-Screen banner ────────────────── */
.install-banner {
  position: fixed;
  bottom: calc(68px + env(safe-area-inset-bottom, 0px)); /* sits above mobile tab bar */
  left: 0;
  right: 0;
  z-index: 98;
  background: var(--clr-burgundy-dk);
  color: #fff;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.25);
  /* hidden by default; shown by JS */
}

.install-banner-body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.install-banner-icon {
  flex-shrink: 0;
  color: var(--clr-gold);
  display: flex;
  align-items: center;
}

.install-banner-text {
  flex: 1;
  min-width: 0;
}

.install-banner-text strong {
  display: block;
  font-size: 0.88rem;
  font-family: var(--font-serif);
  color: var(--clr-gold);
  line-height: 1.3;
}

.install-banner-text span {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.4;
}

.install-banner-cta {
  flex-shrink: 0;
  background: var(--clr-gold);
  color: var(--clr-burgundy);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  min-height: unset;
  white-space: nowrap;
}

.install-banner-cta:hover { background: var(--clr-gold-dk); color: #fff; }

.install-banner-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  min-height: unset;
  line-height: 1;
}

.install-banner-close:hover { color: #fff; }

/* On desktop: anchor to bottom (no tab bar), max-width centred */
@media (min-width: 769px) {
  .install-banner {
    bottom: 0;
    left: 200px; /* clear sidebar */
  }
}

/* ── Alert / notice blocks ──────────────────────────────── */
.alert-past-peak {
  background: #fef2f2;
  border-left: 3px solid var(--clr-status-red);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
}
.alert-past-peak p { margin: 0; }

.alert-success {
  background: #f0fdf4;
  border-left: 3px solid var(--clr-status-green);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
}
.alert-success p { margin: 0; color: #15803d; }

.alert-warning {
  background: #fff7ed;
  border-left: 3px solid var(--clr-status-amber);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
}
.alert-warning p { margin: 0; color: #92400e; }

/* ── Assess critique section ────────────────────────────── */
.critique-section {
  border-top: 1px solid var(--pico-muted-border-color);
  padding-top: 1rem;
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}
.critique-flags {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}
.critique-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  padding: 0.3rem 0;
  color: var(--pico-color);
}
.critique-highlight-item::before {
  content: '\25CF';
  color: var(--clr-status-green);
  font-size: 0.6rem;
  margin-top: 0.3em;
  flex-shrink: 0;
}
.critique-flag-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  padding: 0.3rem 0;
  color: #92400e;
}
.critique-flag-item::before {
  content: '\25CF';
  color: var(--clr-status-amber);
  font-size: 0.6rem;
  margin-top: 0.3em;
  flex-shrink: 0;
}
.critique-contrarian {
  margin: 0;
  padding: 0.65rem 1rem;
  background: var(--pico-muted-background-color);
  border-left: 3px solid var(--pico-muted-border-color);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--pico-muted-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Welcome / onboarding modal ─────────────────────────── */
.welcome-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.welcome-modal {
  background: var(--pico-card-background-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.welcome-modal h2 {
  font-family: var(--font-serif);
  color: var(--clr-burgundy);
  margin: 0 0 0.5rem;
}

.welcome-modal-divider {
  border-top: 1px solid var(--pico-muted-border-color);
  padding-top: 1rem;
  margin-bottom: 0.75rem;
}

/* ── Dashboard section header ───────────────────────────── */
.section-header-muted {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pico-muted-color);
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--pico-muted-background-color);
}

/* ── Settings: Install App section ─────────────────────── */
.install-instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.install-platform {
  background: var(--pico-muted-background-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.install-platform-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pico-muted-color);
  margin-bottom: 0.6rem;
}

.install-steps {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.85rem;
  line-height: 1.8;
}

.install-share-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 0.1em;
  color: var(--clr-burgundy);
}

/* ── Tasting profile nudge card ─────────────────────────── */
.nudge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.nudge-card strong { color: #92400e; font-size: 0.9rem; display: block; }
.nudge-card p { margin: 0.2rem 0 0; font-size: 0.82rem; color: #b45309; }

/* ── Dashboard two-zone layout ──────────────────────────── */
.dash-zone-header {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pico-muted-color);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--pico-muted-background-color);
}

.dash-zone-header--manage {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-add-wine-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--clr-burgundy, #722f37);
  text-decoration: none;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--clr-burgundy, #722f37);
  border-radius: 20px;
  letter-spacing: 0.01em;
  transition: background 0.15s, color 0.15s;
  text-transform: none;
}

.dash-add-wine-btn:hover {
  background: var(--clr-burgundy, #722f37);
  color: #fff;
}

/* Action cards — mobile-first (stacked list) */
.action-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--pico-muted-border-color);
  text-decoration: none;
  color: inherit;
  min-height: 68px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.action-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 10px 0 0 10px;
}

.action-card:hover {
  background: var(--pico-muted-background-color);
  border-color: var(--pico-muted-color);
  text-decoration: none;
  color: inherit;
}

.action-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-card-body {
  flex: 1;
  min-width: 0;
}

.action-card-body strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  line-height: 1.2;
}

.action-card-body p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  line-height: 1.35;
}

.action-card-arrow {
  color: var(--pico-muted-color);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Colour accents per card type */
.action-card--label .action-card-icon {
  background: #fef3c7;
  color: #92400e;
}
.action-card--label::before { background: #f59e0b; }

.action-card--menu .action-card-icon {
  background: #ecfdf5;
  color: #065f46;
}
.action-card--menu::before { background: #10b981; }

.action-card--pairing .action-card-icon {
  background: transparent;
  overflow: visible;
}
.action-card--pairing::before { background: var(--clr-burgundy); }

/* Desktop: 3-column grid with vertical card layout */
@media (min-width: 640px) {
  .action-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .action-card {
    flex-direction: column;
    align-items: flex-start;
    min-height: 130px;
    padding: 1.1rem 1rem 1rem;
    gap: 0.65rem;
  }

  .action-card::before {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: 3px;
    border-radius: 10px 10px 0 0;
  }

  .action-card-arrow {
    display: none;
  }

  .action-card-body strong {
    font-size: 0.9rem;
  }
}

/* ── Dashboard welcome strip ────────────────────────────── */
.dash-welcome {
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--pico-muted-background-color);
}

.dash-welcome-title {
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

.dash-welcome-sub {
  color: var(--pico-muted-color);
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .dash-welcome-title {
    font-size: 1.9rem;
  }
}

/* ── Unified page header ────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header--split {
  justify-content: space-between;
}

.page-header-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.page-header h1 {
  font-size: 1.6rem;
  color: var(--clr-burgundy);
  margin: 0 0 0.15rem;
  line-height: 1.2;
}

.page-header-sub {
  color: var(--pico-muted-color);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.45;
}

/* ── Cellar view pills ──────────────────────────────────── */
.cellar-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 1rem;
  align-items: center;
}

.cellar-pill {
  display: inline-block;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--pico-muted-border-color);
  color: var(--pico-muted-color);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.cellar-pill:hover {
  border-color: var(--clr-burgundy);
  color: var(--clr-burgundy);
}

.cellar-pill--active {
  background: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
  color: #fff !important;
}

/* Push "By Location" to the right on wide screens */
.cellar-pill--location { margin-left: auto; }
@media (max-width: 600px) { .cellar-pill--location { margin-left: 0; } }

/* Location group headers */
.location-group-header {
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-burgundy);
  margin: 1.5rem 0 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(139,26,47,0.15);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.location-group-count {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--pico-muted-color);
}

/* ── Bulk location select ───────────────────────────────── */
.wines-select-btn {
  font-size: 0.85rem;
  padding: 0 0.75rem;
  height: 36px;
  border: 1px solid rgba(139,26,47,0.35);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--clr-burgundy);
  font-weight: 600;
  cursor: pointer;
  width: auto;
  min-height: unset;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.wines-select-btn--active {
  background: var(--clr-burgundy);
  color: #fff;
  border-color: var(--clr-burgundy);
}

/* Checkbox circle overlaid on each card */
.wine-card-check {
  display: none;
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(139,26,47,0.3);
  background: #fff;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.selection-mode .wine-card { position: relative; }
.selection-mode .wine-card-check { display: block; }

.wine-card--selected .wine-card-check {
  background: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
}
.wine-card--selected .wine-card-check::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 7px;
  height: 11px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.wine-card--selected article {
  border-color: var(--clr-burgundy);
  background: rgba(139,26,47,0.04);
}
.selection-mode .wine-card article { padding-left: 2.75rem; }

/* "Select all" per location group */
.location-select-all {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--clr-burgundy);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
  width: auto;
  min-height: unset;
  display: none;
}
.selection-mode .location-select-all { display: inline; }

/* Desktop table checkbox column */
.col-check { width: 2rem; }
.table-wine-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--clr-burgundy);
}

/* Bulk action bar — replaces bottom nav in selection mode */
.bulk-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: var(--clr-burgundy);
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.22s ease;
  z-index: 150;
}
.bulk-action-bar--visible { transform: translateY(0); }

/* Hide bottom nav when bulk bar is active */
.bottom-tab-bar { transition: opacity 0.22s ease; }
.selection-mode .bottom-tab-bar { opacity: 0; pointer-events: none; }

.bulk-bar-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  padding: 0 0.75rem;
  height: 100%;
  width: 100%;
  margin: 0;
}

#bulk-ids { display: none; }

/* Hide Add Wine button in selection mode */
.selection-mode .wines-add-btn { display: none; }

.bulk-count {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Custom location picker */
.bulk-loc-btn {
  flex: 1;
  min-width: 0;
  height: 36px !important;
  min-height: unset !important;
  background: #fff !important;
  color: #8B1A2F !important;
  border: none !important;
  border-radius: 6px;
  padding: 0 0.5rem !important;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.25rem;
  overflow: hidden;
  width: auto;
}
.bulk-loc-btn span { color: #8B1A2F; }
.bulk-loc-arrow { font-size: 0.7rem; flex-shrink: 0; }

.bulk-loc-menu {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 -2px 24px rgba(0,0,0,0.22);
  z-index: 300;
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}
.bulk-loc-opt {
  display: block !important;
  width: 100% !important;
  min-height: unset !important;
  height: auto !important;
  padding: 0.85rem 1rem !important;
  background: #fff !important;
  color: #1a1a1a !important;
  border: none !important;
  border-bottom: 1px solid #f0eaea !important;
  text-align: left !important;
  font-size: 0.95rem;
  cursor: pointer;
}
.bulk-loc-opt:last-child { border-bottom: none !important; }
.bulk-loc-opt:active,
.bulk-loc-opt:hover { background: #fdf4f5 !important; }

.bulk-move-btn {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  background: #fff !important;
  color: var(--clr-burgundy) !important;
  border: none !important;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  width: auto !important;
  min-height: unset;
}
.bulk-cancel-btn {
  flex-shrink: 0;
  width: 32px !important;
  height: 32px !important;
  min-height: unset !important;
  border-radius: 50%;
  background: rgba(255,255,255,0.15) !important;
  border: none !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ── Forgot My Readers Mode ─────────────────────────────── */
@media (max-width: 768px) {
  html.readers-mode {
    font-size: 125%; /* 16px → 20px; all rem cascade automatically */
  }
  /* Tab label guard — prevent overflow at larger root size */
  html.readers-mode .tab-item {
    font-size: 0.7em;
  }
}

/* Toggle row in avatar sheet */
.readers-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
}
.readers-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.readers-toggle-icon { color: #374151; flex-shrink: 0; display: flex; align-items: center; }
.readers-toggle-text { display: flex; flex-direction: column; gap: 3px; }
.readers-toggle-text strong { font-size: 0.92rem; color: #111827; font-weight: 600; }
.readers-toggle-text small   { font-size: 0.75rem; color: #6b7280; }

/* Pill toggle switch */
.pill-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.pill-switch input {
  opacity: 0; width: 0; height: 0; position: absolute;
}
.pill-switch-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.25);
  border-radius: 13px;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}
.pill-switch-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.pill-switch input:checked + .pill-switch-track {
  background: var(--clr-gold);
}
.pill-switch input:checked + .pill-switch-track::after {
  transform: translateX(20px);
}

/* ── Mobile UX improvements ─────────────────────────────── */

/* 1A: Mobile font floor — no text below 0.82rem on small screens */
@media (max-width: 768px) {
  .tab-item          { font-size: 0.82rem; }
  .hint-chip         { font-size: 0.82rem; }
  .stat-label        { font-size: 0.82rem; }
  .badge             { font-size: 0.88rem; }
  .small-help        { font-size: 0.82rem; }
}

/* 2A: Assess step progress — dot stepper */
.assess-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 1.5rem;
  gap: 0;
}
.assess-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
}
.assess-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5e7eb;
  border: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #9ca3af;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.assess-step--active .assess-step-dot {
  background: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
  color: #fff;
}
.assess-step-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #9ca3af;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.assess-step--active .assess-step-label {
  color: var(--clr-burgundy);
}
.assess-step-line {
  height: 2px;
  width: 44px;
  background: #e5e7eb;
  flex-shrink: 0;
  margin-top: 10px; /* aligns with dot centre */
}

/* 2C: Back link for non-settings pages */
.page-back-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  color: var(--pico-muted-color);
  text-decoration: none;
  margin-bottom: 0.75rem;
}
.page-back-link:hover { text-decoration: underline; }

/* 2D: Hold-to-confirm button */
.hold-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.hold-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.25);
  transform: scaleX(0);
  transform-origin: left;
  transition: none;
  z-index: 0;
  border-radius: inherit;
}
.hold-btn.holding::after {
  transform: scaleX(1);
  transition: transform 2s linear;
}
.hold-btn > * {
  position: relative;
  z-index: 1;
}
.hold-btn-hint {
  font-size: 0.78rem;
  color: var(--pico-muted-color);
  margin-top: 0.35rem;
}
.hold-text-fallback {
  margin-top: 0.75rem;
}
.hold-text-fallback-link {
  font-size: 0.82rem;
  color: var(--pico-muted-color);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
}

/* 2E: Welcome modal onboarding cards */
.welcome-cards {
  display: flex;
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.25rem;
}
.welcome-card {
  flex: 0 0 auto;
  width: 130px;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.85rem 0.75rem;
  scroll-snap-align: start;
  text-align: center;
}
.welcome-card-icon { font-size: 1.6rem; margin-bottom: 0.4rem; line-height: 1; }
.welcome-card-title { font-size: 0.85rem; font-weight: 700; color: #111827; margin-bottom: 0.2rem; }
.welcome-card-sub   { font-size: 0.78rem; color: #6b7280; line-height: 1.4; }

/* ── Quick-action strip ──────────────────────────────────────── */
.quick-actions-intro {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.92rem; font-style: italic; font-weight: 400;
  color: var(--pico-muted-color); line-height: 1.4;
  margin: 0 0 0.65rem;
  padding-left: 0.65rem;
  border-left: 2px solid #C9A66B;
}
.quick-actions {
  display: flex; gap: 0.55rem;
  margin: 0.25rem 0 1.5rem;
}
.quick-action {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  gap: 0.55rem; padding: 0.85rem 0.4rem 0.7rem;
  border: 1px solid rgba(139,26,47,0.22); border-radius: 12px;
  text-decoration: none; color: #8B1A2F;
  background: white;
  box-shadow: 0 1px 5px rgba(139,26,47,0.07);
  transition: transform 0.13s, box-shadow 0.13s, border-color 0.13s;
  -webkit-tap-highlight-color: transparent;
}
.quick-action:hover,
.quick-action:active {
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(139,26,47,0.15);
  border-color: rgba(139,26,47,0.5);
  text-decoration: none; color: #8B1A2F;
}
.quick-action-icon {
  display: flex; align-items: center; justify-content: center;
  height: 44px; flex-shrink: 0;
}
.quick-action-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: #8B1A2F;
  text-align: center; line-height: 1.2;
}

/* ── Cellar hero card ─────────────────────────────────────────── */
.cellar-hero {
  background: linear-gradient(135deg, #6E1425 0%, #8B1A2F 60%, #A32038 100%);
  border-radius: 14px;
  padding: 1.25rem 1.5rem 1.1rem;
  margin-bottom: 1.25rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cellar-hero::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(201,166,107,0.1);
  pointer-events: none;
}
.cellar-hero-stats { display: flex; gap: 2rem; margin-bottom: 1rem; }
.cellar-hero-stat-label {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: rgba(255,255,255,0.88); margin-bottom: 0.2rem;
}
.cellar-hero-stat-number {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.25rem; font-weight: 700; line-height: 1; color: #E2C99A;
}
.cellar-health-bar {
  display: flex; height: 11px; border-radius: 6px;
  overflow: hidden; background: rgba(255,255,255,0.15);
  margin-bottom: 0.65rem; gap: 2px;
}
.cellar-health-segment { height: 100%; border-radius: 5px; }
.cellar-health-legend { display: flex; flex-wrap: wrap; gap: 0.45rem 1rem; }
.cellar-health-legend-item {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; color: rgba(255,255,255,0.88);
}
.cellar-health-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Urgency badges in action rows ───────────────────────────── */
.action-urgency {
  flex-shrink: 0;
  font-size: 0.8rem; font-weight: 700;
  padding: 0.2em 0.55em; border-radius: 9px; white-space: nowrap;
}
.action-urgency-red   { background: #fee2e2; color: #7F1D1D; }
.action-urgency-amber { background: #fef3c7; color: #78350F; }

/* ── Recently Opened section ─────────────────────────────────── */
.action-section-teal { border-left: 4px solid #0891b2; }
.action-dot-teal     { background: #0891b2; }
.action-section-teal .action-row:hover { background: #ecfeff; }
.action-meta { font-size: 0.85rem; color: var(--pico-muted-color); flex-shrink: 0; }

/* ── Cellar CTA row ──────────────────────────────────────────── */
.cellar-cta-row { display: flex; gap: 0.65rem; margin: 1rem 0 1.5rem; }
.cellar-cta-row a {
  flex: 1; text-align: center; margin: 0;
  font-size: 0.88rem; padding: 0.55rem 0.75rem; min-height: 42px;
}
/* Force burgundy brand colors regardless of Pico theme resolution order */
.cellar-cta-row a[role="button"]:not(.secondary) {
  background: #8B1A2F; border-color: #8B1A2F; color: #fff;
}
.cellar-cta-row a[role="button"]:not(.secondary):hover {
  background: #6E1425; border-color: #6E1425;
}
.cellar-cta-row a[role="button"].secondary.outline {
  background: transparent; border-color: #8B1A2F; color: #8B1A2F;
}
.cellar-cta-row a[role="button"].secondary.outline:hover {
  background: rgba(139,26,47,0.06);
}

/* ── Compact scan pills ──────────────────────────────────────── */
.scan-pills { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1.25rem; }
.scan-pill {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1rem; border-radius: 10px;
  border: 1px solid var(--pico-muted-border-color);
  text-decoration: none; color: inherit;
  font-size: 0.95rem; font-weight: 500; min-height: 52px;
  transition: background 0.12s, border-color 0.12s;
  background: var(--pico-card-background-color);
}
.scan-pill:hover {
  background: var(--pico-muted-background-color);
  border-color: var(--pico-muted-color);
  text-decoration: none; color: inherit;
}
.scan-pill-icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.scan-pill-label { flex: 1; }
.scan-pill-hint { font-size: 0.85rem; color: var(--pico-muted-color); font-weight: 400; display: block; }
.scan-pill-arrow { color: var(--pico-muted-color); flex-shrink: 0; font-size: 1.1rem; }

/* ── Collection Insights panel ──────────────────────────────── */
.insights-panel {
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(139,26,47,0.09), 0 1px 4px rgba(0,0,0,0.05);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.insights-panel-header {
  padding: 0.85rem 1rem 0.7rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.insights-panel-title {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--pico-muted-color);
  margin-bottom: 0.65rem;
}
.insights-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Bleed to panel edges so pills don't get clipped */
  margin: 0 -1rem;
  padding: 0 1rem 0.5rem;
}
.insights-tabs::-webkit-scrollbar { display: none; }
.insights-tab {
  font-size: 0.88rem; font-weight: 600;
  padding: 0.55rem 1rem; border-radius: 22px; min-height: 44px;
  border: 1.5px solid rgba(139,26,47,0.25);
  background: transparent; color: var(--pico-muted-color);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
  display: inline-flex; align-items: center;
}
.insights-tab.active,
.insights-tab:hover {
  background: #8B1A2F; color: white; border-color: #8B1A2F;
}
.insights-group { padding: 0.75rem 1rem 0.85rem; display: none; }
.insights-group.active { display: block; }
.insights-group-label {
  font-size: 0.63rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--pico-muted-color); margin-bottom: 0.65rem;
}
.insights-bar-row {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.45rem; min-height: 26px;
}
.insights-bar-label {
  font-size: 0.9rem; min-width: 95px; max-width: 95px; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--pico-color); font-weight: 500; text-decoration: none;
}
.insights-bar-label:hover { color: #8B1A2F; text-decoration: none; }
.insights-bar-track {
  flex: 1; height: 11px; border-radius: 6px;
  background: var(--pico-muted-background-color); position: relative; overflow: hidden;
}
.insights-bar-fill-all {
  position: absolute; left: 0; top: 0; height: 100%;
  background: rgba(139,26,47,0.18); border-radius: 5px;
}
.insights-bar-fill-stock {
  position: absolute; left: 0; top: 0; height: 100%;
  background: #8B1A2F; border-radius: 5px;
}
.insights-bar-count {
  font-size: 0.88rem; font-weight: 700; color: var(--pico-color);
  min-width: 2rem; text-align: right; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.insights-view-more {
  font-size: 0.85rem; color: var(--pico-muted-color);
  text-decoration: none;
  min-height: 36px; display: flex; align-items: center;
}
.insights-view-more:hover { color: #8B1A2F; }
.insights-legend {
  display: flex; gap: 1rem; padding: 0.5rem 1rem 0.6rem;
  border-top: 1px solid rgba(0,0,0,0.045);
  background: var(--pico-muted-background-color);
}
.insights-legend-item {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.82rem; color: var(--pico-muted-color);
}
.insights-legend-swatch {
  width: 18px; height: 6px; border-radius: 3px; flex-shrink: 0;
}

/* ── Status row colouring in cellar list ─────────────────────────── */
.tr-status-red   td:first-child { border-left: 3px solid #dc3545; }
.tr-status-amber td:first-child { border-left: 3px solid #f0ad4e; }
.tr-status-green td:first-child { border-left: 3px solid #28a745; }
.tr-status-grey  td:first-child { border-left: 3px solid #adb5bd; }

/* ── Status colouring on mobile wine cards ──────────────────────── */
.card-status-red   article { border-left: 3px solid #dc3545; }
.card-status-amber article { border-left: 3px solid #f0ad4e; }
.card-status-green article { border-left: 3px solid #28a745; }
.card-status-grey  article { border-left: 3px solid #adb5bd; }

/* ── Uncork consequence notice ───────────────────────────────────── */
.uncork-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #fff8f0;
  border: 1px solid rgba(201,160,107,0.4);
  border-radius: var(--pico-border-radius, 4px);
  padding: 0.6rem 0.85rem;
  font-size: 0.88rem;
  color: var(--pico-muted-color);
  margin-bottom: 1.25rem;
}

/* ── Log filters always-visible ─────────────────────────────────── */
.log-filter-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}
.log-filter-inline select {
  width: auto;
  min-width: 0;
  flex-shrink: 0;
  margin: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}
.log-filter-date-range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.log-filter-date {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}
.log-filter-date-sep {
  font-size: 0.82rem;
  color: var(--pico-muted-color);
}
.log-filter-clear {
  font-size: 0.82rem;
  color: var(--pico-muted-color);
  text-decoration: underline;
  white-space: nowrap;
}

/* ── Latest tasting note on detail page ─────────────────────────── */
.latest-tasting-note {
  position: relative;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.9rem;
  background: var(--pico-muted-background-color);
  border-left: 3px solid var(--clr-gold);
  border-radius: 0 var(--pico-border-radius, 4px) var(--pico-border-radius, 4px) 0;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--pico-color);
  line-height: 1.5;
}
.latest-tasting-note-label {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--clr-gold);
  margin-bottom: 0.25rem;
}
.latest-tasting-note-rating {
  display: inline-block;
  margin-left: 0.4rem;
  color: var(--clr-gold);
  font-style: normal;
}

/* ── Cellar value stat on dashboard hero ─────────────────────────── */
.cellar-hero-stat-value {
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
}

/* ── Wishlist banner on detail page ─────────────────────────────── */
.wishlist-detail-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(to right, rgba(201,160,107,0.12), rgba(201,160,107,0.04));
  border: 1px solid rgba(201,160,107,0.4);
  border-radius: var(--pico-border-radius, 4px);
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  margin-bottom: 0.75rem;
}
.wishlist-detail-banner svg {
  flex-shrink: 0;
  color: var(--clr-gold);
}
.wishlist-banner-btn {
  all: unset;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--clr-burgundy);
  border: 1.5px solid var(--clr-burgundy);
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.wishlist-banner-btn:hover {
  background: var(--clr-burgundy);
  color: #fff;
}
.wishlist-banner-btn:focus-visible {
  outline: 2px solid var(--clr-burgundy);
  outline-offset: 2px;
}

/* ── Pairing favourite (pin) button ─────────────────────────────── */
.pairing-fav-btn {
  all: unset;
  cursor: pointer;
  font-size: 1.1rem;
  color: #d1d5db;
  line-height: 1;
  padding: 0.1rem 0.25rem;
  transition: color 0.12s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
}
.pairing-fav-btn:hover { color: var(--clr-gold); transform: scale(1.2); }
.pairing-fav-btn:focus-visible { outline: 2px solid var(--clr-gold); border-radius: 3px; }
.pairing-fav-btn--active { color: var(--clr-gold); }
.pairing-fav-btn--active:hover { color: #b8882a; }

/* Favourite row highlight (desktop table) */
.pairing-row--favourite td:first-child {
  border-left: 3px solid var(--clr-gold);
}

/* Favourite card highlight (mobile) */
.pairing-history-card--favourite {
  border-left: 3px solid var(--clr-gold);
  background: linear-gradient(to right, rgba(201,160,107,0.06), transparent 60%);
}

/* ── Wishlist cellar pill ────────────────────────────────────────── */
.cellar-pill--wishlist {
  border-color: rgba(139,26,47,0.25);
}
.cellar-pill--wishlist.cellar-pill--active,
.cellar-pill--wishlist:hover {
  border-color: var(--clr-burgundy);
}

/* ── Wishlist "Add to Cellar" action button ──────────────────────── */
.wishlist-add-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid var(--clr-burgundy);
  border-radius: 20px;
  background: transparent;
  color: var(--clr-burgundy);
  cursor: pointer;
  margin: 0;
  width: auto;
  min-height: unset;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.wishlist-add-btn:hover {
  background: var(--clr-burgundy);
  color: #fff;
}

/* ── Wine form sections ──────────────────────────────────────────── */
.wine-form-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.wine-form-section:last-of-type {
  border-bottom: none;
}
.wine-form-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--clr-burgundy);
  margin-bottom: 0.85rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--clr-burgundy);
  display: inline-block;
}
.wine-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 480px) {
  .wine-form-row {
    grid-template-columns: 1fr;
  }
}
.wine-form-field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--pico-color);
}

/* ── Currency + price joined group ───────────────────────────────── */
.currency-price-group {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.currency-label {
  display: flex;
  flex-direction: column;
}
.currency-select {
  width: auto;
  min-width: 90px;
  margin: 0;
}

/* ── Label thumbnail preview ─────────────────────────────────────── */
.label-thumbnail-preview {
  margin-bottom: 1rem;
}
.label-thumb-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--pico-muted-border-color);
  box-shadow: 0 2px 8px rgba(139,26,47,0.1);
}

/* ── Detail label thumbnail ──────────────────────────────────────── */
.detail-label-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--pico-muted-border-color);
  float: right;
  margin: 0 0 0.5rem 0.75rem;
  box-shadow: 0 2px 8px rgba(139,26,47,0.1);
}

/* ── Log filter collapse toggle ─────────────────────────────────── */
.log-filter-toggle {
  background: none;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  color: var(--pico-muted-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: auto;
  margin: 0;
  min-height: 32px;
  transition: border-color 0.12s, color 0.12s;
}
.log-filter-toggle:hover {
  border-color: var(--clr-burgundy);
  color: var(--clr-burgundy);
}
.log-filter-chevron {
  transition: transform 0.15s;
}
.log-filter-active-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clr-burgundy);
  margin-left: 1px;
}

/* ── Welcome modal currency picker buttons ──────────────────────── */
.welcome-currency-btn {
  padding: 0.35rem 0.85rem;
  border: 1.5px solid var(--pico-muted-border-color);
  border-radius: 20px;
  background: var(--pico-card-background-color);
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  width: auto;
  margin: 0;
  min-height: 36px;
}
.welcome-currency-btn--active {
  border-color: var(--clr-burgundy);
  color: var(--clr-burgundy);
  background: rgba(139,26,47,0.06);
}
.welcome-currency-btn:hover:not(.welcome-currency-btn--active) {
  border-color: var(--pico-color);
  color: var(--pico-color);
}

/* ── Form identity section label thumbnail ───────────────────────── */
.form-label-thumb-wrap {
  float: right;
  margin: 0 0 0.75rem 0.75rem;
  clear: right;
}
.form-label-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--pico-muted-border-color);
  box-shadow: 0 2px 8px rgba(139,26,47,0.1);
  display: block;
}

/* ── Shared section header (used on Settings and Admin) ─────────── */
.section-header {
  background: var(--pico-muted-background-color);
  padding: 0.35rem 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--pico-muted-color);
  text-transform: uppercase;
  margin: 1.5rem 0 0.6rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

/* ── Extended Cellar — Onboarding modal cellar type buttons ─────── */
.onboarding-cellar-btn {
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s, background 0.12s;
}
.onboarding-cellar-btn:hover {
  border-color: var(--clr-burgundy) !important;
}
.onboarding-cellar-btn:focus-visible {
  outline: 2px solid var(--clr-burgundy);
  outline-offset: 2px;
}

/* ── Taste chip (pill toggle) ── */
.taste-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border: 1.5px solid #d1d5db;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.88rem;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  color: #374151;
  font-weight: normal;
  margin: 0;
  line-height: 1.4;
}
.taste-chip--selected,
.taste-chip:has(input:checked) {
  background: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
  color: #fff;
}

/* ── Bulk location picker — place group header ── */
.bulk-loc-group {
  padding: 0.45rem 1rem 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  border-bottom: 1px solid #f3f4f6;
}
.bulk-loc-opt--indented {
  padding-left: 1.5rem !important;
}

/* ── By-Location: Place & Space collapsible blocks ── */
.loc-place-block {
  margin-bottom: 0.85rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(139,26,47,0.08), 0 0 0 1px rgba(139,26,47,0.1);
  background: #fff;
}
.loc-place-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, rgba(139,26,47,0.07) 0%, rgba(139,26,47,0.04) 100%);
  border: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(139,26,47,0.1);
}
.loc-place-header:hover {
  background: linear-gradient(135deg, rgba(139,26,47,0.12) 0%, rgba(139,26,47,0.07) 100%);
}
.loc-place-header:active {
  background: rgba(139,26,47,0.14);
}
.loc-place-icon {
  color: var(--clr-burgundy);
  flex-shrink: 0;
  opacity: 0.75;
}
.loc-place-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-burgundy);
  flex: 1;
  letter-spacing: -0.01em;
}
.loc-place-meta {
  font-size: 0.76rem;
  color: rgba(139,26,47,0.55);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.loc-place-chevron {
  color: var(--clr-burgundy);
  opacity: 0.6;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 0.1rem;
}
.loc-place-block--collapsed .loc-place-chevron { transform: rotate(-90deg); }

.loc-place-body {
  padding: 0 0.5rem 0;
}
.loc-place-body.collapsed { display: none; }

/* Space rows */
.loc-space-block {
  margin-bottom: 0;
  border-bottom: 1px solid rgba(139,26,47,0.07);
}
.loc-space-block:last-child { border-bottom: none; }

.loc-space-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
  border-radius: 6px;
}
.loc-space-header:hover { background: rgba(139,26,47,0.04); }
.loc-space-header:active { background: rgba(139,26,47,0.08); }

.loc-space-chevron {
  color: rgba(139,26,47,0.35);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.loc-space-block--collapsed .loc-space-chevron { transform: rotate(-90deg); }

.loc-space-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d2d2d;
  flex: 1;
}
.loc-space-meta {
  font-size: 0.75rem;
  color: #9ca3af;
  white-space: nowrap;
}
.loc-space-meta-wines {
  display: inline;
  color: #bbb;
}
.loc-space-select {
  font-size: 0.7rem !important;
  padding: 0.15rem 0.5rem !important;
  min-height: unset !important;
  border-color: rgba(139,26,47,0.25) !important;
  color: var(--clr-burgundy) !important;
  background: transparent !important;
  flex-shrink: 0;
}
.loc-space-select:hover {
  background: rgba(139,26,47,0.06) !important;
}

/* Hidden in select mode — shown only when select mode active */
.loc-space-select { display: none; }
.selection-mode .loc-space-select { display: inline-flex; }

.loc-space-body {
  padding: 0.5rem 0 0.5rem 0;
  border-top: 1px solid rgba(139,26,47,0.05);
  background: rgba(248,244,239,0.4);
}
.loc-space-body.collapsed { display: none; }

/* ── By-Location: entrance animation + polish ── */
@keyframes locPlaceFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.loc-place-block {
  animation: locPlaceFadeIn 0.28s ease both;
}
.loc-place-block:nth-child(1) { animation-delay: 0.00s; }
.loc-place-block:nth-child(2) { animation-delay: 0.06s; }
.loc-place-block:nth-child(3) { animation-delay: 0.12s; }
.loc-place-block:nth-child(4) { animation-delay: 0.18s; }
.loc-place-block:nth-child(5) { animation-delay: 0.24s; }

/* Expanded space body left accent line */
.loc-space-body:not(.collapsed) {
  border-left: 2px solid rgba(139,26,47,0.18);
  margin-left: 0.85rem;
  padding-left: 0.6rem;
}

/* Bottle count number in place header — bolder */
.loc-place-meta strong,
.loc-place-meta b {
  font-weight: 600;
  color: rgba(139,26,47,0.75);
}

/* Space block last child — remove bottom border */
.loc-place-body > .loc-space-block:last-child {
  border-bottom: none;
  margin-bottom: 0.25rem;
}

/* ── Dashboard: Location split hero (extended cellar) ── */
.cellar-loc-split {
  display: flex;
  gap: 0;
  margin-bottom: 0.85rem;
  /* Scrollable strip — shows 2.5 columns to hint overflow */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  /* Negative margin bleeds to card edge, padding restores */
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.cellar-loc-split::-webkit-scrollbar { display: none; }

.cellar-loc-item {
  /* Fixed width so 2.5 items are visible on a 390px card */
  flex: 0 0 38%;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem 0.5rem;
  text-decoration: none;
  color: inherit;
  border-right: 1px solid rgba(255,255,255,0.12);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
  border-radius: 4px;
  scroll-snap-align: start;
}
.cellar-loc-item:last-child { border-right: none; padding-right: 1.5rem; }
.cellar-loc-item:hover { background: rgba(255,255,255,0.06); }
.cellar-loc-item--value { cursor: default; }
.cellar-loc-item--value:hover { background: none; }

.cellar-loc-bottles {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: #E2C99A;
  line-height: 1;
  letter-spacing: -0.03em;
}
/* No BTL label — remove height placeholder */
.cellar-loc-label { display: none; }
.cellar-loc-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-align: center;
  line-height: 1.25;
  margin-top: 0.35rem;
  max-width: 7rem;
  /* Allow wrapping for long merchant names */
  white-space: normal;
  word-break: break-word;
}

/* ── Dashboard: In Bond card ── */
.dash-inbond-card {
  margin-bottom: 0.75rem;
  background: #fff;
  border: 1px solid rgba(139,26,47,0.15);
  border-left: 3px solid var(--clr-burgundy);
  border-radius: 8px;
  overflow: hidden;
}
.dash-inbond-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: rgba(139,26,47,0.04);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--clr-burgundy);
  border-bottom: 1px solid rgba(139,26,47,0.08);
}
.dash-inbond-tag {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}
.dash-inbond-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(139,26,47,0.05);
}
.dash-inbond-row:last-child { border-bottom: none; }
.dash-inbond-place {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
  flex: 1;
}
.dash-inbond-meta {
  font-size: 0.78rem;
  color: #9ca3af;
}
.dash-inbond-action {
  font-size: 0.78rem;
  color: var(--clr-burgundy);
  text-decoration: none;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.dash-inbond-action:hover { background: rgba(139,26,47,0.08); }

/* ── Pairing: location chips on result cards ── */
.pairing-pick-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}
.pairing-loc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2em 0.55em;
  border-radius: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.pairing-loc-chip svg {
  flex-shrink: 0;
}
.pairing-loc-chip--home {
  background: rgba(139,26,47,0.08);
  color: var(--clr-burgundy);
  border: 1px solid rgba(139,26,47,0.15);
}
.pairing-loc-chip--merchant {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ── Dashboard: Opening Soon action section ── */
.action-section-green { border-left-color: #16a34a !important; }
.action-dot-green { background: #16a34a !important; }
.action-urgency-green {
  background: #dcfce7;
  color: #166534;
  font-size: 0.72rem;
  padding: 0.1em 0.5em;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Vintage advice chips (menu scan) ── */
.vintage-advice-block { margin: 0.5rem 0 0.65rem; padding: 0.5rem 0.75rem; background: #fafaf9; border-radius: 6px; border: 1px solid #e5e7eb; }
.vintage-advice-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin: 0.25rem 0; }
.vintage-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #6b7280; min-width: 62px; flex-shrink: 0; }
.vintage-chip { font-size: 0.75rem; font-weight: 700; padding: 0.15em 0.5em; border-radius: 4px; }
.vintage-chip--good { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.vintage-chip--avoid { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.ask-sommelier-callout { background: #F8F4EF; border-left: 3px solid #8B1A2F; padding: 0.45rem 0.75rem; font-size: 0.82rem; font-style: italic; color: #6b7280; margin: 0.5rem 0; border-radius: 0 4px 4px 0; }
.vintage-context { font-size: 0.8rem; color: #9ca3af; margin: 0.25rem 0 0; line-height: 1.5; }

/* ── Restaurant section (menu scan) ── */
.menu-restaurant-section {
  background: var(--clr-cream);
  border: 1.5px solid #e8ddd6;
  border-radius: 10px;
  padding: 0.9rem 1rem 0.75rem;
  margin-bottom: 1.25rem;
}
.menu-restaurant-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--clr-burgundy);
  margin-bottom: 0.55rem;
}
.restaurant-name-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0; }
.menu-restaurant-input {
  flex: 1;
  font-size: 0.92rem;
  margin: 0;
  background: #fff;
  border-color: #d4c5bc;
}
.menu-restaurant-input:focus { border-color: var(--clr-burgundy); }
.menu-geo-btn-styled {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #fff;
  border: 1.5px solid #d4c5bc;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--clr-burgundy);
  transition: background 0.12s, border-color 0.12s;
}
.menu-geo-btn-styled:hover { background: #fdf2f4; border-color: var(--clr-burgundy); }
.restaurant-found-banner {
  background: #fdf2f4;
  border: 1px solid #f3c6cf;
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  font-size: 0.83rem;
  color: var(--clr-burgundy);
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Welcome modal redesign (onboarding improvements) ─────────────── */
.welcome-modal-header { margin-bottom: 1rem; }
.welcome-modal-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-burgundy);
  opacity: 0.7;
  margin: 0 0 0.3rem;
}
.welcome-modal h2 {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.4rem;
}
.welcome-modal-subtitle {
  font-size: 0.88rem;
  color: var(--pico-muted-color);
  margin: 0;
  line-height: 1.5;
}
.welcome-modal-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin: 0 0 0.45rem;
}
.welcome-modal-field { margin-bottom: 1rem; }
.welcome-modal-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.welcome-action-primary {
  flex: 1;
  margin: 0;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.welcome-action-secondary {
  margin: 0;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  background: transparent;
  border: 1.5px solid #d1d5db;
  border-radius: var(--pico-border-radius);
  color: #6b7280;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.welcome-action-secondary:hover { border-color: #9ca3af; color: #374151; }
.welcome-skip-link {
  background: none;
  border: none;
  color: var(--pico-muted-color);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  width: auto;
  min-height: unset;
  transition: text-decoration-color 0.12s, color 0.12s;
}
.welcome-skip-link:hover { color: #374151; text-decoration-color: #9ca3af; }

/* Cellar type selector buttons */
.onboarding-cellar-btn {
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  background: white;
  color: #111827;
  cursor: pointer;
  width: 100%;
  min-height: unset;
  transition: border-color 0.12s, background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.onboarding-cellar-btn--active {
  border-color: var(--clr-burgundy);
  background: #fff7f8;
}
.onboarding-cellar-btn:hover:not(.onboarding-cellar-btn--active) {
  border-color: #9ca3af;
}
.onboarding-cellar-btn-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
  color: #111827;
}
.onboarding-cellar-btn-sub {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 400;
  line-height: 1.4;
}

/* ── Dashboard skeleton loader ───────────────────────────────────────── */
@keyframes dash-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.dash-skel-block {
  background: linear-gradient(90deg,
    rgba(139,26,47,0.06) 25%,
    rgba(139,26,47,0.03) 50%,
    rgba(139,26,47,0.06) 75%
  );
  background-size: 200% 100%;
  animation: dash-shimmer 1.5s ease-in-out infinite;
  border-radius: 5px;
}

/* ── WSET Expert Tasting Notes ───────────────────────────────────────────── */

/* Toggle on log form */
.wset-expert-toggle-row {
  margin: 1rem 0 0.25rem;
  padding: 0.85rem 1rem;
  border: 1.5px dashed #d1d5db;
  border-radius: 10px;
  background: #fafafa;
  transition: border-color 0.15s, background 0.15s;
}
.wset-expert-toggle-row:has(input:checked) {
  border-color: var(--clr-burgundy);
  background: #fff7f8;
}
.wset-expert-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wset-expert-toggle input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--clr-burgundy);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.wset-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.3;
}
.wset-toggle-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: 1.5px solid var(--clr-burgundy);
  border-radius: 4px;
  color: var(--clr-burgundy);
  line-height: 1.4;
}
.wset-preview-hint {
  margin-top: 0.5rem;
  padding: 0.4rem 0 0 1.75rem;
  font-size: 0.82rem;
  color: var(--pico-muted-color);
  font-style: italic;
}

/* WSET form wizard */
.wset-form-header {
  margin-bottom: 1.25rem;
}
.wset-progress-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 1rem;
}
.wset-progress-segment {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: #e5e7eb;
  transition: background 0.2s;
}
.wset-progress-segment--active {
  background: var(--clr-burgundy);
}
.wset-progress-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--clr-burgundy);
}
.wset-step-section {
  background: #fff;
  border: 1px solid rgba(139,26,47,0.1);
  border-radius: 12px;
  padding: 1.25rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(139,26,47,0.06);
}
.wset-section-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--clr-burgundy);
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}
.wset-attr-row {
  margin-bottom: 0.9rem;
}
.wset-attr-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.4rem;
}
.wset-scale-btns {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.wset-scale-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  border: 1.5px solid #d1d5db;
  border-radius: 5px;
  cursor: pointer;
  background: #fff;
  color: #374151;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  margin: 0;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.2;
}
.wset-scale-btn:hover { border-color: var(--clr-burgundy-md); color: var(--clr-burgundy); }
.wset-scale-btn--active {
  background: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
  color: #fff;
}
.wset-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.wset-descriptor-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border: 1.5px solid #d1d5db;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  user-select: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  color: #374151;
  background: #fff;
  min-height: 34px;
  -webkit-tap-highlight-color: transparent;
}
.wset-descriptor-chip--selected {
  background: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
  color: #fff;
}
.wset-section-notes {
  width: 100%;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
  color: #374151;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.12s;
  margin: 0;
  box-sizing: border-box;
}
.wset-section-notes:focus { border-color: var(--clr-burgundy); outline: none; box-shadow: 0 0 0 2px rgba(139,26,47,0.1); }
.wset-form-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}
.wset-conditional { display: none; }
.wset-conditional--visible { display: block; }
.wset-aroma-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
  margin: 0.6rem 0 0.3rem;
}

/* WSET note read-only card */
.wset-note-card {
  background: #fff;
  border: 1px solid rgba(139,26,47,0.12);
  border-radius: 12px;
  padding: 1.1rem 1rem;
  box-shadow: 0 2px 8px rgba(139,26,47,0.06);
}
.wset-note-section {
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
}
.wset-note-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.wset-note-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--clr-burgundy);
  margin-bottom: 0.6rem;
}
.wset-note-attr {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}
.wset-note-attr-label {
  font-weight: 600;
  color: #6b7280;
  min-width: 110px;
  flex-shrink: 0;
  font-size: 0.82rem;
}
.wset-note-attr-value { color: #111827; }
.wset-note-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
}
.wset-note-chip {
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  border: 1.5px solid rgba(139,26,47,0.3);
  border-radius: 20px;
  color: var(--clr-burgundy);
  background: #fff7f8;
  font-weight: 500;
}
.wset-verdict-badge {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.wset-verdict-badge--good       { background: #f0fdf4; color: #15803d; border: 1.5px solid #16a34a; }
.wset-verdict-badge--acceptable { background: #fffbeb; color: #b45309; border: 1.5px solid #d97706; }
.wset-verdict-badge--poor       { background: #fef2f2; color: #b91c1c; border: 1.5px solid #dc2626; }

/* Inline note links in consumption table */
.wset-note-link {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--clr-burgundy);
  text-decoration: none;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(139,26,47,0.25);
  background: #fff7f8;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.wset-note-link:hover { background: #fee2e2; border-color: var(--clr-burgundy); }
.wset-add-link {
  display: inline-block;
  font-size: 0.78rem;
  color: #9ca3af;
  text-decoration: none;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px dashed #d1d5db;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
}

/* ── Import wizard ──────────────────────────────────────────────────────────
   Settings source card + BBR import page (4-state wizard)
   ──────────────────────────────────────────────────────────────────────── */

/* Settings entry point card */
.import-source-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(139,26,47,0.18);
  background: #fff;
  box-shadow: 0 2px 8px rgba(139,26,47,0.06);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.import-source-card:hover {
  border-color: var(--clr-burgundy);
  box-shadow: 0 4px 14px rgba(139,26,47,0.12);
  transform: translateY(-1px);
}
.import-source-card:active { transform: translateY(0); }

.import-source-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #fdf2f4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-burgundy);
}
.import-source-card-body { flex: 1; min-width: 0; }
.import-source-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1a1a1a;
}
.import-source-card-desc {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.1rem;
}
.import-source-card-arrow {
  flex-shrink: 0;
  color: #9ca3af;
  transition: color 0.12s, transform 0.12s;
}
.import-source-card:hover .import-source-card-arrow {
  color: var(--clr-burgundy);
  transform: translateX(2px);
}

/* Page header */
.import-page-header {
  margin-bottom: 1.75rem;
}
.import-page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--clr-burgundy);
  text-decoration: none;
  margin-bottom: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.12s;
}
.import-page-back:hover { opacity: 1; }
.import-page-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1a1a1a;
  margin: 0 0 0.25rem;
}
.import-page-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

/* Upload drop zone */
.import-drop-zone {
  position: relative;
  border: 2px dashed rgba(139,26,47,0.3);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.import-drop-zone:hover,
.import-drop-zone:focus-visible {
  border-color: var(--clr-burgundy);
  background: #fdf7f8;
  outline: none;
}
.import-drop-zone--over {
  border-color: var(--clr-burgundy);
  background: #fdf2f4;
  border-style: solid;
}
.import-drop-zone--loading {
  pointer-events: none;
  opacity: 0.7;
}
.import-drop-inner {
  padding: 2.5rem 2rem;
}
.import-drop-icon-wrap {
  color: rgba(139,26,47,0.45);
  margin-bottom: 1rem;
}
.import-drop-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.4rem;
}
.import-drop-hint {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0 0 0.6rem;
}
.import-drop-link {
  color: var(--clr-burgundy);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.import-drop-formats {
  font-size: 0.78rem;
  color: #9ca3af;
  margin: 0;
}

/* Error message */
.import-error {
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.85rem;
}

/* Step description */
.import-step-desc {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0 0 1.25rem;
}

/* Column mapper table */
.import-mapper-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.import-mapper-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0;
}
.import-mapper-table thead th {
  background: #f9fafb;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  padding: 0.6rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}
.import-mapper-table tbody td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.import-mapper-table tbody tr:last-child td { border-bottom: none; }
.mapper-row--unknown td { background: #fffbeb; }
.mapper-col-header { font-weight: 600; color: #374151; }
.mapper-unknown-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.mapper-select {
  font-size: 0.83rem;
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  border: 1px solid #d1d5db;
  background: #fff;
  min-width: 180px;
  margin: 0;
}
.mapper-sample {
  color: #9ca3af;
  font-size: 0.8rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Action row (mapper / actions shared) */
.import-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* Location picker row */
.import-location-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #fdf7f8;
  border-radius: 8px;
  border: 1px solid rgba(139,26,47,0.12);
}
.import-location-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
  white-space: nowrap;
}
.import-space-select {
  font-size: 0.85rem;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  margin: 0;
}

/* Preview table */
.import-preview-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  max-height: 50vh;
  overflow-y: auto;
}
.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 0;
}
.import-preview-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.import-preview-table thead th {
  background: #f9fafb;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.import-preview-table tbody td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.import-preview-table tbody tr:last-child td { border-bottom: none; }
.import-preview-table tbody tr:hover td { background: #fdf7f8; }

.import-row--removed td {
  opacity: 0.35;
  text-decoration: line-through;
}
.import-row--removed:hover td { background: transparent !important; }

.import-preview-vintage {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--clr-burgundy);
  white-space: nowrap;
  width: 56px;
}
.import-preview-name {
  min-width: 160px;
  max-width: 280px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-preview-region {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6b7280;
}
.import-preview-type { width: 40px; text-align: center; }
.import-preview-qty  { width: 40px; text-align: center; font-weight: 600; }
.import-preview-drink { white-space: nowrap; color: #6b7280; }
.import-preview-action { width: 36px; text-align: center; }

/* Type badge */
.import-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
}
.import-type-badge--red   { background: #fef2f2; color: #b91c1c; }
.import-type-badge--white { background: #fefce8; color: #854d0e; }
.import-type-badge--rose,
.import-type-badge--rosé  { background: #fdf2f8; color: #9d174d; }
.import-type-badge--sparkling { background: #f0f9ff; color: #0c4a6e; }

/* Per-row remove button */
.import-row-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #9ca3af;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
}
.import-row-remove:hover {
  background: #fde8ec;
  color: var(--clr-burgundy);
}

/* Sticky summary bar */
.import-summary-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(139,26,47,0.07);
  position: sticky;
  bottom: 4.5rem; /* above bottom tab bar */
  z-index: 10;
}
@media (min-width: 768px) {
  .import-summary-bar { bottom: 1rem; }
}
.import-summary-back {
  flex-shrink: 0;
  margin: 0;
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
}
.import-summary-count {
  flex: 1;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
}
.import-confirm-btn {
  flex-shrink: 0;
  margin: 0;
  min-height: 44px;
  padding: 0.45rem 1.2rem;
  font-size: 0.88rem;
  font-weight: 700;
  background: var(--clr-burgundy);
  border: none;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.import-confirm-btn:hover { background: var(--clr-burgundy-dk); }
.import-confirm-btn:active { transform: scale(0.98); }
.import-confirm-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Results */
.import-results-wrap { margin-bottom: 0.5rem; }

.import-results-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.import-result-block {
  flex: 1;
  min-width: 140px;
  padding: 1.5rem 1.75rem;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(139,26,47,0.05);
}
.import-result-block--success {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
}
.import-result-block--skipped {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
}
.import-result-num {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.import-result-block--success .import-result-num { color: #15803d; }
.import-result-block--skipped .import-result-num { color: #b45309; }
.import-result-lbl {
  font-size: 0.82rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

.import-skipped-note {
  font-size: 0.82rem;
  color: #6b7280;
  margin: 0.75rem 0 0;
}
.import-skipped-details {
  margin-top: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.import-skipped-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  user-select: none;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  background: #f9fafb;
}
.import-skipped-details summary::-webkit-details-marker { display: none; }
.import-skipped-details summary::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid #9ca3af;
  border-bottom: 2px solid #9ca3af;
  transform: rotate(-45deg);
  transition: transform 0.15s;
  flex-shrink: 0;
}
.import-skipped-details[open] summary::after {
  transform: rotate(45deg);
}
.import-skipped-details summary:hover { background: #f3f4f6; }
.import-results-list {
  margin: 0;
  padding: 0.5rem 1rem 0.75rem 2rem;
  font-size: 0.83rem;
  color: #374151;
  line-height: 1.9;
  background: #fff;
}

.import-result-errors {
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.83rem;
  color: #b91c1c;
  margin-top: 1rem;
}
.import-result-errors ul {
  margin: 0.25rem 0 0 1rem;
  padding: 0;
}

.import-results-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
/* Override Pico's blue → burgundy for ALL import action areas */
.import-results-actions a[role="button"],
.import-actions button:not(.outline) {
  background: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
  color: #fff;
  font-weight: 600;
  transition: background 0.12s, border-color 0.12s;
}
.import-results-actions a[role="button"]:hover,
.import-actions button:not(.outline):hover {
  background: var(--clr-burgundy-dk);
  border-color: var(--clr-burgundy-dk);
  color: #fff;
}
/* Outline buttons use burgundy border/text */
.import-results-actions button.outline,
.import-actions button.outline {
  color: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
  background: transparent;
  margin: 0;
  font-weight: 600;
  transition: background 0.12s, color 0.12s;
}
.import-results-actions button.outline:hover,
.import-actions button.outline:hover {
  background: #fdf2f4;
}
.wset-add-link:hover { color: var(--clr-burgundy); border-color: var(--clr-burgundy); }

/* ── Sortable table headers ─────────────────────────────── */
.sort-th a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: color 0.12s;
}
.sort-th a:hover { color: var(--clr-burgundy); }
.sort-th--active a { color: var(--clr-burgundy); font-weight: 600; }
.sort-arrow { font-size: 0.78em; opacity: 0.8; }

/* ── Restaurant autocomplete dropdown ──────────────────────── */
.restaurant-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 2.9rem; /* leave room for geo button */
  background: #fff;
  border: 1.5px solid var(--clr-burgundy);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 6px 16px rgba(139,26,47,0.12);
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
}
.restaurant-dropdown-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.1s;
}
.restaurant-dropdown-item:last-child { border-bottom: none; }
.restaurant-dropdown-item:hover { background: #fdf2f4; }
.rest-drop-name { font-size: 0.88rem; font-weight: 600; color: #111; }
.rest-drop-age  { font-size: 0.76rem; color: var(--pico-muted-color); }
/* Load previous menu button */
.menu-load-prev-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  background: var(--clr-burgundy);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
  flex-shrink: 0;
}
.menu-load-prev-btn:hover { background: var(--clr-burgundy-dk); }

/* ── Menu scan — history notice + add-more row ─────────────── */
.menu-history-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  color: #92400e;
  margin-bottom: 0.75rem;
}
.menu-add-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  background: transparent;
  border: 1.5px solid var(--clr-burgundy);
  border-radius: 20px;
  color: var(--clr-burgundy);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.menu-add-more-btn:hover { background: #fdf2f4; }
.menu-add-more-btn:disabled { opacity: 0.6; cursor: default; }

/* ── Geo location chip (Priority 1) ────────────────────────── */
.menu-geo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.75rem;
  background: transparent;
  border: 1.5px solid var(--pico-muted-border-color);
  border-radius: 20px;
  color: var(--pico-muted-color);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0.45rem;
  width: auto;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.menu-geo-chip:hover { border-color: var(--clr-burgundy); color: var(--clr-burgundy); background: #fdf2f4; }
.menu-geo-chip--loading { opacity: 0.7; cursor: default; }
.menu-geo-chip--done { border-color: #15803d; color: #15803d; background: #f0fdf4; }

/* ── Restaurant banner layout (Priority 4) ─────────────────── */
.rest-banner-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.rest-history-row,
.rest-community-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.rest-history-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--pico-muted-color);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}
.rest-history-chip {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  background: rgba(201,160,107,0.12);
  border: 1px solid rgba(201,160,107,0.3);
  color: #7a5c2e;
  white-space: nowrap;
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rest-community-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  background: rgba(139,26,47,0.07);
  border: 1px solid rgba(139,26,47,0.18);
  color: var(--clr-burgundy);
  white-space: nowrap;
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rest-community-count {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(139,26,47,0.15);
  border-radius: 20px;
  padding: 0 0.32rem;
  flex-shrink: 0;
}

/* ── Wine badges in checklist (Priority 5) ─────────────────── */
.menu-wine-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.menu-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.08rem 0.4rem;
  border-radius: 20px;
  white-space: nowrap;
  line-height: 1.5;
}
.menu-badge--community {
  background: rgba(139,26,47,0.08);
  color: var(--clr-burgundy);
  border: 1px solid rgba(139,26,47,0.2);
}
.menu-badge--history {
  background: rgba(201,160,107,0.12);
  color: #7a5c2e;
  border: 1px solid rgba(201,160,107,0.3);
}

/* ── Restaurant badge on tasting log (Priority 3) ──────────── */
.log-restaurant-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--clr-burgundy);
  background: rgba(139,26,47,0.07);
  border: 1px solid rgba(139,26,47,0.18);
  border-radius: 20px;
  padding: 0.06rem 0.45rem;
  margin-top: 0.2rem;
  text-decoration: none;
  transition: background 0.12s;
  white-space: nowrap;
}
.log-restaurant-badge:hover { background: rgba(139,26,47,0.14); }

/* ── My Restaurants page (Priority 2) ──────────────────────── */
.restaurant-visit-count-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  background: rgba(139,26,47,0.08);
  border: 1px solid rgba(139,26,47,0.18);
  color: var(--clr-burgundy);
}

/* ── Log restaurant chips row ──────────────────────────────── */
.log-restaurant-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 0 0.1rem;
  flex-wrap: wrap;
}
.log-quick-chip--venue {
  background: rgba(139,26,47,0.06);
  border-color: rgba(139,26,47,0.2);
  color: var(--clr-burgundy);
}
.log-quick-chip--venue:hover,
.log-quick-chip--venue.log-quick-chip--active {
  background: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
  color: #fff;
}
.log-venue-all-link {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  text-decoration: none;
  margin-left: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.log-venue-all-link:hover { color: var(--clr-burgundy); }

/* ── Dashboard restaurants stat card ───────────────────────── */
.stat-card--restaurants {
  border-color: rgba(139,26,47,0.2);
  background: rgba(139,26,47,0.04);
}
.stat-card--restaurants .stat-number { color: var(--clr-burgundy); }

/* ── Restaurant page — menu scan badge ─────────────────────── */
.rest-menu-scan-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--clr-burgundy);
  text-decoration: none;
  white-space: nowrap;
}
.rest-menu-scan-link:hover { text-decoration: underline; }
.rest-menu-scan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--clr-burgundy);
  background: rgba(139,26,47,0.07);
  border: 1px solid rgba(139,26,47,0.18);
  border-radius: 20px;
  padding: 0.06rem 0.45rem;
}

/* ── Restaurant menu view ── */
.rest-menu-scan-badge { text-decoration: none; }
.rest-menu-scan-badge:hover { background: rgba(139,26,47,0.12); }

/* Header */
.rmv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.rmv-title {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.3rem;
  color: var(--pico-color);
}
.rmv-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--pico-muted-color);
}
.rmv-dot { opacity: 0.4; }
.rmv-attribution {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.05rem 0.45rem;
  border-radius: 10px;
  letter-spacing: 0.02em;
}
.rmv-attribution--own {
  background: rgba(139,26,47,0.08);
  color: var(--clr-burgundy);
  border: 1px solid rgba(139,26,47,0.2);
}
.rmv-attribution--community {
  background: rgba(201,160,107,0.12);
  color: #8a6830;
  border: 1px solid rgba(201,160,107,0.3);
}
.rmv-rescan-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--clr-burgundy);
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  border: 1.5px solid rgba(139,26,47,0.28);
  border-radius: 20px;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
  margin-top: 0.15rem;
}
.rmv-rescan-btn:hover {
  background: rgba(139,26,47,0.06);
  border-color: var(--clr-burgundy);
}
.rmv-hint {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  margin-bottom: 0.75rem;
}

/* Wine list */
.rmv-list { display: flex; flex-direction: column; gap: 0; }

/* Wine card */
.rmv-card {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0;
  background: var(--pico-card-background-color);
  border-bottom: none;
  transition: background 0.1s;
}
.rmv-list > .rmv-card:first-of-type,
.rmv-list > .menu-section-heading + .rmv-card { border-radius: var(--pico-border-radius) var(--pico-border-radius) 0 0; }
.rmv-list > .rmv-card:last-child {
  border-radius: 0 0 var(--pico-border-radius) var(--pico-border-radius);
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.rmv-card--open {
  background: var(--pico-card-background-color);
  border-color: rgba(139,26,47,0.3);
  border-bottom: 1px solid rgba(139,26,47,0.15) !important;
  border-radius: var(--pico-border-radius) !important;
  margin: 0.25rem 0;
  box-shadow: 0 3px 14px rgba(139,26,47,0.09);
  z-index: 1;
  position: relative;
}

/* Trigger button (the collapsed row) */
.rmv-card-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  margin: 0;
  height: auto;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  border-radius: inherit;
}
.rmv-card-trigger:hover { background: rgba(139,26,47,0.025); }
.rmv-card-trigger:focus-visible { outline: 2px solid var(--clr-burgundy); outline-offset: -2px; border-radius: var(--pico-border-radius); }

.rmv-card-info { flex: 1; min-width: 0; }
.rmv-card-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 0.2rem;
  word-break: break-word;
}
.rmv-card-sub {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.rmv-type-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.06rem 0.38rem;
  border-radius: 3px;
}
.rmv-type-tag--red       { background: rgba(139,26,47,0.1);  color: var(--clr-burgundy); }
.rmv-type-tag--white     { background: rgba(201,160,107,0.15); color: #7a5c1e; }
.rmv-type-tag--sparkling { background: rgba(100,130,180,0.12); color: #3a5a90; }
.rmv-type-tag--ros\e    { background: rgba(210,100,130,0.12); color: #a0304a; }
.rmv-type-tag--fortified { background: rgba(120,60,20,0.12); color: #6b3010; }
.rmv-type-tag--sweet     { background: rgba(180,140,50,0.12); color: #7a5a10; }
.rmv-card-year {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--pico-muted-color);
}
.rmv-card-detail {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
}
.rmv-logged-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #28a745;
  background: rgba(40,167,69,0.08);
  border: 1px solid rgba(40,167,69,0.22);
  border-radius: 10px;
  padding: 0.05rem 0.4rem;
}
.rmv-card-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.rmv-card-price {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clr-burgundy);
  white-space: nowrap;
}
.rmv-chevron {
  color: var(--pico-muted-color);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* Expanded panel */
.rmv-panel {
  padding: 0 0.85rem 0.85rem;
}

/* Action buttons strip */
.rmv-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
  padding-top: 0.1rem;
  border-top: 1px solid var(--pico-muted-border-color);
  padding-top: 0.65rem;
}
.rmv-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
  white-space: nowrap;
  min-height: 36px;
  text-decoration: none;
  border: 1.5px solid transparent;
  width: auto;
  margin: 0;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
.rmv-action-btn:active { transform: scale(0.97); }
.rmv-action-btn--log {
  background: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
  color: #fff;
}
.rmv-action-btn--log:hover { background: var(--clr-burgundy-dk); border-color: var(--clr-burgundy-dk); }
.rmv-action-btn--assess {
  background: transparent;
  border-color: rgba(139,26,47,0.3);
  color: var(--clr-burgundy);
}
.rmv-action-btn--assess:hover { background: rgba(139,26,47,0.05); border-color: var(--clr-burgundy); }
.rmv-action-btn--edit {
  background: transparent;
  border-color: var(--pico-muted-border-color);
  color: var(--pico-muted-color);
  margin-left: auto;
}
.rmv-action-btn--edit:hover { background: var(--pico-muted-background-color); color: var(--pico-color); border-color: var(--pico-muted-color); }

/* Log form */
.rmv-log-form { margin-bottom: 0.5rem; }
.rmv-log-form-inner {
  background: rgba(139,26,47,0.03);
  border: 1px solid rgba(139,26,47,0.12);
  border-radius: var(--pico-border-radius);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.rmv-log-top-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.rmv-star-row { display: flex; gap: 0.1rem; }
.rmv-star {
  font-size: 1.4rem;
  background: none;
  border: none;
  color: var(--pico-muted-border-color);
  cursor: pointer;
  padding: 0;
  width: auto;
  margin: 0;
  line-height: 1;
  transition: color 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.rmv-star:hover,
.rmv-star--on { color: var(--clr-gold); }
.rmv-log-date {
  font-size: 0.8rem;
  padding: 0.22rem 0.45rem;
  border: 1.5px solid var(--pico-muted-border-color);
  border-radius: var(--radius-sm);
  height: auto;
  margin: 0;
  background: var(--pico-card-background-color);
  width: auto;
}
.rmv-log-notes {
  font-size: 0.82rem;
  padding: 0.4rem 0.5rem;
  border: 1.5px solid var(--pico-muted-border-color);
  border-radius: var(--radius-sm);
  resize: vertical;
  min-height: 54px;
  margin: 0;
  width: 100%;
  background: var(--pico-card-background-color);
}
.rmv-log-btns {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Edit / correction form */
.rmv-edit-form { margin-bottom: 0.5rem; }
.rmv-edit-form-inner {
  background: var(--pico-muted-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rmv-field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pico-muted-color);
  margin-bottom: 0.2rem;
}
.rmv-input {
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  border: 1.5px solid var(--pico-muted-border-color);
  border-radius: var(--radius-sm);
  height: auto;
  margin: 0;
  background: var(--pico-card-background-color);
  width: 100%;
  display: block;
}
.rmv-input-name { width: 100%; }
.rmv-edit-row2 {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}
.rmv-edit-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.rmv-edit-note {
  font-size: 0.72rem;
  color: var(--pico-muted-color);
  margin: 0;
}

/* Shared form buttons */
.rmv-submit-btn {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  background: var(--clr-burgundy);
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
  min-height: 36px;
  width: auto;
  margin: 0;
}
.rmv-submit-btn:hover { background: var(--clr-burgundy-dk); }
.rmv-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.rmv-ghost-btn {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  background: none;
  color: var(--pico-muted-color);
  border: 1.5px solid var(--pico-muted-border-color);
  border-radius: 20px;
  cursor: pointer;
  min-height: 36px;
  width: auto;
  margin: 0;
}
.rmv-ghost-btn:hover { background: var(--pico-muted-background-color); }

/* Toast */
.rm-toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  background: #222;
  color: #fff;
  font-size: 0.82rem;
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 9999;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.rm-toast--error { background: var(--clr-burgundy); }
.rm-toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* ── Assess page top-bar + compact prefs ── */
.assess-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.assess-topbar-title {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--clr-burgundy);
  margin: 0;
}
/* Tighten the step indicator */
.assess-steps { margin-bottom: 0.9rem; }

/* Compact prefs row */
.assess-prefs-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.assess-prefs-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  background: var(--pico-muted-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 20px;
  padding: 0.18rem 0.55rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.assess-prefs-pill svg { flex-shrink: 0; color: #28a745; }
.assess-prefs-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assess-prefs-edit-btn {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.18rem 0.55rem;
  border: 1.5px solid var(--pico-muted-border-color);
  border-radius: 20px;
  background: var(--pico-card-background-color);
  color: var(--pico-muted-color);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  width: auto;
  margin: 0;
  min-height: 28px;
  transition: border-color 0.12s, color 0.12s;
}
.assess-prefs-edit-btn:hover { border-color: var(--pico-muted-color); color: var(--pico-color); }
.assess-prefs-empty {
  font-size: 0.78rem;
  color: var(--pico-muted-color);
  padding: 0.25rem 0.6rem;
  background: rgba(201,160,107,0.08);
  border-left: 2.5px solid var(--clr-gold);
  border-radius: 0 4px 4px 0;
}

/* ── Meal capture bottom sheet ── */
.meal-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(14, 5, 8, 0.6);
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.meal-sheet {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: var(--clr-cream, #F8F4EF);
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -12px 48px rgba(139,26,47,0.22), 0 -2px 8px rgba(0,0,0,0.08);
}
.meal-sheet--open {
  transform: translateY(0);
}
.meal-sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(139,26,47,0.2);
  border-radius: 2px;
  margin: 10px auto 0;
}
.meal-sheet-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.25rem 0.55rem;
  background: rgba(139,26,47,0.06);
  border-bottom: 1px solid rgba(139,26,47,0.1);
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  margin-top: 0.5rem;
}
.meal-sheet-body {
  padding: 1.1rem 1.25rem 1.5rem;
}
.meal-sheet-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(139,26,47,0.08);
  border-radius: 50%;
  color: var(--clr-burgundy);
  margin-bottom: 0.85rem;
}
.meal-sheet-heading {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: normal;
  color: var(--clr-burgundy);
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.meal-sheet-sub {
  font-size: 0.82rem;
  color: var(--pico-muted-color);
  margin: 0 0 1rem;
  line-height: 1.5;
}
.meal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.meal-chip {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border: 1.5px solid rgba(139,26,47,0.28);
  border-radius: 20px;
  background: transparent;
  color: var(--clr-burgundy);
  cursor: pointer;
  width: auto;
  min-height: 36px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.meal-chip:hover { background: rgba(139,26,47,0.06); border-color: var(--clr-burgundy); }
.meal-chip--active {
  background: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
  color: #fff;
}
.meal-chip--active:hover { background: var(--clr-burgundy-dk); }
.meal-capture-text {
  font-size: 0.88rem;
  margin: 0 0 1rem;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--pico-muted-border-color);
  border-radius: 8px;
  width: 100%;
  background: #fff;
  transition: border-color 0.12s;
}
.meal-capture-text:focus { border-color: var(--clr-gold); outline: none; box-shadow: 0 0 0 3px rgba(201,160,107,0.15); }
.meal-sheet-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.meal-sheet-confirm {
  flex: 1;
  background: var(--clr-burgundy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  min-height: 44px;
  transition: background 0.12s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.meal-sheet-confirm:hover { background: var(--clr-burgundy-dk); }
.meal-sheet-confirm:active { transform: scale(0.98); }
.meal-sheet-skip {
  font-size: 0.84rem;
  color: var(--pico-muted-color);
  background: none;
  border: none;
  padding: 0.5rem 0.25rem;
  cursor: pointer;
  width: auto;
  min-height: 44px;
  transition: color 0.12s;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: transparent;
  transition: color 0.12s, text-decoration-color 0.12s;
}
.meal-sheet-skip:hover { color: var(--pico-color); text-decoration-color: var(--pico-muted-color); }

/* ── Meal context badge (shown above wine list after scan) ── */
.meal-context-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--pico-muted-color);
  margin-bottom: 0.85rem;
  padding: 0.45rem 0.75rem;
  background: rgba(201,160,107,0.1);
  border-left: 3px solid var(--clr-gold);
  border-radius: 0 6px 6px 0;
  flex-wrap: wrap;
}
.meal-context-badge strong { color: var(--pico-color); font-weight: 600; }
.meal-badge-edit {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.25rem 0.6rem;
  border: 1.5px solid var(--pico-muted-border-color);
  border-radius: 20px;
  background: transparent;
  color: var(--pico-muted-color);
  cursor: pointer;
  width: auto;
  min-height: unset;
  height: auto;
  margin: 0 0 0 auto;
  box-shadow: none;
  transition: border-color 0.12s, color 0.12s;
  /* override Pico form-element sizing */
  --pico-form-element-spacing-vertical: 0;
  --pico-form-element-spacing-horizontal: 0;
}
.meal-badge-edit:hover { border-color: var(--pico-color); color: var(--pico-color); background: transparent; box-shadow: none; }
.meal-badge-inline-input {
  font-size: 0.84rem;
  padding: 0.1rem 0.4rem;
  border: 1.5px solid var(--clr-gold);
  border-radius: 4px;
  background: var(--pico-card-background-color);
  width: 8rem;
  min-height: unset;
  margin: 0;
}

/* ── Pairing spotlight section ── */
.menu-pairing-spotlight {
  background: linear-gradient(135deg, rgba(201,160,107,0.1) 0%, rgba(139,26,47,0.04) 100%);
  border: 1.5px solid rgba(201,160,107,0.4);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  padding: 0.75rem 0.85rem 0.5rem;
  margin-bottom: 0;
}
.menu-pairing-spotlight-heading {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--clr-burgundy);
  margin: 0 0 0.15rem;
  font-weight: normal;
  letter-spacing: -0.01em;
}
.menu-pairing-meal { font-weight: 600; }
.menu-pairing-spotlight-sub {
  font-size: 0.76rem;
  color: var(--pico-muted-color);
  margin: 0 0 0.35rem;
}
.menu-wine-item--paired {
  border-color: rgba(201,160,107,0.5) !important;
  background: rgba(201,160,107,0.05) !important;
  border-radius: 0 !important;
  border-top-width: 0 !important;
  margin-bottom: 0 !important;
}
.menu-wine-item--paired:last-of-type {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
.menu-pairing-divider {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--pico-muted-color);
  padding: 0.8rem 0 0.35rem;
  border-top: 1px solid var(--pico-muted-border-color);
  margin-bottom: 0.1rem;
}

/* ── Pairing trigger (history-load prompt) ── */
.pairing-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(201,160,107,0.12) 0%, rgba(248,244,239,0.6) 60%);
  border: 1.5px solid rgba(201,160,107,0.4);
  border-left: 3.5px solid var(--clr-gold);
  border-radius: 0 10px 10px 0;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.pairing-trigger-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}
.pairing-trigger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(139,26,47,0.08);
  border-radius: 50%;
  color: var(--clr-burgundy);
  flex-shrink: 0;
}
.pairing-trigger-heading {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: var(--clr-burgundy);
  margin: 0 0 0.1rem;
  font-weight: normal;
  letter-spacing: -0.01em;
}
.pairing-trigger-sub {
  font-size: 0.74rem;
  color: var(--pico-muted-color);
  margin: 0;
  line-height: 1.4;
}
.pairing-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background: var(--clr-burgundy);
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  width: auto;
  min-height: 36px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(139,26,47,0.25);
  animation: pairingPulse 3s ease-in-out 1.2s 3;
  transition: background 0.12s, transform 0.1s, box-shadow 0.12s;
  --pico-form-element-spacing-vertical: 0;
  --pico-form-element-spacing-horizontal: 0;
}
.pairing-trigger-btn:hover {
  background: var(--clr-burgundy-dk);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,26,47,0.3);
}
.pairing-trigger-btn:active { transform: scale(0.97); }
.pairing-trigger-arrow { font-style: normal; }
@keyframes pairingPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(139,26,47,0.25); }
  50%       { box-shadow: 0 2px 16px rgba(139,26,47,0.5), 0 0 0 4px rgba(201,160,107,0.2); }
}

/* ── Meal chip — last time recall (localStorage, 24h) ── */
.meal-chip--last-time {
  border-style: dashed;
  border-color: var(--clr-gold);
  color: var(--clr-burgundy);
  background: rgba(201,160,107,0.08);
  font-style: italic;
}
.meal-chip--last-time.meal-chip--active {
  background: var(--clr-burgundy);
  border-color: var(--clr-burgundy);
  color: #fff;
  border-style: solid;
  font-style: normal;
}

/* ── Pairing → Scan CTA (pairing results page) ── */
.pairing-scan-cta {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}
.pairing-scan-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--clr-burgundy);
  text-decoration: none;
  padding: 0.6rem 1.4rem;
  border: 1.5px solid var(--clr-burgundy);
  border-radius: 20px;
  letter-spacing: 0.01em;
  transition: background 0.12s, color 0.12s, transform 0.1s, box-shadow 0.12s;
}
.pairing-scan-cta-link:hover {
  background: var(--clr-burgundy);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,26,47,0.22);
  text-decoration: none;
}
.pairing-scan-cta-link:active { transform: scale(0.97); }
