[hidden] {
  display: none !important;
}
:root {
  --bg: #fbfaf8;
  --card: #ffffff;
  --line: #e7e2dc;
  --text: #1f2633;
  --muted: #6b6f78;
  --accent: #8e5b3d;
  --accent-soft: #f4ece6;
  --ok: #2f6b4f;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --risk: #a3352b;
  --radius: 14px;
  --font:
    "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue",
    Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 250, 248, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1480px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.brand {
  font-weight: 800;
  margin-right: auto;
}
.brand b {
  color: var(--accent);
}
.badge {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.wrap {
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px 20px 80px;
}
h1 {
  font-size: 28px;
  margin: 6px 0 6px;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 19px;
  margin: 0;
}
h3 {
  font-size: 17px;
  margin: 0;
}
.muted {
  color: var(--muted);
}
.intro p {
  max-width: 900px;
  margin: 0;
}
.step {
  margin-top: 26px;
}
.step-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0;
}
.btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn.sm {
  padding: 6px 12px;
  font-size: 14px;
}
.btn.busy {
  position: relative;
  color: transparent;
}
.btn.busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.field-inline input {
  width: 130px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.rooms {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.room {
  flex: 0 0 auto;
  width: 170px;
  aspect-ratio: 3/2;
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid transparent;
  cursor: pointer;
  padding: 0;
  background: #eee;
}
.room img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.room[aria-pressed="true"] {
  border-color: var(--accent);
}

.cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 10px;
}
.cat {
  display: grid;
  grid-template-columns: auto 56px 1fr;
  gap: 10px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.cat.off {
  opacity: 0.5;
}
.cat img,
.cat .noimg {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: #f3f1ee;
}
.cat select {
  width: 100%;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.cat .t {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.cat .s {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.cat .s a {
  color: var(--accent);
}
.total {
  justify-content: space-between;
}

.cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1100px) {
  .cols {
    grid-template-columns: 1fr;
  }
}
.col {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.col-h p {
  margin: 2px 0 0;
  font-size: 13px;
}
.model-sel {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.stage {
  position: relative;
  width: 100%;
  background: #f1eee9;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 4px;
}
.stage .placeholder {
  aspect-ratio: 3/2;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 10px;
}
.stage img.result,
.stage img.photo {
  width: 100%;
  display: block;
}
.stage img.result {
  cursor: zoom-in;
}
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
.stage .busy-veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  color: var(--muted);
}
.meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  min-height: 20px;
}
.meta b {
  color: var(--text);
}
.meta details {
  margin-top: 4px;
}
.meta pre {
  white-space: pre-wrap;
  font-size: 12px;
  background: #f6f4f1;
  padding: 8px;
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
}
.warns {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  font-size: 13px;
}
.warns li {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn);
  margin-top: 4px;
}
.warns li.ok {
  background: #e6f1eb;
  color: var(--ok);
}
.rating {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
}
.rating:empty {
  display: none;
}
.rating .r {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
}
.rating .r span:first-child {
  color: var(--muted);
}
.rating .stars button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  width: 26px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
.rating .stars button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.hint {
  font-size: 13px;
  margin-top: 10px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.runs {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.runs th,
.runs td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.runs th {
  color: var(--muted);
  font-weight: 600;
}
.runs img {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
  display: block;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, 0.85);
  display: grid;
  place-items: center;
  z-index: 50;
  cursor: zoom-out;
  padding: 20px;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  z-index: 60;
  max-width: min(640px, 90vw);
  font-size: 14px;
}
.toast.err {
  background: var(--risk);
}
/* Выбор одного пайплайна и общая рабочая область. */
.wrap {
  max-width: 1180px;
}
.intro {
  padding: 20px 0 8px;
}
.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
h1 {
  max-width: 800px;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.15;
  margin: 12px 0;
}
.pipeline-card,
.workspace {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.pipeline-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
}
.field select,
textarea {
  width: 100%;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  color: var(--text);
}
textarea {
  resize: vertical;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
}
.wishes-field {
  margin-top: 20px;
}
.small {
  font-size: 13px;
}
.primary {
  padding: 12px 22px;
}
.notice {
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
}
.status-line {
  min-height: 23px;
  color: var(--muted);
}
.status-line.error {
  color: var(--risk);
}
.view-tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
  padding: 4px;
  background: var(--accent-soft);
  border-radius: 10px;
}
.view-tabs button {
  border: none;
  border-radius: 7px;
  padding: 7px 13px;
  cursor: pointer;
  background: transparent;
}
.view-tabs button[aria-pressed="true"] {
  color: var(--accent);
  background: white;
  box-shadow: 0 1px 4px #0001;
}
.view-tabs button:disabled {
  opacity: 0.4;
  cursor: default;
}
.workspace .stage {
  max-width: 100%;
}
.workspace .stage .placeholder {
  aspect-ratio: 16/8;
}
.plan-explanation {
  margin-top: 14px;
  line-height: 1.6;
}
.workspace details {
  margin-top: 15px;
  font-size: 13px;
}
.workspace pre {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  padding: 14px;
  background: var(--bg);
}
button:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid #bca18c;
  outline-offset: 2px;
}
@media (max-width: 800px) {
  .pipeline-controls {
    grid-template-columns: 1fr;
  }
  .top-in {
    flex-wrap: wrap;
  }
  .brand {
    width: 100%;
  }
  .pipeline-card,
  .workspace {
    padding: 14px;
  }
  .cats {
    grid-template-columns: 1fr;
  }
}
.zones-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.6fr) minmax(240px, 1fr);
  gap: 16px;
  align-items: start;
}
#zoneMap {
  width: 100%;
  max-height: 480px;
  background: #f4f1ec;
  border: 1px solid var(--line);
  border-radius: 12px;
  touch-action: none;
  user-select: none;
}
.editor-toolbar {
  display: grid;
  grid-template-columns: 1.4fr 1.3fr 0.8fr 0.8fr;
  gap: 12px;
  margin-bottom: 16px;
}
.editor-toolbar .field {
  min-width: 0;
}
.editor-toolbar input,
.zone-panel input,
.zone-panel select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 7px;
  background: white;
}
.zone-panel {
  min-width: 0;
}
.zone-panel .field {
  margin-bottom: 9px;
}
.zone-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.zone-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 180px;
  overflow-y: auto;
  margin: 10px 0;
}
.zone-list button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: white;
  text-align: left;
  cursor: pointer;
}
.zone-list button[aria-pressed="true"] {
  border-color: var(--accent, #8e5b3d);
  background: #f4ece5;
}
.zone-list small {
  display: block;
  color: var(--muted);
  margin: 3px 0 0 15px;
}
.danger {
  color: #a3352b;
}
.zone-shape {
  cursor: move;
}
.resize-handle {
  cursor: nwse-resize;
}
[data-vertex-handle] {
  cursor: grab;
}
.zone-panel details {
  margin-top: 14px;
  font-size: 13px;
}
.vertex-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.vertex-table td {
  padding: 3px;
}
.vertex-table input {
  width: 100%;
}
.vertex-table button {
  min-width: 27px;
  min-height: 30px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 5px;
}
.append-views {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  align-items: center;
}
.room-views {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.room-view {
  display: grid;
  grid-template-columns: 72px minmax(100px, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  max-width: 300px;
  font-size: 12px;
}
.room-view img {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: 5px;
  cursor: pointer;
}
.room-view span {
  display: block;
}
.room-view button {
  border: 0;
  padding: 4px 0;
  background: transparent;
  text-align: left;
  color: #8e5b3d;
  cursor: pointer;
}
#renderView {
  max-width: 220px;
}
.mode-link {
  color: #8e5b3d;
  font-size: 13px;
  text-decoration: none;
  margin-left: auto;
}
.mode-link:hover {
  text-decoration: underline;
}
html[data-experience="automatic"] #catalogueStep,
html[data-experience="automatic"] #zoneEditor,
html[data-experience="automatic"] .pipeline-controls,
html[data-experience="automatic"] #btnGeo,
html[data-experience="automatic"] #btnPlan,
html[data-experience="automatic"] #sceneToolbar,
html[data-experience="automatic"] #planDetails,
html[data-experience="automatic"] #planExplanation,
html[data-experience="automatic"] #gpuBadge,
html[data-experience="automatic"] #spendBadge {
  display: none !important;
}
html[data-experience="automatic"] .runs th:nth-child(4),
html[data-experience="automatic"] .runs td:nth-child(4) {
  display: none;
}
.auto-selection {
  padding: 18px;
  border-top: 1px solid var(--line);
}
.auto-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.auto-products > div {
  display: flex;
  gap: 10px;
  font-size: 12px;
  align-items: center;
}
.auto-products img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: white;
  border-radius: 8px;
}
.auto-products small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
@media (max-width: 800px) {
  .editor-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .zones-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 420px) {
  .editor-toolbar {
    grid-template-columns: 1fr;
  }
}
.zone-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}
.zone-table td,
.zone-table th {
  padding: 5px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.zone-table input {
  width: 65px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px;
  font-size: 12px;
}
.zone-table input[type="text"] {
  width: 150px;
}
.zone-table button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--risk);
}
@media (max-width: 800px) {
  .zones-grid {
    grid-template-columns: 1fr;
  }
  .zone-table {
    min-width: 560px;
  }
}
#supplierFilter {
  max-width: 290px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 8px;
}
.supplier-details {
  margin: 10px 0 16px;
  font-size: 13px;
  color: var(--muted);
}
.supplier-details article {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.supplier-details a {
  color: var(--accent);
}
.total b {
  font-size: 14px;
}
