/* Visual layer for the embedded scanner. Presentation only: IDs, controls and logic stay in app.css/app.js. */
@import url("../assets/r3/type.css");

:root:root:root, :root:root:root[data-theme] {
  --paper: #ffffff; --paper-2: #f4f4f6; --card: #ffffff;
  --ink: #141217; --ink-2: #3b3840; --muted: #6b6770; --rule: rgba(20, 18, 23, .1);
  --wine: #6b1736; --wine-2: #561129; --gold: #6b1736; --wine-soft: #f7eef1;
  --ok: #2f7a4f; --warn: #9a6a12; --bad: #a2313b;
  --shadow: none;
  --display: "Geologica", "Commissioner", system-ui, sans-serif;
  --text: "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ui: var(--text);
  color-scheme: light;
}

body { background: #fff; background-image: none; min-height: 0; font: 400 16px/1.55 var(--text); }
.grain { display: none; }
h1, h2, h3, h4, em, .card-producer, .stage-head h2, .idle-title, .bottle-head h3, .viewer-head h2, .alts-title, .loading-title { font-style: normal; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the service page carries the heading; the live status keeps its own right-aligned row, so a long label wraps instead of covering a heading */
.masthead { justify-content: flex-end; border-bottom: 0; padding-top: 0; padding-bottom: 0; animation: none; }
@media (min-width: 881px) {
  .masthead { padding-top: 16px; }
  .layout { padding-top: 16px; }
}
.masthead .brand { display: none; }
.status { min-height: 34px; max-width: 100%; padding: 0 12px; border-radius: 999px; font: 400 14px/1.2 var(--ui); text-align: left; }
/* Ready is a resting state: a box-shadow pulse repaints the iframe every frame
   and invalidates the translucent fixed navigation above it while scrolling. */
.status.ready .dot { animation: none; }
/* glass.js filter definitions only; an inline svg would add a line box below the measured content */
svg.control-optics { position: absolute; top: 0; left: 0; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.foot { border-top: 1px solid var(--rule); color: var(--muted); font: 14px/1.4 var(--ui); }
.stage, .result, .extra, .card { animation: none; }

.stage-head { margin-bottom: 14px; }
.stage-head h2, .idle-title { font: 540 19px/1.25 var(--display); letter-spacing: -.02em; margin: 0; }
.stage-head h2 { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--muted); font-family: var(--ui); }
#result-title:focus { outline: none; }
.loading-title, .error-title { font: 540 21px/1.25 var(--display); letter-spacing: -.02em; }

/* Same three materials as the host, from one set of variables: toned wine glass (primary), clear glass (every other button) and the pressed
   wine lens for pressed, selected or expanded states. glass.js adds the lens; the host forwards its explicit transparency preference. */
:root {
  --w-fill: rgba(98, 18, 49, .86);
  --w-fill-h: rgba(106, 23, 54, .88);
  --w-veil: transparent;
  --w-veil-h: rgba(255, 255, 255, .025);
  --w-optic: blur(4px) saturate(1.2) brightness(.55);
  --w-rim: rgba(255, 255, 255, .12);
  --w-rim-live: rgba(255, 255, 255, .12);
  --w-shadow: 0 3px 10px -4px rgba(30, 20, 25, .18);
  --w-shadow-a: 0 1px 4px -2px rgba(30, 20, 25, .18);
  --q-fill: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .62)), rgba(244, 243, 246, .4);
  --q-fill-h: linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .72)), rgba(244, 243, 246, .4);
  --q-optic: blur(12px) saturate(1.4) brightness(1.04);
  --q-rim: linear-gradient(128deg, #fff 0%, rgba(255, 255, 255, .3) 24%, rgba(255, 255, 255, 0) 46%, rgba(255, 255, 255, 0) 60%, rgba(107, 23, 54, .14) 82%, rgba(255, 255, 255, .9) 100%);
  --q-shadow: 0 1px 2px rgba(20, 18, 23, .07), 0 6px 14px -9px rgba(64, 12, 32, .3);
  --q-shadow-sm: 0 1px 2px rgba(20, 18, 23, .07), 0 6px 14px -9px rgba(64, 12, 32, .32);
  --q-frost-shadow: var(--q-shadow);
  --p-fill: linear-gradient(180deg, rgba(107, 23, 54, .16), rgba(107, 23, 54, .08)), rgba(255, 255, 255, .5);
  --p-shadow: inset 0 2px 6px -2px rgba(74, 14, 36, .42), inset 0 0 0 1px rgba(107, 23, 54, .22);
  /* smoked glass over the user's photo */
  --s-fill: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 60%), rgba(20, 18, 23, .34);
  --s-fill-h: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 60%), rgba(20, 18, 23, .5);
  --s-optic: blur(8px) saturate(1.5) brightness(.62);
  --s-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), inset 0 0 0 1px rgba(255, 255, 255, .1), 0 6px 18px -10px rgba(0, 0, 0, .6);
  --g-fx: block;
  --bw-solid: #651632;
  --bw-solid-shadow: 0 3px 10px -4px rgba(30, 20, 25, .18);
  --bq-solid: radial-gradient(120% 100% at 24% -30%, #fff, rgba(255, 255, 255, 0) 62%), linear-gradient(180deg, #f6f5f8 0%, #ebeaef 100%);
  --bq-solid-shadow: inset 0 1px 0 #fff, inset 0 -2px 3px -2px rgba(107, 23, 54, .14), 0 1px 2px rgba(20, 18, 23, .08), 0 10px 22px -12px rgba(64, 12, 32, .36);
  --bq-solid-shadow-sm: inset 0 1px 0 #fff, inset 0 -1px 2px -1px rgba(107, 23, 54, .14), 0 1px 2px rgba(20, 18, 23, .08), 0 6px 14px -9px rgba(64, 12, 32, .34);
}
/* frosted solid glass when the system reduces transparency (unless "Прозрачные") or backdrop-filter is missing: no see-through, same lit rim and shadow */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html:not([data-glass="off"]) { --w-fill: var(--bw-solid); --w-fill-h: var(--bw-solid); --w-optic: none; --w-shadow: var(--bw-solid-shadow); --q-fill: var(--bq-solid); --q-fill-h: var(--bq-solid); --q-optic: none; --q-shadow: var(--bq-solid-shadow); --q-shadow-sm: var(--bq-solid-shadow-sm); --s-fill: rgba(20, 18, 23, .92); --s-fill-h: rgba(20, 18, 23, .96); --s-optic: none; }
}
@media (prefers-reduced-transparency: reduce) {
  html:not([data-glass="on"]) { --w-fill: var(--bw-solid); --w-fill-h: var(--bw-solid); --w-optic: none; --w-shadow: var(--bw-solid-shadow); --q-fill: var(--bq-solid); --q-fill-h: var(--bq-solid); --q-optic: none; --q-shadow: var(--bq-solid-shadow); --q-shadow-sm: var(--bq-solid-shadow-sm); --s-fill: rgba(20, 18, 23, .92); --s-fill-h: rgba(20, 18, 23, .96); --s-optic: none; }
}
html[data-glass="off"] { --w-fill: var(--wine); --w-fill-h: var(--wine-2); --w-optic: none; --w-shadow: none; --w-shadow-a: none; --q-fill: var(--paper-2); --q-fill-h: #ebebef; --q-optic: none; --q-shadow: none; --q-shadow-sm: none; --p-fill: var(--wine-soft); --p-shadow: none; --s-fill: rgba(20, 18, 23, .92); --s-fill-h: rgba(20, 18, 23, .96); --s-optic: none; --g-fx: none; }
@media (prefers-contrast: more) {
  :root:root { --w-fill: var(--wine); --w-fill-h: var(--wine-2); --w-optic: none; --w-shadow: 0 0 0 1px var(--ink); --w-shadow-a: inset 0 0 0 2px #fff, 0 0 0 2px var(--ink); --q-fill: #fff; --q-fill-h: #fff; --q-optic: none; --q-shadow: inset 0 0 0 1px var(--ink); --q-shadow-sm: inset 0 0 0 1px var(--ink); --p-fill: #fff; --p-shadow: inset 0 0 0 2px var(--wine); --s-fill: #141217; --s-fill-h: #141217; --s-optic: none; --s-shadow: inset 0 0 0 1px #fff; --g-fx: none; }
}

button, .button { font: 500 15px/1 var(--ui); letter-spacing: 0; text-transform: none; }
.primary, .ghost, .status, .tab, .help-btn, .chip.more-btn, .tip-close {
  position: relative; isolation: isolate; border: 0; transition: background .2s, box-shadow .2s, transform .12s;
  -webkit-backdrop-filter: var(--optic); backdrop-filter: var(--optic);
}
.primary, .ghost { border-radius: 999px; min-height: 48px; padding: 0 22px; }
.primary::before, :is(.ghost, .status, .tab, .help-btn, .chip.more-btn, .tip-close):not([aria-pressed="true"], [aria-selected="true"], [aria-expanded="true"])::before {
  content: ""; display: var(--g-fx); position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: var(--rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.primary, .primary:hover {
  --optic: var(--w-optic); --rim: var(--w-rim); --tone: wine; --tone-optic: brightness(1); --spec: 0; --frost: #5e1130;
  --matte: 1; --frost-flat: 1; --dome: 0; --frost-a: 0; --frost-blur: 4;
  color: #fff; font-weight: 600; background: var(--w-fill); box-shadow: var(--w-shadow);
}
/* glass.js toned the backdrop into the wine ramp and lights the rim from the pointer: no fixed sheen on top */
.primary.tone-live { --rim: var(--w-rim-live); background: var(--w-veil); }
:is(.ghost, .status, .tab, .help-btn, .chip.more-btn, .tip-close) {
  --optic: var(--q-optic); --rim: var(--q-rim); --spec: .15; --frost: #f4f3f6; --matte: 1; --dome: 0; --frost-a: .78; --frost-blur: 12;
  color: var(--wine-2); background: var(--q-fill); box-shadow: var(--q-shadow);
}
:is(.status, .tab, .help-btn, .chip.more-btn, .tip-close) { box-shadow: var(--q-shadow-sm); }
.ghost[aria-pressed="true"], .tab[aria-selected="true"], :is(.help-btn, .chip.more-btn)[aria-expanded="true"] { color: var(--wine); background: var(--p-fill); box-shadow: var(--p-shadow); }
.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.primary:active, .ghost:active { transform: scale(.98); }
.primary:active { box-shadow: var(--w-shadow-a); }
@media (hover: hover) {
  .primary:not(:active):hover { background: var(--w-fill-h); }
  .primary.tone-live:not(:active):hover { background: var(--w-veil-h); }
  :is(.ghost, .status, .tab, .help-btn, .chip.more-btn, .tip-close):not([aria-pressed="true"], [aria-selected="true"], [aria-expanded="true"]):hover { background: var(--q-fill-h); }
}
/* frost-live: glass.js paints the opaque frosted face and the lit, bending rim; the CSS fill steps aside */
.primary.frost-live, .primary.frost-live:hover { background: var(--w-veil); }
:is(.ghost, .status, .tab, .help-btn, .chip.more-btn, .tip-close).frost-live, :is(.ghost, .status, .tab, .help-btn, .chip.more-btn, .tip-close).frost-live:hover { background: none; box-shadow: var(--q-frost-shadow); }
@media (hover: hover) { :is(.ghost, .status, .tab, .help-btn, .chip.more-btn, .tip-close).frost-live:not([aria-pressed="true"], [aria-selected="true"], [aria-expanded="true"]):hover { background: rgba(255, 255, 255, .26); } }
/* with a camera button on touch screens, "Выбрать фото" steps down to clear glass */
@media (pointer: coarse) {
  .small { min-height: 44px; }
  .primary.pick-btn, .primary.pick-btn:hover {
    --optic: var(--q-optic); --rim: var(--q-rim); --tone: none; --spec: .15; --frost: #f4f3f6; --matte: 1; --dome: 0; --frost-a: .78; --frost-blur: 12;
    color: var(--wine-2); font-weight: 500; background: var(--q-fill); box-shadow: var(--q-shadow);
  }
  .primary.pick-btn.frost-live, .primary.pick-btn.frost-live:hover { background: none; }
}
.status, .status:hover { color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }

/* empty state: the photographed glass from the home page under a frosted pane; the whole surface still accepts a dropped photo */
.drop {
  position: relative; isolation: isolate; overflow: hidden; min-height: 520px; padding: clamp(20px, 3vw, 36px);
  align-items: flex-start; justify-content: flex-end; text-align: left; gap: 0;
  --drop-pos: 88% 30%; --drop-size: auto 132%;
  border: 0; border-radius: 24px; box-shadow: inset 0 0 0 1px var(--rule); transition: box-shadow .25s ease;
}
.drop, .drop:hover, .drop.over { background: #f6f5f7 url("../assets/revision2/wine-light.jpg") var(--drop-pos) / var(--drop-size) no-repeat; }
.drop::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(200deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .5) 78%, rgba(255, 255, 255, .72));
}
@media (hover: hover) { .drop:hover { border: 0; box-shadow: inset 0 0 0 1px rgba(107, 23, 54, .3); } }
.drop.over { transform: none; border: 0; box-shadow: inset 0 0 0 2px var(--wine), 0 0 0 6px rgba(107, 23, 54, .1); }
.drop-glass {
  position: relative; isolation: isolate; display: grid; justify-items: start; gap: 10px; width: min(100%, 440px);
  padding: 28px 30px 24px; border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(255, 255, 255, .55), 0 2px 4px rgba(20, 18, 23, .06), 0 30px 60px -32px rgba(52, 8, 24, .5);
}
/* the frost is its own layer, not an ancestor of the buttons, so their glass still sees the photograph */
.drop-glass::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(80% 70% at 18% 0%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 70%), rgba(255, 255, 255, .58);
  -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .drop-glass::before { background: rgba(255, 255, 255, .94); } }
@media (prefers-reduced-transparency: reduce) { html:not([data-glass="on"]) .drop-glass::before { background: rgba(255, 255, 255, .95); -webkit-backdrop-filter: none; backdrop-filter: none; } }
html[data-glass="off"] .drop-glass::before { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (prefers-contrast: more) { .drop-glass { box-shadow: inset 0 0 0 1px var(--ink); } .drop-glass::before { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; } }
.drop .hero-title { font: 560 clamp(30px, 3vw, 42px)/1.02 var(--display); letter-spacing: -.045em; max-width: none; font-variation-settings: "SHRP" 40, "CRSV" 0; }
.drop .hero-lede { font: 400 17px/1.5 var(--text); color: var(--ink-2); max-width: 30ch; }
.hero-actions { justify-content: flex-start; margin-top: 10px; }
.hero-actions .primary { padding: 0 26px; min-height: 52px; font-size: 16px; }
.drop .drop-hint { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.drop-note { font-size: 13px; color: var(--muted); max-width: none; }

/* before a photo: the answer column names what the answer holds, opposite the upload card */
.panel { border-radius: 14px; border: 0; box-shadow: none; background: #fff; }
.panel.idle { display: grid; align-content: start; gap: 0; padding: 0; background: none; }
@media (min-width: 881px) { [data-phase="idle"] .result { align-self: center; } }
.idle-note { max-width: 40ch; margin: 20px 0 0; font: 400 15px/1.5 var(--text); color: var(--muted); }
.panel.idle .idle-title { font-size: clamp(28px, 2.6vw, 36px); line-height: 1.05; letter-spacing: -.04em; font-variation-settings: "SHRP" 40, "CRSV" 0; }
.idle-text { margin: 12px 0 0; font: 400 17px/1.5 var(--text); color: var(--ink-2); max-width: 40ch; }
.error { padding: 28px 28px 26px; background: linear-gradient(180deg, #fff, #fcf8f9); box-shadow: inset 3px 0 0 var(--bad), 0 0 0 1px rgba(162, 49, 59, .22); }
.error.info { background: #fff; box-shadow: inset 3px 0 0 var(--wine), 0 0 0 1px var(--rule); }
.loading { position: relative; overflow: hidden; text-align: left; padding: 30px 28px 26px; border-radius: 20px; background: radial-gradient(80% 120% at 100% 0%, var(--wine-soft), rgba(247, 238, 241, 0) 60%), var(--paper-2); }
.loading::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--wine), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: sweep 1.6s ease-in-out infinite; }
@keyframes sweep { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.loading .elapsed { margin: 4px 0 0; font-variant-numeric: tabular-nums; min-height: 1.5em; }
.loading .actions { margin-top: 16px; }

/* the photo: controls are smoked glass so they read on any picture; dense when transparency is reduced */
.photo-frame { border-radius: 22px; border: 0; box-shadow: inset 0 0 0 1px var(--rule); background: radial-gradient(70% 60% at 50% 40%, #fbfbfc, #efeef2); }
.overlay .box.active, .overlay .box:focus { stroke: #fff; stroke-width: 4; }
.overlay .box:focus-visible { outline: none; stroke: var(--wine); }
.overlay .roi { stroke: #fff; fill: rgba(255, 255, 255, .14); }
.overlay .roi.editing { fill: rgba(255, 255, 255, .22); }
.badge { font-family: var(--ui); font-weight: 600; }
.badge-bg { fill: var(--ink); }
.badge-bg.active { fill: var(--wine); }
.draw-bar, .photo-chip, .roi-hint {
  background: rgba(20, 18, 23, .56); color: #fff; border: 0; box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
}
/* photo tools are smoked glass that bends the photo under it; "Распознать" is the toned wine glass of the primary */
.photo-tool, .roi-btn {
  --optic: var(--s-optic); --spec: .2; --dome: 0; --frost: #1d1a20; --matte: 1; --frost-a: .62; --frost-blur: 12;
  color: #fff; border: 0; background: var(--s-fill); box-shadow: var(--s-shadow);
  -webkit-backdrop-filter: var(--optic); backdrop-filter: var(--optic);
}
.roi-btn.go {
  --optic: var(--w-optic); --tone: wine; --tone-optic: brightness(1); --spec: 0; --dome: 0; --frost: #5e1130; --matte: 1; --frost-flat: 1; --frost-a: 0; --frost-blur: 4;
  color: #fff; background: var(--w-fill); box-shadow: var(--w-shadow);
}
.roi-btn.go.tone-live { background: var(--w-veil); }
/* reduced transparency: glass.js paints a dense smoked face and keeps the bending rim, so the CSS fill steps aside */
.photo-tool.frost-live, .roi-btn:not(.go).frost-live { background: none; }
.photo-tool { border-radius: 10px; }
.roi-btn { border-radius: 10px; width: 44px; height: 44px; animation: none; }
.roi-btn.go { width: 52px; height: 52px; border-radius: 12px; }
.photo-tool svg, .roi-btn svg { stroke-width: 1.75; }
.roi-btn.go svg { stroke-width: 2; }
.draw-bar { border-radius: 12px; }
.photo-chip { border-radius: 10px; }
/* inside the smoked draw bar: clear glass as a light fill with a lit top rim */
.draw-btn, .draw-btn:hover {
  border-radius: 999px; font: 500 14px/1 var(--ui); letter-spacing: 0; text-transform: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .12)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
@media (hover: hover) { .draw-btn:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .36), rgba(255, 255, 255, .18)); } }
html[data-glass="off"] .draw-btn { background: #46434a; box-shadow: none; }
@media (prefers-contrast: more) {
  .draw-btn, .draw-btn:hover { background: #fff; color: #141217; box-shadow: inset 0 0 0 2px #141217; }
  html[data-glass="off"] .draw-btn { background: #fff; box-shadow: inset 0 0 0 2px #141217; }
}
.roi-ui.editing .roi-btn.edit { background: var(--wine); color: #fff; }
.roi-handle { border-color: var(--wine); }
.roi-hint {
  position: absolute; left: 50%; transform: translateX(-50%); margin: 0; padding: 8px 12px; border-radius: 8px;
  font: 500 13px/1.3 var(--ui); white-space: nowrap; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; opacity: 0; visibility: hidden;
}
.roi-hint.on { opacity: 1; visibility: visible; }
@media (hover: hover) {
  .photo-tool:not(.frost-live):hover, .roi-btn:not(.go, .frost-live):hover { background: var(--s-fill-h); transform: none; box-shadow: var(--s-shadow); }
  .roi-btn.go:hover { transform: none; box-shadow: var(--w-shadow); }
}
.photo-tool::after, .roi-btn::after, .help-tip, .result-tip-bubble, .file-tip { border-radius: 8px; font-family: var(--ui); }
#file-tip {
  position: static; display: flex; align-items: flex-start; gap: 10px; width: auto; max-width: none; margin: 12px var(--gutter-r) 16px var(--gutter-l); padding: 12px 8px 12px 16px;
  opacity: 1; transform: none; transition: none; background: var(--wine-soft); color: var(--wine); box-shadow: none; scroll-margin-block: 76px 100px;
}
#file-tip p { flex: 1; padding-top: 2px; }
#file-tip::before { display: none; }
.tip-close { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.tip-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
@media (prefers-reduced-transparency: reduce) {
  .draw-bar, .photo-chip, .roi-hint { background: rgba(20, 18, 23, .92); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
figcaption { font: 14px/1.4 var(--ui); }

/* result */
.bottle-tabs { gap: 6px; }
.tab, .tab:hover { border-radius: 999px; color: var(--ink-2); font: 500 14px/1.2 var(--ui); letter-spacing: 0; min-height: 40px; padding: 0 14px; }
.tab[aria-selected="true"] { color: var(--wine); }
.bottle-head h3 { font: 540 19px/1.25 var(--display); letter-spacing: -.02em; }
.bottle-head h3:focus { outline: none; }
.verdict, .card-tag { font: 500 14px/1.3 var(--ui); letter-spacing: 0; text-transform: none; color: var(--wine); }
.card-verdict { margin: 4px 0 0; font: 400 14px/1.4 var(--ui); color: var(--ink-2); }
.card, .empty-card { border-radius: 16px; border: 1px solid var(--rule); box-shadow: none; background: #fff; }
.card.best { border: 0; padding: 0; gap: 18px; }
.card-ref, .pane { border: 0; border-radius: 16px; background: radial-gradient(58% 42% at 50% 18%, #fff, rgba(255, 255, 255, 0) 72%), linear-gradient(180deg, #f7f6f8, #eceaef); }
.card-ref img, .pane img { mix-blend-mode: multiply; }
.pane img { inset: 18px 14px 22px; width: calc(100% - 28px); height: calc(100% - 40px); }
/* the user's crop stands whole on a light neutral mat, not on a black field */
.pane.mine { background: linear-gradient(180deg, #efeef2, #e6e4e9); box-shadow: inset 0 0 0 1px var(--rule); }
.pane.mine canvas, .pane.mine img { mix-blend-mode: normal; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
.compare { gap: 12px; }
/* photo and reference stay small enough that the wine's name and actions share the first screen; the pair stays one block with its zoom chip inside */
.compare .pane { max-height: 230px; }
@media (min-width: 881px) { .compare { grid-template-columns: repeat(2, minmax(0, 172px)); justify-content: start; width: min(100%, 356px); } }
.card.best.with-compare { gap: 14px; }
.pane-fig figcaption { font: 500 13px/1.3 var(--ui); letter-spacing: 0; text-transform: none; color: var(--muted); text-align: left; padding-left: 2px; }
.pane-fig:first-child figcaption { color: var(--wine); }
.compare, .card-ref.zoomable { position: relative; }
.zoom-chip {
  position: absolute; right: 8px; top: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px;
  font: 500 13px/1 var(--ui); color: #fff; background: rgba(20, 18, 23, .72); pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 2px 8px -3px rgba(20, 18, 23, .5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.zoom-chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
.card-ref .zoom-chip { padding: 5px; font-size: 0; gap: 0; }
@media (prefers-reduced-transparency: reduce) {
  .zoom-chip { background: rgba(20, 18, 23, .94); color: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .zoom-chip { background: #141217; color: #fff; box-shadow: inset 0 0 0 1px #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.card-title { font: 560 clamp(24px, 2.4vw, 32px)/1.06 var(--display); letter-spacing: -.04em; text-wrap: balance; font-variation-settings: "SHRP" 40, "CRSV" 0; }
.card.best .card-body { padding-top: 6px; border-top: 1px solid var(--ink); }
.card.best .card-tag { display: block; padding-top: 12px; }
.card-producer { font: 400 16px/1.4 var(--text); color: var(--ink-2); }
.chip { border: 0; border-radius: 5px; background: var(--paper-2); font: 13px/1.3 var(--ui); color: var(--ink-2); padding: 4px 9px; }
.chip.more { border: 0; background: none; color: var(--wine); text-decoration: underline; text-underline-offset: 3px; }
.chip.more-btn { border-radius: 999px; min-height: 28px; padding: 4px 10px; font: 600 13px/1 var(--ui); letter-spacing: 0; }
.card-gastronomy { font: 15px/1.45 var(--ui); }
.card-gastronomy-label { font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.card-gastronomy-label::after { content: " · категории каталога"; font-weight: 400; }
.card-link a { font: 500 15px/1.3 var(--ui); letter-spacing: 0; text-transform: none; border-bottom: 0; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; padding: 10px 0; color: var(--wine); }
.card-link .arrow { width: 1em; height: 1em; stroke-width: 1.75; }
.service-actions { margin-top: 14px; gap: 8px; }
.alts-title { font: 540 18px/1.25 var(--display); letter-spacing: -.02em; flex-wrap: wrap; }
.alts-title span { font: 400 13px/1.3 var(--ui); color: var(--muted); }
.alts .card { border-radius: 16px; border-color: var(--rule); transition: border-color .15s, box-shadow .2s; }
@media (hover: hover) { .alts .card.pickable:hover { box-shadow: 0 10px 24px -18px rgba(64, 12, 32, .4); } }
.alts .card-ref { border-radius: 10px; }
.alts .service-actions { margin-top: 8px; }
.alts-more { margin-top: 10px; }
.alts-more > summary { padding: 10px 0; cursor: pointer; font: 500 15px/1.3 var(--ui); color: var(--wine); text-decoration: underline; text-underline-offset: 3px; }
.alts-more > .alts { margin-top: 4px; }
.empty-card { background: var(--paper-2); border: 0; }
.empty-title { font: 540 19px/1.25 var(--display); letter-spacing: -.02em; }
.help-btn { border-radius: 50%; font: 600 15px/1 var(--ui); }
.result-tip-bubble { font: 15px/1.45 var(--ui); }
.extra .stage-head h2 { font-size: 16px; color: var(--ink-2); }
.viewer { border-radius: 22px; border: 0; box-shadow: 0 40px 90px -40px rgba(30, 6, 16, .6); }
.viewer::backdrop { background: rgba(20, 18, 23, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.viewer-head h2 { font: 540 18px/1.25 var(--display); letter-spacing: -.02em; }
.back-btn svg, .ghost .back-icon { stroke-width: 1.75; }

/* secondary actions: one compact row under photo and answer, never a third column */
.extra { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 20px; padding-top: 16px; border-top: 1px solid var(--rule); }
.extra .stage-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
.extra-actions { gap: 8px; }
.extra-actions + .extra-actions { margin-top: 0; }
.extra .ghost { min-height: 40px; padding: 0 14px; font-size: 14px; }
@media (pointer: coarse) { .extra .ghost { min-height: 44px; } }
@media (min-width: 881px) {
  .layout, [data-phase="photo"] .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 32px 36px; }
  .stage, [data-phase="photo"] .stage { grid-row: 1; }
  .extra, [data-phase="photo"] .extra { grid-column: 1 / -1; grid-row: 2; position: static; }
  [data-phase="photo"] .extra-actions { flex-direction: row; }
  [data-phase="photo"] .extra .ghost { width: auto; }
}

/* Embedded pages use the host viewport, never their own expanding iframe height. */
#preview { max-height: min(620px, calc(var(--host-height, 900px) * .6)); }
.viewer { max-height: calc(var(--host-height, 900px) - 24px); }
.viewer .pane { height: min(600px, calc(var(--host-height, 900px) * .66)); }
@media (max-width: 880px) {
  #preview { max-height: min(460px, calc(var(--host-height, 844px) * .52)); }
  .viewer .pane { height: min(500px, calc(var(--host-height, 844px) * .55)); }
  .drop { min-height: 420px; padding: 16px; --drop-pos: 72% 20%; --drop-size: auto 112%; }
  .drop-glass { padding: 22px 20px 18px; }
  .drop-hint { display: none; }
  .roi-hint { white-space: normal; text-align: center; width: max-content; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation: none !important; } }
.lens-live.lens-live { -webkit-backdrop-filter: var(--lens-optic); backdrop-filter: var(--lens-optic); }
