/* Pergola configurator — design system */

:root {
  --ink: #231f20;
  --muted: #66666a;
  --line: #dedfe1;
  --bg: #eff0f2;
  --card: #ffffff;
  --accent: #21b4dc;
  --accent-dark: #1689a9;
  --secondary: #5a5b5e;
  --green: #16a34a;
  --radius: 14px;
  --topbar-h: 62px;
  --panel-w: 600px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body.modal-open { overflow: hidden; }

/* App-like UI: double-tap zoom shifts the fixed topbar/footer layout on
   phones (iOS ignores user-scalable=no, so the viewport meta isn't enough).
   `manipulation` keeps panning/scrolling but kills double-tap zoom; the
   3D canvas keeps its own touch-action: none (id selector wins). */
* { touch-action: manipulation; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  z-index: 40;
}
.topbar::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
}

.brand { display: flex; align-items: center; min-width: 0; }
.brand img { height: 34px; width: auto; display: block; }

.topbar-badges {
  display: flex;
  gap: 14px;
  margin-left: 6px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}
.topbar-badges span { display: inline-flex; align-items: center; gap: 5px; }
.topbar-badges b { color: var(--ink); font-weight: 600; }

/* language switcher */
.lang-switch { position: relative; margin-left: auto; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lang-btn:hover { border-color: var(--accent); }
.lang-flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
  flex: none;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}
.lang-flag svg { width: 100%; height: 100%; display: block; }
.lang-btn > svg { color: var(--muted); }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
  min-width: 116px;
}
.lang-menu[hidden] { display: none; }
.lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}
.lang-item:hover { background: #f1f5f9; }
.lang-item--active { background: #e8f8fc; color: var(--accent-dark); }

.topbar-phone {
  margin-left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.topbar-phone:hover { border-color: var(--accent); }
.topbar-phone svg { flex: none; }

/* ---------------------------------------------------------------- layout */

.layout {
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  display: flex;
}

.viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  /* Promote to its own GPU layer so the canvas doesn't repaint with the
     scrolling panel — kills the flicker on mobile. */
  transform: translateZ(0);
  backface-visibility: hidden;
  /* Stop the browser from treating a rotate-drag as a text selection
     (the blue "copy" highlight) on touch + desktop. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.panel {
  width: var(--panel-w);
  flex: none;
  background: var(--card);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: width 0.25s ease;
}

/* Summary step: the form is the goal — give the panel ~20% more room. */
.layout.is-summary .panel { width: 680px; }

.panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 24px 30px;
  scroll-behavior: smooth;
}
.panel-body * { max-width: 100%; }

.panel-title {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.panel-sub {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ------------------------------------------------------------- steps nav */

.steps {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 15px 20px 13px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 7px;
  border-radius: 8px;
  flex: none;
  transition: background 0.15s, color 0.15s;
}
.step:not(:disabled):hover { background: #f1f5f9; }
.step:disabled { opacity: 0.5; cursor: default; }

.step-num {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.step--active { color: var(--ink); }
.step--active .step-num { background: var(--accent); color: #fff; }
.step--done { color: var(--ink); }
.step--done .step-num { background: #dcfce7; color: var(--green); }

/* Connector line between steps grows to fill, like a progress rail. */
.step-sep {
  flex: 1 1 auto;
  height: 2px;
  border-radius: 1px;
  background: var(--line);
  min-width: 10px;
}

/* ------------------------------------------------------------ cards/opts */

.card-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.card-grid--2 { grid-template-columns: 1fr 1fr; }

.card {
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.card:hover { border-color: #e3a6a8; box-shadow: var(--shadow); }
.card--active { border-color: var(--accent); }

.card-img {
  width: 100%;
  aspect-ratio: 16 / 7.5;
  object-fit: cover;
  background: #f1f5f9;
}
.card-grid--2 .card-img { aspect-ratio: 4 / 3; }

.card-body { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; }
.card-name { font-weight: 600; font-size: 14.5px; }
.card-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.opt-price {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 3px;
  white-space: nowrap;
}
.opt-price--free { color: var(--green); }

/* ---------------------------------------------------------- sections */

.section { margin-bottom: 26px; }
.section:last-child { margin-bottom: 6px; }
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  margin: 0 0 11px;
}
.section-hint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 11px 0 0;
}

/* ------------------------------------------------------- type tiles */

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

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  border: 2px solid var(--line);
  border-radius: 13px;
  padding: 10px 8px 11px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.08s;
}
.tile:hover { border-color: #e3a6a8; }
.tile:active { transform: translateY(1px); }
.tile--active { border-color: var(--accent); }

.tile-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 9px;
  background: #f1f5f9;
}
.tile-img--wide { aspect-ratio: 4 / 3; }
.tile-name { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.tile .opt-price { margin-top: 0; font-size: 11.5px; }

/* size grid */
.size-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.size-btn {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 11px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.size-btn:hover { border-color: #e3a6a8; }
.size-btn--active { border-color: var(--accent); }
.size-dim { font-weight: 700; font-size: 14px; }
.size-area { font-size: 11.5px; color: var(--muted); }

/* accessories — vertical checklist */
.acc-list { display: flex; flex-direction: column; gap: 8px; }
.acc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.acc-row:hover { border-color: #e3a6a8; }
.acc-row--active { border-color: var(--accent); background: rgba(220, 31, 59, 0.05); }
.acc-thumb {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 9px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.acc-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acc-thumb-icon { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 22px; }
.acc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.acc-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.acc-desc { font-size: 12px; color: var(--muted); line-height: 1.35; }
.acc-price-wrap { flex: none; }
.acc-price-wrap .opt-price { position: static; }
.acc-check {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid var(--line);
  background: #fff;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.acc-row--active .acc-check { border-color: var(--accent); background: var(--accent); }
.acc-check::after {
  content: '';
  position: absolute;
  left: 7px; top: 3px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.15s;
}
.acc-row--active .acc-check::after { opacity: 1; }

/* sliders */
.sliders { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.slider-row {
  display: grid;
  grid-template-columns: 110px 1fr 64px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.slider-label { color: var(--muted); font-weight: 500; }
.slider-value { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #dbe4f0;
  outline: none;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
  cursor: grab;
}
input[type='range']::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
  cursor: grab;
}

/* notes */
.note {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 14px 0 0;
}
.note--tip {
  background: #e8f8fc;
  border: 1px solid #d8e6ff;
  border-radius: 10px;
  padding: 10px 13px;
  color: #1e3a8a;
}

/* top-view plan — clickable sides around the pergola */
.plan {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  grid-template-rows: 58px 1fr 58px;
  gap: 7px;
  height: 214px;
  margin: 8px 0 20px;
}
.plan-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  min-width: 0;
  padding: 4px;
  text-align: center;
}
.plan-corner { background: transparent; }
.plan-center {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  color: #475569;
  gap: 1px;
}
.plan-center span { font-weight: 700; font-size: 12px; }
.plan-center small { font-size: 10px; color: var(--muted); }
.plan-edge {
  border: 2px solid var(--line);
  background: #fff;
  gap: 2px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.plan-edge:hover { border-color: #e3a6a8; }
.plan-edge--active { border-color: var(--accent); background: #e8f8fc; }
.plan-edge-name { font-weight: 700; font-size: 12.5px; line-height: 1.1; }
.plan-edge-status { font-size: 10.5px; font-weight: 600; color: var(--accent); line-height: 1.15; }
.plan-edge-status--open { color: #94a3b8; font-weight: 500; }
.plan-wall {
  background: repeating-linear-gradient(45deg, #eef2f7 0 7px, #e2e8f0 7px 14px);
  border: 1px solid var(--line);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

/* side chips (legacy, no longer used) */
.side-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  position: relative;
  padding: 9px 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  transition: border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chip:hover { border-color: #e3a6a8; }
.chip--active { border-color: var(--accent); background: #e8f8fc; }
.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

/* hint + locked state shown until a side is picked in the plan */
.fill-hint {
  margin: 4px 0 12px;
  padding: 11px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: repeating-linear-gradient(45deg, #eef2f7 0 8px, #f7fafc 8px 16px);
  color: #64748b;
  font-size: 12.5px;
  font-weight: 600;
}
.opt-grid--locked .opt-card {
  opacity: 0.5;
  filter: grayscale(0.7);
  cursor: not-allowed;
}
.opt-grid--locked .opt-card:hover {
  border-color: var(--line);
  box-shadow: none;
}
.opt-grid--locked .opt-card:active { transform: none; }

/* option groups */
.opt-group { margin-bottom: 20px; }
.opt-group-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin: 0 0 10px;
}

/* option cards — 3 per row (matches the production /pergoly layout) */
.opt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.opt-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.08s;
}
.opt-card:hover { border-color: #e3a6a8; box-shadow: var(--shadow); }
.opt-card:active { transform: translateY(1px); }
.opt-card--active { border-color: var(--accent); }

.opt-card-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
}
.opt-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.opt-card-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #f1f5f9;
}
.opt-card-ph--open {
  color: #64748b;
  background:
    repeating-linear-gradient(45deg, #eef2f7 0 8px, #f7fafc 8px 16px);
  border: 1px dashed #cbd5e1;
}
.opt-card-check {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}
.opt-card-body { padding: 8px 8px 9px; display: flex; flex-direction: column; gap: 2px; text-align: center; }
.opt-card-name { font-size: 12px; font-weight: 600; line-height: 1.2; }

/* legacy option rows (kept for safety; no longer used) */
.opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 13px;
  background: #fff;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.opt:hover { border-color: #e3a6a8; }
.opt--active { border-color: var(--accent); background: #fdf1f1; }
.opt-img {
  width: 52px;
  height: 40px;
  object-fit: cover;
  border-radius: 7px;
  background: #f1f5f9;
  flex: none;
}
.opt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.opt-name { font-size: 13.5px; font-weight: 600; }
.opt-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.opt .opt-price { margin: 0; }
.opt-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  flex: none;
  position: relative;
  transition: border-color 0.15s;
}
.opt--active .opt-radio { border-color: var(--accent); }
.opt--active .opt-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}

/* swatches */
.swatch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.swatch {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.swatch:hover { border-color: #e3a6a8; }
.swatch--active { border-color: var(--accent); }
.swatch-color {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: inset 0 -6px 14px rgba(255, 255, 255, 0.25), inset 0 4px 8px rgba(0, 0, 0, 0.18);
}
/* custom (RAL) — rainbow disc to signal "pick any colour" */
.swatch-color--custom {
  background: conic-gradient(#ef4444, #f59e0b, #eab308, #22c55e, #3b82f6, #8b5cf6, #ec4899, #ef4444);
}
.swatch-name { font-size: 12.5px; font-weight: 600; text-align: center; line-height: 1.2; }

/* custom colour picker — shown only when "Vlastní (RAL)" is selected */
.custom-color {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.custom-color[hidden] { display: none; }
.custom-color input[type='color'] {
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  flex: none;
  box-shadow: 0 0 0 1px var(--line), inset 0 0 0 2px #fff;
}
.custom-color input[type='color']::-webkit-color-swatch-wrapper { padding: 0; }
.custom-color input[type='color']::-webkit-color-swatch { border: none; border-radius: 50%; }
.custom-color input[type='color']::-moz-color-swatch { border: none; border-radius: 50%; }
.custom-input {
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.custom-input:focus { border-color: var(--accent); }
#custom-hex-input { width: 108px; font-variant-numeric: tabular-nums; text-transform: uppercase; }
.custom-input--ral { flex: 1; min-width: 130px; }

/* ---------------------------------------------------------------- recap */

.recap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.recap-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.recap-row:last-child { border-bottom: none; }
.recap-label { color: var(--muted); width: 72px; flex: none; }
.recap-value { flex: 1; font-weight: 600; line-height: 1.4; }
.recap-edit {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  flex: none;
}
.recap-edit:hover { text-decoration: underline; }

.price-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 22px;
}
.price-box--hidden {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13.5px;
  background: #e8f8fc;
  border-color: #d8e6ff;
}
.price-box--hidden span { color: #3b5384; line-height: 1.5; }
.price-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
  padding: 4px 0;
  color: #334155;
}
.price-row span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-row--sub {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 8px;
  color: var(--muted);
}
.price-row--sub + .price-row--sub { border-top: none; margin-top: 0; padding-top: 2px; }
.price-row--total {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
  border-top: 2px solid var(--ink);
  margin-top: 8px;
  padding-top: 10px;
}

/* ---------------------------------------------------------------- form */

.lead-form {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: #59595b; /* logo grey */
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.28);
  margin: 4px 0 28px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.form-head {
  background: linear-gradient(135deg, #646467 0%, #4b4b4e 100%);
  color: #fff;
  padding: 18px 20px 20px;
}
.form-body { padding: 18px 20px 20px; background: #59595b; }
.form-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.form-title { margin: 0 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; color: #fff; }
.form-lead { margin: 0; font-size: 13px; line-height: 1.55; color: rgba(255, 255, 255, 0.9); }
.form-lead strong { color: #fff; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field--full { grid-column: 1 / -1; }
.field span { font-size: 12px; font-weight: 700; color: #fff; }
.field input,
.field textarea {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
}

.gdpr {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.5;
  margin: 14px 0;
  cursor: pointer;
}
.gdpr input { margin-top: 2px; accent-color: #fff; width: 16px; height: 16px; flex: none; }

.form-trust {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin: 10px 0 0;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 11px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.08s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-dark); }
.btn--primary:disabled { opacity: 0.6; cursor: wait; }
.btn--ghost {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink);
}
.btn--ghost:hover { border-color: #e3a6a8; }
.btn--big { width: 100%; padding: 14px 18px; font-size: 15px; }

/* Submit button sits on the grey form — brand red so it pops as the CTA. */
.lead-form #submit-btn {
  background: var(--accent);
  color: #fff;
}
.lead-form #submit-btn:hover { background: var(--accent-dark); }

/* --------------------------------------------------------------- footer */

.panel-footer {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  z-index: 5;
}
.footer-left { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.footer-price {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}
.footer-price-note,
.footer-price-label { font-size: 11px; color: var(--muted); line-height: 1.35; }
.footer-price-label { font-weight: 500; }
.footer-step { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.footer-right { display: flex; gap: 8px; flex: none; }

.price-pulse { animation: pricePulse 0.6s ease; }
@keyframes pricePulse {
  0% { color: var(--accent); transform: scale(1); }
  30% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* --------------------------------------------------------- viewport UI */

/* AR / AI action cards, top-left overlay (matches production layout). */
.viewport-actions {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 10px;
  z-index: 10;
  max-width: calc(100% - 28px);
}

.vaction {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px 13px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.08s;
  min-width: 0;
}
.vaction:hover { border-color: var(--accent); }
.vaction:active { transform: translateY(1px); }
.vaction-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #e8f8fc;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.vaction-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vaction-text strong { font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.vaction-text span { font-size: 11px; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.vtool {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 13px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, background 0.15s;
}
.vtool:hover { border-color: var(--accent); }
.vtool--on { border-color: var(--accent); background: #e8f8fc; color: var(--accent-dark); }

.lamella-control {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.lamella-control input { width: 130px; }

.viewport-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 11.5px;
  padding: 6px 13px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 9;
  animation: hintFade 9s forwards;
  white-space: nowrap;
}
@keyframes hintFade {
  0%, 80% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

.demo-banner {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 9px;
  padding: 7px 11px;
  max-width: 260px;
  line-height: 1.45;
}

/* --------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  position: relative;
  background: #fff;
  border-radius: 18px;
  max-width: 480px;
  width: 100%;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
  animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal--wide { max-width: 640px; }
@keyframes popIn { from { opacity: 0; transform: scale(0.94) translateY(8px); } }

.modal-content { padding: 24px; }
.modal-content h3 { margin: 0 0 10px; font-size: 18px; }
.modal-content p { font-size: 13.5px; line-height: 1.6; color: #334155; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.modal-close:hover { background: #e2e8f0; }

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #dbe4f0;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 8px auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* malý spinner uvnitř tlačítka (Spustit AR režim → načítání modelu) */
.spinner--btn {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  margin: 0 9px -2px 0;
  vertical-align: middle;
}

/* AR v in-app prohlížeči (Instagram…): kopírování odkazu */
.ar-note { font-size: 13px; color: #64748b; margin-top: 12px; }
.ar-copied { font-size: 14px; color: #166534; margin-top: 12px; }
.ar-linkbox {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  font-size: 12px;
  color: #334155;
}
#inapp-copy { width: 100%; }

#ar-status { text-align: center; padding: 6px 0; }
.ar-steps { text-align: left; font-size: 13.5px; line-height: 1.7; color: #334155; padding-left: 20px; margin: 10px 0 18px; }
.qr-box { display: flex; justify-content: center; margin: 16px 0; }
.qr-box svg { border: 1px solid var(--line); border-radius: 12px; }
#copy-link { width: 100%; }

/* AI modal */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border: 2px dashed #e3a6a8;
  border-radius: 14px;
  background: #fdf1f1;
  padding: 34px 18px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  font-size: 13px;
  color: var(--muted);
}
.upload-zone strong { color: var(--ink); font-size: 15px; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: #e8f8fc; }
.upload-icon { font-size: 30px; }

.ai-instruct { font-size: 13px; color: #334155; margin: 0 0 10px; }
.ai-canvas-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: crosshair;
  line-height: 0;
}
.ai-canvas-wrap img { width: 100%; height: auto; pointer-events: none; }
.ai-rect {
  position: absolute;
  border: 3px solid #ff00ff;
  background: rgba(255, 0, 255, 0.12);
  pointer-events: none;
}
.ai-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ai-actions .btn { flex: 1; }
.ai-progress { text-align: center; padding: 22px 0; }
.ai-result { width: 100%; border-radius: 12px; display: block; }

/* -------------------------------------------------------------- success */

.success { text-align: center; padding: 26px 4px; }
.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #dcfce7;
  color: var(--green);
  font-size: 30px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  animation: popIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
.success h2 { margin: 0 0 8px; font-size: 22px; }
.success p { font-size: 14px; color: #334155; line-height: 1.6; }
.success-id { font-size: 13px; color: var(--muted); }
.success .btn--big { margin: 14px 0; }
.success .btn--ghost { margin-top: 18px; }

/* ----------------------------------------------------- trust components */

.next-steps { margin: 0 0 24px; }
.next-steps h3 { font-size: 15px; margin: 0 0 12px; }
.next-steps ol {
  list-style: none;
  counter-reset: ns;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.next-steps li {
  counter-increment: ns;
  position: relative;
  padding-left: 42px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.next-steps li::before {
  content: counter(ns);
  position: absolute;
  left: 0;
  top: 1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8f8fc;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.next-steps strong { font-size: 13.5px; }
.next-steps span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.rep-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
  background: #f8fafc;
}
.rep-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
}
.rep-avatar--logo {
  width: 132px;
  height: 48px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  padding: 7px;
}
.rep-info { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.rep-info strong { font-size: 14px; }
.rep-info span { font-size: 11.5px; color: var(--muted); }
.rep-info a { font-size: 12.5px; color: var(--accent); text-decoration: none; font-weight: 600; }
.rep-info a:hover { text-decoration: underline; }
.rep-rating {
  flex: none;
  text-align: center;
  font-weight: 800;
  font-size: 16px;
  color: #f59e0b;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.rep-rating span { font-size: 10.5px; color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------- chatbot */

.chatbot {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.chatbot-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #0f172a;
  border-bottom: 1px solid var(--line);
}
.chatbot-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e8f8fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex: none;
}
.chatbot-headtext { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.chatbot-headtext strong { font-size: 13px; line-height: 1.2; }
.chatbot-headtext span { font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.chatbot-status {
  flex: none;
  font-size: 10px;
  font-weight: 600;
  color: #059669;
  padding-left: 14px;
  position: relative;
}
.chatbot-status::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: chat-pulse 2s infinite;
}
@keyframes chat-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.chatbot-msgs {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px;
  max-height: 210px;
  overflow-y: auto;
  background: #fff;
}
.chat-msg {
  max-width: 88%;
  padding: 7px 11px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg--bot {
  align-self: flex-start;
  background: #f4f6f9;
  color: #1f2937;
  border-bottom-left-radius: 4px;
}
.chat-msg--user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg--typing { color: var(--muted); letter-spacing: 2px; animation: chat-blink 1.1s infinite; }
@keyframes chat-blink { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

.chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 11px 2px;
}
.chat-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chat-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.chatbot-input {
  display: flex;
  gap: 7px;
  padding: 10px 11px;
  border-top: 1px solid var(--line);
}
.chatbot-input input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
}
.chatbot-input input:focus { border-color: var(--accent); }
.chatbot-input button {
  flex: none;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
}
.chatbot-input button:hover { filter: brightness(1.08); }
.chatbot-input button:active { transform: scale(0.94); }

/* ---- floating AI assistant (bottom-right of the 3D viewport) ---- */
.chat-fab {
  position: absolute; right: 18px; bottom: 18px; z-index: 14;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.28);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.chat-fab:hover { background: var(--accent-dark); }
.chat-fab:active { transform: scale(0.94); }
.chat-fab .fab-close { display: none; }
body.chat-open .chat-fab .fab-open { display: none; }
body.chat-open .chat-fab .fab-close { display: block; }

/* teaser bubble by the chat FAB */
.chat-bubble {
  position: absolute; right: 84px; bottom: 24px; z-index: 14;
  max-width: 230px; background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 11px 30px 11px 14px; font-size: 13px; line-height: 1.45;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.2); cursor: pointer;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.chat-bubble.show { opacity: 1; transform: none; pointer-events: auto; }
.chat-bubble b { color: var(--accent); }
.chat-bubble::after {
  content: ''; position: absolute; right: -7px; bottom: 16px;
  width: 13px; height: 13px; background: #fff;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: rotate(-45deg);
}
.chat-bubble-x { position: absolute; top: 4px; right: 5px; width: 20px; height: 20px; border: none; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; border-radius: 50%; }
.chat-bubble-x:hover { background: #f1f5f4; }
body.chat-open .chat-bubble { opacity: 0 !important; pointer-events: none !important; }

.chat-panel {
  position: absolute; right: 18px; bottom: 86px; z-index: 14;
  width: 360px; max-width: calc(100% - 36px);
  height: 470px; max-height: calc(100% - 110px);
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(12px) scale(0.98); transform-origin: bottom right;
  pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
body.chat-open .chat-panel { opacity: 1; transform: none; pointer-events: auto; }
.chat-panel .chatbot-head { background: var(--accent); color: #fff; border-bottom: none; }
.chat-panel .chatbot-avatar { background: rgba(255, 255, 255, 0.18); }
.chat-panel .chatbot-headtext strong { color: #fff; }
.chat-panel .chatbot-headtext span { color: rgba(255, 255, 255, 0.82); }
.chat-panel .chatbot-status { color: #d1fae5; }
.chat-panel .chatbot-msgs { flex: 1; min-height: 0; max-height: none; }

/* --------------------------------------------------------------- toasts */

#toast-root {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 30px);
}
.toast {
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  padding: 11px 17px;
  border-radius: 11px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
  max-width: 420px;
}
.toast--in { opacity: 1; transform: translateY(0); }
.toast-btn {
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.toast-btn:hover { background: rgba(255, 255, 255, 0.28); }

/* --------------------------------------------------------------- loader */

#loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: opacity 0.45s;
}
#loader img { height: 44px; }
.loader--hide { opacity: 0; pointer-events: none; }
.loader-bar {
  width: 150px;
  height: 4px;
  border-radius: 2px;
  background: #dbe4f0;
  overflow: hidden;
}
.loader-bar::after {
  content: '';
  display: block;
  width: 45%;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  animation: loaderSlide 1.1s ease-in-out infinite;
}
@keyframes loaderSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(340%); }
}

/* --------------------------------------------------------------- mobile */

@media (max-width: 900px) {
  :root { --topbar-h: 54px; }

  .topbar { padding: 0 14px; gap: 10px; }
  .brand img { height: 28px; }
  .topbar-badges { display: none; }
  .topbar-phone { padding: 8px 11px; font-size: 13px; margin-left: 8px; }
  .topbar-phone .phone-label { display: none; }
  .lang-btn { padding: 7px 9px; font-size: 12.5px; gap: 4px; }
  .lang-btn > svg { display: none; } /* hide only the chevron, keep the flag */

  .layout {
    flex-direction: column;
    position: static;
    margin-top: var(--topbar-h);
  }

  .viewport {
    position: sticky;
    top: var(--topbar-h);
    /* svh (small viewport) is stable — it does NOT change as the mobile URL
       bar shows/hides during scroll, so the canvas keeps a constant size. */
    height: 42svh;
    min-height: 260px;
    flex: none;
    z-index: 8;
    border-bottom: 1px solid var(--line);
  }

  .panel {
    width: 100%;
    border-left: none;
    min-height: 58svh;
    max-width: 100%;
    overflow-x: hidden;
    padding-bottom: 80px; /* room for fixed footer */
  }

  .panel-body { overflow: visible; padding: 18px 15px 28px; max-width: 100%; }
  .panel-body * { max-width: 100%; }

  .steps { padding: 12px 14px 10px; gap: 4px; }
  .step { font-size: 12px; padding: 4px 5px; gap: 6px; }
  .step-num { width: 21px; height: 21px; font-size: 11px; }

  .panel-footer {
    position: fixed;
    inset: auto 0 0 0;
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.1);
    padding: 11px 14px;
    padding-bottom: max(11px, env(safe-area-inset-bottom));
    gap: 10px;
  }
  .footer-price-label { font-size: 10.5px; }
  .footer-right .btn { padding: 11px 15px; }

  /* AR / AI actions: a thin solid toolbar fused to the topbar — full-width
     white strip so the buttons read as part of the header, not as floating
     rounded cards awkwardly touching its edge. */
  .viewport-actions {
    top: 0;
    left: 0;
    right: 0;
    max-width: none;
    gap: 8px;
    padding: 7px 8px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
  .vaction { flex: 1; padding: 7px 10px; gap: 8px; justify-content: flex-start; border-radius: 10px; box-shadow: none; }
  .vaction-icon { width: 30px; height: 30px; }
  .vaction-text strong { font-size: 11.5px; white-space: normal; line-height: 1.15; }
  .vaction-text span { display: none; }

  /* Solid backgrounds instead of backdrop-blur — blur over the animating
     WebGL canvas triggers continuous repaints and visible flicker on mobile. */
  .topbar { background: #fff; backdrop-filter: none; }
  .vaction { background: #f8fafc; backdrop-filter: none; }
  .lamella-control { background: #fff; backdrop-filter: none; }

  .lamella-control { left: 10px; bottom: 10px; padding: 8px 11px; }
  .lamella-control input { width: 96px; }
  .lamella-label-text { display: none; }

  /* hide the rotate hint on mobile — it overlapped the lamella slider and
     "kolečkem přibližujte" doesn't apply on touch anyway */
  .viewport-hint { display: none; }

  .demo-banner { display: none; }

  /* AI chat on phones: it's moved to <body> (see placeChat) and becomes a
     full-width bottom sheet floating above the fixed footer bar. */
  .chat-fab { position: fixed; right: 14px; bottom: 70px; width: 52px; height: 52px; z-index: 45; }
  .chat-panel {
    position: fixed; left: 8px; right: 8px; bottom: 130px; top: auto;
    width: auto; max-width: none; height: auto;
    max-height: calc(100svh - var(--topbar-h) - 150px); z-index: 46; border-radius: 16px;
  }
  .chat-bubble { display: none !important; }

  .tile-grid { gap: 8px; }
  .tile { padding: 8px 6px 9px; border-radius: 11px; }
  .tile-name { font-size: 11.5px; }
  .size-grid { grid-template-columns: repeat(2, 1fr); }

  /* Prevent iOS auto-zoom when focusing a field: inputs must be >= 16px. */
  .field input, .field textarea { font-size: 16px; }

  /* Summary step on mobile: drop the 3D preview, the panel takes the screen. */
  .layout.is-summary .viewport { display: none; }
  .layout.is-summary .panel { min-height: calc(100svh - var(--topbar-h)); }
  .form-grid { grid-template-columns: 1fr; }
  .slider-row { grid-template-columns: 84px 1fr 58px; }
}

@media (max-width: 380px) {
  .vaction-icon { display: none; }
  .size-grid { grid-template-columns: repeat(2, 1fr); }
}
