/* «Колечки» — studio (/studio). STUDIO_SPEC §2, §4, §6. Tokens only from src/ui/theme.css; kit classes from kit.css.
   The 3D canvas is the page background; panels float on it as smoky glass with the casket double line.
   Layout modes are set by layout.js on <html data-layout="desktop|tablet|phone">. */

/* ============================================================== page */
html, body.st { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.st { background: var(--scene-bg); }
.st { --gap: var(--s-2); --panel-top: calc(var(--topbar-h) + var(--gap)); --panel-bottom: calc(var(--statusbar-h) + var(--gap)); --rail-w: 72px; }

.st-skip {
  position: fixed; left: var(--s-2); top: var(--s-2); z-index: var(--z-modal); padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill); background: var(--velvet-2); color: var(--ink); transform: translateY(-200%);
  transition: transform var(--t-ui) var(--ease-out);
}
.st-skip:focus { transform: none; }
.st-noscript { position: fixed; inset: auto var(--s-4) var(--s-8); z-index: var(--z-modal); text-align: center; color: var(--ink-2); }

/* ============================================================== scene */
.st-scene { position: fixed; inset: 0; z-index: var(--z-canvas); background: var(--scene-bg); }
.st-scene canvas { display: block; outline: none; }
.st-scene-layer { position: fixed; inset: 0; z-index: var(--z-scene-ui); pointer-events: none; }
.st-scene-layer > * { pointer-events: auto; }
/* legacy viewport chrome (render panel) never shows in the studio */
.st-scene .rp-toggle, .st-scene .rp-panel, .st-scene .render-panel { display: none !important; }

.st-empty {
  position: fixed; z-index: var(--z-scene-ui); left: 50%; top: 46%; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: var(--s-4); text-align: center; width: min(440px, calc(100vw - 32px));
}
.st-empty__title { margin: 0; font: var(--fw-h2) var(--fs-h2)/var(--lh-h2) var(--font-display); letter-spacing: var(--ls-h2); text-wrap: balance; }
.st-empty__overline { margin: 0; }

/* ============================================================== shared bits */
.st-panel-title {
  display: flex; align-items: baseline; gap: var(--s-2); margin: 0;
  font: var(--fw-cap) var(--fs-cap)/var(--lh-cap) var(--font-ui); letter-spacing: var(--ls-cap); text-transform: uppercase; color: var(--ink-3);
}
/* the brand word («шкатулка», «паспорт», «бирка»): second, small, never Cormorant below 20 px */
.st-panel-title__alt {
  margin-left: auto; font: italic 500 var(--fs-micro)/1 var(--font-ui); letter-spacing: .02em; text-transform: none; color: var(--ink-3); opacity: .8;
}
.st-ai { color: var(--moon); }
.st-ai:hover { background: var(--moon-dim); color: var(--moon); }

.glass { border-radius: var(--r-2); }
.st-rail, .st-drawer, .st-inspector, .st-price, .st-minitag, .st-sheet, .st-menu, .st-status__pop, .st-overlay__panel {
  box-shadow: var(--glass-edge), var(--casket), var(--shadow-float);
}

/* thin, quiet scrollbars inside panels */
.st-inspector, .st-drawer__body, .st-cat__body, .st-sheet__body, .st-overlay__panel {
  scrollbar-width: thin; scrollbar-color: var(--velvet-4) transparent;
}

/* ============================================================== top bar */
.st-topbar {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-topbar);
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) var(--s-3) 0 var(--s-4);
  display: flex; align-items: center; gap: var(--s-3);
  background: linear-gradient(180deg, var(--velvet-0) 0%, color-mix(in srgb, var(--velvet-0) 82%, transparent) 62%, transparent 100%);
}
.st-topbar__brand { flex: none; display: flex; align-items: center; padding-right: var(--s-3); margin-right: var(--s-1); box-shadow: 1px 0 0 var(--hairline); }
.st-topbar__brand .k-wordmark { color: var(--ink); text-decoration: none; }
.st-topbar__ident { min-width: 0; display: flex; align-items: baseline; gap: var(--s-3); flex: 0 1 auto; }
.st-topbar__name {
  min-width: 6ch; width: clamp(140px, 22vw, 300px); padding: 2px 6px; margin-left: -6px;
  border: 0; border-radius: var(--r-1); background: transparent; color: var(--ink);
  font: var(--fw-title) 20px/1.2 var(--font-display); text-overflow: ellipsis;
  transition: background-color var(--t-micro) var(--ease-out), box-shadow var(--t-micro) var(--ease-out);
}
.st-topbar__name:hover { background: var(--candle-faint); }
.st-topbar__name:focus { outline: none; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--candle); }
.st-topbar__name::placeholder { color: var(--ink-3); }
.st-topbar__kind { white-space: nowrap; color: var(--ink-3); }
.st-topbar__hist { display: flex; gap: 2px; flex: none; }
.st-topbar__right { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); position: relative; }
.st-topbar__cta { gap: var(--s-2); padding-inline: var(--s-5); }
.st-topbar__cta-sep { opacity: .55; }
.st-topbar__cta-price { font-size: var(--fs-mono-lg); }
.st-topbar__more { display: none; }

/* versions strip («Эскизы»): warm dots = manual, cold = AI */
.st-versions { display: flex; align-items: center; gap: var(--s-2); flex: none; padding-left: var(--s-3); box-shadow: -1px 0 0 var(--hairline); }
.st-versions__label { white-space: nowrap; padding: 4px 6px; border: 0; border-radius: var(--r-1); background: none; color: var(--ink-3); cursor: pointer; }
.st-versions__label:hover, .st-versions__label[aria-expanded="true"] { color: var(--ink); background: var(--velvet-3); }
.st-versions__dots { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; }
.st-versions__n { color: var(--ink-3); min-width: 3ch; }
.st-dot {
  position: relative; display: grid; place-items: center; width: 16px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer;
}
.st-dot::after {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--candle-dim); box-shadow: inset 0 0 0 1px var(--candle);
  transition: transform var(--t-micro) var(--ease-out), background-color var(--t-micro);
}
.st-dot.is-ai::after { background: var(--moon-dim); box-shadow: inset 0 0 0 1px var(--moon); }
.st-dot:hover::after { transform: scale(1.35); }
.st-dot.is-current::after { width: 9px; height: 9px; background: var(--candle); box-shadow: var(--glow-candle); }
.st-dot.is-ai.is-current::after { background: var(--moon); box-shadow: var(--glow-moon); }
.st-dot:focus-visible { box-shadow: none; }
.st-dot:focus-visible::after { box-shadow: var(--focus-ring); }

/* «⋯» menu */
.st-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: var(--z-popover); min-width: 240px; max-height: 60vh; overflow: auto;
  display: grid; padding: 6px; border-radius: var(--r-3);
}
.st-menu__item {
  display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-2);
  background: transparent; text-align: left; font: 500 var(--fs-ui-lg)/1.2 var(--font-ui); color: var(--ink); cursor: pointer;
}
.st-menu__item:hover, .st-menu__item:focus-visible { background: var(--velvet-3); box-shadow: none; }
.st-menu__item.is-current { color: var(--candle); }
.st-menu__item .st-dot { width: 12px; pointer-events: none; }

/* ============================================================== tool rail */
.st-rail {
  position: fixed; z-index: var(--z-panels); left: var(--gap); top: var(--panel-top); width: var(--rail-w);
  padding: 6px; border-radius: var(--r-2);
}
.st-rail__list { display: grid; gap: 4px; }
/* icon over a visible label: no mystery buttons */
.st-rail__btn {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; width: 100%; min-height: 56px; padding: 6px 2px;
  border: 0; border-radius: var(--r-2); background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background-color var(--t-micro) var(--ease-out), color var(--t-micro) var(--ease-out);
}
.st-rail__ic { display: grid; place-items: center; }
.st-rail__label { font: 600 11px/1.1 var(--font-ui); letter-spacing: .01em; white-space: nowrap; }
.st-rail__btn:hover { background: var(--velvet-3); color: var(--ink); }
.st-rail__btn[aria-pressed="true"] { color: var(--candle); background: var(--candle-faint); box-shadow: inset 0 0 0 1px var(--candle-dim); }
.st-rail__btn:disabled { opacity: .4; cursor: progress; }
.st-rail__btn[hidden] { display: none; }

/* ============================================================== catalog drawer */
.st-drawer {
  position: fixed; z-index: var(--z-panels); top: var(--panel-top); bottom: var(--panel-bottom);
  left: calc(var(--gap) * 2 + var(--rail-w)); width: var(--drawer-w);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(calc(-100% - var(--rail-w) - var(--gap) * 3)); opacity: 0; visibility: hidden;
  transition: transform var(--t-panel) var(--ease-out), opacity var(--t-panel) var(--ease-out), visibility 0s linear var(--t-panel);
}
.st-drawer.is-open { transform: none; opacity: 1; visibility: visible; transition: transform var(--t-panel) var(--ease-out), opacity var(--t-panel) var(--ease-out), visibility 0s; }
.st-drawer__body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.st-catalog { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.st-cat__head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-4) var(--s-3) var(--s-2) var(--s-5); }
.st-cat__head .st-panel-title { flex: 1; }
.st-cat__close { margin-left: var(--s-2); }
.st-cat__search { padding: 0 var(--s-4) var(--s-2); }
.st-cat__search input { min-height: 40px !important; padding: 8px 12px 8px 34px !important; background-repeat: no-repeat; background-position: 12px 50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none' stroke='%238A8279' stroke-width='1.4' stroke-linecap='round'><circle cx='8.5' cy='8.5' r='5.5'/><path d='M12.6 12.6l4.6 4.6'/></svg>"); }
/* all six sections visible at once (they used to scroll sideways and «Камни» was cut off) */
.st-cat__tabs {
  display: flex; flex-wrap: wrap; gap: 0 2px; padding: 0 var(--s-3); box-shadow: inset 0 -1px 0 var(--hairline);
}
.st-cat__tabs::-webkit-scrollbar { display: none; }
.st-cat__tab {
  position: relative; flex: none; padding: var(--s-2) var(--s-2) var(--s-2); min-height: 36px; border: 0; background: none; cursor: pointer;
  font: 600 var(--fs-ui)/1 var(--font-ui); letter-spacing: var(--ls-ui); color: var(--ink-3);
  transition: color var(--t-micro) var(--ease-out);
}
.st-cat__tab:hover { color: var(--ink); }
.st-cat__tab[aria-selected="true"] { color: var(--ink); }
.st-cat__tab[aria-selected="true"]::after {
  content: ''; position: absolute; left: var(--s-2); right: var(--s-2); bottom: 0; height: 1.5px; border-radius: 1px; background: var(--candle);
}
.st-cat__tab:focus-visible { box-shadow: inset 0 0 0 2px var(--candle); border-radius: var(--r-1); }
.st-cat__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--s-3) var(--s-3) var(--s-4); outline: none; }
.st-cat__group { margin: var(--s-4) var(--s-2) var(--s-2); }
.st-cat__group:first-child { margin-top: var(--s-1); }
.st-cat__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2) 6px; }
.st-cat__empty { margin: var(--s-6) var(--s-3); color: var(--ink-3); font-size: var(--fs-ui-lg); text-align: center; }
.st-cat__hint { flex: none; margin: 0; padding: var(--s-2) var(--s-5) var(--s-3); box-shadow: inset 0 1px 0 var(--hairline); min-height: 2.6em; }
.st-tile.is-blocked { opacity: .4; cursor: not-allowed; }
.st-tile.is-blocked:hover .st-tile__fig img { transform: none; }

/* tile: lancet arch with a baked render on velvet (fallback: icon) */
.st-tile {
  display: grid; justify-items: center; align-content: start; gap: 6px; min-width: 0; padding: 6px 4px 8px; border: 0; border-radius: var(--r-2);
  background: transparent; color: var(--ink-2); cursor: pointer; text-align: center;
  transition: background-color var(--t-micro) var(--ease-out), color var(--t-micro) var(--ease-out);
}
.st-tile:hover { background: var(--velvet-3); color: var(--ink); }
.st-tile:active .st-tile__fig { transform: translateY(1px); }
.st-tile__fig {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1.12; color: var(--ink-3);
  clip-path: polygon(0% 100%, 0% 77.32%, 0.55% 67.99%, 2.19% 58.76%, 4.89% 49.73%, 8.65% 41.01%, 13.4% 32.68%, 19.1% 24.84%, 25.69% 17.58%, 33.09% 10.97%, 41.22% 5.09%, 50% 0%, 58.78% 5.09%, 66.91% 10.97%, 74.31% 17.58%, 80.9% 24.84%, 86.6% 32.68%, 91.35% 41.01%, 95.11% 49.73%, 97.81% 58.76%, 99.45% 67.99%, 100% 77.32%, 100% 100%);
  background:
    radial-gradient(120% 90% at 50% 30%, color-mix(in srgb, var(--velvet-4) 70%, transparent), transparent 70%),
    var(--velvet-2);
  transition: transform var(--t-micro) var(--ease-out);
}
.st-tile__fig img { width: 100%; height: 100%; object-fit: contain; padding: 14% 6% 2%; transition: transform var(--t-ui) var(--ease-out); }
.st-tile:hover .st-tile__fig img { transform: scale(1.06); }
.st-tile:hover .st-tile__fig { color: var(--candle); }
.st-tile.is-blank .st-tile__fig img { opacity: .7; }
.st-tile__name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font: 600 12px/1.25 var(--font-ui); letter-spacing: .005em; min-height: 2.5em; overflow-wrap: anywhere; hyphens: auto;
}
.st-tile--stone .st-tile__fig img { padding: 22% 16% 10%; }

/* ============================================================== right column: inspector + price tag */
.st-side {
  position: fixed; z-index: var(--z-panels); right: var(--gap); top: var(--panel-top); bottom: var(--panel-bottom); width: var(--inspector-w);
  display: flex; flex-direction: column; gap: var(--gap); pointer-events: none;
}
.st-side > * { pointer-events: auto; }
.st-inspector { flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: var(--s-5) var(--s-5) var(--s-6); outline: none; }

/* ---- inspector content */
.st-insp__head { display: grid; gap: var(--s-1); margin-bottom: var(--s-4); }
.st-insp__head .st-panel-title { margin-bottom: var(--s-2); }
.st-insp__name {
  width: 100%; margin: 0 0 0 -6px; padding: 2px 6px; border: 0; border-radius: var(--r-1); background: transparent; color: var(--ink);
}
.st-insp__name:hover { background: var(--candle-faint); }
.st-insp__name:focus { outline: none; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--candle); }
.st-insp__kind { margin: 0; color: var(--ink-3); }
.st-insp__title-row { display: flex; align-items: center; gap: var(--s-2); }
.st-insp__title { margin: 0; }
.st-insp__metal {
  flex: none; width: 12px; height: 12px; border-radius: 50%;
  background: conic-gradient(from 210deg, color-mix(in srgb, var(--coin) 55%, white), var(--coin), color-mix(in srgb, var(--coin) 55%, black), var(--coin));
  box-shadow: 0 0 0 1px var(--hairline-strong);
}
.st-insp__sub { margin: 0; color: var(--ink-3); }
.st-insp__actions { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 -8px var(--s-3); }
.st-insp__actions .k-btn { padding-inline: var(--s-2); }
.st-insp__sec { display: grid; gap: var(--s-4); padding: var(--s-4) 0; box-shadow: inset 0 1px 0 var(--hairline); }
.st-insp__sec:first-of-type { box-shadow: none; padding-top: 0; }
.st-insp__sec-title { display: flex; margin: 0; }
.st-insp__lead { margin: var(--s-2) 0 var(--s-4); font: var(--fw-title) var(--fs-title)/1.3 var(--font-display); color: var(--ink); text-wrap: balance; }
.st-insp__empty { display: grid; gap: var(--s-2); justify-items: start; }
.st-insp__add { margin-top: var(--s-4); }
.st-styles { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.st-plaque {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin: 0 0 var(--s-3); padding: 6px 6px 6px 12px;
  border-radius: var(--r-2); background: var(--candle-faint); box-shadow: inset 0 0 0 1px var(--candle-dim);
  font: 500 var(--fs-ui)/1.35 var(--font-ui); color: var(--ink-2);
}
.st-plaque:not(:has(button)) { padding-right: 12px; }

.st-passport { display: grid; grid-template-columns: 1fr auto; gap: 6px var(--s-4); margin: 0; font-size: var(--fs-ui); }
.st-passport dt { color: var(--ink-3); font-weight: 500; }
.st-passport dd { margin: 0; text-align: right; color: var(--ink); }

.st-girth { gap: 6px; }
.st-girth__row { display: flex; gap: var(--s-2); align-items: center; }
.st-girth__row input { width: 96px !important; min-height: 40px !important; }

/* ---- controls (generic) */
.st-ctl { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: var(--s-2); }
.st-ctl__head { display: flex; align-items: baseline; gap: var(--s-2); }
.st-ctl__label { padding: 0; font: 600 var(--fs-ui)/var(--lh-ui) var(--font-ui); letter-spacing: var(--ls-ui); color: var(--ink-2); }
.st-ctl__help { margin: 0; font: 500 var(--fs-micro)/var(--lh-micro) var(--font-ui); color: var(--ink-3); }
legend.st-ctl__label { margin-bottom: var(--s-2); }

/* ---- ruler (caliper) */
.st-ruler__val { margin-left: auto; font-size: var(--fs-mono-lg); color: var(--ink); cursor: text; white-space: nowrap; }
.st-ruler__delta {
  padding: 2px 8px; border-radius: var(--r-pill); color: var(--candle); white-space: nowrap;
  background: var(--candle-faint); box-shadow: inset 0 0 0 1px var(--candle-dim);
  background-image: none; outline: 1px dashed var(--candle-dim); outline-offset: -1px; font-size: 11px;
}
.st-ruler__edit { margin-left: auto; width: 8ch; padding: 2px 6px; border: 0; border-radius: var(--r-1); background: var(--velvet-2);
  box-shadow: inset 0 0 0 1px var(--candle); color: var(--ink); font-size: var(--fs-mono-lg); text-align: right; outline: none; }
.st-ruler__scale { position: relative; height: 34px; border-radius: var(--r-1); background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--hairline); overflow: hidden; }
.st-ruler__ticks { position: absolute; left: 10px; right: 10px; bottom: 0; width: calc(100% - 20px); height: 12px; overflow: visible; }
.st-ruler__ticks line { stroke: var(--hairline-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.st-ruler__ticks line.is-major { stroke: var(--ink-3); }
.st-ruler__marks { position: absolute; left: 10px; right: 10px; top: 5px; height: 6px; }
.st-ruler__mark { position: absolute; top: 0; height: 100%; min-width: 2px; border-radius: 3px; background: var(--hairline-strong); transition: background-color var(--t-ui); }
.st-ruler__mark.is-point { width: 2px !important; margin-left: -1px; }
.st-ruler__mark.is-on { background: var(--candle); }
.st-ruler__fill { position: absolute; left: 10px; top: 0; bottom: 0; max-width: calc(100% - 20px); background: linear-gradient(90deg, transparent, var(--candle-faint)); pointer-events: none; }
.st-ruler__jaw {   /* the caliper jaw */
  position: absolute; top: 0; bottom: 0; width: 2px; margin-left: 9px; background: var(--candle); pointer-events: none;
  box-shadow: 0 0 10px rgba(242, 184, 114, .45); transition: box-shadow var(--t-micro);
}
.st-ruler__jaw::before {
  content: ''; position: absolute; left: -5px; top: 0; border: 6px solid transparent; border-top-color: var(--candle); border-bottom: 0;
}
.st-ruler__input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y;
  -webkit-appearance: none; appearance: none;
}
.st-ruler:focus-within .st-ruler__scale { box-shadow: inset 0 0 0 1px var(--candle), 0 0 0 3px var(--candle-dim); }
.st-ruler.is-active .st-ruler__jaw { box-shadow: 0 0 16px rgba(242, 184, 114, .75); }
.st-ruler.is-disabled { opacity: .5; }
.st-ruler__ends { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 11px; margin-top: -2px; }
.st-length__note { color: var(--candle); }

/* ---- coins (metals) */
.st-coins__row { display: flex; flex-wrap: wrap; gap: 10px; }
.st-coin { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
.st-coin__face {
  width: 28px; height: 28px; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .55), transparent 42%),
    conic-gradient(from 210deg, color-mix(in srgb, var(--coin) 55%, white), var(--coin) 25%, color-mix(in srgb, var(--coin) 50%, black) 50%, var(--coin) 72%, color-mix(in srgb, var(--coin) 70%, white));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .45);
  transition: transform var(--t-micro) var(--ease-out), box-shadow var(--t-ui) var(--ease-out);
}
.st-coin__face.has-img { position: relative; overflow: hidden; background: radial-gradient(circle at 50% 40%, var(--velvet-4), var(--velvet-2)); }
.st-coin__face.has-img img { position: absolute; inset: -12%; width: 124%; height: 124%; object-fit: contain; }
.st-coin:hover .st-coin__face { transform: translateY(-1px) scale(1.06); }
.st-coin:has(input:checked) .st-coin__face { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 0 0 2px var(--velvet-1), 0 0 0 3.5px var(--candle), var(--glow-candle); }
.st-coin:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.st-coins__name, .st-facets__name { margin: 0; min-height: 1.3em; font: 500 var(--fs-ui)/1.3 var(--font-ui); color: var(--ink-2); }
.st-coins__name.is-preview, .st-facets__name.is-preview { color: var(--candle); }

/* ---- facets (stones) */
.st-facets__groups { display: grid; gap: var(--s-3); }
.st-facets__group { display: grid; gap: 6px; }
.st-facets__title { color: var(--ink-3); }
.st-facets__row { display: flex; flex-wrap: wrap; gap: 6px; }
.st-facet { position: relative; display: grid; place-items: center; width: 30px; height: 30px; cursor: pointer; border-radius: var(--r-1); }
.st-facet__face {
  width: 24px; height: 21px; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0% 50%);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .55) 0%, transparent 34%),
    conic-gradient(from 30deg, color-mix(in srgb, var(--stone) 70%, white), var(--stone), color-mix(in srgb, var(--stone) 55%, black), var(--stone), color-mix(in srgb, var(--stone) 80%, white), var(--stone));
  transition: transform var(--t-micro) var(--ease-out);
}
.st-facet.is-pearl .st-facet__face { clip-path: circle(46%); width: 22px; height: 22px; background: radial-gradient(circle at 35% 30%, #fff 0%, var(--stone) 45%, color-mix(in srgb, var(--stone) 70%, black) 100%); }
.st-facet.is-none .st-facet__face { background: none; box-shadow: none; clip-path: none; width: 20px; height: 20px; border-radius: 50%;
  border: 1.25px dashed var(--ink-3); }
.st-facet__face.has-img, .st-facet.is-pearl .st-facet__face.has-img { clip-path: none; background: none; width: 28px; height: 28px; }
.st-facet__face.has-img img { width: 100%; height: 100%; object-fit: contain; }
.st-facet:hover .st-facet__face { transform: scale(1.12); }
.st-facet:has(input:checked) { box-shadow: 0 0 0 1.5px var(--candle), var(--glow-candle); }
.st-facet:has(input:focus-visible) { box-shadow: var(--focus-ring); }

/* ---- segmented (kit .k-seg) */
.st-seg__row { display: flex; width: 100%; }
.st-seg__opt span { overflow: hidden; text-overflow: ellipsis; }

/* ---- toggle («замочек») */
.st-toggle__row { display: flex; align-items: center; gap: var(--s-3); cursor: pointer; min-height: 36px; }
.st-toggle__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.st-toggle__lock {
  display: grid; place-items: center; width: 40px; height: 28px; border-radius: var(--r-pill);
  background: var(--velvet-2); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--hairline-strong);
  transition: background-color var(--t-ui) var(--ease-out), color var(--t-ui) var(--ease-out);
}
.st-toggle__input:checked + .st-toggle__lock { background: var(--candle-faint); color: var(--candle); box-shadow: inset 0 0 0 1px var(--candle-dim); }
.st-toggle__input:focus-visible + .st-toggle__lock { box-shadow: var(--focus-ring); }
.st-toggle__text { font: 500 var(--fs-ui-lg)/1.3 var(--font-ui); color: var(--ink); }

/* ---- stepper */
.st-stepper__box { display: inline-flex; align-items: center; gap: 2px; padding: 2px; width: fit-content; border-radius: var(--r-pill); background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--hairline); }
.st-stepper__btn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); font: 500 18px/1 var(--font-ui); cursor: pointer; }
.st-stepper__btn:hover:not(:disabled) { background: var(--velvet-3); color: var(--ink); }
.st-stepper__btn:disabled { opacity: .35; cursor: default; }
.st-stepper__input { width: 4ch; border: 0; background: transparent; color: var(--ink); text-align: center; font-size: var(--fs-mono-lg); -moz-appearance: textfield; }
.st-stepper__input::-webkit-outer-spin-button, .st-stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.st-stepper__unit { padding-right: var(--s-3); }

/* ---- dots («счёты») */
.st-dots__line { display: flex; align-items: center; gap: var(--s-3); }
.st-dots__row { display: flex; gap: 2px; }
.st-dots__dot { display: grid; place-items: center; width: 22px; height: 28px; cursor: pointer; }
.st-dots__dot::after {
  content: ''; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.25px var(--ink-3);
  transition: background-color var(--t-micro), box-shadow var(--t-micro), transform var(--t-micro) var(--ease-out);
}
.st-dots__dot.is-on::after { background: var(--candle); box-shadow: inset 0 0 0 1.25px var(--candle); }
.st-dots__row.is-hover .st-dots__dot.is-on::after { background: var(--candle-dim); }
.st-dots__dot:hover::after { transform: scale(1.2); }
.st-dots__dot:has(input:focus-visible)::after { box-shadow: var(--focus-ring); }
.st-dots__val { color: var(--ink-2); min-width: 2ch; }

/* ---- thumb grid (weaves, figures) */
.st-tgrid__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.st-tgrid__opt {
  display: grid; gap: 4px; justify-items: center; padding: 6px 4px; border-radius: var(--r-2); cursor: pointer; text-align: center;
  color: var(--ink-2); transition: background-color var(--t-micro), color var(--t-micro);
}
.st-tgrid__opt:hover { background: var(--velvet-3); color: var(--ink); }
.st-tgrid__opt:has(input:checked) { background: var(--candle-faint); color: var(--ink); box-shadow: inset 0 0 0 1px var(--candle-dim); }
.st-tgrid__opt:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.st-tgrid__fig:empty { display: none; }
.st-tgrid__fig { width: 100%; aspect-ratio: 1; border-radius: var(--r-1); overflow: hidden; background: var(--velvet-2); }
.st-tgrid__fig img { width: 100%; height: 100%; object-fit: contain; }
.st-tgrid__name { font: 600 12px/1.25 var(--font-ui); overflow-wrap: anywhere; }

/* ---- attach row, fine tune */
.st-attach { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-3); }
.st-attach__text { margin: 0; font: 500 var(--fs-ui)/1.35 var(--font-ui); color: var(--ink); }
.st-attach__k { color: var(--ink-3); }
.st-fine { margin-top: var(--s-2); border-radius: var(--r-2); box-shadow: inset 0 1px 0 var(--hairline); }
.st-fine__sum {
  display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) 0; cursor: pointer; list-style: none;
  font: 600 var(--fs-ui)/1 var(--font-ui); color: var(--ink-2);
}
.st-fine__sum::-webkit-details-marker { display: none; }
.st-fine__sum::before {
  content: ''; width: 6px; height: 6px; border-right: 1.25px solid currentColor; border-bottom: 1.25px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--t-ui) var(--ease-out);
}
.st-fine[open] .st-fine__sum::before { transform: rotate(45deg); }
.st-fine__sum:hover { color: var(--ink); }
.st-fine__body { display: grid; gap: var(--s-4); padding-bottom: var(--s-2); }

/* ============================================================== price tag («бирка») */
.st-price {
  position: relative; flex: none; display: grid; gap: 2px; padding: var(--s-4) var(--s-5) var(--s-5);
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%, 0 16px);
  transform-origin: 22px 22px;
}
.st-price.is-swinging { animation: st-swing 700ms var(--ease-out); }
@keyframes st-swing { 0% { transform: rotate(0); } 18% { transform: rotate(3deg); } 42% { transform: rotate(-2deg); } 66% { transform: rotate(1deg); } 84% { transform: rotate(-.4deg); } 100% { transform: rotate(0); } }
.st-price__head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-2); }
.st-price__head .st-panel-title { flex: 1; }
.st-price__hole { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--velvet-0); box-shadow: inset 0 0 0 1px var(--ink-3), inset 0 1px 2px rgba(0, 0, 0, .5); }
.st-price__total { margin: 0; color: var(--ink); min-height: 1em; }
.st-price__work { margin: var(--s-1) 0 0; color: var(--candle); }
.st-price__ready { margin: 0; font: 500 var(--fs-ui-lg)/1.4 var(--font-ui); color: var(--ink); }
.st-price__ready:empty, .st-price__slots:has(.st-price__free:empty) { display: none; }
.st-price__slots { display: flex; align-items: center; gap: var(--s-2); margin: 0; font: 500 var(--fs-ui)/1.3 var(--font-ui); color: var(--ink-2); }
.st-price__dots { display: inline-flex; gap: 3px; }
.st-price__slot { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--ink-3); }
.st-price__slot.is-taken { background: var(--ink-3); }
.st-price__warn { display: grid; gap: var(--s-2); justify-items: start; margin-top: var(--s-2); padding: var(--s-3); border-radius: var(--r-2);
  background: color-mix(in srgb, var(--warn) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 35%, transparent); }
.st-price__warn p { margin: 0; font: 500 var(--fs-ui)/1.4 var(--font-ui); color: var(--ink); }
.st-price__why { margin-top: var(--s-2); }
.st-price__why summary {
  display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) 0; cursor: pointer; list-style: none;
  font: 600 var(--fs-ui)/1 var(--font-ui); color: var(--ink-2);
}
.st-price__why summary::-webkit-details-marker { display: none; }
.st-price__why summary::before { content: ''; width: 6px; height: 6px; border-right: 1.25px solid currentColor; border-bottom: 1.25px solid currentColor; transform: rotate(-45deg); transition: transform var(--t-ui) var(--ease-out); }
.st-price__why[open] summary::before { transform: rotate(45deg); }
.st-price__why summary:hover { color: var(--ink); }
.st-price__lines { display: grid; grid-template-columns: 1fr auto; gap: 4px var(--s-3); margin: 0 0 var(--s-2); font-size: var(--fs-ui); }
.st-price__lines dt { color: var(--ink-2); }
.st-price__lines dd { margin: 0; text-align: right; }
.st-price__lines .is-prepay { color: var(--ink-3); padding-top: 4px; box-shadow: inset 0 1px 0 var(--hairline); }
.st-price__design { margin: 0 0 var(--s-2); }
.st-price__note { margin: var(--s-2) 0 var(--s-3); }
.st-price.is-empty .st-price__total, .st-price.is-empty .st-price__why, .st-price.is-empty .st-price__note { display: none; }
.st-price.is-empty .st-price__work { color: var(--ink-3); }

/* ============================================================== status bar */
.st-status {
  position: fixed; inset: auto 0 0 0; z-index: var(--z-panels); height: calc(var(--statusbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 var(--s-4) env(safe-area-inset-bottom, 0px); display: flex; align-items: center; justify-content: center; gap: var(--s-4);
  background: linear-gradient(0deg, var(--velvet-0) 0%, color-mix(in srgb, var(--velvet-0) 70%, transparent) 70%, transparent);
}
.st-status__facts { margin: 0; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-status__check {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 0; border-radius: var(--r-pill); background: transparent;
  font: 600 var(--fs-ui)/1 var(--font-ui); cursor: pointer; white-space: nowrap;
}
.st-status__check .k-icon { width: 16px; height: 16px; }
.st-status__check.is-ok { color: var(--ok); cursor: default; }
.st-status__check.is-warn { color: var(--warn); }
.st-status__check.is-bad { color: var(--bad); }
.st-status__check:not(:disabled):hover { background: var(--velvet-3); }
.st-status.is-empty { visibility: hidden; }
.st-status__pop {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: min(520px, calc(100vw - 32px));
  max-height: 40vh; overflow: auto; padding: var(--s-2); border-radius: var(--r-3); z-index: var(--z-popover);
}
.st-status__pop ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.st-status__pop li { padding: var(--s-2) var(--s-3); border-radius: var(--r-2); font: 500 var(--fs-ui)/1.4 var(--font-ui); color: var(--ink); }
.st-status__pop li.is-bad { box-shadow: inset 2px 0 0 var(--bad); }
.st-status__pop li.is-warn { box-shadow: inset 2px 0 0 var(--warn); }
.st-status__pop li[tabindex]:hover { background: var(--velvet-3); cursor: pointer; }

/* ============================================================== copilot slots (content by the copilot stream) */
.st-copilot {
  position: fixed; z-index: var(--z-panels); bottom: calc(var(--statusbar-h) + var(--s-3));
  left: calc(var(--gap) * 2 + var(--rail-w)); right: calc(var(--gap) * 2 + var(--inspector-w));
  display: flex; justify-content: center; pointer-events: none;
}
html.st-drawer-open[data-layout="desktop"] .st-copilot { left: calc(var(--gap) * 3 + var(--rail-w) + var(--drawer-w)); }
.st-copilot > * { pointer-events: auto; width: min(var(--copilot-w), 100%); }
.st-copilot:empty { display: none; }
.st-copilot-sheet { position: fixed; z-index: var(--z-sheet); display: none; }
.st-copilot-sheet.is-open { display: block; }

/* ============================================================== side / full sheets (order, share) */
.st-overlay { position: fixed; inset: 0; z-index: var(--z-modal); }
.st-overlay__scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity var(--t-panel) var(--ease-out); }
.st-overlay__panel {
  position: absolute; top: var(--gap); right: var(--gap); bottom: var(--gap); width: min(560px, calc(100% - 2 * var(--gap)));
  overflow-y: auto; border-radius: var(--r-3); background: var(--velvet-1);
  transform: translateX(calc(100% + 2 * var(--gap))); transition: transform var(--t-panel) var(--ease-out);
}
.st-overlay.is-open .st-overlay__scrim { opacity: 1; }
.st-overlay.is-open .st-overlay__panel { transform: none; }

/* ============================================================== dialog (confirm) */
.st-dialog {
  max-width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-3);
  background: var(--velvet-1); color: var(--ink); box-shadow: var(--casket), var(--shadow-pop);
}
.st-dialog::backdrop { background: var(--scrim); }
.st-dialog__body { display: grid; gap: var(--s-3); padding: var(--s-6); margin: 0; }
.st-dialog__title { margin: 0; }
.st-dialog__text { margin: 0; font: var(--fw-title) var(--fs-title)/1.3 var(--font-display); text-wrap: balance; }
.st-dialog__detail { margin: 0; color: var(--ink-2); font-size: var(--fs-ui-lg); }
.st-dialog__actions { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-3); }
@media (prefers-reduced-motion: no-preference) {
  .st-dialog[open] { animation: st-rise var(--t-ui) var(--ease-out); }
  @keyframes st-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* toasts sit above the status bar / copilot bar; on the phone above the mini tag */
.k-toasts { --toast-bottom: calc(var(--statusbar-h) + var(--s-6) + env(safe-area-inset-bottom, 0px)); }
html[data-layout="desktop"] .k-toasts, html[data-layout="tablet"] .k-toasts {   /* above the copilot bar, centred in the free area */
  --toast-bottom: calc(var(--free-b, 40px) + var(--s-3));
  left: calc(var(--free-l, 0px) + (100vw - var(--free-l, 0px) - var(--free-r, 0px)) / 2);
}

/* phone-only parts are hidden elsewhere */
.st-minitag, .st-sheet { display: none; }

/* ============================================================== tablet (768–1199): overlay catalog, narrower column */
@media (max-width: 1199px) {
  .st { --inspector-w: 320px; }
  html[data-layout="tablet"] .st-drawer { z-index: calc(var(--z-panels) + 1); box-shadow: var(--glass-edge), var(--casket), var(--shadow-pop); }
  .st-versions__label { display: none; }
  .st-topbar__share span { display: none; }
  .st-topbar__share { width: 40px; padding: 0; }
}
@media (max-width: 999px) {
  .st-versions { display: none; }
}

/* ============================================================== phone (< 768) */
@media (max-width: 767px) {
  .st { --topbar-h: var(--topbar-h-phone); }
  .st-topbar { padding-inline: var(--s-2) var(--s-1); gap: var(--s-1); }
  .st-topbar__brand { padding-right: var(--s-2); }
  .st-topbar__brand .k-wordmark__word > span:not(.k-wordmark__o) { display: none; }   /* only the ring «О» */
  .st-topbar__name { width: auto; flex: 1; min-width: 0; font-size: 20px; }
  .st-topbar__ident { flex: 1; }
  .st-topbar__kind, .st-versions, .st-topbar__share, .st-topbar__cta, .st-topbar__theme { display: none; }
  .st-topbar__right { margin-left: 0; }
  .st-topbar__more { display: inline-flex; }

  .st-rail, .st-drawer, .st-side, .st-status, .st-copilot { display: none; }

  .st-minitag {
    position: fixed; z-index: var(--z-sheet); left: var(--s-2); right: var(--s-2);
    bottom: calc(var(--sheet-h, 88px) + var(--s-2)); height: var(--minitag-h);
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 0 6px 0 var(--s-4); border-radius: var(--r-pill);
    transition: bottom var(--t-panel) var(--ease-out);
  }
  .st-minitag[hidden] { display: none; }
  .st-sheet.is-animating ~ .st-minitag { transition: bottom var(--t-panel) var(--ease-out); }
  .st-mini__price { display: flex; align-items: baseline; gap: var(--s-2); padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
  .st-mini__odo { font-size: 17px; font-weight: 500; }
  .st-mini__date { color: var(--ink-2); }

  .st-sheet {
    position: fixed; z-index: var(--z-sheet); left: 0; right: 0; bottom: 0; height: var(--sheet-h, 88px);
    display: flex; flex-direction: column; border-radius: var(--r-3) var(--r-3) 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .st-sheet.is-animating { transition: height var(--t-panel) var(--ease-out); }
  .st-sheet__grip { flex: none; display: grid; place-items: center; height: 22px; padding: 0; border: 0; background: none; cursor: grab; touch-action: none; }
  .st-sheet__grip span { width: 36px; height: 4px; border-radius: 2px; background: var(--hairline-strong); }
  .st-sheet__grip:focus-visible { box-shadow: none; }
  .st-sheet__grip:focus-visible span { box-shadow: var(--focus-ring); }
  .st-sheet__tabs { flex: none; display: flex; gap: 2px; padding: 0 var(--s-2) var(--s-2); touch-action: none; }
  .st-sheet__tab {
    flex: 1 1 0; min-height: 44px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2);
    font: 600 var(--fs-ui)/1 var(--font-ui); letter-spacing: var(--ls-ui); cursor: pointer;
  }
  .st-sheet__tab[aria-selected="true"] { background: var(--velvet-4); color: var(--ink); }
  .st-sheet__tab[data-tab="ai"] { flex: 0 0 52px; color: var(--moon); }
  .st-sheet__tab:disabled { opacity: .35; }
  .st-sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--s-2) var(--s-4) var(--s-6); overscroll-behavior: contain; }
  .st-sheet[data-snap="peek"] .st-sheet__body { visibility: hidden; }
  /* re-parented panels lose their own card look inside the sheet */
  .st-sheet .st-inspector { padding: 0; overflow: visible; background: none; box-shadow: none; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .st-sheet .st-drawer__body { min-height: 100%; }
  .st-sheet .st-cat__head { display: none; }
  .st-sheet .st-cat__search { padding: 0 0 var(--s-2); }
  .st-sheet .st-cat__tabs { padding: 0; }
  .st-sheet .st-cat__body { overflow: visible; padding: var(--s-3) 0; }
  .st-sheet .st-cat__grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .st-sheet .st-copilot { display: block; position: static; pointer-events: auto; }

  .st-overlay__panel { inset: 0; width: 100%; border-radius: 0; transform: translateY(100%); }
  .k-toasts { --toast-bottom: calc(var(--sheet-h, 88px) + var(--minitag-h) + var(--s-4)); }
  .st-empty { top: 38%; }
}

/* touch: bigger targets */
@media (pointer: coarse) {
  .st-coin { width: 44px; height: 44px; }
  .st-facet { width: 40px; height: 40px; }
  .st-dots__dot { width: 32px; height: 40px; }
  .st-ruler__scale { height: 44px; }
}

/* reduced motion: no swing, instant panels (tokens already collapse durations) */
@media (prefers-reduced-motion: reduce) {
  .st-price.is-swinging { animation: none; }
}

/* ============================================================== first run (onboarding.js, §4.3) */
/* centred in the free area of the scene (layout offset -> --free-l / --free-r, set by main.js) */
.st-empty.st-onb {
  left: calc(var(--free-l, 0px) + (100vw - var(--free-l, 0px) - var(--free-r, 0px)) / 2);
  width: min(760px, calc(100vw - var(--free-l, 0px) - var(--free-r, 0px) - 32px));
  top: calc(var(--free-t, 56px) + 8px); bottom: calc(var(--free-b, 40px) + 8px); transform: translateX(-50%);
  align-content: safe center; overflow: auto; overscroll-behavior: contain;
  padding: var(--s-2); gap: var(--s-5); scrollbar-width: none;
}
.st-onb__head { display: grid; justify-items: center; gap: var(--s-2); }
.st-onb__over { margin: 0; color: var(--ink-3); }
.st-onb__title { margin: 0; font: var(--fw-h2) var(--fs-h2)/var(--lh-h2) var(--font-display); letter-spacing: var(--ls-h2);
  text-wrap: balance; color: var(--ink); }
.st-onb__sub { margin: 0; color: var(--ink-2); font: 500 var(--fs-body)/1.4 var(--font-ui); }
.st-onb__back { justify-self: center; }
.st-onb__fine { margin: 0; max-width: 46ch; }
.st-onb__kinds, .st-onb__strip {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: var(--s-3);
}
.st-onb__card {
  --w: clamp(84px, min(9vw, 13vh), 116px);
  display: grid; justify-items: center; gap: var(--s-2); width: var(--w); padding: 0; border: 0; background: none;
  color: var(--ink); cursor: pointer; font: inherit; text-align: center; border-radius: var(--r-2);
}
.st-onb__fig {
  position: relative; display: grid; place-items: center; width: var(--w); height: calc(var(--w) * 1.25);
  background: radial-gradient(120% 90% at 50% 70%, var(--velvet-3), var(--velvet-1) 70%);
  color: var(--ink-2); transition: color var(--t-micro, .15s) ease, background var(--t-ui, .24s) ease, transform var(--t-ui, .24s) var(--ease-out, ease);
}
.st-onb__fig > img { width: 100%; height: 100%; object-fit: contain; padding: 22% 8% 6%; transition: transform var(--t-ui, .24s) var(--ease-out, ease); }
.st-onb__card:hover .st-onb__fig > img { transform: scale(1.05); }
.st-onb__label { font: var(--fw-ui) var(--fs-ui-lg)/1.25 var(--font-ui); letter-spacing: var(--ls-ui); }
.st-onb__price { min-height: 1.4em; color: var(--ink-2); font: 500 var(--fs-mono)/1.4 var(--font-mono); }
.st-onb__card:hover .st-onb__fig, .st-onb__card:focus-visible .st-onb__fig {
  color: var(--candle); transform: translateY(-3px);
  background: radial-gradient(120% 90% at 50% 70%, color-mix(in srgb, var(--candle) 16%, var(--velvet-3)), var(--velvet-1) 72%);
}
.st-onb__card:hover .k-arch__stroke path, .st-onb__card:focus-visible .k-arch__stroke path { stroke: var(--candle); }
.st-onb__card:focus-visible { outline: none; box-shadow: none; }
.st-onb__card:focus-visible .st-onb__label { color: var(--candle); text-decoration: underline; text-underline-offset: 4px; }
.st-onb__card.is-blank .st-onb__fig > img { opacity: .6; }
.st-onb__ways { display: grid; gap: var(--s-6); width: 100%; justify-items: center; }
.st-onb__ready, .st-onb__ai { display: grid; gap: var(--s-3); justify-items: center; width: 100%; }
.st-onb__h { margin: 0; color: var(--ink-3); }
.st-onb__strip { flex-wrap: nowrap; justify-content: safe center; overflow-x: auto; max-width: 100%;
  padding: 4px 4px var(--s-2); scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--hairline-strong) transparent; }
.st-onb__strip .st-onb__card { --w: clamp(84px, min(8vw, 12vh), 104px); flex: none; scroll-snap-align: start; }
.st-onb__ai { grid-auto-flow: row; }
.st-onb__ai > .st-onb__way { min-width: 240px; }
.st-onb__way {
  display: grid; gap: 2px; padding: var(--s-3) var(--s-4); border: 1px solid var(--moon-dim); border-radius: var(--r-2);
  background: var(--glass-bg); color: var(--ink); cursor: pointer; text-align: left; font: inherit;
}
.st-onb__way:hover { border-color: var(--moon); }
.st-onb__way-t { font: var(--fw-ui) var(--fs-ui-lg)/1.3 var(--font-ui); color: var(--moon); }
@media (max-width: 767px) {
  .st-empty.st-onb { left: 50%; width: calc(100vw - 32px); }
  .st-onb__card { --w: 92px; }
  .st-onb__strip .st-onb__card { --w: 88px; }
}

/* coach marks (three hints after the first design) */
.st-coach { position: fixed; inset: 0; z-index: calc(var(--z-scene-ui, 10) + 5); pointer-events: none;
  animation: st-fade-in .4s var(--ease-out, ease) both; }
.st-coach.is-out { opacity: 0; transition: opacity .3s ease; }
.st-coach__ring { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 1.25px solid var(--candle); box-shadow: 0 0 24px var(--candle-dim); animation: st-coach-pulse 1.8s ease-in-out infinite; }
.st-coach__hs { position: absolute; left: 0; top: 0; }
.st-coach__tip { position: absolute; max-width: 240px; padding: 8px 12px; border-radius: var(--r-2);
  background: var(--glass-bg-solid); color: var(--ink); box-shadow: var(--shadow-float, 0 8px 24px rgba(0,0,0,.4));
  border: 1px solid var(--candle-dim); font: var(--fw-ui) var(--fs-ui)/var(--lh-ui) var(--font-ui); }
.st-coach__tip.is-left { transform: translate(-100%, -50%); }
.st-coach__tip.is-right { transform: translate(0, -50%); }
.st-coach__tip.is-above { transform: translate(0, -100%); }
.st-coach__skip { position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); margin: 0; color: var(--ink-2); }
@keyframes st-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes st-coach-pulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.18); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .st-coach, .st-coach__ring { animation: none; } }

/* ============================================================== scene layers */
.st-layer { position: absolute; inset: 0; pointer-events: none; }
.st-scene-layer > .st-layer { pointer-events: none; }
.st-layer > * { pointer-events: auto; }
.st-layer > .ix-layer { pointer-events: none; }

/* ============================================================== «Что повесить сюда?» (hotspot-popover.js) */
.st-pop {
  position: fixed; z-index: var(--z-popover); left: 0; top: 0; width: min(452px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px)); overflow: hidden; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: var(--s-3); padding: var(--s-4);
  border-radius: var(--r-3); box-shadow: var(--glass-edge), var(--shadow-pop); scrollbar-width: thin;
}
.st-pop[hidden] { display: none; }
.st-pop.glass { background: var(--glass-bg-solid); }
.st-float { position: fixed; inset: 0; z-index: var(--z-popover); pointer-events: none; }
.st-float > * { pointer-events: auto; }
.st-float > [hidden] { display: none; }
.st-pop.is-in { animation: st-pop-in var(--t-ui) var(--ease-out) both; }
@keyframes st-pop-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.st-pop__head { display: flex; align-items: flex-start; gap: var(--s-2); }
.st-pop__titles { flex: 1; min-width: 0; }
.st-pop__title { margin: 0; font: 600 var(--fs-title)/1.2 var(--font-display); color: var(--ink); }
.st-pop__where { margin: 2px 0 0; color: var(--candle); }
.st-pop__close { margin: -6px -6px 0 0; }
.st-pop__body { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; margin: 0 calc(-1 * var(--s-2)); padding: 0 var(--s-2) var(--s-1); }
.st-pop__browse, .st-pop__more { display: grid; gap: var(--s-2); }
.st-pop__browse[hidden] { display: none; }
.st-pop__more:empty { display: none; }
.st-pop__sec { position: sticky; top: 0; z-index: 1; margin: var(--s-1) 0 0; padding: 6px 0 4px; color: var(--ink-2);
  background: var(--glass-bg-solid); text-transform: uppercase; letter-spacing: .08em; }
.st-pop__tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: calc(-1 * var(--s-1)) 0 0; }
.st-pop__tabs[hidden] { display: none; }
.st-pop__chip { flex: none; border: 0; border-radius: 999px; padding: 6px 10px; background: var(--velvet-2); color: var(--ink-2); cursor: pointer;
  font: 600 var(--fs-micro)/1 var(--font-ui); box-shadow: inset 0 0 0 1px var(--hairline); }
.st-pop__chip .t-mono { color: var(--candle); margin-left: 2px; }
.st-pop__chip:hover { color: var(--ink); }
.st-pop__chip.is-on { color: var(--ink); background: var(--velvet-3); box-shadow: inset 0 0 0 1px var(--candle-dim); }
.st-pop__grid, .st-pop__results { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.st-pop__grid[hidden], .st-pop__results[hidden] { display: none; }
.st-pop__tile {
  display: grid; justify-items: center; align-content: start; gap: 3px; min-height: 0; padding: 6px 3px 7px;
  border: 0; border-radius: var(--r-2); background: var(--velvet-2); color: var(--ink); cursor: pointer; text-align: center;
  box-shadow: inset 0 0 0 1px var(--hairline); font: inherit;
  transition: background var(--t-micro) var(--ease-out), box-shadow var(--t-micro) var(--ease-out), transform var(--t-micro) var(--ease-out);
}
.st-pop__tile:hover, .st-pop__tile:focus-visible { background: var(--velvet-3); box-shadow: inset 0 0 0 1px var(--candle-dim), 0 0 18px -6px var(--candle-dim); transform: translateY(-1px); }
.st-pop__tile.is-blocked { opacity: .45; cursor: not-allowed; }
.st-pop__fig { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: var(--ink-2);
  background: radial-gradient(circle at 50% 40%, var(--velvet-4), var(--velvet-1)); overflow: hidden; }
.st-pop__fig img { width: 100%; height: 100%; object-fit: cover; }
.st-pop__name { font: 600 var(--fs-micro)/1.2 var(--font-ui); text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-pop__price { color: var(--candle); font: 500 var(--fs-micro)/1.2 var(--font-mono); }
.st-pop__search input { width: 100%; }
.st-pop__empty { grid-column: 1 / -1; margin: 0; color: var(--ink-2); font: 500 var(--fs-ui)/1.4 var(--font-ui); }
.st-pop__foot { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.st-pop__all { margin-right: auto; }
.st-pop__mirror { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-ui)/1 var(--font-ui); color: var(--ink-2); cursor: pointer; }
.st-pop__mirror[hidden] { display: none; }
.st-pop__mirror input { accent-color: var(--candle); }
.st-pop.is-sheet { left: 8px !important; right: 8px; top: auto !important; bottom: calc(var(--minitag-h, 56px) + 16px); width: auto; max-height: 60vh; }

/* ============================================================== placement bar (intent.js) */
.st-intent {
  position: fixed; z-index: var(--z-popover); top: calc(var(--free-t, 56px) + 12px);
  left: calc(var(--free-l, 0px) + (100vw - var(--free-l, 0px) - var(--free-r, 0px)) / 2); transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--s-3); max-width: calc(100vw - 32px); padding: 8px 8px 8px var(--s-4);
  border-radius: var(--r-pill); box-shadow: var(--glass-edge), var(--shadow-pop), 0 0 0 1px var(--candle-dim);
}
.st-intent[hidden] { display: none; }
.st-intent__text { margin: 0; font: 600 var(--fs-ui-lg)/1.3 var(--font-ui); color: var(--ink); }
.st-intent__actions { display: flex; gap: 4px; flex: none; }

/* ============================================================== radial menu (radial-menu.js) */
.st-radial { position: fixed; z-index: var(--z-popover); width: 0; height: 0; }
.st-radial[hidden] { display: none; }
.st-radial__cap { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); margin: 0; padding: 4px 10px; white-space: nowrap;
  border-radius: var(--r-pill); background: var(--glass-bg-solid); color: var(--ink); box-shadow: var(--shadow-float); }
.st-radial__btn {
  position: absolute; left: 0; top: 0; width: 48px; height: 48px; margin: -24px 0 0 -24px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--glass-bg-solid); color: var(--ink); cursor: pointer;
  box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--hairline-strong);
  transform: translate(0, 0) scale(.6); opacity: 0;
  transition: transform var(--t-ui) var(--ease-out), opacity var(--t-ui) var(--ease-out), background var(--t-micro);
}
.st-radial.is-in .st-radial__btn { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 1; }
.st-radial__btn:hover, .st-radial__btn:focus-visible { background: var(--velvet-3); color: var(--candle); }
.st-radial__btn.st-ai { color: var(--moon); }
.st-radial__label { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 600 var(--fs-micro)/1 var(--font-ui); color: var(--ink-2); pointer-events: none; text-shadow: 0 1px 3px var(--velvet-0); }

/* ============================================================== inspector extras */
.st-hang { margin-top: var(--s-3); }
.st-hang__sum { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 36px;
  font: 600 var(--fs-ui)/1.2 var(--font-ui); color: var(--ink-2); }
.st-hang__sum::-webkit-details-marker { display: none; }
.st-hang__sum::before { content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--candle-dim); color: var(--candle); font-weight: 500; }
.st-hang__sum:hover { color: var(--ink); }
.st-hang__list { display: flex; flex-wrap: wrap; gap: 4px; padding: var(--s-2) 0; }
.st-issues { display: grid; gap: var(--s-2); margin: var(--s-2) 0; }
.st-issues__lead { margin: 0; font: 600 var(--fs-ui)/1.3 var(--font-ui); color: var(--warn); }
.st-issue { display: block; width: 100%; padding: var(--s-2) var(--s-3); border: 0; border-radius: var(--r-2); text-align: left; cursor: pointer;
  background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--ink); font: 500 var(--fs-ui)/1.4 var(--font-ui);
  box-shadow: inset 2px 0 0 var(--warn); }
.st-issue.is-bad { background: color-mix(in srgb, var(--bad) 10%, transparent); box-shadow: inset 2px 0 0 var(--bad); }
.st-issue:hover { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.st-cat__mode { display: grid; gap: var(--s-2); margin: 0 var(--s-3) var(--s-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-2);
  background: var(--candle-faint); box-shadow: inset 0 0 0 1px var(--candle-dim); }
.st-cat__mode[hidden] { display: none; }
.st-cat__mode-t { margin: 0; font: 600 var(--fs-ui)/1.35 var(--font-ui); color: var(--ink); }
.st-tile__price { color: var(--candle); font-size: var(--fs-micro); }
.st-menu__item--sep { box-shadow: inset 0 1px 0 var(--hairline); border-radius: 0 0 var(--r-2) var(--r-2); }
.st-menu__label { color: var(--ink-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* versions tooltip / menu (topbar.js) */
.st-versions { position: relative; }
.st-vtip { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: var(--z-popover);
  display: grid; justify-items: center; gap: 2px; padding: var(--s-2); border-radius: var(--r-2); box-shadow: var(--shadow-pop); pointer-events: none; }
.st-vtip[hidden], .st-vmenu[hidden] { display: none; }
.st-vtip img { width: 128px; height: 128px; border-radius: var(--r-1); background: var(--velvet-2); object-fit: cover; }
.st-vtip img:not([src]), .st-vtip img[src=""] { display: none; }
.st-vtip__t { margin: 0; font: 600 var(--fs-ui)/1.3 var(--font-ui); color: var(--ink); white-space: nowrap; }
.st-vtip__s { margin: 0; white-space: nowrap; }
.st-vmenu { left: 0; right: auto; }

/* «Из чего цена» sheet on the phone (price-tag.js) */
.st-pricesheet { position: fixed; inset: 0; z-index: var(--z-modal); }
.st-pricesheet__scrim { position: absolute; inset: 0; background: var(--scrim); animation: st-fade-in var(--t-ui) both; }
.st-pricesheet__panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow: auto; padding: var(--s-3) var(--s-5) var(--s-6);
  border-radius: var(--r-3) var(--r-3) 0 0; background: var(--glass-bg-solid); animation: st-sheet-up var(--t-panel) var(--ease-out) both; }
@keyframes st-sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* «Для мастера: JSON» (json-modal.js) */
.st-dialog.st-json { width: min(860px, calc(100vw - 32px)); max-width: none; }
.st-json__head { display: grid; gap: 4px; }
.st-json__lead { margin: 0; color: var(--ink-2); }
.st-json__text { width: 100%; min-height: 50vh; resize: vertical; padding: var(--s-3); border: 0; border-radius: var(--r-2);
  background: var(--velvet-0); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline-strong); font: 400 var(--fs-mono)/1.5 var(--font-mono); tab-size: 2; }
.st-json__text:focus { outline: none; box-shadow: inset 0 0 0 1px var(--candle); }
.st-json__err { margin: 0; color: var(--bad); }
.st-json__err[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .st-pop.is-in, .st-radial__btn { animation: none; transition: none; } }

/* short windows: the tag scrolls inside itself and the CTA stays reachable */
.st-price { flex: 0 0 auto; max-height: 64%; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.st-side > .st-inspector { flex: 1 1 0; }
.st-price::-webkit-scrollbar { display: none; }
.st-price__cta { position: sticky; bottom: 0; z-index: 1; background-color: var(--glass-bg-solid); }
@media (max-height: 760px) {
  .st-price__note { display: none; }
  .st-inspector { min-height: 160px; }
}

/* drag a catalog tile onto a point */
.st-tile img { -webkit-user-drag: none; user-select: none; }
.st-tile--part { touch-action: manipulation; }
html.st-dragging, html.st-dragging * { cursor: grabbing !important; user-select: none; }
.st-drag-ghost {
  position: fixed; left: 0; top: 0; z-index: var(--z-toast); pointer-events: none; display: flex; align-items: center; gap: 8px;
  margin: -22px 0 0 14px; padding: 6px 12px 6px 6px; border-radius: var(--r-pill); background: var(--glass-bg-solid);
  color: var(--ink); font: 600 var(--fs-ui)/1 var(--font-ui); box-shadow: var(--shadow-pop), 0 0 0 1px var(--candle-dim);
  transition: box-shadow var(--t-micro);
}
.st-drag-ghost .st-tile__fig { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none; }
.st-drag-ghost .st-tile__fig img { width: 100%; height: 100%; object-fit: cover; }
.st-drag-ghost.is-magnet { box-shadow: var(--shadow-pop), 0 0 0 1px var(--candle), 0 0 24px var(--candle-dim); }

/* ============================================================== simplified studio (one way to do each thing) */
/* inspector «Деталь»: the way back to «Изделие» is always on screen */
.st-insp__nav { display: flex; align-items: center; justify-content: space-between; margin: calc(var(--s-2) * -1) calc(var(--s-2) * -1) var(--s-2); }
.st-insp__nav[hidden] { display: none; }
.st-insp__back { gap: 6px; padding-inline: var(--s-2); color: var(--ink-2); }
.st-insp__back:hover { color: var(--ink); }
/* the order CTA lives in the top bar (desktop / tablet) and in the mini tag (phone); the tag only shows the price */
html:not([data-layout="phone"]) .st-side .st-price__cta { display: none; }
/* empty studio: only the first-run choice in the middle (no empty inspector, no zero price, no blank status) */
html.st-is-empty .st-side, html.st-is-empty .st-status { display: none; }
/* popover tiles: baked renders on velvet */
.st-pop__fig { width: 60px !important; height: 60px !important; border-radius: var(--r-2) !important;
  background: radial-gradient(circle at 50% 40%, var(--velvet-4), var(--velvet-2)); overflow: hidden; }
.st-pop__fig img { object-fit: contain !important; padding: 4%; }
