:root {
  --navy: #14283d;
  --navy-2: #23455f;
  --ink: #1c2f40;
  --muted: #617487;
  --bg: #f2f5f7;
  --panel: #fff;
  --line: #dce5eb;
  --orange: #ed8547;
  --orange-dark: #c8642d;
  --teal: #087a70;
  --green: #236848;
  --green-bg: #e8f5ed;
  --blue-bg: #eaf2f7;
  --shadow: 0 9px 28px rgba(25, 46, 63, .07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button, label.upload { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid #78bdd0;
  outline-offset: 3px;
}

.app-header {
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, rgba(237, 133, 71, .19), transparent 27%),
    linear-gradient(122deg, var(--navy), #25465f);
  padding: 17px max(16px, calc((100vw - 1440px) / 2)) 29px;
}

.topbar, .hero, .chapter-nav { max-width: 1440px; margin-inline: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.brand-logo { display: block; padding: 4px 10px; border-radius: 10px; background: #fff; box-shadow: 0 3px 13px rgba(0,0,0,.14); }
.brand-logo img { display: block; width: 190px; height: auto; max-height: 76px; object-fit: contain; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--orange);
  color: var(--navy);
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
  box-shadow: 0 4px 13px rgba(0, 0, 0, .18);
}

.brand strong { display: block; letter-spacing: .08em; font-size: 19px; }
.brand small { display: block; margin-top: 2px; color: #bcd0dd; font-size: 9px; letter-spacing: .15em; }
.privacy { color: #d9e6ee; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 7px 11px; font-size: 11px; }

.chapter-nav {
  display: flex;
  width: max-content;
  max-width: 100%;
  gap: 4px;
  margin-top: 20px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
}

.chapter-nav a {
  color: #d5e3eb;
  text-decoration: none;
  font-size: 12px;
  font-weight: 760;
  padding: 9px 13px;
  border-radius: 8px;
  white-space: nowrap;
}

.chapter-nav a[aria-current="page"] { color: var(--navy); background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.14); }

.hero { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-top: 24px; }
.eyebrow { color: #ffb182; font-size: 11px; font-weight: 850; letter-spacing: .13em; }
.hero h1 { margin: 7px 0 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1.07; letter-spacing: -.035em; }
.hero p { max-width: 760px; margin: 0; color: #d5e2e9; font-size: 14px; line-height: 1.55; }
.catalogue-summary { flex: 0 0 auto; min-width: 148px; padding: 15px 18px; border: 1px solid rgba(255,255,255,.17); border-radius: 14px; background: rgba(255,255,255,.09); }
.catalogue-summary strong { display: block; color: #fff; font-size: 30px; line-height: 1; }
.catalogue-summary span { display: block; margin-top: 5px; color: #c9d9e3; font-size: 11px; }

.page { max-width: 1472px; margin: 0 auto; padding: 18px 16px 28px; }
.app-alert { margin-bottom: 12px; padding: 11px 14px; border: 1px solid #c9dce7; border-radius: 11px; background: var(--blue-bg); color: #2f536a; font-size: 12px; font-weight: 680; }
.app-alert.success { color: #245c44; background: var(--green-bg); border-color: #bbdec9; }
.app-alert.error { color: #8a3a2e; background: #fff0ed; border-color: #f1c4ba; }

.workspace { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 16px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.panel-title > div, .color-heading > div, .workflow-section-title > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.panel-title h2, .color-heading h3, .workflow-section-title h3 { margin: 0; font-size: 16px; line-height: 1.2; }
.step { display: inline-grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 850; }
.counter, .status-pill { color: #526c7f; background: #edf3f6; border-radius: 999px; padding: 6px 9px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-pill.ready { color: #236348; background: var(--green-bg); }
.panel-body { padding: 16px; }

.field-label { display: block; margin: 13px 0 6px; color: #344c5e; font-size: 12px; font-weight: 800; }
.field-label:first-child { margin-top: 0; }
.field { width: 100%; height: 44px; border: 1px solid #cbd8e1; border-radius: 10px; background: #fff; color: var(--ink); padding: 0 11px; font-size: 13px; }
.search-wrap { position: relative; }
.search-wrap span { position: absolute; left: 12px; top: 50%; transform: translateY(-52%); color: #6c7d8c; font-size: 20px; pointer-events: none; }
.search-wrap .field { padding-left: 38px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 15px 1px 8px; color: var(--muted); font-size: 10px; }
.list-head strong { color: var(--ink); font-size: 12px; }

.model-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 640px; padding: 1px 4px 1px 1px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.model-card { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); text-align: left; content-visibility: auto; contain-intrinsic-size: 130px; }
.model-card:hover { border-color: #9db7c8; background: #f8fbfc; }
.model-card[aria-pressed="true"] { border: 2px solid var(--orange); padding: 7px; background: #fff7f1; box-shadow: 0 0 0 2px rgba(237,133,71,.12); }
.model-card img { display: block; width: 100%; height: 108px; border-radius: 7px; background: linear-gradient(#f4f5f6,#e7ebed); object-fit: contain; }
.model-card strong { display: block; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.model-card span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.model-card .photo-ok { color: var(--green); }
.empty, .loading { grid-column: 1 / -1; padding: 24px 12px; border: 1px dashed #cbd8e1; border-radius: 11px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.5; }

.button { min-height: 40px; border: 1px solid #c3d1db; border-radius: 10px; background: #fff; color: #29465a; padding: 9px 12px; font-size: 12px; font-weight: 800; }
.button:hover:not(:disabled) { filter: brightness(.975); }
.button.primary { border-color: var(--navy); background: var(--navy); color: #fff; }
.button.secondary { background: #f8fafb; }
.button.lock { border-color: #2d5872; background: #2d5872; color: #fff; }
.button.lock[aria-pressed="true"] { border-color: #80ba96; background: var(--green-bg); color: #1b6341; }
.button.full { width: 100%; margin-top: 9px; }
.upload { position: relative; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.selected-model { display: flex; align-items: center; gap: 11px; min-height: 64px; margin-bottom: 12px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.selected-thumb { display: grid; place-items: center; flex: 0 0 auto; width: 47px; height: 47px; border-radius: 8px; background: #e8edf0; color: #738391; overflow: hidden; }
.selected-thumb img { width: 100%; height: 100%; object-fit: contain; }
.selected-model strong { display: block; font-size: 13px; }
.selected-model span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }

.photo-toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.upload-group { display: flex; gap: 7px; }
.photo-placeholder { display: grid; place-items: center; min-height: 380px; padding: 35px 18px; border: 2px dashed #c9d5dc; border-radius: 13px; background: linear-gradient(145deg,#f8fafb,#eef3f5); text-align: center; }
.photo-placeholder .house-glyph { color: #9aacb8; font-size: 78px; line-height: .9; }
.photo-placeholder strong { margin-top: 9px; font-size: 17px; }
.photo-placeholder p { max-width: 470px; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.stage-wrap { display: grid; justify-items: center; min-width: 0; }
.photo-stage { position: relative; width: 100%; max-width: 100%; border-radius: 13px; background: #162431; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.photo-stage.is-editing { touch-action: none; }
.facade-photo { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.door-overlay { position: absolute; z-index: 4; transform: translate(-50%,-50%); overflow: visible; touch-action: none; cursor: grab; outline: 2px solid rgba(255,255,255,.9); outline-offset: 1px; box-shadow: 0 5px 20px rgba(0,0,0,.4); }
.door-overlay:active { cursor: grabbing; }
.door-overlay > img { display: block; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: fill; transform-origin: 0 0; backface-visibility: hidden; will-change: transform; pointer-events: none; }
.corner { position: absolute; z-index: 8; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; border-radius: 50%; background: transparent; touch-action: none; }
.corner::after { content: ""; position: absolute; inset: 10px; border: 3px solid var(--orange); border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(0,0,0,.4); }
.photo-stage.is-perspective:not(.is-locked) .corner::after { background: #fff3e7; }
.photo-stage.is-locked .door-overlay { cursor: default; outline: 0; box-shadow: 0 3px 14px rgba(0,0,0,.28); }
.photo-stage.is-locked .corner, .photo-stage.mode-before .door-overlay, .photo-stage.mode-before .split-line { display: none !important; }
.photo-stage.mode-compare .door-overlay { cursor: default; outline: 0; box-shadow: none; }
.photo-stage.mode-compare .corner { display: none; }
.split-line { position: absolute; z-index: 12; top: 0; bottom: 0; left: 50%; display: none; width: 3px; background: #fff; box-shadow: 0 0 0 1px #17354c,0 0 13px rgba(16,33,47,.45); touch-action: none; cursor: ew-resize; }
.split-line::before { content: ""; position: absolute; top: 0; bottom: 0; left: -20px; width: 43px; }
.split-line span { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 46px; height: 46px; transform: translate(-50%,-50%); border-radius: 50%; background: #fff; color: var(--navy); box-shadow: 0 2px 13px rgba(0,0,0,.28); font-size: 23px; font-weight: 900; white-space: nowrap; }
.photo-stage.mode-compare .split-line { display: block; }
.view-label { position: absolute; z-index: 14; top: 9px; right: 9px; padding: 6px 9px; border-radius: 6px; background: rgba(20,40,61,.92); color: #fff; font-size: 10px; font-weight: 850; letter-spacing: .08em; pointer-events: none; }
.compare-help { margin: 7px 0 0; color: var(--muted); text-align: center; font-size: 11px; font-weight: 650; }

.view-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 11px; padding: 4px; border-radius: 12px; background: #eaf0f4; }
.segmented { flex: 0 1 92px; min-height: 38px; border: 0; border-radius: 8px; background: transparent; color: #536b7c; font-size: 12px; font-weight: 800; }
.segmented[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(23,43,58,.12); }
.view-actions .export { margin-left: auto; }
.edit-status { margin-top: 10px; padding: 10px 12px; border: 1px solid #c8dce7; border-radius: 9px; background: var(--blue-bg); color: #2e5167; font-size: 11px; font-weight: 680; line-height: 1.45; }
.edit-status.locked { border-color: #9bc9ad; background: var(--green-bg); color: #225e40; }

.adjustments, .color-card { margin-top: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfd; }
.selected-model + .color-card { margin-top: 0; }
.workflow-section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 16px 0 10px; }
.workflow-section-title p { margin: 0; color: var(--muted); font-size: 10px; text-align: right; }
.adjustments summary { display: flex; align-items: center; gap: 9px; padding: 12px 13px; cursor: pointer; font-size: 13px; font-weight: 850; list-style: none; }
.adjustments summary::-webkit-details-marker { display: none; }
.adjustments[open] summary { border-bottom: 1px solid var(--line); }
.adjust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; padding: 14px 14px 5px; }
.adjust-grid label { min-width: 0; color: #3b5263; font-size: 11px; font-weight: 800; }
.adjust-grid output { float: right; color: var(--teal); }
.adjust-grid input[type="range"] { width: 100%; margin-top: 9px; accent-color: var(--teal); }
.help { margin: 8px 14px 13px; color: var(--muted); font-size: 10px; line-height: 1.55; }

.color-card { padding-bottom: 13px; }
.color-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 13px; border-bottom: 1px solid var(--line); }
.color-heading h3 { font-size: 14px; }
.color-heading > span { color: #536a7a; font-size: 9px; font-weight: 800; text-align: right; }
.coloration-mode, .opening-mode { display: flex; flex-wrap: wrap; gap: 7px 15px; margin: 11px 14px; padding: 10px 12px; border: 1px solid #d7e1e7; border-radius: 10px; }
.coloration-mode legend, .opening-mode legend { padding: 0 5px; color: #596f80; font-size: 10px; font-weight: 800; }
.coloration-mode label, .opening-mode label { font-size: 11px; font-weight: 720; }
.coloration-mode input, .opening-mode input { accent-color: var(--teal); }
.swatches { display: flex; gap: 10px; margin: 10px 14px; padding-bottom: 4px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x proximity; }
.swatch-item { flex: 0 0 66px; border: 0; background: transparent; color: #526778; padding: 0; text-align: center; scroll-snap-align: start; }
.swatch-color { display: block; width: 42px; height: 37px; margin: 0 auto 5px; border: 2px solid #fff; border-radius: 9px; box-shadow: 0 0 0 1px #bbc9d2,0 2px 6px rgba(0,0,0,.12); }
.swatch-item[aria-pressed="true"] .swatch-color { box-shadow: 0 0 0 3px var(--orange),0 3px 8px rgba(0,0,0,.14); }
.swatch-item small { display: block; font-size: 8px; line-height: 1.25; }
.custom-ral { display: grid; grid-template-columns: auto 120px 45px auto; align-items: center; gap: 7px; margin: 10px 14px; }
.custom-ral label { font-size: 10px; font-weight: 800; }
.custom-ral .field { height: 39px; }
.custom-ral input[type="color"] { width: 45px; height: 39px; border: 1px solid #c5d2dc; border-radius: 9px; background: #fff; padding: 3px; }
.color-status { margin: 8px 14px 0; padding: 9px 11px; border-radius: 9px; background: #fff4e9; color: #76502c; font-size: 10px; line-height: 1.45; }
.opening-mode { margin-top: 12px; margin-bottom: 6px; background: #fff; }
.opening-status { margin: 0 14px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.legal { margin: 18px 6px 0; color: #7c8c98; text-align: center; font-size: 10px; line-height: 1.55; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); max-width: calc(100vw - 28px); transform: translateX(-50%); padding: 11px 15px; border-radius: 10px; background: var(--navy); color: #fff; box-shadow: 0 7px 24px rgba(0,0,0,.3); font-size: 12px; font-weight: 750; }
.noscript { margin: 20px; padding: 15px; border: 1px solid #e6b8ad; background: #fff0ed; }
.export-dialog { width: min(900px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 16px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 15px 55px rgba(0,0,0,.35); overflow: auto; }
.export-dialog::backdrop { background: rgba(10,25,38,.68); }
.export-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.export-dialog h2 { margin: 0; font-size: 18px; }
.export-dialog-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.export-preview { display: block; max-width: 100%; max-height: 64vh; width: auto; height: auto; margin-inline: auto; border-radius: 10px; object-fit: contain; -webkit-touch-callout: default; user-select: auto; -webkit-user-select: auto; }
.export-help { color: var(--muted); font-size: 11px; line-height: 1.5; }
.export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.export-actions .button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

@media (min-width: 1180px) {
  .simulation-panel .panel-body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 0 16px; }
  .selected-model, .color-card, .photo-section-title, .photo-toolbar, .photo-placeholder, .stage-wrap, .view-actions, .edit-status { grid-column: 1; }
  .adjustments { grid-column: 2; grid-row: 1 / span 4; margin-top: 0; align-self: start; }
  .adjust-grid { grid-template-columns: 1fr; }
  .photo-placeholder { min-height: 520px; }
  .custom-ral { grid-template-columns: 1fr 45px; }
  .custom-ral label, .custom-ral .field { grid-column: 1; }
  .custom-ral input[type="color"] { grid-column: 2; grid-row: 1 / span 2; }
  .custom-ral .button { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; }
  .catalogue-panel { order: 1; }
  .simulation-panel { order: 2; }
  .model-list { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 430px; }
  .model-card img { height: 126px; }
}

@media (max-width: 560px) {
  .app-header { padding-inline: 14px; padding-bottom: 22px; }
  .privacy { display: none; }
  .chapter-nav { width: 100%; }
  .chapter-nav a { flex: 1; padding-inline: 7px; text-align: center; }
  .hero { align-items: start; margin-top: 20px; }
  .hero h1 { font-size: 29px; }
  .hero p { font-size: 12px; }
  .catalogue-summary { display: none; }
  .page { padding: 12px 10px 24px; }
  .panel { border-radius: 14px; }
  .panel-title, .panel-body { padding-inline: 12px; }
  .simulation-title-row { align-items: flex-start; }
  .status-pill { max-width: 125px; overflow: hidden; text-overflow: ellipsis; }
  .model-list { display: flex; max-height: none; padding: 1px 1px 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
  .model-card { flex: 0 0 133px; scroll-snap-align: start; }
  .model-card img { height: 125px; }
  .photo-toolbar, .upload-group { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .photo-toolbar > .button, .upload-group { min-width: 0; }
  .photo-toolbar > .button.lock { grid-column: 1 / -1; }
  .photo-placeholder { min-height: 320px; }
  .view-actions .segmented { flex: 1 1 25%; }
  .view-actions .export { flex: 1 0 100%; margin: 2px 0 0; }
  .adjust-grid { grid-template-columns: 1fr; }
  .custom-ral { grid-template-columns: 1fr 45px auto; }
  .custom-ral label { grid-column: 1 / -1; }
  .selected-model { margin-bottom: 10px; }
  .workflow-section-title { align-items: flex-start; }
  .workflow-section-title p { max-width: 145px; }
  .corner { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ===== Version publique arenov.com ===== */
.arv-cta{margin:18px 0 6px;padding:18px 18px 14px;border-radius:16px;background:#fff6f3;border:1px solid #f1c7bb;display:grid;gap:12px}
.arv-cta.is-ready{background:#14283d;border-color:#14283d;color:#fff;box-shadow:0 12px 30px rgba(20,40,61,.25)}
.arv-cta__txt strong{display:block;font-size:1.1rem;margin-bottom:4px}
.arv-cta__txt span{font-size:.92rem;opacity:.85}
.arv-cta__btns{display:flex;flex-wrap:wrap;gap:10px}
.arv-cta__btns .button{flex:1 1 180px;justify-content:center}
.arv-cta__note{margin:0;font-size:.8rem;opacity:.75}
.arv-wa-btn{background:#25d366!important;color:#fff!important;border-color:#25d366!important}
#arv-quote{background:#c0392b;border-color:#c0392b;color:#fff}
#arv-quote:disabled{opacity:.5}
.export-actions{flex-wrap:wrap}
.arv-embed .app-header .topbar{display:none}
.arv-embed body{background:transparent}

.arv-embed .app-header{display:none}
.arv-embed .page{padding-top:12px}
