:root {
  color-scheme: light;
  --paper: #fcf9f2;
  --ink: #24221c;
  --wine: #722b3d;
  --rose: #f5e7e9;
  --green: #244a37;
  --line: #ddd6c8;
  --muted: #625c51;
  font-family: "Trebuchet MS", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #a54862; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; }
h1 { font-size: clamp(2.6rem, 6vw, 5.5rem); line-height: .99; letter-spacing: -.061em; font-weight: 700; }
h2 { font-size: clamp(1.85rem, 3.2vw, 2.75rem); letter-spacing: -.047em; line-height: 1.06; }
h3 { font-size: 1.5rem; line-height: 1.12; letter-spacing: -.025em; }
p { line-height: 1.5; }
.top { border-bottom: 1px solid var(--line); }
.bar, main { width: min(1180px, calc(100% - 88px)); margin: auto; }
.bar { display: flex; align-items: center; min-height: 78px; gap: 47px; }
.name { color: var(--green); font: bold 2rem/1 Georgia, serif; letter-spacing: -.07em; text-decoration: none; }
.name span { color: var(--wine); }
nav, .account-actions { display: flex; align-items: center; gap: 19px; }
nav a { font-size: .94rem; font-weight: 700; text-decoration: none; padding: .55rem .6rem; white-space: nowrap; }
nav a[aria-current] { color: var(--wine); border-bottom: 2px solid; }
.account-actions { margin-left: auto; gap: 12px; }
.button, .profile, .close { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; text-decoration: none; min-height: 46px; padding: .75rem 1.1rem; border-radius: 10px; font-weight: 700; gap: .38rem; white-space: nowrap; }
.button:hover, .profile:hover, .close:hover { filter: brightness(.93); }
.button.small { min-height: 40px; padding: .5rem .8rem; font-size: .9rem; }
.burgundy { background: var(--wine); color: white; }
.ink { background: var(--green); color: white; }
.outline { color: var(--green); background: transparent; border-color: #b7b6a3; }
.profile { width: 40px; min-height: 40px; padding: 0; border: 1px solid #b7b6a3; border-radius: 50%; color: var(--green); background: var(--paper); }
main { padding: 42px 0 62px; }
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--rose); border: 1px solid #dfc9ce; border-radius: 26px 30px 23px 29px; }
.hero-content { position: relative; z-index: 1; padding: 56px 0 52px 55px; max-width: 57%; }
.hero h1 { color: var(--wine); }
.hero h1 em { font-weight: 400; }
.hero p { margin: 21px 0 27px; color: #54404a; max-width: 425px; }
.hero-art { position: absolute; z-index: 0; inset: 0 0 0 54%; }
.hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; mask-image: linear-gradient(to right, transparent, black 15%, black 88%, transparent); }
label { display: block; font-weight: 700; font-size: .95rem; line-height: 1.35; }
input, textarea, select { min-width: 0; border: 1px solid #c9bfb3; border-radius: 8px; padding: .75rem; background: #fffdf8; color: var(--ink); }
input, textarea { display: block; width: 100%; }
textarea { resize: vertical; }
label input, label select, label textarea { margin-top: 6px; width: 100%; }
#meal { max-width: 440px; min-height: 78px; margin-top: 8px; }
.form-actions { display: flex; align-items: stretch; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 38px 0 16px; }
.section-head p { color: var(--muted); margin-top: 7px; }
.section-head.first { margin-top: 0; }
#cave h1 { color: var(--green); }
.empty { padding: 27px; border: 1px dashed #a9aa95; border-radius: 13px; display: flex; justify-content: space-between; align-items: center; gap: 15px; background: #faf7eb; }
.empty p { color: var(--muted); margin-top: 6px; }
.filters { display: flex; gap: 10px; margin: 21px 0 15px; }
.filters input { flex: 1; }
.wine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.wine-card { border: 1px solid var(--line); border-top: 3px solid var(--wine); background: #fffdf8; border-radius: 13px; padding: 18px; min-width: 0; overflow-wrap: anywhere; }
.wine-card[data-color="Blanc"] { border-top-color: #a17b28; }
.wine-card[data-color="Rosé"] { border-top-color: #b15172; }
.wine-card[data-color="Effervescent"] { border-top-color: var(--green); }
.wine-card p, .wine-card details { margin-top: 8px; }
.wine-card .muted { font-size: .91rem; }
.card-top, .card-actions { display: flex; justify-content: space-between; gap: 9px; align-items: center; }
.card-actions { margin-top: 13px; flex-wrap: wrap; }
.stock { color: var(--green); font-weight: 700; }
.wine-price { font-weight: 700; color: var(--wine); }
.wine-card summary { cursor: pointer; font-size: .88rem; }
.wine-card details ul { padding-left: 20px; }
.card-notes { white-space: pre-wrap; }
.muted { color: var(--muted); }
.notice { margin-top: 12px; color: var(--muted); }
.notice.error { color: #8d2438; }
#pair-results:not(:empty) { margin-top: 24px; }
#pair-results .wine-grid { margin-top: 12px; }
dialog { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 18px; padding: 26px; width: min(625px, calc(100% - 24px)); max-height: calc(100% - 35px); }
dialog::backdrop { background: #20201b9e; }
#account-dialog { max-width: 440px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 15px; }
.dialog-head h2 { color: var(--green); }
.close { border-radius: 50%; background: transparent; border-color: var(--line); min-height: 39px; width: 39px; padding: 0; font-size: 1.4rem; }
dialog form > label, dialog form > p, dialog form > input, dialog form > button, #signed-in > button { margin-top: 10px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
fieldset { border: 1px solid var(--line); padding: 10px; border-radius: 8px; margin: 14px 0 0; }
legend { font-weight: 700; padding: 0 5px; }
.scan { background: var(--rose); color: var(--wine); border: 1px dashed #af7b88; border-radius: 12px; padding: 14px; margin-bottom: 13px; cursor: pointer; }
.scan span { display: block; font-weight: 400; margin-top: 5px; }
.scan:focus-within, #scan-section:has(input:focus-visible) .scan { outline: 3px solid #a54862; }
#scan-status { margin: -4px 0 12px; }
.text-button { padding: .55rem .3rem; background: none; border: 0; font-weight: 700; text-decoration: underline; color: var(--green); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 900px) {
  .bar, main { width: calc(100% - 44px); }
  .hero-content { padding: 38px 0 37px 31px; }
  .wine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .bar, main { width: calc(100% - 24px); }
  .bar { min-height: 62px; gap: 9px; }
  nav { gap: 4px; }
  nav a { padding: .5rem .32rem; font-size: .87rem; }
  .account-actions { gap: 6px; }
  .wide, br.desktop { display: none; }
  .profile { width: 34px; min-height: 34px; }
  main { padding-top: 19px; }
  .hero { display: flex; flex-direction: column; }
  .hero-content { padding: 24px 18px 2px; max-width: 100%; }
  .hero p { margin: 12px 0 17px; }
  .hero-art { position: relative; inset: auto; height: 178px; margin: 10px 0 2px; }
  .hero-art img { mask-image: linear-gradient(transparent, black 9%, black 93%, transparent); }
  .hero-art:has(img[hidden]) { display: none; }
  .form-actions { gap: 6px; }
  .form-actions select, .form-actions button { flex: 1; font-size: .9rem; padding: .6rem; }
  .section-head { margin-top: 25px; }
  .section-head .button { font-size: .88rem; padding-inline: .65rem; }
  .empty { align-items: flex-start; flex-direction: column; padding: 17px; }
  .wine-grid { grid-template-columns: 1fr; }
  .filters { flex-wrap: wrap; }
  .filters input { flex-basis: 60%; }
  dialog { padding: 17px; }
}
@media (max-width: 390px) {
  .bar .name { font-size: 1.65rem; }
  .bar { gap: 5px; }
  nav a { padding-inline: .2rem; font-size: .82rem; }
  #add-top { padding-inline: .32rem; font-size: .8rem; }
}
