/* The frame: wallpaper, the glass slab, the sidebar (icon rail + context panel), pages, and shared controls. */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  font-feature-settings: "ss01", "cv11";
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ph, .ph-fill { line-height: 1; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--pill); color: var(--pill-ink); border-radius: var(--r-sm); text-decoration: none; }
.skip:focus { top: 16px; }
:root.no-motion *, :root.no-motion *::before, :root.no-motion *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; } }

/* ---------- slab ---------- */
.app { position: relative; z-index: 2; height: 100dvh; padding: clamp(8px, 1.3vw, 18px); }
.slab {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  border-radius: var(--r-slab);
  background: var(--slab);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--edge), inset 0 0 0 1px var(--edge-soft);
  backdrop-filter: blur(var(--blur)) saturate(1.45);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.45);
  overflow: hidden;
  transition: grid-template-columns .45s var(--ease);
}
.slab.ctx-closed { --ctx-w: 0px; }

/* ---------- icon rail ---------- */
.rail {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 0 16px;
  background: var(--rail);
  border-right: 1px solid var(--line);
}
.rail .new {
  display: grid; place-items: center;
  width: 46px; height: 46px; margin-bottom: 10px;
  border: 0; border-radius: 50%;
  background: var(--pill); color: var(--pill-ink);
  font-size: 22px;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.45);
  transition: transform .35s var(--spring), box-shadow .2s;
}
.rail .new:hover { transform: rotate(90deg) scale(1.04); }
.rail .new:active { transform: scale(0.94); }
.rail .sep { width: 28px; height: 1px; margin: 8px 0; background: var(--line-2); }
.rail .grow { flex: 1; }
.nav {
  position: relative;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border: 0; border-radius: var(--r-sm);
  background: none;
  color: var(--ink-2);
  font-size: 22px;
  text-decoration: none;
  transition: background-color .2s var(--ease), color .2s, transform .15s var(--ease);
}
.nav:hover { background: var(--well); color: var(--ink); }
.nav:active { transform: scale(0.95); }
.nav .ph-fill { display: none; }
.nav[aria-current="page"] { color: var(--ink); }
.nav[aria-current="page"] .ph { display: none; }
.nav[aria-current="page"] .ph-fill { display: block; }
.nav[aria-current="page"]::before {
  content: ""; position: absolute; left: -15px; top: 11px; bottom: 11px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--ink);
  animation: grow .35s var(--ease);
}
@keyframes grow { from { transform: scaleY(0); } }
.nav .dot-badge {
  position: absolute; top: 9px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--rail);
}
.nav .dot-badge.accent { background: var(--accent); }
.nav .dot-badge.crit { background: var(--crit); }
.conn-dot { width: 8px; height: 8px; margin: 6px 0 2px; border-radius: 50%; background: var(--good); }
.conn-dot.busy { animation: beat 1.6s ease-in-out infinite; }
.conn-dot.bad { background: var(--crit); }
.nav .dot-badge.live { background: var(--accent); animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 50% { transform: scale(1.35); opacity: .7; } }
/* hover label, like a callout */
.nav::after {
  content: attr(data-label);
  position: absolute; left: calc(100% + 14px); top: 50%;
  transform: translate(-6px, -50%);
  padding: 5px 10px;
  border-radius: var(--r-xs);
  background: var(--pill); color: var(--pill-ink);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .2s var(--ease);
}
.nav:hover::after, .nav:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
.avatar {
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-top: 8px;
  border: 2px solid var(--edge); border-radius: 50%;
  background: var(--pill);
  color: var(--pill-ink); font-weight: 600; font-size: 15px; letter-spacing: .02em;
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.5);
}

/* ---------- context panel ---------- */
.ctx {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.ctx-inner { width: 280px; display: flex; flex-direction: column; min-height: 0; height: 100%; }
.ctx-head { display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 12px 0 22px; border-bottom: 1px solid var(--line); flex: none; }
.ctx-head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 10px 24px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.ctx-foot { flex: none; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.ctx-foot .clock { margin-left: auto; font-family: var(--mono); font-size: 12px; }
.grp { margin: 0 0 18px; }
.grp > h3 { margin: 6px 12px 6px; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.item {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; min-height: 40px; padding: 7px 12px;
  border: 0; border-radius: var(--r-sm);
  background: none; text-align: left;
  color: var(--ink); font-size: 15px; text-decoration: none;
  transition: background-color .15s;
}
.item:hover { background: var(--well); }
.item > i { font-size: 20px; color: var(--ink-2); justify-self: center; }
.item .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t .dim { color: var(--muted); font-size: 13.5px; }
.item .r { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item .r.warn { color: #b45309; }
:root[data-theme="dark"] .item .r.warn { color: var(--warn); }
.item .r.bad { color: var(--crit); }
.item .sw { width: 10px; height: 10px; border-radius: 50%; justify-self: center; }
.item .live-dot { display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: var(--good); vertical-align: 2px; animation: beat 1.6s ease-in-out infinite; }
.ctx-extra:empty { display: none; }
.ctx-empty { margin: 18px 12px; font-size: 14px; color: var(--muted); line-height: 1.55; }

/* ---------- stage and pages ---------- */
.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.page {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 26px clamp(18px, 2.6vw, 38px) 48px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  visibility: hidden; opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity .28s var(--ease), transform .4s var(--ease), visibility 0s .28s;
}
.page.on { visibility: visible; opacity: 1; pointer-events: auto; transform: none; transition: opacity .28s var(--ease), transform .4s var(--ease); }
.page.flush { padding: 0; overflow: hidden; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head h1 { margin: 0; font-size: clamp(26px, 2.3vw, 32px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; text-wrap: balance; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 15px; max-width: 70ch; text-wrap: pretty; }
.page-head .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 12px; }
.section-title h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.section-title p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ---------- cards ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--edge-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow), inset 0 1px 0 var(--edge);
  padding: 18px 20px;
  min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 28px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.005em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.card-foot { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--card-2);
  font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none;
  box-shadow: inset 0 1px 0 var(--edge);
  transition: background-color .2s var(--ease), transform .15s var(--ease), border-color .2s, opacity .2s;
}
.btn i { font-size: 16px; }
.btn:hover { background: var(--card); border-color: var(--line-2); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.pill { border-radius: 999px; background: var(--pill); color: var(--pill-ink); border-color: transparent; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.6); }
.btn.pill:hover { background: var(--pill); opacity: .9; }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.danger { color: var(--crit); }
.btn.ghost { background: none; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--well); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border: 0; border-radius: var(--r-xs);
  background: none; color: var(--ink-2); font-size: 18px;
  transition: background-color .15s, color .15s, transform .15s var(--ease);
}
.icon-btn:hover { background: var(--well); color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }

/* segmented control */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--well); border: 1px solid var(--line); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: calc(var(--r-sm) - 3px); background: none; color: var(--ink-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background-color .2s var(--ease), color .2s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--card-2); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 1px 0 var(--edge); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea {
  width: 100%; min-height: 38px; padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--card-2);
  font-size: 14px; font-weight: 400;
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.mono-in { font-family: var(--mono) !important; font-size: 13px !important; }
.switch { position: relative; display: inline-flex; flex: none; width: 40px; height: 24px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--well-2); border: 1px solid var(--line-2); transition: background-color .25s var(--ease); }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--card-2); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform .3s var(--spring); corner-shape: round; }
.switch input:checked + span { background: var(--accent); border-color: transparent; }
.switch input:checked + span::after { background: var(--on-accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="range"] { accent-color: var(--accent); width: 100%; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--well); cursor: pointer; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.check:hover { background: var(--well-2); }
.check input { margin-top: 3px; accent-color: var(--accent); }
.check b { color: var(--ink); font-weight: 600; }

/* ---------- status ---------- */
.status-pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--well); color: var(--ink-2); }
.status-pill i { font-size: 14px; }
.status-pill[data-s="ok"] i { color: var(--good); }
.status-pill[data-s="low"] i { color: #c98500; }
.status-pill[data-s="limited"] i, .status-pill[data-s="failed"] i { color: var(--crit); }
.status-pill[data-s="signed-out"] i { color: var(--muted); }
.status-pill[data-s="running"] i { color: var(--accent); animation: spin 1.2s linear infinite; }
.status-pill[data-s="done"] i { color: var(--good); }
.status-pill[data-s="stopped"] i, .status-pill[data-s="interrupted"] i { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-xs); background: var(--well); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.tag .sw { width: 8px; height: 8px; border-radius: 50%; }
.delta { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good-ink); }
.delta.down { color: var(--crit); }
.delta.flat { color: var(--muted); }

/* ---------- toasts with undo ---------- */
.toasts { position: fixed; left: 50%; bottom: 22px; z-index: 60; display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-width: 280px; max-width: min(560px, calc(100vw - 32px));
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-md);
  background: rgba(10, 10, 10, 0.92);
  color: #fafafa;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6);
  font-size: 14px;
  overflow: hidden;
  pointer-events: auto;
  animation: toast-in .45s var(--spring);
}
:root[data-theme="dark"] .toast { background: rgba(250, 250, 250, 0.95); color: #0a0a0a; }
.toast.out { animation: toast-out .3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }
.toast > i { font-size: 18px; opacity: .85; }
.toast .msg { flex: 1; min-width: 0; line-height: 1.4; }
.toast .undo { height: 30px; padding: 0 12px; border: 0; border-radius: var(--r-xs); background: rgba(255, 255, 255, 0.14); color: inherit; font-weight: 600; font-size: 13.5px; }
.toast .undo:hover { background: rgba(255, 255, 255, 0.24); }
:root[data-theme="dark"] .toast .undo { background: rgba(0, 0, 0, 0.08); }
.toast .x { width: 30px; height: 30px; border: 0; border-radius: var(--r-xs); background: none; color: inherit; opacity: .6; font-size: 16px; display: grid; place-items: center; }
.toast .x:hover { opacity: 1; }
.toast .timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: currentColor; opacity: .5; transform-origin: left; animation: timer linear forwards; }
@keyframes timer { to { transform: scaleX(0); } }
.toast.bad > i { color: #ff8b7a; }

/* ---------- chart tooltip ---------- */
.tip {
  position: fixed; z-index: 70; pointer-events: none;
  min-width: 120px; padding: 9px 11px;
  border-radius: var(--r-sm);
  background: var(--tip);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  font-size: 12.5px; color: var(--ink-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0; transform: translateY(4px);
  transition: opacity .12s, transform .12s;
}
.tip.on { opacity: 1; transform: none; }
.tip .th { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.tip .tr { display: grid; grid-template-columns: 12px auto 1fr; gap: 7px; align-items: center; line-height: 1.6; }
.tip .tr b { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.tip .key { width: 12px; height: 2px; border-radius: 2px; }

/* ---------- overlays: palette, sheets, dialogs ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.2); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.palette {
  position: fixed; left: 50%; top: 14vh; z-index: 50;
  width: min(640px, calc(100vw - 32px));
  transform: translateX(-50%);
  border-radius: var(--r-xl);
  background: var(--slab);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--edge);
  backdrop-filter: blur(36px) saturate(1.6);
  -webkit-backdrop-filter: blur(36px) saturate(1.6);
  overflow: hidden;
  animation: pop .35s var(--spring);
}
@keyframes pop { from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(.97); } }
.palette .q { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.palette .q i { font-size: 20px; color: var(--muted); }
.palette .q input { border: 0 !important; background: none !important; box-shadow: none !important; height: 58px; padding: 0 !important; font-size: 17px !important; }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.palette li h4 { margin: 10px 12px 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.palette .opt { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; width: 100%; min-height: 42px; padding: 6px 12px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; font-size: 14.5px; color: var(--ink-2); }
.palette .opt i { font-size: 18px; }
.palette .opt .k { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.palette .opt[aria-selected="true"] { background: var(--card-2); color: var(--ink); box-shadow: inset 0 1px 0 var(--edge); }
.palette .none { padding: 18px 12px; color: var(--muted); font-size: 14px; }
.palette .foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
kbd { display: inline-block; min-width: 20px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--card-2); font: 11.5px var(--mono); color: var(--ink-2); text-align: center; }

.sheet {
  position: fixed; top: 14px; right: 14px; bottom: 14px; z-index: 50;
  width: min(560px, calc(100vw - 28px));
  display: flex; flex-direction: column;
  border-radius: var(--r-xl);
  background: var(--slab);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--edge);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  overflow: hidden;
  animation: slide .45s var(--ease);
}
@keyframes slide { from { opacity: 0; transform: translateX(24px); } }
.sheet > header { display: flex; align-items: center; gap: 10px; height: 62px; padding: 0 12px 0 22px; border-bottom: 1px solid var(--line); flex: none; }
.sheet > header h2 { margin: 0; flex: 1; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet > .body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px 28px; }
.sheet > footer { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); flex: none; }
.sheet > footer .note { margin-right: auto; font-size: 13px; color: var(--muted); }

.dialog {
  position: fixed; left: 50%; top: 50%; z-index: 50;
  width: min(620px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border-radius: var(--r-xl);
  background: var(--slab);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--edge);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  padding: 22px;
  animation: pop2 .35s var(--spring);
}
@keyframes pop2 { from { opacity: 0; transform: translate(-50%, -48%) scale(.97); } }
.dialog h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.dialog > p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.dialog .row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; align-items: center; }
.dialog .row-end .note { margin-right: auto; font-size: 13px; color: var(--muted); }

.enter { animation: enter .45s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

/* ---------- narrow screens ---------- */
@media (max-width: 1100px) {
  .slab { grid-template-columns: 68px minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .app { padding: 0; }
  .slab { border-radius: 0; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .rail { grid-row: 2; flex-direction: row; justify-content: space-around; padding: 6px 8px; border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; }
  .rail .new { width: 40px; height: 40px; margin: 0; }
  .rail .sep, .rail .grow, .avatar { display: none; }
  .nav[aria-current="page"]::before { left: 11px; right: 11px; top: auto; bottom: -6px; width: auto; height: 3px; }
  .stage { grid-row: 1; }
}

/* ---------- people ---------- */
.face { border-radius: 50%; display: inline-grid; place-items: center; flex: none; width: var(--s, 26px); height: var(--s, 26px); background: var(--c, var(--pill)); color: #fff; font-size: calc(var(--s, 26px) * 0.4); font-weight: 600; letter-spacing: 0; line-height: 1; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.face.sys { background: var(--well-2); color: var(--muted); }
.faces { display: inline-flex; align-items: center; }
.faces .face { margin-left: -6px; box-shadow: 0 0 0 2px var(--card); }
.faces .face:first-child { margin-left: 0; }
.rail .people { display: grid; justify-items: center; gap: 8px; margin-bottom: 4px; }
.rail .person { border-radius: 50%; position: relative; width: 34px; height: 34px; border: 0; padding: 0; display: grid; place-items: center; background: var(--c); color: #fff; font: 600 12.5px var(--font); cursor: pointer; box-shadow: 0 0 0 2px var(--rail), 0 0 0 3.5px color-mix(in srgb, var(--c) 45%, transparent); transition: transform .2s var(--spring); }
.rail .person:hover { transform: scale(1.07); }
.rail .person .on { border-radius: 50%; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; background: var(--good); box-shadow: 0 0 0 2px var(--rail); }
.rail .person[data-label]:hover::after { content: attr(data-label); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); z-index: 30; white-space: pre; padding: 7px 10px; border-radius: var(--r-sm); background: var(--tip); color: var(--ink); font: 500 12.5px var(--font); box-shadow: var(--shadow-lg); border: 1px solid var(--line); pointer-events: none; }
#avatar { background: var(--me, var(--pill)); color: #fff; }
