body.office-view > main { width: min(100%, 1230px); max-width: 1230px; }
body.office-view > main > .toolbar { margin-bottom: 0; }
body.office-view header .brand { display: none; }
body.office-view header h1 { letter-spacing: -.04em; }

#office {
  --office-ink: #f8eef4;
  --office-muted: #c9c2d6;
  --office-panel: #282538;
  --office-line: #4b435b;
  color-scheme: dark;
  color: var(--office-ink);
  background: #1a192b;
  border-radius: 22px;
  padding: clamp(10px, 2vw, 24px);
}
.office-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.office-summary :is(span, button) {
  border: 1px solid var(--office-line); background: var(--office-panel);
  border-radius: 20px; padding: 5px 10px; font-size: .82rem; white-space: nowrap;
}
#office [data-state="active"] { --state-color: #82deb1; }
#office [data-state="decision"] { --state-color: #ffd17a; }
#office [data-state="paused"] { --state-color: #c4a9ef; }
#office [data-state="error"] { --state-color: #ff9796; }
#office [data-state="waiting"] { --state-color: #a9cfec; }
#office [data-state="stale"] { --state-color: #d2c9d9; }
.office-summary button { min-height: 0; color: var(--office-ink); }
.office-summary b { color: var(--state-color); margin-right: .22em; }
.office-floor { display: grid; grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr); align-items: start; gap: 12px; }
.office-room { position: relative; isolation: isolate; }
.office-room canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; border-radius: 12px; }
.office-room button {
  position: absolute; transform: translateX(-50%); z-index: 1; top: 40%;
  color: var(--office-ink); background: #221f33; border: 1px solid #777089;
  padding: 4px 2px; min-height: 40px; width: 20%; border-radius: 7px;
  display: grid; align-content: center; gap: 1px; line-height: 1.08; text-align: center;
  box-shadow: 0 3px 0 #121222aa; font-size: clamp(11px, 1.25vw, 17px);
}
.office-room button[data-state="decision"] { border-color: #ffd17a; }
.office-room button[aria-pressed="true"] { background: #433750; border-color: #dbb6de; }
#office :is(button, a):focus-visible { outline: 3px solid #ffdc89; outline-offset: 3px; z-index: 2; }
.office-room button small { color: var(--state-color); font-size: .76em; }
.office-room button[data-desk="research"], .office-room button[data-desk="analytics"] { left: 14.8%; }
.office-room button[data-desk="marketing"], .office-room button[data-desk="mail"] { left: 36.9%; }
.office-room button[data-desk="crm"], .office-room button[data-desk="owner"] { left: 59%; }
.office-room button:nth-child(n+4) { top: 81%; }
.office-lounge {
  position: absolute; right: 6.7%; top: 83%; color: #e0ede4;
  font-size: clamp(9px, 1.1vw, 14px); font-weight: 650; text-align: center;
}
.office-detail { min-width: 0; padding: 14px; border: 1px solid var(--office-line); border-radius: 13px; background: var(--office-panel); }
.office-detail h2 { font-size: 1.3rem; color: var(--office-ink); margin: 0 0 5px; }
.office-detail p { color: var(--office-muted); margin: 0 0 12px; }
.office-detail dl { margin: 0; display: grid; gap: 4px; }
.office-detail dt { color: #c8b6ce; font-size: .79em; }
.office-detail dd { margin: 0 0 5px; overflow-wrap: anywhere; }
.office-links { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.office-links button { min-height: 36px; font-size: .78em; padding: 3px 8px; background: #342e49; border: 1px solid #675772; color: #f5e3fa; }
.office-detail details { margin-top: 9px; }
.office-detail summary { cursor: pointer; }
.office-links a { display: inline-block; color: #f3c7e5; padding: 3px 0; }
.office-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-top: 12px; font-size: .8rem; color: var(--office-muted); }
.office-footer a { color: #f3c7e5; }

@media (max-width: 760px) {
  .office-floor { grid-template-columns: minmax(0, 1fr); }
  .office-room button { padding-inline: 0; width: 20.7%; top: 38%; }
  .office-room button:nth-child(n+4) { top: 78%; }
  .office-lounge { right: 6%; top: 85%; }
  .office-detail dl { grid-template-columns: 112px minmax(0,1fr); align-items: baseline; }
  body.office-view .toolbar { margin-bottom: 4px; }
}
body.office-view:not(.office-tv) #office {
  --office-panel: #1a2130;
  --office-line: #374256;
  background: #131a27;
}
body.office-view .office-command-room button {
  left: var(--desk-left);
  top: var(--desk-top);
  background: #131a27ed;
  border-color: #4c5870;
  border-radius: 6px;
  box-shadow: 0 2px 0 #080c15b8;
  font-size: clamp(11px, 1.15vw, 15px);
  min-height: 34px;
  width: 19%;
}
body.office-view .office-room button[aria-pressed="true"] {
  background: #27334a;
  border-color: #96a8c3;
}
body.office-view .office-room button[data-state="decision"] {
  border-color: #c19b62;
}
body.office-view .office-room button small { font-size: .8em; }
.office-command-room .office-lounge {
  top: 76.5%;
  right: 19%;
  transform: translateX(50%);
  color: #293530;
  text-shadow: 0 1px #e0deca;
}
body.office-tv > main {
  width: 94%;
  max-width: none;
  padding: max(2vh, calc(env(safe-area-inset-top) + 8px)) 0 max(2vh, env(safe-area-inset-bottom));
}
.office-tv .toolbar { justify-content: flex-start; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
#exit-tv {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid #667188;
  border-radius: 999px;
  color: #f8eef4;
  background: #252d40;
  text-decoration: none;
}
#exit-tv:focus-visible { outline: 3px solid #ffd17a; outline-offset: 3px; }
body.office-tv { background: #171628; color: #f8eef4; }
body.office-tv header h1 { color: #f8eef4; font-size: clamp(24px, min(7vw, 4.5vh), 54px); }
body.office-tv .appearance { display: none; }
body.office-tv .toolbar > button, body.office-tv #browser-login, body.office-tv #status { font-size: clamp(18px, 2.6vh, 34px); }
body.office-tv #status { color: #f8eef4; }
body.office-tv #office { padding: 1.5vh; }
.office-tv .office-floor { grid-template-columns: minmax(0, min(76%, 103vh)) minmax(0, 1fr); }
.office-tv .office-summary span { font-size: clamp(18px, 2.45vh, 34px); }
body.office-tv .office-command-room button { min-height: 4vh; font-size: clamp(17px, 1.9vh, 28px); border-width: 2px; }
.office-tv .office-room button small { font-size: .78em; }
.office-tv .office-detail h2 { font-size: clamp(20px, 3.4vh, 48px); }
.office-tv .office-detail, .office-tv .office-footer, .office-tv .office-lounge { font-size: clamp(16px, 2.5vh, 35px); }
.office-tv #office button:focus-visible, .office-tv main button:focus-visible { outline: 4px solid #ffd17a; outline-offset: 4px; }
@media (max-width: 690px) {
  body.office-tv .toolbar > button { font-size: .9rem; }
  .office-tv .office-detail, .office-tv .office-footer, .office-tv .office-summary span { font-size: .95rem; }
  .office-tv .office-floor { grid-template-columns: minmax(0,1fr); }
  .office-tv .office-lounge { font-size: clamp(8px, 2.3vw, 14px); }
}

@media (max-width: 690px) {
  body.office-view .office-room.office-command-room button {
    top: var(--desk-top-compact);
    min-height: 20px;
    width: 20.5%;
    padding: 2px;
    font-size: clamp(9px, 2.8vw, 13px);
  }
  .office-command-room button strong::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 3px;
    border-radius: 50%;
    background: var(--state-color);
    vertical-align: .12em;
  }
  .office-command-room button small {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
