:root {
  --accent: #f05a00;
  --accent-dark: #c64a00;
  --ink: #262728;
  --muted: #6c7278;
  --line: #d9dee2;
  --soft: #f4f5f5;
  --panel: #ffffff;
  --stage: #e6e1dc;
  --good: #00a96b;
  --dark-control: #3d4145;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #f0f2f3;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.utility-nav {
  height: 36px;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #e8ecef;
}

.utility-nav a {
  display: flex;
  align-items: center;
  padding: 0 28px;
  color: #171717;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  border-right: 1px solid #e8ecef;
}

.utility-nav a.active {
  background: #f8f8f8;
}

.brand-row {
  height: 48px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 26px;
}

.menu-button {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #222;
}

.menu-button::after {
  content: "Menü";
  font-size: 20px;
}

.menu-button span {
  width: 16px;
  height: 2px;
  display: block;
  background: #222;
}

.configurator {
  height: calc(100vh - 84px);
  min-height: 620px;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 328px minmax(0, 1fr);
  overflow: hidden;
}

.config-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: var(--panel);
  border-right: 1px solid #cfd5da;
}

.product-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid #dde1e4;
}

.product-button {
  min-height: 92px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 0;
  border-right: 1px solid #e5e8eb;
  background: #fff;
  color: #4c5054;
  font-size: 13px;
  position: relative;
}

.product-button svg {
  width: 56px;
  height: 40px;
  stroke: currentColor;
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-button.selected {
  color: var(--accent);
}

.product-button.selected::after,
.step-tab.selected::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  background: var(--accent);
}

.step-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid #dde1e4;
}

.step-tab {
  min-height: 56px;
  position: relative;
  border: 0;
  border-right: 1px solid #e7eaed;
  background: #fff;
  color: #3e4245;
  display: grid;
  place-items: center;
  gap: 2px;
  font-size: 12px;
}

.step-icon {
  font-size: 19px;
  line-height: 1;
}

.step-tab.selected {
  color: var(--accent);
}

.panel-scroll {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 72px;
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
}

h2,
h3 {
  margin: 0;
  font-weight: 800;
  color: var(--accent);
}

h2 {
  font-size: 18px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--accent);
}

h3 {
  margin-top: 22px;
  font-size: 16px;
}

.hint {
  color: #60676f;
  font-size: 13px;
  line-height: 1.4;
  margin: 8px 0 12px;
}

.option-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.option-grid.two {
  grid-template-columns: 1fr 1fr;
}

.option-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.image-option,
.tile-option {
  min-height: 98px;
  border: 1px solid var(--line);
  background: #fbfbfb;
  color: #2e3337;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 8px;
}

.image-option.selected,
.tile-option.selected,
.image-option:hover,
.tile-option:hover {
  border-color: #1db285;
  box-shadow: inset 0 0 0 1px rgba(29, 178, 133, 0.25);
}

.image-option strong,
.tile-option strong {
  font-size: 13px;
}

.tile-option small {
  color: var(--muted);
  font-weight: 700;
}

.mini-scene {
  width: 76px;
  height: 48px;
  display: block;
  position: relative;
  background: linear-gradient(160deg, #eff6f9, #d7e3eb);
  overflow: hidden;
}

.mini-scene::before,
.mini-scene::after {
  content: "";
  position: absolute;
}

.mini-scene::before {
  left: 14px;
  right: 10px;
  top: 14px;
  height: 8px;
  background: #303638;
  transform: skewY(-12deg);
}

.mini-scene::after {
  left: 20px;
  top: 24px;
  width: 42px;
  height: 22px;
  border-left: 4px solid #303638;
  border-right: 4px solid #303638;
}

.mini-scene.wallbound {
  background: linear-gradient(90deg, #eef2f4 0 36%, #d3d9dd 36% 41%, #eef6f9 41%);
}

.dimension-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.project-grid {
  display: grid;
  gap: 8px;
  margin: 10px 0 16px;
}

.number-row,
.select-row,
.text-row,
.range-row,
.toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #edf0f2;
  padding: 8px 0;
}

.number-row.compact {
  margin-top: 10px;
}

.number-row strong,
.select-row strong,
.text-row strong,
.range-row strong {
  display: block;
  font-size: 13px;
  line-height: 1.18;
}

.number-row small,
.select-row small,
.text-row small,
.range-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.text-row input {
  width: 150px;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  padding: 0 10px;
  background: #fff;
}

.number-control {
  height: 43px;
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(52px, 1fr) auto 38px 38px;
  align-items: stretch;
  border: 1px solid var(--line);
  background: #fff;
}

.number-control.single {
  grid-template-columns: minmax(76px, 1fr) auto;
}

.number-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0 10px;
}

.number-control em {
  display: flex;
  align-items: center;
  color: #4a5055;
  font-style: normal;
  padding-right: 8px;
}

.number-control button {
  border: 0;
  border-left: 1px solid var(--line);
  background: #f8f9fa;
  font-size: 22px;
  color: #384048;
}

.swatch-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.swatch {
  min-height: 62px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 8px 5px;
  font-size: 12px;
  font-weight: 700;
}

.swatch span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--swatch);
  border: 1px solid #b7bdc2;
}

.swatch.selected {
  border-color: #1db285;
}

.roof-sample {
  width: 50px;
  height: 38px;
  display: block;
  transform: skewX(-13deg);
  border: 1px solid rgba(110, 126, 135, 0.28);
}

.roof-sample.clear {
  background: linear-gradient(110deg, rgba(141, 203, 218, 0.35), rgba(255, 255, 255, 0.78), rgba(141, 203, 218, 0.28));
}

.roof-sample.milk {
  background: linear-gradient(110deg, rgba(244, 252, 250, 0.9), rgba(218, 236, 230, 0.75));
}

.roof-sample.poly {
  background: repeating-linear-gradient(100deg, rgba(166, 214, 198, 0.55) 0 5px, rgba(255, 255, 255, 0.7) 5px 9px);
}

.roof-sample.metal {
  background: repeating-linear-gradient(90deg, #c6ccd1 0 6px, #f2f3f3 6px 12px);
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 10px;
  border: 1px solid var(--line);
}

.segmented-control button {
  flex: 1 1 92px;
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #f6f7f7;
  color: #3a4045;
  font-weight: 700;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.selected {
  background: #fff;
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.carport-system-control[hidden] {
  display: none;
}

.bridge-control {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
}

.bridge-control[hidden],
#glassThicknessRow[hidden] {
  display: none;
}

.bridge-control h4 {
  font-size: 13px;
  margin: 0;
}

.toggle-stack {
  display: grid;
  gap: 0;
}

.range-row {
  grid-template-columns: 1fr;
}

.range-row > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.range-row input {
  width: 100%;
  accent-color: var(--accent);
}

.toggle-row {
  grid-template-columns: auto 1fr;
  justify-content: start;
  font-weight: 700;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.list-options {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.select-row select {
  width: 176px;
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 8px;
}

.list-options .select-row,
.list-options .number-row.compact {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 7px;
}

.list-options .select-row select,
.list-options .number-row.compact .number-control {
  width: 100%;
}

.select-row select:disabled,
.toggle-row input:disabled {
  opacity: 0.52;
}

.field-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.field-buttons button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
}

.field-buttons button.selected {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.viewer {
  min-width: 0;
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 42%),
    linear-gradient(135deg, #f7f8f7 0%, #e7ecec 54%, #d6dddd 100%);
}

.viewer-topbar {
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(197, 204, 209, 0.76);
  box-shadow: 0 10px 28px rgba(30, 39, 44, 0.08);
  z-index: 2;
}

.viewer-topbar > div {
  min-width: 0;
}

.viewer-topbar strong {
  color: var(--accent);
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.viewer-topbar span {
  margin-left: 0;
  color: #25282b;
  font-size: 18px;
  font-weight: 800;
}

.viewer-actions {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewer-actions button,
.bottom-tools button {
  min-height: 40px;
  border: 1px solid rgba(185, 193, 198, 0.8);
  background: rgba(255, 255, 255, 0.92);
  color: #3d4247;
  padding: 0 15px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(34, 42, 48, 0.06);
}

.viewer-actions button[aria-pressed="true"],
.bottom-tools button:last-child {
  color: #fff;
  background: var(--dark-control);
}

.canvas-wrap {
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #eef1f1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(91, 105, 112, 0.2);
}

#previewCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#previewCanvas.dragging {
  cursor: grabbing;
}

.canvas-badge {
  position: absolute;
  right: 26px;
  bottom: 78px;
  max-width: min(360px, calc(100% - 52px));
  padding: 9px 12px;
  color: #273038;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(173, 184, 190, 0.72);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(30, 39, 44, 0.1);
}

.bottom-tools {
  position: absolute;
  left: 32px;
  bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  z-index: 2;
}

.bom-dialog {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(25, 27, 28, 0.45);
}

.bom-dialog[hidden] {
  display: none;
}

.bom-sheet {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(166, 173, 179, 0.8);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.24);
}

.bom-header,
.bom-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.bom-header h2 {
  padding-bottom: 0;
  border-bottom: 0;
}

.bom-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.bom-footer button,
.icon-button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  color: #30363b;
  font-weight: 800;
  padding: 0 14px;
}

.bom-footer button:last-child {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.bom-footer button[id*="Drawing"] {
  color: var(--accent);
  background: #f8fbfa;
  border-color: rgba(29, 178, 133, 0.35);
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
}

.section-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.bom-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 18px 22px 8px;
}

.bom-summary div {
  min-height: 70px;
  padding: 12px;
  background: #f5f7f7;
  border-left: 3px solid var(--accent);
}

.bom-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.bom-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.handover-panel {
  margin: 4px 22px 8px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fbfcfc;
}

.handover-route {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.handover-route div {
  min-height: 54px;
  padding: 10px;
  background: #fff;
  border-left: 3px solid #1db285;
}

.handover-route span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.handover-route strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.bom-notices {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.bom-notices li {
  padding: 9px 10px;
  border-left: 3px solid #1db285;
  background: #f2faf7;
  color: #283331;
  font-size: 13px;
  line-height: 1.35;
}

.bom-notices li.warn {
  border-color: #f2a100;
  background: #fff8e8;
}

.bom-notices li.danger {
  border-color: #d64545;
  background: #fff0f0;
}

.drawing-spec-panel {
  display: grid;
  gap: 10px;
  margin: 12px 22px 8px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8fafb;
}

.drawing-spec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawing-spec-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.drawing-spec-header strong {
  color: var(--accent);
  font-size: 13px;
}

.drawing-spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.drawing-spec-card {
  min-height: 76px;
  padding: 10px;
  border-left: 3px solid var(--accent);
  background: #fff;
}

.drawing-spec-card span,
.drawing-spec-card small {
  display: block;
  min-width: 0;
}

.drawing-spec-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.drawing-spec-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.drawing-spec-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.offer-drawing-preview {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.internal-only {
  display: none !important;
}

.offer-drawing-preview svg {
  display: block;
  width: 100%;
  min-width: 820px;
  height: auto;
}

.bom-table-wrap {
  padding: 12px 22px;
  overflow-x: auto;
}

.bom-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.bom-table th,
.bom-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e8ecef;
  text-align: left;
  vertical-align: top;
}

.bom-table th {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
}

.handover-json {
  margin: 0 22px 18px;
  border: 1px solid var(--line);
  background: #f8f9fa;
}

.handover-json summary {
  cursor: pointer;
  padding: 12px;
  font-weight: 800;
}

.handover-json pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

@media (max-width: 760px) {
  .utility-nav {
    overflow-x: auto;
  }

  .brand-row {
    min-height: 48px;
    grid-template-columns: auto 1fr;
  }

  .configurator {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(520px, 1fr);
    overflow: visible;
  }

  .config-panel {
    max-height: none;
  }

  .panel-scroll {
    max-height: 520px;
  }

  .viewer {
    min-height: 620px;
  }

  .viewer-topbar {
    height: auto;
    min-height: 62px;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

  .viewer-actions {
    width: 100%;
    align-self: stretch;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .bottom-tools {
    bottom: 18px;
    left: 18px;
  }

  .bom-dialog {
    padding: 12px;
  }

  .bom-summary {
    grid-template-columns: 1fr 1fr;
  }

  .handover-route,
  .drawing-spec-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand-row {
    padding: 0 16px;
  }

  .product-button {
    min-height: 78px;
    font-size: 11px;
  }

  .product-button svg {
    width: 44px;
  }

  .step-tab {
    font-size: 11px;
  }

  .panel-scroll {
    padding: 16px 14px 70px;
  }

  .option-grid.three {
    grid-template-columns: repeat(2, 1fr);
  }

  .number-row,
  .select-row,
  .text-row {
    grid-template-columns: 1fr;
  }

  .number-control,
  .select-row select,
  .text-row input {
    width: 100%;
  }

  .swatch-row {
    grid-template-columns: 1fr;
  }

  .bom-summary,
  .drawing-spec-grid {
    grid-template-columns: 1fr;
  }
}
