:root {
  --bg: #f4ede3;
  --bg-deep: #e8d7c3;
  --surface: rgba(255, 250, 244, 0.84);
  --surface-strong: rgba(255, 252, 248, 0.94);
  --surface-dark: rgba(52, 26, 18, 0.78);
  --line: rgba(79, 39, 27, 0.12);
  --line-strong: rgba(119, 52, 36, 0.2);
  --ink: #23130f;
  --muted: #6b554b;
  --accent: #7d1930;
  --accent-soft: #edd0c4;
  --gold: #b78345;
  --success: #2f8f5b;
  --shadow: 0 30px 70px rgba(82, 43, 29, 0.14);
  --radius-xl: 34px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(125, 25, 48, 0.16), transparent 26%),
    radial-gradient(circle at 88% 12%, rgba(183, 131, 69, 0.22), transparent 20%),
    linear-gradient(180deg, #f9f2ea 0%, #f2e5d8 44%, #ebdac8 100%);
  font-family: "Georgia", "Times New Roman", serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.24), transparent 78%);
}

.scanner-page {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.scanner-hero {
  margin-bottom: 20px;
  padding: 18px 4px 14px;
}

.hero-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 40;
}

.hero-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-cellar-select-shell {
  display: inline-flex;
  align-items: center;
}

.hero-cellar-select-shell .text-input {
  min-height: 42px;
  padding: 0 34px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 249, 243, 0.86);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
}

.hero-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hero-logo-frame {
  display: inline-block;
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  overflow: hidden;
  border-radius: 12px;
}

.hero-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 82px;
  height: 82px;
  max-width: none;
  transform: translate(-50%, -50%);
  object-fit: contain;
}

.hero-brand,
.hero-kicker,
.stage-label,
.panel-label,
.result-label,
.save-field span,
.edit-field span {
  margin: 0;
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-brand {
  font-size: 0.72rem;
  color: var(--accent);
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 249, 243, 0.74);
  color: var(--ink);
  text-decoration: none;
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.92rem;
}

.hero-link.is-active {
  border-color: rgba(119, 52, 36, 0.28);
  background: rgba(255, 252, 248, 0.92);
}

.hero-copy-block {
  margin-top: 26px;
  max-width: 720px;
}

.hero-kicker {
  font-size: 0.72rem;
  color: var(--gold);
}

.scanner-hero h1 {
  margin: 10px 0 0;
  max-width: 10ch;
  font-size: clamp(3.1rem, 11vw, 5.3rem);
  line-height: 0.92;
  font-weight: 600;
}

.hero-copy {
  margin: 16px 0 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.scanner-layout {
  display: grid;
  gap: 18px;
}

.capture-stage,
.result-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.capture-stage {
  padding: 20px;
}

.result-stage {
  padding: 22px;
  background:
    linear-gradient(160deg, rgba(255, 251, 246, 0.98), rgba(248, 238, 228, 0.82)),
    var(--surface-strong);
}

.stage-topline,
.panel-head,
.result-header,
.save-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.stage-topline {
  align-items: center;
  margin-bottom: 16px;
}

.stage-label,
.panel-label,
.result-label,
.save-field span,
.edit-field span {
  font-size: 0.72rem;
  color: var(--accent);
}

.stage-subtitle,
.panel-copy,
.capture-status,
.match-reason,
.result-empty p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(125, 25, 48, 0.1);
  color: var(--accent);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill-soft {
  background: rgba(255, 251, 246, 0.82);
  border: 1px solid var(--line);
  color: var(--muted);
}

.camera-shell {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-xl) - 8px);
  border: 3px solid rgba(255, 255, 255, 0.18);
  background: #1d1411;
  transition: border-color 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease;
}

.camera-frame-live {
  border-color: rgba(176, 39, 51, 0.92);
  box-shadow:
    0 0 0 3px rgba(176, 39, 51, 0.12),
    0 22px 42px rgba(125, 25, 48, 0.18);
}

.camera-overlay {
  position: absolute;
  inset-inline: 16px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.camera-overlay-top {
  top: 16px;
}

.camera-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(23, 16, 14, 0.52);
  color: rgba(255, 247, 241, 0.88);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  backdrop-filter: blur(14px);
}

.camera-surface {
  position: relative;
  min-height: 380px;
  background:
    linear-gradient(180deg, rgba(21, 14, 12, 0.12), rgba(21, 14, 12, 0.42)),
    url("https://images.unsplash.com/photo-1510812431401-41d2bd2722f3?auto=format&fit=crop&w=1200&q=80")
      center / cover;
}

#camera-feed,
.preview-shell,
#photo-preview {
  width: 100%;
  height: 100%;
}

#camera-feed {
  object-fit: cover;
}

.preview-shell {
  position: absolute;
  inset: 0;
}

#photo-preview {
  object-fit: cover;
}

.camera-guides {
  pointer-events: none;
  position: absolute;
  inset: 24px;
  z-index: 1;
}

.camera-guides span {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: rgba(255, 248, 243, 0.68);
  border-style: solid;
}

.camera-guides span:nth-child(1) {
  top: 0;
  left: 0;
  border-width: 2px 0 0 2px;
  border-top-left-radius: 14px;
}

.camera-guides span:nth-child(2) {
  top: 0;
  right: 0;
  border-width: 2px 2px 0 0;
  border-top-right-radius: 14px;
}

.camera-guides span:nth-child(3) {
  bottom: 0;
  left: 0;
  border-width: 0 0 2px 2px;
  border-bottom-left-radius: 14px;
}

.camera-guides span:nth-child(4) {
  bottom: 0;
  right: 0;
  border-width: 0 2px 2px 0;
  border-bottom-right-radius: 14px;
}

.camera-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.mobile-camera-note {
  margin: 12px 2px 0;
  color: var(--muted);
  line-height: 1.55;
}

button,
.gallery-button,
.text-input,
.hero-link {
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

button:hover,
.gallery-button:hover,
.hero-link:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.ghost-button,
.primary-button {
  min-height: 52px;
  border-radius: 18px;
  border: 0;
  padding: 0 18px;
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.96rem;
  cursor: pointer;
}

.ghost-button {
  background: rgba(255, 249, 243, 0.86);
  color: var(--ink);
  border: 1px solid var(--line);
}

.gallery-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  text-decoration: none;
}

.gallery-button:focus-visible {
  outline: 3px solid rgba(125, 25, 48, 0.24);
  outline-offset: 3px;
}

.button-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.primary-button {
  background: linear-gradient(135deg, #7d1930, #a73247);
  color: #fff8f4;
  box-shadow: 0 16px 36px rgba(125, 25, 48, 0.22);
}

.primary-button-wide {
  width: 100%;
}

.stage-panel,
.result-panel,
.save-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.72);
}

.scanner-live-camera-blocked #start-camera {
  opacity: 0.55;
}

.detail-list,
.chip-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list li {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  line-height: 1.55;
}

.detail-list-links a {
  color: var(--accent);
}

.detail-list-soft li {
  background: rgba(255, 252, 249, 0.72);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-list li {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(125, 25, 48, 0.08);
  border: 1px solid rgba(125, 25, 48, 0.12);
  color: var(--accent);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.88rem;
}

.scan-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.82rem;
}

.scan-progress-track {
  margin-top: 10px;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(125, 25, 48, 0.1);
}

.progress-bar-indeterminate {
  width: 38%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7d1930, #c84d62);
  animation: progress-slide 1.45s ease-in-out infinite;
}

.scan-progress-inline {
  margin-top: 14px;
}

.result-empty {
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 44px 10px;
  text-align: center;
}

.empty-emblem {
  width: 70px;
  height: 70px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.7), transparent 45%),
    linear-gradient(160deg, rgba(125, 25, 48, 0.16), rgba(183, 131, 69, 0.22));
  border: 1px solid rgba(125, 25, 48, 0.12);
}

.result-empty h2,
#wine-name {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 0.98;
}

.result-empty p {
  max-width: 36rem;
}

.result-sheet {
  display: grid;
  gap: 18px;
}

.result-hero-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 18% 18%, rgba(183, 131, 69, 0.16), transparent 28%),
    radial-gradient(circle at 82% 10%, rgba(125, 25, 48, 0.12), transparent 24%),
    linear-gradient(155deg, rgba(255, 251, 246, 0.98), rgba(242, 226, 212, 0.9));
  border: 1px solid rgba(125, 25, 48, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 24px 50px rgba(84, 44, 29, 0.08);
}

.result-header {
  align-items: flex-start;
}

.result-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.vintage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 12px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(183, 131, 69, 0.16);
  border: 1px solid rgba(183, 131, 69, 0.2);
  color: #8e6028;
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-story {
  margin-top: 18px;
}

.hero-summary {
  margin: 0;
  max-width: 42rem;
  color: #3b2620;
  font-size: 1.06rem;
  line-height: 1.8;
}

.hero-meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.hero-meta {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 250, 245, 0.82);
  border: 1px solid rgba(119, 52, 36, 0.12);
}

.hero-meta-label {
  color: var(--muted);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-meta-value {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
}

.hero-origin-value {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.country-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  font-size: 1.1rem;
  line-height: 1;
  filter: saturate(0.95);
}

.result-hero-visuals {
  display: grid;
  gap: 14px;
}

.bottle-spotlight,
.origin-card {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(247, 234, 219, 0.92));
}

.bottle-spotlight {
  min-height: 340px;
  display: grid;
  place-items: center;
}

.bottle-aura {
  position: absolute;
  width: 64%;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(125, 25, 48, 0.16), rgba(183, 131, 69, 0.07) 56%, transparent 72%);
  filter: blur(2px);
}

.bottle-image {
  position: relative;
  z-index: 1;
  max-width: 72%;
  max-height: 300px;
  object-fit: contain;
  filter: drop-shadow(0 24px 24px rgba(42, 18, 11, 0.22));
}

.hero-remove-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(122, 36, 31, 0.16);
  background: rgba(255, 247, 240, 0.9);
  color: #7d1930;
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.86rem;
  box-shadow: 0 8px 18px rgba(42, 18, 11, 0.12);
}

.bottle-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  width: 68%;
  max-width: 220px;
  aspect-ratio: 4 / 9;
  padding: 20px;
  border-radius: 26px 26px 34px 34px;
  border: 1px solid rgba(119, 52, 36, 0.18);
  background: linear-gradient(180deg, rgba(98, 41, 28, 0.95), rgba(55, 23, 17, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 28px rgba(42, 18, 11, 0.24);
}

.bottle-placeholder::before {
  content: "";
  position: absolute;
  top: -26px;
  width: 36%;
  height: 44px;
  border-radius: 20px 20px 10px 10px;
  background: linear-gradient(180deg, #2f1710, #4c261a);
}

.bottle-placeholder-kicker {
  color: rgba(255, 241, 230, 0.78);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.bottle-placeholder-vintage {
  color: #fff7f1;
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1;
}

.origin-card {
  padding: 18px;
}

.origin-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.origin-flag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 250, 245, 0.9);
  border: 1px solid rgba(119, 52, 36, 0.12);
  font-size: 1.7rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.origin-title-block {
  min-width: 0;
}

.origin-country-name {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.2;
}

.country-map {
  min-height: 132px;
  margin-top: 16px;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background:
    radial-gradient(circle at 24% 22%, rgba(183, 131, 69, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 235, 225, 0.95));
}

.country-map svg {
  width: min(100%, 112px);
  max-height: 100px;
  height: auto;
  overflow: visible;
}

.country-map path,
.country-map polygon,
.country-map circle,
.country-map rect,
.country-map ellipse {
  fill: #8b3b31;
  stroke: none;
}

.country-map text {
  display: none;
}

.country-fallback {
  display: grid;
  place-items: center;
  min-height: 120px;
  width: 100%;
  padding: 16px;
  border-radius: 20px;
  border: 1px dashed rgba(119, 52, 36, 0.22);
  background: rgba(255, 251, 247, 0.52);
}

.country-fallback-name {
  color: var(--accent);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
}

.origin-copy {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.result-grid-elevated .result-panel {
  background: linear-gradient(180deg, rgba(255, 253, 250, 0.92), rgba(247, 235, 225, 0.82));
}

.result-panel-glow {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 16px 30px rgba(84, 44, 29, 0.06);
}

.wine-facts-grid,
.result-grid {
  display: grid;
  gap: 12px;
}

.wine-facts-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fact-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.75);
}

.fact-card dt {
  margin: 0;
  color: var(--muted);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fact-card dd {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.panel-intro,
.save-copy {
  margin-bottom: 14px;
}

.panel-copy-long {
  margin-top: 14px;
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.edit-field,
.save-field {
  display: grid;
  gap: 8px;
}

.edit-field-wide {
  grid-column: 1 / -1;
}

.text-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
}

.text-input:focus {
  outline: 2px solid rgba(125, 25, 48, 0.22);
  border-color: rgba(125, 25, 48, 0.34);
}

.save-panel {
  display: grid;
  gap: 10px;
  align-items: end;
}

.lookup-footnote {
  margin-top: 4px;
  background: rgba(250, 243, 236, 0.78);
}

.lookup-summary-block {
  margin-bottom: 16px;
}

.lookup-footer-block {
  margin-top: 16px;
}

.save-controls {
  display: grid;
  grid-template-columns: minmax(74px, 92px) minmax(120px, 1fr) minmax(120px, 1fr);
  gap: 8px;
  justify-content: start;
  align-items: end;
}

.save-controls .save-field {
  gap: 4px;
}

.save-controls .save-field span {
  font-size: 0.6rem;
}

.save-controls .text-input {
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.76rem;
}

.save-controls .primary-button {
  width: 100%;
  min-width: 0;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 0.76rem;
}

.smart-save-shell {
  position: relative;
}

.smart-save-toggle {
  min-height: 26px;
  border-radius: 10px;
  justify-content: center;
}

.smart-save-menu {
  position: absolute;
  z-index: 35;
  bottom: calc(100% + 8px);
  left: 0;
  width: max(100%, 240px);
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(125, 25, 48, 0.28);
  background: rgba(125, 25, 48, 0.94);
  box-shadow: 0 16px 30px rgba(52, 18, 14, 0.24);
}

.smart-save-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  color: #fff7f1;
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.88rem;
  line-height: 1.3;
}

.smart-save-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #f0d7ca;
}

.capture-status {
  font-size: 0.92rem;
}

.cellar-page {
  padding-bottom: 54px;
}

.cellar-hero h1 {
  max-width: 12ch;
}

.cellar-layout {
  display: grid;
  gap: 18px;
}

.cellar-topbar {
  position: relative;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.72);
  box-shadow: 0 18px 38px rgba(82, 43, 29, 0.09);
  backdrop-filter: blur(16px);
}

.cellar-topbar-main {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.cellar-topbar-cellar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 16px;
  flex: 1;
}

.cellar-topbar-select-shell {
  display: grid;
  gap: 8px;
}

.cellar-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.profile-trigger-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 249, 243, 0.9);
  color: var(--ink);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.profile-trigger-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(119, 52, 36, 0.18);
  background: rgba(255, 252, 249, 0.9);
}

.profile-trigger-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hero-link-row .profile-trigger-button {
  margin-left: 2px;
}

.profile-trigger-button.is-login-cta {
  font-weight: 700;
  background: rgba(183, 131, 69, 0.16);
}

.cellar-management-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 220;
  width: min(560px, calc(100vw - 24px));
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(119, 52, 36, 0.16);
  background: rgba(255, 250, 244, 0.96);
  box-shadow: 0 20px 42px rgba(82, 43, 29, 0.14);
  backdrop-filter: blur(16px);
}

.cellar-management-grid {
  display: grid;
  gap: 12px;
}

.cellar-summary-stage,
.cellar-inventory-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.cellar-summary-stage {
  padding: 20px;
}

.cellar-inventory-stage {
  padding: 22px;
  background:
    linear-gradient(160deg, rgba(255, 251, 246, 0.98), rgba(248, 238, 228, 0.82)),
    var(--surface-strong);
}

.cellar-summary-card {
  display: grid;
  gap: 16px;
}

.auth-gate-card {
  position: fixed;
  inset: 0;
  z-index: 1200;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: grid;
  justify-items: center;
  align-items: end;
  padding: clamp(32px, 6vh, 64px) 16px clamp(48px, 12vh, 140px);
  background: url("/Images/splash.png") center center / cover no-repeat;
}

.auth-splash-shell {
  width: min(470px, 100%);
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(18, 15, 13, 0.5);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.auth-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  background: rgba(9, 15, 22, 0.3);
  backdrop-filter: blur(1px);
}

.auth-loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  animation: auth-loading-spin 0.85s linear infinite;
}

.auth-splash-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-splash-logo-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff7f1;
  background: linear-gradient(145deg, #8f2a42, #6c1c30);
  box-shadow: 0 10px 20px rgba(125, 25, 48, 0.28);
}

.auth-splash-logo-copy {
  display: grid;
  gap: 3px;
}

.auth-splash-kicker {
  margin: 0;
  color: #5d2418;
  font-size: 1.45rem;
  line-height: 1.1;
}

.auth-splash-sub {
  margin: 0;
  color: #8f6d58;
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-splash-head {
  align-items: start;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.auth-actions {
  margin-top: 2px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-splash-shell .edit-field span {
  color: rgba(255, 247, 241, 0.9);
  font-size: 0.64rem;
}

.auth-splash-shell .text-input {
  background: rgba(255, 255, 255, 0.94);
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 13px;
}

.auth-splash-shell .ghost-button {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff8f4;
}

.auth-actions .ghost-button,
.auth-actions .primary-button {
  min-height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 0.82rem;
}

.auth-splash-shell .capture-status {
  margin-top: 4px;
  color: rgba(255, 247, 241, 0.9);
}

body.auth-locked {
  overflow: hidden;
}

.profile-mini {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 250, 244, 0.55);
}

.profile-mini-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.profile-mini .ghost-button,
.cellar-topbar .ghost-button {
  white-space: nowrap;
}

.cellar-sharing-shell,
.cellar-create-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.cellar-owned-shell,
.cellar-shared-shell,
.settings-logout-shell {
  display: grid;
  gap: 10px;
}

.settings-cellar-list {
  display: grid;
  gap: 10px;
}

.settings-cellar-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.settings-cellar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-cellar-name {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.settings-small-button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 0.82rem;
}


.settings-logout-shell .ghost-button {
  justify-self: end;
}

.settings-logout-shell a.ghost-button {
  text-decoration: none;
}

.cellar-switch-block,
.cellar-share-block {
  display: grid;
  gap: 8px;
}

.cellar-share-block {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
}

.pairing-assistant-card {
  margin-top: 0;
}

.cellar-summary-head,
.cellar-inventory-head,
.cellar-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.cellar-summary-grid {
  display: grid;
  gap: 12px;
}

.cellar-stat {
  padding: 14px 16px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 252, 248, 0.96), rgba(246, 237, 227, 0.85)),
    rgba(255, 251, 246, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.cellar-stat-label {
  margin: 0;
  color: var(--muted);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cellar-stat-value {
  margin: 6px 0 0;
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 0.98;
}

.cellar-note {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 248, 240, 0.72);
  color: var(--muted);
  line-height: 1.7;
}

.cellar-note p {
  margin: 0;
}

.cellar-status-inline {
  margin-top: 4px;
}

.cellar-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.stats-layout {
  display: grid;
  gap: 18px;
}

.stats-stage {
  display: grid;
  gap: 18px;
}

.stats-kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-kpi-card,
.stats-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stats-kpi-card {
  padding: 18px;
}

.stats-kpi-value {
  margin: 8px 0 0;
  font-size: clamp(2.1rem, 6vw, 2.8rem);
  line-height: 0.98;
}

.stats-kpi-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.stats-panel {
  padding: 22px;
  background:
    linear-gradient(160deg, rgba(255, 251, 246, 0.98), rgba(248, 238, 228, 0.82)),
    var(--surface-strong);
}

.stats-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.stats-empty {
  margin-top: 0;
}

.stats-history-graph {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 12px;
  align-items: end;
}

.stats-day-bar {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.stats-day-bar-track {
  display: flex;
  align-items: end;
  width: 100%;
  min-height: 190px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.72);
}

.stats-day-bar-fill {
  width: 100%;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(183, 131, 69, 0.85), rgba(125, 25, 48, 0.9));
}

.stats-day-bar-fill.is-down {
  background: linear-gradient(180deg, rgba(154, 103, 53, 0.65), rgba(106, 73, 54, 0.9));
}

.stats-day-bar-total,
.stats-day-bar-label,
.stats-day-bar-delta {
  margin: 0;
  text-align: center;
}

.stats-day-bar-total {
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.92rem;
  color: var(--ink);
}

.stats-day-bar-label,
.stats-day-bar-delta {
  font-size: 0.82rem;
  color: var(--muted);
}

.stats-top-wines {
  display: grid;
  gap: 12px;
}

.stats-top-wine-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.72);
}

.stats-top-wine-rank {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(125, 25, 48, 0.1);
  color: var(--accent);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.stats-top-wine-copy h3,
.stats-top-wine-copy p {
  margin: 0;
}

.stats-top-wine-copy h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.stats-top-wine-copy p {
  color: var(--muted);
  line-height: 1.6;
}

.cellar-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.8);
}

.cellar-search-field {
  display: grid;
  gap: 8px;
}

.pairing-assistant-form {
  display: grid;
  gap: 14px;
}

.pairing-mode-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(119, 52, 36, 0.14);
  background: rgba(255, 252, 248, 0.72);
}

.pairing-mode-button {
  flex: 1 1 0;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  text-transform: none;
  cursor: pointer;
}

.pairing-mode-button.is-active {
  border-color: rgba(119, 52, 36, 0.16);
  background: rgba(255, 248, 240, 0.9);
  color: var(--ink);
}

.pairing-query-input {
  min-height: 112px;
}

.pairing-price-filter {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(119, 52, 36, 0.1);
  background: rgba(255, 252, 248, 0.58);
}

.pairing-price-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pairing-price-range-label {
  color: var(--muted);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
}

.pairing-price-ends {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pairing-price-dual {
  --min-percent: 0%;
  --max-percent: 100%;
  position: relative;
  height: 30px;
}

.pairing-price-dual::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 999px;
  border: 1px solid rgba(119, 52, 36, 0.18);
  background:
    linear-gradient(
      to right,
      rgba(119, 52, 36, 0.2) 0 var(--min-percent),
      rgba(125, 25, 48, 0.75) var(--min-percent) var(--max-percent),
      rgba(119, 52, 36, 0.2) var(--max-percent) 100%
    );
}

.pairing-price-range {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 30px;
  margin: 0;
  background: transparent;
  pointer-events: none;
}

.pairing-price-range::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
}

.pairing-price-range::-moz-range-track {
  height: 8px;
  background: transparent;
  border: 0;
}

.pairing-price-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border-radius: 50%;
  border: 2px solid #fff7f0;
  background: #7d1930;
  box-shadow: 0 4px 10px rgba(84, 44, 29, 0.28);
  pointer-events: auto;
  cursor: pointer;
}

.pairing-price-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff7f0;
  background: #7d1930;
  box-shadow: 0 4px 10px rgba(84, 44, 29, 0.28);
  pointer-events: auto;
  cursor: pointer;
}

.pairing-price-range.is-max::-webkit-slider-thumb,
.pairing-price-range.is-max::-moz-range-thumb {
  background: #1f5a94;
}

.pairing-price-range.is-min {
  z-index: 2;
}

.pairing-price-range.is-max {
  z-index: 3;
}

.pairing-assistant-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pairing-assistant-actions .ghost-button,
.pairing-assistant-actions .primary-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  font-size: 0.88rem;
}

.pairing-selected-wine {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background: rgba(255, 252, 249, 0.72);
}

.pairing-selected-wine-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.pairing-selected-wine-title {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.pairing-selected-wine-copy {
  margin: 6px 0 0;
  color: var(--muted);
}

.pairing-results {
  display: grid;
  gap: 16px;
}

.pairing-menu-head {
  display: flex;
  align-items: start;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.pairing-menu-head > div {
  max-width: 30rem;
}

.pairing-menu-logo-frame {
  display: block;
  margin: 0 auto 8px;
}

.pairing-tone-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.pairing-tone-note .panel-label {
  margin-right: 8px;
}

.pairing-dish-grid,
.pairing-match-list {
  display: grid;
  gap: 12px;
}

.pairing-dish-card,
.pairing-match-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background: rgba(255, 252, 249, 0.78);
}

.pairing-dish-card-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
}

.pairing-dish-card-compact h3 {
  margin-top: 4px;
  font-size: 0.96rem;
}

.pairing-dish-card-compact .pairing-dish-meta {
  margin: 0;
  font-size: 0.78rem;
}

.pairing-dish-card.is-chosen {
  grid-template-columns: minmax(120px, 152px) minmax(0, 1fr);
  align-items: start;
  border-color: rgba(125, 25, 48, 0.2);
  background: rgba(125, 25, 48, 0.06);
}

.pairing-chosen-dish-image-shell {
  display: grid;
  place-items: center;
  min-height: 136px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 252, 249, 0.82);
  border: 1px solid rgba(119, 52, 36, 0.1);
}

.pairing-chosen-dish-image {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 14px;
}

.pairing-chosen-dish-copy {
  min-width: 0;
}

.pairing-dish-card h3,
.pairing-match-card h3 {
  margin: 8px 0 0;
  font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
}

.pairing-dish-card p,
.pairing-match-card p {
  margin: 8px 0 0;
  line-height: 1.6;
}

.pairing-dish-meta,
.pairing-match-fit,
.pairing-dish-source,
.pairing-dish-why {
  color: var(--muted);
}

.pairing-dish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pairing-dish-card-compact .pairing-dish-actions .ghost-button,
.pairing-dish-card-compact .pairing-dish-actions .primary-button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 13px;
  font-size: 0.84rem;
}

.pairing-option-card {
  gap: 12px;
}

.pairing-option-main {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.pairing-option-media {
  width: 70px;
}

.pairing-option-image {
  width: 70px;
  height: 88px;
  object-fit: contain;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(119, 52, 36, 0.16);
  background: rgba(255, 251, 246, 0.86);
}

.pairing-option-image-fallback {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pairing-option-copy h3 {
  margin: 0;
}

.pairing-option-copy .pairing-option-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.pairing-option-match-toggle {
  justify-self: stretch;
  min-height: 34px;
  border: 1px solid rgba(119, 52, 36, 0.16);
  border-radius: 12px;
  background: rgba(255, 248, 240, 0.72);
  color: var(--accent);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.pairing-option-reason {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background: rgba(255, 252, 249, 0.72);
  color: var(--muted);
  line-height: 1.6;
}

.pairing-option-reason p {
  margin: 0;
}

.pairing-option-select-button {
  min-height: 22px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.72rem;
}

.pairing-menu-stage {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  padding: 26px 22px 28px;
  border-radius: 34px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 247, 237, 0.8), rgba(241, 225, 210, 0.86)),
    url("/textures/yan-ots-UuBR5kbvt4Y-unsplash.jpg") center 42% / cover no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 20px 40px rgba(84, 44, 29, 0.1);
}

.pairing-menu-stage::before {
  content: "";
  display: block;
  height: 1px;
  margin: -8px auto 10px;
  width: min(74%, 280px);
  background: linear-gradient(90deg, transparent, rgba(119, 52, 36, 0.28), transparent);
}

.pairing-menu-list {
  display: grid;
  gap: 14px;
}

.pairing-menu-actions {
  display: flex;
  justify-content: center;
  margin-top: 2px;
}

.pairing-menu-actions .ghost-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.pairing-menu-course {
  display: grid;
  gap: 10px;
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(119, 52, 36, 0.12);
  text-align: center;
}

.pairing-menu-course-top {
  display: flex;
  align-items: start;
  justify-content: center;
  gap: 14px;
}

.pairing-menu-course-top > div {
  display: grid;
  justify-items: center;
}

.pairing-menu-course-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pairing-menu-course-title {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  max-width: 26ch;
}

.pairing-menu-served {
  margin-top: 10px;
}

.pairing-menu-served-label,
.pairing-menu-served-value {
  margin: 0;
}

.pairing-menu-served-label {
  color: var(--muted);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pairing-menu-served-value {
  margin-top: 4px;
  font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 0.88rem;
  line-height: 1.35;
}

.pairing-menu-course-detail {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.pairing-menu-link {
  align-self: center;
  color: var(--accent);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.pairing-menu-readmore-link {
  display: inline-block;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.pairing-menu-wines {
  display: grid;
  gap: 8px;
  width: 100%;
}

.pairing-menu-wine,
.pairing-menu-empty,
.pairing-menu-pending {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background: rgba(255, 252, 249, 0.62);
}

.pairing-menu-wine-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.pairing-menu-wine-top h4 {
  margin: 6px 0 0;
  font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
}

.pairing-menu-readmore {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pairing-menu-reason {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.65;
}

.pairing-menu-reason p,
.pairing-menu-empty p,
.pairing-menu-pending p {
  margin: 0;
}

.pairing-fit-no_good_match .pairing-match-card {
  border-color: rgba(119, 52, 36, 0.22);
  background: rgba(255, 245, 240, 0.82);
}

.pairing-fit-no_good_match.pairing-menu-course {
  border-color: rgba(119, 52, 36, 0.22);
}

.cellar-card {
  display: block;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(183, 131, 69, 0.14), transparent 24%),
    linear-gradient(160deg, rgba(255, 251, 246, 0.94), rgba(245, 233, 222, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 14px 28px rgba(84, 44, 29, 0.06);
}

.cellar-card.is-updating {
  opacity: 0.68;
}

.cellar-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  width: 100%;
}

.cellar-card-lead {
  display: grid;
  grid-template-columns: minmax(130px, 160px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.cellar-card-visual {
  display: grid;
  gap: 12px;
}

.cellar-bottle-shell,
.cellar-origin-shell {
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background: rgba(255, 252, 248, 0.78);
}

.cellar-bottle-shell {
  min-height: 188px;
}

.cellar-bottle-image {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(42, 18, 11, 0.16));
}

.cellar-bottle-placeholder {
  display: grid;
  place-items: center;
  width: 78px;
  height: 142px;
  border-radius: 22px 22px 28px 28px;
  background: linear-gradient(180deg, rgba(98, 41, 28, 0.95), rgba(55, 23, 17, 0.98));
  color: #fff8f4;
  font-size: 1.1rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 28px rgba(42, 18, 11, 0.2);
}

.cellar-origin-shell {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
}

.cellar-origin-map {
  display: grid;
  place-items: center;
  min-height: 52px;
}

.cellar-origin-map svg {
  width: min(100%, 64px);
  max-height: 52px;
}

.cellar-origin-map path,
.cellar-origin-map polygon,
.cellar-origin-map circle,
.cellar-origin-map rect,
.cellar-origin-map ellipse {
  fill: #8b3b31;
  stroke: none;
}

.cellar-origin-map text {
  display: none;
}

.cellar-card-body {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.cellar-card-title-block {
  display: grid;
  align-content: start;
  gap: 0;
  min-width: 0;
}

.cellar-card-title {
  margin: 6px 0 0;
  font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: clamp(1rem, 2.3vw, 1.32rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.cellar-card-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.cellar-style-badge {
  display: inline-grid;
  gap: 4px;
  justify-self: start;
  margin: 10px 0 0;
  padding: 9px 14px 10px;
  border-radius: 18px;
  background: rgba(125, 25, 48, 0.08);
  border: 1px solid rgba(125, 25, 48, 0.12);
  color: #7d1930;
}

.cellar-badge-row {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 10px;
  margin-top: 2px;
  align-items: start;
  justify-content: start;
}

.cellar-badge-row .cellar-style-badge {
  margin-top: 0;
}

.cellar-style-badge-soft {
  background: rgba(183, 131, 69, 0.1);
  border-color: rgba(183, 131, 69, 0.18);
  color: #7a4e22;
}

.cellar-style-badge-neutral {
  background: rgba(90, 74, 65, 0.08);
  border-color: rgba(90, 74, 65, 0.14);
  color: #5b463d;
}

.cellar-style-badge-label {
  margin: 0;
  color: var(--muted);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
}

.cellar-style-badge-value {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.2;
}

.cellar-drink-window-badge {
  cursor: pointer;
}

.cellar-match-note {
  margin: 10px 0 0;
  color: var(--accent);
  line-height: 1.55;
}

.cellar-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  width: 100%;
  align-items: stretch;
}

.cellar-facts div {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background: rgba(255, 252, 249, 0.72);
}

.cellar-facts dt {
  margin: 0;
  color: var(--muted);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cellar-facts dd {
  margin: 8px 0 0;
  color: var(--ink);
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.quantity-block {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(34px, auto);
  align-items: center;
  justify-content: end;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(119, 52, 36, 0.16);
  background: rgba(255, 250, 245, 0.88);
  margin: 0;
  justify-self: end;
}

.quantity-button {
  min-width: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #7d1930, #a73247);
  color: #fff8f4;
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 8px 14px rgba(125, 25, 48, 0.16);
}

.quantity-value {
  min-width: 28px;
  text-align: center;
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
}

.cellar-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  width: 100%;
}

.cellar-meta div {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background: rgba(255, 252, 249, 0.72);
}

.cellar-meta dt {
  margin: 0;
  color: var(--muted);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cellar-meta dd {
  margin: 8px 0 0;
  color: var(--ink);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.cellar-meta-wide {
  grid-column: 1 / -1;
}

.cellar-summary {
  margin: 0;
  color: #3b2620;
  line-height: 1.75;
}

.cellar-sensory-grid,
.taste-meter-section {
  display: grid;
  gap: 12px;
}

.cellar-sensory-block {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background: rgba(255, 252, 249, 0.76);
}

.cellar-sensory-title {
  margin: 0;
  color: var(--accent);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cellar-sensory-copy {
  margin: 10px 0 0;
  color: #3b2620;
  line-height: 1.7;
}

.taste-meter-grid {
  display: grid;
  gap: 12px;
}

.taste-meter-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background: rgba(255, 252, 249, 0.76);
}

.taste-meter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.taste-meter-label {
  color: var(--ink);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.taste-meter-value {
  color: var(--muted);
  font-size: 0.88rem;
}

.taste-meter-track {
  margin-top: 10px;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(125, 25, 48, 0.1);
}

.taste-meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7d1930, #b78345);
}

.cellar-expand-button {
  justify-self: start;
}

.cellar-delete-button {
  justify-self: start;
  min-height: 46px;
}

.cellar-card-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cellar-pair-button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cellar-pair-button-icon {
  width: 29px;
  height: 29px;
  display: inline-flex;
  position: relative;
}

.cellar-pair-button-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cellar-pair-button-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.cellar-pair-button-icon::before,
.cellar-pair-button-icon::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 7px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  animation: cellar-food-smoke 2.2s ease-in-out infinite;
}

.cellar-pair-button-icon::before {
  left: 8px;
}

.cellar-pair-button-icon::after {
  left: 16px;
  animation-delay: 1.1s;
}

@keyframes cellar-food-smoke {
  0% {
    opacity: 0;
    transform: translateY(2px) scale(0.8);
  }
  25% {
    opacity: 0.44;
  }
  100% {
    opacity: 0;
    transform: translateY(-10px) scale(1.22);
  }
}

.cellar-rating-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  padding: 0 2px 0 0;
}

.rating-strip-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rating-strip-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.rating-stars,
.rating-control-row,
.thumb-control-row,
.rating-chip-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.rating-star-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(125, 25, 48, 0.28);
  font-size: 1.38rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 140ms ease, color 140ms ease;
}

.rating-star-button:hover,
.rating-star-button:focus-visible {
  color: #a24f3e;
  transform: translateY(-1px);
}

.rating-star-button.is-filled {
  color: #a24f3e;
}

.rating-star-button-large {
  font-size: 1.95rem;
}

.rating-thumb-display {
  min-width: 44px;
  color: #7d1930;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
}

.rating-thumb-display.is-empty {
  min-width: 0;
}

.favorite-mark {
  color: #7d1930;
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rating-food-link {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(119, 52, 36, 0.14);
  background:
    no-repeat center / 16px 16px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d1930' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 3v7a2 2 0 0 0 2 2h1v9'/%3E%3Cpath d='M8 3v7'/%3E%3Cpath d='M12 3v7'/%3E%3Cpath d='M17 3c0 4-2 5-2 7v11'/%3E%3C/svg%3E"),
    rgba(255, 252, 249, 0.84);
  box-shadow: 0 10px 18px rgba(84, 44, 29, 0.08);
}

.rating-food-link:hover {
  transform: translateY(-1px);
}

.rating-dialog {
  width: min(100%, 560px);
}

.rating-form-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.rating-form-section {
  display: grid;
  gap: 10px;
}

.thumb-choice {
  display: inline-grid;
  gap: 4px;
  min-width: 124px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(119, 52, 36, 0.12);
  background: rgba(255, 252, 249, 0.76);
  color: var(--ink);
  cursor: pointer;
}

.thumb-choice.is-selected {
  border-color: rgba(125, 25, 48, 0.28);
  background: rgba(125, 25, 48, 0.08);
  color: #7d1930;
}

.thumb-choice-icon {
  font-size: 1.08rem;
}

.thumb-choice-label {
  font-size: 0.88rem;
  line-height: 1.35;
}

.rating-chip {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(119, 52, 36, 0.14);
  background: rgba(255, 252, 249, 0.76);
  color: var(--ink);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  cursor: pointer;
}

.rating-chip.is-selected {
  border-color: rgba(125, 25, 48, 0.3);
  background: rgba(125, 25, 48, 0.08);
  color: #7d1930;
}

.rating-favorite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.rating-note-field textarea {
  resize: vertical;
}

.year-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(34, 18, 14, 0.36);
  backdrop-filter: blur(10px);
}

.year-picker-dialog {
  width: min(100%, 460px);
  padding: 22px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(183, 131, 69, 0.12), transparent 26%),
    linear-gradient(165deg, rgba(255, 250, 245, 0.98), rgba(244, 231, 219, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 28px 60px rgba(42, 18, 11, 0.18);
}

.year-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.year-picker-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.rating-dialog .edit-field {
  display: grid;
  gap: 8px;
}

.cellar-details {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.cellar-link {
  color: var(--accent);
  font-family: "Trebuchet MS", "Helvetica Neue", sans-serif;
  text-decoration: none;
}

.cellar-empty {
  min-height: 420px;
}

.camera-frame-captured {
  border-color: rgba(47, 143, 91, 0.85) !important;
  box-shadow:
    0 0 0 3px rgba(78, 189, 118, 0.18),
    0 28px 48px rgba(47, 143, 91, 0.18);
}

.is-hidden,
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes progress-slide {
  0% {
    transform: translateX(-120%);
  }
  50% {
    transform: translateX(90%);
  }
  100% {
    transform: translateX(260%);
  }
}

@keyframes auth-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 960px) {
  .scanner-layout {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    align-items: start;
  }

  .cellar-layout {
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
    align-items: start;
  }

  .cellar-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-hero-card {
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
    align-items: stretch;
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 799px) {
  .scanner-page {
    width: min(100% - 14px, 580px);
    padding-top: 14px;
  }

  .scanner-hero {
    margin-bottom: 14px;
    padding-top: 10px;
  }

  .scanner-hero h1 {
    max-width: 9ch;
    font-size: clamp(2.7rem, 12vw, 4.1rem);
  }

  .hero-nav {
    align-items: flex-start;
    gap: 10px;
  }

  .hero-link-row {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .hero-link-row::-webkit-scrollbar {
    display: none;
  }

  .hero-link,
  .profile-trigger-button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.86rem;
  }

  .hero-cellar-select-shell .text-input {
    min-height: 38px;
    padding: 0 30px 0 10px;
    font-size: 0.84rem;
  }

  .hero-copy {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .camera-surface {
    min-height: 250px;
    height: min(54vh, 310px);
  }

  .scanner-layout {
    gap: 12px;
  }

  .cellar-layout {
    gap: 12px;
  }

  .hero-meta-row,
  .edit-grid,
  .result-grid,
  .cellar-meta,
  .cellar-facts,
  .stats-kpi-grid {
    grid-template-columns: 1fr;
  }

  .cellar-rating-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .rating-strip-side {
    justify-content: flex-start;
  }

  .cellar-badge-row {
    grid-template-columns: 1fr;
  }

  .save-controls {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cellar-search-bar {
    grid-template-columns: 1fr;
    margin-top: 12px;
    padding: 12px;
    gap: 10px;
  }

  .cellar-list {
    margin-top: 12px;
    gap: 10px;
  }

  .cellar-card {
    padding: 14px;
    border-radius: 22px;
  }

  .cellar-card-visual {
    gap: 10px;
  }

  .cellar-bottle-shell {
    min-height: 152px;
  }

  .cellar-bottle-image {
    max-height: 136px;
  }

  .cellar-origin-shell {
    gap: 10px;
    padding: 10px 12px;
  }

  .cellar-origin-map {
    min-height: 44px;
  }

  .cellar-origin-map svg {
    max-height: 44px;
  }

  .cellar-card-controls {
    gap: 8px;
  }

  .cellar-card-controls .ghost-button,
  .cellar-card-controls .primary-button {
    width: 100%;
    min-width: 0;
  }

  .cellar-card-title {
    font-size: clamp(1rem, 4.8vw, 1.24rem);
    overflow-wrap: anywhere;
  }

  .cellar-style-badge {
    width: 100%;
    padding: 8px 10px 9px;
    border-radius: 14px;
  }

  .cellar-style-badge-value {
    font-size: 0.82rem;
  }

  .quantity-block {
    margin-top: 8px;
    justify-self: start;
  }

  .year-picker-modal {
    padding: 14px;
  }

  .year-picker-dialog {
    width: min(100%, 560px);
    max-height: calc(100vh - 28px);
    overflow: auto;
    padding: 16px;
    border-radius: 20px;
  }

  .year-picker-actions {
    justify-content: stretch;
  }

  .year-picker-actions .ghost-button,
  .year-picker-actions .primary-button {
    width: 100%;
  }

  .cellar-empty {
    min-height: 280px;
  }

  .pairing-selected-wine-row,
  .pairing-assistant-actions,
  .cellar-card-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .pairing-menu-head,
  .pairing-menu-course-top,
  .pairing-menu-wine-top {
    flex-direction: column;
    align-items: stretch;
  }

  .pairing-dish-card-compact {
    grid-template-columns: 1fr;
  }

  .pairing-dish-card.is-chosen {
    grid-template-columns: 1fr;
  }

  .cellar-card-lead {
    grid-template-columns: 1fr;
  }

  .cellar-topbar-main,
  .cellar-topbar-cellar {
    grid-template-columns: 1fr;
    display: grid;
    align-items: stretch;
  }

  .hero-link-row {
    margin-left: auto;
  }

  .hero-brand {
    display: none;
  }

  .cellar-topbar-actions {
    justify-content: stretch;
  }

  .profile-trigger-button {
    width: auto;
    min-width: 42px;
    padding: 0 10px;
    justify-content: center;
  }

  .profile-trigger-button .profile-trigger-label {
    display: none;
  }

  .cellar-management-panel {
    width: min(560px, calc(100vw - 24px));
    right: 0;
  }

  .profile-mini {
    flex-direction: column;
  }

  .profile-mini-actions {
    width: 100%;
    justify-content: stretch;
  }

  .cellar-sharing-shell,
  .cellar-create-shell,
  .cellar-share-block,
  .settings-cellar-item {
    grid-template-columns: 1fr;
  }

  .save-controls .primary-button {
    width: 100%;
    min-width: 0;
  }

  .capture-stage,
  .result-stage {
    padding: 14px;
    border-radius: 24px;
  }

  .cellar-summary-stage,
  .cellar-inventory-stage {
    border-radius: 24px;
  }

  .result-hero-card {
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
  }

  .stage-panel,
  .result-panel,
  .save-panel {
    margin-top: 12px;
    padding: 12px;
    border-radius: 16px;
  }

  .camera-actions {
    gap: 10px;
  }

  .ghost-button,
  .primary-button {
    min-height: 48px;
    border-radius: 14px;
    padding: 0 14px;
  }

  .result-header,
  .save-panel,
  .panel-head,
  .stage-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .cellar-summary-head,
  .cellar-inventory-head,
  .cellar-card-head {
      grid-template-columns: 1fr;
      align-items: start;
    }

    .quantity-block {
      justify-self: start;
      justify-content: start;
    }

  .result-flags {
    justify-content: flex-start;
  }

}

@media (max-width: 520px) {
  .scanner-page {
    width: calc(100% - 12px);
    padding-top: 10px;
  }

  .scanner-hero h1 {
    font-size: clamp(2.1rem, 9.4vw, 2.9rem);
  }

  .hero-logo-frame {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }

  .hero-logo {
    width: 72px;
    height: 72px;
  }

  .hero-link-row {
    gap: 6px;
  }

  .hero-link,
  .profile-trigger-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .camera-surface {
    min-height: 230px;
    height: min(50vh, 280px);
  }

  .camera-actions {
    grid-template-columns: 1fr;
  }

  .cellar-summary-stage,
  .cellar-inventory-stage {
    padding: 12px;
  }

  .cellar-card {
    padding: 12px;
    border-radius: 18px;
  }

  .cellar-bottle-shell,
  .cellar-origin-shell {
    border-radius: 16px;
  }

  .cellar-bottle-shell {
    min-height: 138px;
    padding: 10px;
  }

  .cellar-bottle-image {
    max-height: 120px;
  }

  .cellar-card-title {
    font-size: 1.04rem;
    line-height: 1.22;
  }

  .cellar-card-subtitle {
    margin-top: 6px;
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .cellar-badge-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .quantity-block {
    grid-auto-columns: minmax(32px, auto);
    padding: 4px;
  }

  .quantity-button {
    min-width: 30px;
    min-height: 30px;
  }

  .quantity-value {
    min-width: 24px;
    font-size: 0.84rem;
  }

  .year-picker-modal {
    padding: 10px;
  }

  .year-picker-dialog {
    max-height: calc(100vh - 20px);
    padding: 14px;
    border-radius: 18px;
  }

  .year-picker-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
  }

  .year-picker-actions {
    margin-top: 14px;
    gap: 8px;
  }

  .cellar-empty {
    min-height: 220px;
  }

  .result-empty h2,
  #wine-name {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  .hero-summary {
    font-size: 0.95rem;
    line-height: 1.62;
  }

  .bottle-spotlight {
    min-height: 260px;
  }

  .bottle-image {
    max-height: 220px;
  }

}
