html {
    touch-action: manipulation;
}

:root {
  --bg: #f5f2ed;
  --ink: #221f1f;
  --muted: #6f6963;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #fffdf9;
  --border: rgba(61, 50, 43, 0.13);
  --brand: #5e1f2f;
  --brand-dark: #39121d;
  --accent: #b88746;
  --green: #236850;
  --blue: #314f7f;
  --danger: #9f322d;
  --shadow: 0 18px 48px rgba(43, 31, 24, 0.16);
  --soft-shadow: 0 8px 24px rgba(43, 31, 24, 0.11);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app,
.home-shell {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.home-shell {
  display: flex;
  flex-direction: column;
}
.home-shell::before{
      content: "";
    position: absolute;
    inset: -10px; /* prevents blur edges */
    background:url("/assets/images/winecellar2.avif") center / cover no-repeat;
    background-size: cover;
    background-position: center;
    filter: blur(3px);

    z-index: -1;
}

.app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.app::before,
.home-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.app::before {
  inset: -10px; /* prevents blur edges */
  background: url("/assets/images/winecellar2.avif") center / cover no-repeat;
  background-size: cover;
  background-position: center;
  filter: blur(3px);
  z-index: -1;
}

.top-bar {
  min-height: 72px;
  padding: 16px clamp(18px, 5vw, 48px);
  position: relative;
  z-index: 1;
  border: 0;
  background: rgba(48, 20, 29, 0.95);
  color: white;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

button.top-bar {
  width: 100%;
  cursor: pointer;
}

.logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex: 0 0 auto;
}


.current-cellar{
  margin-top:0px;
  margin-bottom:0px;
  margin-left:0px;
  color: rgb(255, 255, 255);
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.05;
}

.top-bar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cellar-switch-button,
.account-button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  font: inherit;
  transition: background 160ms ease, border-color 160ms ease;
}

.cellar-switch-button {
  max-width: min(34vw, 260px);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.top-bar-action-label {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.68rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-shell .current-cellar {
  max-width: 100%;
  margin: 1px 0 0;
  overflow: hidden;
  color: white;
  font-size: 0.88rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button {
  padding: 0 15px;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 760;
}

.cellar-switch-button:hover,
.account-button:hover,
.cellar-switch-button:focus-visible,
.account-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.brand-title,
.title {
  margin: 0;
  color: white;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.05;
}

.brand-title {
  font-size: clamp(1.45rem, 5vw, 2.15rem);
}

.title {
  font-size: clamp(1.35rem, 4.2vw, 2rem);
}

.content-panel {
  width: min(1120px, calc(100% - 32px));
  position: relative;
  z-index: 1;
  margin: 22px auto;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.home-panel {
  width: min(900px, calc(100% - 32px));
  margin-top: clamp(26px, 8vh, 72px);
}

.insights-panel {
  width: min(900px, calc(100% - 32px));
  min-width: 0;
  max-width: calc(100% - 24px);
  margin-top: clamp(26px, 6vh, 56px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.insights-heading {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 1.1rem;
}

.insights-caption {
  margin: -5px 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.insight-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.insight-type-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 112px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 720;
}

.insight-type-item strong {
  margin-left: auto;
  color: var(--ink);
  font-size: 1rem;
}

.insight-type-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--brand);
}

.insight-type-item:nth-child(2) .insight-type-dot { background: #d9bf64; }
.insight-type-item:nth-child(3) .insight-type-dot { background: #d77b91; }
.insight-type-item:nth-child(4) .insight-type-dot { background: #df8e43; }
.insight-type-item:nth-child(5) .insight-type-dot { background: #759abf; }
.insight-type-item:nth-child(6) .insight-type-dot { background: #aa7658; }
.insight-type-item:nth-child(7) .insight-type-dot { background: #735975; }

.drink-soon-list {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.drink-soon-item {
  min-width: min(285px, 82vw);
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: var(--soft-shadow);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  scroll-snap-align: start;
}

.drink-soon-item > span:first-child {
  display: grid;
  gap: 4px;
}

.drink-soon-item small,
.drink-by {
  color: var(--muted);
  font-size: 0.86rem;
}

.drink-by {
  text-align: left;
}

.drink-by strong {
  color: var(--brand);
}

.drink-soon-view {
  align-self: stretch;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.drink-soon-view:hover,
.drink-soon-view:focus-visible {
  outline: 0;
  background: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(94, 31, 47, 0.14);
}

.insights-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.cellar-index-page {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.cellar-index-page .home-panel {
  min-height: 0;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
}

/* scan review page: keep the nav pinned and scroll the list inside the panel */
.scan-review-page .scan-review-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.scan-review-page .scan-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.home-intro {
  max-width: 650px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-intro h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.65rem, 5vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.home-intro p {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 2.8vw, 1.08rem);
  line-height: 1.6;
}

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

.bottomNavbarImage {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}
.actionIconImage {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex: 0 0 auto;
}

.stat-icon .actionIconImage {
  width: 70%;
  height: 70%;
  flex: 0 1 auto;
  display: block;
}

.menu-btn {
  min-height: 140px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-solid);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  box-shadow: var(--soft-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.menu-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 31, 47, 0.35);
  box-shadow: 0 14px 34px rgba(43, 31, 24, 0.16);
}

.menu-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4eee6;
  color: var(--brand);
}

.menu-icon img {
  width: 100%;
  height: 100%;
  display: block;  
}

.menu-icon.plus {
  padding-bottom: 3px;
  font-size: 2rem;
  line-height: 1;
  font-weight: 500;
}

.menu-btn span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.menu-btn strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  line-height: 1.15;
}

.workspace-panel {
  min-height: 0;
  height: auto;
  align-self: stretch;
  width: min(1120px, calc(100% - 32px));
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-container {
  display: flex;
  gap: 10px;
}

.cellar-filter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.wine-type-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.cellar-filter-label {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.cellar-filter:has(input:focus-visible) {
  border-color: rgba(94, 31, 47, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 31, 47, 0.12);
}

.wine-sort,
.sort-direction-btn {
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.wine-sort {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  white-space: nowrap;
}

.wine-sort span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.wine-sort-select {
  min-width: 142px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.wine-sort-caret {
  margin-left: 6px;
  color: var(--brand);
  font-size: 1.1rem;
  line-height: 0;
}

.wine-sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 5;
  width: max-content;
  min-width: 220px;
  overflow: hidden;
  border: 1px solid rgba(94, 31, 47, 0.2);
  border-radius: 10px;
  background: #fffdf9;
  box-shadow: 0 14px 30px rgba(43, 31, 24, 0.2);
}

.wine-sort-menu button {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid rgba(61, 50, 43, 0.1);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.wine-sort-menu button:last-child {
  border-bottom: 0;
}

.wine-sort-menu button:hover,
.wine-sort-menu button:focus-visible,
.wine-sort-menu button[aria-selected="true"] {
  outline: 0;
  background: #f3e9e2;
  color: var(--brand-dark);
}

/* Native wine-type selects use the same visual treatment as the sort menu. */
.wine-type-select,
.form-card select.input-field,
.scan-field select {
  appearance: none;
  min-height: 40px;
  padding: 10px 38px 10px 14px;
  border: 1px solid rgba(94, 31, 47, 0.2);
  border-radius: 10px;
  outline: 0;
  background-color: #fffdf9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235e1f2f' d='m1.4 1.1 4.6 4.6 4.6-4.6L12 2.5 6 8 0 2.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  box-shadow: 0 14px 30px rgba(43, 31, 24, 0.12);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.wine-type-select:hover,
.form-card select.input-field:hover,
.scan-field select:hover,
.wine-type-select:focus-visible,
.form-card select.input-field:focus-visible,
.scan-field select:focus-visible {
  border-color: rgba(94, 31, 47, 0.55);
  background-color: #f3e9e2;
  box-shadow: 0 0 0 3px rgba(94, 31, 47, 0.12);
}

.wine-type-select option,
.form-card select.input-field option,
.scan-field select option {
  background: #fffdf9;
  color: var(--ink);
}

.sort-direction-btn {
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.wine-sort:focus-within,
.sort-direction-btn:focus-visible {
  border-color: rgba(94, 31, 47, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 31, 47, 0.12);
}

.sort-direction-btn:hover {
  border-color: rgba(94, 31, 47, 0.35);
  background: #faf5f0;
}
.search-btn {
  width: 56px;
  height: 52px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--soft-shadow);
  transition: transform 160ms ease, background 160ms ease;
}
.search-box {
  min-width: 180px;
  height: 52px;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px;
  outline: none;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(35, 24, 18, 0.04);
}

.search-box::placeholder {
  color: #8c8580;
}

.search-box:focus {
  border-color: rgba(94, 31, 47, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 31, 47, 0.12);
}

.switch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 60px;
  height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: rgba(94, 31, 47, 1);;
}

input:focus + .slider {
  box-shadow: 0 0 1px rgba(94, 31, 47, 1);;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.pairing-summary {
  min-height: 1.4rem;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.wine-list,
.cellar-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.wine-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--wine-accent, var(--brand));
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-solid);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  box-shadow: 0 4px 16px rgba(43, 31, 24, 0.08);
}

.wine-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wine-name {
  color: var(--ink);
  font-size: clamp(1rem, 2.7vw, 1.18rem);
  font-weight: 760;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.wine-details {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.wine-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}

.action-btn,
.quantity-pill {
  border: 0;
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 0.85rem;
  font-weight: 720;
  white-space: nowrap;
}

.action-btn {
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.96);
}

.view-btn {
  background: #efe8df;
  color: var(--brand-dark);
}

.delete-btn {
  background: var(--danger);
  color: white;
}

.out-of-stock-label {
  border: 0;
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 0.85rem;
  font-weight: 720;
  white-space: nowrap;

  background: var(--danger);
  color: white;
}

.out-of-stock {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 720;
  white-space: nowrap;
}

.quantity-pill {
  background: var(--brand);
  color: #ffffff;
}


.tasting-note-remove-icon {
  width: 300%;
  height: 300%;
  display: block;
}
.tasting-notes-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.tasting-note-tag {
  border-radius: 999px;
  padding: 5px 9px;
  background: #f4eee6;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.pairing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.pairing-tag {
  border-radius: 999px;
  padding: 5px 9px;
  background: #f4eee6;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.bottom-nav {
  height: 52px;
  margin-top: auto;
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(48, 20, 29, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-btn {
  border: 0;
  background: transparent;
  color: white;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 720;
}

.wine-list::-webkit-scrollbar,
.cellar-list::-webkit-scrollbar {
  width: 8px;
}

.wine-list::-webkit-scrollbar-thumb,
.cellar-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(94, 31, 47, 0.28);
}

.wine-detail-panel {
  min-height: 0;
  align-self: stretch;
  margin: 16px auto;
  overflow-y: auto;
}

.wine-detail-layout {
  display: grid;
  grid-template-columns: minmax(190px, 280px) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 34px);
  min-height: 100%;
}

.bottle-placeholder {
  min-height: 360px;
  border: 1px dashed rgba(94, 31, 47, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(244, 238, 230, 0.62), rgba(255, 253, 249, 0.92));
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.bottle-image {
  width: auto;
  height: auto;
  max-width: min(100%, 280px);
  max-height: 430px;
  object-fit: contain;
  display: block;
}

/* Once a bottle photo is available, let the frame shrink-wrap it rather than
   retaining the fixed placeholder dimensions. */
.bottle-placeholder:has(.bottle-image:not([hidden])) {
  position: relative;
  justify-self: start;
  align-self: start;
  min-height: 0;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
}

.bottle-placeholder:has(.bottle-image:not([hidden]))::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(94, 31, 47, 0.32);
  border-radius: var(--radius);
  pointer-events: none;
}

.bottle-image:not([hidden]) + .bottle-silhouette {
  display: none;
}

.bottle-silhouette {
  width: 74px;
  height: 250px;
  border: 2px solid rgba(94, 31, 47, 0.22);
  border-radius: 26px 26px 10px 10px;
  position: relative;
}

.bottle-silhouette::before {
  content: "";
  position: absolute;
  top: -74px;
  left: 23px;
  width: 24px;
  height: 82px;
  border: 2px solid rgba(94, 31, 47, 0.22);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.bottle-silhouette::after {
  content: "Bottle image";
  position: absolute;
  left: 50%;
  bottom: 82px;
  transform: translateX(-50%);
  width: 112px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.wine-detail-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wine-detail-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wine-detail-title {
  border: None;
  background:transparent;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.05;
  font-weight: 600;
}

.wine-detail-subtitle {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

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

.detail-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.detail-stat {
  min-width: 100px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 13px;
}

.detail-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-value {
  border:none;
  margin: 0;
  color: var(--ink);
  width:100%;
  font-weight: 760;
  line-height: 1.35;
}
.detail-value:focus {
  outline: none;
}

.detail-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.detail-section h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1rem;
}

.detail-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tasting-note-form,
.pairing-form,
.custom-note-form {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.tasting-note-input,
.pairing-input,
.custom-note-input {
  height: 40px;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

.tasting-note-input:focus,
.pairing-input:focus,
.custom-note-input:focus {
  border-color: rgba(94, 31, 47, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 31, 47, 0.12);
}

.tasting-note-add,
.pairing-add,
.custom-note-update {
  height: 40px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  font-weight: 760;
}

.general-update {
  height: 40px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  font-weight: 760;
}

.tasting-note-tag,
.pairing-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tasting-note-remove,
.pairing-remove {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;

  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.tasting-note-add:disabled,
.tasting-note-input:disabled,
.tasting-note-remove:disabled,
.pairing-add:disabled,
.pairing-input:disabled,
.pairing-remove:disabled,
.custom-note-update:disabled,
.custom-note-input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.custom-note-input {
  min-height: 40px;
  max-height: 240px;
  box-sizing: border-box;
  padding: 10px 12px;
  resize: none;
  overflow-y: auto;
  font: inherit;
  line-height: 1.35;
}

.note-status {
  min-height: 1.2rem;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.note-status.is-error {
  color: var(--danger);
}

.detail-empty {
  color: var(--muted);
}

.detail-nav {
  gap: 18px;
}

.camera-body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  background: #090706;
  color: white;
  font-family: var(--font);
}

.camera-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 5, 5, 0.72) 0%, transparent 26%, transparent 62%, rgba(8, 5, 5, 0.82) 100%),
    linear-gradient(90deg, rgba(8, 5, 5, 0.22), transparent 25%, transparent 75%, rgba(8, 5, 5, 0.22));
}

#previewVideo,
#PostCaptureImage,
#camera {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050404;
}

.camera-crop-box {
  position: fixed;
  top: 25%;
  left: 25%;
  width: 50%;
  height: 50%;
  z-index: 2;
  pointer-events: none;
}

.camera-crop-corner {
  position: absolute;
  width: clamp(48px, 11vw, 84px);
  height: clamp(48px, 11vw, 84px);
  border: 3px solid rgba(180, 180, 180, 0.9);
}

.camera-crop-corner--top-left {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 18px 0 0;
}

.camera-crop-corner--top-right {
  top: 0;
  right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0 18px 0 0;
}

.camera-crop-corner--bottom-left {
  bottom: 0;
  left: 0;
  border-top: 0;
  border-right: 0;
  border-radius: 0 0 0 18px;
}

.camera-crop-corner--bottom-right {
  right: 0;
  bottom: 0;
  border-top: 0;
  border-left: 0;
  border-radius: 0 0 18px;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.camera-top,
.camera-bottom {
  display: flex;
  align-items: center;
  padding: clamp(18px, 4vw, 30px);
  pointer-events: auto;
}

.camera-top {
  justify-content: space-between;
  gap: 14px;
}

.camera-bottom {
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding-bottom: max(clamp(22px, 5vw, 38px), env(safe-area-inset-bottom));
}

.camera-title {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42);
}

.camera-title span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.camera-title strong {
  color: #fff;
  font-size: clamp(1rem, 3.2vw, 1.2rem);
  line-height: 1.15;
}

.camera-guidance {
  max-width: 330px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.87rem;
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.54);
}

.scanner-body {
  background: #090706;
}

.scanner-status-pill {
  min-width: 140px;
  max-width: min(44vw, 220px);
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(14, 10, 10, 0.68);
  color: #f5f2ed;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

.scanner-controls {
  display: flex;
  justify-content: center;
}

#scannerButton {
  min-width: 170px;
  padding: 14px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

#scannerButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.28);
}

.camera-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

#statusText {
  max-width: min(76vw, 620px);
  color: #f5f2ed;
  font-size: 0.96rem;
  line-height: 1.45;
}

.icon-button,
#captureButton {
  border: 0;
  background: none;
  cursor: pointer;
}

.camera-back-button,
.icon-button,
#captureButton {
  -webkit-tap-highlight-color: transparent;
}

.camera-back-button {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(28, 17, 16, 0.38);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.camera-back-button img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

#switchCameraButton {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(28, 17, 16, 0.38);
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
}

#switchCameraButton img {
  width: 22px;
  height: 22px;
}

#uploadButton {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(28, 17, 16, 0.52);
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
}

#uploadButton img {
  width: 22px;
  height: 22px;
}

#captureButton {
  width: 88px;
  height: 88px;
  border: 3px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 0 0 5px rgba(255, 255, 255, 0.12);
  position: relative;
  transition: transform 160ms ease, background 160ms ease;
}

#captureButton::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: #fffdf9;
}

.camera-back-button:hover,
#switchCameraButton:hover,
#uploadButton:hover {
  background: rgba(61, 24, 34, 0.74);
}

#captureButton:hover {
  transform: scale(1.04);
  background: rgba(255, 255, 255, 0.24);
}

#captureButton:disabled,
#switchCameraButton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#overlayDiv {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.48);
}

.loader {
  width: 48px;
  aspect-ratio: 1;
  border: 6px solid;
  border-color: #fff transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 5, 5, 0.56);
  backdrop-filter: blur(6px);
  visibility: hidden;
}

.popup-card {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(31, 18, 15, 0.96);
  color: #f6f0ea;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.popup-card h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  line-height: 1.2;
}

.popup-card p {
  margin: 0;
  color: rgba(246, 240, 234, 0.86);
  line-height: 1.5;
}

.popup-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.popup-actions button {
  min-width: 92px;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #f5f2ed;
  color: #221f1f;
  font-weight: 700;
  cursor: pointer;
}

.popup-actions [data-delete-confirm] {
  background: #b42318;
  color: #fff;
}

.popup-actions [data-delete-confirm]:hover {
  background: #8f1b13;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.verify-page {
  min-height: 100vh;
  overflow: hidden;
  background: #090706;
  font-family: var(--font);
}

.background {
  position: fixed;
  inset: 0;
  background: url("/assets/images/HomePagebg.png") center / cover no-repeat;
  filter: blur(3px);
  transform: scale(1.02);
}

.verify-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}

.verify-container {
  min-height: 100vh;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: clamp(18px, 4vw, 36px);
}

.form-card {
  width: min(430px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 5vw, 30px);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(12px);
}

.form-card h1 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  line-height: 1.12;
}

.form-card p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.45;
}

.input-field {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

.input-field:focus {
  border-color: rgba(94, 31, 47, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 31, 47, 0.12);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.submit-btn {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  font-weight: 760;
}

.submit-btn.secondary {
  background: #efe8df;
  color: var(--brand-dark);
}

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(33, 20, 16, 0.48), rgba(33, 20, 16, 0.22)),
    url("/assets/images/HomePagebg.png") center / cover no-repeat;
}

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 48px);
}

.auth-card {
  width: min(460px, 100%);
  padding: clamp(24px, 5vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 24px 60px rgba(31, 18, 15, 0.3);
  backdrop-filter: blur(12px);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-dark);
  font-size: 1.05rem;
  font-weight: 800;
}

.auth-logo {
  width: 34px;
  height: 34px;
}

.auth-intro {
  margin: 28px 0 24px;
}

.auth-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.85rem, 6vw, 2.45rem);
  line-height: 1.08;
}

.auth-intro > p:last-child {
  margin: 11px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #efe8df;
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  cursor: pointer;
}

.auth-tab.is-active {
  background: #fffdf9;
  color: var(--brand-dark);
  box-shadow: 0 2px 7px rgba(43, 31, 24, 0.12);
}

.auth-form {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.auth-form label {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 720;
}

.auth-form input {
  width: 100%;
  height: 48px;
  margin-bottom: 8px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  background: #fff;
  color: var(--ink);
}
.auth-form p {
  width: 100%;
  margin-bottom: 8px;
  margin-left:0px;
  outline: 0; 
  font-weight: 800;
  color: var(--brand);
}

.auth-form input:focus {
  border-color: rgba(94, 31, 47, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 31, 47, 0.12);
}

.auth-form .submit-btn {
  margin-top: 8px;
}

.auth-status {
  min-height: 1.3rem;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.settings-page {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: url("/assets/images/winecellar2.avif") center / cover no-repeat fixed;
}

.settings-page::before {
  content: "";
  position: fixed;
  inset: -10px; /* prevents blur edges */
  background: url("/assets/images/winecellar2.avif") center / cover no-repeat;
  background-size: cover;
  background-position: center;
  filter: blur(3px);
  z-index: -1;
  pointer-events: none;
}


.settings-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 48px);
}


.settings-card {
  width: min(760px, 100%);
  padding: clamp(24px, 5vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 24px 60px rgba(31, 18, 15, 0.3);
  backdrop-filter: blur(12px);
}

.settings-card .auth-brand {
  width: 100%;
  justify-content: center;
  gap: 13px;
  font-size: 1.3rem;
}

.settings-card .auth-logo {
  width: 48px;
  height: 48px;
}

.settings-back-link {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--brand);
  font-size: 0.88rem;
  font-weight: 760;
  text-decoration: none;
}

.settings-back-link:hover,
.settings-back-link:focus-visible {
  color: var(--brand-dark);
  text-decoration: underline;
}

.settings-intro {
  margin: 26px 0 24px;
}

.settings-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.85rem, 6vw, 2.45rem);
  line-height: 1.08;
}

.settings-intro > p:last-child,
.settings-section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.settings-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #efe8df;
}

.settings-tab {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.settings-tab.is-active {
  background: #fffdf9;
  color: var(--brand-dark);
  box-shadow: 0 2px 7px rgba(43, 31, 24, 0.12);
}

.settings-panel {
  padding-top: 26px;
}

.settings-section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.1rem;
}

.settings-password-heading {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.settings-form {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  max-width: 460px;
}

.settings-form label {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 720;
}

.settings-form input {
  width: 100%;
  height: 48px;
  margin-bottom: 8px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  background: #fff;
  color: var(--ink);
}

.settings-form input:focus {
  border-color: rgba(94, 31, 47, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 31, 47, 0.12);
}

.settings-form .submit-btn {
  width: fit-content;
  min-width: 150px;
  margin-top: 4px;
}

.settings-status {
  min-height: 1.3rem;
  margin: 16px 0 0;
  color: var(--green);
  font-size: 0.9rem;
  line-height: 1.45;
}

.settings-status.is-error {
  color: var(--danger);
}

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

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffdf9;
  box-shadow: var(--soft-shadow);
}

.plan-card-featured {
  border-color: rgba(94, 31, 47, 0.4);
}

.plan-card.is-selected {
  border: 2px solid var(--brand);
  padding: 21px;
  box-shadow: 0 12px 28px rgba(94, 31, 47, 0.16);
}

.plan-label,
.plan-badge {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.plan-label {
  color: var(--muted);
}

.plan-badge {
  width: fit-content;
  margin-bottom: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f3e6d7;
  color: var(--brand-dark);
}

.plan-card h3 {
  margin: 11px 0 0;
  color: var(--ink);
  font-size: 1.32rem;
}

.plan-price {
  margin: 14px 0 0;
  color: var(--brand-dark);
  font-size: 1.65rem;
  font-weight: 800;
}

.plan-price span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 650;
}

.plan-features {
  display: grid;
  gap: 10px;
  margin: 22px 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  list-style: none;
}

.plan-features li::before {
  content: "✓";
  margin-right: 8px;
  color: var(--green);
  font-weight: 800;
}

.plan-select-button {
  min-height: 42px;
  margin-top: auto;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.plan-card-featured .plan-select-button,
.plan-card.is-selected .plan-select-button {
  background: var(--brand);
  color: white;
}

.plan-select-button:hover,
.plan-select-button:focus-visible {
  background: var(--brand-dark);
  color: white;
  outline: none;
}

@media (max-width: 760px) {
  .top-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .top-bar-actions {
    gap: 6px;
  }

  .cellar-switch-button {
    max-width: 132px;
    padding-inline: 9px;
  }

  .account-button {
    padding-inline: 10px;
  }

  .content-panel {
    width: calc(100% - 24px);
    margin: 12px auto;
    padding: 16px;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .insight-type-grid {
    gap: 8px 12px;
  }

  .insight-type-item {
    flex: 1 1 130px;
  }

  .drink-soon-item {
    min-width: min(250px, 78vw);
  }

  .add-remove-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .add-remove-grid .menu-btn {
    min-height: 0;
    padding: 14px 12px;
  }

  .add-remove-grid .menu-btn span {
    font-size: 0.74rem;
  }

  .add-remove-grid .menu-btn strong {
    font-size: 1rem;
  }

  .menu-btn {
    min-height: 132px;
  }

  .workspace-panel {
    height: auto;
    min-height: 0;
  }

  .search-container {
    flex-wrap: wrap;
  }

  .search-box {
    flex-basis: 100%;
  }

  .wine-sort {
    flex: 1 1 190px;
    justify-content: space-between;
  }

  .wine-card {
    align-items: flex-start;
    flex-direction: column;
  }
  
  .wine-detail-layout {
    grid-template-columns: 1fr;
  }

  .bottle-placeholder {
    min-height: 220px;
  }

  .bottle-placeholder:has(.bottle-image:not([hidden])) {
    min-height: 0;
  }

  .bottle-silhouette {
    height: 150px;
  }

  .bottle-silhouette::before {
    top: -48px;
    height: 54px;
  }

  .bottle-silhouette::after {
    bottom: 46px;
  }

  .general-detail-form {
    grid-template-columns: 1fr;
  }

  .wine-actions {
    width: 100%;
  }

  .action-btn {
    flex: 1;
  }

  .quantity-pill {
    white-space: normal;
  }

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

@media (max-width: 430px) {
  .top-bar {
    padding-inline: 12px;
    gap: 9px;
  }

  .brand-title {
    font-size: 1.18rem;
  }

  .cellar-switch-button {
    max-width: 102px;
  }

  .top-bar-action-label {
    display: none;
  }

  .home-shell .current-cellar {
    margin: 0;
  }

  .settings-shell {
    padding: 12px;
  }

  .settings-card {
    padding: 22px 18px;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .settings-form .submit-btn {
    width: 100%;
  }
}


.index-intro {
  max-width: 650px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.index-intro h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.65rem, 5vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.index-intro p {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 2.8vw, 1.08rem);
  line-height: 1.6;
}

.add-remove-panel {
  gap: 20px;
}

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

.add-remove-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.add-remove-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
}




.cellar-picker-panel {
  gap: 0;
}

.cellar-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.cellar-picker-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
}

.cellar-create-btn {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 760;
}

.cellar-create-form {
  margin-bottom: 14px;
}

.cellar-create-form label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
}

/* ------------------------------------------------------------------
   Cellars page (dashboard-style)
------------------------------------------------------------------- */
.dashboard-page .cellars-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-page .cellar-picker-heading {
  margin-bottom: 0;
}

.dashboard-page .cellar-picker-heading h3 {
  color: #1c1110;
  font-size: 1.2rem;
  font-weight: 750;
}

.dashboard-page .cellar-create-btn {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 14px;
  background: #72162b;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 720;
  transition: background 160ms ease;
}

.dashboard-page .cellar-create-btn:hover {
  background: #5e1f2f;
}

.dashboard-page .cellar-create-form {
  margin-bottom: 0;
}

.dashboard-page .cellar-create-form label {
  color: #796e69;
}

.dashboard-page .cellar-create-controls input {
  min-height: 42px;
  border-color: rgba(94, 31, 47, 0.18);
  background: #fffdf9;
  color: #1c1110;
}

.dashboard-page .cellar-picker-status {
  color: #2e7d32;
}

.dashboard-page .cellar-picker-list {
  gap: 12px;
  overflow: visible;
}

.dashboard-page .cellar-choice-card {
  border-color: rgba(51, 28, 20, 0.1);
  background: #fffdfb;
  box-shadow: 0 4px 12px rgba(37, 16, 9, 0.06);
  padding: 18px;
  border-radius: 14px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.dashboard-page .cellar-choice-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(37, 16, 9, 0.1);
}

.dashboard-page .cellar-choice-card h4 {
  color: #1c1110;
  font-size: 1.25rem;
  font-weight: 750;
}

.dashboard-page .cellar-bottle-count {
  margin-top: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #f4eee6;
  color: #5e1f2f;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-block;
}

.dashboard-page .cellar-card-actions {
  display: flex;
  gap: 10px;
}

.dashboard-page .cellar-card-actions .view-btn {
  background: #efe8df;
  color: #5e1f2f;
}

.dashboard-page .cellar-card-actions .delete-btn {
  background: #b23b3b;
  color: #fff;
}

.dashboard-page .cellar-empty-state {
  border: 1px dashed rgba(51, 28, 20, 0.18);
  border-radius: var(--radius);
  background: transparent;
  box-shadow: none;
  color: #796e69;
  padding: 20px;
}

/* ------------------------------------------------------------------
   Search-wines page (dashboard-style)
   Adapts the wine search controls + list to the light dashboard card.
------------------------------------------------------------------- */
.dashboard-page .search-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-page .search-container {
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.dashboard-page .search-box {
  flex: 1 1 220px;
  min-width: 0;
  height: 42px;
  min-height: 0;
  font-size: 0.92rem;
}

.dashboard-page .filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(94, 31, 47, 0.22);
  border-radius: var(--radius);
  background: #fffdf9;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.dashboard-page .filter-toggle-btn:hover,
.dashboard-page .filter-toggle-btn[aria-expanded="true"] {
  border-color: rgba(94, 31, 47, 0.55);
  background: #f3e9e2;
}

.dashboard-page .filter-toggle-btn .actionIconImage {
  width: 20px;
  height: 20px;
}

.dashboard-page .filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(94, 31, 47, 0.16);
  border-radius: var(--radius);
  background: #fbf5ef;
}

.dashboard-page .filter-panel[hidden] {
  display: none;
}

.dashboard-page .cellar-filter,
.dashboard-page .wine-type-filter,
.dashboard-page .wine-sort,
.dashboard-page .sort-direction-btn {
  height: 40px;
  min-height: 0;
  padding: 0 12px;
  border-color: rgba(94, 31, 47, 0.18);
  background: #fffdf9;
  color: var(--ink);
}

.dashboard-page .wine-sort-select {
  min-width: 0;
  padding: 0;
  line-height: 40px;
}

.dashboard-page .wine-type-select {
  min-height: 0;
  height: 40px;
  padding: 0 38px 0 14px;
  line-height: 40px;
}

.dashboard-page .switch {
  height: 26px;
  width: 46px;
}

.dashboard-page .slider:before {
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
}

.dashboard-page input:checked + .slider:before {
  transform: translateX(20px);
}

.dashboard-page .wine-list {
  flex: none;
  max-height: none;
  overflow: visible;
  gap: 12px;
  padding-right: 0;
}

.dashboard-page .wine-card {
  border-left-width: 4px;
  box-shadow: 0 4px 12px rgba(37, 16, 9, 0.06);
}

.dashboard-page .wine-list::-webkit-scrollbar {
  width: 0;
}

/* ------------------------------------------------------------------
   Pairings page (dashboard-style)
------------------------------------------------------------------- */
.dashboard-page .pairings-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-page .pairings-section .search-container {
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard-page .pairings-section .search-box {
  flex: 1 1 0;
  height: 42px;
  min-height: 0;
  font-size: 0.92rem;
}

.dashboard-page .pairing-summary {
  min-height: 1.4rem;
  color: #796e69;
  font-size: 0.92rem;
  line-height: 1.45;
}

.dashboard-page .pairings-section .wine-list {
  flex: none;
  max-height: none;
  overflow: visible;
  gap: 12px;
  padding-right: 0;
}

.dashboard-page .pairings-section .wine-card {
  border-left-width: 4px;
  box-shadow: 0 4px 12px rgba(37, 16, 9, 0.06);
}

.dashboard-page .pairings-section .pairing-tags {
  margin-top: 8px;
}

.dashboard-page .pairings-section .pairing-tag {
  border-radius: 999px;
  padding: 5px 9px;
  background: #f4eee6;
  color: #5e1f2f;
  font-size: 0.78rem;
  font-weight: 700;
}

.dashboard-page .pairings-section .quantity-pill {
  background: #72162b;
  color: #fff;
}

@media (max-width: 720px) {
  .dashboard-page .search-container {
    flex-direction: row;
    align-items: center;
  }

  .dashboard-page .search-box {
    flex: 1 1 0;
  }

  .dashboard-page .filter-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-page .cellar-filter,
  .dashboard-page .wine-type-filter,
  .dashboard-page .wine-sort,
  .dashboard-page .sort-direction-btn {
    width: 100%;
    flex: 0 0 40px;
  }

  .dashboard-page .wine-sort {
    justify-content: flex-start;
  }
}

/* ------------------------------------------------------------------
   Insights page (dashboard-style)
------------------------------------------------------------------- */
.dashboard-page .insights-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-page .insights-caption {
  margin: -8px 0 4px;
  color: #796e69;
  font-size: 0.92rem;
}

.dashboard-page .insight-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 16px;
}

.dashboard-page .insight-type-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid rgba(51, 28, 20, 0.1);
  border-radius: 14px;
  background: #fffdfb;
  color: #1c1110;
  font-size: 0.95rem;
  font-weight: 700;
}

.dashboard-page .insight-type-item strong {
  margin-left: auto;
  color: #1c1110;
  font-size: 1.1rem;
}

.dashboard-page .insight-type-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}

.dashboard-page .drink-soon-list {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.dashboard-page .drink-soon-item {
  min-width: min(285px, 82vw);
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: 18px;
  border: 1px solid rgba(51, 28, 20, 0.1);
  border-radius: 16px;
  background: #fffdfb;
  color: #1c1110;
  box-shadow: 0 4px 12px rgba(37, 16, 9, 0.06);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.dashboard-page .drink-soon-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(37, 16, 9, 0.1);
}

.dashboard-page .drink-soon-item strong {
  color: #1c1110;
  font-size: 1.2rem;
}

.dashboard-page .drink-soon-item small,
.dashboard-page .drink-by {
  color: #796e69;
  font-size: 0.9rem;
}

.dashboard-page .drink-by strong {
  color: #d46800;
}

.dashboard-page .drink-soon-view {
  align-self: stretch;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: #72162b;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease;
}

.dashboard-page .drink-soon-view:hover,
.dashboard-page .drink-soon-view:focus-visible {
  outline: 0;
  background: #5e1f2f;
}

.dashboard-page .insights-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed rgba(51, 28, 20, 0.18);
  border-radius: var(--radius);
  color: #796e69;
}

/* ------------------------------------------------------------------
   View-wine page (dashboard-style)
------------------------------------------------------------------- */
.dashboard-page .wine-detail-panel {
  margin: 0;
  padding: 28px;
  overflow: visible;
}

.dashboard-page .wine-detail-layout {
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 32px);
  min-height: 0;
}

.dashboard-page .bottle-placeholder {
  min-height: 320px;
  border-color: rgba(51, 28, 20, 0.16);
  background: linear-gradient(180deg, rgba(244, 238, 230, 0.62), rgba(255, 253, 249, 0.92));
}

.dashboard-page .wine-detail-content {
  gap: 22px;
}

.dashboard-page .wine-detail-header {
  gap: 10px;
}

.dashboard-page .wine-detail-header .eyebrow {
  display: none;
}

.dashboard-page .wine-detail-title {
  color: #1c1110;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 750;
}

.dashboard-page .wine-detail-subtitle {
  color: #796e69;
  font-size: 1rem;
}

.dashboard-page .detail-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.dashboard-page .detail-row {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.dashboard-page .detail-stat {
  border-color: rgba(51, 28, 20, 0.1);
  background: #fffdfb;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(37, 16, 9, 0.04);
}

.dashboard-page .detail-label {
  color: #796e69;
  margin-bottom: 3px;
  font-size: 0.68rem;
}

.dashboard-page .detail-value {
  color: #1c1110;
  font-size: 0.96rem;
}

.dashboard-page .detail-section {
  border-top: 1px solid rgba(51, 28, 20, 0.1);
  padding-top: 18px;
}

.dashboard-page .detail-section h2 {
  color: #1c1110;
  font-size: 1.15rem;
  font-weight: 750;
  margin-bottom: 12px;
}

.dashboard-page .tasting-note-input,
.dashboard-page .pairing-input,
.dashboard-page .custom-note-input {
  border-color: rgba(94, 31, 47, 0.18);
  background: #fffdf9;
  color: #1c1110;
}

.dashboard-page .tasting-note-add,
.dashboard-page .pairing-add,
.dashboard-page .custom-note-update,
.dashboard-page .general-update {
  height: 40px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 14px;
  background: #72162b;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 720;
  transition: background 160ms ease;
}

.dashboard-page .general-update {
  width: 100%;
}

.dashboard-page .tasting-note-add:hover,
.dashboard-page .pairing-add:hover,
.dashboard-page .custom-note-update:hover,
.dashboard-page .general-update:hover {
  background: #5e1f2f;
}

.dashboard-page .note-status {
  color: #796e69;
}

.dashboard-page .detail-empty {
  color: #796e69;
}

@media (max-width: 720px) {
  .dashboard-page .wine-detail-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .dashboard-page .wine-detail-content {
    width: 100%;
  }

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

/* ------------------------------------------------------------------
   Add/remove + scan-review pages (dashboard-style)
------------------------------------------------------------------- */
.dashboard-page .add-remove-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-page .add-remove-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-page .menu-btn {
  min-height: 150px;
  padding: 20px;
  border-color: rgba(51, 28, 20, 0.11);
  background: #fffdfb;
  box-shadow: 0 4px 12px rgba(37, 16, 9, 0.05);
}

.dashboard-page .menu-btn:hover {
  border-color: rgba(94, 31, 47, 0.35);
  box-shadow: 0 12px 28px rgba(43, 31, 24, 0.14);
}

.dashboard-page .menu-icon {
  width: 52px;
  height: 52px;
  background: #f4eee6;
}

.dashboard-page .menu-btn span {
  color: #796e69;
}

.dashboard-page .menu-btn strong {
  color: #1c1110;
}

.dashboard-page .scan-review-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-page .scan-review-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
}

.dashboard-page .scan-review-actions button {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(51, 28, 20, 0.12);
  background: #72162b;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease;
}

.dashboard-page .scan-review-actions button:hover {
  background: #5e1f2f;
}

.dashboard-page .scan-commit-all {
  background: #2e7d32 !important;
}

.dashboard-page .scan-commit-all:hover {
  background: #256628 !important;
}

.dashboard-page .scan-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  padding-right: 0;
}

.dashboard-page .scan-empty {
  color: #796e69;
  font-style: italic;
}

.dashboard-page .scan-card {
  border-color: rgba(51, 28, 20, 0.1);
  background: #fffdfb;
  box-shadow: 0 4px 14px rgba(37, 16, 9, 0.06);
}

.dashboard-page .scan-card--flagged {
  border-color: #ffb454;
  background: #fff8ee;
}

.dashboard-page .scan-card-flag {
  color: #b25e00;
}

.dashboard-page .scan-card:not(.scan-card--flagged) .scan-card-flag {
  color: #2e7d32;
}

.dashboard-page .scan-field {
  color: #4a4239;
}

.dashboard-page .scan-field input {
  border-color: rgba(51, 28, 20, 0.15);
  background: #fffdf9;
  color: #1c1110;
}

.dashboard-page .scan-card-actions button {
  background: #72162b;
}

.dashboard-page .scan-card-actions button:hover {
  background: #5e1f2f;
}

.dashboard-page .scan-discard {
  background: #b23b3b !important;
}

.dashboard-page .scan-discard:hover {
  background: #8f2e2e !important;
}

@media (max-width: 720px) {
  .dashboard-page .add-remove-grid {
    grid-template-columns: 1fr;
  }
}

.cellar-create-controls {
  display: flex;
  gap: 8px;
}

.cellar-create-controls input {
  min-width: 0;
  min-height: 48px;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
}

.cellar-picker-status {
  min-height: 1.2rem;
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 680;
}

.cellar-picker-list {
  gap: 10px;
}

.cellar-choice-card,
.cellar-empty-state {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--soft-shadow);
}

.cellar-choice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
}

.cellar-choice-card h4,
.cellar-choice-card p {
  margin: 0;
}

.cellar-choice-card h4 {
  color: var(--ink);
  font-size: 1rem;
}

.cellar-choice-card p,
.cellar-empty-state {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.cellar-choice-card p {
  margin-top: 4px;
}

.cellar-empty-state {
  margin: 0;
  padding: 20px;
  text-align: center;
}

@media (max-width: 760px) {
  .cellar-picker-heading,
  .cellar-choice-card,
  .cellar-create-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .cellar-create-btn,
  .cellar-choice-card .action-btn {
    width: 100%;
  }

}

/* scan review page */
.scan-review-panel {
  margin-bottom: 22px;
}

.scan-review-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 18px;
}

.scan-review-actions button {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.scan-commit-all { background: #2e7d32 !important; }

.scan-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scan-empty { color: #6b6258; font-style: italic; }

.scan-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.scan-card--flagged {
  border-color: #ffb454;
  background: #fff8ee;
}

.scan-card-img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}

.scan-card-img-wrap {
  position: relative;
  flex-shrink: 0;
}

.scan-card-count {
  position: absolute;
  right: -6px;
  bottom: -6px;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.scan-card-body { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.scan-card-flag { font-weight: 700; font-size: 0.9rem; color: #b25e00; }
.scan-card:not(.scan-card--flagged) .scan-card-flag { color: #2e7d32; }

.scan-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  color: #4a4239;
}

.scan-field input,
.scan-field select {
  width: 100%;
}

.scan-field input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.15);
  font-size: 0.9rem;
}

.scan-card-actions { display: flex; gap: 10px; margin-top: 4px; }

.scan-card-actions button {
  padding: 8px 14px;
  border-radius: 999px;
  border: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.scan-discard { background: #b23b3b !important; }

@media (max-width: 600px) {
  .scan-card {
    flex-direction: column;
    align-items: stretch;
  }

  .scan-card-img {
    width: 100%;
    height: 160px;
  }

  .scan-card-img-wrap {
    width: 100%;
  }

  .scan-review-actions button {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

/* ---------------------------------------------------------------------------
   popup.js toast + modal (scoped to #popupHost so they don't clash with
   the .popup-card/.popup-actions block used elsewhere)
--------------------------------------------------------------------------- */

#popupHost .popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(33, 20, 16, 0.45);
  backdrop-filter: blur(4px);
  animation: popup-fade 160ms ease;
}

@keyframes popup-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

#popupHost .popup-card {
  width: min(420px, calc(100% - 32px));
  padding: 22px 22px 18px;
  border-radius: 16px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(43, 31, 24, 0.28);
  animation: popup-pop 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes popup-pop {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

#popupHost .popup-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 780;
}

#popupHost .popup-message {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

#popupHost .popup-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#popupHost .popup-btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--ink);
  font: inherit;
  font-weight: 720;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

#popupHost .popup-btn:hover { background: #f4eee6; }
#popupHost .popup-btn:active { transform: translateY(1px); }

#popupHost .popup-btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

#popupHost .popup-btn--primary:hover { background: var(--brand-dark); }

#popupHost .popup-btn--danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

#popupHost .popup-btn--danger:hover { background: #7e2722; }

/* toast variant (top, auto-dismiss) */
#popupHost .popup-overlay--toast {
  align-items: flex-start;
  padding-top: 18px;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
  animation: popup-slide 220ms ease;
}

@keyframes popup-slide {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

#popupHost .popup-overlay--toast .popup-card {
  width: min(440px, calc(100% - 32px));
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(43, 31, 24, 0.22);
}

#popupHost .popup-overlay--toast .popup-message {
  margin: 0;
  flex: 1;
}

#popupHost .popup-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
}

#popupHost .popup-icon--ok { background: var(--green); }
#popupHost .popup-icon--error { background: var(--danger); }
#popupHost .popup-icon--info { background: var(--blue); }

/* Home dashboard */
.dashboard-page { min-height: 100vh; padding-bottom: 122px; background: #140706 url("/assets/images/winecellar2.avif") center top / cover fixed no-repeat; color: #fff; }
.dashboard-page::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, rgba(14, 3, 3, .8) 0, rgba(14, 3, 3, .48) 67%, rgba(255,253,250,.96) 80%, #fffdf9 100%); }
.dashboard-shell, .dashboard-header, .dashboard-nav { position: relative; z-index: 1; }
.dashboard-shell { width: min(950px, calc(100% - 48px)); margin: auto; }
.dashboard-header { min-height: 116px; display: flex; align-items: center; justify-content: space-between; }
.dashboard-brand { display: inline-flex; align-items: center; gap: 15px; padding: 0; border: 0; background: transparent; color: #fff; font: inherit; font-size: clamp(1.7rem, 3.5vw, 2.45rem); font-weight: 750; cursor: pointer; }
.dashboard-brand img { width: 50px; height: 50px; filter: brightness(0) invert(1); }
.dashboard-account { width: 74px; height: 74px; display: grid; place-items: center; padding: 0; border: 2px solid rgba(255,255,255,.22); border-radius: 50%; background: rgba(33, 5, 10, .23); color: #fff; cursor: pointer; }
.dashboard-account svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.dashboard-hero { padding: 28px 5px 25px; }
.dashboard-greeting { margin: 0; font-size: clamp(2.05rem, 5.25vw, 3.05rem); font-weight: 750; line-height: 1.2; letter-spacing: -.03em; }
.dashboard-subtitle { margin: 9px 0 0; font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: rgba(255,255,255,.9); }
.dashboard-cellar-name { display: inline-block; margin: 16px 0 -13px; padding: 5px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; background: rgba(13, 2, 2, .35); color: #fff; font: inherit; font-size: .8rem; cursor: pointer; }
.dashboard-statbar { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0 0 12px; padding: 30px; border: 1px solid rgba(255,255,255,.13); border-radius: 22px; background: rgba(32, 10, 5, .75); box-shadow: 0 14px 30px rgba(0,0,0,.22); backdrop-filter: blur(10px); }
.dashboard-stat { display: flex; align-items: center; gap: 15px; min-width: 0; padding: 0 18px; border-right: 1px solid rgba(255,255,255,.18); }
.dashboard-stat:first-child { padding-left: 0; }.dashboard-stat:last-child { padding-right: 0; border: 0; }
.stat-icon { width: 72px; height: 72px; flex: 0 0 72px; display: grid; place-items: center; border-radius: 50%; font-size: 2.8rem; font-weight: 300; }
.stat-icon--bottle { color: #fa80a0; background: rgba(113, 20, 49, .68); }.stat-icon--clock { color: #ff9d20; background: rgba(119, 54, 0, .62); }.stat-icon--star { color: #f5d1ff; background: rgba(89, 59, 93, .72); }
.dashboard-stat strong, .dashboard-stat b, .dashboard-stat small { display: block; }.dashboard-stat strong { font-size: 2rem; line-height: 1; }.dashboard-stat b { margin-top: 7px; font-size: 1.05rem; }.dashboard-stat small { margin-top: 8px; color: rgba(255,255,255,.9); font-size: 1rem; }
.scan-hero { width: 100%; min-height: 176px; display: flex; align-items: center; gap: 28px; padding: 22px 30px; border: 1px solid rgba(255,167,181,.22); border-radius: 23px; background: linear-gradient(110deg, rgba(91, 14, 33, .94), rgba(56, 10, 15, .87)); color: #fff; text-align: left; cursor: pointer; box-shadow: 0 14px 28px rgba(0,0,0,.24); }
.scan-hero-icon { width: 136px; height: 136px; display: grid; place-items: center; flex: 0 0 136px; border-radius: 50%; background: rgba(23, 3, 8, .65); }.scan-hero svg, .dashboard-nav-scan svg { width: 58px; height: 58px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.scan-hero strong, .scan-hero small { display: block; }.scan-hero strong { font-size: clamp(1.8rem, 4.3vw, 2.55rem); }.scan-hero small { margin-top: 13px; font-size: clamp(1.1rem, 2.3vw, 1.45rem); }.scan-arrow { margin-left: auto; font-size: 4.4rem; font-weight: 200; }
.dashboard-section { margin-top: 16px; padding: 28px; border: 1px solid rgba(45,25,18,.1); border-radius: 22px; background: rgba(255,253,250,.94); box-shadow: 0 7px 18px rgba(39,16,10,.09); color: #1c1110; }.dashboard-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }.dashboard-section h2 { margin: 0 0 22px; font-size: 1.55rem; letter-spacing: -.03em; }.dashboard-section-heading h2 { margin-bottom: 22px; }.view-all-button { padding: 0; border: 0; background: transparent; color: #72162b; font: inherit; font-size: 1.12rem; font-weight: 720; cursor: pointer; }.view-all-button span { font-size: 2rem; vertical-align: -.16em; }
.drink-soon-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }.drink-card { position: relative; min-width: 0; display: flex; align-items: center; gap: 19px; padding: 8px; border: 1px solid rgba(51, 28, 20, .12); border-radius: 18px; background: #fffdfb; color: #1c1110; text-align: left; cursor: pointer; box-shadow: 0 6px 13px rgba(37,16,9,.07); }.drink-card img { width: 96px; height: 130px; flex: 0 0 96px; object-fit: cover; object-position: center; border-radius: 11px; background: #311c0d; }.drink-card span { min-width: 0; }.drink-card strong, .drink-card small, .drink-card em { display: block; }.drink-card strong { overflow: hidden; font-size: 1.35rem; text-overflow: ellipsis; white-space: nowrap; }.drink-card small { margin-top: 8px; color: #796e69; font-size: 1rem; }.drink-card em { margin-top: 20px; color: #766e6c; font-size: 1rem; font-style: normal; }.drink-card em b { color: #d46800; }.drink-card i { position: absolute; top: 17px; right: 18px; color: #72162b; font-size: 1.5rem; font-style: normal; }
.quick-actions { margin-bottom: 8px; }.quick-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }.quick-action { min-height: 193px; padding: 20px 10px; border: 1px solid rgba(51, 28, 20, .11); border-radius: 16px; background: #fffdfb; color: #1c1110; cursor: pointer; box-shadow: 0 4px 12px rgba(37,16,9,.05); }.quick-action:hover, .drink-card:hover, .scan-hero:hover { transform: translateY(-2px); }.quick-action, .drink-card, .scan-hero { transition: transform 160ms ease, box-shadow 160ms ease; }.quick-icon { width: 61px; height: 61px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 50%; font-size: 2.55rem; font-weight: 300; }.quick-icon--search { color: #79172d; background: #f3e7ea; }.quick-icon--pairing { color: #b45a00; background: #f9eee4; }.quick-icon--insights { color: #664378; background: #f1edf3; }.quick-icon--bottle { color: #7a5d20; background: #f7f0df; }.quick-action strong, .quick-action small { display: block; }.quick-action strong { font-size: 1.12rem; }.quick-action small { margin-top: 8px; color: #583a2c; font-size: .95rem; line-height: 1.38; }
.dashboard-nav { position: fixed; right: max(24px, calc((100% - 950px) / 2)); bottom: 14px; left: max(24px, calc((100% - 950px) / 2)); height: 106px; display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; align-items: center; padding: 6px 20px; border: 1px solid rgba(51,28,20,.11); border-radius: 22px; background: rgba(255,253,251,.97); box-shadow: 0 8px 22px rgba(32,10,6,.15); }.dashboard-nav-button { display: grid; place-items: center; gap: 2px; padding: 0; border: 0; background: transparent; color: #8a817e; font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; }.dashboard-nav-button span { font-size: 2.3rem; line-height: .95; }.dashboard-nav-button.is-active { color: #76162b; }.dashboard-nav-scan { width: 103px; height: 103px; justify-self: center; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; background: #561121; color: #fff; box-shadow: 0 3px 11px rgba(43,10,17,.42); cursor: pointer; }.dashboard-nav-scan svg { width: 47px; height: 47px; }
@media (max-width: 720px) { .dashboard-page { padding-bottom: 94px; }.dashboard-shell { width: calc(100% - 24px); }.dashboard-header { min-height: 83px; }.dashboard-brand { gap: 9px; font-size: 1.45rem; }.dashboard-brand img { width: 36px; height: 36px; }.dashboard-account { width: 48px; height: 48px; }.dashboard-account svg { width: 26px; height: 26px; }.dashboard-hero { padding: 18px 4px; }.dashboard-greeting { font-size: 2rem; }.dashboard-statbar { padding: 16px 11px; border-radius: 17px; }.dashboard-stat { gap: 7px; padding: 0 8px; }.stat-icon { width: 43px; height: 43px; flex-basis: 43px; font-size: 1.65rem; }.dashboard-stat strong { font-size: 1.35rem; }.dashboard-stat b { margin-top: 4px; font-size: .76rem; }.dashboard-stat small { margin-top: 4px; font-size: .68rem; }.scan-hero { min-height: 118px; gap: 13px; padding: 15px; border-radius: 18px; }.scan-hero-icon { width: 86px; height: 86px; flex-basis: 86px; }.scan-hero svg { width: 40px; height: 40px; }.scan-hero strong { font-size: 1.5rem; }.scan-hero small { margin-top: 6px; font-size: .94rem; }.scan-arrow { font-size: 3rem; }.dashboard-section { padding: 20px 14px; border-radius: 18px; }.dashboard-section h2 { margin-bottom: 16px; font-size: 1.35rem; }.drink-soon-grid { gap: 10px; overflow-x: auto; padding: 0 1px 4px; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 270px; }.drink-card { min-width: 0; }.quick-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }.quick-action { min-height: 164px; }.dashboard-nav { right: 8px; bottom: 8px; left: 8px; height: 75px; padding: 3px 8px; border-radius: 17px; }.dashboard-nav-button { font-size: .66rem; }.dashboard-nav-button span { font-size: 1.6rem; }.dashboard-nav-scan { width: 77px; height: 77px; }.dashboard-nav-scan svg { width: 38px; height: 38px; } }
