/* =============================== 3D STUDIJA v3 ===============================
   Graphite + gold, glass overlays. Mobile: sticky 3D on top, options scroll below, price bar fixed.
   Desktop: stage + 440px panel, panel scrolls inside. */
.kg-studio {
  --s-bg: #0d0f12; --s-bg2: #14171b; --s-bg3: #1b1f24; --s-line: rgba(255, 255, 255, .08); --s-line2: rgba(255, 255, 255, .16);
  --s-tx: #ecebe6; --s-tx2: #a4a7ad; --s-tx3: #6f747b; --s-gold: #c9a86a; --s-gold2: #e9d3a6;
  font-family: var(--f, Montserrat, system-ui, sans-serif); color: var(--s-tx); background: var(--s-bg); position: relative;
}
.kg-studio *, .kg-studio *::before { box-sizing: border-box; }
:where(.kg-studio) button { font: inherit; color: inherit; }

/* ---------- layout ---------- */
.st-stage { position: sticky; top: var(--hdr, 64px); z-index: 5; height: 46svh; min-height: 300px; overflow: hidden; background: #dfe3e2; }
.st-panel { position: relative; background: var(--s-bg); padding-bottom: 96px; }
.st-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(13, 15, 18, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--s-line); }
@media (min-width: 1024px) {
  .kg-studio { display: grid; grid-template-columns: minmax(0, 1fr) 440px; grid-template-rows: minmax(0, 1fr) auto; height: calc(100svh - var(--hdr, 78px)); min-height: 660px; }
  .st-stage { position: relative; top: 0; height: auto; grid-column: 1; grid-row: 1; }
  .st-panel { grid-column: 2; grid-row: 1 / 3; overflow-y: auto; padding-bottom: 24px; border-left: 1px solid var(--s-line); scrollbar-width: thin; scrollbar-color: #2a2f35 transparent; }
  .st-bar { position: relative; grid-column: 1; grid-row: 2; padding: 12px 18px; }
}
@media (max-width: 1023px) { .kg-studio .st-hide-m { display: none; } .st-price small { font-size: .56rem; } .st-total { font-size: 1.2rem; } .st-bar .btn--gold { padding: 0 16px; } }

.st-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.is-painting .st-canvas { cursor: crosshair; }
.is-dragging .st-canvas { cursor: grabbing; }
.st-loading { position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; justify-items: center; gap: 14px; font-size: .85rem; color: #4a4f55; background: radial-gradient(circle at 50% 40%, #eef1f0, #d9dedd); }
.st-loading[hidden] { display: none; }
.st-spin { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .1); border-top-color: var(--s-gold); animation: stspin 1s linear infinite; }
@keyframes stspin { to { transform: rotate(360deg); } }

/* ---------- stage overlays (glass) ---------- */
.st-top { position: absolute; z-index: 4; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.st-top > * { pointer-events: auto; }
.st-seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(13, 15, 18, .62); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .1); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.st-seg::-webkit-scrollbar { display: none; }
.st-seg button { flex: none; border: 0; background: none; padding: 7px 12px; border-radius: 999px; font-size: .74rem; font-weight: 600; color: #d8d9dc; cursor: pointer; min-height: 32px; transition: background .2s, color .2s; }
.st-seg button[aria-pressed="true"] { background: #fff; color: #0d0f12; }
.st-seg [data-evening][aria-pressed="true"] { background: #3a2b16; color: #ffd690; }
.st-seasons { position: absolute; z-index: 4; left: 10px; bottom: 10px; max-width: calc(100% - 20px); }
.st-real { flex: none; display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; padding: 0 16px; min-height: 38px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .01em; color: #17130b; background: linear-gradient(135deg, #f1dcae, #c9a86a 55%, #a8854a); box-shadow: 0 8px 24px -8px rgba(201, 168, 106, .8), inset 0 1px 0 rgba(255, 255, 255, .5); }
.st-real span { font-size: .95rem; }
@media (max-width: 560px) { .st-top { flex-direction: column; align-items: flex-start; } .st-real { min-height: 34px; padding: 0 13px; } }
.st-hint { position: absolute; z-index: 5; left: 50%; top: 58px; transform: translateX(-50%); padding: 9px 16px; border-radius: 999px; background: rgba(13, 15, 18, .82); color: #fff; font-size: .8rem; font-weight: 600; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; animation: sthint .3s ease; }
@keyframes sthint { from { opacity: 0; transform: translate(-50%, -6px); } }

/* photoreal overlay */
.st-photo { position: absolute; z-index: 5; inset: auto 10px 10px; display: grid; gap: 10px; }
.st-photo[hidden] { display: none; }
.st-photo__bar { padding: 12px 14px; border-radius: 14px; background: rgba(13, 15, 18, .78); backdrop-filter: blur(14px); font-size: .82rem; font-weight: 600; display: grid; gap: 8px; }
.st-photo__bar i { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.st-photo__bar b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--s-gold), var(--s-gold2)); transition: width .3s; }
.st-photo__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.is-photo .st-seasons, .is-photo .st-top .st-seg { display: none; }

/* ---------- steps ---------- */
.st-steps { position: sticky; top: calc(var(--hdr, 64px) + 46svh); z-index: 4; display: flex; gap: 4px; padding: 10px 12px; background: rgba(13, 15, 18, .96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--s-line); overflow-x: auto; scrollbar-width: none; }
.st-steps::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .st-steps { top: 0; padding: 14px 16px; } }
.st-steps button { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; background: none; color: var(--s-tx2); padding: 7px 11px 7px 7px; border-radius: 999px; font-size: .78rem; font-weight: 600; cursor: pointer; }
.st-steps i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-style: normal; font-size: .7rem; background: var(--s-bg3); color: var(--s-tx2); }
.st-steps [aria-selected="true"] { color: var(--s-tx); border-color: var(--s-line2); background: var(--s-bg2); }
.st-steps [aria-selected="true"] i { background: var(--s-gold); color: #17130b; }

/* ---------- panel content ---------- */
.st-body { padding: 4px 16px 24px; }
@media (min-width: 1024px) { .st-body { padding: 4px 20px 24px; } }
.pg { padding: 20px 0; border-bottom: 1px solid var(--s-line); }
.pg:last-child { border-bottom: 0; }
.pg h3 { margin: 0 0 12px; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--s-tx2); }
.pg--lead h3 { font-size: 1.15rem; letter-spacing: 0; text-transform: none; color: var(--s-tx); margin-bottom: 4px; }
.pg .note, .kg-studio .note { margin: 10px 0 0; font-size: .8rem; line-height: 1.55; color: var(--s-tx3); }
.pg--lead > .note { margin: 0 0 14px; }
.sub { margin: 14px 0 8px; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--s-tx3); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chips--sm { margin-bottom: 10px; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--s-line2); background: var(--s-bg2); font-size: .8rem; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.chip small { font-weight: 500; color: var(--s-tx3); font-size: .72rem; }
.chip:hover { border-color: rgba(255, 255, 255, .3); }
.chip[aria-pressed="true"] { background: var(--s-tx); color: #0d0f12; border-color: var(--s-tx); }
.chip[aria-pressed="true"] small { color: #55595f; }

/* tiles */
.tiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.tile { position: relative; display: grid; align-content: start; gap: 3px; text-align: left; padding: 8px; border-radius: 14px; border: 1px solid var(--s-line); background: var(--s-bg2); cursor: pointer; transition: border-color .15s, transform .15s, background .15s; min-width: 0; }
.tile:hover { border-color: var(--s-line2); background: var(--s-bg3); }
.tile:active { transform: scale(.98); }
.tile[aria-pressed="true"] { border-color: var(--s-gold); box-shadow: 0 0 0 1px var(--s-gold), 0 10px 30px -14px rgba(201, 168, 106, .6); }
.tile[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--s-gold); color: #17130b; font-size: .7rem; font-weight: 800; }
.tile b { font-size: .78rem; font-weight: 700; line-height: 1.3; }
.tile small { font-size: .7rem; color: var(--s-tx3); line-height: 1.35; }
.tile em { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--s-gold); }
.tile .sw { display: block; aspect-ratio: 1.35; border-radius: 9px; background-size: cover; background-color: #222; margin-bottom: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.tiles--mini { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
.tiles--mini .tile { padding: 5px; } .tiles--mini .sw { aspect-ratio: 1; margin: 0 0 3px; } .tiles--mini small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles--plan { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.tiles--plan svg { width: 100%; height: auto; aspect-ratio: 14 / 24; max-height: 120px; border-radius: 8px; margin-bottom: 6px; }
.tiles--shape { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.tiles--shape svg, .tiles--items svg { width: 44px; height: 44px; margin: 4px auto 6px 0; color: var(--s-gold2); }
.tiles--items { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.tiles--font span { font-size: 1.35rem; line-height: 1.2; padding: 8px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #f3e6c8; }
.tiles--ink i { display: block; height: 28px; border-radius: 8px; margin-bottom: 5px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -6px 12px rgba(0, 0, 0, .25); }

/* ready designs */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.preset { position: relative; display: grid; gap: 3px; text-align: left; border: 1px solid var(--s-line); border-radius: 16px; background: var(--s-bg2); padding: 6px 6px 10px; cursor: pointer; transition: border-color .15s, transform .15s; }
.preset:hover { border-color: var(--s-gold); transform: translateY(-2px); }
.preset__img { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 11px; overflow: hidden; background: radial-gradient(circle at 50% 30%, #2a2f35, #15181c); margin-bottom: 6px; }
.preset__img svg { position: absolute; inset: 10% 30%; width: 40%; height: 80%; }
.preset__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.preset em { position: absolute; z-index: 2; top: 12px; left: 12px; font-style: normal; font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: rgba(13, 15, 18, .78); color: var(--s-gold2); backdrop-filter: blur(6px); }
.preset b { font-size: .78rem; line-height: 1.3; padding: 0 4px; }
.preset small { font-size: .78rem; font-weight: 700; color: var(--s-gold); padding: 0 4px; }

/* paint */
.pg--paint.is-on { background: linear-gradient(180deg, rgba(201, 168, 106, .08), transparent); margin: 0 -16px; padding: 20px 16px; }
.brushes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.brush { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--s-line2); background: var(--s-bg2); font-size: .78rem; font-weight: 600; cursor: pointer; }
.brush i { width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.brush[aria-pressed="true"] { border-color: var(--s-gold); background: rgba(201, 168, 106, .14); }

/* forms */
.kg-studio .field { display: grid; gap: 5px; margin-bottom: 10px; }
.kg-studio .field span { font-size: .72rem; font-weight: 600; color: var(--s-tx2); }
.kg-studio .field input, .kg-studio .field textarea { width: 100%; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--s-line2); background: var(--s-bg2); color: var(--s-tx); font: 500 16px/1.4 var(--f, sans-serif); }
.kg-studio .field input:focus, .kg-studio .field textarea:focus { outline: 0; border-color: var(--s-gold); box-shadow: 0 0 0 3px rgba(201, 168, 106, .2); }
.kg-studio .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kg-studio .person { border: 0; padding: 0; margin: 0 0 8px; }
.kg-studio .check { display: flex; gap: 10px; align-items: flex-start; font-size: .8rem; color: var(--s-tx2); margin: 6px 0 12px; }
.kg-studio .check input { width: 18px; height: 18px; accent-color: var(--s-gold); margin-top: 1px; }
.kg-studio .kg-hp { position: absolute; left: -9999px; }
.kg-studio .link { background: none; border: 0; padding: 4px 0; color: var(--s-gold); font-size: .78rem; font-weight: 600; cursor: pointer; }
.kg-studio .upload { margin-top: 10px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: .84rem; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 42px; height: 24px; border-radius: 999px; background: var(--s-bg3); border: 1px solid var(--s-line2); position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--s-gold); border-color: var(--s-gold); }
.switch input:checked + span::after { transform: translateX(18px); }
.range { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 12px 0; font-size: .8rem; color: var(--s-tx2); }
.range output { font-weight: 700; color: var(--s-tx); }
.range input { grid-column: 1 / -1; accent-color: var(--s-gold); width: 100%; }
.more { margin-top: 12px; }
.more summary { cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--s-tx2); list-style: none; }
.more summary::before { content: "+ "; color: var(--s-gold); }
.more[open] summary::before { content: "− "; }
.placed { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.placed li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--s-bg2); font-size: .82rem; }
.placed li span { flex: 1; }

/* price lines */
.lines { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: 12px; }
.lines td { padding: 8px 0; border-bottom: 1px solid var(--s-line); vertical-align: top; }
.lines td:last-child { text-align: right; white-space: nowrap; font-weight: 600; padding-left: 12px; }
.lines td small { display: block; color: var(--s-tx3); font-size: .72rem; }
.lines .sum td { border-bottom: 0; padding-top: 14px; font-size: 1rem; font-weight: 800; color: var(--s-gold2); }
.warns { margin: 12px 0 0; padding: 0 0 0 18px; font-size: .78rem; display: grid; gap: 4px; }
.lv-block { color: #f08a7e; } .lv-review { color: #e6b66c; }
.real { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.real img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.lead .done { text-align: center; padding: 18px 0; }
.lead .done i { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--s-gold); color: #17130b; font-style: normal; font-weight: 800; font-size: 1.3rem; }
.lead .done h4 { margin: 12px 0 6px; font-size: 1.05rem; }
.lead .done p { margin: 0; font-size: .85rem; color: var(--s-tx2); }

/* buttons inside studio */
.kg-studio .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-size: .84rem; font-weight: 700; cursor: pointer; text-decoration: none; }
.kg-studio .btn--gold { color: #17130b; background: linear-gradient(135deg, #f1dcae, #c9a86a 55%, #a8854a); }
.kg-studio .btn--ghost { color: var(--s-tx); background: rgba(255, 255, 255, .06); border-color: var(--s-line2); }
.kg-studio .btn--sm { min-height: 36px; padding: 0 12px; font-size: .78rem; }
.kg-studio .btn--block { width: 100%; }
.kg-studio .btn--icon { width: 36px; min-height: 36px; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: var(--s-tx); }
.kg-studio .btn:disabled { opacity: .6; cursor: wait; }

/* price bar */
.st-price { display: grid; text-align: left; border: 0; background: none; cursor: pointer; padding: 0; position: relative; }
.st-price small { font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--s-tx3); }
.st-total { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.st-delta { position: absolute; left: 100%; top: 14px; margin-left: 8px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.st-delta.up { color: #e6b66c; } .st-delta.down { color: #7fd1a1; }
.st-bar__act { display: flex; gap: 8px; }

/* dialog */
.st-dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, 94vw); background: var(--s-bg2); color: var(--s-tx); }
.st-dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
.st-dialog header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--s-line); }
.st-dialog h2 { margin: 0; font-size: 1rem; }
.st-dialog__body { padding: 18px; }

/* page around the studio */
.studio-page .site-footer, .studio-page .section { position: relative; z-index: 1; }

.cta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
