/* Elevara Stair Configurator – all rules are scoped to .esc so the theme is untouched */
.esc {
  --bg: #e9ecef; --panel: #ffffff; --panel-2: #f4f6f8; --ink: #1b2025; --muted: #5b6570; --line: #d3d9df;
  --accent: #a8641f; --accent-ink: #ffffff; --ok: #2c7a4b; --ok-bg: #e3f2e9; --bad: #ad3b28; --bad-bg: #f8e4df;
  --view-top: #dfe5ea; --view-bottom: #c9d1d8;
  --f-display: inherit; --f-body: inherit;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 8px;
}
.esc.esc-fonts { --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif; --f-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace; }
.esc[data-scheme="dark"] {
  --bg: #111417; --panel: #181c20; --panel-2: #1f2429; --ink: #e6eaee; --muted: #97a1ab; --line: #2b3238;
  --accent-ink: #1a1208; --ok: #62b984; --ok-bg: #1c2e23; --bad: #e57a64; --bad-bg: #36201b;
  --view-top: #1d2328; --view-bottom: #0e1114; color-scheme: dark }
@media (prefers-color-scheme: dark) { .esc[data-scheme="auto"] {
  --bg: #111417; --panel: #181c20; --panel-2: #1f2429; --ink: #e6eaee; --muted: #97a1ab; --line: #2b3238;
  --accent-ink: #1a1208; --ok: #62b984; --ok-bg: #1c2e23; --bad: #e57a64; --bad-bg: #36201b;
  --view-top: #1d2328; --view-bottom: #0e1114; color-scheme: dark } }

.esc { position: relative; width: 100%; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.4;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-align: left; }
/* neutralise common theme styling on form controls inside the tool */
.esc, .esc *, .esc *::before, .esc *::after { box-sizing: border-box; }
.esc h1, .esc h2, .esc p { margin: 0; padding: 0; text-transform: none; color: inherit; font-family: var(--f-display); line-height: 1.3; }
.esc p { font-size: inherit; font-family: inherit; line-height: 1.45; }
.esc label, .esc legend { font-weight: 400; margin: 0; text-transform: none; }
.esc fieldset { min-width: 0; }
.esc input, .esc select, .esc button, .esc textarea { margin: 0; min-height: 0; height: auto; box-shadow: none; text-transform: none;
  letter-spacing: normal; line-height: 1.25; max-width: none; }
.esc select { -webkit-appearance: auto; appearance: auto; background-image: none; }
.esc button:hover { filter: brightness(1.05); }
.esc canvas { max-width: none; }
.esc .app { height: var(--esc-h, 760px); display: grid; grid-template-columns: minmax(300px, 360px) 1fr; gap: 0; }
.esc .esc-aside { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding-block: 18px 28px; padding-inline: 20px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.esc .esc-head h2 { font-family: var(--f-display); font-weight: 800; font-size: 20px; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.esc .esc-head p { margin: 4px 0 0; color: var(--muted); line-height: 1.45; }
.esc fieldset { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.esc legend { font-family: var(--f-display); font-weight: 700; font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 10px; }
.esc .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.esc .field.wide { grid-column: 1 / -1; }
.esc label { font-size: 12.5px; color: var(--muted); }
.esc .inp { position: relative; display: flex; align-items: center; }
.esc input[type=number], .esc select { width: 100%; box-sizing: border-box; font: 500 14px var(--f-mono); color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 34px 8px 10px; font-variant-numeric: tabular-nums; }
.esc select { font-family: var(--f-body); padding-right: 10px; }
.esc .inp .u { position: absolute; right: 10px; font: 12px var(--f-mono); color: var(--muted); pointer-events: none; }
.esc input:focus-visible, .esc select:focus-visible, .esc button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.esc .types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; grid-column: 1 / -1; }
.esc .type { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel-2); cursor: pointer; color: var(--muted); text-align: center; font: 600 12px var(--f-body); line-height: 1.2; }
.esc .type input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.esc .type svg { width: 46px; height: 30px; }
.esc .type:has(input:checked) { border-color: var(--accent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); background: var(--panel); }
.esc .type:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.esc .typenote { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.esc input:disabled, .esc select:disabled { opacity: .5; }
.esc .chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.esc .chk input { accent-color: var(--accent); }

.esc .esc-main { position: relative; min-width: 0; min-height: 0; background: linear-gradient(var(--view-top), var(--view-bottom)); }
.esc #esc-view { position: absolute; inset: 0; }
.esc #esc-view canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.esc .toolbar { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; pointer-events: none; }
.esc .seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; pointer-events: auto; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.esc .seg button { font: 600 12.5px var(--f-body); color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.esc .seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.esc .hint { pointer-events: none; position: absolute; bottom: 12px; left: 14px; color: var(--muted); font-size: 12px; }

.esc .stats { position: absolute; right: 14px; bottom: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; display: grid; grid-template-columns: repeat(4, auto); gap: 6px 18px; box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.esc .stat b { display: block; font: 500 17px var(--f-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.esc .stat span { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.esc .checks { display: flex; flex-direction: column; gap: 6px; }
.esc .check { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; background: var(--panel-2); }
.esc .check .v { font: 500 13px var(--f-mono); font-variant-numeric: tabular-nums; }
.esc .check .lim { font: 12px var(--f-mono); color: var(--muted); }
.esc .check .n { font-size: 13px; }
.esc .check[data-ok="true"] { box-shadow: inset 3px 0 0 var(--ok); }
.esc .check[data-ok="false"] { box-shadow: inset 3px 0 0 var(--bad); background: var(--bad-bg); }
.esc .pill { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--f-body); padding: 4px 10px; border-radius: 999px; }
.esc .pill.ok { background: var(--ok-bg); color: var(--ok); }
.esc .pill.bad { background: var(--bad-bg); color: var(--bad); }
.esc .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.esc .btn { font: 600 13px var(--f-body); border-radius: 6px; padding: 9px 14px; cursor: pointer; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); }
.esc .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.esc .note { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0; }
.esc textarea#esc-copyfallback { width: 100%; box-sizing: border-box; min-height: 90px; font: 11.5px var(--f-mono); background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; }
.esc .err { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 24px; text-align: center; }

@media (max-width: 760px) {
  .esc .app { height: auto; }
  .esc .app { grid-template-columns: 1fr; grid-template-rows: 58vh auto; height: auto; }
  .esc .esc-main { order: -1; height: 58vh; }
  .esc .esc-aside { border-right: 0; border-top: 1px solid var(--line); overflow: visible; }
  .esc .stats { left: 14px; right: 14px; grid-template-columns: repeat(4, 1fr); padding: 10px; gap: 4px 10px; }
  .esc .stat b { font-size: 14px; }
  .esc .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .esc * { scroll-behavior: auto !important; } }

.esc .chk { flex-direction: row; }
.esc label.chk { font-weight: 400; }

/* enquiry form */
.esc .esc-modal { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; padding: 16px; background: rgba(15,18,21,.55); }
.esc .esc-modal[hidden] { display: none; }
.esc .esc-dialog { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); color: var(--ink); border-radius: 12px;
  padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 14px; }
.esc .esc-dialog h2 { font-size: 19px; font-weight: 800; }
.esc .esc-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.esc .esc-shots[hidden] { display: none; }
.esc .esc-shots figure { margin: 0; }
.esc .esc-shots figcaption { font-size: 11px; color: var(--muted); margin-top: 3px; }
.esc .esc-dialog img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); display: block; background: var(--panel-2); }
.esc .esc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.esc .esc-form input[type=text], .esc .esc-form input[type=email], .esc .esc-form input[type=tel], .esc .esc-form textarea {
  width: 100%; font: 14px var(--f-body); color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; }
.esc .esc-form textarea { min-height: 80px; resize: vertical; }
.esc .esc-dialog a:not(.btn) { color: var(--accent); }
.esc .esc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.esc .esc-status { font-size: 13px; line-height: 1.45; }
.esc .esc-status.is-err { color: var(--bad); position: static; display: block; padding: 0; text-align: left; }
.esc .esc-status.is-ok { color: var(--ok); font-weight: 600; }
.esc .esc-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.esc .btn[disabled] { opacity: .6; cursor: wait; }
@media (max-width: 520px) { .esc .esc-form { grid-template-columns: 1fr; } }
@media (max-width: 760px) {   /* phones: figures sit under the model instead of covering it */
  .esc .app { grid-template-rows: auto auto; }
  .esc .esc-main { height: auto; }
  .esc #esc-view { position: relative; height: 58vh; }
  .esc .stats { position: static; grid-template-columns: repeat(3, 1fr); border-radius: 0; box-shadow: none; border-width: 1px 0 0; }
}
