/* Slate Codex colors. --accent is the primary color; each player can change it (Panels & colors). */
:root {
  --bg: #10161c;
  --bg-2: #141b22;
  --panel: #1b232b;
  --panel-2: #26313b;
  --line: #2e3a45;
  --line-2: #4a5866;
  --text: #f4f7fa;
  --muted: #8d9aa7;
  --accent: #1d9bf0;
  --accent-2: #4db3ff;
  --accent-ink: #ffffff; /* text on top of the accent color */
  --blue: #4db3ff;
  --ok: #5cc25a;
  --danger: #d13340;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --sidebar: 360px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.4 var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }
kbd {
  font: 600 11px/1 var(--font);
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  white-space: nowrap;
}
a { color: var(--accent-2); }
body:not(.is-dm) .dm-only { display: none !important; }

/* ---------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  cursor: pointer;
  font-weight: 600;
  transition: background .12s, border-color .12s, transform .06s;
  white-space: nowrap;
}
.btn:hover { background: #2a3142; border-color: #465068; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.big { padding: 12px 18px; font-size: 15px; width: 100%; }
.btn.primary, .btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover, .btn.accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: #fecaca; border-color: #7f1d1d; background: #3b1518; }
.btn.danger:hover { background: #5b1d22; }
.btn.ok { color: #bbf7d0; border-color: #14532d; background: #12301e; }
.btn.ok:hover { background: #18432a; }
.btn.ghost { background: transparent; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger:hover { color: #fca5a5; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

input[type=text], input:not([type]), input[type=number], input[type=password], select, textarea {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 7px 9px;
  outline: none;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=color] { width: 34px; height: 28px; padding: 2px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; }
input[type=range] { accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
textarea { resize: vertical; width: 100%; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check.small { font-size: 12.5px; gap: 6px; }

.badge {
  font: 700 10px/1 var(--font);
  letter-spacing: .06em;
  padding: 4px 6px;
  border-radius: 5px;
}
.badge.live { background: rgba(34, 197, 94, .15); color: #4ade80; border: 1px solid rgba(34, 197, 94, .35); }
.badge.preview { background: rgba(168, 85, 247, .15); color: #c4b5fd; border: 1px solid rgba(168, 85, 247, .35); }

.switch { position: relative; display: inline-block; width: 36px; height: 20px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 20px; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25);
  font-size: 11px; color: #111;
}
.swatch.on { border-color: #fff; transform: scale(1.08); }
.swatch.sm { width: 22px; height: 22px; }

/* ---------------------------------------------------------- join */
.join {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 16px;
  background:
    radial-gradient(1200px 600px at 20% 10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    radial-gradient(900px 600px at 90% 90%, rgba(96, 165, 250, .08), transparent 60%),
    var(--bg);
  overflow: auto;
}
.join-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px;
}
.join-brand { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.join-brand small { font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: .1em; }
.join-card p { margin: -8px 0 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 13px; }
.field input { padding: 10px 12px; font-size: 15px; }
.join-error { color: #fca5a5; min-height: 1em; font-weight: 600; }
.join-error:empty { display: none; }

/* ---------------------------------------------------------- layout */
.app { display: flex; flex-direction: column; height: 100%; }
.topbar {
  height: 52px; flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.brand { font-weight: 800; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.scene-pill { display: flex; align-items: center; gap: 8px; min-width: 0; }
.scene-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.scene-switch { display: flex; gap: 8px; align-items: center; }
.scene-switch select { padding: 5px 8px; max-width: 200px; }
.users { display: flex; gap: 6px; align-items: center; overflow: hidden; }
.user { display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); }
.user.me { border-color: var(--c); }
.avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
}
.uname { font-size: 12.5px; font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.conn.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.conn.bad { background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

.main { flex: 1; display: flex; min-height: 0; }
.board-wrap { position: relative; flex: 1; min-width: 0; overflow: hidden; background: var(--bg); }
#board { display: block; touch-action: none; }

.sidebar {
  width: var(--sidebar); flex: none;
  display: flex; flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--line);
  min-height: 0;
}
body.sidebar-closed .sidebar { display: none; }

/* ---------------------------------------------------------- toolbar */
.toolbar {
  position: absolute; left: 12px; top: 12px;
  display: flex; flex-direction: column; gap: 2px;
  padding: 5px;
  background: rgba(26, 30, 40, .92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 5;
}
.toolbar button {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.toolbar button:hover { background: var(--panel-2); color: var(--text); }
.toolbar button.on { background: var(--accent); color: var(--accent-ink); }
.toolbar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.toolbar .sep { height: 1px; background: var(--line); margin: 4px 4px; }

.tool-options {
  position: absolute; left: 64px; top: 12px;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: rgba(26, 30, 40, .92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 5;
  max-width: calc(100% - 80px);
  flex-wrap: wrap;
}
.opt-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.zoombar {
  position: absolute; right: 12px; bottom: 12px;
  display: flex;
  background: rgba(26, 30, 40, .92);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  z-index: 5;
}
.zoombar button { border: 0; background: transparent; color: var(--text); height: 34px; min-width: 34px; cursor: pointer; font-weight: 700; font-size: 15px; }
.zoombar button:hover { background: var(--panel-2); }
#zoomFit { font-size: 12px; min-width: 56px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

.empty-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(26, 30, 40, .9);
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 380px; text-align: center;
  color: var(--muted);
  pointer-events: auto;
  z-index: 2;
}
.empty-hint b { color: var(--text); }

/* ---------------------------------------------------------- inspector */
.inspector {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  max-height: calc(100% - 90px);
  overflow: auto;
  background: rgba(26, 30, 40, .97);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 6;
}
.insp-head { display: flex; align-items: center; gap: 10px; }
.insp-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  font-weight: 700; font-size: 14px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .3);
}
.insp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.insp-name { flex: 1; font-size: 16px; font-weight: 700; padding: 6px 9px; }
.insp-title { flex: 1; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.inspector .close { font-size: 20px; }
.insp-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 8px; }
.insp-grid label, .row-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.hp-row { display: flex; align-items: center; gap: 4px; }
.hp-row .slash { color: var(--muted); }
.num { width: 100%; text-align: center; }
.hp-quick { display: flex; gap: 6px; }
.hp-quick .amt { width: 80px; flex: none; }
.insp-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.inline select { padding: 5px 7px; }
.dm-row { padding: 8px 10px; background: rgba(168, 85, 247, .07); border: 1px solid rgba(168, 85, 247, .2); border-radius: 9px; }
.notes { font-size: 13px; }
.insp-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cond-details summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); user-select: none; display: flex; align-items: center; gap: 6px; }
.cond-details .count { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 6px; font-size: 11px; }
.cond-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.cond-list.readonly { margin-top: 0; }
.cond {
  font-size: 12px; padding: 3px 9px; border-radius: 99px;
  border: 1px solid var(--line-2); background: transparent; cursor: pointer;
  text-transform: capitalize; color: var(--muted);
}
.cond:hover { color: var(--text); }
.cond.on { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); color: var(--accent-2); }
.hp-status { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; text-transform: capitalize; }
.hp-status.healthy { background: rgba(34, 197, 94, .15); color: #4ade80; }
.hp-status.bloodied { background: rgba(239, 68, 68, .15); color: #f87171; }
.hp-status.down { background: #3b1518; color: #fca5a5; }

/* ---------------------------------------------------------- sidebar */
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; padding: 0 6px; }
.tab {
  flex: 1; padding: 13px 6px 11px;
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font-weight: 600; cursor: pointer; position: relative;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab.ping::after { content: ""; position: absolute; top: 9px; right: 12px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.tab-badge { font-size: 10.5px; background: var(--panel-2); border: 1px solid var(--line-2); padding: 1px 5px; border-radius: 99px; margin-left: 4px; }
.panel { display: none; flex: 1; flex-direction: column; min-height: 0; }
.panel.active { display: flex; }
#scenePanel { overflow-y: auto; padding: 12px; gap: 12px; }

/* chat */
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-empty { text-align: center; margin: auto; }
.msg { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.msg-head { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 2px; }
.msg-head .who { font-weight: 700; }
.msg-head .time { margin-left: auto; color: var(--muted); font-size: 11px; }
.msg-text { white-space: pre-wrap; word-wrap: break-word; }
.msg.from-dm { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.msg.system { background: transparent; border: 0; text-align: center; color: var(--muted); font-size: 12.5px; padding: 2px; }
.msg.roll.private { border-style: dashed; border-color: rgba(168, 85, 247, .45); }
.msg.pop { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.roll-label { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.roll-body { display: flex; align-items: center; gap: 12px; }
.roll-total {
  min-width: 54px; height: 46px; padding: 0 8px;
  display: grid; place-items: center;
  font-size: 24px; font-weight: 800;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 9px;
}
.crit-success .roll-total { background: rgba(34, 197, 94, .16); border-color: #22c55e; color: #4ade80; }
.crit-fail .roll-total { background: rgba(239, 68, 68, .14); border-color: #ef4444; color: #f87171; }
.crit-tag { font-size: 11.5px; font-weight: 700; margin-top: 4px; text-transform: uppercase; letter-spacing: .06em; }
.crit-success .crit-tag { color: #4ade80; }
.crit-fail .crit-tag { color: #f87171; }
.roll-break { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; font-size: 12.5px; color: var(--muted); }
.dgroup { display: inline-flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.dnote { font-size: 11px; margin-right: 2px; }
.die {
  min-width: 22px; height: 22px; padding: 0 4px;
  display: inline-grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 5px;
  color: var(--text); font-weight: 700; font-size: 12px;
}
.die.max { color: #4ade80; border-color: rgba(34, 197, 94, .5); }
.die.min { color: #f87171; border-color: rgba(239, 68, 68, .5); }
.die.dropped { opacity: .4; text-decoration: line-through; }
.mod { color: var(--text); font-weight: 700; }

.dice-tray { border-top: 1px solid var(--line); padding: 10px 12px 6px; flex: none; display: flex; flex-direction: column; gap: 8px; }
.dice-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.die-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0 4px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px;
  cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 700;
}
.die-btn svg { width: 20px; height: 20px; fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.die-btn:hover { border-color: var(--accent); color: var(--text); background: var(--panel-2); }
.die-btn:active { transform: scale(.95); }
.dice-opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 4px 9px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--panel-2); color: var(--text); }
.mod-field { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.mod-field input { width: 56px; padding: 4px 6px; text-align: center; }
.chat-form { display: flex; gap: 6px; padding: 6px 12px 12px; flex: none; }
.chat-form input { flex: 1; padding: 9px 11px; }

/* initiative */
.init-head { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 1px solid var(--line); gap: 8px; }
.round { font-size: 13px; color: var(--muted); }
.round b { color: var(--text); font-size: 18px; margin-left: 4px; }
.init-turn-btns { display: flex; gap: 6px; }
.init-list { list-style: none; margin: 0; padding: 8px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.init-empty { padding: 20px 12px; text-align: center; }
.init-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--bg-2);
  cursor: pointer;
}
.init-row:hover { border-color: var(--line-2); }
.init-row.selected { border-color: var(--blue); }
.init-row.current { background: color-mix(in srgb, var(--accent) 13%, transparent); border-color: var(--accent); }
.init-row.current .init-name { font-weight: 700; }
.init-row.hidden-entry { opacity: .55; }
.init-val { width: 44px; text-align: center; font-weight: 800; font-size: 15px; padding: 4px; }
span.init-val { display: inline-block; }
.init-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.init-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.init-hp { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.init-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; border-top: 1px solid var(--line); }

/* scene panel */
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.card-title { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13.5px; }
.invite { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent); }
.invite-url { display: flex; align-items: center; gap: 8px; }
.invite-url code { flex: 1; font-size: 13px; background: var(--panel); padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line); user-select: all; overflow: hidden; text-overflow: ellipsis; }
.scene-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.scene-list li { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 8px; border: 1px solid transparent; }
.scene-list li.viewing { background: var(--panel-2); border-color: var(--line-2); }
.scene-btn { flex: 1; text-align: left; background: transparent; border: 0; cursor: pointer; padding: 4px 6px; font-weight: 600; display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.map-thumb { display: flex; flex-direction: column; gap: 4px; }
.map-thumb img { width: 100%; max-height: 140px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.grid-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row-field input[type=number] { width: 100%; }
.nudge { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nudge .muted { margin-right: 6px; }
.nudge .icon-btn { border-color: var(--line); }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.shortcuts kbd { justify-self: start; }

/* toasts */
.toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 50; pointer-events: none; align-items: center; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line-2);
  padding: 8px 14px; border-radius: 9px; box-shadow: var(--shadow);
  font-weight: 600; font-size: 13px;
  animation: pop .2s ease-out; transition: opacity .4s, transform .4s;
}
.toast.error { border-color: #7f1d1d; background: #3b1518; color: #fecaca; }
.toast.out { opacity: 0; transform: translateY(-6px); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------- small screens */
@media (max-width: 900px) {
  :root { --sidebar: 320px; }
  .uname, .brand { display: none; }
  .scene-name { max-width: 140px; }
}
@media (max-width: 800px) {
  .sidebar {
    position: fixed; right: 0; top: 52px; bottom: 0;
    width: min(380px, 100%);
    z-index: 20;
    box-shadow: var(--shadow);
  }
  .users { display: none; }
  .insp-grid { grid-template-columns: 1fr 1fr; }
  .scene-switch select { max-width: 120px; }
}
.cond-details summary::before { content: "▸"; font-size: 10px; transition: transform .12s; }
.cond-details[open] summary::before { transform: rotate(90deg); }
.cond-details summary::-webkit-details-marker { display: none; }
