:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #eee7d5;
  background: #16222d;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
html,body,#office { width:100%; height:100%; margin:0; overflow:hidden; }
#office { position:relative; }
#floor,#lamps { display:block; position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
#wall-switch, #wall-switch:hover {
  position:absolute; z-index:3; transform:translate(-50%,-50%);
  width:17px; height:20px; padding:0; border:0; background:transparent;
}
#wall-switch:disabled { cursor:default; }
#thermostat-switch, #thermostat-switch:hover, #photo-frame, #photo-frame:hover {
  position:absolute; z-index:3; transform:translate(-50%,-50%);
  width:25px; height:22px; padding:0; border:0; background:transparent;
}
#thermostat-panel, #photo-panel {
  --climate-panel:#172a34f8; --climate-display:#26434a; --climate-accent:#a9dfc5; --climate-muted:#b9d0d3;
  position:absolute; z-index:4; overflow:auto; padding:12px;
  border:1px solid #789394b0; border-radius:13px;
  background:var(--climate-panel); box-shadow:0 10px 26px #10202858;
}
[data-lighting="light"] #thermostat-panel, [data-lighting="light"] #photo-panel {
  --climate-panel:#fcfdf9f8; --climate-display:#e4eeeb; --climate-accent:#326d61; --climate-muted:#526a6b;
}
#photo-frame, #photo-frame:hover { transform:none; }
#photo-panel { overflow:hidden; }
#group-photo { display:block; width:100%; height:calc(100% - 34px); margin-top:7px; border-radius:5px; }
.thermostat-header,.thermostat-footer,.thermostat-adjust {
  display:flex; justify-content:space-between; align-items:center; gap:7px;
}
.thermostat-header h2 { margin:0; font-size:15px; font-weight:680; }
.thermostat-display {
  display:grid; justify-items:center; margin:9px 0; padding:8px;
  border-radius:9px; background:var(--climate-display); color:var(--climate-accent);
}
.thermostat-display label,.thermostat-display p,.thermostat-footer p {
  font-size:11px; margin:0; color:var(--climate-muted);
}
#thermostat-reading { font:640 33px/1.15 "Segoe UI",system-ui,sans-serif; font-variant-numeric:tabular-nums; }
#thermostat-setpoint { width:100%; min-width:0; accent-color:var(--climate-accent); }
.thermostat-adjust button { font-size:15px; min-width:28px; padding:2px 5px; }
.thermostat-footer { margin-top:8px; }
.thermostat-units { display:flex; gap:3px; }
.thermostat-units button { padding:4px 7px; }
#thermostat-panel .thermostat-units [aria-pressed="true"] {
  background:var(--climate-accent); color:var(--climate-panel); border-color:var(--climate-accent);
}
#debug-controls {
  position:absolute; right:12px; bottom:12px; z-index:4;
  width:min(356px,calc(100% - 24px));
  display:grid; gap:6px; justify-items:end; pointer-events:none;
  --debug-bg:#142731f5; --debug-border:#78939492; --debug-muted:#b8cacc;
}
[data-lighting="light"] #debug-controls {
  --debug-bg:#fcfdfaf7; --debug-border:#b4c6c6; --debug-muted:#52676a;
}
#debug-events,.debug-toolbar > * {
  pointer-events:auto;
}
#debug-events {
  width:100%; max-height:min(550px,calc(100vh - 122px)); overflow:auto;
  overscroll-behavior:contain; padding:9px; border:1px solid var(--debug-border);
  border-radius:12px; background:var(--debug-bg); box-shadow:0 6px 24px #1b343843;
}
.debug-header,.debug-toolbar { display:flex; align-items:center; gap:6px; }
.debug-header { justify-content:space-between; margin-bottom:4px; }
.debug-header h2 { margin:0 0 0 4px; font-size:14px; font-weight:650; }
.debug-toolbar { justify-content:flex-end; flex-wrap:wrap; }
#debug-status {
  max-width:100%; margin:0; padding:5px 8px; font-size:11px; color:var(--debug-muted);
  border:1px solid var(--debug-border); border-radius:6px; background:var(--debug-bg);
}
#debug-groups details + details { border-top:1px solid var(--debug-border); }
#debug-groups summary { padding:7px 4px; cursor:pointer; font-size:12px; font-weight:600; }
.debug-items {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px;
  padding:0 2px 6px;
}
.debug-items button { text-align:left; line-height:1.2; }
.closeup {
  --accent:#a2c8ac;
  position:absolute; z-index:2;
  padding:0; overflow:hidden; border-radius:16px; border:1px solid #779394ab;
  background:#182933; box-shadow:0 17px 60px #071318cc,0 1px 8px #071319c2;
  pointer-events:none;
  transition:opacity .20s ease,transform .20s ease;
  opacity:0; transform:translateY(7px) scale(.985);
}
.closeup.open { opacity:1; transform:translateY(0) scale(1); }
.card-head { display:flex; align-items:center; gap:10px; padding:11px 14px; height:54px; border-bottom:1px solid #8da5a337; }
.desk-flag {
  flex:none; width:9px; height:24px; background:var(--accent); border-radius:3px;
  box-shadow:0 0 14px color-mix(in srgb,var(--accent),transparent 67%);
}
.desk-title { min-width:0; }
.desk-title h2 { font-size:17px; line-height:1.13; margin:0; color:#f3eddb; font-weight:630; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.desk-title p { margin:4px 0 0; color:#9baeb0; font-size:10.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#desk-ref { margin-left:auto; flex:none; font:10px Consolas,monospace; color:var(--accent); }
.cubicle { width:100%; height:53%; display:block; }
.notes {
  display:grid; grid-template-columns:1.20fr .85fr; gap:8px; align-items:stretch;
  height:calc(47% - 54px); padding:9px 11px 11px;
  background:linear-gradient(135deg,#1b303b,#15252f);
}
.monitor {
  min-width:0; min-height:0; overflow:hidden;
  display:flex; flex-direction:column; justify-content:space-between;
  background:#101e27; border:1px solid #728c8d6e; border-radius:7px;
}
.monitor canvas { display:block; width:100%; height:calc(100% - 16px); min-height:0; }
#task { padding:2px 7px 4px; color:#afc1be; font-size:8px; white-space:nowrap; }
.memo {
  display:flex; flex-direction:column; justify-content:center;
  padding:8px 10px; color:#223138; border-radius:6px;
  background:linear-gradient(135deg,#ddc897,#bfad83);
  box-shadow:inset 0 1px #f7e4bbb3;
  min-width:0;
}
.memo span { font:8.5px Consolas,monospace; text-transform:uppercase; letter-spacing:.06em; }
.memo p { margin:5px 0 0; font-size:10.5px; line-height:1.31; font-weight:550; overflow-wrap:anywhere; }
.notes:has(.memo[hidden]) { grid-template-columns:1fr; }
.staff-profile { display:grid; grid-template-rows:54px minmax(0,1fr) auto; }
#staff-portrait { display:block; width:100%; height:100%; min-height:0; }
.staff-details { padding:10px 15px 12px; border-top:1px solid #8da5a337; background:#1b303b; }
.staff-details p { margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#staff-context { color:#f0ecd9; font-size:12px; font-weight:600; }
#staff-destination { margin-top:4px; color:#b2c6c5; font-size:11px; }
#staff-destination[data-quote] { white-space:normal; }
[data-lighting="light"] .staff-details { background:#f1f4f2; border-color:#dce2df; }
[data-lighting="light"] #staff-context { color:#223238; }
[data-lighting="light"] #staff-destination { color:#50666b; }
.preview {
  position:absolute; z-index:3; top:20px; left:22px; right:22px;
  display:flex; justify-content:space-between; gap:16px; pointer-events:none;
}
.preview .title,.commands { border:1px solid #a0b6b858; border-radius:12px; background:#142731f0; box-shadow:0 6px 22px #0815218c; }
.preview .title { margin-left:clamp(135px,35%,528px); padding:9px 14px 9px 12px; display:flex; align-items:center; gap:10px; }
.logo { display:block; position:relative; width:23px; height:23px; color:#9ad2b7; border-radius:5px; background:#334c50; }
.logo:before,.logo:after { content:""; position:absolute; top:6px; bottom:6px; width:5px; border-radius:1px; background:#9ad2b7; }
.logo:before { left:5px; }.logo:after { right:5px; background:#ddbd8a; }
.title h1 { margin:0; font-size:17px; line-height:1.03; font-weight:680; letter-spacing:-.02em; }
.title p { margin:4px 0 0; font-size:10px; color:#a5bbba; }
.commands { display:flex; pointer-events:auto; padding:6px; gap:6px; align-items:center; }
.commands label { display:flex; align-items:center; gap:5px; padding-left:5px; font-size:10px; color:#a7bbbf; }
button,select {
  font:500 11px "Segoe UI",system-ui,sans-serif; color:#e8e5d5;
  padding:7px 8px; background:#223b46; border:1px solid #7696946b; border-radius:7px;
}
button { cursor:pointer; }
button:hover,select:hover { background:#33515c; }
:focus-visible { outline:2px solid #b6e2c9; outline-offset:2px; }
#office[data-lighting="light"] { color-scheme:light; color:#26373d; }
[data-lighting="light"] .closeup {
  border-color:#b9c3c6; background:#fcfdfb;
  box-shadow:0 15px 48px #3f52563b,0 2px 8px #53646a29;
}
[data-lighting="light"] .card-head { border-color:#d9e2e2; }
[data-lighting="light"] .desk-title h2 { color:#223238; }
[data-lighting="light"] .desk-title p { color:#53676e; }
[data-lighting="light"] #desk-ref { color:color-mix(in srgb,var(--accent),#26373d 65%); }
[data-lighting="light"] .notes { background:#f1f4f2; border-top:1px solid #dce2df; }
[data-lighting="light"] .memo { background:#faf0d2; box-shadow:inset 0 0 0 1px #e3d8b8; }
[data-lighting="light"] .preview .title,
[data-lighting="light"] .commands {
  border-color:#c4cdce; background:#fcfdfaf5; box-shadow:0 4px 16px #475b5d28;
}
[data-lighting="light"] .title p,
[data-lighting="light"] .commands label { color:#52666b; }
[data-lighting="light"] .logo { background:#5d7974; }
[data-lighting="light"] button,
[data-lighting="light"] select { color:#26373d; background:#eef3f1; border-color:#c2cdcc; }
[data-lighting="light"] button:hover,
[data-lighting="light"] select:hover { background:#e2ebe8; }
[data-lighting="light"] :focus-visible { outline-color:#4e7970; }
@media (max-width:760px) {
  .preview { top:10px; left:9px; right:9px; flex-wrap:wrap; gap:6px; }
  .preview .title { margin-left:clamp(96px,25%,160px); }
  .commands { margin-left:auto; }
  .commands label span { display:none; }
}
@media (max-height:440px) {
  .staff-profile { grid-template-rows:39px minmax(0,1fr) auto; }
  .card-head { height:39px; padding:6px 10px; }
  .desk-title h2 { font-size:14px; }
  .desk-title p { margin-top:1px; }
  .notes { height:calc(47% - 39px); }
}
@media (prefers-reduced-motion:reduce) { .closeup { transition:none; } }


