/* «Сайт»: the gallery, the site wizard and the plan editor (sitebuilder.js). Only studio.css tokens. */

.sb { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.sb-h1 { margin: 6px 0 0; font-size: 26px; line-height: 1.15; color: var(--ink); text-align: center; overflow-wrap: anywhere; }
.sb-note { margin: 4px; font-size: 13px; }
.sb-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sb-row > .btn { flex: 1 1 140px; width: auto; }
.sb-stack { display: flex; flex-direction: column; gap: 10px; }
.sb-grow { flex: 1; min-width: 0; }
.sb-danger { border-color: var(--bad); color: var(--bad); }

/* the two ways in */
.sb-ways { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .sb-ways { grid-template-columns: 1fr 1fr; } }
.sb-way {
  display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 3px;
  padding: 14px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--card); color: var(--fg);
  text-align: left; box-shadow: var(--shadow); font: inherit;
}
.sb-way:active { transform: scale(.99); }
.sb-way-art { grid-row: 1 / span 3; display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 18px; background: var(--tint); color: var(--ink); }
.sb-way-art.b { background: var(--ink); color: var(--it); }
.sb-way-art svg { width: 46px; height: 32px; }
.sb-way b { font-size: 16px; color: var(--ink); }
.sb-way small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.sb-way em { font-style: normal; font-weight: 800; font-size: 12px; color: var(--acc); }

/* the examples */
.sb-examples { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .sb-examples { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
.sb-ex { border-radius: 22px; overflow: hidden; border: 1.5px solid var(--line); background: var(--card); display: flex; flex-direction: column; }
.sb-ex img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--tint); }
.sb-ex-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.sb-ex-body b { font-size: 16px; color: var(--ink); }
.sb-ex-body small { color: var(--muted); font-size: 12px; }
.sb-ex-body p { margin: 2px 0 8px; font-size: 13.5px; }

/* my sites */
.sb-list { display: flex; flex-direction: column; gap: 8px; }
.sb-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--fg); text-align: left; font: inherit; width: 100%;
}
.sb-item span { display: flex; flex-direction: column; min-width: 0; }
.sb-item b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-item small { color: var(--muted); font-size: 12px; }
.sb-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; }

/* the wizard */
.sb-steps { margin-top: 2px; }
.sb-body { display: flex; flex-direction: column; gap: 10px; }
.sb-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sb-field > span { font-size: 12px; font-weight: 700; color: var(--muted); padding-left: 4px; }
.sb-field > small { font-size: 11.5px; color: var(--muted); padding-left: 4px; }
.sb-in {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--fg); font: inherit; font-size: 15px;
}
textarea.sb-in { resize: vertical; line-height: 1.4; }
.sb-in:focus { outline: none; border-color: var(--ink); }
select.sb-in { appearance: auto; }
.sb-color { width: 100%; height: 44px; padding: 3px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); }
.sb-theme { display: grid; grid-template-columns: 1fr; gap: 10px; }
.sb-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sb-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.sb-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 380px) { .sb-grid3 { grid-template-columns: 1fr 1fr; } .sb-grid4 { grid-template-columns: 1fr 1fr; } }
.sb-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card); }
.sb-card > .chip { align-self: flex-start; }
.sb-card-row { display: flex; gap: 12px; align-items: flex-start; }
.sb-mini { flex: none; width: 76px; height: 60px; border-radius: 10px; background: var(--tint); }
.sb-mini.empty { display: block; border: 1.5px dashed var(--line); }
.sb-item .sb-mini { width: 64px; height: 48px; }
.sb-floors .chip.has:not(.on) { border-color: var(--ink); }
.sb-floors .chip.over { border-color: var(--bad); color: var(--bad); border-style: dashed; }
.sb-flat .sb-row .chip { margin: 0; }

/* the photos */
.sb-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.sb-photo { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sb-photo-pick {
  display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3; padding: 0; overflow: hidden;
  border-radius: 14px; border: 1.5px dashed var(--line); background: var(--tint); color: var(--ink); font-size: 28px; font-weight: 300;
}
.sb-photo.has .sb-photo-pick { border-style: solid; }
.sb-photo-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-photo small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.sb-photo-x {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0;
  background: var(--ink); color: var(--it); font-size: 18px; line-height: 28px;
}
.sb-photo.busy { opacity: .5; pointer-events: none; }

/* done */
.sb-counts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sb-counts span { display: flex; flex-direction: column; align-items: center; padding: 8px 2px; border-radius: 14px; background: var(--tint); min-width: 0; }
.sb-counts b { font-size: 18px; color: var(--ink); }
.sb-counts small { font-size: 10.5px; color: var(--muted); }
.sb-frame { border-radius: 18px; overflow: hidden; border: 1.5px solid var(--line); background: var(--tint); }
.sb-preview { display: block; width: 100%; height: 70vh; min-height: 420px; border: 0; background: #fff; }

/* the plan editor */
.sb-canvas-box { border-radius: 18px; border: 1.5px solid var(--line); background: #fff; overflow: hidden; }
.sb-canvas { display: block; width: 100%; height: auto; max-height: 62vh; touch-action: none; user-select: none; -webkit-user-select: none; }
.sb-canvas .sb-grid line { stroke: var(--line); stroke-width: .02; }
.sb-canvas .sb-r { cursor: move; }
.sb-canvas .sb-r rect:first-child { stroke: #2a2a2a; stroke-width: .1; }
.sb-canvas .sb-r.on rect:first-child { stroke: var(--acc); stroke-width: .14; }
.sb-canvas text { text-anchor: middle; dominant-baseline: middle; fill: #2a0a10; font-family: var(--f); font-weight: 700; pointer-events: none; }
.sb-canvas text.sz { font-weight: 500; fill: #76595f; }
.sb-canvas .sb-door { stroke: #fff; stroke-width: .16; }
.sb-canvas .sb-window { stroke: #3a8ee6; stroke-width: .16; }
.sb-canvas .sb-handle { fill: var(--acc); stroke: #fff; stroke-width: .05; cursor: nwse-resize; }
/* names stay readable over a photo under the plan or a pale floor: a white halo under the letters */
.sb-canvas text { stroke: #fff; stroke-width: .07; stroke-linejoin: round; paint-order: stroke; }
/* a room a plan read off a photo is not sure of: dashed amber until it is looked at */
.sb-canvas .sb-r.flag rect:first-child { stroke: #e8a400; stroke-width: .14; stroke-dasharray: .3 .18; }
.sb-canvas .sb-r.flag.on rect:first-child { stroke: var(--acc); stroke-dasharray: none; }
.sb-fixes { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--tint); }
.sb-fixes b { font-size: 13px; }
.sb-fixes .sb-flag { margin: 0; font-size: 13px; color: #8a5a00; }
.sb-walls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.sb-walls > div { display: flex; align-items: center; gap: 4px; font-size: 12.5px; }
.sb-walls > div span { flex: 1; min-width: 0; }
.sb-warn { margin: 0 4px; font-size: 13px; font-weight: 700; color: var(--bad); }
.sb-room { display: flex; flex-direction: column; gap: 10px; }
.sb-open { display: flex; flex-direction: column; gap: 6px; }
.sb-open-h { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.sb-open-h b { font-size: 13px; color: var(--ink); }
.sb-open-row { display: grid; grid-template-columns: 1.1fr 1.3fr .9fr auto; gap: 6px; align-items: center; }
.sb-open-row .sb-in { min-height: 40px; padding: 6px 8px; font-size: 14px; }
.sb-range { width: 100%; accent-color: var(--ink); }
.sb-check { display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.sb-check input { width: 20px; height: 20px; accent-color: var(--ink); }

/* a picture with outlines and pins tapped on it (facade floors, flats on a floor, rooms, points of a space) */
.sb-board { position: relative; border-radius: 16px; overflow: hidden; border: 1.5px solid var(--line); background: var(--tint);
  cursor: crosshair; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.sb-board img { display: block; width: 100%; height: auto; pointer-events: none; }
.sb-board-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sb-board-layer polygon, .sb-board-layer polyline { fill: rgba(255, 255, 255, .18); stroke: #fff; stroke-width: 1.5;
  vector-effect: non-scaling-stroke; stroke-dasharray: 4 3; }
.sb-board-layer .on { fill: rgba(255, 196, 0, .32); stroke: #ffc400; stroke-dasharray: none; stroke-width: 2.5; }
.sb-board-pins { position: absolute; inset: 0; pointer-events: none; }
.sb-pin { position: absolute; transform: translate(-50%, -50%); min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; font-style: normal; font-size: 11.5px; font-weight: 800; color: #fff; background: var(--ink);
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); white-space: nowrap; }
.sb-pin.on { background: #e8a400; transform: translate(-50%, -50%) scale(1.15); }
.sb-pin.dot { min-width: 14px; height: 14px; padding: 0; background: #e8a400; }
.sb-spot.on { border-color: #e8a400; }
.sb-spots { padding-top: 6px; border-top: 1.5px dashed var(--line); }
.sb-upload { display: contents; }
.sb-thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 10px; }
.sb-end { align-items: flex-end; justify-content: flex-end; }
.sb-photo-pick video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-warn .chip { margin-left: 6px; }

/* «Графика»: sketches → package → generation → review → build */
.sb-g-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; counter-reset: g; }
.sb-g-stages li { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 2px; border-radius: 12px; background: var(--tint); min-width: 0; text-align: center; }
.sb-g-stages b { font-size: 11.5px; color: var(--ink); overflow-wrap: anywhere; }
.sb-g-stages small { font-size: 10.5px; color: var(--muted); overflow-wrap: anywhere; }
.sb-g-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 520px) { .sb-g-grid { grid-template-columns: 1fr 1fr; } }
.sb-g-card, .sb-g-review { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card); min-width: 0; }
.sb-g-pic { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--tint); display: grid; place-items: center; }
.sb-g-pic img, .sb-g-pic video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-g-empty { font-size: 12.5px; color: var(--muted); padding: 8px; text-align: center; }
.sb-g-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.sb-g-meta b { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.sb-g-meta small { font-size: 11.5px; color: var(--muted); }
.sb-g-tag { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--tint); color: var(--muted); }
.sb-g-tag.ready, .sb-g-tag.review { background: #fff3cf; color: #7a5200; }
.sb-g-tag.approved, .sb-g-tag.done { background: #dff3e4; color: #1d6b35; }
.sb-g-tag.failed { background: #fde3e3; color: var(--bad); }
.sb-g-card .sb-row > .btn, .sb-g-review .sb-row > .btn { flex: 1 1 120px; }
.sb-g-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 340px) { .sb-g-pair { grid-template-columns: 1fr; } }
.sb-g-pair figure { margin: 0; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sb-g-pair figcaption { font-size: 11.5px; color: var(--muted); text-align: center; }
.sb-g-est { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 40vh; overflow: auto; }
.sb-g-est li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 4px 2px; border-bottom: 1px dashed var(--line); }
.sb-g-est li span { min-width: 0; overflow-wrap: anywhere; }
.sb-g-est li b { flex: none; }
.sb-g-est li.off { opacity: .55; }
.sb-g-total { display: flex; justify-content: space-between; font-size: 16px; margin: 12px 2px 6px; padding-top: 8px; border-top: 1px solid var(--line, rgba(0,0,0,.1)); }
.sb-g-total b { color: var(--ink); }
