/* Virtual Office — base UI. Theme colours (--primary/--accent/--bg) are set on
   :root by main.js applyTheme(config); everything else derives from them. */

:root {
  --primary: #2563eb;
  --accent: #f59e0b;
  --bg: #0f172a;

  /* derived surfaces (fallbacks first, color-mix where supported) */
  --surface: #1e293b;
  --surface: color-mix(in srgb, var(--bg) 86%, white);
  --surface-2: #273548;
  --surface-2: color-mix(in srgb, var(--bg) 76%, white);
  --surface-3: #334155;
  --surface-3: color-mix(in srgb, var(--bg) 66%, white);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary-soft: rgba(37, 99, 235, 0.18);
  --primary-soft: color-mix(in srgb, var(--primary) 20%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 20%, transparent);
  --success: #22c55e;
  --warn: #f59e0b;
  --error: #ef4444;
  --info: #38bdf8;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
  --topbar-h: 52px;
  --side-w: 340px;
}

/* ---- reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.25; font-weight: 650; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
p { margin: 0 0 10px; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
::selection { background: var(--primary); color: #fff; }

/* ---- scrollbars ------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- app frame -------------------------------------------------------- */
.app { display: flex; flex-direction: column; height: 100%; height: 100dvh; }
.main { flex: 1; display: flex; min-height: 0; position: relative; }

/* top bar */
.topbar {
  flex: none;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.company-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex: none;
  background: var(--surface-2);
}
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-initial {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  border-radius: 50%;
  text-transform: uppercase;
}
.logo-lg { width: 56px; height: 56px; font-size: 26px; border-radius: 14px; }
.logo-lg.logo-initial { border-radius: 50%; }
.spacer { flex: 1; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-pill { color: var(--text); }
.online-pill { color: var(--text-muted); }
.online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}
.status-btn {
  max-width: 260px;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: transparent;
}
.status-btn:hover { border-style: solid; background: var(--surface-2); }
.status-emoji { font-family: var(--font-emoji); font-size: 15px; line-height: 1; }
.status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.zoom { display: inline-flex; gap: 4px; }
/* the panel toggle collapses the side on desktop and opens the sheet on mobile */

/* stage */
.stage {
  flex: 1;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #0a0f1c;
  background: color-mix(in srgb, var(--bg) 70%, black);
}
#canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
}
.overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  font-family: var(--font);
}

/* HUD strip (module slots) */
.hud {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100% - 24px);
  pointer-events: none;
  z-index: 3;
}
.hud-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: auto;
}

/* emote bar */
.emotes {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
  z-index: 3;
}
.emote-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  font-family: var(--font-emoji);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.12s ease, background 0.12s ease;
}
.emote-btn:hover { background: var(--surface-2); transform: scale(1.18); }
.emote-btn:active { transform: scale(0.95); }

/* side panel */
.side {
  flex: none;
  width: var(--side-w);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 4;
}
body.side-collapsed .side { display: none; }
.tabs {
  flex: none;
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tab {
  flex: 1;
  position: relative;
  height: 46px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-emoji);
  font-size: 19px;
  line-height: 1;
  transition: background 0.12s ease, color 0.12s ease;
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active {
  color: var(--primary);
  box-shadow: inset 0 -2px 0 var(--primary);
  background: var(--primary-soft);
}
.tab-badge {
  position: absolute;
  top: 6px; right: 50%;
  transform: translateX(16px);
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--error);
  color: #fff;
  font: 700 10px/16px var(--font);
  text-align: center;
  pointer-events: none;
}
.panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  overscroll-behavior: contain;
}
.panel { display: flex; flex-direction: column; gap: 10px; min-height: 100%; }
.panel-empty {
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  text-align: center;
  padding: 24px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-head h2 { margin: 0; }

/* ---- components ------------------------------------------------------- */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 10px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-head h3 { margin: 0; flex: 1; }
.card.placeholder { text-align: center; padding: 28px 16px; }
.placeholder .big { font-family: var(--font-emoji); font-size: 36px; margin-bottom: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease, opacity 0.12s ease;
}
.btn:hover { border-color: var(--text-dim); filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; transform: none; }
.btn-primary { background: var(--primary); border-color: transparent; color: #fff; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-accent { background: var(--accent); border-color: transparent; color: #111827; }
.btn-danger { background: var(--error); border-color: transparent; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 32px; height: 32px; padding: 0;
  font-size: 16px; font-weight: 700;
}
.btn.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

.input {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, black);
  color: var(--text);
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input::placeholder { color: var(--text-dim); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input:disabled { opacity: 0.6; }
select.input { appearance: auto; }
select.input option, select.input optgroup { background: var(--surface); color: var(--text); }
textarea.input { resize: vertical; min-height: 64px; }
input[type="color"].input { padding: 2px; height: 32px; width: 44px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 15px; height: 15px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field > span { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.field-inline { flex-direction: row; align-items: center; gap: 8px; }

.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.row-center { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
.grid-2 { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emoji { font-family: var(--font-emoji); }
hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }

.badge {
  display: inline-flex; align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: rgba(34, 197, 94, 0.18); color: var(--success); }
.badge-warn { background: rgba(245, 158, 11, 0.18); color: var(--warn); }
.badge-error { background: rgba(239, 68, 68, 0.18); color: var(--error); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 12.5px;
  cursor: pointer;
}
.chip:hover { border-color: var(--text-dim); }
.chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.locked { opacity: 0.45; filter: grayscale(0.6); cursor: not-allowed; }

.list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease;
}
.list-item:hover, .list-item.active { background: var(--surface-3); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .name { font-weight: 600; }
.list-item .sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-title {
  margin: 10px 0 4px;
  padding: 0 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 6px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--text-dim); }
.avatar-box {
  width: 40px; height: 48px;
  display: inline-flex; align-items: flex-end; justify-content: center;
  flex: none;
}
.avatar-box canvas { image-rendering: pixelated; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
tr:hover td { background: var(--surface-3); }

.error { color: var(--error); font-size: 13px; }
.success { color: var(--success); }
.kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  background: var(--surface-3);
  font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---- toasts ----------------------------------------------------------- */
.toasts {
  position: fixed;
  top: calc(var(--topbar-h) + 10px);
  right: 12px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 60;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 24px));
}
.toast {
  pointer-events: auto;
  padding: 10px 14px 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--info);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  word-break: break-word;
}
.toast.show { opacity: 1; transform: none; }
/* passive notices ("new #1"): clicks go through to whatever is underneath */
.toast.toast-passive { pointer-events: none; cursor: default; }
.toast.hide { opacity: 0; transform: translateX(16px); }
/* reduced motion: toasts fade in place, no slide */
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.hide { transform: none; }
}
.toast-info { border-left-color: var(--info); }
.toast-success { border-left-color: var(--success); }
.toast-warn { border-left-color: var(--warn); }
.toast-error { border-left-color: var(--error); }
/* desktop: toasts sit over the map, never over the side panel's tabs */
@media (min-width: 768px) and (min-height: 501px), (min-width: 768px) and (pointer: fine) {
  .toasts { right: calc(var(--side-w) + 12px); }
  body.side-collapsed .toasts { right: 12px; }
}

/* ---- world overlay: name tags, status bubbles, emotes ------------------- */
.tag, .bubble, .emote, .nameplate {
  position: absolute;
  left: 0; top: 0;
  pointer-events: none;
  white-space: nowrap;
  will-change: transform;
}
.tag {
  transform: translate(-50%, 0);
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag .dot { width: 7px; height: 7px; }
.tag.me { outline: 1px solid var(--primary); }
.tag.sitting, .nameplate {
  background: var(--primary);
  color: #fff;
}
.bubble {
  transform: translate(-50%, -100%);
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 180px;
  padding: 4px 9px;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  text-overflow: ellipsis;
}
.bubble::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -5px;
  width: 10px; height: 10px;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}
.bubble .emoji, .bubble .bubble-emoji { font-family: var(--font-emoji); font-size: 15px; line-height: 1; }
.bubble .text, .bubble .bubble-text { overflow: hidden; text-overflow: ellipsis; }
.bubble.me { pointer-events: auto; cursor: pointer; }
.bubble.me:hover { box-shadow: 0 0 0 2px var(--primary), 0 2px 8px rgba(0, 0, 0, 0.35); }
.bubble.typing, .typing-dots { color: var(--text-dim); font-weight: 700; letter-spacing: 2px; }
.typing-dots::after, .bubble.typing::after { content: none; }
.typing-dots { animation: vo-blink 1s steps(2, start) infinite; }
.emote {
  transform: translate(-50%, -100%);
  font-family: var(--font-emoji);
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
  animation: vo-emote-float 2s ease-out forwards;
}
/* Reduced motion (e.g. Windows with animations off): the float would end invisible at once,
   so show the emoji still; the script removes it after 2 s. */
@media (prefers-reduced-motion: reduce) {
  .emote { animation: none !important; opacity: 1; }
}
@keyframes vo-emote-float {
  0%   { opacity: 0; transform: translate(-50%, -80%) scale(0.6); }
  12%  { opacity: 1; transform: translate(-50%, -110%) scale(1.15); }
  30%  { transform: translate(-50%, -120%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -220%) scale(1); }
}
@keyframes vo-blink { to { visibility: hidden; } }

/* ---- full-screen overlays: login + reconnect --------------------------- */
.screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: var(--bg);
  background-image:
    radial-gradient(60% 50% at 20% 10%, var(--primary-soft), transparent 70%),
    radial-gradient(40% 40% at 85% 90%, var(--accent-soft), transparent 70%);
  z-index: 50;
}
.reconnect { background: rgba(2, 6, 23, 0.78); backdrop-filter: blur(4px); }
.login-card { width: min(380px, 100%); padding: 24px; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.login-title { margin: 0; font-size: 20px; }
.login-card .btn-block { margin-top: 6px; }
.login-card .error { margin: -4px 0 10px; }
.login-card .login-help { margin: 12px 0 0; text-align: center; }
/* PIN fields: spaced dots; the placeholder text stays normal */
.login-pin { letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }
.login-pin::placeholder { letter-spacing: normal; }
/* "Email me a PIN" (only while email PINs are on) */
.login-mailpin { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.login-or { margin: 0; text-align: center; }
.login-note { margin: 2px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--text); line-height: 1.4; }

/* "Choose your own PIN" (first sign-in, after an admin PIN reset): over the office,
   below the sign-in / reconnect screens (50) and toasts (60) */
.pin-setup {
  position: fixed; inset: 0; z-index: 48;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(3px);
}
.pin-setup-card { width: min(380px, 100%); margin: auto; padding: 24px; border-color: var(--border-strong); box-shadow: var(--shadow); }
.pin-setup-card h2 { margin: 0 0 6px; font-size: 19px; }
.pin-setup-icon { margin-bottom: 8px; font-family: var(--font-emoji); font-size: 30px; line-height: 1; }
.pin-setup-card .error { margin: -4px 0 10px; }
.pin-setup-card .btn-block { margin-top: 6px; }
.reconnect-card { width: min(360px, 100%); padding: 24px; text-align: center; }
.reconnect-card .row { margin-top: 12px; }
.spinner {
  width: 34px; height: 34px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid var(--border-strong);
  border-top-color: var(--primary);
  animation: vo-spin 0.8s linear infinite;
}
@keyframes vo-spin { to { transform: rotate(360deg); } }

/* ---- mobile: side panel becomes a bottom sheet ------------------------- */
@media (max-width: 767px), (max-height: 500px) and (pointer: coarse) {
  :root { --side-w: 100%; }
  .company-name { max-width: 120px; }
  .status-btn .status-text { display: none; }
  .status-btn { padding: 4px 8px; }
  .room-pill { max-width: 140px; }
  .online-pill { display: none; }
  .zoom { display: none; }
  .side {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 70vh;
    height: 70dvh;
    border-left: 0;
    border-top: 1px solid var(--border-strong);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45);
    transform: translateY(100%);
    transition: transform 0.25s ease;
    display: flex;
  }
  body.side-collapsed .side { display: flex; }
  body.panel-open .side { transform: none; }
  .tabs { border-radius: 16px 16px 0 0; }
  .emotes { bottom: 10px; }
  body.panel-open .emotes, body.panel-open .hud { display: none; }
  .toasts { top: auto; bottom: 16px; left: 12px; right: 12px; max-width: none; }
}

/* ---- motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .emote { opacity: 1; }
}

/* ---- panel-specific styles are appended below by their panels ---- */

/* ==== user panels ==== */
/* Chat, People, Me, Decorate and Events (public/js/ui/{chat,people,me,decorate,events}.js) */
.panel-chat .card + .card, .panel-people .card + .card, .panel-me .card + .card,
.panel-decorate .card + .card, .panel-events .card + .card { margin-top: 0; }

/* ---- chat ---- */
.panel-chat { height: 100%; min-height: 0; gap: 6px; }
.chat-tabs { flex: none; display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; margin: -2px -2px 0; scrollbar-width: none; }
.chat-tabs::-webkit-scrollbar { display: none; }
.chat-tab {
  flex: none; position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 170px; height: 30px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-muted);
  font-size: 12.5px; font-weight: 650; white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.chat-tab:hover { color: var(--text); border-color: var(--text-dim); }
.chat-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.chat-tab.active { background: var(--primary); border-color: transparent; color: #fff; box-shadow: 0 2px 10px var(--primary-soft); }
.chat-tab-icon { font-family: var(--font-emoji); font-size: 13px; line-height: 1; }
.chat-tab-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chat-tab-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); }
.chat-tab-dot.on { background: var(--success); }
.chat-unread {
  flex: none; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 999px; background: var(--error); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center;
}
.chat-tab-close {
  flex: none; width: 18px; height: 18px; margin: 0 -6px 0 -2px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 15px; line-height: 1; opacity: 0.6;
}
.chat-tab-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.16); }
.chat-tab-add { width: 30px; padding: 0; justify-content: center; font-size: 17px; font-weight: 500; border-style: dashed; }
.chat-scope { flex: none; padding: 0 4px; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-wrap {
  position: relative; flex: 1; min-height: 140px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg); background: color-mix(in srgb, var(--bg) 55%, var(--surface));
}
.chat-list { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 6px 8px 12px; overflow-y: auto; overscroll-behavior: contain; }
.chat-msg { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; margin-top: 10px; }
.chat-msg.cont { margin-top: 3px; }
.chat-msg.mine { align-items: flex-end; }
.chat-msg.new { animation: vo-chat-in 0.18s ease-out; }
.chat-meta { display: flex; align-items: baseline; gap: 6px; max-width: 100%; margin: 0 4px 3px; font-size: 11.5px; }
.chat-from { font-weight: 700; color: var(--from, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-msg.mine .chat-from { color: var(--text-muted); }
.chat-time { flex: none; font-size: 10.5px; color: var(--text-dim); white-space: nowrap; }
.chat-bubble {
  max-width: 88%; padding: 6px 11px;
  border-radius: 16px; background: var(--surface-3); color: var(--text);
  line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere;
}
.chat-msg:not(.mine):not(.cont):not(.system) .chat-bubble { border-top-left-radius: 5px; }
.chat-msg.mine .chat-bubble { background: var(--primary); color: #fff; }
.chat-msg.mine:not(.cont) .chat-bubble { border-top-right-radius: 5px; }
.chat-msg.mention .chat-bubble { background: color-mix(in srgb, var(--accent) 18%, var(--surface-3)); box-shadow: inset 0 0 0 1.5px var(--accent); }
.chat-msg.system { align-items: center; margin: 10px 0 2px; }
.chat-msg.system .chat-bubble { max-width: 100%; padding: 2px 6px; background: transparent; color: var(--text-muted); font-size: 12px; font-style: italic; text-align: center; }
.chat-msg.system .chat-time { font-style: normal; }
.chat-sys-icon { font-family: var(--font-emoji); font-style: normal; }
.chat-day {
  align-self: center; margin: 12px 0 0; padding: 2px 10px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-dim); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.chat-day:first-child { margin-top: 2px; }
.chat-empty { max-width: 260px; margin: auto; padding: 24px 12px; text-align: center; color: var(--text-muted); }
.chat-empty .big { margin-bottom: 6px; font-family: var(--font-emoji); font-size: 34px; line-height: 1.2; }
.chat-empty-title { margin-bottom: 4px; font-weight: 650; color: var(--text); }
.chat-jump {
  position: absolute; left: 50%; bottom: 10px; z-index: 1; transform: translateX(-50%);
  padding: 5px 12px; border: 0; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; box-shadow: var(--shadow-sm);
}
.chat-typing {
  flex: none; min-height: 16px; padding: 0 6px;
  font-size: 11.5px; font-style: italic; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity 0.15s ease;
}
.chat-typing.on { opacity: 1; }
.chat-note { flex: none; padding: 6px 10px; border-radius: var(--radius-sm); background: rgba(245, 158, 11, 0.14); color: var(--warn); font-size: 12px; }
.chat-compose { flex: none; display: flex; align-items: flex-end; gap: 6px; }
textarea.input.chat-input { flex: 1; min-height: 40px; max-height: 132px; padding: 9px 12px; border-radius: 12px; line-height: 1.35; resize: none; overflow-y: auto; }
.chat-send { height: 40px; padding: 0 14px; border-radius: 12px; }
.chat-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; font-size: 11px; color: var(--text-dim); }
.chat-foot .kbd { padding: 0 4px; font-size: 10px; }
.chat-count.warn { color: var(--warn); font-weight: 700; }
@keyframes vo-chat-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- people ---- */
.panel-people { gap: 6px; }
.pp-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; flex-direction: column; gap: 8px;
  margin: -12px -12px 0; padding: 12px 12px 10px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.pp-head h2 { margin: 0; }
.pp-summary { font-size: 12px; color: var(--text-muted); }
.pp-list { display: flex; flex-direction: column; gap: 1px; }
.pp-section-title {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 2px 2px; padding: 0; border: 0; background: none;
  color: var(--text); font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; text-align: left;
}
button.pp-section-title { width: calc(100% - 4px); cursor: pointer; }
button.pp-section-title:hover { color: var(--primary); }
.pp-caret { margin-left: auto; color: var(--text-dim); font-size: 12px; }
.pp-live { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.pp-off { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); }
.pp-dept { display: flex; align-items: center; gap: 7px; margin: 8px 4px 2px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.pp-dept .dot { width: 8px; height: 8px; }
.pp-dept-n { font-weight: 600; color: var(--text-dim); }
.pp-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius); transition: background 0.12s ease; }
.pp-row:hover { background: var(--surface-2); }
.pp-row.me { background: var(--primary-soft); }
.pp-av {
  position: relative; flex: none; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-radius: 12px; background: var(--surface-3);
  background: color-mix(in srgb, var(--dept, #64748b) 30%, var(--surface-2));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.pp-av canvas { flex: none; image-rendering: pixelated; }
.pp-row.offline .pp-av { background: var(--surface-2); }
.pp-row.offline .pp-av canvas { filter: grayscale(1); opacity: 0.55; }
.pp-online { position: absolute; right: 3px; bottom: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px var(--surface); }
.pp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pp-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 650; }
.pp-name-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-name .badge { flex: none; }
.pp-row.offline .pp-name { color: var(--text-muted); }
/* admins only: the full name under the nickname */
.pp-full { margin-top: -1px; font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-status { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12.5px; color: var(--text); }
.pp-status .emoji { flex: none; font-size: 14px; line-height: 1; }
.pp-status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-sub { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-where.off { color: var(--text-dim); }
.pp-actions { flex: none; display: flex; flex-direction: column; gap: 4px; }
.pp-actions .btn { justify-content: flex-start; }
.pp-empty { padding: 30px 10px; text-align: center; color: var(--text-muted); }
.pp-empty .big { margin-bottom: 6px; font-family: var(--font-emoji); font-size: 30px; }

/* ---- me ---- */
.me-card { display: flex; flex-direction: column; gap: 8px; }
.me-card .card-head { margin-bottom: 0; }
.me-label { margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.05em; text-transform: uppercase; }
.me-status-preview {
  display: flex; justify-content: center; padding: 12px 6px 16px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: radial-gradient(120% 120% at 50% 0%, var(--primary-soft), transparent 70%), var(--surface);
}
.me-bubble {
  position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 6px 12px; border-radius: 12px; background: #fff; color: #0f172a;
  font-size: 13px; font-weight: 650; line-height: 1.3; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.me-bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; border-radius: 2px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.me-bubble-emoji { font-size: 17px; line-height: 1; }
.me-bubble-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-bubble.empty { background: var(--surface-3); color: var(--text-muted); font-style: italic; font-weight: 600; box-shadow: none; }
.me-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.me-preset .emoji { font-size: 14px; line-height: 1; }
.me-status-row { display: flex; gap: 6px; }
.me-emoji-btn { flex: none; width: 44px; height: 38px; padding: 0; font-family: var(--font-emoji); font-size: 20px; line-height: 1; }
.me-emoji-btn.placeholder { filter: grayscale(1); opacity: 0.6; }
.me-emoji-btn[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.me-status-text { flex: 1; min-width: 0; }
.me-emoji-pop {
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-sm);
}
.me-emoji-free { display: flex; align-items: center; gap: 6px; }
.me-emoji-input { flex: 1; min-width: 0; }
.me-emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 2px; max-height: 196px; overflow-y: auto; overscroll-behavior: contain; }
.me-emoji {
  height: 34px; border: 0; border-radius: 8px; background: transparent;
  font-family: var(--font-emoji); font-size: 19px; line-height: 1;
  transition: transform 0.1s ease, background 0.1s ease;
}
.me-emoji:hover, .me-emoji:focus-visible { background: var(--surface-3); transform: scale(1.15); outline: none; }
.me-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.me-count { font-size: 11px; color: var(--text-dim); }
.me-msg { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--text); font-size: 12.5px; }
.me-msg.success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.me-msg.error { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.me-msg.info { background: var(--primary-soft); }
.me-wardrobe-top { display: flex; align-items: center; gap: 12px; }
.me-preview {
  position: relative; flex: none; width: 140px; height: 140px; padding: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-radius: 16px; border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--primary-soft) 0%, transparent 72%), var(--surface);
  cursor: pointer; transition: border-color 0.12s ease;
}
.me-preview:hover, .me-preview:focus-visible { border-color: var(--primary); outline: none; }
.me-preview canvas { image-rendering: pixelated; }
.me-preview-hint { position: absolute; top: 6px; left: 0; right: 0; font-size: 10px; color: var(--text-dim); text-align: center; opacity: 0; transition: opacity 0.15s ease; }
.me-preview:hover .me-preview-hint { opacity: 1; }
.me-wardrobe-side { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.me-wardrobe-side p { margin: 0 0 2px; }
.me-slot { padding-top: 8px; border-top: 1px solid var(--border); }
.me-slot-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.me-slot-label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.me-slot-label .emoji { font-size: 13px; }
.me-color-wrap { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
input[type="color"].me-color { width: 36px; height: 24px; padding: 0; border: 1px solid var(--border-strong); border-radius: 6px; background: none; cursor: pointer; }
input[type="color"].me-color::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"].me-color::-webkit-color-swatch { border: 0; border-radius: 4px; }
input[type="color"].me-color::-moz-color-swatch { border: 0; border-radius: 4px; }
.me-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.me-chip { padding: 4px 10px; font-size: 12px; }
.me-chip .emoji { font-size: 11px; }
.me-chip.special:not(.active) { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.me-skins { gap: 8px; }
.me-swatch {
  width: 28px; height: 28px; padding: 0; border-radius: 50%;
  border: 2px solid var(--surface-2); box-shadow: 0 0 0 1px var(--border-strong);
  cursor: pointer; transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.me-swatch:hover { transform: scale(1.1); }
.me-swatch.active { box-shadow: 0 0 0 2px var(--primary); transform: scale(1.12); }
.me-points { display: flex; align-items: baseline; gap: 6px; }
.me-points .emoji { font-size: 20px; }
.me-points-n { font-size: 26px; font-weight: 800; line-height: 1; }
.me-points-label { font-weight: 600; color: var(--text-muted); }
.me-unlocks { display: flex; flex-wrap: wrap; gap: 6px; }
.me-unlock { cursor: default; }
.me-unlock .emoji { font-size: 14px; }
.me-who { font-size: 13px; }
.me-pin .field { margin-bottom: 8px; }
.me-pin .me-msg { margin-bottom: 8px; }
.me-nick { margin: 10px 0 12px; }
.me-nick .field { margin-bottom: 4px; }
.me-nick-row { display: flex; gap: 8px; align-items: center; }
.me-nick-row .input { flex: 1; min-width: 0; }
.me-nick-row .btn { flex: none; }
.me-hint { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-muted); }
.pin-setup-card .me-hint { margin-top: -4px; margin-bottom: 10px; }

/* ---- decorate ---- */
.dec-card { display: flex; flex-direction: column; gap: 8px; }
.dec-card .card-head { margin-bottom: 0; }
.dec-card > p { margin: 0; }
.dec-desk-box { display: flex; flex-direction: column; gap: 10px; }
.dec-desk {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 12px 12px 20px; border-radius: 10px;
  background: linear-gradient(180deg, #dbb783 0, #c89f6a 6px, #c89f6a calc(100% - 12px), #9c7446 calc(100% - 12px));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22), var(--shadow-sm);
}
.dec-slot {
  aspect-ratio: 1; min-height: 48px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 2px dashed rgba(60, 35, 10, 0.45); background: rgba(60, 35, 10, 0.12);
  color: rgba(60, 35, 10, 0.7); font-family: var(--font-emoji); font-size: 28px; line-height: 1;
  cursor: pointer; transition: transform 0.1s ease, border-color 0.12s ease, background 0.12s ease;
}
.dec-slot:hover { transform: translateY(-2px); border-color: rgba(60, 35, 10, 0.8); }
.dec-slot.filled { border-style: solid; border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.28); }
.dec-slot.active { border-style: solid; border-color: var(--primary); background: rgba(255, 255, 255, 0.4); box-shadow: 0 0 0 3px var(--primary-soft); }
.dec-plus { font-family: var(--font); font-size: 24px; font-weight: 400; }
.dec-picker { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); }
.dec-label { font-size: 11.5px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.05em; text-transform: uppercase; }
.dec-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px; }
.dec-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px 6px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-muted); font-size: 11px; line-height: 1.2;
  cursor: pointer; transition: border-color 0.12s ease, background 0.12s ease, transform 0.1s ease;
}
.dec-item:hover { border-color: var(--text-dim); color: var(--text); transform: translateY(-1px); }
.dec-item.active { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.dec-item.locked:hover { transform: none; }
.dec-item-emoji { font-size: 24px; line-height: 1.1; }
.dec-item-name { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dec-empty { padding: 14px 8px; text-align: center; color: var(--text-muted); }
.dec-empty .big { margin-bottom: 4px; font-family: var(--font-emoji); font-size: 30px; }
.dec-place-btn.active { background: var(--accent); border-color: transparent; color: #111827; }
.dec-hint { padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent-soft); font-size: 12.5px; line-height: 1.45; }
.dec-hint .emoji { font-size: 14px; }
.dec-placed { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.dec-placed-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius-sm); }
.dec-placed-row:hover { background: var(--surface-3); }
.dec-placed-row .btn-icon { width: 28px; height: 28px; font-size: 14px; }
.dec-placed-emoji { flex: none; width: 26px; font-size: 20px; text-align: center; }
.dec-placed-name { font-size: 13px; font-weight: 600; }
.dec-remove:hover { color: var(--error); }
.dec-none { padding: 4px 2px; }
#canvas.dec-placing { cursor: cell; }

/* ---- events ---- */
.ev-head h2 { margin: 0 0 2px; }
.ev-head p { margin: 0; }
.ev-card { display: flex; flex-direction: column; gap: 8px; }
.ev-card .card-head { margin-bottom: 0; }
.ev-active { display: flex; flex-direction: column; gap: 8px; }
.ev-mod { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.ev-mod-icon { flex: none; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--accent-soft); font-family: var(--font-emoji); font-size: 24px; line-height: 1; }
.ev-mod-body { flex: 1; min-width: 0; }
.ev-mod-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ev-mod-name { font-weight: 700; }
.ev-mod-desc { margin-top: 2px; font-size: 12.5px; color: var(--text-muted); }
.ev-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; text-align: center; color: var(--text-muted); }
.ev-empty .big { font-family: var(--font-emoji); font-size: 32px; line-height: 1.1; }
.ev-empty-title { font-weight: 600; color: var(--text); }
.events-cards:empty { display: none; }
.events-cards > .card + .card { margin-top: 0; }
.ev-hof-list { display: flex; flex-direction: column; gap: 10px; }
.ev-hof-entry { padding: 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.ev-hof-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.ev-hof-icon { font-family: var(--font-emoji); font-size: 16px; }
.ev-hof-title { flex: 1; min-width: 0; font-weight: 700; }
.ev-hof-date { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.ev-hof-del { align-self: center; padding: 2px 6px; font-family: var(--font-emoji); line-height: 1; opacity: 0.6; }
.ev-hof-del:hover, .ev-hof-del:focus-visible { opacity: 1; }
.ev-hof-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 6px 8px; border-radius: var(--radius-sm); background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35); }
.ev-podium { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; list-style: none; }
.ev-place { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius-sm); }
.ev-place:first-child { background: rgba(250, 204, 21, 0.12); }
.ev-place.me { box-shadow: inset 0 0 0 1px var(--primary); }
.ev-medal { font-family: var(--font-emoji); font-size: 18px; line-height: 1; }
.ev-winner { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-score { font-size: 12.5px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ev-error .error { margin: 0 0 6px; }
/* ==== end user panels ==== */

/* ==== admin + editor ==== */
/* admin panel (ui/admin.js): .adm-* ; floor plan editor (ui/editor.js): .ed-* */

/* the side panel is wider while the admin panel is open (desktop only) */
@media (min-width: 768px) and (min-height: 501px), (min-width: 768px) and (pointer: fine) {
  body.vo-wide-side { --side-w: min(540px, 46vw); }
}

.adm, .ed { gap: 12px; }
.adm-head, .ed-head { display: flex; align-items: flex-start; gap: 10px; }
.adm-head h2, .ed-head h2 { margin: 0 0 2px; font-size: 17px; }
.adm-nav {
  display: flex; gap: 4px; padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  position: sticky; top: -12px; z-index: 2;
}
.adm-nav-btn {
  flex: 1; border: 0; background: transparent; color: var(--text-muted);
  padding: 7px 10px; border-radius: 999px; font-weight: 650; font-size: 13px; white-space: nowrap;
}
.adm-nav-btn:hover { color: var(--text); background: var(--surface-3); }
.adm-nav-btn.active { background: var(--primary); color: #fff; }
.adm-sec { display: flex; flex-direction: column; gap: 10px; }
.adm-sec > .card + .card, .adm-mods > .card + .card { margin-top: 0; }
.adm-card .field:last-child { margin-bottom: 0; }
.adm-dirty { color: var(--warn); font-size: 12px; font-weight: 700; white-space: nowrap; }
.adm-toolbar { flex-wrap: nowrap; align-items: center; }
.adm-sec-title { margin: 0 0 2px; }

/* branding */
.adm-color-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.adm-color-row:last-child { border-bottom: 0; }
.adm-color-label { font-weight: 650; }
.adm-color { flex: none; }
.adm-hex { width: 92px; flex: none; }
.input.adm-invalid { border-color: var(--error); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
.adm-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-quick-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface-3);
  font-size: 12px; font-weight: 600;
}
.adm-quick-btn:hover { border-color: var(--text-dim); }
.adm-quick-sw { width: 20px; height: 20px; border-radius: 50%; border: 3px solid; flex: none; }
.adm-logo-row { align-items: center; margin-bottom: 8px; flex-wrap: nowrap; }
.adm-logo-box {
  width: 64px; height: 64px; flex: none; border-radius: 12px; overflow: hidden;
  background: var(--surface-3); border: 1px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center;
}
.adm-logo-box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.adm-logo-initial {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.adm-file { display: none; }
.adm-presets { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.adm-preset { display: flex; align-items: center; gap: 4px; }
.adm-preset > .input { flex: 1; min-width: 0; }
.adm-preset > .btn { padding: 4px 7px; }
.adm-emoji-cell { display: flex; align-items: center; flex: none; }
.adm-emoji-input { width: 48px; text-align: center; font-family: var(--font-emoji); font-size: 16px; padding: 6px 4px; }
.adm-emoji-pick { padding: 4px 6px; }
.adm-emoji-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 2px;
  padding: 6px; max-height: 180px; overflow: auto;
  border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border-strong);
}
.adm-emoji-opt { border: 0; background: transparent; font-family: var(--font-emoji); font-size: 19px; line-height: 1; padding: 6px 0; border-radius: 6px; }
.adm-emoji-opt:hover { background: var(--surface-3); }
.adm-empty-line { padding: 6px 2px; }

/* staff */
.adm-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.adm-staff { table-layout: fixed; }
.adm-staff th, .adm-staff td { padding: 6px; }
.adm-staff .adm-c-dot { width: 24px; padding-right: 0; text-align: center; }
.adm-staff .adm-c-dept { width: 27%; }
.adm-staff .adm-c-role { width: 86px; }
.adm-staff .adm-c-desk { width: 56px; }
.adm-staff .adm-c-act { width: 40px; text-align: right; padding-left: 0; }
.adm-staff .adm-c-act .btn { padding: 3px 6px; }
.adm-row { cursor: pointer; }
.adm-row.open > td { background: var(--primary-soft); }
.adm-c-name, .adm-c-dept { overflow: hidden; }
.adm-c-dept { white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; }
.adm-c-dept .dot { width: 8px; height: 8px; margin-right: 6px; }
.adm-name { font-weight: 650; }
.adm-fullname { font-weight: 500; color: var(--text-muted); }
.adm-hint { font-size: 11px; color: var(--text-muted); }
.adm-key-row { margin: -4px 0 10px; }
.adm-edit .grid-2 .adm-wide { grid-column: 1 / -1; }
.adm-danger-row { row-gap: 6px; }
/* Admin -> Email: "Require emailed PINs" preview */
.adm-retire { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.adm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.adm-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-3); font-size: 11.5px; color: var(--text-muted); line-height: 1.3; }
.adm-stat strong { font-size: 20px; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.adm-stat.ok strong { color: var(--success); }
.adm-stat.warn strong { color: var(--warn); }
.adm-missing > summary { cursor: pointer; font-size: 12.5px; font-weight: 650; }
.adm-missing ul { margin: 6px 0 0; padding-left: 18px; max-height: 180px; overflow: auto; font-size: 12.5px; }
.warn-text { color: var(--warn); margin: 0; }
/* Admin -> Staff: email addresses people typed on the sign-in page ("self-added") */
.adm-selfadded { border-color: var(--warn); }
.adm-selfadded-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.adm-selfadded-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-3); }
.adm-selfadded-row .mono { word-break: break-all; }
.adm-selfadded-act { flex: none; flex-wrap: wrap; justify-content: flex-end; }
.adm-name-row { display: flex; align-items: center; min-width: 0; }
.adm-name-row > .ellipsis { min-width: 0; }
.adm-selfadded-badge { flex: none; margin-left: 6px; font-size: 10.5px; padding: 1px 6px; vertical-align: 1px; }
@media (max-width: 480px) { .adm-selfadded-row { flex-direction: column; align-items: stretch; } .adm-selfadded-act { justify-content: flex-start; } }
.login-mailpin-email { margin-bottom: 4px; }
.login-mailpin-email small { font-weight: 400; }
.adm-online { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-strong); vertical-align: middle; }
.adm-online.on { background: var(--success); border-color: transparent; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.adm-flash > td { animation: adm-flash 1.6s ease-out; }
@keyframes adm-flash { 0%, 35% { background: var(--accent-soft); } 100% { background: transparent; } }
.adm-staff tr.adm-edit-row > td, .adm-staff tr.adm-edit-row:hover > td { padding: 0; background: var(--surface); border-bottom: 2px solid var(--primary); }
.adm-edit { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.adm-edit .field { margin-bottom: 0; }
.adm-edit .grid-2 { gap: 8px 10px; }
.adm-edit hr { margin: 2px 0; }
.adm-edit-head { flex-wrap: nowrap; }
.adm-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 13px; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}
.adm-seen { font-family: var(--font); }
.adm-ws-hint:empty { display: none; }
.adm-unlocks-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; background: var(--surface-2); }
.adm-unlocks-box > summary { cursor: pointer; font-weight: 650; padding: 2px 0; }
.adm-unlocks-box p { margin: 6px 0 0; }
.adm-unlock-group { margin-top: 6px; }
.adm-unlock-title { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin: 2px 0 4px; }
.adm-unlocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 8px; }
.adm-unlock { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.adm-unlock:hover { background: var(--surface-3); }
.adm-pin { width: 110px; flex: none; }
.adm-confirm {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--error); background: rgba(239, 68, 68, 0.12); font-size: 13px;
}
.adm-add .field { margin-bottom: 6px; }
.adm-empty { text-align: center; padding: 18px 12px; }
.adm-empty p { margin: 6px 0 10px; }
.adm-empty-icon { font-family: var(--font-emoji); font-size: 34px; line-height: 1.2; margin-bottom: 6px; }

/* events & modules */
.adm-mods { gap: 10px; }
.adm-mod { display: flex; flex-direction: column; gap: 8px; }
.adm-mod-head { display: flex; align-items: flex-start; gap: 10px; }
.adm-mod-icon {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); font-family: var(--font-emoji); font-size: 24px; line-height: 1;
}
.adm-mod-name { font-weight: 700; font-size: 14.5px; }
.adm-mod-desc { margin: 0; color: var(--text-muted); }
.adm-status { flex: none; margin-top: 2px; }
.adm-mod-detail { word-break: break-word; }
.adm-check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; line-height: 1.35; }
.adm-check input { margin-top: 1px; flex: none; }
.adm-switch { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-3); }
.adm-sched, .adm-settings { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.adm-settings .field { margin-bottom: 2px; }
.adm-dates, .adm-sched-hint { padding-left: 23px; }
.adm-dates { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.adm-mmdd { display: inline-flex; gap: 4px; }
.adm-mmdd .input { padding: 5px 6px; }
.adm-mm { width: 74px; }
.adm-dd { width: 62px; }
.adm-mod-actions { gap: 6px; }
.adm-tech > summary { cursor: pointer; color: var(--text-dim); }
.adm-perms { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* floor plan editor */
.ed-status { color: var(--text-muted); min-height: 18px; }
.ed-status[data-kind="warn"] { color: var(--warn); }
.ed-status[data-kind="ok"] { color: var(--success); }
.ed-banner, .ed-prompt {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--warn); background: rgba(245, 158, 11, 0.12);
}
.ed-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ed-tool {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 4px 6px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-size: 11.5px; font-weight: 650;
}
.ed-tool:hover { border-color: var(--text-dim); background: var(--surface-3); }
.ed-tool.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.ed-tool:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ed-tool-icon { font-family: var(--font-emoji); font-size: 19px; line-height: 1.1; }
.ed-key { position: absolute; top: 3px; right: 5px; font: 700 9.5px/1 ui-monospace, Consolas, monospace; color: var(--text-dim); }
.ed-actions { gap: 6px; flex-wrap: nowrap; }
.ed-pulse { animation: ed-pulse 1.8s ease-in-out infinite; }
@keyframes ed-pulse { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 4px var(--primary-soft); } }
.ed-hover {
  padding: 6px 10px; min-height: 30px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ed-options h3 { margin-bottom: 6px; }
.ed-options p { margin: 6px 0 0; }
.ed-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; margin-top: 6px; }
.ed-swatch {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  min-height: 62px; padding: 6px 4px 5px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-3);
  color: var(--text); font-size: 11px; font-weight: 600; line-height: 1.15;
}
.ed-swatch:hover { border-color: var(--text-dim); }
.ed-swatch.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.ed-sw-canvas { display: block; image-rendering: pixelated; border-radius: 3px; }
.ed-sw-art { flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.ed-sw-label { max-width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-inspect { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-3); font-size: 12.5px; }
.ed-inspect .row { margin-top: 6px; }
.ed-inspect-title { font-weight: 700; margin-bottom: 2px; }
.ed-kv { display: flex; gap: 8px; font-size: 12.5px; }
.ed-kv > span:first-child { width: 92px; flex: none; }
.ed-form {
  display: flex; flex-direction: column; gap: 6px;
  margin: 8px 0; padding: 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--primary); background: var(--primary-soft);
}
.ed-form .field { margin-bottom: 0; }
.ed-form-title { font-weight: 700; font-size: 12.5px; }
.ed-form-row { flex-wrap: nowrap; align-items: flex-end; }
.ed-form input[type="color"].input { width: 52px; }
.ed-list-title { margin: 10px 0 4px; font-size: 11.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.ed-list { display: flex; flex-direction: column; gap: 2px; }
.ed-list-scroll { max-height: 260px; overflow: auto; }
.ed-list-item { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: var(--radius-sm); font-size: 13px; }
.ed-list-item:hover, .ed-list-item.active { background: var(--surface-3); }
.ed-list-item .btn { padding: 2px 6px; }
.ed-ws-id { width: 46px; flex: none; color: var(--text-muted); }
.ed-steps { margin: 4px 0 6px; padding-left: 20px; color: var(--text-muted); }
.ed-steps li { margin: 2px 0; }
.ed-steps li.now { color: var(--text); font-weight: 650; }
.ed-steps li.done { color: var(--success); }
.ed-results[data-kind="error"] { border-color: var(--error); }
.ed-results[data-kind="warn"] { border-color: var(--warn); }
.ed-results[data-kind="ok"] { border-color: var(--success); }
.ed-results h3 { font-size: 13.5px; }
.ed-results .card-head { margin-bottom: 4px; }
.ed-msgs { margin: 0; padding-left: 18px; font-size: 12.5px; max-height: 220px; overflow: auto; }
.ed-msgs li { margin: 2px 0; word-break: break-word; }
.ed-errors li { color: #fca5a5; }
.ed-warnings li { color: #fcd34d; }
.ed-warn-text { color: var(--warn); }
.ed-mapcard > summary, .ed-help > summary { cursor: pointer; font-weight: 650; }
.ed-mapcard[open] > summary, .ed-help[open] > summary { margin-bottom: 8px; }
.ed-size-row { display: flex; align-items: flex-end; gap: 6px; }
.ed-size-row .field { margin-bottom: 6px; }
.ed-size { width: 76px; }
.ed-times { padding-bottom: 14px; color: var(--text-dim); }
.ed-help ul { margin: 0; padding-left: 18px; color: var(--text-muted); }
.ed-help li { margin: 3px 0; }

@media (max-width: 767px), (max-height: 500px) and (pointer: coarse) {
  .adm-staff th:nth-child(3), .adm-staff td.adm-c-dept { display: none; }
  .adm-nav-btn { padding: 7px 6px; }
}
/* ==== end admin + editor ==== */

/* ==== user panels (follow-up) ==== */
/* chat channel tabs wrap instead of scrolling sideways; readable key hints */
.chat-tabs { flex-wrap: wrap; overflow: visible; }
.chat-foot .kbd { color: var(--text-muted); }
/* selected wardrobe pieces / status preset: solid primary, not tinted text */
.me-chip.active, .me-preset.active { background: var(--primary); border-color: transparent; color: #fff; }
/* people: the 68px avatar preview is cropped to a head-and-shoulders portrait */
.pp-av canvas { position: absolute; left: -12px; top: -12px; }
/* ==== end user panels (follow-up) ==== */

/* ==== user panels (mobile sheet fix) ==== */
/* name tags / bubbles use inline z-index 1000+; keep them inside the stage so
   the mobile bottom sheet (.side, z-index 4) covers them */
.stage { isolation: isolate; }
/* ==== end user panels (mobile sheet fix) ==== */

/* ==== user panels (chat tab pills) ==== */
/* a channel tab is a pill holding the tab button (+ a separate close button for DMs) */
.chat-tab:not(.chat-tab-add) { padding: 0; }
.chat-tab-main {
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 0; max-width: 100%; height: 100%; padding: 0 11px;
  border: 0; border-radius: 999px; background: none; color: inherit; font: inherit; cursor: pointer;
}
.chat-tab-main:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.chat-tab.dm .chat-tab-main { padding-right: 3px; }
.chat-tab .chat-tab-close { margin: 0 7px 0 0; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.chat-tab .chat-tab-close:focus-visible { outline: 2px solid var(--primary); opacity: 1; }
/* ==== end user panels (chat tab pills) ==== */

/* ==== user panels (close hover) ==== */
.chat-tab .chat-tab-close:hover { background: rgba(255, 255, 255, 0.16); opacity: 1; }
/* ==== end user panels (close hover) ==== */

/* ==== v0.2 room access ==== */
/* door prompt + knock cards (public/js/features/access.js): centred over the
   map, above the mobile bottom sheet (.side z 4), below screens (50) + toasts (60) */
.acc-stack {
  position: fixed;
  top: calc(var(--topbar-h) + 10px);
  left: calc((100vw - var(--side-w)) / 2);
  transform: translateX(-50%);
  z-index: 45;
  width: min(360px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
body.side-collapsed .acc-stack { left: 50%; }
.acc-stack > * { pointer-events: auto; }
.acc-stack .card + .card { margin-top: 0; }
.acc-card, .acc-pop { background: var(--surface-2); border-color: var(--border-strong); box-shadow: var(--shadow); }
.acc-card { animation: acc-in 0.18s ease-out; }
.acc-head { display: flex; align-items: flex-start; gap: 10px; }
.acc-icon { flex: none; font-family: var(--font-emoji); font-size: 22px; line-height: 1.15; }
.acc-title { font-weight: 700; line-height: 1.3; }
.acc-sub { font-size: 12px; color: var(--text-muted); }
.acc-close { flex: none; margin: -4px -6px 0 0; padding: 2px 7px; }
.acc-pin-row { display: flex; gap: 6px; margin-top: 10px; }
.acc-pin-row .input { flex: 1; min-width: 0; }
.acc-pin { letter-spacing: 0.25em; font-variant-numeric: tabular-nums; }
.acc-pin::placeholder { letter-spacing: normal; }
.acc-msg { margin-top: 8px; font-size: 12.5px; color: var(--text-muted); }
.acc-msg.error { color: var(--error); font-weight: 600; }
.acc-actions { margin-top: 10px; gap: 6px; }
.acc-wait { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.acc-knock-card { border-left: 4px solid var(--accent); }
.acc-timer { flex: none; font-size: 12px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.acc-bar { height: 3px; margin-top: 10px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.acc-bar > span { display: block; width: 100%; height: 100%; background: var(--accent); transition: width 1s linear; }
@keyframes acc-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* lock button next to the room pill + the host controls popover */
.acc-lock { flex: none; width: 30px; height: 30px; font-family: var(--font-emoji); font-size: 15px; font-weight: 400; }
.acc-lock.locked { border-color: var(--accent); background: var(--accent-soft); }
.acc-pop { position: fixed; z-index: 46; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overscroll-behavior: contain; }
.acc-label { font-size: 11.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.acc-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.acc-mode {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  font-size: 12px; font-weight: 650; text-align: center;
  cursor: pointer;
}
.acc-mode:hover { border-color: var(--text-dim); }
.acc-mode.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.acc-mode:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.acc-mode input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.acc-mode-icon { font-family: var(--font-emoji); font-size: 18px; line-height: 1.1; }
.acc-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.acc-pop .field { margin-bottom: 0; }
.acc-field { display: flex; flex-direction: column; gap: 6px; }
.acc-people { max-height: 190px; padding: 4px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.acc-person { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.acc-person:hover { background: var(--surface-3); }
.acc-person .ellipsis { min-width: 0; }
.acc-dept { flex: none; max-width: 45%; margin-left: auto; padding-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--text-dim); }
.acc-empty { padding: 8px; text-align: center; }

/* editor: room access + voice (public/js/ui/editor.js) */
.ed-access { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--border-strong); }
.ed-access .field { margin-bottom: 0; }
.ed-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

@media (max-width: 767px), (max-height: 500px) and (pointer: coarse) {
  .acc-stack { left: 50%; top: calc(var(--topbar-h) + 8px); }
  .acc-lock { width: 28px; height: 28px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .acc-card { animation: none; }
}
/* ==== end v0.2 room access ==== */

/* ==== v0.2 tables + seat view ==== */
/* seat view (ui/seatview.js): covers the map stage while seated or watching;
   the top bar, the side panel and the toasts stay usable above/next to it.
   z-index is inside the stage's own stacking context (name tags use 1000-9000). */
.sv {
  position: absolute; inset: 0; z-index: 9500;
  display: flex; flex-direction: column;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 90%, black);
  background-image: radial-gradient(70% 45% at 50% 0%, var(--primary-soft), transparent 70%);
}
.sv-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.sv-icon {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #f8fafc; font-family: var(--font-emoji); font-size: 22px; line-height: 1;
}
.sv-titles { min-width: 0; }
.sv-title { margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-pill {
  flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong);
  font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sv-timer.low { background: rgba(239, 68, 68, 0.18); border-color: var(--error); color: var(--error); }
.sv-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 14px; }
.sv-foot { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.sv-controls { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.sv-controls:empty { display: none; }
.sv-esc { white-space: nowrap; }
.sv-stand { min-width: 128px; }

/* table layout: the game (or the lobby) on the left, seats + log on the right */
.sv-table { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); max-width: 1120px; margin: 0 auto; }
@media (min-width: 1000px) { .sv-table { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; } }
.sv-main { display: flex; flex-direction: column; align-items: stretch; gap: 12px; min-width: 0; }
.sv-note { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--text); font-size: 13px; text-align: center; }
.sv-game { display: flex; justify-content: center; min-width: 0; }
.sv-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sv-label { margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.sv-seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
@media (min-width: 1000px) { .sv-seats { grid-template-columns: minmax(0, 1fr); } }
.sv-seat { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.sv-seat.me { border-color: var(--primary); background: var(--primary-soft); }
.sv-seat.turn { box-shadow: 0 0 0 2px var(--accent); }
.sv-seat.empty { border-style: dashed; background: transparent; color: var(--text-muted); }
.sv-av { position: relative; flex: none; width: 40px; height: 40px; overflow: hidden; border-radius: 10px; background: var(--surface-3); }
.sv-av canvas { position: absolute; left: -14px; top: -10px; image-rendering: pixelated; }
.sv-av-initial { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--text-muted); }
.sv-seat-info { flex: 1; min-width: 0; }
.sv-seat-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-seat-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.sv-sit { flex: none; }
.sv-watchers { grid-column: 1 / -1; padding: 2px 4px; }
.sv-log {
  margin: 0; padding: 6px 8px 6px 24px; max-height: 180px; overflow: auto;
  border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-muted); overscroll-behavior: contain;
}
.sv-log:empty { padding-left: 8px; list-style: none; }
.sv-log:empty::before { content: "Moves and results show up here."; color: var(--text-dim); }
.sv-log li { margin: 2px 0; overflow-wrap: anywhere; }
.sv-log .sv-log-success { color: var(--success); font-weight: 650; }
.sv-log .sv-log-warn { color: var(--warn); }
.sv-log .sv-log-info { color: var(--text); }

/* lobby: pick a game, player settings, start */
.sv-lobby { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 640px; margin: 0 auto; }
.sv-lobby h3 { margin: 0; }
.sv-lobby p { margin: 0; }
.sv-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.sv-gcard {
  display: flex; align-items: center; gap: 10px; padding: 10px; min-width: 0;
  border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); text-align: left; font: inherit; cursor: pointer;
}
.sv-gcard:hover { border-color: var(--text-dim); }
.sv-gcard:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sv-gcard.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.sv-gicon { flex: none; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #f8fafc; font-family: var(--font-emoji); font-size: 22px; line-height: 1; }
.sv-gname { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.sv-gsettings { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.sv-gsetting { flex: 0 1 200px; margin: 0; }
.sv-startrow { gap: 10px; }
.sv-start { min-width: 150px; }

/* the meeting's wall screen (#seat-wall, the stage of the meeting layout below) */
.sv-wall-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-dim); font-weight: 650; text-align: center; }
.sv-wall-icon { font-family: var(--font-emoji); font-size: 40px; line-height: 1.1; opacity: 0.75; }

@media (max-width: 767px), (max-height: 500px) and (pointer: coarse) {
  .sv-head, .sv-foot { padding: 8px 10px; }
  .sv-icon { width: 32px; height: 32px; font-size: 19px; }
  .sv-body { padding: 10px; }
  .sv-esc { display: none; }
  .sv-seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-seat { gap: 6px; padding: 5px 6px; }
  .sv-av { width: 32px; height: 32px; }
  .sv-av canvas { left: -18px; top: -14px; }
  .sv-sit { padding: 3px 6px; }
  .sv-stand { min-width: 0; }
}
/* ==== end v0.2 tables + seat view ==== */

/* ==== v0.2 room access (follow-up) ==== */
/* the global .locked class greys out locked wardrobe items, so the lock button uses .acc-locked */
.acc-lock.acc-locked { border-color: var(--accent); background: var(--accent-soft); }
/* the picked access mode: solid primary like the other selected chips */
.acc-mode.active { background: var(--primary); border-color: transparent; color: #fff; box-shadow: none; }
/* ==== end v0.2 room access (follow-up) ==== */

/* ==== v0.2 tables + seat view (layout by stage width) ==== */
/* two columns only when the stage itself is wide (the side panel takes room) */
.sv-body { container-type: inline-size; }
@media (min-width: 1000px) {
  .sv-table { grid-template-columns: minmax(0, 1fr); }
  .sv-seats { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@container (min-width: 900px) {
  .sv-table { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
  .sv-seats { grid-template-columns: minmax(0, 1fr); }
}
.sv-esc { color: var(--text-muted); }
.sv-esc .kbd { color: var(--text); }
.sv-log { list-style: none; padding-left: 8px; }
/* ==== end v0.2 tables + seat view (layout by stage width) ==== */

/* ==== v0.2 voice + screen share ==== */
/* voice bar (public/js/ui/voice.js): top left of the map stage while in a voice room; over a
   table seat view it sits at the footer's empty left end; the meeting seat view shows the
   same controls in #seat-controls instead. z-index is inside the stage (seat view 9500). */
.rtc-bar { position: absolute; top: 10px; left: 10px; z-index: 9600; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: calc(100% - 20px); pointer-events: none; }
.rtc-bar > * { pointer-events: auto; }
.rtc-bar.on-seat { top: auto; bottom: 10px; }
.rtc-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 4px;
  border-radius: 999px; border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm);
  background: rgba(15, 23, 42, 0.86); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(6px);
}
.rtc-row .btn { border-radius: 999px; }
.rtc-pill { display: inline-flex; align-items: center; padding: 2px 8px; font-size: 12.5px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.btn.rtc-mic.live { background: var(--success); border-color: transparent; color: #052e16; }
.rtc-hint {
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-sm);
  border: 1px solid var(--accent); background: rgba(15, 23, 42, 0.9); background: color-mix(in srgb, var(--bg) 78%, var(--accent));
}
.sv-controls { flex-wrap: wrap; }
.sv-controls .rtc-pill { padding-left: 2px; }
/* the wall screen: the presenter's screen, letterboxed */
.rtc-screen { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
/* speaking: name tags on the map (the ring at the feet is the engine layer 'rtc-speaking') */
.overlay .vo-bub.speaking .vo-tag { background: #15803d; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.6), 0 1px 2px rgba(0, 0, 0, 0.35); }
@media (max-width: 767px), (max-height: 500px) and (pointer: coarse) {
  .rtc-bar { top: auto; bottom: 62px; left: 8px; }
  .rtc-bar.on-seat { bottom: 8px; }
  body.panel-open .rtc-bar { display: none; }
  .rtc-label { display: none; } /* icons only; aria-label and title keep the words */
  .rtc-unblock .rtc-label { display: inline; }
  .sv-foot { flex-wrap: wrap; }
}
/* ==== end v0.2 voice + screen share ==== */

/* ==== v0.2 meeting view: the parts needed without the seat view (the rest is css/meet.css) ==== */
.rtc-hint.warn { border-color: #f9ab00; }
/* raised hands on the map: a hand after the name on the tag */
.overlay .vo-bub.hand .vo-tag::after { content: "✋"; margin-left: 2px; font-family: var(--font-emoji); }
/* ==== end v0.2 meeting view ==== */

/* ==== phones and touch (SPEC 11, "Phones and touch") ==== */
/* --kb: how much of the page the on-screen keyboard covers (ui/touch.js, 0px when closed);
   the safe areas keep things off an iPhone's notch and home bar (viewport-fit=cover) */
:root {
  --kb: 0px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* the app frame never scrolls (a focused field or scrollIntoView must not shift the whole office) */
.app, .main { overflow: clip; }
/* no double-tap zoom delay on controls; no long-press callouts or text selection on the map and bars */
button, a, input, select, textarea, label, summary, [role="button"] { touch-action: manipulation; }
#canvas, .overlay, .emotes, .tabs, .topbar, .act-btn, .map-ctl, .sheet-grip { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.topbar { height: calc(var(--topbar-h) + var(--safe-t)); padding-top: var(--safe-t); padding-left: max(12px, var(--safe-l)); padding-right: max(12px, var(--safe-r)); }
.toasts { top: calc(var(--topbar-h) + var(--safe-t) + 10px); }
.acc-stack { top: calc(var(--topbar-h) + var(--safe-t) + 10px); }
.screen, .pin-setup { padding: max(16px, var(--safe-t)) max(16px, var(--safe-r)) max(16px, var(--safe-b)) max(16px, var(--safe-l)); }
/* sign-in and reconnect cards taller than the screen (a phone on its side) scroll instead of being cut off */
.screen { overflow-y: auto; overscroll-behavior: contain; }
.screen > .card { margin: auto; }

/* the page never zooms (pinch, double tap): the map has its own zoom; panels still scroll */
html, body { touch-action: pan-x pan-y; }
/* the sheet's grip is phone-only */
.sheet-grip { display: none; }

/* the Use button (ui/touch.js): what E does here, by the right thumb, on touch screens only */
.act-btn {
  position: absolute; right: calc(12px + var(--safe-r)); bottom: calc(76px + var(--safe-b)); z-index: 9400;
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 64px; min-height: 56px; padding: 0 20px 0 16px;
  border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.4);
  background: var(--primary); color: #fff; font: 750 16px/1 var(--font);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.act-btn:active { transform: scale(0.96); }
.act-btn:disabled { background: var(--surface-3); color: var(--text-muted); border-color: var(--border-strong); cursor: default; transform: none; }
.act-icon { font-family: var(--font-emoji); font-size: 24px; line-height: 1; }
/* map buttons (ui/touch.js): the whole office, find me; + and − on phones only (desktop has them in the top bar) */
.map-ctl { position: absolute; right: calc(14px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); z-index: 9400; display: flex; flex-direction: column; gap: 8px; }
.map-ctl .btn { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; background: rgba(15, 23, 42, 0.8); background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(6px); box-shadow: var(--shadow-sm); }
.map-ctl .btn.active { background: var(--primary); border-color: transparent; color: #fff; }
.map-ctl .mc-zoom { display: none; }

/* touch screens: 44 px targets, 16 px fields (iOS zooms into smaller ones), no keyboard-only hints */
@media (pointer: coarse) {
  .btn { min-height: 44px; min-width: 44px; }
  .adm-nav-btn { min-height: 44px; }
  .btn-sm { padding: 6px 12px; font-size: 13px; }
  .btn-icon { width: 44px; height: 44px; }
  .tab { height: 50px; }
  .emote-btn { width: 44px; height: 44px; }
  .chat-tab { height: 44px; }
  .chat-tab .chat-tab-close { width: 30px; height: 30px; }
  .chat-tab-add { width: 44px; }
  .chip, .me-chip { min-height: 44px; }
  .me-swatch { width: 36px; height: 36px; }
  .me-emoji { height: 44px; }
  .pp-section-title { min-height: 44px; }
  .status-btn { min-height: 40px; }
  .acc-lock { width: 40px; height: 40px; }
  input.input, select.input, textarea.input { min-height: 44px; font-size: 16px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
  .adm-unlock, .acc-person, .acc-check, .adm-check, .ed-check { min-height: 40px; }
  .chat-foot > span:first-child, .sv-esc, .ed-key { display: none; }
  .chat-count { margin-left: auto; }
  .chat-foot { font-size: 12px; }
  .badge { font-size: 12px; }
  .overlay .vo-bub .vo-tag, .overlay .vo-bub .vo-status { font-size: 12px; }
  .me-preview-hint { opacity: 1; }
  .rtc-pill, .sv-key-label { font-size: 12px; }
  .sv .sv-screen-key { width: 44px; height: 44px; }
}
@media (pointer: coarse) and (max-width: 767px), (pointer: coarse) and (max-height: 500px) {
  /* above the Use button, by the right thumb (the top is where toasts and the door prompt show) */
  .map-ctl { right: calc(12px + var(--safe-r)); bottom: calc(144px + var(--safe-b)); }
  .map-ctl .btn { width: 44px; height: 44px; font-size: 22px; }
  .map-ctl .mc-zoom { display: inline-flex; }
  body.panel-open .map-ctl, body.panel-open .act-btn { display: none; }
  .rtc-bar { max-width: calc(100% - 120px); }
}

/* phones: the side panel is a sheet over the map with a grip; toasts sit at the top and let taps through */
@media (max-width: 767px), (max-height: 500px) and (pointer: coarse) {
  .sheet-grip {
    display: block; position: relative; flex: none; width: 100%; height: 24px; padding: 0; margin: 0;
    border: 0; background: transparent; cursor: grab; touch-action: none;
  }
  .sheet-grip::before {
    content: ""; position: absolute; left: 50%; top: 9px; width: 44px; height: 5px;
    border-radius: 3px; background: var(--text-dim); transform: translateX(-50%);
  }
  .sheet-grip:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
  .side {
    bottom: var(--kb);
    height: min(70vh, calc(100vh - var(--topbar-h) - var(--kb)));
    height: min(70dvh, calc(100dvh - var(--topbar-h) - var(--safe-t) - var(--kb)));
    padding-bottom: var(--safe-b);
  }
  body.sheet-tall .side { height: calc(100vh - var(--topbar-h) - var(--kb)); height: calc(100dvh - var(--topbar-h) - var(--safe-t) - var(--kb)); }
  body.kb-open .side { padding-bottom: 0; }
  .tabs { border-radius: 0; }
  .emotes { bottom: calc(10px + var(--safe-b)); }
  .toasts { top: calc(var(--topbar-h) + var(--safe-t) + 8px); bottom: auto; left: max(12px, var(--safe-l)); right: max(12px, var(--safe-r)); max-width: none; align-items: center; gap: 6px; }
  .toast { width: 100%; max-width: 480px; padding: 8px 12px; pointer-events: none; cursor: default; box-shadow: var(--shadow-sm); }
  .toast.toast-action { pointer-events: auto; cursor: pointer; }
  .rtc-bar { bottom: calc(66px + var(--safe-b)); }
  /* seat view: smaller head and foot, room for the game */
  .sv-head { padding: 6px max(10px, var(--safe-r)) 6px max(10px, var(--safe-l)); gap: 8px; }
  .sv-title { font-size: 15px; }
  .sv-foot { padding: 6px max(10px, var(--safe-r)) calc(6px + var(--safe-b)) max(10px, var(--safe-l)); }
  /* the lobby: two games a row, Start always in reach at the bottom */
  .sv-games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .sv-gcard { gap: 8px; padding: 8px; }
  .sv-gicon { width: 30px; height: 30px; font-size: 18px; }
  .sv-gname b { font-size: 13px; line-height: 1.25; }
  .sv-startrow { position: sticky; bottom: -10px; z-index: 2; margin: 0 -12px -12px; padding: 10px 12px; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); background: var(--surface-2); }
  /* Admin -> Staff: one card per person, the whole nickname and full name readable */
  .adm-staff, .adm-staff tbody { display: block; }
  .adm-staff thead { display: none; }
  .adm-staff tr.adm-row {
    display: grid; grid-template-columns: 18px auto minmax(0, 1fr) 44px;
    grid-template-areas: "dot name name act" "dot role desk act";
    align-items: center; column-gap: 8px; row-gap: 4px; padding: 10px 6px 10px 10px; border-bottom: 1px solid var(--border);
  }
  .adm-staff tr.adm-row > td { display: block; width: auto; padding: 0; border: 0; background: none; }
  .adm-staff tr.adm-row.open { background: var(--primary-soft); }
  .adm-staff tr.adm-row > td.adm-c-dot { grid-area: dot; align-self: start; padding-top: 5px; text-align: left; }
  .adm-staff tr.adm-row > td.adm-c-name { grid-area: name; }
  .adm-staff tr.adm-row > td.adm-c-role { grid-area: role; }
  .adm-staff tr.adm-row > td.adm-c-desk { grid-area: desk; color: var(--text-muted); }
  .adm-staff tr.adm-row > td.adm-c-act { grid-area: act; padding: 0; text-align: right; }
  .adm-staff tr.adm-row > td.adm-c-dept { display: none; }
  .adm-staff .adm-c-name .ellipsis { white-space: normal; overflow-wrap: anywhere; }
  .adm-staff .adm-name-row { flex-wrap: wrap; row-gap: 2px; }
  .adm-staff tr.adm-edit-row, .adm-staff tr.adm-edit-row > td { display: block; }
  .adm-staff .adm-edit .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
/* a phone on its side: the side panel is a drawer from the right, the map stays wide */
@media (max-height: 500px) and (pointer: coarse) and (orientation: landscape) {
  .side {
    top: 0; right: 0; bottom: var(--kb); left: auto; width: min(400px, 62vw); height: auto;
    border-top: 0; border-left: 1px solid var(--border-strong); border-radius: 16px 0 0 16px;
    padding-right: var(--safe-r); padding-bottom: 0;
    transform: translateX(100%);
  }
  body.sheet-tall .side { height: auto; }
  .sheet-grip { height: 16px; }
  .sheet-grip::before { top: 5px; }
  .tab { height: 42px; }
  .panel-body { padding: 8px 10px; }
  .chat-list-wrap { min-height: 60px; }
  body.panel-open .toasts { right: calc(min(400px, 62vw) + 12px); }
  .company-name { max-width: 180px; }
}
/* the keyboard is up on a phone on its side: only the conversation and the box being typed in */
@media (max-height: 260px) and (pointer: coarse) {
  .topbar, .sheet-grip, .tabs, .chat-scope, .chat-foot, .chat-tabs { display: none; }
}
@media (max-height: 500px) and (pointer: coarse) and (orientation: landscape) {
  body.kb-open .topbar, body.kb-open .sheet-grip, body.kb-open .tabs, body.kb-open .chat-scope, body.kb-open .chat-foot, body.kb-open .chat-tabs { display: none; }
}
@media (pointer: coarse) {
  .status-btn { min-width: 44px; justify-content: center; }
  .panel-toggle, .zoom, .acc-lock { flex: none; }
  .pp-sub, .pp-dept, .pp-full, .me-label, .me-count, .dec-item-name, .dec-label, .chat-scope, .chat-time, .ev-hof-date, .adm-hint, .me-preview-hint, .list-title, .sv-label { font-size: 12px; }
}
/* ==== end phones and touch ==== */
