:root {
  --bg: #F2EDE4;
  --bg2: #EAE3D7;
  --card: #FDFAF5;
  --border: #D8CFBF;
  --text: #1E1A14;
  --text2: #6B6254;
  --accent: #7C2D3B;
  --accent-fg: #ffffff;
  --accent2: #C4763B;
  --open: #3B6B4A;
  --open-bg: #EAF3EC;
  --open-border: #C2DEC9;
  --nav-bg: #FDFAF5;
  --pin-dot: #7C2D3B;
  --pin-empty: #D8CFBF;
  --display-font: 'Cormorant Garamond', Georgia, serif;
  --body-font: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--body-font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::-webkit-scrollbar { display: none; }
button { font-family: inherit; color: inherit; }
input { font-family: inherit; color: inherit; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.shake { animation: shake 0.5s ease; }

@keyframes toast-in {
  from { transform: translate(-50%, -10px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.app-shell {
  font-family: var(--body-font);
  background: var(--bg);
  min-height: 100vh;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  color: var(--text);
  position: relative;
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 80px;
}

.label-tiny {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text2);
  font-family: var(--body-font);
}

.view-header {
  padding: 48px 24px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.view-header h2 {
  font-family: var(--display-font);
  font-size: 28px;
  font-weight: 300;
  color: var(--text);
}
.view-header .sub {
  font-size: 12px;
  color: var(--text2);
  margin-top: 4px;
}

.chip-row {
  overflow-x: auto;
  padding: 12px 24px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.chip {
  background: var(--card);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
}
.btn-secondary {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
}

.input-base {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 20px;
  z-index: 50;
}
.bottom-nav button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text2);
  padding: 4px 6px;
}
.bottom-nav button.active { color: var(--accent); }
.bottom-nav .icon { font-size: 15px; }
.bottom-nav .label { font-size: 9px; }

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 999;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.18s ease;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  z-index: 100;
}
.modal-sheet {
  background: var(--card);
  border-radius: 16px 16px 0 0;
  padding: 24px 24px 44px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.pin-root {
  min-height: 100vh;
  max-width: 420px;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
  color: var(--text);
}
.pin-title {
  font-family: var(--display-font);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.pin-sub {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 48px;
}
.pin-dots {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
}
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--pin-empty);
  transition: all 0.15s;
}
.pin-dot.filled {
  background: var(--pin-dot);
  border-color: var(--pin-dot);
}
.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 280px;
}
.pin-grid button {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  height: 72px;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  color: var(--text);
  font-family: var(--display-font);
}
.pin-grid button.pin-del {
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--text2);
  font-family: var(--body-font);
  letter-spacing: 1px;
}
.pin-hint {
  margin-top: 32px;
  font-size: 11px;
  color: var(--text2);
}

.pin-error {
  margin-top: 24px;
  font-size: 12px;
  color: #c33;
  text-align: center;
}

/* NyVareForm: fullscreen page with a sticky header and footer.
   Body scrolls; save button stays anchored at the bottom. */
.ny-vare-form {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  max-width: 420px;
  margin: 0 auto;
  color: var(--text);
}
.ny-vare-header {
  padding: 48px 24px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.ny-vare-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text2);
  text-transform: uppercase;
}
.ny-vare-title {
  font-family: var(--display-font);
  font-size: 24px;
  font-weight: 300;
  color: var(--text);
  margin-top: 4px;
}
.ny-vare-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text2);
  font-size: 22px;
  font-family: var(--body-font);
  line-height: 1;
}
.ny-vare-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 24px;
}
.ny-vare-footer {
  padding: 14px 24px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}
.ny-vare-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ny-vare-chip {
  background: var(--card);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--body-font);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ny-vare-chip.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.ny-vare-pill {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 5px 12px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--body-font);
}
.ny-vare-pill.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.ny-vare-photo-add {
  width: 100%;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 22px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text2);
  font-family: var(--body-font);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ny-vare-photo-preview {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg2);
  display: block;
}

/* Product thumbnail used in Lager-view cards and LaegIndModal results.
   Width/height is set inline by the consumer so the same class can render
   44px (Lager), 40px (selected card), or 36px (search row). */
.product-thumb {
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg2);
}
.product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-thumb-emoji {
  opacity: 0.75;
  line-height: 1;
}
.ny-vare-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--body-font);
}

/* BottleSheet action rows. Three variants — primary (filled accent),
   secondary (outlined), muted (outlined, dimmer). Same flex layout. */
.bottle-row {
  width: 100%;
  border-radius: 12px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: var(--body-font);
  text-align: left;
  font-size: 14px;
}
.bottle-row:disabled { cursor: not-allowed; opacity: 0.55; }
.bottle-row.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
}
.bottle-row.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.bottle-row.muted {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}
.bottle-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.bottle-text { flex: 1; min-width: 0; }
.bottle-label { font-size: 14px; font-weight: 500; }
.bottle-row.muted .bottle-label { font-weight: 400; }
.bottle-sub {
  font-size: 11px;
  margin-top: 2px;
  opacity: 0.75;
}
.bottle-row.primary .bottle-sub { opacity: 0.85; }
.bottle-amount {
  font-size: 13px;
  font-family: var(--display-font);
  font-weight: 400;
  opacity: 0.75;
  flex-shrink: 0;
}
.bottle-row.primary .bottle-amount { font-weight: 500; opacity: 1; }
