:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #191518;
  color: #fbefe7;
  --background: #191518;
  --sidebar: #151214;
  --surface: #3e2834;
  --surface-strong: #211a20;
  --border: #3b3036;
  --muted: #b8a9ae;
  --dim: #ac99a2;
  --rose: #e9a6b4;
  --accent: #963e57;
  --accent-hover: #aa4963;
  --cream: #fbefe7;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sidebar-width: 244px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --mobile-nav-height: 55px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; min-height: 100dvh; background-color: var(--background); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button, a { touch-action: manipulation; }
button, input, select, textarea { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid #e3a0b0;
  outline-offset: 3px;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: #77374c; color: #fff1ed; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 4;
  display: flex; flex-direction: column; padding: calc(29px + var(--safe-top)) 18px calc(21px + var(--safe-bottom));
  border-right: 1px solid #30262c; background: var(--sidebar);
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; margin-left: 5px; color: var(--cream); font: 27px/.9 var(--serif); letter-spacing: -.035em; }
.brand-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; background: #8f3851; color: #fff0e8; flex-shrink: 0; box-shadow: inset 0 0 0 1px #d48c9c45; }
.brand small { display: block; margin-top: 6px; color: var(--dim); font: 700 8px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .145em; }
.nav-label { padding-left: 12px; margin: 48px 0 10px; color: #a58f99; font-size: 10px; font-weight: 750; letter-spacing: .16em; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav button {
  display: flex; align-items: center; gap: 11px; padding: 11px 11px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--muted); text-align: left; min-height: 43px; font-weight: 620; font-size: 13px;
}
.sidebar nav button:hover { background: #241b21; color: var(--cream); }
.sidebar nav button[aria-current] { border-color: #542f3e; background: #35222c; color: #f1bdc9; }
.sidebar nav small { margin-left: auto; padding: 2px 6px; color: var(--muted); background: #322930; border-radius: 5px; font-size: 10px; }
.sidebar nav button[aria-current] small { background: #56303f; color: #f4c7d1; }
.side-bottom { margin-top: auto; }
.side-bottom > .button { width: 100%; justify-content: flex-start; padding: 8px; font-size: 12px; }
.side-rule { margin: 13px 3px 16px; height: 1px; background: #30262c; }
.profile { display: flex; align-items: center; gap: 9px; padding: 0 4px; color: var(--cream); font-size: 12px; font-weight: 620; }
.profile-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; background: #32252b; color: var(--rose); }
.profile small { display: block; margin-top: 4px; color: var(--dim); font-size: 10px; font-weight: 450; }
.mobile-head { display: none; }

.main { margin-left: var(--sidebar-width); padding: calc(25px + var(--safe-top)) clamp(25px, 3.4vw, 57px) 64px; max-width: 1560px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin: 0 0 27px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; color: var(--rose); font-size: 10px; letter-spacing: .19em; font-weight: 750; }
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: #cb7189; box-shadow: 0 0 0 3px #65324545; }
h1 { color: var(--cream); font: 400 clamp(38px, 4.2vw, 56px)/1.05 var(--serif); letter-spacing: -.045em; overflow-wrap: anywhere; }
.page-heading p { margin-top: 11px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.heading-actions { display: flex; flex: 0 0 auto; gap: 9px; padding-bottom: 2px; }
.button, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 15px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--cream); font-size: 13px; font-weight: 620; line-height: 1.2;
  transition: background .16s, border-color .16s, color .16s; text-align: center;
}
.button svg, .icon-button svg { flex-shrink: 0; }
.button:hover, .icon-button:hover { background: #342930; border-color: #5b424f; }
.button.primary { background: var(--accent); border-color: #ac536b; color: #fff4ee; }
.button.primary:hover { background: var(--accent-hover); border-color: #bc6680; }
.button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.button.quiet:hover { color: var(--cream); background: #32252d; }
.button.danger { color: #f4a9b5; }
.icon-button { width: 39px; height: 39px; min-height: 0; padding: 0; color: var(--muted); flex-shrink: 0; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 17px; }
.metric { display: flex; align-items: center; gap: 13px; min-height: 77px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.metric-icon { display: inline-grid; flex-shrink: 0; place-items: center; width: 40px; height: 40px; border: 1px solid #6b3a4c; border-radius: 9px; background: #492b38; color: #e8a0b2; }
.metric strong { display: block; font: 400 29px/.95 var(--serif); color: var(--cream); }
.metric div > span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }

.demo-banner {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  overflow: hidden; padding: 18px 20px; min-height: 98px; margin-bottom: 27px;
  background: #35222a linear-gradient(100deg, #3d252e, #472b36 57%, #563240); border: 1px solid #704556; border-radius: 12px;
}
.demo-banner::after { content: ""; position: absolute; inset: 0 0 0 23%; pointer-events: none; background: url("./assets/hero.svg") right center / cover; opacity: .49; }
.demo-banner > * { position: relative; z-index: 1; }
.demo-text { display: flex; align-items: center; gap: 13px; }
.demo-icon { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border: 1px solid #845469; border-radius: 9px; color: #f2adbd; background: #4d2d3a; }
.demo-text small { display: block; color: #f0afbc; font-size: 9px; font-weight: 760; letter-spacing: .15em; }
.demo-text strong { display: block; margin-top: 3px; color: var(--cream); font: 400 23px/1.05 var(--serif); letter-spacing: -.025em; }
.demo-text div > span { display: block; margin-top: 4px; color: #dcc4cb; font-size: 11px; line-height: 1.4; }
.button.demo-button { background: #301e27; border-color: #8b5b6d; min-height: 37px; white-space: nowrap; }
.demo-button svg { order: 1; }
.button.demo-button:hover { background: #582d3e; border-color: #a96b80; }

.section { margin-top: 26px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-title h2 { font: 400 29px/1.05 var(--serif); color: var(--cream); letter-spacing: -.04em; }
.section-title p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.view-switch, .segmented { display: inline-flex; flex: 0 0 auto; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: #211b1f; }
.view-switch button, .segmented button { display: inline-flex; gap: 6px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 6px; padding: 5px 9px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 650; min-height: 30px; }
.view-switch button[aria-pressed="true"], .segmented button[aria-pressed="true"] { color: #f0b7c5; background: #3e2834; border-color: #644151; }
.view-switch button:hover, .segmented button:hover { color: var(--cream); }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(136px, .34fr) minmax(136px, .36fr); gap: 9px; margin-bottom: 14px; }
.search, .filter-select { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 42px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--dim); }
.search { padding: 0 11px; }
.search svg, .filter-select svg { flex-shrink: 0; }
.search input, .filter-select select { width: 100%; min-width: 0; min-height: 39px; padding: 0; background: transparent; border: 0; color: var(--cream); font-size: 13px; border-radius: 6px; }
.search input::placeholder { color: var(--dim); opacity: 1; }
.filter-select { position: relative; }
.filter-select select { appearance: none; padding: 0 30px 0 11px; text-overflow: ellipsis; cursor: pointer; }
.filter-select svg { position: absolute; right: 10px; pointer-events: none; }
select option { background: var(--surface); color: var(--cream); }

.bottle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.wine-card { min-width: 0; }
.wine-hit {
  display: flex; flex-direction: column; width: 100%; height: 100%; min-width: 0; padding: 0;
  overflow: hidden; text-align: left; background: var(--surface); color: var(--cream); border: 1px solid var(--border); border-radius: 11px;
  transition: border-color .16s, background .16s;
}
.wine-hit:hover { border-color: #7e5365; background: #2b2127; }
.wine-art-wrap { width: 100%; position: relative; }
.bottle-art {
  position: relative; display: grid; place-items: center; width: 100%; height: 154px; overflow: hidden; isolation: isolate;
  background: radial-gradient(ellipse at 50% 65%, var(--art-light), transparent 64%), linear-gradient(145deg, var(--art-tint), #252027 83%);
  --art-light: #77535f; --art-tint: #442933;
}
.bottle-art::before {
  content: ""; position: absolute; z-index: -1; top: 49%; left: 50%; transform: translate(-50%, -50%);
  width: 128px; height: 128px; border: 1px solid #f2d7cd29; border-radius: 50%;
  box-shadow: 0 0 0 12px #f2d7cd0a, inset 0 0 0 12px #f2d7cd09, 0 0 0 25px #f2d7cd08;
}
.bottle-art::after { content: ""; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 85px; height: 14px; z-index: -1; background: #100c13a0; border-radius: 50%; filter: blur(5px); }
.bottle-art.art-brunello { --art-light: #625353; --art-tint: #3c3135; }
.bottle-art.art-brut, .bottle-art.art-dolce { --art-light: #775464; --art-tint: #403039; }
.bottle-art.art-etna { --art-light: #715662; --art-tint: #392a33; }
.bottle-art.art-rosato { --art-light: #8d5967; --art-tint: #52333f; }
.bottle-art.art-other { --art-light: #6a5262; --art-tint: #332630; }
.bottle-drawing { width: auto; height: 142px; transform: rotate(-8deg); filter: drop-shadow(8px 5px 7px #110d117a); }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; width: max-content; height: max-content;
  color: var(--badge-text); background: var(--badge-bg); border: 1px solid var(--badge-border); border-radius: 5px;
  font-size: 10px; font-weight: 650; white-space: nowrap; line-height: 1;
}
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-red { --badge-text: #f5b4c6; --badge-bg: #492735; --badge-border: #825066; }
.badge-white { --badge-text: #ead7de; --badge-bg: #35272e; --badge-border: #73515f; }
.badge-pink { --badge-text: #f6c4c8; --badge-bg: #50313b; --badge-border: #866069; }
.badge-bubbles { --badge-text: #e4c8d9; --badge-bg: #3e2937; --badge-border: #795367; }
.badge-sweet { --badge-text: #ebc1cd; --badge-bg: #4a2b38; --badge-border: #825365; }
.badge-other { --badge-text: #d7bdca; --badge-bg: #352630; --badge-border: #6f4f62; }
.wine-art-wrap .badge { position: absolute; top: 10px; left: 10px; }
.card-arrow { position: absolute; top: 9px; right: 9px; display: grid; place-items: center; width: 29px; height: 29px; color: #efe0df; border: 1px solid #e0c3cd3d; border-radius: 50%; background: #20191d5e; }
.wine-copy { width: 100%; padding: 16px 17px 18px; }
.wine-maker { color: var(--rose); font-size: 10px; letter-spacing: .08em; font-weight: 730; text-transform: uppercase; }
.wine-copy h3 { color: var(--cream); font: 400 24px/1.12 var(--serif); margin: 5px 0 9px; letter-spacing: -.033em; overflow-wrap: anywhere; }
.wine-location { display: flex; align-items: flex-start; gap: 5px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.wine-location svg { margin-top: -1px; flex-shrink: 0; color: #bd8598; }
.bottle-list { grid-template-columns: 1fr; gap: 8px; }
.bottle-list .wine-hit { flex-direction: row; align-items: center; }
.bottle-list .wine-art-wrap { width: 100px; flex: 0 0 100px; }
.bottle-list .bottle-art { height: 90px; }
.bottle-list .bottle-art::before { width: 66px; height: 66px; }
.bottle-list .bottle-drawing { height: 80px; }
.bottle-list .wine-art-wrap .badge { top: auto; bottom: 4px; left: 4px; }
.bottle-list .card-arrow { display: none; }

.empty { display: grid; justify-items: center; gap: 8px; padding: 43px 15px; border: 1px dashed #5a424e; background: #211a20; border-radius: 11px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 3px; background: #3a2632; color: var(--rose); border: 1px solid #654251; border-radius: 13px; }
.empty h3 { color: var(--cream); font: 400 26px/1 var(--serif); letter-spacing: -.025em; }
.empty p { color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 380px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 7px; }

.cellar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr)); gap: 13px; }
.cellar-card { padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; color: var(--cream); min-width: 0; }
.cellar-card:hover { border-color: #7e5365; background: var(--surface-strong); }
.cellar-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.cellar-arrow { color: var(--rose); }
.cellar-card h2 { font: 400 29px/1.05 var(--serif); letter-spacing: -.04em; overflow-wrap: anywhere; }
.cellar-card p { margin: 5px 0 16px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.capacity { height: 5px; border-radius: 5px; background: #403039; overflow: hidden; }
.capacity div { height: 100%; border-radius: 5px; background: #c6718a; }
.cellar-card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 10px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.back-link { margin: -10px 0 9px -6px; }
.map-panel { min-width: 0; padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.map-title { display: flex; justify-content: space-between; align-items: start; gap: 7px; margin-bottom: 14px; }
.map-title h3 { font: 400 22px/1.1 var(--serif); color: var(--cream); overflow-wrap: anywhere; }
.map-title p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.slot-scroll { overflow-x: auto; padding: 3px; margin: -3px; }
.slot-grid { display: grid; grid-template-columns: repeat(var(--columns), minmax(46px, 1fr)); gap: 5px; }
.slot {
  display: grid; place-items: center; align-content: center; gap: 3px; padding: 4px 0; min-height: 48px; border: 1px dashed #594750;
  border-radius: 6px; background: #272025; color: var(--dim); font-size: 9px;
}
.slot.occupied { border-style: solid; border-color: var(--badge-border); background: var(--badge-bg); color: var(--badge-text); }
.slot:hover { border-color: #e3a0b0; color: var(--cream); }
.simple-list { display: grid; gap: 7px; }
.simple-list > article { display: grid; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.simple-list button:not(.icon-button) {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--cream); text-align: left; font-size: 13px;
}
.simple-list button:not(.icon-button):hover { border-color: #7e5365; background: var(--surface-strong); }
.simple-list button span { flex: 1; overflow-wrap: anywhere; }
.simple-list button small { min-width: 28px; color: var(--rose); }
.history-list { display: grid; gap: 9px; }
.history-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--cream); text-align: left;
}
.history-card:hover { border-color: #7e5365; background: var(--surface-strong); }
.history-title strong { display: block; font: 400 22px/1.1 var(--serif); overflow-wrap: anywhere; }
.history-card small, .history-note { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.history-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 6px; }
.stars { display: inline-flex; align-items: center; gap: 2px; color: var(--dim); }
.stars span { display: inline-flex; }
.star { position: relative; }
.star-fill { position: absolute; inset: 0; color: var(--rose); }
.star-fill svg { fill: currentColor; }
.star-fill.half { clip-path: inset(0 50% 0 0); }

dialog {
  inset: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  max-height: min(90dvh, 850px, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 24px)); width: min(calc(100% - 32px - var(--safe-left) - var(--safe-right)), 545px); padding: 0; margin: auto; overflow: auto;
  background: var(--surface); border: 1px solid #634650; border-radius: 15px; color: var(--cream); box-shadow: 0 25px 90px #0d090be0;
}
dialog::backdrop { background: #100c10b8; backdrop-filter: blur(4px); }
.dialog-content { padding: 23px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 9px; margin-bottom: 17px; }
.dialog-heading h2 { font: 400 33px/.99 var(--serif); letter-spacing: -.045em; overflow-wrap: anywhere; }
.dialog-heading p { margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.45; }
form { display: grid; gap: 11px; }
form label { display: grid; gap: 5px; min-width: 0; color: #e5d5da; font-size: 12px; font-weight: 620; }
form input:not([type="radio"]), form select, form textarea {
  display: block; width: 100%; min-width: 0; min-height: 40px; padding: 8px 9px; border: 1px solid #594451;
  background: #1d171c; color: var(--cream); border-radius: 7px; font-size: 14px; font-weight: 400;
}
form input::placeholder { color: #ad979f; }
form select:disabled { color: #a59198; opacity: .65; }
form textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-grid .full { grid-column: 1 / -1; }
.form-fieldset { min-width: 0; padding: 9px; margin: 0; border: 1px solid #4c3a43; border-radius: 8px; }
.form-fieldset legend { padding: 0 5px; color: #e6c5d1; font-size: 12px; }
.form-shortcut { display: flex; flex-wrap: wrap; gap: 4px; }
.form-shortcut .button { min-height: 34px; padding: 0 8px; color: var(--rose); }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding-top: 5px; }
.dialog-footer .primary { margin-left: auto; }
.form-error { border: 1px solid #805364; background: #452731; color: #ffd2d9; padding: 8px 9px; border-radius: 7px; font-size: 12px; line-height: 1.4; }
.inline-info { display: flex; align-items: center; gap: 7px; padding: 8px 9px; background: #342630; color: #ead0d8; border-radius: 7px; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.inline-info svg { flex-shrink: 0; color: var(--rose); }
.detail { display: grid; grid-template-columns: minmax(105px, .7fr) minmax(0, 1.3fr); gap: 14px; }
.detail .bottle-art { height: 100%; min-height: 180px; border-radius: 9px; }
.detail .bottle-drawing { height: 162px; }
.detail-copy { min-width: 0; }
.detail dl { margin: 9px 0 0; }
.detail dl > div { padding: 5px 0; border-bottom: 1px solid #3d3038; }
.detail dl > div:last-child { border-bottom: 0; }
.detail dt { color: var(--muted); font-size: 10px; }
.detail dd { margin: 2px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.detail-notes { margin-top: 12px; }
.detail-notes h3 { color: var(--rose); font-size: 12px; }
.detail-notes p { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.detail-actions .primary { margin-left: auto; }
.detail-delete { margin-top: 8px; }
.detail-delete .button { min-height: 34px; padding: 0 8px; }
.demo-notice { margin: -5px 0 10px; color: var(--rose); font-size: 12px; line-height: 1.4; }
.rating-field { background: #291e26; padding: 12px 14px 6px; }
.rating-preview, .rating-help { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rating-stars {
  display: grid; align-items: center; position: relative; width: min(205px, 100%); min-width: 0; min-height: 48px; border-radius: 8px;
  cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.rating-stars:has(input:focus-visible) { outline: 2px solid var(--rose); outline-offset: 2px; }
.rating-stars.is-pressing { background: #3e2834; cursor: grabbing; }
.rating-stars input, .rating-stars [data-rating-stars] { pointer-events: none; }
.rating-stars .stars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.rating-stars .star, .rating-stars .star-fill { justify-content: center; }
.rating-stars .star svg { max-width: 90%; }
.rating-value { color: var(--rose); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rating-help { color: var(--muted); }
.rating-help small { line-height: 1.4; }
.rating-help .rating-clear { flex-shrink: 0; padding-inline: 8px; }
.scan-frame {
  display: grid; justify-items: center; gap: 7px; text-align: center; padding: 24px 12px; border: 1px dashed #7f5667; border-radius: 10px;
  background: #30232b; color: var(--cream);
}
.scan-icon { display: grid; place-items: center; width: 53px; height: 53px; margin-bottom: 3px; border-radius: 10px; color: var(--rose); background: #482b3a; }
.scan-frame strong { font: 400 23px/1.1 var(--serif); }
.scan-frame p, .scan-status { color: var(--muted); font-size: 12px; line-height: 1.4; }
.scan-actions, .settings { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.scan-status { padding: 9px 0 2px; }
.scan-status.scan-error { color: #ffbbc8; }
.settings + .form-error { margin-top: 9px; }
.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 6; max-width: min(360px, calc(100% - 36px));
  padding: 11px 14px; border-radius: 8px; border: 1px solid #8c5b6e; background: #412833; color: #fff0eb;
  box-shadow: 0 6px 18px #0906096b; font-size: 13px; line-height: 1.35;
}

@media (max-width: 1040px) {
  :root { --sidebar-width: 192px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .main { padding-top: calc(32px + var(--safe-top)); }
}
@media (max-width: 720px) {
  html { scroll-padding-top: calc(130px + var(--safe-top)); scroll-padding-bottom: calc(var(--mobile-nav-height) + var(--safe-bottom) + 20px); }
  .sidebar { inset: auto 0 0; width: 100%; padding: 4px max(7px, var(--safe-right)) calc(6px + var(--safe-bottom)) max(7px, var(--safe-left)); border: 0; border-top: 1px solid #51323d; background: #21181f; }
  .sidebar > .brand, .sidebar .nav-label, .side-bottom { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .sidebar nav button { justify-content: center; flex-direction: column; gap: 3px; min-height: 44px; padding: 4px; font-size: 10px; }
  .sidebar nav small { display: none; }
  .mobile-head { display: grid; position: sticky; top: 0; z-index: 5; gap: 12px; padding: calc(18px + var(--safe-top)) max(16px, var(--safe-right)) 14px max(16px, var(--safe-left)); border-bottom: 1px solid #382b33; background: #21181f; }
  .mobile-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
  .mobile-head .brand { margin: 0; gap: 8px; font-size: 24px; }
  .mobile-head .brand-icon { width: 33px; height: 33px; border-radius: 8px; }
  .main { margin-left: 0; padding: 21px max(16px, var(--safe-right)) calc(var(--mobile-nav-height) + var(--safe-bottom) + 24px) max(16px, var(--safe-left)); }
  .page-heading { margin-bottom: 16px; }
  .page-heading p { margin-top: 8px; font-size: 13px; }
  .heading-actions { width: 100%; flex-wrap: wrap; gap: 6px; }
  .heading-actions > .button { flex: 1 1 auto; }
  .metrics { gap: 6px; margin-bottom: 10px; }
  .metric { flex-direction: column; align-items: flex-start; gap: 7px; min-height: 96px; padding: 8px 7px; }
  .metric-icon { width: 32px; height: 32px; border-radius: 7px; }
  .metric-icon svg { width: 17px; height: 17px; }
  .metric strong { font-size: 24px; }
  .metric div > span { margin-top: 3px; font-size: 10px; line-height: 1.2; }
  .demo-banner { margin-bottom: 16px; padding: 10px; gap: 8px; }
  .demo-banner::after { inset-inline-start: 4%; }
  .demo-icon { display: none; }
  .demo-text small { font-size: 8px; }
  .demo-text strong { font-size: 18px; }
  .demo-text div > span { font-size: 10px; }
  .button.demo-button { min-height: 35px; white-space: normal; font-size: 10px; padding: 4px 7px; }
  .demo-button svg { width: 14px; }
  .section { margin-top: 17px; }
  .section-title h2 { font-size: 25px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
  .search { grid-column: 1 / -1; }
  .search input, .filter-select select { font-size: 16px; }
  .filter-select select { padding-left: 7px; }
  .bottle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .bottle-list { grid-template-columns: 1fr; }
  .bottle-art { height: 120px; }
  .bottle-art::before { width: 91px; height: 91px; }
  .bottle-drawing { height: 108px; }
  .wine-copy { padding: 9px 8px; }
  .wine-copy h3 { font-size: 18px; }
  .wine-maker { font-size: 8px; }
  .wine-location { font-size: 10px; }
  .wine-art-wrap .badge { top: 6px; left: 6px; }
  .card-arrow { top: 6px; right: 6px; width: 23px; height: 23px; }
  .card-arrow svg { width: 14px; }
  .map-panel { padding: 11px; }
  .map-title h3 { font-size: 20px; }
  .toast { right: calc(18px + var(--safe-right)); bottom: calc(var(--mobile-nav-height) + var(--safe-bottom) + 12px); }
  dialog { width: calc(100% - 20px - var(--safe-left) - var(--safe-right)); max-height: min(92dvh, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 24px)); }
  .dialog-content { padding: 15px; }
  form input:not([type="radio"]), form select, form textarea { font-size: 16px; }
}
@media (max-width: 370px) {
  .main { padding-left: max(10px, var(--safe-left)); padding-right: max(10px, var(--safe-right)); }
  .heading-actions .button { gap: 4px; padding: 0 8px; font-size: 11px; }
  .history-card { gap: 5px; padding: 8px; }
  .history-title strong { font-size: 18px; }
  .history-rating .stars svg { width: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.metric { text-align: left; color: var(--cream); }
.metric:hover { background: var(--surface-strong); border-color: #785060; }
.metric > svg:last-child { margin-left: auto; color: var(--rose); flex-shrink: 0; }
#collection-title { scroll-margin-top: 20px; }

.cover-art { position: relative; min-width: 0; overflow: hidden; }
.cover-art > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  padding: 6px; background: #30242b; opacity: 0;
}
.cover-art > .photo-loaded, .label-preview > .photo-loaded { opacity: 1; }
.detail .cover-art { border-radius: 9px; }

.placement-row + .placement-row { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.placement-name { margin: 0 0 6px; color: var(--rose); font-size: 12px; line-height: 1.35; font-weight: 650; }
.extra-fields { min-width: 0; color: var(--rose); font-size: 12px; }
.extra-fields summary { cursor: pointer; padding-block: 4px; }
.extra-fields > :not(summary) { margin-top: 8px; }
.extra-fields p { color: var(--muted); line-height: 1.4; }

.label-field { border: 1px solid var(--border); border-radius: 9px; padding: 8px; min-width: 0; }
.label-field-head { display: flex; align-items: center; gap: 10px; }
.label-preview {
  position: relative; display: grid; place-items: center; overflow: hidden; flex: 0 0 52px; height: 52px;
  background: #30242b; border-radius: 7px; color: var(--rose);
}
.label-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #30242b; opacity: 0; }
.label-field-copy { min-width: 0; }
.label-field-copy > strong { display: block; font-size: 12px; }
.label-field-copy > small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.label-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.label-actions .button { min-height: 34px; padding: 3px 8px; }
.label-actions .quiet { color: var(--rose); }
.label-editor { display: grid; gap: 9px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.label-editor canvas {
  max-width: 100%; max-height: 235px; display: block; margin-inline: auto;
  border-radius: 5px; cursor: grab; touch-action: none;
}
form .label-editor input[type="range"] {
  min-height: 30px; padding: 0; background: transparent; border: 0; accent-color: #cb7189;
}

.cellar-map .map-title { margin-bottom: 11px; }
.cellar-map .touch-map-hint { display: none; }
.slot, [data-move-bottle], [data-move-bottle] * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.slot.occupied { cursor: grab; }
.move-mode .slot { cursor: crosshair; }
.move-mode .slot.occupied { touch-action: none; }
.is-dragging .slot { cursor: grabbing; }
.is-dragging .map-title { overflow: hidden; }
.move-mode .map-title .touch-map-hint, .move-mode .map-title .desktop-map-hint { display: none; }
.move-mode .move-toggle { border-color: #ac667c; background: #4b2e3a; }
.slot.move-source { outline: 2px solid #f4a8bb; outline-offset: -3px; box-shadow: inset 0 0 0 4px #4f2e3c; }
.slot.drag-target, .slot.move-target { border-style: solid; border-color: #edb4c8; background: #583044; color: #ffe7ee; outline: 2px solid #c6819c; outline-offset: -3px; }
.move-review {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 10px; margin-bottom: 10px; border: 1px solid #896071; border-radius: 8px;
  background: #392630; font-size: 13px;
}
.move-review p { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.move-review > div:last-child { display: flex; flex-shrink: 0; gap: 4px; }

@media (pointer: coarse) {
  .cellar-map .touch-map-hint { display: block; }
  .cellar-map .desktop-map-hint { display: none; }
  .slot.occupied { cursor: pointer; }
}
@media (max-width: 720px) {
  .metric { position: relative; }
  .metric > svg:last-child { position: absolute; top: 9px; right: 6px; width: 12px; }
  .label-editor canvas { max-height: 195px; }
  .move-review { flex-wrap: wrap; }
}

.wine-art-wrap { aspect-ratio: 16 / 9; }
.wine-art-wrap > .bottle-art, .wine-art-wrap > .cover-art { position: absolute; inset: 0; height: 100%; }
.wine-art-wrap .cover-art > .bottle-art { height: 100%; }
.wine-art-wrap .cover-art > img { padding: 0; object-fit: cover; }
.wine-art-wrap .bottle-drawing { height: min(142px, 94%); }
.bottle-list .wine-art-wrap .bottle-drawing { height: 94%; }

.cellar-workspace { display: grid; align-items: start; gap: 12px; }
.map-controls { display: flex; flex-shrink: 0; align-items: center; gap: 5px; }
.map-title p, .move-review p { overflow-wrap: anywhere; }
.slot-grid { grid-template-columns: repeat(var(--columns), minmax(63px, 1fr)); }
.slot { min-width: 0; min-height: 69px; padding: 5px 4px; }
.slot-top, .move-review-source { display: flex; align-items: center; min-width: 0; gap: 5px; }
.slot-code { font-size: 10px; font-weight: 680; }
.slot-name {
  min-width: 0; max-width: 100%; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere; color: var(--cream); font-size: 10px; line-height: 1.16;
}
.slot[aria-disabled="true"] { opacity: .46; cursor: not-allowed; }
.wine-thumb {
  display: grid; place-items: center; position: relative; overflow: hidden; width: 29px; height: 25px; flex-shrink: 0;
  border-radius: 4px; color: inherit; background: #18131850;
}
.wine-thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.wine-thumb > .photo-loaded { opacity: 1; }

.unplaced-list { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.unplaced-bottle {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px;
  background: #292128; border: 1px solid var(--border); border-radius: 8px;
}
.unplaced-bottle.move-source { border-color: #f4a8bb; background: #412b37; }
.unplaced-open {
  display: flex; flex: 1 1 125px; align-items: center; gap: 7px; min-width: 0;
  min-height: 40px; padding: 2px; border: 0; background: transparent; color: var(--cream); text-align: left;
}
.unplaced-open:hover { color: var(--rose); }
.unplaced-open strong, .unplaced-open small { display: block; overflow-wrap: anywhere; }
.unplaced-open strong { font-size: 12px; }
.unplaced-open small { margin-top: 3px; font-size: 10px; color: var(--muted); }
.unplaced-actions { display: flex; gap: 4px; margin-left: auto; }
.unplaced-actions .button { min-height: 39px; padding-inline: 8px; }
.unplaced-actions .button:not(:disabled) { cursor: grab; }
.unplaced-actions .button:disabled { cursor: not-allowed; }
.bottle-drag-label {
  position: fixed; top: 0; left: 0; z-index: 12; pointer-events: none; max-width: min(280px, calc(100vw - 16px));
  padding: 6px 10px; border: 1px solid #e9a6b4; border-radius: 7px; background: #4b2e3a; color: #fff0ec;
  box-shadow: 0 5px 18px #130b11ae; font-size: 12px; font-weight: 670; overflow-wrap: anywhere;
}
@media (min-width: 1000px) {
  .cellar-workspace.with-unplaced { grid-template-columns: minmax(0, 1fr) minmax(245px, .45fr); }
  .unplaced-list { max-height: 480px; overflow: auto; padding: 3px; margin: -3px; }
}
@media (pointer: coarse) {
  .unplaced-actions .button:not(:disabled) { cursor: pointer; }
}
.label-editor canvas { width: min(100%, 400px); max-height: none; aspect-ratio: 16 / 9; }
.crop-hint { color: var(--muted); font-size: 11px; line-height: 1.35; }
.crop-rotation { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px; }
form .crop-rotation .crop-degrees {
  display: flex; align-items: center; position: relative; min-width: 0; margin-bottom: 1px;
}
form .crop-degrees > input { width: 57px; min-height: 30px; padding: 3px 14px 3px 5px; appearance: textfield; }
.crop-degrees input::-webkit-inner-spin-button, .crop-degrees input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.crop-degrees > span[aria-hidden] { position: absolute; right: 5px; pointer-events: none; }
.cellar-workspace:has(.move-mode) .unplaced-actions [data-move-bottle] { touch-action: none; }

.profile-space { width: 100%; text-align: left; background: transparent; border: 0; border-radius: 7px; padding: 4px; }
.profile-space:hover { background: var(--surface); }
.profile-space span { min-width: 0; overflow-wrap: anywhere; }
.mobile-space-actions { display: flex; gap: 6px; }
.space-shell { max-width: 960px; padding: 22px 22px 50px; margin: 0 auto; }
.space-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 42px; }
.space-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.space-intro { max-width: 550px; margin: 12px 0 22px; color: var(--muted); line-height: 1.5; }
.space-box { max-width: 460px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.space-box h2, .space-group h2 { margin-bottom: 10px; color: var(--cream); font: 26px var(--serif); }
.space-box p:not(.form-error) { margin-bottom: 8px; color: var(--muted); }
.space-auth-links, .space-box > .form-error { margin-top: 8px; }
.space-group { margin-top: 22px; }
.space-group .cellar-card h3 { color: var(--cream); font: 23px var(--serif); overflow-wrap: anywhere; }
.space-group .cellar-card p, .space-empty { color: var(--muted); }
.space-members { display: grid; gap: 6px; margin-bottom: 12px; }
.space-member {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px;
  padding: 8px; border: 1px solid var(--border); border-radius: 8px;
}
.space-member > div { flex: 1 1 105px; }
.space-member small, .install-note { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.install-note { margin-top: 12px; }
.space-member form { display: flex; gap: 4px; align-items: center; }
.space-member select { width: 110px; }
.invite-link { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.invite-link input { width: 100%; background: #1d171c; color: var(--cream); border: 1px solid var(--border); border-radius: 7px; padding: 8px; font-size: 14px; }
.admin-table { overflow-x: auto; border: 1px solid var(--border); border-radius: 9px; }
.admin-table table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 12px; }
.admin-table th, .admin-table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--rose); }
.space-shell .metrics { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
@media (max-width: 720px) {
  .space-shell { padding: 16px 16px 40px; }
  .space-header { margin-bottom: 26px; }
}

.personal-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 721px) {
  .personal-filters { grid-template-columns: minmax(0, 1fr) minmax(136px, .36fr); }
}
@media (max-width: 720px) {
  .personal-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .personal-filters > .filter-select { grid-column: 1 / -1; }
}

.history-header { flex-wrap: wrap; gap: 16px; }
.history-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 9px 13px; border: 1px solid #624251; border-radius: 24px; background: #241a21; color: var(--muted); font-size: 12px; font-weight: 600; }
.filter-chip svg { flex-shrink: 0; }
.filter-chip:hover { border-color: #b97c95; color: var(--cream); }
.filter-chip[aria-pressed="true"] { background: #583044; border-color: #b97c95; color: #ffe7ee; }
.filter-chip[aria-pressed="true"] svg { color: var(--rose); }
.rebuy-note { display: block; width: max-content; margin-top: 6px; padding: 3px 6px; border-radius: 5px; color: var(--rose); background: #422a36; font-size: 11px; }

/* Cantinova · bordeaux, prugna e vino rosato */
body { background-image: radial-gradient(ellipse at 100% 0%, #642a3c35, transparent 50%); }
.brand { font-size: 29px; }
.brand-icon { background: #8f3851; box-shadow: none; border-radius: 12px; }
.brand small { font-size: 8px; letter-spacing: .17em; }
.nav-label { margin-top: 43px; margin-bottom: 12px; }
.sidebar nav button { padding: 13px 12px; font-size: 14px; border-radius: 10px; }
.sidebar nav button[aria-current] { box-shadow: inset 3px 0 #a7506b; }
.sidebar nav small { font-size: 11px; }
.profile { font-size: 13px; }
.profile small { font-size: 11px; line-height: 1.4; }
.context-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding-bottom: 18px; margin-bottom: 28px; border-bottom: 1px solid var(--border);
}
.context-label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); }
.context-label strong { color: var(--cream); font-weight: 650; overflow-wrap: anywhere; }
.scope-pill { display: inline-flex; gap: 5px; align-items: center; width: max-content; padding: 5px 8px; font-size: 10px; font-weight: 650; letter-spacing: .035em; color: #e9a6b4; background: #402a35; border: 1px solid #64414e; border-radius: 5px; }
.scope-pill.private { color: #e2bacb; background: #37242e; border-color: #654251; }
.context-strip .button { min-height: 32px; padding-inline: 8px; font-size: 12px; white-space: nowrap; }
.scope-switcher { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); gap: 4px; min-width: 220px; max-width: 380px; padding: 4px; border: 1px solid #624251; border-radius: 11px; background: #191318; }
.scope-switcher button, .scope-shared { display: flex; justify-content: center; align-items: center; position: relative; gap: 7px; min-width: 0; min-height: 36px; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: #c5afb9; font-size: 13px; font-weight: 600; line-height: 1.2; }
.scope-switcher svg { flex-shrink: 0; }
.scope-switcher button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-switcher [aria-pressed="true"], .scope-switcher .is-active { background: #583044; color: #ffe7ee; box-shadow: 0 1px 4px #100a0d40; }
.scope-switcher button:hover { color: #ffe7ee; }
.scope-shared select { appearance: none; position: absolute; inset: 0; width: 100%; min-width: 0; border: 0; border-radius: inherit; padding: 7px 28px 7px 34px; background: transparent; color: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-overflow: ellipsis; }
.scope-shared:has(select) { justify-content: space-between; }
.scope-shared option { background: #21181f; color: var(--cream); }
.scope-switcher:focus-within { border-color: #bc7c94; }
.page-heading { margin-bottom: 25px; align-items: center; }
.page-heading p { max-width: 500px; line-height: 1.6; }
.eyebrow { font-size: 9px; letter-spacing: .18em; }
.eyebrow i { background: #d17b94; box-shadow: none; width: 5px; height: 5px; }
.metric { min-height: 88px; border-radius: 12px; padding: 15px 18px; box-shadow: 0 3px 12px #100b0d12; }
.metric strong { font-size: 32px; }
.metric div > span { font-size: 12px; }
.metric:hover { box-shadow: 0 4px 14px #0d090b26; }
.section-title h2 { font-size: 27px; }
.filters { gap: 10px; margin-block: 17px; }
.search, .filter-select { min-height: 46px; background: #241c22; }
.search:focus-within { border-color: var(--rose); }
.search input:focus-visible { outline: none; }
.wine-hit { border-radius: 13px; box-shadow: 0 4px 14px #0d090b24; }
.wine-hit:hover { background: #30222b; box-shadow: 0 8px 24px #09060940; }
.wine-copy h3 { margin-block: 7px 12px; }
.badge { border-radius: 5px; font-size: 10px; padding: 6px 8px; }
.card-arrow { background: #281d25df; color: #f0d7dd; border-color: #7e5867; }
.cover-art > img { background: #30232a; }
.wine-thumb { background: #17101750; }
.wine-thumb > img { background: #36252c; }
.cellar-card { padding: 21px; box-shadow: 0 4px 20px #09060924; border-radius: 13px; }
.cellar-card h2 { font-size: 29px; }
.cellar-card-meta { font-size: 12px; line-height: 1.4; }
.map-panel { border-radius: 13px; padding: 18px; box-shadow: 0 4px 20px #09060912; }
.slot-grid { gap: 7px; }
.slot { min-height: 78px; border-radius: 8px; }
.slot-name { font-size: 11px; }
.slot.move-source { box-shadow: inset 0 0 0 4px #503140; }
.history-card { padding: 16px; border-radius: 12px; box-shadow: 0 3px 15px #09060912; }
.history-title strong { font-size: 23px; }
.empty { background: #251c23; border-color: #634653; padding-block: 48px; }
.empty h3 { font-size: 28px; }
.empty p { line-height: 1.6; }
dialog { border-radius: 17px; border-color: #6b4757; box-shadow: 0 22px 90px #09060970; }
.dialog-content { padding: 26px; }
.dialog-heading { margin-bottom: 22px; }
.dialog-heading h2 { font-size: 32px; line-height: 1.1; }
form label { font-size: 12px; gap: 7px; }
form input:not([type="radio"]), form select, form textarea { min-height: 44px; border-radius: 8px; }
.dialog-footer { padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--border); }
.demo-banner { background: #a7506b; border-color: #a7506b; }
.demo-banner small, .demo-banner strong, .demo-text div > span { color: #fff0e8; }
.demo-icon { background: #ffffff08; border-color: #b3798c66; color: #f5bdc9; }
.demo-button { color: #fff0e8; }
.button.demo-button { background: #3e2632; border-color: #a16a7e; color: #fbefe7; }
.button.demo-button:hover { background: #563044; color: #fbefe7; }
.demo-banner::after { opacity: .23; }
.space-shell { max-width: 1140px; padding: calc(28px + var(--safe-top)) max(34px, var(--safe-right)) calc(65px + var(--safe-bottom)) max(34px, var(--safe-left)); }
.space-header { border-bottom: 1px solid var(--border); padding-bottom: 22px; margin-bottom: 38px; }
.space-intro { font-size: 15px; max-width: 600px; line-height: 1.65; }
.space-group { margin-top: 28px; }
.space-group h2 { font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 13px; color: var(--muted); }
.personal-space-card { width: 100%; display: flex; text-align: left; align-items: center; justify-content: space-between; gap: 18px; padding: 24px; border-radius: 14px; border: 1px solid #744757; background: #39242e; color: #f8e9e8; }
.personal-space-card:hover { border-color: #a36c80; background: #472c3a; }
.personal-space-copy { display: flex; align-items: center; gap: 18px; min-width: 0; }
.personal-space-card .metric-icon { width: 52px; height: 58px; background: #4a2c3a; border-color: #805265; color: #efb1c3; }
.personal-space-card h3 { font: 29px var(--serif); letter-spacing: -.03em; margin-block: 8px 4px; }
.personal-space-card p { font-size: 13px; color: #cfb9c2; line-height: 1.5; }
.space-box { max-width: 470px; padding: 25px; border-radius: 15px; box-shadow: 0 12px 35px #0906092b; }
.space-member { padding: 12px; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 70px; align-items: center; }
.auth-illustration { display: flex; align-items: center; gap: 20px; margin-top: 28px; }
.auth-emblem { display: grid; place-items: center; width: 85px; height: 100px; border: 1px solid #7f5161; border-radius: 50% 50% 8px 8px; color: #a7506b; background: #412a34; }
.auth-illustration p { font: 25px/1.25 var(--serif); color: #d1b2bf; max-width: 210px; }
.auth-layout .space-intro { max-width: 390px; margin-bottom: 12px; }
.auth-layout > .space-box { width: 100%; justify-self: end; }
.auth-layout h1 { max-width: 430px; }
@media (max-width: 1040px) {
  .page-heading { align-items: flex-start; }
  .auth-layout { gap: 30px; }
}
@media (max-width: 720px) {
  .mobile-head .scope-switcher { width: 100%; min-width: 0; max-width: none; }
  .mobile-head .scope-switcher button, .mobile-head .scope-shared { min-height: 38px; }
  .mobile-head .scope-shared select { font-size: 16px; }
  .context-strip { padding-bottom: 12px; margin-bottom: 22px; }
  .context-label { gap: 6px; font-size: 12px; }
  .context-strip .button { font-size: 11px; padding-inline: 4px; }
  .context-strip .scope-pill { display: none; }
  .context-strip.has-space { display: none; }
  .main { padding-top: 17px; }
  h1 { font-size: 39px; letter-spacing: -.04em; }
  .page-heading { gap: 16px; margin-bottom: 19px; }
  .heading-actions { flex-wrap: nowrap; }
  .heading-actions .button { font-size: 12px; padding-inline: 9px; }
  .metrics { gap: 8px; margin-bottom: 20px; }
  .metric { min-height: 105px; padding: 11px 9px; }
  .metric strong { font-size: 27px; }
  .metric div > span { font-size: 11px; line-height: 1.3; }
  .metric-icon { width: 31px; height: 31px; }
  .metric > svg:last-child { top: 13px; right: 8px; }
  .bottle-grid { gap: 10px; }
  .wine-copy { padding: 12px 10px; }
  .wine-copy h3 { font-size: 20px; margin-bottom: 9px; }
  .wine-maker { font-size: 8px; letter-spacing: .05em; }
  .wine-location { font-size: 10px; }
  .wine-hit { border-radius: 10px; }
  .mobile-head .brand { font-size: 25px; line-height: 1.15; }
  .sidebar { background: #21181ffa; backdrop-filter: blur(18px); }
  .sidebar nav button { position: relative; padding: 4px; font-size: 11px; border: 0; border-radius: 0; }
  .sidebar nav button[aria-current] { color: #f0b8ca; background: transparent; box-shadow: none; }
  .sidebar nav button[aria-current]::before { content: ''; position: absolute; top: -4px; left: calc(50% - 13px); width: 26px; height: 2px; border-radius: 2px; background: #d17b94; }
  .sidebar nav button:hover { background: transparent; color: #f0b8ca; }
  .slot { min-height: 74px; }
  .map-panel { padding: 12px; }
  .map-title h3 { font-size: 21px; }
  .history-card { padding: 12px; gap: 8px; }
  .history-title strong { font-size: 20px; }
  .dialog-content { padding: 19px 16px; }
  .space-shell { padding: calc(24px + var(--safe-top)) max(18px, var(--safe-right)) calc(40px + var(--safe-bottom)) max(18px, var(--safe-left)); }
  .space-header { padding-bottom: 18px; margin-bottom: 26px; }
  .space-header .brand { font-size: 26px; }
  .space-header .space-actions { gap: 5px; }
  .space-header .button { font-size: 11px; padding-inline: 9px; }
  .space-intro { font-size: 14px; }
  .personal-space-card { padding: 18px; }
  .personal-space-copy { gap: 12px; }
  .personal-space-card h3 { font-size: 27px; }
  .personal-space-card p { font-size: 12px; }
  .auth-layout { grid-template-columns: 1fr; gap: 23px; }
  .auth-illustration { display: none; }
  .auth-layout > .space-box { max-width: none; padding: 22px; }
  .auth-layout h1 { max-width: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .wine-hit, .cellar-card, .personal-space-card { transition: box-shadow .16s, border-color .16s, background .16s; }
}

@media (min-width: 721px) and (max-width: 1120px) {
  .bottle-grid:not(.bottle-list) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar .brand { font-size: 25px; gap: 8px; }
  .sidebar .brand-icon { width: 33px; height: 36px; }
  .sidebar .brand small { font-size: 6px; }
  .demo-banner { flex-wrap: wrap; }
  .demo-button { margin-left: auto; }
  .demo-text { gap: 9px; }
}

/* Cantinova, Registro */
:root {
  --background: #21161c;
  --sidebar: #1a1118;
  --surface: #30212b;
  --surface-strong: #251923;
  --border: #503642;
  --cream: #f6e9e2;
  --rose: #edbbca;
  --muted: #cbb4bd;
  --dim: #b29aa5;
  --accent: #90405f;
  --accent-hover: #a64e70;
}
body { background-image: radial-gradient(ellipse at 95% 0, #42242f55, transparent 45rem); }
.brand-icon { overflow: hidden; }
.brand-icon img { width: 100%; height: 100%; display: block; }
.sidebar > nav { margin-top: 36px; }
.sidebar nav button { border-radius: 5px; }
.context-strip { margin-bottom: 20px; padding-bottom: 12px; }
.beta-label { color: var(--rose); font: 650 11px/1.2 system-ui; letter-spacing: .06em; }
.beta-demo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding-inline: 10px; border-inline-start: 2px solid #a5607a; color: var(--muted); background: #35242e; font-size: 12px; }
.beta-demo .button { color: var(--rose); }
.inventory-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.inventory-title h1 { white-space: nowrap; }
.inventory-title small, .copy-count, .slot-code { font-variant-numeric: tabular-nums; }
.inventory-title small { color: var(--rose); font: 500 15px/1 system-ui; vertical-align: middle; }
.collection-links { display: flex; flex-wrap: wrap; gap: 5px 12px; margin: 5px 0 13px; }
.collection-links .button { color: var(--muted); padding: 0 3px; min-height: 36px; font-size: 12px; }
.inventory-tools { display: flex; align-items: center; gap: 7px; }
.inventory-tools .search { flex: 1 1 120px; min-width: 0; }
.inventory-tools .search input, .tonight-tools .search input { min-width: 0; }
.inventory-tools .view-switch { flex-shrink: 0; }
.search input::-webkit-search-cancel-button { display: none; }
.search .icon-button { width: 44px; height: 44px; flex: none; margin-inline-end: -6px; background: transparent; border: 0; color: var(--muted); }
.filter-category { display: grid; gap: 7px; margin-block: 14px; }
.filter-category h3 { font: 650 13px/1.4 system-ui; color: var(--muted); }
.filter-options { display: flex; gap: 6px; flex-wrap: wrap; }
#result-count:not(.sr-only) { margin: 0 0 7px; color: var(--muted); font-size: 12px; }
.active-filters, .tonight-tools, .meal-chips, .journal-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.active-filters:not(:empty), .tonight-tools { margin-block: 10px; }
.tonight-tools .search { flex: 1 1 170px; min-width: 0; }
.meal-catalog { flex-basis: 100%; min-width: 0; border-bottom: 1px solid var(--border); }
.meal-catalog summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 8px; cursor: pointer; color: var(--rose); }
.meal-catalog summary::-webkit-details-marker { display: none; }
.meal-catalog[open] summary svg { transform: rotate(180deg); }
.meal-catalog-content { max-block-size: min(39dvh, 300px); overflow-y: auto; overscroll-behavior-y: contain; padding: 0 6px 10px; }
.meal-catalog-group + .meal-catalog-group { margin-top: 12px; }
.meal-catalog-group h3 { margin: 0 0 4px; font: 650 12px/1.3 system-ui; color: var(--muted); }
.meal-catalog-group ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 1px 8px; margin: 0; padding: 0; list-style: none; }
.meal-catalog-group .button { width: 100%; min-height: 44px; justify-content: flex-start; text-align: start; overflow-wrap: anywhere; border-bottom: 1px solid var(--border); border-radius: 0; padding-inline: 3px; }
.button.filter-chip { min-height: 40px; }
.filter-options .button.filter-chip { min-height: 44px; }
.wine-card { display: flex; flex-direction: column; border-bottom: 1px solid var(--border); }
.wine-hit, .wine-hit:hover { height: auto; border: 0; background: transparent; box-shadow: none; }
.wine-card .wine-hit:hover { background: var(--surface); }
.wine-hit .wine-art-wrap { overflow: hidden; border-radius: 7px; }
.wine-card .location-link { align-self: flex-start; text-align: left; color: var(--rose); font-variant-numeric: tabular-nums; }
.copy-count, .pairing-match { display: block; font-size: 13px; color: var(--rose); }
.wine-inspector { display: none; }
.wine-copy h3 { font-size: clamp(20px, 2.3vw, 27px); margin: 3px 0 5px; }
.wine-maker { color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; }
.bottle-list .wine-art-wrap { width: 100px; flex-basis: 100px; }
.bottle-list .wine-hit { min-height: 66px; }
.bottle-list .wine-art-wrap .badge { display: none; }
.copy-links { display: grid; margin-block: 12px; }
.copy-links > div { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
.copy-links .button, .location-link { white-space: normal; }
.group-cover .bottle-art { height: 180px; border-radius: 8px; }
@media (min-width: 1050px) {
  .with-inspector { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 25px; align-items: start; }
  .wine-inspector { display: grid; gap: 8px; position: sticky; top: calc(20px + var(--safe-top)); padding-left: 18px; border-left: 1px solid var(--border); }
  .wine-inspector h2 { font: 400 29px/1.1 var(--serif); }
  .wine-inspector p { color: var(--muted); }
  .wine-card.is-selected .wine-hit { background: #382530; }
  .bottle-list .wine-card:has(.location-link) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); align-items: center; }
  .bottle-list .wine-card .location-link { align-self: center; max-width: 158px; }
}
.journal-entry { display: grid; grid-template-columns: minmax(115px, 190px) 1fr; align-items: start; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--border); }
.journal-cover { padding: 0; border: 0; background: none; overflow: hidden; border-radius: 8px; }
.journal-cover .bottle-art { height: 125px; }
.journal-cover .bottle-drawing { height: 114px; }
.journal-copy { min-width: 0; }
.journal-copy time { color: var(--muted); font-size: 12px; }
.journal-copy h2 { font: 400 26px/1.2 var(--serif); overflow-wrap: anywhere; margin: 3px 0 8px; }
.journal-copy .stars { margin-bottom: 6px; }
.journal-note { color: var(--cream); font: 400 17px/1.45 var(--serif); white-space: pre-line; overflow-wrap: anywhere; }
.journal-actions { margin-top: 8px; }
.journal-actions .button { padding-inline: 6px; font-size: 12px; }
.journal-actions .primary { padding-inline: 10px; }
.pairing-match svg, .detail-notes h3 svg { vertical-align: middle; color: var(--rose); }
.pairing-match { margin-top: 4px; overflow-wrap: anywhere; }
.pairing-reason { display: block; margin-top: 4px; color: var(--muted); line-height: 1.4; }
.wine-pairings { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.wine-pairings li { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.wine-pairings h3 { margin: 3px 0; font: 400 23px/1.2 var(--serif); }
.wine-pairings p { color: var(--muted); font-size: 13px; line-height: 1.5; }
[data-wine-pairings] { margin-top: 14px; }
.portrait-art { align-self: start; aspect-ratio: 3 / 4; max-block-size: min(330px, 48dvh); border-radius: 8px; }
.portrait-art > .bottle-art { height: 100%; min-height: 0; border-radius: inherit; }
.portrait-art > img { padding: 3px; object-fit: contain; }
.portrait-art .bottle-drawing { height: 90%; max-height: 240px; }
.group-cover .portrait-art { width: min(72%, 210px); margin-inline: auto; }
.located-wine { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; background: #402a35; border: 1px solid #86556a; border-radius: 7px; padding: 9px; }
.located-wine > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.located-wine small { display: block; color: var(--rose); }
.slot.located-slot { border: 2px solid var(--rose); }
.map-panel, .cellar-card, .space-box, .personal-space-card { box-shadow: none; border-radius: 8px; }
.cellar-map > .slot-scroll { padding: 8px; background: #211820; border: 1px solid #624654; border-radius: 7px; }
.cellar-map .slot { border-bottom: 2px solid #765264; }
.cellar-map .slot-code { font-family: ui-monospace, monospace; }
.slot-cork { flex: none; width: 18px; height: 18px; border: 2px solid #b98697; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #8c5365 0 1px, transparent 1.4px), radial-gradient(circle at 70% 64%, #8c5365 0 1px, transparent 1.4px), #d6a9b1; }
.name-camera { display: flex; gap: 8px; align-items: end; }
.name-camera label { flex: 1; }
.name-camera .icon-button { min-width: 44px; min-height: 44px; }
[data-quick-matches]:not(:empty) { display: grid; padding: 5px 0; }
.quick-match { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px; background: var(--surface-strong); color: var(--cream); border: 0; border-bottom: 1px solid var(--border); text-align: left; }
.quick-match span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.quick-match small { display: block; color: var(--muted); }
.save-destination { color: var(--rose); overflow-wrap: anywhere; }
[data-assignment-map]:not(:empty) { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--border); }
[data-assignment-map] h3 { font: 400 19px var(--serif); margin-bottom: 8px; }
[data-assignment-map] .slot { min-height: 44px; }
[data-assignment-map] .slot:disabled { cursor: default; }
.space-header, .space-member, .admin-table { border-color: var(--border); }
.space-shell .eyebrow, .auth-illustration { display: none; }
.space-shell .scope-pill { border-radius: 4px; }
.dialog-open { overflow: hidden; scrollbar-gutter: stable; }
.dialog-open body { position: fixed; inset: var(--dialog-page-y, 0px) 0 auto; }
dialog { overscroll-behavior: contain; }
@media (max-width: 720px), (pointer: coarse) {
  dialog {
    position: fixed;
    inset: calc(var(--visible-top, 0px) + var(--safe-top) + 8px) var(--safe-right) auto var(--safe-left);
    margin: 0 auto;
    max-height: calc(var(--visible-height, 100dvh) - var(--safe-top) - var(--safe-bottom) - 16px);
  }
  .dialog-content { padding-top: 0; }
  .dialog-heading { position: sticky; top: 0; z-index: 3; padding-block: 15px 10px; margin-bottom: 9px; background: var(--surface); }
  .dialog-heading .icon-button { width: 44px; height: 44px; flex: none; }
}
@media (max-width: 720px) {
  .mobile-head { gap: 8px; padding-top: calc(13px + var(--safe-top)); padding-bottom: 9px; background: #21161c; }
  .sidebar { background: #21161c; }
  .sidebar > nav { margin-top: 0; }
  .inventory-title h1 { font-size: clamp(33px, 8vw, 39px); }
  .collection-links { gap: 2px 7px; margin-block: 1px 8px; }
  .collection-links .button { min-height: 39px; font-size: 11px; }
  .collection-links svg { width: 13px; }
  .inventory-tools { display: grid; grid-template-columns: auto 1fr; }
  .inventory-tools .search { grid-column: 1 / -1; padding-inline: 11px; gap: 6px; }
  .inventory-tools .view-switch { justify-self: end; }
  .inventory-tools .inventory-filters { justify-self: start; }
  .inventory-tools .search input, .tonight-tools .search input { font-size: 16px; }
  .inventory-tools .view-switch button { padding-inline: 4px; }
  .tonight-tools .search { flex-basis: 100%; }
  .detail { grid-template-columns: minmax(95px, .86fr) minmax(0, 1.14fr); gap: 12px; }
  .journal-entry { grid-template-columns: minmax(72px, 100px) 1fr; gap: 11px; }
  .journal-cover .bottle-art { height: 92px; }
  .journal-cover .bottle-drawing { height: 82px; }
  .journal-copy h2 { font-size: 23px; }
  .journal-actions .button { min-height: 42px; }
}
