@font-face {
  font-family: "Inter";
  src: url("/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f6f8fa;
  --card: #ffffff;
  --raised: #f1f4f7;
  --text: #0f1b26;
  --muted: #627181;
  --line: #e3e8ee;
  --brand: #0d9488;
  --brand-2: #0f766e;
  --brand-text: #ffffff;
  --glow-1: rgba(13, 148, 136, 0.13);
  --glow-2: rgba(99, 102, 241, 0.09);
  --danger: #c0271c;
  --active: #16a34a;
  --online: #2563eb;
  --idle: #d97706;
  --locked: #7c3aed;
  --offline: #a3aeba;
  --shadow: 0 1px 2px rgba(15, 27, 38, 0.04), 0 4px 16px rgba(15, 27, 38, 0.05);
  --shadow-lg: 0 12px 40px rgba(15, 27, 38, 0.14);
  --radius: 16px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1015;
  --card: #131a21;
  --raised: #1a232c;
  --text: #e9eef3;
  --muted: #8d9cab;
  --line: #232e39;
  --brand: #2dd4bf;
  --brand-2: #14b8a6;
  --brand-text: #04211d;
  --glow-1: rgba(45, 212, 191, 0.1);
  --glow-2: rgba(129, 140, 248, 0.08);
  --danger: #f97066;
  --active: #22c55e;
  --online: #60a5fa;
  --idle: #f59e0b;
  --locked: #a78bfa;
  --offline: #55626f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 480px at 8% -8%, var(--glow-1), transparent 70%),
    radial-gradient(800px 460px at 100% 0%, var(--glow-2), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; overflow-wrap: anywhere; }
h2 { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.015em; line-height: 1.3; overflow-wrap: anywhere; }
h3 { font-size: 0.95rem; font-weight: 600; }

.ic {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted { color: var(--muted); font-size: 0.9rem; }

/* ---- header ---- */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}

.top-in {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.brand img { border-radius: 8px; }
.brand b { color: var(--brand); font-weight: 800; }
.brand span { font-weight: 700; }

.room-name {
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--line);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-name:empty { display: none; }

.top nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top .spacer { flex: 1; }
#themeBtn, #doorBtn { color: var(--muted); }
#doorBtn .on, #doorBtn[aria-pressed="true"] .off { display: none; }
#doorBtn[aria-pressed="true"] .on { display: block; }
#doorBtn[aria-pressed="true"] { color: var(--brand); }
#themeBtn .sun, :root[data-theme="dark"] #themeBtn .moon { display: none; }
:root[data-theme="dark"] #themeBtn .sun { display: block; }

.me-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px 4px 4px;
  cursor: pointer;
  min-width: 0;
  max-width: 220px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.me-chip:hover { border-color: var(--muted); }
.me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- layout ---- */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
section.narrow { max-width: 440px; margin: 4vh auto 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* ---- home ---- */
.home {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: start;
  padding-top: 4vh;
}
.hero { display: grid; gap: 20px; padding-top: 12px; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.08; letter-spacing: -0.04em; font-weight: 750; }
.accent {
  background: linear-gradient(100deg, var(--brand), #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead { font-size: 1.1rem; color: var(--muted); max-width: 46ch; }

.eyebrow {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--active);
  box-shadow: 0 0 0 0 var(--active);
  animation: live 2s ease-out infinite;
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--active) 55%, transparent); }
  100% { box-shadow: 0 0 0 9px transparent; }
}

.points { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 16px; }
.points li { display: flex; gap: 14px; align-items: flex-start; }
.points b { display: block; font-weight: 600; }
.points span { color: var(--muted); font-size: 0.92rem; }
.pt-ic {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--brand) !important;
  font-size: 1.05rem !important;
  background: color-mix(in srgb, var(--brand) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
}

.side { display: grid; gap: 16px; }
.room-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.room-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin: 0 -8px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.room-list a:hover { background: var(--raised); }

/* ---- forms ---- */
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.form small { font-weight: 400; color: var(--muted); font-size: 0.84rem; }

input, textarea, select {
  font: inherit;
  color: inherit;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { resize: vertical; min-height: 84px; display: block; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:focus, textarea:focus, select:focus {
  outline: none;
  background: var(--card);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.08s, box-shadow 0.15s, border-color 0.15s, background 0.15s, opacity 0.15s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:focus-visible, .me-chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.btn.primary {
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: var(--brand-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 4px 14px color-mix(in srgb, var(--brand) 28%, transparent);
}
.btn.primary:hover:not(:disabled) { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 6px 20px color-mix(in srgb, var(--brand) 40%, transparent); }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { border-color: var(--muted); }
.btn.icon { padding: 9px; }
.btn.small { padding: 5px 10px; font-size: 0.82rem; border-radius: 8px; }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; padding: 12px 16px; }
.btn.big { font-size: 1.1rem; padding: 15px 28px; border-radius: 14px; }
.btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; }

.row { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.row.between { justify-content: space-between; }

.error { color: var(--danger); font-size: 0.9rem; }
.notice {
  background: color-mix(in srgb, var(--idle) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--idle) 30%, transparent);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.join-head { display: flex; align-items: center; gap: 14px; }

/* ---- avatars ---- */
.avatar {
  --size: 44px;
  position: relative;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 650;
  font-size: calc(var(--size) * 0.38);
  letter-spacing: 0.01em;
  background: var(--offline);
  user-select: none;
}
.avatar.sm { --size: 30px; }
.avatar.lg { --size: 52px; }
.avatar.xl { --size: 92px; }

/* Status badge on the corner of an avatar */
.avatar .badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 3px solid var(--card);
  background: var(--offline);
}
.avatar.sm .badge { width: 11px; height: 11px; border-width: 2px; right: -3px; bottom: -3px; }
.badge.active { background: var(--active); }
.badge.online { background: var(--online); }
.badge.idle { background: var(--idle); }
.badge.locked { background: var(--locked); }
.badge.active::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  animation: live 2s ease-out infinite;
}

/* ---- board ---- */
.board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-variant-numeric: tabular-nums;
}
.stat i, .sw { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--offline); }
.stat i.active, .sw.active { background: var(--active); }
.stat i.online, .sw.online { background: var(--online); }
.stat i.idle, .sw.idle { background: var(--idle); }
.stat i.locked, .sw.locked { background: var(--locked); }

.banners { display: grid; gap: 8px; }
.banners:empty { display: none; }
.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--idle) 32%, var(--line));
  background: color-mix(in srgb, var(--idle) 9%, var(--card));
  font-size: 0.9rem;
}
.banner .ic { color: var(--idle); font-size: 1.1rem; }
.banner span { flex: 1; min-width: 0; }

.missed-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--line));
  background: color-mix(in srgb, var(--danger) 7%, var(--card));
  font-size: 0.92rem;
}
.missed-card > .ic { color: var(--danger); font-size: 1.15rem; }
.missed-body { flex: 1; min-width: 180px; display: grid; gap: 8px; }
.missed-body .note { font-size: 0.92rem; padding: 8px 12px; margin: 0; }
.report .bad { color: var(--danger); font-weight: 600; }

.people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
  gap: 12px;
}
.people:empty { display: none; }

.group-head {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.person {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.person:not(.offline):hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.person.offline { background: transparent; box-shadow: none; border-style: dashed; }
.person.offline .avatar { filter: grayscale(1); opacity: 0.55; }
.person.offline .name { color: var(--muted); }

/* Our own connection is down: what is shown is old, so it must not look live. */
.stale .people, .stale .stats, .stale .group-head { opacity: 0.4; filter: grayscale(1); pointer-events: none; }

.who { min-width: 0; flex: 1; }
.who .name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--raised);
  border-radius: 6px;
  padding: 1px 6px;
  vertical-align: 1px;
}
.who .status { font-size: 0.86rem; font-weight: 600; color: var(--muted); }
.status.active { color: var(--active); }
.status.online { color: var(--online); }
.status.idle { color: var(--idle); }
.status.locked { color: var(--locked); }
.who .pnote { font-size: 0.86rem; margin-top: 2px; overflow-wrap: anywhere; }
.who .pnote::before { content: "“"; }
.who .pnote::after { content: "”"; }
.status-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.watch {
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.watch:hover { color: var(--text); border-color: var(--muted); }
.watch.on { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: color-mix(in srgb, var(--brand) 10%, var(--card)); }
.who .device { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 0.8rem; margin-top: 1px; }
.who .device span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .device .ic { font-size: 0.85rem; }

.acts { display: flex; align-items: center; gap: 8px; flex: none; }
.btn.round { border-radius: 50%; padding: 9px; color: var(--muted); }
.btn.round:hover { color: var(--brand); }
.ping-btn { border-radius: 999px; padding: 8px 16px; }
.ping-btn.ringing {
  background: var(--idle);
  color: #201400;
  box-shadow: none;
  animation: wiggle 1s ease-in-out infinite;
}
.ping-btn.ringing:disabled { opacity: 1; cursor: default; }
.ping-btn.noanswer { background: var(--raised); color: var(--muted); box-shadow: none; border-color: var(--line); }
.ping-btn.answered { background: var(--active); color: #04210f; box-shadow: none; }
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-3deg); }
  40% { transform: rotate(3deg); }
  60% { transform: rotate(-2deg); }
  80% { transform: rotate(2deg); }
}

/* ---- dialogs ---- */
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  color: var(--text);
  padding: 26px;
  width: min(92vw, 400px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
dialog[open] { animation: pop 0.18s ease-out; }
dialog::backdrop { background: rgba(6, 10, 14, 0.55); backdrop-filter: blur(4px); }
@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.ping-dialog { text-align: center; padding: 36px 28px 28px; }
.ping-dialog[open] { display: grid; gap: 22px; justify-items: center; }
.ping-dialog h2 { font-size: 1.4rem; }
.ping-dialog .muted { margin-top: 4px; }

.replies { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.replies .big { grid-column: 1 / -1; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -6px; }

.notes { display: grid; gap: 8px; width: 100%; }
.notes:empty { display: none; }
.note {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1.02rem;
  text-align: left;
  overflow-wrap: anywhere;
}

.ringer { position: relative; display: grid; place-items: center; padding: 14px; }
.ringer::before, .ringer::after {
  content: "";
  position: absolute;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  animation: ring 1.8s ease-out infinite;
}
.ringer::after { animation-delay: 0.9s; }
@keyframes ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.75); opacity: 0; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg);
  z-index: 10;
  pointer-events: none; /* never in the way of what is under it */
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---- daily report ---- */
.report-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report-controls input { width: auto; padding: 8px 10px; background: var(--card); }

.table-wrap { padding: 0; overflow: hidden; }
.report { border-collapse: collapse; width: 100%; font-size: 0.9rem; table-layout: fixed; }
.report th, .report td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.report tbody tr:last-child td { border-bottom: 0; }
.report tbody tr:hover td { background: color-mix(in srgb, var(--raised) 60%, transparent); }
.report th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--raised);
}
.report th:first-child { border-top-left-radius: var(--radius); }
.report th:last-child { border-top-right-radius: var(--radius); }
.report .num { text-align: right; }
.report td { font-variant-numeric: tabular-nums; }
.report td.empty { color: var(--muted); text-align: center; padding: 36px; }
.report .cell-name { display: flex; align-items: center; gap: 12px; }
.report .name { font-weight: 600; }
.report .device { color: var(--muted); font-size: 0.8rem; }
.report .strong { font-weight: 600; }
.report .now { color: var(--active); font-weight: 600; }
.report .actions { display: flex; gap: 5px; justify-content: flex-end; }
.report .actions .btn.small { padding: 4px 8px; }

.tl-head { display: flex; justify-content: space-between; letter-spacing: 0; }

.timeline {
  position: relative;
  height: 18px;
  border-radius: 6px;
  background:
    linear-gradient(to right, var(--line) 1px, transparent 1px) 0 0 / 25% 100%,
    var(--raised);
  overflow: hidden;
}
.timeline i { position: absolute; top: 0; bottom: 0; min-width: 2px; }
.timeline i.active { background: var(--active); }
.timeline i.online { background: var(--online); }
.timeline i.idle { background: var(--idle); }
.timeline i.locked { background: var(--locked); }

.legend { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 0.84rem; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend .sw { border-radius: 3px; }

.seg { display: inline-flex; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button {
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 7px;
  padding: 6px 12px;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* Seven-day view: one cell per person per day, with a bar scaled to the longest day shown. */
.week th.day { text-align: left; cursor: pointer; }
.week th.day:hover { color: var(--text); }
.week th.day b { display: block; color: var(--text); font-size: 0.86rem; letter-spacing: 0; text-transform: none; }
.week th.today b { color: var(--brand); }
.week td.day { padding-left: 6px; padding-right: 6px; }
.week th.day { padding-left: 6px; padding-right: 6px; }
.week td.day .dl { display: none; color: var(--muted); font-size: 0.72rem; }
.week td.day .t { font-size: 0.86rem; }
.week td.day.none .t { color: var(--muted); }
.daybar { display: flex; height: 6px; margin-top: 5px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.daybar i { display: block; height: 100%; }
.daybar .active { background: var(--active); }
.daybar .idle { background: var(--idle); }
.daybar .other { background: var(--online); }

/* ---- fun room: the office scene ---- */
.roll {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, var(--card));
  font-size: 0.92rem;
}
.roll .who { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 200px; }
.roll .chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 0.82rem; font-weight: 600; }
.roll .chip.here, .roll .chip.soon, .roll .chip.call { border-color: color-mix(in srgb, var(--active) 55%, var(--line)); }
.roll .chip.missed { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); color: var(--danger); }
.roll .chip.pending { opacity: 0.7; }
.roll .chip small { font-weight: 500; color: var(--muted); }
.head-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.tag.role { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--card)); }
.check { display: flex !important; grid-template-columns: none; align-items: flex-start; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--brand); padding: 0; }
.check small { display: block; }
.field-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.field-label small { display: block; font-weight: 400; color: var(--muted); font-size: 0.84rem; }
#roleField .presets { margin-top: 0; }
#roleField { display: grid; gap: 10px; }
.look-pick { display: flex; gap: 14px; align-items: center; }
#lookPreview { flex: none; width: 92px; height: 104px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); overflow: hidden; }
.portrait { display: block; width: 100%; height: 100%; }
.look-controls { display: grid; gap: 8px; }
.device-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.device-row .muted { margin-right: auto; }
.fun-menu {
  position: fixed;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 280px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.14s ease-out;
}
.btn.picked { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--card)); }

.scene {
  --sc-wall: #e7f0ee;
  --sc-floor: #e7d6bd;
  --sc-plank: rgba(120, 88, 48, 0.13);
  --sc-base: #cfb995;
  --sc-desk: #d6ad7b;
  --sc-deskfront: #c29865;
  --sc-chair: #6b7b8c;
  --sc-laptop: #3a4756;
  --sc-plate: #ffffff;
  --sc-plate-text: #17212b;
  --sc-board: #ffffff;
  --sc-frame: #8d7250;
  --sc-door: #c0966a;
  --sc-door-panel: #b58a5d;
  --sc-counter: #a5835c;
  --sc-machine: #46525f;
  --sc-ink: #1f2933;
  --sc-shadow: rgba(40, 26, 10, 0.13);
  --sc-dim: rgba(8, 14, 30, 0);
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--sc-wall);
}
:root[data-theme="dark"] .scene {
  --sc-wall: #18252d;
  --sc-floor: #2c2219;
  --sc-plank: rgba(255, 222, 170, 0.06);
  --sc-base: #1f1811;
  --sc-desk: #80603f;
  --sc-deskfront: #684c31;
  --sc-chair: #3c4957;
  --sc-laptop: #0d141a;
  --sc-plate: #101920;
  --sc-plate-text: #e8edf2;
  --sc-board: #24333d;
  --sc-frame: #4d3c2a;
  --sc-door: #5c4630;
  --sc-door-panel: #523e2a;
  --sc-counter: #513f2c;
  --sc-machine: #1f2831;
  --sc-ink: #dfe7ee;
  --sc-shadow: rgba(0, 0, 0, 0.4);
}
.scene > svg { display: block; width: 100%; height: auto; font-family: inherit; }
.scene-hint { margin-top: -8px; }
/* On a narrow screen the room keeps a readable size and scrolls sideways inside its own frame. */
.scene-scroll { overflow-x: auto; border-radius: var(--radius); -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.swipe-hint { display: none; }
@media (max-width: 900px) {
  .scene-scroll.zoomed .scene { min-width: 860px; }
  .swipe-hint { display: inline; }
}

.sc-wall { fill: var(--sc-wall); }
.sc-floor { fill: var(--sc-floor); }
.sc-plank { stroke: var(--sc-plank); stroke-width: 2; }
.sc-base { fill: var(--sc-base); }
.sc-sun-patch { fill: #fff6d6; opacity: 0.28; }
:root[data-theme="dark"] .sc-sun-patch { opacity: 0.07; }
.sc-frame { fill: var(--sc-frame); }
.sc-mullion { stroke: var(--sc-frame); stroke-width: 6; }
.sc-door { fill: var(--sc-door); }
.sc-door-panel { fill: var(--sc-door-panel); }
.sc-knob { fill: #e8c46a; }
.sc-hook { fill: none; stroke: var(--sc-frame); stroke-width: 2; stroke-linecap: round; }
.sc-board { fill: var(--sc-board); stroke: var(--sc-frame); stroke-width: 5; }
.sc-board-title { fill: var(--sc-ink); font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.sc-board-sub { fill: var(--muted); font-size: 14px; font-weight: 600; }
.sc-board-title.small { font-size: 15px; }
.sc-board-sub.small { font-size: 11px; }
.sc-meet-wall { fill: color-mix(in srgb, var(--sc-wall) 86%, #2a4a5a); }
.sc-meet-chart { fill: none; stroke: #7ef0c5; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sc-meet-label { fill: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; }
.sc-meet-name { fill: #ffffff; font-size: 9.5px; font-weight: 650; }
.sc-meet-name.me { fill: #a7f3e3; }
.sc-glass { fill: #bfe9ff; opacity: 0.1; pointer-events: none; }
.sc-glass-shine { fill: #ffffff; opacity: 0.1; pointer-events: none; }
.sc-meet { cursor: pointer; outline: none; }
.sc-meet:hover .sc-fig, .sc-meet:focus-visible .sc-fig { filter: brightness(1.12); }
.sc-board-line { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; }
.sc-clock { fill: var(--sc-board); stroke: var(--sc-frame); stroke-width: 5; }
.sc-tick { stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.sc-hand { stroke: var(--sc-ink); stroke-linecap: round; }
.sc-hand.hour { stroke-width: 3.6; }
.sc-hand.minute { stroke-width: 2.2; }
.sc-jar { fill: #e3b94f; }
.sc-mug { fill: #ffffff; stroke: #c9d2da; stroke-width: 1; }
.sc-mug-handle { fill: none; stroke: #ffffff; stroke-width: 2.2; stroke-linecap: round; }
.sc-counter { fill: var(--sc-counter); }
.sc-countertop { fill: var(--sc-desk); }
.sc-counter-line { stroke: rgba(0, 0, 0, 0.18); stroke-width: 2; }
.sc-machine { fill: var(--sc-machine); }
.sc-machine-face { fill: rgba(255, 255, 255, 0.14); }
.sc-kettle { fill: #d9a441; }
.sc-kettle-handle { fill: none; stroke: #d9a441; stroke-width: 4; stroke-linecap: round; }
.sc-steam { fill: none; stroke: #ffffff; stroke-width: 2; stroke-linecap: round; opacity: 0.75; animation: sc-steam 2.6s ease-in-out infinite; }
:root:not([data-theme="dark"]) .sc-steam { stroke: #9aa7b3; }
.sc-star { animation: sc-twinkle 3s ease-in-out infinite; }
.sc-star:nth-of-type(odd) { animation-delay: 1.4s; }

/* evening and night: the room dims and the desk lamps carry it */
.sc-dim { fill: #070d1c; opacity: 0; pointer-events: none; }
.part-dusk .sc-dim { opacity: 0.1; }
.part-night .sc-dim { opacity: 0.22; }
:root[data-theme="dark"] .part-night .sc-dim { opacity: 0.3; }
.sc-glow { opacity: 0.5; pointer-events: none; }
.part-dusk .sc-glow { opacity: 0.8; }
.part-night .sc-glow, :root[data-theme="dark"] .sc-glow { opacity: 1; }

.sc-shadow { fill: var(--sc-shadow); }
.sc-chair { fill: var(--sc-chair); }
.sc-desktop { fill: var(--sc-desk); }
.sc-deskfront { fill: var(--sc-deskfront); }
.sc-plate { fill: var(--sc-plate); }
.sc-plate-text { fill: var(--sc-plate-text); font-size: 10.5px; font-weight: 650; }
.me .sc-plate { fill: var(--brand); }
.me .sc-plate-text { fill: var(--brand-text); }
.sc-me-ring { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-dasharray: 5 6; opacity: 0.8; }
.sc-laptop { fill: var(--sc-laptop); }
.sc-logo { fill: #6b7885; }
.sc-logo.on { fill: #7ef0c5; animation: sc-pulse 2.4s ease-in-out infinite; }
.sc-lamp, .sc-lamp-arm { fill: #56636f; stroke: #56636f; stroke-width: 2.4; stroke-linecap: round; }
.sc-shade { fill: #7d8894; }
.sc-shade.on { fill: #f5b83d; }
.sc-sticky { fill: #fde047; stroke: #d4b106; stroke-width: 0.8; }
.sc-badge circle { fill: var(--locked); }
.sc-badge.miss circle { fill: var(--danger); }
.sc-badge.miss path { stroke-width: 2.4; }
.sc-badge.wait circle { fill: var(--idle); }
.sc-badge.wait .dot { fill: #201400; animation: sc-dots 1.2s ease-in-out infinite; }
.sc-badge.wait .d1 { animation-delay: 0.2s; }
.sc-badge.wait .d2 { animation-delay: 0.4s; }
.sc-arm { transform-box: fill-box; transform-origin: 0% 100%; animation: sc-wave 0.9s ease-in-out infinite alternate; }
.sc-zzz { fill: var(--muted); font-size: 11px; font-weight: 700; opacity: 0; animation: sc-zzz 2.8s ease-in-out infinite; }
.sc-zzz.z1 { animation-delay: 0.5s; font-size: 13px; }
.sc-zzz.z2 { animation-delay: 1s; font-size: 15px; }
.sc-rain { fill: none; stroke: #dbeafe; stroke-width: 1.6; stroke-linecap: round; opacity: 0.85; animation: sc-fall 0.75s linear infinite; }
.sc-snow { fill: #ffffff; opacity: 0.95; animation: sc-fall 5s linear infinite; }
.sc-rain.r1, .sc-snow.r1 { animation-delay: -0.3s; }
.sc-rain.r2 { animation-delay: -0.55s; }
.sc-snow.r1 { animation-delay: -1.8s; }
.sc-snow.r2 { animation-delay: -3.4s; }
.sc-lunch { cursor: pointer; outline: none; }
.sc-lunch:hover .sc-plate, .sc-lunch:focus-visible .sc-plate { stroke: var(--brand); stroke-width: 2.5; }
@keyframes sc-dots { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes sc-wave { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes sc-zzz { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: 0.9; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes sc-fall { from { transform: translateY(-20px); } to { transform: translateY(190px); } }
.sc-badge.call circle { fill: var(--online); }
.sc-badge .solid { fill: #ffffff; stroke: none; }
.sc-logo.call { fill: #7cc0ff; }
.sc-away { fill: var(--sc-plate); font-size: 8.5px; font-weight: 600; opacity: 0.92; }
.sc-stand .sc-away { fill: var(--muted); font-size: 9.5px; }
.sc-wait { opacity: 0; }
.sc-eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: sc-blink 9.2s infinite; }
.sc-typing .sc-hand { animation: sc-tap 0.26s ease-in-out infinite alternate; }
.sc-typing .sc-hand.r { animation-delay: -0.13s; }
.sc-swing { transform-box: fill-box; transform-origin: 50% 0%; animation: sc-step 0.42s ease-in-out infinite alternate; }
.sc-swing.a { animation-direction: alternate-reverse; }
.sc-bob { animation: sc-bob 0.42s ease-in-out infinite alternate; }
.sc-arm2 { transform-box: fill-box; }
.sc-arm2.l { transform-origin: 100% 6%; }
.sc-arm2.r { transform-origin: 0% 6%; }
.sc-sip-pose { opacity: 0; }
.sc-sit { animation: sc-sit 0.38s ease-out; transform-box: fill-box; transform-origin: 50% 100%; }
/* habits, each on the person's own beat */
.stretchy .sc-arm2.l { animation: sc-stretch-l 26s ease-in-out infinite; animation-delay: var(--beat, 0s); }
.stretchy .sc-arm2.r { animation: sc-stretch-r 26s ease-in-out infinite; animation-delay: var(--beat, 0s); }
.sipper .sc-arm2.r { animation: sc-sip-hide 11s linear infinite; animation-delay: var(--beat, 0s); }
.sipper .sc-sip-pose { animation: sc-sip-show 11s linear infinite; animation-delay: var(--beat, 0s); }
.sipper .sc-cup { animation: sc-sip-hide 11s linear infinite; animation-delay: var(--beat, 0s); }
.sc-fig.sc-greet .sc-arm2.r { animation: sc-greet 0.95s ease-in-out; }
.sc-leaf.dry { fill: #a9b56a; }
.sc-leaf.dry.dark { fill: #93a05a; }
.sc-thirst { fill: #ffffff; stroke: #7cc6f2; stroke-width: 1.5; }
.sc-thirst-drop { fill: #4aa3df; animation: sc-pulse 1.8s ease-in-out infinite; }
.sc-station { cursor: pointer; outline: none; }
.sc-spot { cursor: pointer; outline: none; }
.sc-spot:focus-visible > .sc-frame, .sc-spot:focus-visible > .sc-desktop, .sc-spot:focus-visible > .sc-sofa.back, rect.sc-spot:focus-visible { stroke: var(--brand); stroke-width: 2.5; }
.sc-sofa { fill: #6d8fb5; }
.sc-sofa.back { fill: #58789d; }
.sc-sofa.arm { fill: #4b6a8e; }
.sc-sofa.pillow { fill: #e9b872; }
.sc-sofa-seam { fill: none; stroke: rgba(20, 35, 55, 0.25); stroke-width: 2; stroke-linecap: round; }
.sc-station:hover .sc-machine, .sc-station:focus-visible .sc-machine { stroke: var(--brand); stroke-width: 2.5; }
.sc-boss-plaque { fill: #3b2a10; font-size: 6.2px; font-weight: 800; letter-spacing: 0.06em; }
.sc-boss-frame { transform-box: fill-box; transform-origin: 50% 0%; transition: transform 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
.sc-boss-frame.crooked { transform: rotate(-8deg); }
.sc-boss:hover .sc-boss-frame rect:first-child, .sc-boss:focus-visible .sc-boss-frame rect:first-child { stroke: var(--brand); stroke-width: 2.5; }
/* with nobody walking, the portrait slowly looks the room over */
.sc-boss-pupils { animation: sc-boss-scan 16s ease-in-out infinite; }
.sc-boss-nod { animation: sc-boss-nod 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes sc-boss-scan { 0%, 30%, 100% { transform: translate(0, 0.6px); } 38%, 52% { transform: translate(-2.2px, 0.9px); } 62%, 78% { transform: translate(2.2px, 0.9px); } 88% { transform: translate(0, 0.6px); } }
@keyframes sc-boss-nod { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(4deg); } }
.sc-order-sign { fill: #ffffff; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; opacity: 0.85; pointer-events: none; }
.sc-slip { fill: #fffdf2; stroke: #d9cfa6; stroke-width: 1; }
.sc-slip-text { fill: #3b3524; font-size: 8px; font-weight: 700; }
.sc-slip-text.small { font-size: 5.6px; font-weight: 600; fill: #8a7f5c; }
@keyframes sc-sit { from { opacity: 0.4; transform: translateY(-12px) scaleY(1.08); } to { opacity: 1; transform: none; } }
@keyframes sc-stretch-l { 0%, 86%, 100% { transform: rotate(0); } 89%, 96% { transform: rotate(118deg); } }
@keyframes sc-stretch-r { 0%, 86%, 100% { transform: rotate(0); } 89%, 96% { transform: rotate(-118deg); } }
@keyframes sc-sip-show { 0%, 81.9%, 96.1%, 100% { opacity: 0; } 82%, 96% { opacity: 1; } }
@keyframes sc-sip-hide { 0%, 81.9%, 96.1%, 100% { opacity: 1; } 82%, 96% { opacity: 0; } }
@keyframes sc-greet { 0%, 100% { transform: rotate(0); } 30%, 70% { transform: rotate(-112deg); } 50% { transform: rotate(-96deg); } }
.sc-can { transform-box: fill-box; transform-origin: 30% 60%; }
.sc-pour { fill: none; stroke: #7cc6f2; stroke-width: 1.8; stroke-linecap: round; opacity: 0; }
.sc-record { fill: #111827; stroke: #4b5563; stroke-width: 1; }
.music .sc-desk .sc-fig > g, .music .sc-meet .sc-fig, .music .sc-lunch .sc-fig { animation: sc-nod 0.48s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
/* a blink, and now and then a glance towards the window */
@keyframes sc-blink { 0%, 44%, 58%, 93%, 100% { transform: translateX(0) scaleY(1); } 47%, 55% { transform: translateX(1.7px) scaleY(1); } 96% { transform: translateX(0) scaleY(0.12); } }
@keyframes sc-tap { from { transform: translateY(0); } to { transform: translateY(-1.8px); } }
@keyframes sc-bob { from { transform: translateY(0); } to { transform: translateY(-2.6px); } }
@keyframes sc-nod { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }
.sc-leg { transform-box: fill-box; transform-origin: 50% 0%; animation: sc-step 0.42s ease-in-out infinite alternate; }
.sc-leg.b { animation-direction: alternate-reverse; }
.sc-walker { pointer-events: none; }
@keyframes sc-step { from { transform: rotate(-20deg); } to { transform: rotate(20deg); } }
.sc-badge rect { fill: #ffffff; }
.sc-badge path { fill: none; stroke: #ffffff; stroke-width: 1.9; stroke-linecap: round; }
.sc-bubble rect, .sc-bubble path { fill: var(--card); stroke: var(--line); stroke-width: 1; }
.sc-bubble path { stroke: none; }
.sc-bubble text { fill: var(--text); font-size: 11px; font-weight: 550; }
.sc-bell circle { fill: var(--idle); }
.sc-bell path { fill: none; stroke: #201400; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.sc-bell { animation: sc-ring 0.9s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0%; }

.sc-desk, .sc-stand { cursor: pointer; outline: none; }
.sc-desk.st-offline { opacity: 0.42; }
:root[data-theme="dark"] .sc-desk.st-offline { opacity: 0.55; }
.sc-desk.st-locked .sc-shade, .sc-desk.st-offline .sc-shade { fill: #7d8894; }
.sc-desk:hover .sc-plate, .sc-stand:hover .sc-plate,
.sc-desk:focus-visible .sc-plate, .sc-stand:focus-visible .sc-plate { stroke: var(--brand); stroke-width: 2.5; }
.sc-desk.st-offline:hover { opacity: 0.7; }

.sc-typing { animation: sc-type 1.1s ease-in-out infinite; }
.sc-in { animation: sc-in 0.5s ease-out; transform-box: fill-box; transform-origin: 50% 100%; }
.sc-hop { animation: sc-hop 0.55s ease-out; }

@keyframes sc-type { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
@keyframes sc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes sc-steam { 0% { opacity: 0; transform: translateY(3px); } 40% { opacity: 0.8; } 100% { opacity: 0; transform: translateY(-5px); } }
@keyframes sc-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes sc-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(6deg); } }
@keyframes sc-in { from { opacity: 0; transform: translateY(8px) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes sc-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-9px); } }

.sc-cat-body { fill: #f0a24d; }
.sc-cat-chest { fill: #fbe3c2; }
.sc-cat-ear { fill: #d6862f; }
.sc-cat-tail { fill: none; stroke: #f0a24d; stroke-width: 5; stroke-linecap: round; transform-box: fill-box; transform-origin: 0% 100%; animation: sc-tail 3.2s ease-in-out infinite; }
.sc-cat-eye { fill: #1f2933; }
.sc-cat-nose { fill: #c2566b; }
.sc-mug-handle.dark { stroke: #c9d2da; }
.sc-leaf { fill: #4d9a63; }
.sc-leaf.dark { fill: #3b8554; }
.sc-petal { fill: #f472b6; }
.sc-plant { transform-box: fill-box; transform-origin: 50% 100%; }
.sc-plant.grow { animation: sc-grow 0.9s ease-out; }
.sc-note { fill: var(--brand); font-size: 30px; font-weight: 700; opacity: 0; animation: sc-note 3.4s ease-in-out infinite; }
.sc-note.n1 { animation-delay: 0.8s; fill: #a855f7; }
.sc-note.n2 { animation-delay: 1.6s; fill: #f59e0b; }
.sc-note.n3 { animation-delay: 2.4s; fill: #f43f5e; }
@keyframes sc-tail { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(14deg); } }
@keyframes sc-grow { 0% { transform: scale(0.86); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes sc-note { 0% { opacity: 0; transform: translateY(14px) rotate(-8deg); } 25% { opacity: 0.95; } 75% { opacity: 0.95; } 100% { opacity: 0; transform: translateY(-46px) rotate(10deg); } }
.scene-confetti { position: absolute; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; z-index: 2; opacity: 0; }

.scene-emoji { position: absolute; font-size: 30px; line-height: 1; pointer-events: none; z-index: 2; transform: translate(-50%, -100%); opacity: 0; }

.scene-pop {
  position: absolute;
  z-index: 3;
  width: min(380px, calc(100vw - 48px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: pop 0.14s ease-out;
}
.scene-pop .people { grid-template-columns: minmax(0, 1fr); }
.scene-pop .person { border: 0; box-shadow: none; background: none; padding: 10px; }
.scene-pop .person:hover { transform: none; }
.scene-pop .person.offline .avatar { filter: grayscale(1); }
.pop-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 10px 8px; }
.pop-row:empty { display: none; }

/* ---- small screens ---- */
@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; gap: 32px; padding-top: 0; }
}

@media (max-width: 600px) {
  main { padding: 22px 16px 72px; }
  .top-in { padding: 8px 16px; }
  .top .lbl, .room-name { display: none; }
  .brand span { display: none; }
  .top .btn.ghost { padding: 9px; }
  .me-chip { max-width: 150px; }
  .people { grid-template-columns: minmax(0, 1fr); }
  .person { padding: 12px; gap: 12px; }
  .ping-btn { padding: 8px 13px; }
  h1 { font-size: 1.45rem; }
}

@media (max-width: 420px) {
  .me-chip { padding: 4px; }
  .me-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* status in one tap: the row of chips above the room */
.status-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.status-bar .spacer { flex: 1; }
.status-bar.left { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; gap: 10px; }
.status-left { color: var(--muted); font-size: 14px; flex: 1; min-width: 180px; }
.chip { font: inherit; font-size: 13px; font-weight: 550; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { border-color: var(--brand); }
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chip.picked { background: var(--brand); border-color: var(--brand); color: var(--brand-text); }
.chip.leave { color: var(--muted); }

/* The report fits its card: few columns, totals under the timeline, actions behind one button. */
.report .c-name { width: 26%; }
.report .c-when { width: 150px; }
.report .c-more { width: 56px; }
.report .cell-name > div:last-child { min-width: 0; }
.report .more { padding: 2px 10px; font-size: 1.1rem; line-height: 1.2; }
.report .left-tag { margin-top: 3px; font-size: 0.78rem; font-weight: 600; color: var(--locked); }
.totals { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 6px; font-size: 0.8rem; color: var(--muted); }
.totals b { color: var(--text); font-weight: 600; }
.totals .bad { color: var(--danger); font-weight: 600; }
.timeline .mark { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--text); }
.legend .sw.mark { width: 3px; background: var(--text); }
@media (max-width: 760px) {
  .report thead { display: none; }
  .report tbody tr:hover td { background: none; }
  .report, .report tbody, .report tr, .report td { display: block; width: auto; }
  .report tr { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .report tbody tr:last-child { border-bottom: 0; }
  .report td { padding: 4px 0; border: 0; }
  .report td.who { padding-right: 48px; }
  .report td.more-cell { position: absolute; top: 10px; right: 10px; padding: 0; }
  .week tr { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px 6px; }
  .week td.who { grid-column: 1 / -1; padding-right: 0; }
  .week td.day { padding: 4px 0; }
  .week td.day .dl { display: block; }
}

/* a timed status that has run out */
.sc-bubble.late rect, .sc-bubble.late path { fill: #fde9c8; stroke: #e0a94e; }
.sc-bubble.late text { fill: #7a4a06; }
.pnote.late { color: var(--idle); font-weight: 600; }
/* the arcade cabinet and the cat's own walks */
.sc-arcade-body { fill: #3b3f73; }
.sc-arcade-top { fill: #f472b6; }
.sc-arcade-name { fill: #ffffff; font-size: 7px; font-weight: 800; letter-spacing: 0.08em; }
.sc-arcade-screen { fill: #0c1424; stroke: #7ef0c5; stroke-width: 1; }
.sc-arcade-hi { fill: #f9a8d4; font-size: 7.5px; font-weight: 800; }
.sc-arcade-score { fill: #7ef0c5; font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sc-arcade-panel { fill: #2a2d57; }
.sc-arcade-slot { fill: #23264a; }
.sc-arcade:hover .sc-arcade-body, .sc-arcade:focus-visible .sc-arcade-body { stroke: var(--brand); stroke-width: 2.5; }
.sc-trot { animation: sc-trot 0.3s ease-in-out infinite alternate; }
@keyframes sc-trot { from { transform: translateY(0); } to { transform: translateY(-3px); } }

/* message of the day */
.motd { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 12px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--brand) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); }
.motd-icon { font-size: 1.3rem; }
.motd-body { flex: 1; min-width: 0; }
.motd-text { font-weight: 600; overflow-wrap: anywhere; }
.motd-by { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.motd-bubble { position: absolute; z-index: 3; max-width: 240px; padding: 8px 12px; border-radius: 12px; background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 0.85rem; font-weight: 600; overflow-wrap: anywhere; pointer-events: none; animation: toast-in 0.2s ease-out; }

/* the whiteboard: the window with the tasks, and the board on the wall */
#boardBtn.has { border-color: var(--brand); color: var(--brand-2); font-weight: 650; }
dialog.wide { width: min(560px, calc(100vw - 24px)); }
.wb-list { max-height: min(52vh, 460px); overflow-y: auto; display: grid; gap: 14px; }
.wb-group h3 { margin: 0 0 6px; font-size: 0.86rem; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.wb-group.me h3 { color: var(--brand-2); }
.wb-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wb-task { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.wb-group.me .wb-task { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.wb-task input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.wb-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.wb-from { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.wb-task.done .wb-text > div:first-child { text-decoration: line-through; color: var(--muted); }
.wb-task .btn.small { padding: 2px 8px; }
.wb-empty { text-align: center; padding: 18px 0; margin: 0; }
.wb-add { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; gap: 8px; }
@media (max-width: 520px) { .wb-add { grid-template-columns: minmax(0, 1fr) auto; } .wb-add select { grid-column: 1 / -1; } }
.sc-wb-face { fill: #fbfcfd; stroke: #d5dbe1; stroke-width: 1; }
.sc-wb-head { fill: #7a8794; font-size: 7.5px; font-weight: 800; letter-spacing: 0.08em; }
.sc-wb-line { stroke: #d5dbe1; stroke-width: 1; }
.sc-wb-note { fill: #ffe27a; stroke: rgba(90, 70, 0, 0.25); stroke-width: 0.8; }
.sc-wb-note.me { fill: #ffb3c7; }
.sc-wb-name { fill: #3b3320; font-size: 8.5px; font-weight: 700; }
.sc-wb-scribble { fill: none; stroke: #b8c2cc; stroke-width: 2; stroke-linecap: round; }
.sc-wb-badge circle { fill: #e25555; stroke: #ffffff; stroke-width: 1.5; }
.sc-wb-badge text { fill: #ffffff; font-size: 10px; font-weight: 800; }
.sc-wb:hover .sc-wb-frame, .sc-wb:focus-visible .sc-wb-frame { stroke: var(--brand); stroke-width: 2.5; }

/* ---- phones: a compact page with a tab bar at the bottom ---- */
.tabbar, .scene-zoom { display: none; }
.banner.fold { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.banner.fold b { font-weight: 600; color: var(--brand-2); }
@media (max-width: 900px) {
  .scene-zoom:not([hidden]) { display: flex; width: max-content; margin: 0 0 8px auto; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  main { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  .top-in { padding: 6px 12px; gap: 6px; }
  .top nav { gap: 4px; }
  .top .btn.ghost { padding: 7px; }
  #meChip, #boardBtn { display: none; }
  h1 { font-size: 1.2rem; }
  .board-head { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 10px; }
  .board-head .muted { font-size: 0.82rem; }
  .head-right { justify-content: flex-start; gap: 6px; width: 100%; }
  .head-right .btn { padding: 6px 10px; font-size: 0.82rem; }
  .seg button { padding: 4px 10px; font-size: 0.82rem; }
  .stats { gap: 6px; }
  .stat { padding: 3px 8px; font-size: 0.78rem; }
  .banner { padding: 7px 10px; gap: 8px; font-size: 0.82rem; }
  .motd { padding: 8px 12px; gap: 8px; margin-bottom: 8px; }
  .motd-icon { font-size: 1.05rem; }
  .status-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 10px; padding: 0 12px 2px; }
  .status-bar::-webkit-scrollbar { display: none; }
  .status-bar .chip { flex: none; padding: 5px 11px; font-size: 12.5px; }
  .status-bar .spacer { display: none; }
  .status-bar.left { flex-wrap: wrap; margin: 0 0 10px; padding: 8px 10px; }
  .people { gap: 8px; }
  .person { padding: 9px 10px; gap: 10px; border-radius: 12px; }
  .person .avatar { --size: 36px; }
  .person .device { display: none; }
  .ping-btn { padding: 6px 11px; font-size: 0.84rem; }
  .scene-hint { font-size: 0.78rem; }
  dialog { padding: 18px; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .tabbar:not([hidden]) {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .tabbar button { position: relative; display: grid; justify-items: center; gap: 1px; padding: 6px 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.7rem; font-weight: 600; cursor: pointer; border-radius: 10px; }
  .tabbar button .ic { font-size: 1.25rem; }
  .tabbar button[aria-current="page"] { color: var(--brand-2); }
  .tab-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #ffffff; font-size: 0.66rem; line-height: 16px; text-align: center; }
}

/* ---- accounts and organisations ---- */
.org-link::after { content: "›"; margin-left: 10px; color: var(--muted); }
.org-link { color: var(--muted); text-decoration: none; }
.org-link:hover { color: var(--text); }
.org-promo { display: grid; gap: 10px; justify-items: start; }
#view-account { display: grid; gap: 16px; }
#view-account[hidden] { display: none; }
.grow { flex: 1; min-width: 0; }
.small { font-size: 0.8rem; }
.narrow-card { max-width: 460px; }
.org-rooms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.org-room { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.org-room-main { display: grid; gap: 6px; padding: 16px; color: inherit; text-decoration: none; flex: 1; border-radius: var(--radius); }
.org-room-main:hover { background: var(--raised); }
.org-room-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.org-room-top b { font-size: 1.02rem; overflow-wrap: anywhere; }
.org-room-count { color: var(--muted); font-size: 0.88rem; }
.org-room-count.on { color: var(--active); font-weight: 600; }
.org-room-names { color: var(--muted); font-size: 0.82rem; min-height: 1.2em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-room.mine { border-color: var(--brand); }
.org-room-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.org-room-tools:empty { display: none; }
.org-room-tools select { width: auto; padding: 4px 8px; font-size: 0.82rem; }
#orgRooms { display: grid; gap: 22px; margin-bottom: 28px; }
.org-building { display: grid; gap: 14px; }
.org-building-name { font-size: 1.1rem; }
.org-floor { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; align-items: start; padding-top: 14px; border-top: 1px solid var(--line); }
.org-floor:first-of-type { border-top: 0; padding-top: 0; }
.org-floor > .org-rooms:only-child { grid-column: 1 / -1; }
.org-floor-name { display: grid; gap: 2px; position: sticky; top: 70px; }
.org-floor-name span { color: var(--muted); font-size: 0.82rem; }
.org-empty { padding: 14px 0; }
.org-search { margin-bottom: 18px; display: grid; gap: 8px; max-width: 460px; }
.org-b { background: var(--raised); }
.org-f { margin-left: 18px; }
.tag.walk { color: var(--brand-2); text-decoration: none; cursor: pointer; }
.tag.walk:hover { text-decoration: underline; }
@media (max-width: 640px) { .org-floor { grid-template-columns: minmax(0, 1fr); gap: 8px; } .org-floor-name { position: static; display: flex; gap: 10px; align-items: baseline; } }
.org-admin { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.org-admin > * { min-width: 0; }
@media (max-width: 1000px) { .org-admin { grid-template-columns: minmax(0, 1fr); } }
.org-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.org-row input { grid-column: 1 / -1; }
.org-row select, .org-person select { width: auto; }
.org-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.org-people:empty { display: none; }
.org-people li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.org-people .grow { flex-basis: 140px; overflow-wrap: anywhere; }
.org-person.pending { border-color: var(--idle); background: color-mix(in srgb, var(--idle) 8%, var(--card)); }
.org-person .name { font-weight: 600; overflow-wrap: anywhere; }
.org-person select { padding: 5px 8px; }
@media (max-width: 640px) {
  #accountNav { padding: 7px 10px; font-size: 0.82rem; }
}

/* scoped admins, restricted rooms, the organisation report */
.org-room.locked { opacity: 0.72; border-style: dashed; box-shadow: none; }
.org-room.locked .org-room-main:hover { background: none; }
.scopes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag.scope { display: inline-flex; align-items: center; gap: 4px; }
.tag.scope button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 2px; font: inherit; }
.org-person .scope-pick { max-width: 150px; font-size: 0.82rem; }
.access-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 42vh; overflow-y: auto; }
.access-list.off { opacity: 0.45; pointer-events: none; }
.roll-rooms { justify-content: flex-start; margin-bottom: 14px; flex-wrap: wrap; }
.totals.rooms { margin-top: 2px; font-size: 0.76rem; }
#rollScope { width: auto; padding: 8px 10px; background: var(--card); }

/* ---- the organisation drawn as a building ---- */
.bd { --bd-frame: #8d7250; --bd-roof: #6f5a3f; --bd-floor: #e7d6bd; --bd-base: #cfb995; max-width: 100%; }
:root[data-theme="dark"] .bd { --bd-frame: #5d4a33; --bd-roof: #4a3b29; --bd-floor: #5b5142; --bd-base: #4d4437; }
.bd-roof { position: relative; height: 34px; margin: 26px 0 0; background: var(--bd-roof); clip-path: polygon(2.5% 0, 97.5% 0, 100% 100%, 0 100%); }
.bd-name { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); background: var(--brand); color: var(--brand-text); font-weight: 800; font-size: 1.05rem; padding: 6px 22px; border-radius: 10px; white-space: nowrap; }
.bd-roof { overflow: visible; clip-path: none; border-radius: 10px 10px 0 0; }
.bd-body { background: var(--bd-frame); padding: 8px 8px 0; border-radius: 0 0 10px 10px; margin: 0 1.2%; }
.bd-floor { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px; padding-bottom: 8px; }
.bd-lift { background: #566473; border-radius: 4px; color: #ffffff; display: grid; grid-template-rows: auto auto 1fr; justify-items: center; padding: 10px 6px 0; gap: 2px; }
.bd-lift b { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #7ef0c5; text-align: center; overflow-wrap: anywhere; }
.bd-lift span { font-size: 0.72rem; color: #c9d2da; }
.bd-lift i { width: 52px; align-self: end; height: 86px; margin-top: 8px; border-radius: 4px 4px 0 0; background: linear-gradient(to right, #c9d2da 49%, #8b98a5 49%, #8b98a5 51%, #c9d2da 51%); }
.bd-rooms { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.bd-room { position: relative; flex: 1 1 0; min-width: 200px; height: 188px; border-radius: 4px; overflow: hidden; color: #17212b; text-decoration: none; display: block;
  background: linear-gradient(to bottom, var(--wall, #e7f0ee) 0, var(--wall, #e7f0ee) calc(100% - 44px), var(--bd-base) calc(100% - 44px), var(--bd-base) calc(100% - 40px), var(--bd-floor) calc(100% - 40px)); }
.bd-room.team { --wall: #e7f0ee; }
.bd-room.meeting { --wall: #d3e3ea; }
.bd-room.booth { --wall: #efe6dc; flex: 0.55 1 0; min-width: 150px; }
.bd-room.lounge { --wall: #f3ead9; }
:root[data-theme="dark"] .bd-room.team { --wall: #33413f; }
:root[data-theme="dark"] .bd-room.meeting { --wall: #2f3f47; }
:root[data-theme="dark"] .bd-room.booth { --wall: #413a33; }
:root[data-theme="dark"] .bd-room.lounge { --wall: #433c30; }
a.bd-room:hover, a.bd-room:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.bd-room.mine { box-shadow: inset 0 0 0 3px var(--brand); }
.bd-sign { position: absolute; left: 10px; top: 9px; background: #ffffff; border: 2px solid var(--bd-frame); border-radius: 6px; padding: 1px 9px; font-weight: 800; font-size: 0.86rem; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-kind { position: absolute; right: 9px; top: 13px; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #7a8794; }
:root[data-theme="dark"] .bd-kind { color: #b6c1cc; }
.bd-people { position: absolute; z-index: 1; left: 0; right: 0; bottom: 4px; display: flex; align-items: flex-end; justify-content: space-evenly; gap: 2px; padding: 0 8px; }
.bd-person { position: relative; display: grid; justify-items: center; width: 64px; flex: 0 1 64px; min-width: 36px; }
.bd-person svg { width: 100%; height: auto; display: block; }
.bd-person b { font-size: 0.6rem; font-weight: 700; background: #ffffff; color: #17212b; border-radius: 7px; padding: 0 5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -3px; position: relative; }
.bd-dot { position: absolute; right: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #ffffff; background: var(--offline); }
.bd-dot.active { background: var(--active); } .bd-dot.online { background: var(--online); } .bd-dot.idle { background: var(--idle); } .bd-dot.locked { background: var(--locked); }
/* at a desk: the figure sits behind a small desk, and the name goes on its front */
.bd-person.seated { padding-bottom: 2px; }
.bd-person.seated::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 0; height: 22px; border-radius: 3px 3px 2px 2px; background: #c29865; border-top: 5px solid #d6ad7b; }
.bd-person.seated b { z-index: 1; margin-top: -9px; margin-bottom: 3px; font-size: 0.56rem; }
.bd-person.visitor { transform: translateY(-30px) scale(0.86); }
.bd-person.empty { height: 62px; align-content: end; }
.bd-chair { display: block; width: 26px; height: 34px; border-radius: 8px 8px 2px 2px; background: #6b7b8c; opacity: 0.55; margin-bottom: 6px; }
.bd-person.empty b { background: none; }
.bd-more { align-self: center; font-weight: 800; font-size: 0.8rem; color: #566473; background: #ffffff; border-radius: 9px; padding: 1px 7px; margin-bottom: 18px; }
.bd-nobody { position: absolute; left: 0; right: 0; bottom: 58px; text-align: center; font-size: 0.74rem; color: #7a8794; }
:root[data-theme="dark"] .bd-nobody { color: #b6c1cc; }
/* a piece of furniture that says what kind of room it is */
.bd-prop { position: absolute; }
.bd-room.meeting .bd-prop { left: 50%; top: 46px; width: 58px; height: 34px; margin-left: -29px; border-radius: 4px; background: #3a4756 linear-gradient(135deg, transparent 45%, #7ef0c5 45%, #7ef0c5 55%, transparent 55%) center / 60% 40% no-repeat; }
.bd-room.meeting .bd-people { bottom: 12px; padding: 0 20%; }
.bd-room.meeting::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: 6px; height: 22px; border-radius: 4px 4px 2px 2px; background: #c29865; border-top: 7px solid #d6ad7b; }
.bd-room.lounge .bd-prop { left: 12%; right: 12%; bottom: 12px; height: 50px; border-radius: 14px 14px 6px 6px; background: #58789d; box-shadow: inset 0 -18px 0 #6d8fb5; }
.bd-room.lounge .bd-people { bottom: 20px; }
.bd-room.booth .bd-prop { left: 16%; right: 16%; top: 44px; bottom: 6px; border-radius: 10px; border: 3px solid var(--bd-frame); background: rgba(255, 255, 255, 0.4); }
.bd-room.locked { background: repeating-linear-gradient(to right, #4b5866 0, #4b5866 26px, #3f4a57 26px, #3f4a57 34px); }
.bd-room.locked .bd-kind { color: #c9d2da; }
.bd-shut { position: absolute; left: 0; right: 0; top: 50%; text-align: center; color: #ffffff; font-weight: 700; }
.bd-room.vacant { --wall: transparent; background: rgba(255, 255, 255, 0.12); }
@media (max-width: 640px) {
  .bd-floor { grid-template-columns: 62px minmax(0, 1fr); }
  .bd-lift i { width: 34px; }
  .bd-room { min-width: 170px; height: 170px; }
}

/* email codes and small text buttons */
.linkish { border: 0; background: none; color: var(--brand-2); font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; padding: 2px 0; justify-self: center; }
.linkish:hover { text-decoration: underline; }
.code-input { font-size: 1.5rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
#view-reset { display: grid; gap: 16px; }
#view-reset[hidden] { display: none; }

/* ---- private messages: the inbox, a conversation, the recipient's pop-up ---- */
#inboxBtn.has { border-color: var(--brand); color: var(--brand-2); font-weight: 650; }
.chat-threads { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: min(52vh, 440px); overflow-y: auto; }
.chat-threads[hidden], .chat-lines[hidden], .chat-send[hidden] { display: none; }
.chat-thread { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.chat-thread:hover { background: var(--raised); }
.chat-thread .grow { display: grid; min-width: 0; }
.chat-thread.unread b { color: var(--brand-2); }
.chat-last { color: var(--muted); font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-when { color: var(--muted); font-size: 0.76rem; flex: none; }
.tab-badge.still { position: static; display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #ffffff; font-size: 0.7rem; text-align: center; }
.chat-empty { text-align: center; padding: 22px 0; margin: 0; }
.chat-lines { display: flex; flex-direction: column; gap: 6px; height: min(48vh, 400px); overflow-y: auto; padding: 4px 2px; }
.chat-line { max-width: 78%; align-self: flex-start; background: var(--raised); border-radius: 14px 14px 14px 4px; padding: 7px 11px; display: grid; overflow-wrap: anywhere; }
.chat-line.mine { align-self: flex-end; background: var(--brand); color: var(--brand-text); border-radius: 14px 14px 4px 14px; }
.chat-line time { font-size: 0.66rem; opacity: 0.7; justify-self: end; }
.chat-send { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.dm-pop { position: fixed; right: 18px; bottom: 18px; z-index: 9; width: min(380px, calc(100vw - 36px)); display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); animation: toast-in 0.2s ease-out; }
.dm-pop[hidden] { display: none; }
.dm-pop .grow { display: grid; min-width: 0; }
.dm-pop .grow span { color: var(--muted); font-size: 0.86rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  #inboxBtn { display: none; }
  .dm-pop { bottom: calc(76px + env(safe-area-inset-bottom)); right: 12px; }
}

/* the admin's room actions behind one button */
.admin-wrap { position: relative; display: inline-flex; }
.admin-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 6; display: grid; gap: 6px; padding: 8px; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.admin-menu[hidden] { display: none; }
.admin-menu .btn { justify-content: flex-start; width: 100%; }
#chatNew[hidden] { display: none; }
@media (max-width: 640px) { .admin-menu { right: auto; left: 0; } }

/* getting started on the organisation page */
.org-start { margin-bottom: 18px; display: grid; gap: 8px; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: color-mix(in srgb, var(--brand) 6%, var(--card)); }
.org-start ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.org-start li.done { color: var(--muted); text-decoration: line-through; }
.roll-rooms[hidden] { display: none; }

/* personal things on a desk fade with the desk when its owner is offline */
.sc-item.off { opacity: 0.45; }
