/* Office planner screen. Brand teal, ink and gold of Aura Office; a full-screen app with its own top bar. */
:root {
    --ap-teal: #00616b;
    --ap-teal-dark: #00474f;
    --ap-teal-soft: #e3f0ee;
    --ap-ink: #173c3e;
    --ap-muted: #5a7372;
    --ap-gold: #b98f22;
    --ap-gold-soft: #fbf3dc;
    --ap-edge: #d6e1de;
    --ap-bg: #f4f6f5;
    --ap-stage: #e8eeec;
    --ap-red: #b3261e;
    --ap-red-soft: #fbe5e2;
    --ap-warn: #8a6100;
    --ap-warn-soft: #fff4d4;
    --ap-ok-soft: #e4f1ee;
    --ap-good: #2e7d4f;
    --ap-good-soft: #e5f2ea;
    --ap-side: #a8790a;
    --ap-tight: #6f8584;
    --ap-font: "Lato", Arial, "Segoe UI", system-ui, sans-serif;
    --ap-top: 64px;
    --ap-panel: 372px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body.ap-body { height: 100%; margin: 0; }
body.ap-body { background: var(--ap-bg); color: var(--ap-ink); font: 15px/1.5 var(--ap-font); overflow: hidden; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ap-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ap-skip { position: absolute; top: -60px; right: 12px; z-index: 50; background: var(--ap-ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.ap-skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--ap-teal); outline-offset: 2px; }

.ap { display: grid; grid-template-rows: var(--ap-top) minmax(0, 1fr); height: 100%; height: 100dvh; }

/* ---------- Top bar ---------- */
.ap-top { display: flex; align-items: center; gap: 18px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); background: #fff; border-bottom: 1px solid var(--ap-edge); min-width: 0; }
.ap-brand { display: flex; align-items: center; flex: none; }
.ap-brand img { height: 36px; width: auto; display: block; }
.ap-title { font-weight: 700; font-size: 16px; white-space: nowrap; display: flex; align-items: center; gap: 8px; padding-inline-start: 16px; border-inline-start: 1px solid var(--ap-edge); }
.ap-test { font-size: 11.5px; font-weight: 700; color: var(--ap-warn); background: var(--ap-gold-soft); border: 1px solid #e7cf87; border-radius: 999px; padding: 1px 8px; }
.ap-steps { display: flex; gap: 4px; margin-inline: auto; }
.ap-steps button { display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 8px 10px; border-radius: 10px; color: var(--ap-muted); font-weight: 600; }
.ap-steps button:hover { background: var(--ap-teal-soft); color: var(--ap-ink); }
.ap-step-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; border: 1.5px solid #b9c9c5; }
.ap-steps [aria-current] { color: var(--ap-ink); }
.ap-steps [aria-current] .ap-step-n { background: var(--ap-teal); border-color: var(--ap-teal); color: #fff; }
.ap-sum { display: grid; text-align: center; line-height: 1.2; min-width: 110px; }
.ap-sum b { font-size: 19px; font-variant-numeric: tabular-nums; }
.ap-sum small { font-size: 11.5px; color: var(--ap-muted); white-space: nowrap; }
.ap-top-actions { display: flex; gap: 8px; align-items: center; }
.ap-icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--ap-edge); background: #fff; display: grid; place-items: center; }
.ap-icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ap-ink); stroke-width: 1.7; stroke-linecap: round; }

/* ---------- Buttons ---------- */
.ap-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 700; text-decoration: none; white-space: nowrap; line-height: 1.2; }
.ap-btn:disabled { opacity: .45; cursor: not-allowed; }
.ap-btn-main { background: var(--ap-teal); color: #fff; }
.ap-btn-main:hover:not(:disabled) { background: var(--ap-teal-dark); color: #fff; }
.ap-btn-line { background: #fff; color: var(--ap-teal); border-color: var(--ap-teal); }
.ap-btn-line:hover:not(:disabled) { background: var(--ap-teal-soft); color: var(--ap-teal-dark); }
.ap-btn-line.is-saved { border-color: #9cc8c1; color: var(--ap-ink); }
.ap-btn-soft { background: var(--ap-teal-soft); color: var(--ap-ink); }
.ap-btn-soft:hover:not(:disabled) { background: #cfe5e1; color: var(--ap-ink); }
.ap-btn-danger { background: #fff; color: var(--ap-red); border-color: #e7b7b1; }
.ap-btn-danger:hover { background: var(--ap-red-soft); color: var(--ap-red); }
.ap-wide { width: 100%; }
.ap-link { background: none; border: 0; padding: 0; color: var(--ap-teal); text-decoration: underline; font-weight: 600; cursor: pointer; text-align: start; }
.ap-link:hover { color: var(--ap-teal-dark); }

/* ---------- Layout ---------- */
.ap-main { display: flex; min-height: 0; }
.ap-panel { width: var(--ap-panel); flex: none; background: #fff; border-inline-end: 1px solid var(--ap-edge); display: flex; flex-direction: column; min-height: 0; outline: none; }
.ap-panel-body { overflow-y: auto; padding: 18px 20px 28px; display: grid; grid-auto-rows: max-content; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; overscroll-behavior: contain; flex: 1; min-height: 0; }
.ap-grip { display: none; }
.ap-tabs { display: none; }
.ap-stage { position: relative; flex: 1; min-width: 0; background: var(--ap-stage); overflow: hidden; }
.ap-svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.ap-svg:focus { outline: none; }
.ap-svg:focus-visible { box-shadow: inset 0 0 0 3px var(--ap-teal); }
.ap-3d { position: absolute; inset: 0; }
.ap-3d-canvas { display: block; touch-action: none; }
.ap-3d-over { position: absolute; inset: 0 auto auto 0; pointer-events: none; }
.ap-loading { color: var(--ap-muted); padding: 20px; }

.ap-stage-top { position: absolute; top: 14px; left: 14px; display: flex; align-items: center; gap: 8px; z-index: 4; direction: ltr; }
.ap-stage-top > * { direction: rtl; }
.ap-view-switch { display: flex; background: #fff; border: 1px solid #c8d6d2; border-radius: 999px; padding: 3px; }
.ap-view-switch button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-weight: 600; min-height: 34px; }
.ap-view-switch [aria-pressed="true"] { background: var(--ap-teal); color: #fff; }
.ap-layers { display: flex; gap: 6px; }
.ap-layers button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #c8d6d2; background: #fff; border-radius: 999px; padding: 5px 12px 5px 10px; font-weight: 600; font-size: 13.5px; min-height: 36px; color: var(--ap-ink); }
.ap-layers button:hover { border-color: var(--ap-teal); }
.ap-layers svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ap-layers [aria-pressed="true"], .ap-layers [aria-expanded="true"] { background: var(--ap-teal); border-color: var(--ap-teal); color: #fff; }
.ap-pmenu { position: absolute; top: 62px; left: 14px; z-index: 6; background: #fff; border: 1px solid var(--ap-edge); border-radius: 14px; box-shadow: 0 12px 30px rgba(23, 60, 62, .18); padding: 6px; display: grid; gap: 4px; min-width: 220px; }
.ap-pmenu button { display: grid; gap: 1px; text-align: start; border: 0; background: none; border-radius: 10px; padding: 8px 12px; }
.ap-pmenu button:hover, .ap-pmenu button:focus-visible { background: var(--ap-teal-soft); }
.ap-pmenu small { color: var(--ap-muted); font-size: 12.5px; }
.ap-legend { position: absolute; top: 62px; left: 14px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px 12px; background: rgba(255, 255, 255, .92); border: 1px solid var(--ap-edge); border-radius: 10px; padding: 5px 10px; font-size: 12.5px; color: var(--ap-ink); pointer-events: none; max-width: calc(100% - 28px); }
.ap-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ap-legend i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.ap-legend .is-good { background: var(--ap-good); } .ap-legend .is-ok { background: var(--ap-teal); } .ap-legend .is-no { background: var(--ap-red); }
.ap-tools { position: absolute; left: 14px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.ap-tools button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid #c8d6d2; background: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700; line-height: 1; }
.ap-tools svg { width: 20px; height: 20px; fill: none; stroke: var(--ap-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ap-tools [aria-pressed="true"] { background: var(--ap-teal); border-color: var(--ap-teal); }
.ap-tools [aria-pressed="true"] svg { stroke: #fff; }
.ap-stage.is-3d .ap-tools, .ap-stage.is-3d .ap-scale { display: none; }
.ap-scale { position: absolute; right: 18px; bottom: 18px; display: grid; justify-items: center; gap: 2px; pointer-events: none; z-index: 2; }
.ap-scale span { display: block; height: 8px; border: 2px solid var(--ap-ink); border-top: 0; min-width: 10px; }
.ap-scale i { font-style: normal; font-size: 12px; color: var(--ap-muted); }
.ap-selbar { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; background: var(--ap-ink); border-radius: 999px; padding: 4px; z-index: 3; box-shadow: 0 6px 18px rgba(23, 60, 62, .18); }
.ap-selbar button { border: 0; background: none; color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 600; min-height: 38px; white-space: nowrap; }
.ap-selbar button:hover { background: rgba(255, 255, 255, .14); }
.ap-selbar button + button { border-inline-start: 1px solid rgba(255, 255, 255, .2); border-radius: 0; }

/* ---------- Plan drawing ---------- */
.ap-svg * { vector-effect: non-scaling-stroke; }
.ap-svg text, .ap-print-svg text { font-family: var(--ap-font); direction: rtl; unicode-bidi: plaintext; }
.ap-grid { fill: none; stroke: #d9e2df; stroke-width: 1; }
.ap-floor, .ap-gap { fill: #faf7f0; }
.ap-floor-oak { fill: #f8f1e4; } .ap-floor-walnut { fill: #f1e6d9; } .ap-floor-concrete { fill: #f2f2ef; }
.ap-floor-tile { fill: #f9f8f4; } .ap-floor-gray { fill: #eef0f0; } .ap-floor-carpet { fill: #edf0f3; }
.ap-wall { fill: var(--ap-ink); }
.ap-jamb { stroke: var(--ap-ink); stroke-width: 2; }
.ap-glass-line { stroke: #3f8f98; stroke-width: 1.6; }
.ap-leaf { stroke: var(--ap-ink); stroke-width: 3; stroke-linecap: round; }
.ap-sash { stroke: #3f8f98; stroke-width: 2; }
.ap-arc { fill: none; stroke: #6b8382; stroke-width: 1; stroke-dasharray: 4 3; }
.ap-swing.is-passage { opacity: .6; }
.ap-op-hit { fill: transparent; cursor: grab; pointer-events: all; }
.ap-op-hit.is-sel { fill: rgba(0, 97, 107, .1); stroke: var(--ap-teal); stroke-width: 2; stroke-dasharray: 5 4; }
.ap-col { stroke: var(--ap-ink); stroke-width: 1.5; cursor: grab; }
.ap-col.is-sel { stroke: var(--ap-teal); stroke-width: 3; }
.ap-h1-bg { fill: #e8f3f1; } .ap-h1-ln { stroke: #a6d0ca; }
.ap-h2-bg { fill: #fff3d2; } .ap-h2-ln { stroke: #e2bd55; }
.ap-h3-bg { fill: #6c7e7c; } .ap-h3-ln { stroke: var(--ap-ink); }
.ap-item { cursor: grab; }
.ap-item:focus { outline: none; }
.ap-s-wood { fill: #efe6d6; stroke: var(--ap-ink); stroke-width: 1.5; }
.ap-s-body { fill: #f4f0e8; stroke: var(--ap-ink); stroke-width: 1.5; }
.ap-s-inner { fill: none; stroke: #9a8c76; stroke-width: 1; }
.ap-s-front { stroke: var(--ap-ink); stroke-width: 4; }
.ap-s-front.is-open { stroke-dasharray: 6 4; }
.ap-s-tick { stroke: var(--ap-ink); stroke-width: 1.3; }
.ap-s-glass { stroke: #3f8f98; stroke-width: 1.6; }
.ap-s-joint { stroke: #9a8c76; stroke-width: 1; stroke-dasharray: 3 3; }
.ap-s-ext { fill: #f7f2e8; stroke: var(--ap-ink); stroke-width: 1.2; stroke-dasharray: 5 3; }
.ap-s-counter { fill: #d9cdb7; stroke: var(--ap-ink); stroke-width: 1.2; }
.ap-s-seat { fill: #3e5153; } .ap-s-back { fill: #22343a; }
.ap-s-guest { fill: #8d9d9b; } .ap-s-guest-back { fill: #5f7270; }
.ap-s-soft { fill: #bdb6aa; stroke: #6d665c; stroke-width: 1; } .ap-s-soft-dark { fill: #a49c8f; stroke: #6d665c; stroke-width: 1; }
.ap-item.is-sel .ap-s-wood, .ap-item.is-sel .ap-s-body, .ap-item.is-sel .ap-s-ext, .ap-item.is-sel .ap-s-soft { stroke: var(--ap-teal); stroke-width: 2.5; }
.ap-item.is-sel .ap-s-seat, .ap-item.is-sel .ap-s-guest { stroke: var(--ap-teal); stroke-width: 2.5; }
.ap-item:focus-visible .ap-s-wood, .ap-item:focus-visible .ap-s-body, .ap-item:focus-visible .ap-s-seat, .ap-item:focus-visible .ap-s-guest, .ap-item:focus-visible .ap-s-soft { stroke: var(--ap-teal); stroke-width: 4; }
.ap-item.is-bad .ap-s-wood, .ap-item.is-bad .ap-s-body, .ap-item.is-bad .ap-s-ext, .ap-item.is-bad .ap-s-soft, .ap-item.is-bad .ap-s-seat, .ap-item.is-bad .ap-s-guest { fill: #f6d3ce; stroke: var(--ap-red); stroke-width: 2.5; }
.ap-tag { fill: var(--ap-ink); font-weight: 700; pointer-events: none; }
.ap-tag-sub { fill: var(--ap-muted); pointer-events: none; }
.ap-pill { cursor: pointer; }
.ap-pill rect { fill: #fff; stroke: #c3d2ce; stroke-width: 1; }
.ap-pill text { fill: var(--ap-ink); }
.ap-pill:hover rect { stroke: var(--ap-teal); }
.ap-pill.is-dist rect { fill: var(--ap-teal); stroke: none; }
.ap-pill.is-dist text { fill: #fff; font-weight: 700; }
.ap-pill.is-op rect { stroke: var(--ap-teal); stroke-width: 1.5; }
.ap-selbox { fill: none; stroke: var(--ap-teal); stroke-width: 1.5; stroke-dasharray: 6 4; pointer-events: none; }
.ap-rot { fill: #fff; stroke: var(--ap-teal); stroke-width: 2; cursor: grab; }
.ap-rot-ln { stroke: var(--ap-teal); stroke-width: 1.5; pointer-events: none; }
.ap-dist { stroke: var(--ap-teal); stroke-width: 1.5; pointer-events: none; }
.ap-guide { stroke: var(--ap-gold); stroke-width: 1; stroke-dasharray: 4 4; pointer-events: none; }
.ap-pill.is-lv rect { stroke: none; }
.ap-pill.is-lv text { fill: #fff; font-weight: 700; }
.ap-pill.is-good rect { fill: var(--ap-good); } .ap-pill.is-ok rect { fill: var(--ap-teal); } .ap-pill.is-side rect { fill: var(--ap-side); }
.ap-pill.is-no rect { fill: var(--ap-red); } .ap-pill.is-tight rect { fill: var(--ap-tight); }
.ap-pill.is-per { cursor: grab; }
.ap-gapl line, .ap-gapl path, .ap-per-ln line, .ap-per-ln path { stroke-width: 2; pointer-events: none; }
.ap-gapl.is-good *, .ap-per-ln.is-good * { stroke: var(--ap-good); } .ap-gapl.is-ok *, .ap-per-ln.is-ok * { stroke: var(--ap-teal); }
.ap-gapl.is-side *, .ap-per-ln.is-side * { stroke: var(--ap-side); } .ap-gapl.is-no *, .ap-per-ln.is-no * { stroke: var(--ap-red); }
.ap-gapl.is-tight * { stroke: var(--ap-tight); }
.ap-route { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 7; pointer-events: none; }
.ap-route.is-good { stroke: var(--ap-good); } .ap-route.is-ok { stroke: var(--ap-teal); } .ap-route.is-side { stroke: var(--ap-side); } .ap-route.is-no { stroke: var(--ap-red); }
.ap-person { cursor: grab; }
.ap-person:focus { outline: none; }
.ap-per-ring { fill: rgba(255, 255, 255, .55); stroke-width: 3; }
.ap-person.is-good .ap-per-ring { stroke: var(--ap-good); } .ap-person.is-ok .ap-per-ring { stroke: var(--ap-teal); }
.ap-person.is-side .ap-per-ring { stroke: var(--ap-side); } .ap-person.is-no .ap-per-ring { stroke: var(--ap-red); }
.ap-per-body { fill: #5f7578; stroke: #fff; stroke-width: 1.5; }
.ap-per-head { fill: #c9d2d3; stroke: #3c5053; stroke-width: 1.2; }
.ap-per-nose { fill: #3c5053; }
.ap-person.is-sel .ap-per-ring, .ap-person:focus-visible .ap-per-ring { stroke-width: 4.5; fill: rgba(0, 97, 107, .12); }
.ap-dim { fill: none; stroke: var(--ap-ink); stroke-width: 1; pointer-events: none; }
.ap-dim-t { fill: var(--ap-ink); font-weight: 600; pointer-events: none; }
.ap-num circle { fill: var(--ap-teal); stroke: #fff; stroke-width: 2; }
.ap-wall-hl { fill: var(--ap-teal); pointer-events: none; }
.ap-pill.is-wall.is-hl rect { fill: var(--ap-teal); stroke: none; }
.ap-pill.is-wall.is-hl text { fill: #fff; font-weight: 700; }
.ap-num text { fill: #fff; font-weight: 700; }

/* ---------- Panel content ---------- */
.ap-h { margin: 0; font-size: 21px; line-height: 1.25; }
.ap-h-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ap-mini-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #c8d6d2; background: #fff; color: var(--ap-ink); border-radius: 999px; padding: 6px 12px 6px 14px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ap-mini-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ap-mini-btn:hover, .ap-mini-btn:focus-visible { border-color: var(--ap-teal); color: var(--ap-teal); }
.ap-roommap { display: block; width: 100%; max-width: 250px; height: auto; margin: 0 auto; overflow: visible; }
.ap-rm-floor { fill: #f2efe7; }
.ap-rm-wall { stroke: var(--ap-ink); stroke-width: 5; stroke-linecap: square; cursor: pointer; transition: stroke .15s; }
.ap-rm-wall.is-hl { stroke: var(--ap-teal); stroke-width: 6; }
.ap-rm-gap { stroke: #fff; stroke-width: 7; pointer-events: none; }
.ap-rm-win { stroke: #9ccfd8; stroke-width: 5; pointer-events: none; }
.ap-rm-leaf { stroke: var(--ap-ink); stroke-width: 1.4; pointer-events: none; }
.ap-rm-tag { cursor: pointer; }
.ap-rm-tag circle { fill: #fff; stroke: #b9cac6; stroke-width: 1.2; transition: fill .15s, stroke .15s; }
.ap-rm-tag text { fill: var(--ap-ink); font-size: 12.5px; font-weight: 700; }
.ap-rm-tag:hover circle { stroke: var(--ap-teal); }
.ap-rm-tag.is-hl circle { fill: var(--ap-teal); stroke: var(--ap-teal); }
.ap-rm-tag.is-hl text { fill: #fff; }
.ap-choices { display: grid; gap: 8px; }
.ap-choices button { display: grid; gap: 3px; text-align: start; border: 1px solid #c8d6d2; background: #fff; color: var(--ap-ink); border-radius: 12px; padding: 12px 14px; font: inherit; cursor: pointer; }
.ap-choices button:hover:not(:disabled), .ap-choices button:focus-visible { border-color: var(--ap-teal); background: var(--ap-teal-soft); }
.ap-choices b { font-size: 15.5px; }
.ap-choices small { color: var(--ap-muted); font-size: 13px; line-height: 1.45; }
.ap-choices button:disabled { opacity: .55; cursor: default; }
.ap-h3 { margin: 10px 0 0; font-size: 16px; }
.ap-hint { margin: 0; color: var(--ap-muted); font-size: 14px; }
.ap-meta { margin: 0; color: var(--ap-muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ap-note { margin: 0; background: var(--ap-gold-soft); border: 1px solid #ecd795; border-radius: 10px; padding: 9px 12px; font-size: 14px; }
.ap-good { margin: 0; background: var(--ap-ok-soft); border-radius: 10px; padding: 9px 12px; }
.ap-block { display: grid; gap: 7px; }
.ap-label { font-weight: 700; font-size: 14px; }
.ap-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ap-field { display: grid; gap: 4px; font-size: 13.5px; color: var(--ap-muted); min-width: 0; }
.ap-field > span:first-child { font-weight: 600; }
.ap-field input, .ap-field select, .ap-field textarea, .ap-search input { width: 100%; min-height: 42px; border: 1px solid #c3d2ce; border-radius: 10px; padding: 8px 12px; background: #fff; color: var(--ap-ink); font-size: 15px; }
.ap-field textarea { resize: vertical; min-height: 70px; }
.ap-field input:focus, .ap-field select:focus, .ap-field textarea:focus, .ap-search input:focus { border-color: var(--ap-teal); outline: 2px solid var(--ap-teal-soft); }
.ap-field [aria-invalid="true"] { border-color: var(--ap-red); }
.ap-unit-wrap { position: relative; display: block; }
.ap-unit-wrap input { padding-left: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.ap-unit-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ap-muted); font-size: 13px; pointer-events: none; }
.ap-ferr, .ap-err { color: var(--ap-red); font-size: 13px; margin: 0; min-height: 0; }
.ap-err:empty, .ap-ferr:empty { display: none; }
.ap-req { color: var(--ap-red); font-style: normal; }
.ap-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.ap-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ap-teal); }
.ap-seg { display: flex; background: var(--ap-bg); border: 1px solid #d3dedb; border-radius: 12px; padding: 3px; gap: 3px; }
.ap-seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 8px 6px; font-weight: 600; min-height: 38px; }
.ap-seg [aria-pressed="true"] { background: #fff; color: var(--ap-teal); box-shadow: 0 1px 3px rgba(23, 60, 62, .16); }
.ap-corners { display: flex; gap: 8px; }
.ap-corners button { width: 48px; height: 48px; border: 1.5px solid #c3d2ce; border-radius: 10px; background: #fff; display: grid; place-items: center; }
.ap-corners svg { width: 26px; height: 26px; fill: var(--ap-teal-soft); stroke: var(--ap-ink); stroke-width: 1.5; }
.ap-corners [aria-pressed="true"] { border-color: var(--ap-teal); background: var(--ap-teal-soft); }
.ap-adds, .ap-more, .ap-actions, .ap-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.ap-row .ap-field { flex: 1; min-width: 110px; }
.ap-next { padding-top: 6px; }
.ap-next .ap-btn { width: 100%; }
.ap-list, .ap-issues, .ap-lines, .ap-terms, .ap-roomlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ap-row-btn { width: 100%; display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--ap-edge); background: #fff; border-radius: 10px; padding: 10px 12px; text-align: start; }
.ap-row-btn:hover { border-color: var(--ap-teal); }
.ap-row-btn small { color: var(--ap-muted); }
.ap-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-swatches button { display: flex; align-items: center; gap: 6px; border: 1px solid var(--ap-edge); background: #fff; border-radius: 999px; padding: 4px 10px 4px 6px; font-size: 13px; }
.ap-swatches i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); }
.ap-swatches [aria-pressed="true"] { border-color: var(--ap-teal); box-shadow: inset 0 0 0 1px var(--ap-teal); }

.ap-search input { padding-inline-start: 14px; border-radius: 999px; }
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-chips button { border: 1px solid #c8d6d2; background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 13.5px; min-height: 34px; }
.ap-chips [aria-pressed="true"] { background: var(--ap-teal); border-color: var(--ap-teal); color: #fff; }
.ap-chips.is-tight button { padding: 6px 10px; font-variant-numeric: tabular-nums; }
.ap-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; }
.ap-filters label { display: flex; align-items: center; gap: 6px; }
.ap-filters input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ap-teal); }
.ap-sort { margin-inline-start: auto; }
.ap-sort select { border: 1px solid #c8d6d2; border-radius: 999px; padding: 5px 10px; background: #fff; }
.ap-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ap-card { width: 100%; height: 100%; display: grid; align-content: start; gap: 3px; text-align: start; border: 1px solid var(--ap-edge); border-radius: 14px; background: #fff; padding: 8px 8px 10px; cursor: grab; touch-action: pan-y; }
.ap-card:hover { border-color: var(--ap-teal); box-shadow: 0 4px 14px rgba(23, 60, 62, .1); }
.ap-card.is-dragging { opacity: .5; }
.ap-card-img { display: block; aspect-ratio: 4 / 3; border-radius: 10px; background: #f3f5f4; overflow: hidden; margin-bottom: 4px; }
.ap-card-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ap-card-name { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.ap-card-size { color: var(--ap-muted); font-size: 12.5px; }
.ap-card-price { color: var(--ap-teal); font-weight: 700; font-size: 13.5px; }
.ap-card-out, .ap-out { color: var(--ap-red); font-size: 12.5px; font-weight: 600; }

.ap-item-head { display: flex; gap: 10px; align-items: flex-start; }
.ap-item-head small { color: var(--ap-muted); font-size: 13px; }
.ap-back { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid var(--ap-edge); background: #fff; display: grid; place-items: center; }
.ap-back svg { width: 20px; height: 20px; fill: none; stroke: var(--ap-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ap-item-img { width: 100%; max-height: 190px; object-fit: contain; background: #f3f5f4; border-radius: 12px; }
.ap-finishes { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-finishes button { display: grid; justify-items: center; gap: 3px; border: 0; background: none; padding: 2px; width: 74px; font-size: 11px; line-height: 1.2; color: var(--ap-muted); }
.ap-finishes img, .ap-finishes i { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 0 0 1px #c8d6d2; display: block; background: #ddd; }
.ap-finishes [aria-pressed="true"] img, .ap-finishes [aria-pressed="true"] i { box-shadow: 0 0 0 2.5px var(--ap-teal); }
.ap-finishes [aria-pressed="true"] { color: var(--ap-ink); font-weight: 700; }
.ap-price-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; border-top: 1px solid var(--ap-edge); padding-top: 12px; }
.ap-price-row div { display: grid; }
.ap-price-row b { font-size: 21px; font-variant-numeric: tabular-nums; }
.ap-price-row small { color: var(--ap-muted); font-size: 12.5px; }
.ap-price-row a { color: var(--ap-teal); font-weight: 700; }
.ap-seats { background: var(--ap-bg); border-radius: 12px; padding: 10px; }

.ap-issues li { display: flex; gap: 8px; align-items: flex-start; border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.ap-issues .is-error { background: var(--ap-red-soft); }
.ap-issues .is-warn { background: var(--ap-warn-soft); }
.ap-issues .is-ok { background: var(--ap-ok-soft); }
.ap-issues .is-info { background: var(--ap-bg); }
.ap-ico { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; margin-top: 1px; }
.is-error .ap-ico { background: var(--ap-red); } .is-warn .ap-ico { background: #b98a12; } .is-ok .ap-ico { background: var(--ap-teal); } .is-info .ap-ico { background: #6c8483; }
.ap-go { text-decoration: none; color: var(--ap-ink); }
.ap-roomlist { counter-reset: r; gap: 10px; }
.ap-roomlist li { border-bottom: 1px solid var(--ap-edge); padding-bottom: 10px; display: grid; gap: 8px; font-size: 14px; }
.ap-roomlist .ap-link { color: var(--ap-ink); text-decoration: none; font-weight: 600; }
.ap-lines li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; border-bottom: 1px solid var(--ap-edge); padding: 6px 0; font-size: 14px; }
.ap-lines small { display: block; color: var(--ap-muted); font-size: 12.5px; }
.ap-q, .ap-p { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-p { font-weight: 700; }
.ap-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.ap-total b { font-size: 22px; font-variant-numeric: tabular-nums; }
.ap-terms { color: var(--ap-muted); font-size: 13px; gap: 2px; }
.ap-form { display: grid; gap: 10px; background: var(--ap-bg); border-radius: 14px; padding: 14px; }
.ap-done { background: var(--ap-ok-soft); border-radius: 14px; padding: 14px; display: grid; gap: 8px; }
.ap-done p { margin: 0; }
.ap-code { font-size: 22px; letter-spacing: .08em; }

/* ---------- Dialog, toast, 3D views ---------- */
.ap-dialog { border: 0; border-radius: 18px; padding: 0; max-width: min(460px, calc(100vw - 32px)); width: 100%; color: var(--ap-ink); box-shadow: 0 20px 60px rgba(23, 60, 62, .3); }
.ap-dialog::backdrop { background: rgba(23, 60, 62, .35); }
.ap-ask { display: grid; gap: 12px; padding: 22px; }
.ap-ask h2 { margin: 0; font-size: 20px; }
.ap-ask p { margin: 0; }
.ap-ask form { margin: 0; }
.ap-wrap { flex-wrap: wrap; }
.ap-guide svg { width: 100%; height: auto; }
.ap-guide .g-room { fill: #faf7f0; stroke: var(--ap-ink); stroke-width: 4; }
.ap-guide .g-dim { stroke: var(--ap-teal); stroke-width: 1.5; fill: none; }
.ap-guide .g-win { fill: #cfe4e8; stroke: #3f8f98; }
.ap-guide .g-door { fill: none; stroke: var(--ap-ink); stroke-width: 1.5; stroke-dasharray: 4 3; }
.ap-guide text { font-size: 11px; fill: var(--ap-muted); direction: rtl; }
.ap-guide ol { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 4px; font-size: 14.5px; }
.ap-keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.ap-keys dt { font-weight: 700; direction: ltr; text-align: right; }
.ap-keys dd { margin: 0; color: var(--ap-muted); }
.ap-toast { position: fixed; left: 50%; bottom: 76px; transform: translate(-50%, 20px); background: var(--ap-ink); color: #fff; padding: 10px 18px; border-radius: 12px; max-width: calc(100vw - 32px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; font-size: 14.5px; }
.ap-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ap-toast { width: max-content; }
.ap-toast button { margin-inline-start: 14px; white-space: nowrap; border: 0; background: none; color: #8fe0da; font: inherit; font-weight: 700; text-decoration: underline; padding: 2px 0; cursor: pointer; }
.ap-toast.is-on button { pointer-events: auto; }
.ap-3d-views { position: absolute; top: 14px; right: 14px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 3; max-width: calc(100% - 620px); justify-content: flex-start; }
.ap-3d-views button { border: 1px solid #c8d6d2; background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 13px; min-height: 34px; }
.ap-3d-views button:hover { border-color: var(--ap-teal); }
.ap-stage.has-sel .ap-3d-note { display: none; }
.ap-3d-note { position: absolute; right: 14px; bottom: 12px; margin: 0; font-size: 12px; color: var(--ap-muted); background: rgba(255, 255, 255, .85); border-radius: 8px; padding: 4px 8px; max-width: 60%; }
.ap-print { display: none; }
.ap-dialog.is-wide { max-width: min(780px, calc(100vw - 32px)); }
.ap-ex-view { background: var(--ap-bg); border: 1px solid var(--ap-edge); border-radius: 12px; min-height: 200px; display: grid; place-items: center; overflow: hidden; }
.ap-ex-view img { display: block; width: 100%; max-height: 50vh; object-fit: contain; transition: opacity .15s; }
.ap-ex-view.is-busy img { opacity: .45; }
.ap-ex-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ap-verdict { display: grid; gap: 2px; border-radius: 12px; padding: 10px 12px; border-inline-start: 4px solid; font-size: 14px; }
.ap-verdict b { font-size: 15.5px; }
.ap-verdict.is-good { background: var(--ap-good-soft); border-color: var(--ap-good); }
.ap-verdict.is-ok { background: var(--ap-teal-soft); border-color: var(--ap-teal); }
.ap-verdict.is-side { background: var(--ap-warn-soft); border-color: var(--ap-side); }
.ap-verdict.is-no { background: var(--ap-red-soft); border-color: var(--ap-red); }
.ap-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 7px; vertical-align: middle; }
.ap-dot.is-good { background: var(--ap-good); } .ap-dot.is-ok { background: var(--ap-teal); } .ap-dot.is-side { background: var(--ap-side); } .ap-dot.is-no { background: var(--ap-red); }
.ap-noscript { position: fixed; inset: 0; background: #fff; padding: 40px; font-size: 18px; }

/* ---------- Phones ---------- */
@media (max-width: 1500px) {
    .ap-3d-views { top: auto; bottom: 14px; right: auto; left: 14px; max-width: calc(100% - 28px); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .ap-3d-views button { flex: none; }
    .ap-stage.has-sel .ap-3d-views { bottom: 68px; }
    .ap-3d-note { display: none; }
}
@media (max-width: 1180px) {
    .ap-title { display: none; }
    .ap-steps button { padding: 8px 6px; }
}
@media (max-width: 960px) {
    .ap-steps span:not(.ap-step-n) { display: none; }
    :root { --ap-panel: 330px; }
}
@media (max-width: 767px) {
    :root { --ap-top: 56px; }
    .ap-top { gap: 10px; }
    .ap-brand img { height: 28px; }
    .ap-steps, .ap-top-actions .ap-btn-main { display: none; }
    .ap-sum { margin-inline-start: auto; min-width: 0; text-align: start; }
    .ap-sum b { font-size: 16px; }
    .ap-sum small { font-size: 11px; }
    .ap-top-actions .ap-btn { min-height: 36px; padding: 6px 12px; font-size: 14px; }
    .ap-icon-btn { width: 36px; height: 36px; }
    .ap-main { flex-direction: column; }
    .ap-stage { order: 1; }
    .ap-panel { order: 2; width: 100%; height: 46%; border: 0; border-top: 1px solid var(--ap-edge); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 24px rgba(23, 60, 62, .12); transition: height .22s ease; padding-bottom: env(safe-area-inset-bottom); }
    .ap-panel[data-sheet="min"] { height: 112px; }
    .ap-panel[data-sheet="full"] { height: 86%; }
    .ap-grip { display: flex; justify-content: center; padding: 8px 0 2px; cursor: grab; touch-action: none; }
    .ap-grip span { width: 44px; height: 5px; border-radius: 3px; background: #c3d2ce; }
    .ap-panel-body { padding: 4px 16px 24px; }
    .ap-tabs { display: flex; gap: 4px; position: sticky; top: -4px; background: #fff; padding: 4px 0 8px; z-index: 2; }
    .ap-tabs button { flex: 1; border: 0; background: var(--ap-bg); border-radius: 10px; padding: 7px 2px; font-weight: 700; font-size: 13px; color: var(--ap-muted); display: flex; gap: 4px; justify-content: center; align-items: center; }
    .ap-tabs button span { font-size: 11px; opacity: .8; }
    .ap-tabs [aria-current] { background: var(--ap-teal); color: #fff; }
    .ap-panel-body :is(button, input, select, textarea, a) { scroll-margin-top: 64px; }
    .ap-stage-top { top: 10px; left: 10px; gap: 6px; }
    .ap-view-switch button { padding: 5px 11px; min-height: 32px; font-size: 13px; }
    .ap-tools { left: 10px; bottom: 10px; flex-direction: row; }
    .ap-tools button { width: 38px; height: 38px; }
    .ap-tools [data-action="fit"], .ap-tools [data-action="free"] { display: none; }
    .ap-scale { right: 12px; bottom: 12px; }
    .ap-selbar { bottom: 58px; }
    .ap-selbar button { padding: 8px 11px; }
    .ap-3d-views { bottom: 10px; left: 10px; max-width: calc(100% - 20px); }
    .ap-stage.has-sel .ap-3d-views { bottom: 104px; }
    .ap-layers { gap: 5px; }
    .ap-layers button { width: 36px; height: 36px; min-height: 36px; padding: 0; justify-content: center; }
    .ap-layers span { display: none; }
    .ap-pmenu, .ap-legend { top: 54px; left: 10px; }
    .ap-legend { font-size: 11px; padding: 3px 8px; gap: 2px 9px; }
    .ap-selbar button { padding: 8px 10px; font-size: 14px; }
    .ap-3d-note { display: none; }
    .ap-cards { grid-template-columns: 1fr 1fr; }
    .ap-chips:not(.is-tight) { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
    .ap-chips:not(.is-tight) button { flex: none; }
    .ap-toast { bottom: calc(46% + 16px); }
}
@media (max-width: 380px) {
    .ap-sum small { display: none; }
}

/* ---------- Print ---------- */
@media print {
    @page { size: A4 landscape; margin: 10mm; }
    body.ap-body { overflow: visible; background: #fff; height: auto; }
    .ap, .ap-toast, .ap-dialog, .ap-skip, .ap-sr { display: none !important; }
    .ap-print { display: block; color: #000; font-size: 11pt; }
    .ap-print header { display: flex; justify-content: space-between; border-bottom: 1px solid #999; padding-bottom: 4mm; margin-bottom: 4mm; }
    .ap-print-svg { display: block; margin: 0 auto; }
    .ap-print-svg * { vector-effect: non-scaling-stroke; }
    .ap-print-list { break-before: page; }
    .ap-print-list h2 { font-size: 15pt; }
}
@media (prefers-reduced-motion: reduce) {
    .ap-panel, .ap-toast { transition: none; }
}
