/* ═══════════════════════════════════════════════════════════════════
   AURELIA · application styles
   Charcoal / ivory / warm wood / stone / champagne-gold identity.
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --void: #0b0c10; --panel: #13151b; --panel-2: #191c23; --panel-3: #20242c;
  --hair: rgba(255,255,255,.075); --hair-2: rgba(255,255,255,.14);
  --txt: #ebe8e1; --txt-dim: #a3a49f; --txt-faint: #6d7079;
  --ivory: #efe9df; --gold: #c8a45c; --gold-soft: #e0c78f; --gold-deep: #8a6d33;
  --ok: #32d583; --warn: #ffb547; --bad: #ff6b5e; --info: #7fc4ff;
  --radius: 14px; --radius-s: 9px;
  --ease: cubic-bezier(.32,.72,0,1);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Bodoni Moda', 'Didot', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --sidebar-w: 288px; --inspector-w: 360px; --topbar-h: 58px; --drawer-h: 0px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--void); color: var(--txt); font: 13px/1.45 var(--font); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.dim { color: var(--txt-dim); } .faint { color: var(--txt-faint); }
.hidden { display: none !important; }
svg.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── top bar ── */
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 14px 0 16px; border-bottom: 1px solid var(--hair);
  background: linear-gradient(180deg, #121419, #0e1014); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #181206;
  background: linear-gradient(150deg, var(--gold), var(--gold-deep)); box-shadow: 0 8px 18px -8px rgba(200,164,92,.8); }
.brand h1 { margin: 0; font: 500 22px/1 var(--serif); letter-spacing: .01em; }
.brand h1 span { color: var(--gold); }
.brand .sub { font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--txt-faint); margin-top: 4px; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 10.5px; font-weight: 600; letter-spacing: .05em;
  border: 1px solid var(--hair-2); background: rgba(255,255,255,.04); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--txt-faint); }
.badge.demo { color: var(--gold-soft); border-color: rgba(200,164,92,.35); background: rgba(200,164,92,.08); }
.badge.demo .dot { background: var(--gold); }
.topbar .spacer { flex: 1; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(255,255,255,.05); border: 1px solid var(--hair); }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; font-size: 11.5px; font-weight: 600; color: var(--txt-dim); display: inline-flex; gap: 6px; align-items: center; }
.seg button[aria-pressed="true"] { color: #1a1408; background: linear-gradient(150deg, #d8b46c, #a9863f); }
.iconbtn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--hair); background: rgba(255,255,255,.04); display: grid; place-items: center; color: var(--txt-dim); }
.iconbtn:hover { color: var(--txt); background: rgba(255,255,255,.08); }
.iconbtn[aria-pressed="true"] { color: var(--gold-soft); border-color: rgba(200,164,92,.4); }
select.sel { background: rgba(255,255,255,.05); border: 1px solid var(--hair); border-radius: 10px; padding: 6px 10px; color: var(--txt); font-size: 12px; }
select.sel option { background: #1a1d23; }

/* ── workspace ── */
.workspace { position: absolute; inset: var(--topbar-h) 0 0 0; display: grid; grid-template-columns: var(--sidebar-w) 1fr var(--inspector-w); grid-template-rows: 1fr auto; }
.workspace.no-sidebar { grid-template-columns: 0 1fr var(--inspector-w); }
.workspace.no-inspector { grid-template-columns: var(--sidebar-w) 1fr 0; }
.workspace.no-sidebar.no-inspector { grid-template-columns: 0 1fr 0; }
.sidebar, .inspector { overflow-y: auto; overflow-x: hidden; background: var(--panel); border-color: var(--hair); scrollbar-width: thin; scrollbar-color: #333 transparent; }
.sidebar { border-right: 1px solid var(--hair); grid-row: 1 / 3; }
.inspector { border-left: 1px solid var(--hair); grid-row: 1 / 3; grid-column: 3; }
.panel-pad { padding: 14px; }
.sec-title { font-size: 9.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--txt-faint); margin: 16px 0 8px; display: flex; align-items: center; justify-content: space-between; }
.sec-title:first-child { margin-top: 0; }

/* stage */
.stage { position: relative; min-width: 0; min-height: 0; grid-column: 2; grid-row: 1; background: radial-gradient(80% 70% at 50% 30%, #161a21, #090a0d); overflow: hidden; }
#viewport { position: absolute; inset: 0; }
#viewport canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.stage.hot #viewport canvas { cursor: pointer; }
.drawer { grid-column: 2; grid-row: 2; background: var(--panel); border-top: 1px solid var(--hair); display: flex; flex-direction: column; min-height: 0; }

/* overlays */
.ov { position: absolute; z-index: 5; }
.glass { background: rgba(14,16,21,.86); border: 1px solid rgba(255,255,255,.1); /* no backdrop blur: re-blurring the live 3D view every frame is expensive */
  box-shadow: 0 10px 30px -14px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.06); border-radius: 13px; }
.viewbar { left: 50%; transform: translateX(-50%); top: 12px; display: flex; gap: 3px; padding: 4px; max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; }
.viewbar::-webkit-scrollbar { display: none; }
.chip { border: 0; background: transparent; color: var(--txt-dim); padding: 7px 11px; border-radius: 9px; font-size: 11.5px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { color: var(--txt); background: rgba(255,255,255,.06); }
.chip[aria-pressed="true"] { color: #1a1408; background: linear-gradient(150deg, #d8b46c, #a9863f); }
.tools { right: 12px; top: 64px; display: flex; flex-direction: column; gap: 6px; padding: 5px; }
.tools .iconbtn { background: transparent; border-color: transparent; }
.ribbon { left: 12px; bottom: 12px; padding: 6px 11px; font-size: 10.5px; color: var(--txt-dim); display: flex; gap: 8px; align-items: center; max-width: calc(100% - 24px); }
.ribbon b { color: var(--gold-soft); font-weight: 600; }
.statusbar { left: 12px; top: 64px; display: flex; gap: 6px; flex-wrap: wrap; max-width: 42%; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 11px; border-radius: 99px; }
.pill .k { color: var(--txt-faint); }
.pill .led { width: 7px; height: 7px; border-radius: 50%; background: var(--txt-faint); }
.led.ok { background: var(--ok); box-shadow: 0 0 8px rgba(50,213,131,.7); }
.led.warn { background: var(--warn); box-shadow: 0 0 8px rgba(255,181,71,.6); }
.led.bad { background: var(--bad); box-shadow: 0 0 8px rgba(255,107,94,.7); }
.led.info { background: var(--info); box-shadow: 0 0 8px rgba(127,196,255,.6); }
.minimap { right: 12px; bottom: 12px; width: 170px; padding: 8px; }
.minimap svg { max-height: 200px; }
.minimap svg { width: 100%; height: auto; display: block; }
.minimap .mm-head { display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-faint); margin-bottom: 4px; }
.caption { left: 50%; transform: translateX(-50%); bottom: 18px; width: min(560px, calc(100% - 300px)); padding: 12px 16px; }
.caption h3 { margin: 0 0 4px; font: 500 18px/1.2 var(--serif); }
.caption p { margin: 0; color: var(--txt-dim); font-size: 12.5px; }
.caption .tour-ctl { display: flex; gap: 6px; margin-top: 10px; align-items: center; }
.caption .prog { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.caption .prog i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .4s var(--ease); }
.hint { left: 50%; top: 64px; transform: translateX(-50%); padding: 8px 14px; font-size: 12px; max-width: 80%; text-align: center; transition: opacity .3s; }
.tip { position: absolute; z-index: 6; pointer-events: none; transform: translate(-50%, -140%); padding: 5px 9px; border-radius: 8px; font-size: 11px; font-weight: 600;
  background: rgba(12,14,18,.92); border: 1px solid rgba(255,255,255,.14); white-space: nowrap; opacity: 0; transition: opacity .15s; }
.tip.show { opacity: 1; } .tip small { display: block; color: var(--txt-faint); font-weight: 500; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
.hotspot { position: absolute; z-index: 6; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35);
  background: rgba(14,16,21,.84); color: var(--gold-soft); display: grid; place-items: center; }
.hotspot::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid rgba(200,164,92,.45); animation: pulse 2.2s ease-out infinite; }
.hotspot.alert { color: #fff; background: rgba(60,120,200,.85); }
@keyframes pulse { 0% { transform: scale(.8); opacity: 1 } 100% { transform: scale(1.6); opacity: 0 } }
.boot { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; text-align: center; background: radial-gradient(60% 50% at 50% 45%, #14171e, #08090c); transition: opacity .6s var(--ease), visibility .6s; }
.boot.done { opacity: 0; visibility: hidden; }
.boot[hidden] { display: none; }
.boot .ring { width: 40px; height: 40px; margin: 0 auto 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.1); border-top-color: var(--gold); animation: spin 1s linear infinite; }
.boot .bar { width: 220px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); margin: 14px auto 8px; overflow: hidden; }
.boot .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft)); transition: width .3s; }
.boot .msg { font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--txt-dim); }
.boot .err { max-width: 460px; margin: 0 auto; color: var(--txt-dim); }
@keyframes spin { to { transform: rotate(360deg) } }
.joystick { left: 18px; bottom: 18px; width: 120px; height: 120px; border-radius: 50%; display: none; touch-action: none; }
.joystick i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; background: rgba(200,164,92,.55); border: 1px solid rgba(255,255,255,.35); }
.stage.walking .joystick.touch { display: block; }
.walkbar { left: 50%; transform: translateX(-50%); bottom: 16px; display: none; gap: 8px; padding: 6px 10px; align-items: center; font-size: 11.5px; white-space: nowrap; max-width: calc(100% - 24px); }
.stage.walking .walkbar { display: flex; }
.walkbar .whint { color: var(--txt-faint); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.walkbar .btn[aria-pressed="true"] { color: #ffd49a; border-color: rgba(232,204,148,.5); }
@media (max-width: 700px) { .walkbar .whint { display: none; } }
/* mouse look (pointer lock): a crosshair aims clicks */
.crosshair { display: none; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; z-index: 6; pointer-events: none;
  border: 1.5px solid rgba(255, 236, 200, .85); box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 0 10px rgba(255, 190, 110, .45); }
.crosshair::after { content: ''; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px; border-radius: 50%; background: #ffe7c2; }
.stage.walking.looking .crosshair { display: block; }
/* walk: door / gate card */
.doorcard { left: 50%; bottom: 66px; transform: translateX(-50%); width: min(430px, calc(100% - 24px)); padding: 12px 14px; z-index: 8; }
.doorcard h4 { margin: 0; font-size: 13px; }
.doorcard .row { gap: 8px; }
.doorcard .st { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.doorcard .st div { padding: 7px 9px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--hair); }
.doorcard .st small { display: block; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-faint); }
.doorcard .st b { font-size: 12.5px; display: flex; align-items: center; gap: 6px; margin-top: 2px; text-transform: capitalize; }
.doorcard .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.doorcard .acts .btn { flex: 1 1 auto; }
.doorcard [hidden] { display: none !important; }
.doorcard .why { font-size: 11px; color: var(--warn); min-height: 0; margin-top: 6px; }
.doorcard[data-state="open"] { border-color: rgba(50, 213, 131, .45); }
.stage:has(.doorcard) .hint { display: none; }
.stage.walking .ribbon .long { display: none; }          /* the walk bar needs the room; the short label stays */

/* ── generic controls ── */
.btn { border: 1px solid var(--hair-2); background: rgba(255,255,255,.05); color: var(--txt); padding: 8px 12px; border-radius: 10px; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .2s, border-color .2s, opacity .2s; }
.btn:hover { background: rgba(255,255,255,.1); }
.btn.gold { color: #1a1408; border-color: transparent; background: linear-gradient(150deg, #d8b46c, #a9863f); }
.btn.ok { color: #06180e; border-color: transparent; background: linear-gradient(150deg, #48e39a, #23a868); }
.btn.bad { color: #fff; border-color: transparent; background: linear-gradient(150deg, #ff7b6e, #d9473a); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 9px; font-size: 11px; border-radius: 8px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .42; cursor: not-allowed; }
.row { display: flex; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card { background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02)); border: 1px solid var(--hair); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.card h4 { margin: 0; font-size: 12.5px; font-weight: 650; }
.card .meta { font-size: 10.5px; color: var(--txt-faint); }
.switch { width: 42px; height: 24px; border-radius: 99px; border: 0; position: relative; background: rgba(255,255,255,.14); flex: none; transition: background .25s var(--ease); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.5); transition: transform .25s cubic-bezier(.3,1.3,.5,1); }
.switch[aria-checked="true"] { background: linear-gradient(180deg, #3ddc90, #28b673); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch.pending { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .55 } }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--gold) 0 var(--fill, 50%), rgba(255,255,255,.12) var(--fill, 50%) 100%); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; margin-top: -6px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.6); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--gold); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; }
input[type=range].cct::-webkit-slider-runnable-track { background: linear-gradient(90deg, #ffb46b, #fff3e0 50%, #cfe3ff); }
input[type=text], input[type=search], input[type=number], textarea { background: rgba(255,255,255,.05); border: 1px solid var(--hair); border-radius: 10px; padding: 8px 10px; width: 100%; }
.search { position: relative; }
.search input { padding-left: 30px; }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--txt-faint); }

/* sidebar */
.floortabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--hair); }
.floortabs button { border: 0; background: transparent; color: var(--txt-dim); border-radius: 9px; padding: 7px 4px; font-size: 11.5px; font-weight: 600; }
.floortabs button[aria-pressed="true"] { background: rgba(200,164,92,.16); color: var(--gold-soft); box-shadow: inset 0 0 0 1px rgba(200,164,92,.35); }
.roomlist { display: flex; flex-direction: column; gap: 3px; }
.roomitem { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 10px; border: 1px solid transparent; background: transparent; text-align: left; width: 100%; }
.roomitem:hover { background: rgba(255,255,255,.04); }
.roomitem[aria-current="true"] { background: rgba(200,164,92,.1); border-color: rgba(200,164,92,.3); }
.roomitem .ri { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.05); color: var(--txt-dim); flex: none; }
.roomitem.lit .ri { background: linear-gradient(150deg, rgba(255,186,110,.3), rgba(255,186,110,.08)); color: #ffcb8a; }
.roomitem .rn { font-weight: 600; font-size: 12.5px; }
.roomitem .rs { font-size: 10.5px; color: var(--txt-faint); }
.roomitem .tag { margin-left: auto; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-soft); }
.scenegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.scenebtn { text-align: left; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--hair); background: rgba(255,255,255,.03); }
.scenebtn:hover { background: rgba(255,255,255,.07); }
.scenebtn .sn { font-weight: 650; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.scenebtn .sd { font-size: 10px; color: var(--txt-faint); margin-top: 2px; line-height: 1.3; }
.scenebtn.active { border-color: rgba(200,164,92,.5); background: rgba(200,164,92,.1); }
.scenebtn.running { border-color: rgba(127,196,255,.5); }

/* inspector device rows */
.dev { padding: 10px 0; border-top: 1px solid var(--hair); }
.dev:first-of-type { border-top: 0; }
.dev .dh { display: flex; align-items: center; gap: 9px; }
.dev .dn { font-weight: 600; font-size: 12.5px; }
.dev .ds { font-size: 10.5px; color: var(--txt-faint); }
.dev .dctl { margin-top: 8px; display: grid; gap: 6px; }
.dev .lbl { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--txt-faint); }
.srcflag { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--hair-2); color: var(--txt-faint); }
.srcflag.sim { color: var(--gold-soft); border-color: rgba(200,164,92,.35); }
.cmdstate { font-size: 10px; font-family: var(--mono); color: var(--txt-faint); }
.cmdstate.pending { color: var(--info); } .cmdstate.failed, .cmdstate.timeout { color: var(--bad); }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--hair); background: rgba(255,255,255,.04); color: var(--txt-dim); border-radius: 8px; padding: 5px 9px; font-size: 11px; font-weight: 600; }
.chips button[aria-pressed="true"] { color: #1a1408; background: linear-gradient(150deg, #d8b46c, #a9863f); border-color: transparent; }
.climate-row { display: flex; align-items: center; gap: 10px; }
.climate-row .temp { font-size: 22px; font-weight: 300; min-width: 64px; text-align: center; }
.roomhead h2 { margin: 0; font: 500 21px/1.15 var(--serif); }
.roomhead .rmeta { color: var(--txt-faint); font-size: 11px; margin-top: 4px; }

/* entrance card */
.entrance .st { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.entrance .st div { padding: 8px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--hair); }
.entrance .st small { display: block; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-faint); }
.entrance .st b { font-size: 12.5px; display: flex; align-items: center; gap: 6px; margin-top: 2px; text-transform: capitalize; }
.entrance .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.entrance .why { font-size: 11px; color: var(--warn); min-height: 16px; margin-top: 6px; }
.eventlog { max-height: 220px; overflow-y: auto; font-size: 11px; display: flex; flex-direction: column; gap: 3px; }
.eventlog div { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.05); }
.eventlog time { font-family: var(--mono); color: var(--txt-faint); flex: none; }
.eventlog .t-blocked, .eventlog .t-fault { color: var(--warn); }

/* incoming call */
.callpanel { right: 12px; top: 64px; width: 340px; padding: 12px; z-index: 12; }
.callpanel.ringing { box-shadow: 0 0 0 1px rgba(127,196,255,.4), 0 18px 50px -20px rgba(80,150,255,.6); }
.callpanel .cv { position: relative; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16/9; margin: 8px 0; }
.callpanel canvas { width: 100%; height: 100%; display: block; }
.callpanel .cvlabel { position: absolute; left: 8px; top: 8px; font: 700 9.5px var(--mono); letter-spacing: .12em; padding: 3px 6px; border-radius: 5px; background: rgba(0,0,0,.65); color: #ffd28a; }
.callpanel .cvrec { position: absolute; right: 8px; bottom: 8px; font: 600 9px var(--mono); color: rgba(255,255,255,.7); background: rgba(0,0,0,.55); padding: 2px 6px; border-radius: 5px; }
.callpanel .cacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* drawer */
.drawer-tabs { display: flex; align-items: center; gap: 2px; padding: 5px 8px; border-bottom: 1px solid var(--hair); }
.drawer-tabs button { border: 0; background: transparent; color: var(--txt-dim); padding: 7px 12px; border-radius: 9px; font-size: 11.5px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.drawer-tabs button[aria-selected="true"] { color: var(--txt); background: rgba(255,255,255,.07); }
.drawer-body { height: var(--drawer-h); overflow: auto; transition: height .3s var(--ease); }
.drawer.open .drawer-body { --drawer-h: 340px; }
.drawer-tabs .grow { flex: 1; }
.planwrap { display: grid; grid-template-columns: 1fr 280px; gap: 0; height: 100%; }
.planwrap .plan { padding: 10px; overflow: auto; }
.planwrap .legend { border-left: 1px solid var(--hair); padding: 12px; overflow: auto; font-size: 11.5px; }
svg.floorplan { width: 100%; height: 100%; max-height: 100%; }
svg.floorplan .room { cursor: pointer; transition: fill-opacity .2s; }
svg.floorplan .room:hover { fill-opacity: .55; }
svg.floorplan .room.current { stroke: var(--gold); stroke-width: .07; }
svg.floorplan .room:focus { outline: none; stroke: var(--gold); stroke-width: .08; }
svg.floorplan text { pointer-events: none; }
table.eng { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.eng th, table.eng td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--hair); vertical-align: top; }
table.eng th { position: sticky; top: 0; background: var(--panel-2); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--txt-faint); z-index: 1; }
table.eng td input { padding: 4px 6px; border-radius: 6px; font-size: 11px; min-width: 70px; }
.engwrap { display: grid; grid-template-columns: 240px 1fr; height: 100%; }
.engnav { border-right: 1px solid var(--hair); padding: 10px; display: flex; flex-direction: column; gap: 3px; }
.engnav button { text-align: left; border: 0; background: transparent; color: var(--txt-dim); padding: 7px 10px; border-radius: 8px; font-weight: 600; font-size: 12px; }
.engnav button[aria-pressed="true"] { background: rgba(255,255,255,.07); color: var(--txt); }
.engbody { overflow: auto; padding: 12px; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); } .bad-text { color: var(--bad); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 4px 12px; font-size: 12px; }
.kv dt { color: var(--txt-faint); } .kv dd { margin: 0; }

/* toast + modal */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 80; display: flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 99px;
  background: rgba(18,20,26,.95); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 20px 40px -18px #000; font-size: 12px;
  transition: transform .45s var(--ease), opacity .45s; opacity: 0; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.warn { border-color: rgba(255,181,71,.4); } .toast.bad { border-color: rgba(255,107,94,.45); }
dialog.modal { border: 1px solid var(--hair-2); border-radius: 16px; background: var(--panel-2); color: var(--txt); padding: 0; max-width: min(560px, calc(100% - 24px)); width: 100%; box-shadow: 0 40px 100px -30px #000; }
dialog.modal::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }
dialog.modal header { padding: 14px 16px; border-bottom: 1px solid var(--hair); display: flex; justify-content: space-between; align-items: center; }
dialog.modal header h3 { margin: 0; font: 500 18px var(--serif); }
dialog.modal .mb { padding: 16px; max-height: 70vh; overflow: auto; }
dialog.modal footer { padding: 12px 16px; border-top: 1px solid var(--hair); display: flex; justify-content: flex-end; gap: 8px; }
.keypad { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; justify-content: center; margin: 12px 0; }
.keypad button { height: 52px; border-radius: 12px; border: 1px solid var(--hair-2); background: rgba(255,255,255,.05); font-size: 18px; font-weight: 600; }
.pinview { text-align: center; font: 600 24px var(--mono); letter-spacing: .4em; min-height: 34px; }

/* control surfaces (ported hardware) live in hardware.css */

/* ── responsive: tablet ── */
@media (max-width: 1280px) { :root { --sidebar-w: 248px; --inspector-w: 320px; } .minimap { width: 190px; } }
/* ── mobile: single column + bottom sheet ── */
@media (max-width: 860px) {
  :root { --topbar-h: 52px; }
  .brand .sub, .topbar .hide-m { display: none !important; }
  .brand h1 { font-size: 19px; }
  .workspace { grid-template-columns: 1fr !important; grid-template-rows: 54vh 1fr; }
  .stage { grid-column: 1; grid-row: 1; }
  .sidebar, .inspector, .drawer { grid-column: 1; grid-row: 2; border: 0; border-top: 1px solid var(--hair); }
  .sheet-hidden { display: none !important; }
  .mobile-tabs { display: flex !important; }
  .workspace { bottom: 58px; }
  .viewbar { top: auto; bottom: 10px; }
  .statusbar { max-width: 70%; }
  .statusbar .pill.opt { display: none; }
  .tools { top: 10px; right: 10px; }
  .minimap, .ribbon .long { display: none; }
  .ribbon { bottom: 56px; }
  .caption { width: calc(100% - 20px); bottom: 56px; }
  .callpanel { left: 10px; right: 10px; width: auto; top: 10px; }
  .drawer .drawer-body { height: auto; }
  .drawer.open .drawer-body { --drawer-h: auto; }
  .planwrap { grid-template-columns: 1fr; }
  .planwrap .legend { border-left: 0; border-top: 1px solid var(--hair); }
  .engwrap { grid-template-columns: 1fr; }
  .engnav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--hair); }
  .btn, .chip { min-height: 38px; }
  .switch { width: 48px; height: 28px; } .switch::after { width: 22px; height: 22px; } .switch[aria-checked="true"]::after { transform: translateX(20px); }
}
.mobile-tabs { display: none; position: fixed; left: 0; right: 0; bottom: 0; height: 58px; z-index: 25; background: #101217; border-top: 1px solid var(--hair);
  justify-content: space-around; align-items: stretch; padding-bottom: env(safe-area-inset-bottom); }
.mobile-tabs button { flex: 1; border: 0; background: transparent; color: var(--txt-faint); font-size: 10px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.mobile-tabs button[aria-selected="true"] { color: var(--gold-soft); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* compact chrome at mid widths */
.seg button, .chip, .btn { white-space: nowrap; }
.stage { container-type: inline-size; container-name: stage; }
@container stage (max-width: 980px) { .viewbar .chip .lbl { display: none; } .viewbar .chip { padding: 7px 9px; } }
@container stage (max-width: 640px) { .statusbar .pill.opt { display: none; } }
@media (max-width: 1360px) { .brand .sub { display: none; } .topbar { gap: 10px; } }
@media (max-width: 1100px) { #modeBadge { display: none; } }
.workspace:has(.drawer.open) .minimap { display: none; }
.seg { flex-wrap: nowrap; flex-shrink: 0; }
@media (max-width: 860px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .seg button { padding: 6px 8px; font-size: 11px; }
  .tools { flex-direction: row; top: auto; bottom: 64px; right: 10px; }
  .tools .iconbtn:nth-child(n+4) { display: none; }
  .statusbar { top: 10px; }
  .hotspot { width: 34px; height: 34px; }
}
@media (max-width: 400px) { .brand h1 { font-size: 17px; } .brand .mark { width: 26px; height: 26px; } }

/* switch-range chooser (shown with a wall-keypad close-up) */
.rangebar { position: absolute; left: 50%; bottom: 70px; transform: translate(-50%, 12px); z-index: 7; display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  border-radius: 99px; background: rgba(14,16,21,.9); border: 1px solid rgba(255,255,255,.12); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100% - 24px); overflow-x: auto; }
.rangebar.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.rangebar .rl { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--txt-faint); padding: 0 6px; white-space: nowrap; }
.rangebar button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; border: 1px solid transparent; background: transparent; color: var(--txt-dim); font: 600 11px/1 var(--font); cursor: pointer; white-space: nowrap; text-transform: capitalize; }
.rangebar button:hover { color: var(--txt); background: rgba(255,255,255,.06); }
.rangebar button[aria-pressed="true"] { color: var(--gold-soft); border-color: rgba(200,164,92,.45); background: rgba(200,164,92,.1); }
.rangebar .sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(255,255,255,.35); display: inline-block; }
/* wall-device close-ups: keep the device clear of the mini plan */
#stage.closeup #minimap { opacity: 0; pointer-events: none; }
/* wall-device close-ups: keep the device clear of the mini plan */
#stage.closeup #minimap { opacity: 0; pointer-events: none; }

/* ── Present mode: full-screen 3D, large tour captions, slim presenter bar ── */
.btn.present { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 99px; border: 1px solid rgba(200,164,92,.55);
  background: linear-gradient(180deg, rgba(227,196,142,.28), rgba(200,164,92,.12)); color: var(--gold-soft); font: 700 12px/1 var(--font); letter-spacing: .04em; cursor: pointer; }
.btn.present:hover { background: linear-gradient(180deg, rgba(227,196,142,.4), rgba(200,164,92,.2)); color: #fff; }
body.presenting .topbar { display: none; }
body.presenting .workspace { inset: 0 !important; grid-template-columns: 1fr !important; grid-template-rows: 1fr !important; }
body.presenting .stage { grid-column: 1 / -1 !important; grid-row: 1 / -1 !important; }
body.presenting .sidebar, body.presenting .inspector, body.presenting .drawer, body.presenting .mobile-tabs,
body.presenting #statusbar, body.presenting #tools, body.presenting #minimap, body.presenting #viewbar, body.presenting #hint,
body.presenting .rangebar, body.presenting .hotspot, body.presenting #walkbar, body.presenting #joystick { display: none !important; }
body.presenting .caption { bottom: 86px; width: min(780px, calc(100% - 32px)); padding: 18px 24px 20px; background: rgba(10,12,16,.82); }
body.presenting .caption h3 { font-size: clamp(22px, 3.2vw, 34px); margin-bottom: 8px; }
body.presenting .caption p { font-size: clamp(13px, 1.5vw, 17px); line-height: 1.5; color: var(--txt); }
body.presenting .caption .tour-ctl { display: none; }
.presenter { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 9; display: none; align-items: center; gap: 6px; padding: 7px 9px;
  border-radius: 99px; background: rgba(12,14,18,.9); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 16px 40px -20px #000; max-width: calc(100% - 24px); }
body.presenting .presenter { display: flex; }
.presenter button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--txt); display: grid; place-items: center; cursor: pointer; }
.presenter button:hover { background: rgba(255,255,255,.08); }
.presenter button.exit { width: auto; padding: 0 14px; border-radius: 99px; font: 600 12px/1 var(--font); color: var(--txt-dim); }
.presenter .dots { display: flex; gap: 5px; padding: 0 8px; flex-wrap: nowrap; overflow: hidden; }
.presenter .dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.22); flex: none; transition: background .3s, transform .3s; cursor: pointer; }
.presenter .dots i.on { background: var(--gold); transform: scale(1.3); }
.presenter .dots i.done { background: rgba(200,164,92,.5); }
.presenter .count { display: none; padding: 0 10px; font: 600 13px/1 var(--font); color: var(--txt); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 520px) { .presenter .dots { display: none; } .presenter .count { display: block; } .presenter { justify-content: space-between; width: calc(100% - 24px); } }
/* end card + welcome card */
.endcard, .intro { position: absolute; left: 50%; transform: translate(-50%, -50%); top: 46%; z-index: 10; text-align: center; padding: 28px 34px; border-radius: 22px;
  background: rgba(10,12,16,.86); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 80px -30px #000; width: min(520px, calc(100% - 32px)); }
.endcard h2, .intro h2 { font: 500 clamp(26px, 4vw, 40px)/1.1 var(--serif); margin: 0 0 6px; color: var(--txt); }
.endcard p, .intro p { color: var(--txt-dim); margin: 0 0 18px; font-size: 14px; line-height: 1.5; }
.endcard .row, .intro .row { justify-content: center; gap: 10px; display: flex; flex-wrap: wrap; }
.intro { top: auto; bottom: 64px; transform: translateX(-50%); transition: opacity .6s, transform .6s; }
.intro.gone { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; }
.intro .kicker, .endcard .kicker { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 8px; }
@media (max-width: 700px) { .intro { bottom: 150px; padding: 18px; } .intro p { font-size: 13px; } }
/* phones: icon-only Present button, logo without wordmark, no top-bar overflow */
@media (max-width: 860px) {
  .topbar { overflow: hidden; }
  .btn.present { padding: 0; width: 38px; height: 38px; justify-content: center; font-size: 0; gap: 0; border-radius: 50%; flex: none; }
}
@media (max-width: 480px) { .brand h1 { display: none; } }
/* the disclaimer stays visible during presentations, clear of the presenter bar */
body.presenting .ribbon { top: 12px; bottom: auto !important; left: 12px; }
