:root {
  --plum: #3a1c4f;
  --purple: #812495;
  --purple-dark: #6a187c;
  --lavender: #f7f2fc;
  --paper: #fff;
  --ink: #26222a;
  --muted: #5e5563;
  --line: #e7deeb;
  --gold: #f5cf71;
  --shadow: 0 12px 32px rgba(58, 28, 79, 0.14);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "DM Sans", sans-serif; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-160%); padding: 12px 16px; background: white; color: black; border-radius: 8px; }
.skip-link:focus { transform: none; }

.app-shell { min-height: 100vh; padding-bottom: var(--safe-bottom); }
[data-mode="shopper"] .app-shell { padding-bottom: max(24px, var(--safe-bottom)); }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 66px;
  padding: 8px max(12px, calc((100% - 930px) / 2));
  color: var(--plum);
  background: var(--lavender);
  border-block: 4px solid var(--purple);
  border-bottom: 1px solid var(--line);
}
.brand-bar { display: grid; grid-template-columns: 1fr auto 1fr; }
.brand-link { grid-column: 2; }
.brand-logo { display: block; width: 112px; height: auto; }
.brand-bar .member-button { justify-self: end; }
.text-button { min-height: 44px; padding: 8px 10px; border: 0; background: transparent; color: inherit; font-weight: 700; }
.member-button { flex: 0 0 auto; white-space: nowrap; font-size: 13px; }
.member-button:hover, .calendar-return:hover { color: var(--purple); text-decoration: underline; text-underline-offset: 3px; }
.return-bar { position: sticky; top: 0; z-index: 20; }
.calendar-return {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: clamp(12px, 3.6vw, 15px);
  font-weight: 800;
  text-align: left;
  line-height: 1.25;
}
.calendar-return img { width: clamp(50px, 14vw, 72px); height: auto; flex: none; border-radius: 4px; }
.calendar-return > span { max-width: 34ch; }

.demo-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; max-width: 860px; margin: 16px auto 0; padding: 10px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.demo-bar label { display: flex; align-items: center; gap: 8px; }
.demo-bar select { min-height: 44px; border: 1px solid var(--line); border-radius: 4px; background: var(--lavender); color: var(--plum); padding: 4px 10px; }

main { width: min(100%, 860px); margin: 0 auto; }
.eyebrow { margin: 0 0 8px; color: var(--purple); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { color: var(--plum); line-height: 1.12; }
h1 { margin: 0; font-size: clamp(28px, 6.3vw, 46px); line-height: 1.08; letter-spacing: -.035em; }
.primary, .secondary, .danger, .quiet { min-height: 46px; border-radius: 4px; padding: 0 16px; font-weight: 700; border: 1px solid transparent; }
.primary { background: var(--purple); color: white; }
.primary:hover { background: var(--purple-dark); }
.primary:disabled { opacity: .58; cursor: wait; }
.secondary { background: transparent; color: var(--plum); border-color: var(--purple); }
.secondary:hover { background: var(--lavender); }
.danger { background: #fff2f2; color: #8d222b; border-color: #e1b4b8; }
.quiet { min-height: 44px; background: transparent; color: var(--purple); padding: 0 10px; }
.wide { width: 100%; }

.calendar-home { padding: clamp(19px, 4vw, 36px) 12px 0; }
.calendar-intro { text-align: center; margin-bottom: clamp(18px, 3vw, 26px); }
.calendar-intro h1 { margin-inline: auto; max-width: 23ch; }
.calendar-intro p { margin: 9px 0 0; color: var(--muted); line-height: 1.4; }
.advent-wall { position: relative; max-width: 746px; margin: 0 auto; overflow: hidden; border-radius: 6px; background: #075127; box-shadow: var(--shadow); }
.wall-art { display: block; width: 100%; height: auto; }
.wall-doors { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); }
.wall-door { position: relative; display: block; min-width: 0; padding: 0; border: 0; color: var(--plum); background: transparent; }
.door-outline { position: absolute; inset: 3% 3%; border: 2px solid transparent; border-radius: 47%; pointer-events: none; }
.wall-door:nth-child(n + 7) .door-outline { transform: translateY(6%); }
.wall-door:nth-child(n + 19) .door-outline { inset-block-end: 8%; }
.wall-door-locked .door-outline { background-color: rgba(6, 48, 26, .24); }
.wall-door-today .door-outline { border-color: var(--gold); box-shadow: inset 0 0 0 1px #3a1c4f; }
.wall-door:hover .door-outline { border-color: white; background-color: rgba(255, 255, 255, .12); }
.wall-door:focus-visible { z-index: 1; outline: 3px solid white; outline-offset: -4px; box-shadow: inset 0 0 0 6px var(--plum); }
.door-24, .door-rated { position: absolute; display: grid; place-items: center; color: var(--plum); background: #fff7df; border: 1px solid var(--plum); border-radius: 50%; font-weight: 800; line-height: 1; }
.door-24 { right: 7%; top: 11%; width: clamp(17px, 4.7vw, 27px); aspect-ratio: 1; font-size: clamp(10px, 2.9vw, 15px); }
.door-rated { right: 7%; bottom: 3%; width: clamp(16px, 4.5vw, 25px); aspect-ratio: 1; font-size: clamp(10px, 2.9vw, 14px); }
.wall-status { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.4; }
.calendar-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 20px; text-align: center; padding: 10px 0 0; }
.calendar-links a, .today-link { display: inline-flex; align-items: center; gap: .35em; min-height: 44px; color: var(--purple); font-size: 14px; text-underline-offset: 3px; }
.today-link { text-decoration: underline; }

.shop-banner {
  --shop-art-width: clamp(112px, 21vw, 171px);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto var(--shop-art-width);
  align-items: center;
  gap: 14px;
  max-width: 746px;
  min-height: 91px;
  margin: 12px auto 0;
  padding: 12px 0 12px 18px;
  overflow: hidden;
  border: 1px solid #dbb56e;
  border-radius: 6px;
  background: repeating-linear-gradient(138deg, #fff0 0 38px, #f6485129 38px 74px), linear-gradient(105deg, #76091f, #9b0c29);
  color: #fff8eb;
  text-decoration: none;
}
.shop-banner-copy { display: grid; gap: 4px; line-height: 1.3; }
.shop-banner-copy strong { font: 700 clamp(19px, 3vw, 24px)/1.08 Georgia, serif; }
.shop-banner-copy > span { font-size: 13px; }
.shop-banner-copy b { color: #ffe29e; }
.shop-banner-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  justify-self: start;
  min-height: 38px;
  padding: 7px 13px;
  border-radius: 4px;
  background: #f4d38c;
  color: #34131d;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.shop-banner:hover .shop-banner-cta { background: #ffe4a9; text-decoration: underline; text-underline-offset: 3px; }
.shop-banner-art {
  position: absolute;
  inset: 0 0 0 auto;
  width: var(--shop-art-width);
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 24%);
}
.shop-banner-art img {
  position: absolute;
  top: 0;
  right: -12%;
  width: 240%;
  height: 100%;
  object-fit: cover;
  object-position: 83% 60%;
}

@media (max-width: 580px) {
  .shop-banner {
    --shop-art-width: clamp(80px, 27vw, 128px);
    grid-template-columns: minmax(0, 1fr) var(--shop-art-width);
    gap: 6px 4px;
    padding: 10px 0 10px 12px;
  }
  .shop-banner-cta { grid-area: 2 / 1; min-height: 32px; padding: 5px 10px; }
}

.section { padding: 24px 18px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-title h2 { margin: 0; font-size: 29px; line-height: 1.05; }
.section-title p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.mini-link { min-height: 44px; border: 0; background: transparent; color: var(--purple); font-weight: 700; }
.simple-list { display: grid; gap: 10px; }
.list-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-align: left; color: inherit; }
.list-num { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: var(--plum); color: white; font-size: 20px; }
.list-row strong { display: block; }.list-row span { color: var(--muted); font-size: 13px; }
.list-row .chevron { margin-left: auto; color: var(--purple); font-size: 22px; }

.door-page { padding: 24px 16px 8px; }
.day-head { margin-bottom: 16px; }
.day-number { margin: 0 0 6px; color: var(--purple); font-size: 13px; font-weight: 800; }
.day-head h1 { overflow-wrap: anywhere; }
.wine-details { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 12px; }
.wine-details div { display: grid; gap: 3px; }
.wine-details dt { color: var(--muted); font-size: 13px; }
.wine-details dd { margin: 0; color: var(--plum); font-weight: 700; }
.comments-jump { padding-inline: 0; text-decoration: underline; text-underline-offset: 3px; }
.door-navigation { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.door-navigation button { font-size: 14px; }
.door-navigation .next-door { margin-left: auto; }
.door-feature { display: grid; gap: 18px 28px; align-items: start; }
.wine-art { display: grid; place-items: center; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--lavender); }
.wine-art img { display: block; width: 100%; aspect-ratio: 2.48; object-fit: contain; }
.tasting-copy h2, .door-sections h2, .door-activity h2 { margin: 0 0 8px; font-size: clamp(20px, 4vw, 24px); }
.tasting-copy p, .door-activity p { margin: 0 0 8px; line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 16px; }
.actions button { flex: 1 1 auto; font-size: 14px; }
.door-sections { display: grid; gap: 24px; max-width: 620px; margin: 24px auto 0; }
.door-activity { padding-block: 16px; border-block: 1px solid var(--line); }
[data-mode="shopper"] .door-activity { margin-bottom: 24px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 0 10px; align-items: center; }
.event-meta a { display: inline-flex; align-items: center; min-height: 44px; color: var(--purple); font-size: 14px; font-weight: 700; }
.door-community, .rating-panel { scroll-margin-top: 88px; }
.door-community .feed { margin-top: 14px; }
.door-community .shopper-form-status:not(:empty) { margin: 10px 0 0; }
.shopper-form-status:empty { margin: 0; }
.consent-choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; font-size: 14px; line-height: 1.45; }
.consent-choice input { flex: 0 0 18px; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--purple); }
.consent-choice[hidden], .review-actions [hidden], .review-photo[hidden] { display: none; }
.review-bar a, .review-actions a { color: var(--purple); font-weight: 700; text-underline-offset: 3px; }
.review-page { padding: 30px 16px 40px; }
.staff-login { max-width: 440px; margin-inline: auto; }
.staff-login > p { color: var(--muted); line-height: 1.45; }
.staff-sign-in { display: grid; place-items: center; margin-top: 20px; text-decoration: none; }
.staff-login #auth-status:empty { display: none; }
.review-heading, .review-entry-head, .review-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.review-heading { justify-content: space-between; }
.review-entry { display: grid; gap: 14px; }
.review-entry h2 { margin: 0; font-size: 21px; }
.review-entry .feed-story { overflow-wrap: anywhere; }
.review-actions { margin-top: 6px; }
.review-photo { display: block; max-width: 100%; max-height: 300px; border-radius: 8px; object-fit: contain; object-position: left top; }
.review-entry .shopper-form-status:not(:empty) { margin: 10px 0 0; }
@media (min-width: 640px) { .review-entry.has-photo { grid-template-columns: minmax(0, 1fr) minmax(160px, 35%); } }

.rating-panel, .story-form, .feed-card, .summary-card, .moderation-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.rating-panel { background: var(--lavender); text-align: center; }
.rating-panel h3, .story-form h3, .feed-card h3 { margin: 0 0 6px; font-size: 21px; }
.rating-panel p, .story-form p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.stars { display: flex; justify-content: center; gap: 4px; margin: 8px 0 12px; }
.star { width: 46px; height: 46px; border: 0; background: transparent; color: #817387; font-size: 34px; line-height: 1; }
.star.selected { color: var(--purple); }
.rating-actions { display: flex; align-items: center; justify-content: center; gap: 8px; }
.favorite-link { font-size: 13px; }
.signed-note { text-align: center; color: var(--muted); font-size: 12px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 700; }
.field textarea, .field input, .field select { width: 100%; min-height: 48px; border: 1px solid #b9a9c1; border-radius: 6px; background: white; color: var(--ink); padding: 12px; }
.field textarea { min-height: 130px; resize: vertical; }
.field-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.upload { display: grid; place-items: center; overflow: hidden; gap: 5px; min-height: 92px; padding: 10px; border: 1px dashed #a28bad; border-radius: 6px; background: var(--lavender); text-align: center; font-size: 13px; }
.upload input { max-width: 100%; }
.preview { width: 100%; max-height: 240px; object-fit: cover; margin-top: 10px; border-radius: 8px; }
.visibility-note { margin: 10px 0 16px; padding: 10px; border-radius: 8px; background: #e9f0ec; color: #315446; font-size: 12px; }
.status { display: inline-flex; align-items: center; min-height: 26px; padding: 0 8px; border-radius: 999px; background: #efe7d7; color: #695a3a; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.status.visible { background: #dcebe2; color: #286043; }.status.declined, .status.removed { background: #f3dfe0; color: #8b323a; }
.feed { display: grid; gap: 12px; }
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.author { font-weight: 700; }.timestamp { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.feed-story { white-space: pre-wrap; line-height: 1.55; }
.feed-photo { width: 100%; max-height: 380px; object-fit: cover; margin-top: 12px; border-radius: 8px; }
.feed-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.feed-actions button { min-height: 44px; border: 0; background: transparent; color: var(--plum); font-size: 12px; font-weight: 700; }
.comment-list { display: grid; gap: 8px; margin-top: 10px; }
.comment { padding: 10px; border-radius: 8px; background: #f3ecdf; font-size: 13px; }
.comment strong { display: block; margin-bottom: 3px; }
.empty { padding: 28px 18px; border: 1px dashed #b9b0a3; border-radius: 12px; color: var(--muted); text-align: center; }

.locked { min-height: min(52vh, 460px); display: grid; align-content: center; justify-items: center; padding: 36px 18px; text-align: center; }
.locked-door { display: grid; place-items: center; width: 110px; aspect-ratio: 1; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 50%; background: var(--lavender); color: var(--purple); font-size: 52px; font-weight: 800; }
.locked p { max-width: 420px; color: var(--muted); line-height: 1.55; }

.dashboard-head { padding: 30px 18px 20px; }
.dashboard-head h1 { color: var(--plum); font-size: 39px; }
.dashboard-head p { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 20px; }
.summary-card { padding: 14px 10px; text-align: center; }
.summary-card strong { display: block; color: var(--plum); font-size: 27px; }
.summary-card span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.moderation-list { display: grid; gap: 12px; padding: 0 16px 30px; }
.moderation-card h3 { margin: 6px 0; }.moderation-card p { color: #4e4d45; line-height: 1.45; }
.moderation-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.audit { margin-top: 12px; color: var(--muted); font-size: 11px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; align-items: end; padding: 12px; background: rgba(10,25,20,.65); }
.modal { width: min(100%, 480px); max-height: 92vh; overflow: auto; margin: 0 auto; padding: 22px; border-radius: 18px 18px 12px 12px; background: var(--paper); box-shadow: 0 25px 70px rgba(0,0,0,.32); }
.modal h2 { margin: 0 0 8px; font-size: 30px; }.modal > p { color: var(--muted); line-height: 1.45; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }.modal-actions > * { flex: 1; }
.account-links { display: grid; gap: 8px; }
.staff-toggle { display: flex; align-items: center; min-height: 44px; gap: 8px; }
.staff-toggle input[type="checkbox"] { width: 18px; min-height: auto; height: 18px; accent-color: var(--purple); }
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(16px + var(--safe-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 6px; background: var(--plum); color: white; font-size: 13px; box-shadow: var(--shadow); }

@media (min-width: 700px) {
  .door-page { padding: 32px 24px 10px; }
  .door-feature { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; }
  .door-sections { max-width: none; margin-top: 32px; }
  .actions button { flex-grow: 0; }
  .modal-backdrop { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
