/* AEGIS panel — dark, tactile, local-first */
:root {
  --bg: #06080d;
  --bg-soft: #0a0d15;
  --bg-raised: #0e141d;
  --surface: rgba(13, 19, 27, 0.9);
  --surface-2: rgba(19, 26, 37, 0.78);
  --line: rgba(226, 233, 245, 0.075);
  --line-strong: rgba(247, 227, 176, 0.2);
  --text: #f4efe6;
  --text-soft: #d6d0c5;
  --muted: #aaa399;
  --faint: #8b857b;
  --gold: #e8c979;
  --gold-bright: #f7e3b0;
  --gold-dim: #c2a15e;
  --mint: #8fd6b8;
  --violet: #b8ace8;
  --blue: #8fb6e8;
  --red: #f0a29a;
  --red-dim: rgba(240, 162, 154, 0.12);
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  --font-display: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-body: "Aptos", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse 55% 45% at 82% -8%, rgba(232, 201, 121, 0.11), transparent 62%),
    radial-gradient(ellipse 45% 40% at 10% 108%, rgba(108, 123, 255, 0.10), transparent 65%),
    radial-gradient(ellipse 40% 35% at 50% 55%, rgba(24, 31, 44, 0.55), transparent 72%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(226, 233, 245, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 233, 245, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at 50% 10%, black 0%, transparent 75%);
}
::selection { background: rgba(232, 201, 121, 0.28); color: #fdfaf3; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
code { font-family: var(--font-mono); font-size: 0.92em; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  padding: 30px 20px 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(12, 16, 24, 0.97), rgba(6, 8, 13, 0.94)),
    radial-gradient(circle at 50% 0%, rgba(232, 201, 121, 0.07), transparent 38%);
  backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 30px; }
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--gold);
  border: 1px solid rgba(232, 201, 121, 0.3);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(232, 201, 121, 0.15), rgba(232, 201, 121, 0.025));
  box-shadow: inset 0 1px 0 rgba(226, 233, 245, 0.15), 0 8px 24px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.brand-mark svg { width: 27px; height: 27px; position: relative; z-index: 1; }
.brand-glow { position: absolute; inset: 22%; border-radius: 50%; background: var(--gold); filter: blur(18px); opacity: 0.28; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: 0.16em; line-height: 1; }
.brand-copy span { font-size: 7px; font-weight: 700; letter-spacing: 0.2em; color: var(--faint); }

.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-label { padding: 0 12px 10px; color: var(--faint); font-size: 8px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.nav-item .icon { width: 17px; height: 17px; opacity: 0.8; }
.nav-item:hover { color: var(--text-soft); background: rgba(226, 233, 245, 0.035); }
.nav-item.is-active {
  color: var(--gold-bright);
  border-color: rgba(232, 201, 121, 0.14);
  background: linear-gradient(90deg, rgba(232, 201, 121, 0.11), rgba(232, 201, 121, 0.02));
  box-shadow: inset 0 1px 0 rgba(226, 233, 245, 0.04);
}
.nav-item.is-active .icon { opacity: 1; color: var(--gold); }
.nav-marker { width: 3px; height: 14px; margin-left: auto; border-radius: 3px; background: var(--gold); box-shadow: 0 0 12px rgba(232, 201, 121, 0.55); }
.nav-item:not(.is-active) .nav-marker { display: none; }
.nav-count { margin-left: auto; min-width: 20px; padding: 2px 6px; border-radius: 6px; background: rgba(226, 233, 245, 0.055); color: var(--muted); font-size: 9px; text-align: center; }
.nav-pip { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px rgba(143, 214, 184, 0.7); }

.side-monitor {
  margin-top: 34px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(226, 233, 245, 0.018);
}
.side-label { display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 8px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.side-state { margin-top: 9px; font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.side-server { margin-top: 2px; color: var(--muted); font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.side-meter { height: 3px; margin-top: 14px; border-radius: 4px; background: rgba(226, 233, 245, 0.07); overflow: hidden; }
.side-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.side-meter-copy { display: flex; justify-content: space-between; margin-top: 7px; color: var(--faint); font-size: 8px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(143, 214, 184, 0.08), 0 0 10px rgba(143, 214, 184, 0.5); animation: breathe 3s ease-in-out infinite; }
.live-dot.is-off { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 155, 155, 0.08); animation: none; }
.live-dot.is-warn { background: var(--gold); box-shadow: 0 0 0 3px rgba(232, 201, 121, 0.08); }

.sidebar-foot { margin-top: auto; padding-top: 24px; }
.bot-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(226, 233, 245, 0.022); }
.bot-copy { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.bot-copy strong { overflow: hidden; color: var(--text-soft); font-size: 10px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.bot-copy span { color: var(--faint); font-size: 8px; }
.presence-dot { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--faint); }
.presence-dot.is-on { background: var(--mint); box-shadow: 0 0 8px rgba(143, 214, 184, 0.7); }
.foot-meta { display: flex; justify-content: space-between; padding: 14px 4px 0; color: var(--faint); font-size: 7px; font-weight: 700; letter-spacing: 0.16em; }

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(226, 233, 245, 0.12);
  border-radius: 13px;
  background: linear-gradient(145deg, #2a3345, #0e141d);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.small { width: 31px; height: 31px; border-radius: 10px; font-size: 9px; }
.avatar.tiny { width: 27px; height: 27px; border-radius: 9px; font-size: 8px; }
.avatar.large { width: 46px; height: 46px; border-radius: 15px; font-size: 13px; }

/* Main frame */
.main {
  min-width: 0;
  padding: 0 34px 24px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  border-bottom: 1px solid rgba(226, 233, 245, 0.045);
  background: linear-gradient(180deg, rgba(6, 8, 13, 0.92) 20%, rgba(6, 8, 13, 0.55) 80%, transparent);
  backdrop-filter: blur(16px);
}
.breadcrumbs { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 8px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.crumb-sep { color: rgba(226, 233, 245, 0.18); }
.crumb-current { color: var(--text-soft); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.live-pill { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--faint); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.12em; }
.live-pill.is-live { color: var(--mint); }
.live-pill.is-live .live-dot { width: 5px; height: 5px; }
.connection-mode { padding-left: 7px; border-left: 1px solid var(--line); color: var(--faint); font-size: 7px; letter-spacing: 0.14em; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(226, 233, 245, 0.025);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.icon-btn .icon { width: 15px; height: 15px; }
.icon-btn:hover { color: var(--gold); border-color: rgba(232, 201, 121, 0.25); background: rgba(232, 201, 121, 0.05); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.tiny { width: 24px; height: 24px; border-radius: 7px; }
.icon-btn.tiny .icon { width: 12px; height: 12px; }
.operator { display: flex; align-items: center; gap: 9px; margin-left: 4px; padding-left: 13px; border-left: 1px solid var(--line); }
.operator-avatar { width: 33px; height: 33px; border-radius: 10px; }
.operator-copy { display: flex; flex-direction: column; gap: 1px; }
.operator-copy strong { font-size: 10px; font-weight: 600; color: var(--text-soft); }
.operator-copy span { color: var(--faint); font-size: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn .icon { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: wait; opacity: 0.55; transform: none; }
.btn-primary {
  color: #131a24;
  border-color: rgba(226, 233, 245, 0.35);
  background: linear-gradient(135deg, #f7e3b0 0%, #e8c979 48%, #c2a15e 100%);
  box-shadow: 0 10px 26px rgba(190, 150, 70, 0.18), inset 0 1px 0 rgba(226, 233, 245, 0.65);
}
.btn-primary:hover { box-shadow: 0 14px 34px rgba(190, 150, 70, 0.26), inset 0 1px 0 rgba(226, 233, 245, 0.8); }
.btn-ghost { color: var(--text-soft); border-color: var(--line); background: rgba(226, 233, 245, 0.028); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); background: rgba(226, 233, 245, 0.05); }
.btn-danger-ghost { color: var(--red); border-color: rgba(255, 155, 155, 0.17); background: rgba(255, 120, 120, 0.045); }
.btn-danger-ghost:hover { border-color: rgba(255, 155, 155, 0.32); background: rgba(255, 120, 120, 0.09); }
.btn.full { width: 100%; }
.top-pause { min-height: 34px; padding: 0 13px; border-radius: 10px; font-size: 10px; }
.top-pause .icon { width: 13px; height: 13px; }
.top-pause.is-paused { color: var(--gold-bright); border-color: rgba(232, 201, 121, 0.28); background: rgba(232, 201, 121, 0.08); }

/* View + surfaces */
.view-stack { max-width: 1540px; margin: 0 auto; }
.view { display: none; animation: viewIn 0.32s cubic-bezier(0.22, 1, 0.36, 1); }
.view.is-active { display: block; }
.surface {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(21, 27, 39, 0.82), rgba(9, 12, 19, 0.92));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(226, 233, 245, 0.045);
}
.surface::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(125deg, rgba(226, 233, 245, 0.035), transparent 28%, transparent 68%, rgba(232, 201, 121, 0.028));
}
.panel { padding: 24px; overflow: hidden; }
.panel > * { position: relative; z-index: 1; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-kicker, .page-kicker { display: block; color: var(--gold-dim); font-size: 8px; font-weight: 700; letter-spacing: 0.19em; text-transform: uppercase; }
.panel h2 { margin: 5px 0 0; font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.panel-icon { margin-top: 2px; color: var(--faint); opacity: 0.7; }
.text-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: 0.04em; border: 0; background: transparent; transition: color 0.18s ease; }
.text-btn .icon { width: 13px; height: 13px; transition: transform 0.18s ease; }
.text-btn:hover { color: var(--gold); }
.text-btn:hover .icon { transform: translateX(2px); }

/* Hero */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(310px, 0.94fr);
  align-items: center;
  gap: 20px;
  min-height: 438px;
  margin-top: 22px;
  padding: clamp(30px, 3.4vw, 54px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse 55% 75% at 78% 42%, rgba(232, 201, 121, 0.12), transparent 62%),
    radial-gradient(ellipse 45% 60% at 14% 100%, rgba(91, 105, 220, 0.10), transparent 66%),
    linear-gradient(135deg, rgba(24, 30, 43, 0.95), rgba(8, 11, 18, 0.98));
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(226, 233, 245, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 233, 245, 0.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse at 70% 50%, black 0%, transparent 74%);
  opacity: 0.55;
}
.hero::after {
  content: "";
  position: absolute;
  right: -8%;
  top: -20%;
  width: 58%;
  aspect-ratio: 1;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 201, 121, 0.10), transparent 67%);
  filter: blur(10px);
  pointer-events: none;
}
.ambient { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; opacity: 0.75; pointer-events: none; }
.hero-noise { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.3; background-image: radial-gradient(rgba(226, 233, 245, 0.10) 0.5px, transparent 0.5px); background-size: 4px 4px; mask-image: linear-gradient(90deg, transparent, black 60%); }
.hero-copy { position: relative; z-index: 2; max-width: 630px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: 0.21em; text-transform: uppercase; }
.eyebrow-mark { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid rgba(232, 201, 121, 0.25); border-radius: 7px; background: rgba(232, 201, 121, 0.075); }
.eyebrow-mark .icon { width: 12px; height: 12px; }
.hero h1 { margin: 22px 0 20px; font-family: var(--font-display); font-size: clamp(3.2rem, 5.4vw, 5.4rem); font-weight: 600; line-height: 0.92; letter-spacing: -0.052em; }
.hero h1 em { color: var(--gold); font-style: normal; text-shadow: 0 0 42px rgba(232, 201, 121, 0.17); }
.hero-lede { max-width: 475px; margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 27px 0 29px; }
.hero-actions .btn { min-height: 42px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 30px; padding-top: 20px; border-top: 1px solid rgba(226, 233, 245, 0.075); }
.hero-meta div { display: flex; flex-direction: column; gap: 3px; }
.hero-meta span { color: var(--faint); font-size: 7px; font-weight: 700; letter-spacing: 0.17em; text-transform: uppercase; }
.hero-meta strong { color: var(--text-soft); font-family: var(--font-mono); font-size: 10px; font-weight: 500; }
.hero-index { position: absolute; right: 25px; bottom: 19px; z-index: 2; display: flex; gap: 13px; color: var(--faint); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.16em; }

/* Orb */
.orb-stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(100%, 430px);
  aspect-ratio: 1;
  margin: 0 auto;
  perspective: 1100px;
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.orb-halo { position: absolute; inset: 1%; border-radius: 50%; background: radial-gradient(circle, rgba(232, 201, 121, 0.19), rgba(232, 201, 121, 0.04) 38%, transparent 66%); filter: blur(22px); animation: haloPulse 7s ease-in-out infinite; }
.orb {
  position: relative;
  width: 69%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform-style: preserve-3d;
  animation: orbFloat 7s ease-in-out infinite;
}
.orb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 50%;
  border: 1px solid rgba(232, 201, 121, 0.23);
  background:
    radial-gradient(circle at 36% 28%, rgba(247, 227, 176, 0.2), transparent 18%),
    radial-gradient(circle at 54% 58%, rgba(232, 201, 121, 0.11), rgba(13, 17, 25, 0.38) 56%, rgba(7, 10, 16, 0.85) 72%);
  box-shadow: inset 0 0 52px rgba(232, 201, 121, 0.08), inset 0 -20px 45px rgba(0, 0, 0, 0.55), 0 0 80px rgba(232, 201, 121, 0.08);
}
.orb-grid { position: absolute; inset: 1%; z-index: 1; overflow: hidden; border-radius: 50%; opacity: 0.55; background-image: repeating-linear-gradient(0deg, transparent 0 22px, rgba(232, 201, 121, 0.10) 23px), repeating-linear-gradient(90deg, transparent 0 22px, rgba(232, 201, 121, 0.08) 23px); mask-image: radial-gradient(circle, black 35%, transparent 72%); }
.orb-ring { position: absolute; z-index: 2; border-radius: 50%; border: 1px solid rgba(232, 201, 121, 0.28); transform-style: preserve-3d; }
.orb-ring-a { inset: -7%; box-shadow: 0 0 18px rgba(232, 201, 121, 0.08); animation: ringA 19s linear infinite; }
.orb-ring-b { inset: 2%; border-color: rgba(143, 214, 184, 0.17); animation: ringB 24s linear infinite reverse; }
.orb-ring-c { inset: 14%; border-color: rgba(247, 227, 176, 0.2); border-style: dashed; animation: ringC 15s linear infinite; }
.orb-core {
  position: absolute;
  inset: 25%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(232, 201, 121, 0.34);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 27%, #273044, #0d131c 72%);
  box-shadow: 0 0 35px rgba(232, 201, 121, 0.13), inset 0 0 25px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(247, 227, 176, 0.2);
  transform: translateZ(48px);
}
.orb-core svg { width: 50%; color: var(--gold); filter: drop-shadow(0 0 8px rgba(232, 201, 121, 0.3)); }
.core-label { margin-top: 5px; color: var(--gold-dim); font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.26em; }
.orb-node { position: absolute; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 5px 8px; color: var(--text-soft); font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.14em; border: 1px solid rgba(226, 233, 245, 0.12); border-radius: 999px; background: rgba(10, 14, 21, 0.72); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); backdrop-filter: blur(6px); transform: translateZ(72px); }
.orb-node i { width: 3px; height: 3px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 6px rgba(143, 214, 184, 0.8); }
.node-a { top: 9%; left: -3%; }
.node-b { right: -7%; bottom: 17%; }
.node-c { bottom: 1%; left: 15%; }
.orb-plinth { position: absolute; bottom: 3%; width: 54%; height: 7%; border-radius: 50%; background: radial-gradient(ellipse, rgba(232, 201, 121, 0.22), transparent 68%); filter: blur(10px); }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 15px; }
.stat-card { display: flex; align-items: flex-start; gap: 13px; min-height: 132px; padding: 20px; overflow: hidden; }
.stat-card::before { content: ""; position: absolute; top: 0; left: 20px; width: 26px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); opacity: 0.8; }
.stat-icon { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 auto; border: 1px solid rgba(226, 233, 245, 0.08); border-radius: 12px; }
.stat-icon .icon { width: 17px; height: 17px; }
.stat-icon.gold { color: var(--gold); background: rgba(232, 201, 121, 0.08); }
.stat-icon.mint { color: var(--mint); background: rgba(143, 214, 184, 0.07); }
.stat-icon.violet { color: var(--violet); background: rgba(169, 166, 255, 0.07); }
.stat-icon.blue { color: var(--blue); background: rgba(137, 184, 255, 0.07); }
.stat-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.stat-main > span { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.stat-main strong { margin-top: 4px; font-family: var(--font-display); font-size: 29px; font-weight: 600; line-height: 1.05; letter-spacing: -0.045em; }
.stat-main small { overflow: hidden; color: var(--faint); font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.stat-spark { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin-left: auto; opacity: 0.4; }
.stat-spark i { width: 3px; height: 9px; border-radius: 2px; background: var(--gold); }
.stat-spark i:nth-child(2) { height: 14px; opacity: 0.55; }
.stat-spark i:nth-child(3) { height: 20px; opacity: 0.7; }
.stat-spark i:nth-child(4) { height: 12px; opacity: 0.4; }
.stat-spark i:nth-child(5) { height: 24px; }
.stat-spark.mint i { background: var(--mint); }
.stat-spark.violet i { background: var(--violet); }
.stat-spark.blue i { background: var(--blue); }

/* Content grid */
.content-grid { display: grid; grid-template-columns: minmax(0, 1.82fr) minmax(265px, 0.88fr); gap: 15px; margin-top: 15px; }
.content-grid.lower { align-items: stretch; }
.events-layout { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); margin-top: 0; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(232, 201, 121, 0.25) transparent; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { padding: 0 10px 10px; color: var(--faint); font-size: 7px; font-weight: 700; letter-spacing: 0.14em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { padding-left: 4px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 4px; text-align: right; }
.data-table td { padding: 12px 10px; border-top: 1px solid rgba(226, 233, 245, 0.055); vertical-align: middle; }
.data-table tbody tr { transition: background 0.16s ease; }
.data-table tbody tr:hover { background: rgba(226, 233, 245, 0.022); }
.member-cell { display: flex; align-items: center; gap: 9px; min-width: 145px; }
.member-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.member-info strong { overflow: hidden; max-width: 180px; color: var(--text-soft); font-size: 10px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.member-info span { color: var(--faint); font-family: var(--font-mono); font-size: 7px; }
.role-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.tag { padding: 2px 5px; color: var(--muted); font-size: 6px; letter-spacing: 0.02em; border: 1px solid rgba(226, 233, 245, 0.08); border-radius: 4px; background: rgba(226, 233, 245, 0.025); }
.level-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 27px; height: 22px; padding: 0 7px; color: var(--gold); font-family: var(--font-mono); font-size: 10px; border: 1px solid rgba(232, 201, 121, 0.19); border-radius: 6px; background: rgba(232, 201, 121, 0.055); }
.level-badge.high { color: var(--red); border-color: rgba(255, 155, 155, 0.2); background: var(--red-dim); }
.countdown { color: var(--text-soft); font-family: var(--font-mono); font-size: 10px; white-space: nowrap; }
.countdown.is-expired { color: var(--faint); }
.state-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--mint); font-size: 8px; white-space: nowrap; }
.state-chip::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.state-chip.is-expired { color: var(--faint); }
.state-chip.is-expired::before { box-shadow: none; }
.row-action { display: inline-grid; place-items: center; width: 25px; height: 25px; color: var(--faint); border: 1px solid transparent; border-radius: 7px; background: transparent; transition: color 0.16s ease, background 0.16s ease; }
.row-action:hover { color: var(--red); background: var(--red-dim); }
.row-action .icon { width: 12px; height: 12px; }
.row-action.reset { color: var(--muted); }
.row-action.reset:hover { color: var(--gold); background: rgba(232, 201, 121, 0.07); }
.progress-line { width: 100%; min-width: 70px; height: 3px; margin-top: 5px; border-radius: 4px; background: rgba(226, 233, 245, 0.06); overflow: hidden; }
.progress-line span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }
.empty-row td { padding: 29px 10px; color: var(--faint); font-size: 10px; text-align: center !important; }

/* Health */
.health-panel { display: flex; flex-direction: column; }
.health-pulse { position: relative; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(143, 214, 184, 0.06); }
.health-list { display: flex; flex-direction: column; }
.health-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid rgba(226, 233, 245, 0.055); }
.health-row:first-child { padding-top: 0; border-top: 0; }
.health-icon { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; border-radius: 8px; background: rgba(226, 233, 245, 0.035); }
.health-icon .icon { width: 12px; height: 12px; }
.health-copy { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.health-copy strong { overflow: hidden; color: var(--text-soft); font-size: 9px; font-weight: 550; white-space: nowrap; text-overflow: ellipsis; }
.health-copy span { color: var(--faint); font-size: 7px; }
.health-state { margin-left: auto; color: var(--mint); font-family: var(--font-mono); font-size: 7px; }
.health-state.warn { color: var(--gold); }
.health-state.bad { color: var(--red); }
.health-foot { display: flex; align-items: center; gap: 7px; margin-top: 13px; padding-top: 13px; border-top: 1px solid rgba(226, 233, 245, 0.055); color: var(--faint); font-size: 7px; }

/* Timeline */
.timeline { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(232, 201, 121, 0.25) transparent; }
.timeline-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; min-height: 58px; }
.timeline-rail { position: relative; display: flex; justify-content: center; }
.timeline-rail::before { content: ""; position: absolute; top: 18px; bottom: 0; width: 1px; background: rgba(226, 233, 245, 0.075); }
.timeline-item:last-child .timeline-rail::before { display: none; }
.timeline-dot { position: relative; z-index: 1; width: 7px; height: 7px; margin-top: 6px; border: 1px solid rgba(232, 201, 121, 0.4); border-radius: 50%; background: #121722; box-shadow: 0 0 0 4px rgba(232, 201, 121, 0.035); }
.timeline-item[data-level="success"] .timeline-dot { border-color: rgba(143, 214, 184, 0.5); background: var(--mint); box-shadow: 0 0 9px rgba(143, 214, 184, 0.35); }
.timeline-item[data-level="warning"] .timeline-dot { border-color: rgba(232, 201, 121, 0.6); background: var(--gold); box-shadow: 0 0 9px rgba(232, 201, 121, 0.3); }
.timeline-item[data-level="error"] .timeline-dot { border-color: rgba(255, 155, 155, 0.6); background: var(--red); box-shadow: 0 0 9px rgba(255, 155, 155, 0.3); }
.timeline-body { padding-bottom: 14px; min-width: 0; }
.timeline-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.timeline-top strong { overflow: hidden; color: var(--text-soft); font-size: 10px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.timeline-top time { flex: 0 0 auto; color: var(--faint); font-family: var(--font-mono); font-size: 7px; }
.timeline-body p { margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.timeline-kind { display: inline-block; margin-top: 4px; color: var(--faint); font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.13em; text-transform: uppercase; }
.timeline.compact { max-height: 276px; }
.timeline.compact .timeline-body p { -webkit-line-clamp: 1; }
.timeline-empty { padding: 26px 0; color: var(--faint); font-size: 10px; text-align: center; }

/* Control deck */
.control-panel { display: flex; flex-direction: column; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid rgba(226, 233, 245, 0.055); }
.switch-row:first-of-type { border-top: 0; padding-top: 0; }
.switch-row div { display: flex; flex-direction: column; gap: 2px; }
.switch-row strong { color: var(--text-soft); font-size: 10px; font-weight: 600; }
.switch-row span { color: var(--faint); font-size: 8px; }
.switch { position: relative; width: 38px; height: 21px; flex: 0 0 auto; padding: 0; border: 1px solid rgba(226, 233, 245, 0.11); border-radius: 999px; background: rgba(226, 233, 245, 0.06); transition: background 0.2s ease, border-color 0.2s ease; }
.switch span { position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #8f9aa9; transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease; }
.switch.is-on { border-color: rgba(143, 214, 184, 0.35); background: rgba(143, 214, 184, 0.18); }
.switch.is-on span { background: var(--mint); transform: translateX(17px); box-shadow: 0 0 9px rgba(143, 214, 184, 0.4); }
.switch.is-warn { border-color: rgba(232, 201, 121, 0.35); background: rgba(232, 201, 121, 0.16); }
.switch.is-warn.is-on span { background: var(--gold); }
.control-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 13px; }
.control-actions .btn { min-height: 34px; font-size: 9px; }
.fine-print { margin: auto 0 0; padding-top: 13px; color: var(--faint); font-size: 8px; line-height: 1.55; }
.compact-row { margin-top: 15px; padding-top: 15px; }

/* Page heads */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; padding: 35px 0 25px; }
.page-head h1 { margin: 9px 0 5px; font-family: var(--font-display); font-size: clamp(2rem, 3.2vw, 3.1rem); font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.page-head p { max-width: 520px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.page-head p code { color: var(--gold-dim); }
.page-clock { display: flex; align-items: center; gap: 9px; padding-bottom: 4px; color: var(--faint); font-family: var(--font-mono); font-size: 9px; }
.settings-badge { display: flex; align-items: center; gap: 6px; padding: 7px 10px; color: var(--muted); font-size: 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(226, 233, 245, 0.025); }
.settings-badge .icon { width: 12px; height: 12px; color: var(--gold-dim); }

/* Cooldown page */
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.mini-stat { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 18px; border-radius: 16px; }
.mini-stat span { color: var(--faint); font-size: 8px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.mini-stat strong { color: var(--gold); font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 17px; border-bottom: 1px solid rgba(226, 233, 245, 0.055); }
.panel-title h2 { margin: 4px 0 0; font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.search-box { display: flex; align-items: center; gap: 8px; width: min(100%, 280px); height: 34px; padding: 0 11px; color: var(--faint); border: 1px solid var(--line); border-radius: 9px; background: rgba(226, 233, 245, 0.025); transition: border-color 0.18s ease; }
.search-box:focus-within { border-color: rgba(232, 201, 121, 0.3); }
.search-box .icon { width: 14px; height: 14px; }
.search-box input { width: 100%; height: 100%; padding: 0; color: var(--text-soft); font-size: 10px; border: 0; outline: 0; background: transparent; }
.search-box input::placeholder { color: var(--faint); }
.filter-group { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: rgba(226, 233, 245, 0.02); }
.filter { min-height: 25px; padding: 0 9px; color: var(--faint); font-size: 8px; font-weight: 600; border: 0; border-radius: 6px; background: transparent; transition: color 0.16s ease, background 0.16s ease; }
.filter:hover { color: var(--text-soft); }
.filter.is-active { color: var(--gold); background: rgba(232, 201, 121, 0.1); }
.data-table.wide { margin-top: 4px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 46px 20px 40px; text-align: center; }
.empty-mark { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 12px; color: var(--gold-dim); border: 1px solid rgba(232, 201, 121, 0.16); border-radius: 15px; background: rgba(232, 201, 121, 0.04); }
.empty-mark .icon { width: 20px; height: 20px; }
.empty-state strong { color: var(--text-soft); font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.empty-state span { margin-top: 4px; color: var(--faint); font-size: 9px; }

/* Events + console */
.events-layout .panel { min-height: 480px; }
.console-panel { background: linear-gradient(145deg, rgba(14, 18, 27, 0.92), rgba(7, 10, 16, 0.96)); }
.console { max-height: 545px; overflow-y: auto; padding: 2px 0 10px; font-family: var(--font-mono); font-size: 9px; line-height: 1.65; scrollbar-width: thin; scrollbar-color: rgba(232, 201, 121, 0.2) transparent; }
.console-line { display: grid; grid-template-columns: 58px 43px minmax(0, 1fr); gap: 7px; padding: 4px 4px; border-radius: 4px; }
.console-line:hover { background: rgba(226, 233, 245, 0.025); }
.console-time { color: #4e5765; }
.console-level { font-size: 7px; font-weight: 600; letter-spacing: 0.04em; }
.console-level.INFO { color: #71849a; }
.console-level.WARNING { color: var(--gold); }
.console-level.ERROR { color: var(--red); }
.console-level.DEBUG { color: #5a6372; }
.console-msg { overflow-wrap: anywhere; color: #8f9aa9; }
.console-msg strong { color: #b4beca; font-weight: 500; }
.console-empty { padding: 30px 4px; color: var(--faint); }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.settings-grid .span-2 { grid-column: 1 / -1; }
.field-grid { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--text-soft); font-size: 9px; font-weight: 600; }
.field > span em { color: var(--faint); font-size: 7px; font-style: normal; font-weight: 400; }
.field small { color: var(--faint); font-size: 7.5px; line-height: 1.45; }
.input-wrap { display: flex; align-items: center; height: 37px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(226, 233, 245, 0.025); transition: border-color 0.18s ease, background 0.18s ease; }
.input-wrap:focus-within { border-color: rgba(232, 201, 121, 0.32); background: rgba(232, 201, 121, 0.025); }
.input-wrap input { width: 100%; height: 100%; padding: 0; color: var(--text-soft); font-family: var(--font-mono); font-size: 11px; border: 0; outline: 0; background: transparent; }
.input-wrap span { flex: 0 0 auto; color: var(--faint); font-size: 8px; }
.field > input { height: 37px; padding: 0 11px; color: var(--text-soft); font-size: 10px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: rgba(226, 233, 245, 0.025); transition: border-color 0.18s ease; }
.field > input:focus { border-color: rgba(232, 201, 121, 0.32); }
.field > input::placeholder { color: var(--faint); }
.pattern-field { margin-bottom: 16px; }
.pattern-field > input { font-family: var(--font-mono); font-size: 9px; }
.ladder-preview { padding-top: 13px; border-top: 1px solid rgba(226, 233, 245, 0.055); }
.ladder-preview > span { display: block; margin-bottom: 7px; color: var(--gold-dim); font-size: 7px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
#ladder-preview { display: flex; flex-wrap: wrap; gap: 5px; }
.ladder-step { display: flex; align-items: center; gap: 5px; padding: 4px 6px; color: var(--muted); font-family: var(--font-mono); font-size: 7px; border: 1px solid rgba(226, 233, 245, 0.07); border-radius: 5px; background: rgba(226, 233, 245, 0.02); }
.ladder-step strong { color: var(--gold); font-weight: 500; }
.selected-count { display: flex; align-items: baseline; gap: 5px; color: var(--faint); }
.selected-count strong { color: var(--gold); font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.selected-count span { font-size: 7px; letter-spacing: 0.1em; text-transform: uppercase; }
.role-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 3px 0 8px; color: var(--faint); font-size: 7px; }
.role-hint { color: var(--faint); font-size: 7px; }
.role-library { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; max-height: 248px; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; scrollbar-color: rgba(232, 201, 121, 0.22) transparent; }
.role-option { display: flex; align-items: center; gap: 8px; min-height: 35px; padding: 0 9px; text-align: left; border: 1px solid rgba(226, 233, 245, 0.06); border-radius: 8px; background: rgba(226, 233, 245, 0.018); transition: border-color 0.16s ease, background 0.16s ease; }
.role-option:hover { border-color: rgba(247, 227, 176, 0.2); background: rgba(226, 233, 245, 0.035); }
.role-option.is-selected { border-color: rgba(232, 201, 121, 0.28); background: rgba(232, 201, 121, 0.07); }
.role-option.is-locked { cursor: not-allowed; opacity: 0.4; }
.role-swatch { width: 5px; height: 17px; flex: 0 0 auto; border-radius: 3px; background: var(--faint); }
.role-option.is-selected .role-swatch { box-shadow: 0 0 7px currentColor; }
.role-name { overflow: hidden; color: var(--muted); font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.role-option.is-selected .role-name { color: var(--text-soft); }
.role-pos { margin-left: auto; color: var(--faint); font-family: var(--font-mono); font-size: 6px; }
.role-check { display: grid; place-items: center; width: 13px; height: 13px; flex: 0 0 auto; color: var(--gold); border: 1px solid rgba(226, 233, 245, 0.1); border-radius: 4px; }
.role-check .icon { width: 9px; height: 9px; opacity: 0; }
.role-option.is-selected .role-check { border-color: rgba(232, 201, 121, 0.35); background: rgba(232, 201, 121, 0.12); }
.role-option.is-selected .role-check .icon { opacity: 1; }
.api-box { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(226, 233, 245, 0.02); }
.api-box > span { flex: 0 0 auto; color: var(--faint); font-size: 6px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.api-box code { overflow: hidden; color: var(--muted); font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.api-box .icon-btn { margin-left: auto; }
.danger-panel { border-color: rgba(255, 155, 155, 0.09); }
.danger-panel .panel-icon { color: var(--red); opacity: 0.7; }
.muted-copy { margin: 0 0 14px; color: var(--faint); font-size: 8px; line-height: 1.55; }
.danger-actions { display: flex; gap: 7px; }
.danger-actions .btn { min-height: 34px; font-size: 9px; }
.save-bar { position: static; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 15px; padding: 14px 18px; border-color: rgba(232, 201, 121, 0.13); background: linear-gradient(100deg, rgba(27, 33, 45, 0.97), rgba(12, 16, 24, 0.97)); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(226, 233, 245, 0.07); }
.save-bar > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.save-bar strong { color: var(--text-soft); font-size: 10px; font-weight: 600; }
.save-bar span { color: var(--faint); font-size: 8px; }
.save-actions { display: flex; gap: 7px; }
.save-actions .btn { min-height: 34px; font-size: 9px; }
.form-error { margin: 8px 0 0; color: var(--red); font-size: 9px; }

/* Footer */
.footer { display: flex; align-items: center; gap: 8px; max-width: 1540px; margin: 25px auto 0; padding: 15px 2px 0; color: var(--faint); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.04em; border-top: 1px solid rgba(226, 233, 245, 0.045); }
.footer-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.footer-right { margin-left: auto; }

/* Toasts + modal */
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(340px, calc(100vw - 40px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border: 1px solid rgba(226, 233, 245, 0.1); border-radius: 11px; background: rgba(18, 23, 33, 0.96); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35); animation: toastIn 0.25s ease both; pointer-events: auto; }
.toast .icon { width: 14px; height: 14px; margin-top: 1px; color: var(--mint); }
.toast.error .icon { color: var(--red); }
.toast.warn .icon { color: var(--gold); }
.toast-copy { display: flex; flex-direction: column; gap: 1px; }
.toast-copy strong { color: var(--text-soft); font-size: 9px; font-weight: 600; }
.toast-copy span { color: var(--muted); font-size: 8px; line-height: 1.45; }
.toast.is-leaving { animation: toastOut 0.2s ease both; }
.modal-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(2, 4, 8, 0.72); backdrop-filter: blur(12px); }
.modal { width: min(400px, 100%); padding: 30px; overflow: hidden; border-color: rgba(232, 201, 121, 0.18); background: linear-gradient(145deg, #151b27, #0b1018); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
.modal-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 16px; color: var(--gold); border: 1px solid rgba(232, 201, 121, 0.22); border-radius: 13px; background: rgba(232, 201, 121, 0.07); }
.modal-icon .icon { width: 18px; height: 18px; }
.modal h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.035em; }
.modal p { margin: 0 0 18px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.modal p code { color: var(--gold-dim); }
.modal input { width: 100%; height: 39px; margin-bottom: 9px; padding: 0 12px; color: var(--text); font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: rgba(226, 233, 245, 0.035); }
.modal input:focus { border-color: rgba(232, 201, 121, 0.37); }
.modal .btn { margin-top: 7px; }

/* Motion */
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(0.82); } }
@keyframes haloPulse { 0%, 100% { opacity: 0.65; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes orbFloat { 0%, 100% { transform: translateY(0) rotateX(-4deg) rotateY(9deg); } 50% { transform: translateY(-11px) rotateX(2deg) rotateY(-4deg); } }
@keyframes ringA { from { transform: rotateX(68deg) rotateZ(0deg); } to { transform: rotateX(68deg) rotateZ(360deg); } }
@keyframes ringB { from { transform: rotateY(72deg) rotateZ(0deg); } to { transform: rotateY(72deg) rotateZ(360deg); } }
@keyframes ringC { from { transform: rotateX(52deg) rotateY(35deg) rotateZ(0deg); } to { transform: rotateX(52deg) rotateY(35deg) rotateZ(360deg); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(5px); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.is-loading { color: transparent !important; border-radius: 5px; background: linear-gradient(90deg, rgba(226, 233, 245, 0.05), rgba(226, 233, 245, 0.1), rgba(226, 233, 245, 0.05)); background-size: 200% 100%; animation: shimmer 1.5s linear infinite; }

/* Responsive */
@media (max-width: 1240px) {
  .main { padding: 0 24px 22px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(280px, 0.82fr); padding: 38px; }
  .hero h1 { font-size: clamp(3rem, 5.2vw, 4.6rem); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { min-height: 112px; }
}
@media (max-width: 1080px) {
  .app { grid-template-columns: 218px minmax(0, 1fr); }
  .sidebar { padding: 24px 14px 16px; }
  .content-grid { grid-template-columns: 1fr; }
  .events-layout { grid-template-columns: 1fr; }
  .events-layout .panel { min-height: 0; }
  .events-layout .console-panel { min-height: 300px; }
  .operator-copy { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { max-width: 590px; }
  .orb-stage { position: absolute; right: -5%; bottom: -16%; width: 380px; opacity: 0.52; pointer-events: none; }
  .hero-copy { position: relative; z-index: 3; }
  .hero-index { display: none; }
}
@media (max-width: 860px) {
  .app { display: block; }
  .sidebar { position: relative; top: auto; height: auto; padding: 16px 18px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 2px 14px; }
  .brand-copy strong { font-size: 16px; }
  .nav { flex-direction: row; gap: 3px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-label, .side-monitor, .sidebar-foot { display: none; }
  .nav-item { width: auto; min-height: 34px; padding: 0 10px; white-space: nowrap; font-size: 10px; }
  .nav-item .icon { width: 14px; height: 14px; }
  .main { padding: 0 16px 20px; }
  .topbar { min-height: 65px; }
  .breadcrumbs { font-size: 7px; }
  .operator { display: none; }
  .top-pause { padding: 0 10px; }
  .top-pause span { display: none; }
  .top-pause .icon { width: 14px; height: 14px; }
  .hero { padding: 30px 24px; margin-top: 16px; }
  .hero h1 { font-size: clamp(2.8rem, 9vw, 4rem); }
  .orb-stage { right: -18%; bottom: -28%; width: 330px; opacity: 0.36; }
  .page-head { align-items: flex-start; flex-direction: column; padding: 26px 0 20px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .span-2 { grid-column: auto; }
  .role-library { grid-template-columns: 1fr; max-height: none; }
  .save-bar { position: static; }
  .footer { margin-top: 18px; }
  .footer-right { display: none; }
}
@media (max-width: 560px) {
  .top-actions .live-pill { display: none; }
  .top-actions { gap: 6px; }
  .hero { padding: 27px 19px 24px; border-radius: 19px; }
  .hero h1 { font-size: 2.9rem; }
  .hero-lede { font-size: 12px; }
  .hero-actions { margin: 21px 0 24px; }
  .hero-actions .btn { flex: 1; }
  .hero-meta { gap: 18px; }
  .hero-meta div { min-width: 86px; }
  .orb-stage { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { min-height: 110px; padding: 15px; gap: 9px; }
  .stat-icon { width: 31px; height: 31px; border-radius: 9px; }
  .stat-icon .icon { width: 14px; height: 14px; }
  .stat-main strong { font-size: 23px; }
  .stat-spark { display: none; }
  .panel { padding: 18px; border-radius: 18px; }
  .panel-head { margin-bottom: 13px; }
  .panel h2 { font-size: 17px; }
  .mini-stats { gap: 7px; }
  .mini-stat { min-height: 50px; padding: 0 12px; }
  .mini-stat strong { font-size: 18px; }
  .panel-toolbar { align-items: flex-start; flex-direction: column; }
  .search-box { width: 100%; }
  .filter-group { align-self: flex-end; }
  .page-head h1 { font-size: 2.2rem; }
  .save-bar { align-items: flex-start; flex-direction: column; gap: 10px; padding: 13px; }
  .save-actions { width: 100%; }
  .save-actions .btn { flex: 1; }
  .danger-actions { flex-direction: column; }
  .role-toolbar { align-items: flex-start; flex-direction: column; gap: 2px; }
  .footer { flex-wrap: wrap; }
  .toast-region { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .modal { padding: 24px; }
.nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; overflow: visible; }
.nav-item { width: 100%; }
.table-wrap { overflow: visible; }
.data-table { display: block; width: 100%; }
.data-table thead { display: none; }
.data-table tbody { display: block; }
.data-table tr { display: grid; align-items: center; gap: 7px 9px; padding: 12px 0; border-top: 1px solid rgba(226, 233, 245, 0.055); }
.data-table tr:first-child { border-top: 0; padding-top: 2px; }
.data-table td { display: block; padding: 0; border: 0; text-align: left; }
.data-table td:first-child { grid-column: 1 / -1; }
.data-table td:last-child { text-align: right; }
.member-cell { min-width: 0; }
#cooldown-preview tr { grid-template-columns: auto minmax(0, 1fr) auto auto; }
#cooldown-preview td:nth-child(2) { grid-column: 1; }
#cooldown-preview td:nth-child(3) { grid-column: 2; min-width: 0; }
#cooldown-preview td:nth-child(4) { grid-column: 3; }
#cooldown-preview td:nth-child(5) { grid-column: 4; }
#cooldown-full tr { grid-template-columns: auto minmax(0, 1fr) auto auto; }
#cooldown-full td:nth-child(2) { grid-column: 1; }
#cooldown-full td:nth-child(3), #cooldown-full td:nth-child(4) { display: none; }
#cooldown-full td:nth-child(5) { grid-column: 2; }
#cooldown-full td:nth-child(6) { grid-column: 3; }
#cooldown-full td:nth-child(7) { grid-column: 4; }
#cooldown-full td:nth-child(5) .countdown::before { content: "Expires "; color: var(--faint); font-size: 9px; }
.empty-row { display: block !important; }
.empty-row td { grid-column: 1 / -1 !important; display: block !important; padding: 12px 0 !important; }
#activity-preview .timeline-item:nth-child(n+5) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .orb-stage { transform: none !important; }
}

/* ============================================================
   ROYAL FAMILY GUARD · obsidian & gold court theme
   Appended above the responsive sheet so every original ID and
   behaviour remains intact; this layer only restyles the shell.
   ============================================================ */

:root {
  --bg: #080b12;
  --ink-0: #080b12; --ink-1: #0d131c; --ink-2: #131a24; --ink-3: #1b2432;
  --line-cool: rgba(148, 170, 200, 0.14);
  --violet-aura: #c48fff;
  --bg-soft: #0d131c;
  --bg-raised: #131a24;
  --surface: rgba(13, 19, 27, 0.9);
  --surface-2: rgba(19, 26, 37, 0.78);
  --line: rgba(226, 201, 141, 0.13);
  --line-strong: rgba(247, 227, 176, 0.3);
  --text: #f4efe6;
  --text-soft: #d6d0c5;
  --muted: #aaa399;
  --faint: #8b857b;
  --gold: #e8c979;
  --gold-bright: #f7e3b0;
  --gold-dim: #c2a15e;
  --mint: #8fd6b8;
  --violet: #b8ace8;
  --red: #f0a29a;
  --red-dim: #b8705f;
  --radius: 20px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  --font-display: "Baskerville", "Cambria", "Georgia", "Times New Roman", serif;
  --font-body: "Aptos", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "Cascadia Mono", "Consolas", monospace;
}

html {
  background: var(--bg);
  scrollbar-color: rgba(213, 174, 91, 0.3) #080b12;
}

body {
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  background:
    radial-gradient(ellipse 54% 42% at 92% 0%, rgba(196, 143, 255, 0.06), transparent 63%),
    radial-gradient(ellipse 46% 52% at 0% 64%, rgba(64, 190, 210, 0.05), transparent 65%),
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(232, 201, 121, 0.045), transparent 66%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(226, 201, 141, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 201, 141, 0.018) 1px, transparent 1px);
  background-size: 92px 92px;
  mask-image: radial-gradient(ellipse at 50% 12%, black, transparent 76%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% -2%, rgba(244, 220, 161, 0.07), transparent 34%);
}

::selection { background: rgba(232, 201, 121, 0.32); color: #fdfaf3; }

.app { position: relative; z-index: 1; grid-template-columns: 268px minmax(0, 1fr); }

/* ---------- Sidebar: the privy chamber ---------- */
.sidebar {
  padding: 30px 20px 18px;
  border-right: 1px solid rgba(226, 201, 141, 0.12);
  background:
    radial-gradient(ellipse 120% 35% at 50% 0%, rgba(232, 201, 121, 0.065), transparent 70%),
    linear-gradient(180deg, rgba(11, 9, 6, 0.985), rgba(8, 11, 18, 0.99));
  box-shadow: inset -1px 0 0 rgba(226, 233, 245, 0.018);
}

.brand { align-items: center; gap: 12px; padding: 0 2px 28px; }
.brand-mark {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(240, 215, 158, 0.38);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 28%, #151c27, #0a0e16 70%);
  box-shadow: 0 0 0 4px rgba(232, 201, 121, 0.035), 0 8px 24px rgba(0, 0, 0, 0.45);
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1);
  filter: saturate(1.07) contrast(1.04);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(245, 221, 162, 0.18);
  border-radius: 50%;
  pointer-events: none;
}
.brand-copy { min-width: 0; gap: 4px; }
.brand-copy strong {
  overflow: visible;
  color: #efe9df;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.035em;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(226, 233, 245, 0.12);
}
.brand-copy span {
  color: var(--gold-dim);
  font-family: var(--font-mono);
  font-size: 6.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.nav { gap: 3px; }
.nav-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 9px 8px;
  color: var(--gold-dim);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.22em;
}
.nav-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(232, 201, 121, 0.16), transparent); }
.nav-item {
  position: relative;
  gap: 10px;
  min-height: 43px;
  padding: 0 11px;
  color: #a49d92;
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.025em;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.nav-item .icon { width: 16px; height: 16px; color: #9a9389; transition: color 0.18s ease; }
.nav-item:hover { color: var(--text-soft); background: rgba(226, 233, 245, 0.028); }
.nav-item:hover .icon { color: var(--gold); }
.nav-item.is-active {
  color: var(--gold-bright);
  border-color: rgba(226, 201, 141, 0.16);
  background:
    linear-gradient(90deg, rgba(232, 201, 121, 0.13), rgba(232, 201, 121, 0.025) 72%, transparent),
    rgba(12, 10, 7, 0.55);
  box-shadow: inset 0 1px 0 rgba(226, 233, 245, 0.045);
}
.nav-item.is-active .icon { color: var(--gold-bright); filter: drop-shadow(0 0 7px rgba(232, 201, 121, 0.28)); }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 50%;
  width: 2px;
  height: 17px;
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, var(--gold-bright), transparent);
  box-shadow: 0 0 10px rgba(240, 207, 133, 0.35);
  transform: translateY(-50%);
}
.nav-marker { opacity: 0; }
.nav-count {
  min-width: 20px;
  padding: 2px 6px;
  color: #d9b46e;
  font-family: var(--font-mono);
  font-size: 6.5px;
  border-color: rgba(232, 201, 121, 0.13);
  background: rgba(232, 201, 121, 0.045);
}

.side-monitor {
  position: relative;
  margin-top: 25px;
  padding: 13px;
  overflow: hidden;
  border: 1px solid rgba(226, 201, 141, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(150deg, rgba(232, 201, 121, 0.055), transparent 48%),
    rgba(9, 8, 6, 0.66);
}
.side-monitor::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(247, 227, 176, 0.42), transparent);
}
.side-monitor::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(247, 227, 176, 0.7);
  background: #0b1018;
  transform: translateX(-50%) rotate(45deg);
}
.side-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-label > span:first-child { color: var(--gold-dim); font-family: var(--font-mono); font-size: 6.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.side-server { margin-bottom: 9px; overflow: hidden; color: #9a9389; font-size: 8px; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.side-meter-copy { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #7d776d; font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.05em; }
.side-meter-copy span:last-child { color: #a89e92; }
.side-monitor-top span { color: var(--gold-dim); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.18em; }
.side-state { margin: 9px 0 8px; color: var(--text-soft); font-family: var(--font-display); font-size: 15px; font-weight: 500; letter-spacing: 0.01em; }
.side-state strong { color: var(--gold-bright); font-weight: 600; }
.side-meter { height: 2px; margin-bottom: 7px; overflow: hidden; background: rgba(226, 233, 245, 0.07); }
.side-meter span { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright)); box-shadow: 0 0 8px rgba(247, 227, 176, 0.3); }
.side-note { color: var(--faint); font-size: 7px; line-height: 1.5; }
.bot-chip {
  padding: 10px;
  border-color: rgba(226, 201, 141, 0.12);
  border-radius: 11px;
  background: rgba(11, 9, 6, 0.7);
}
.bot-copy strong { color: var(--text-soft); font-size: 9px; letter-spacing: 0.03em; }
.bot-copy span { color: var(--faint); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.04em; }
.avatar {
  border-color: rgba(226, 201, 141, 0.24);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #1b2432, #0b1018 72%);
  color: var(--gold-bright);
}
.foot-meta { padding: 13px 3px 0; color: #7d776d; font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.14em; }

/* ---------- Top bar: the antechamber ---------- */
.main { padding: 0 34px 24px; }
.topbar {
  min-height: 78px;
  border-bottom: 1px solid rgba(226, 201, 141, 0.1);
  background: linear-gradient(180deg, rgba(8, 11, 18, 0.95) 25%, rgba(8, 11, 18, 0.7) 82%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.breadcrumbs { color: #9a9389; font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.19em; }
.breadcrumbs > span:first-child { color: var(--gold-dim); }
.crumb-sep { color: rgba(247, 227, 176, 0.28); }
.crumb-current { color: var(--text-soft); letter-spacing: 0.15em; }
.live-pill {
  height: 32px;
  border-color: rgba(226, 201, 141, 0.14);
  border-radius: 8px;
  background: rgba(8, 7, 5, 0.48);
  color: #9a9389;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
}
.live-pill.is-live { color: var(--mint); border-color: rgba(130, 227, 189, 0.2); }
.live-pill.is-live .live-dot { box-shadow: 0 0 0 3px rgba(130, 227, 189, 0.07), 0 0 10px rgba(130, 227, 189, 0.6); }
.connection-mode { border-color: rgba(226, 201, 141, 0.12); color: #9a9389; }
.icon-btn {
  border-color: rgba(226, 201, 141, 0.14);
  border-radius: 8px;
  background: rgba(226, 233, 245, 0.02);
}
.icon-btn:hover { color: var(--gold-bright); border-color: rgba(247, 227, 176, 0.3); background: rgba(232, 201, 121, 0.07); }
.operator { border-color: rgba(226, 201, 141, 0.13); }
.operator-avatar { border: 1px solid rgba(247, 227, 176, 0.25); border-radius: 50%; }
.operator-copy strong { color: var(--text-soft); font-family: var(--font-display); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; }
.operator-copy span { color: var(--gold-dim); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.12em; }

/* ---------- Buttons: struck gold ---------- */
.btn { border-radius: 9px; font-size: 10px; font-weight: 650; letter-spacing: 0.025em; }
.btn-primary {
  color: #131a24;
  border-color: rgba(226, 233, 245, 0.42);
  background: linear-gradient(180deg, #f7e3b0 0%, #e8c979 43%, #d9b46e 100%);
  box-shadow: 0 10px 24px rgba(174, 128, 43, 0.18), inset 0 1px 0 rgba(226, 233, 245, 0.7), inset 0 -1px 0 rgba(94, 60, 15, 0.3);
}
.btn-primary:hover { box-shadow: 0 14px 34px rgba(174, 128, 43, 0.28), inset 0 1px 0 rgba(226, 233, 245, 0.85); }
.btn-ghost {
  color: var(--text-soft);
  border-color: rgba(226, 201, 141, 0.16);
  background: rgba(226, 233, 245, 0.022);
}
.btn-ghost:hover { color: var(--gold-bright); border-color: rgba(247, 227, 176, 0.33); background: rgba(232, 201, 121, 0.055); }
.btn-danger-ghost { border-color: rgba(255, 158, 145, 0.16); background: rgba(160, 54, 42, 0.07); }
.top-pause.is-paused { color: var(--gold-bright); border-color: rgba(247, 227, 176, 0.3); background: rgba(232, 201, 121, 0.08); }

/* ---------- Hero: the court ---------- */
.hero {
  grid-template-columns: minmax(0, 1.03fr) minmax(330px, 0.97fr);
  gap: 16px;
  min-height: 492px;
  margin-top: 26px;
  padding: clamp(34px, 4vw, 58px) clamp(27px, 4.3vw, 60px);
  border: 1px solid rgba(232, 200, 131, 0.2);
  border-radius: 23px;
  background:
    radial-gradient(ellipse 48% 70% at 88% 45%, rgba(255, 147, 61, 0.095), transparent 62%),
    radial-gradient(ellipse 44% 62% at 60% 10%, rgba(82, 122, 255, 0.06), transparent 63%),
    radial-gradient(ellipse 70% 80% at 28% 120%, rgba(232, 201, 121, 0.055), transparent 64%),
    linear-gradient(132deg, rgba(20, 16, 10, 0.97) 0%, rgba(8, 7, 5, 0.985) 52%, rgba(13, 10, 7, 0.99) 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(226, 233, 245, 0.055), inset 0 0 90px rgba(0, 0, 0, 0.26);
}
.hero::before {
  background-image:
    linear-gradient(rgba(240, 211, 148, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 211, 148, 0.028) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse at 65% 48%, black, transparent 76%);
  opacity: 0.6;
}
.hero::after {
  right: -18%;
  top: -34%;
  width: 78%;
  background: radial-gradient(circle, rgba(239, 194, 107, 0.08), rgba(255, 139, 58, 0.035) 38%, transparent 66%);
  filter: blur(6px);
}
.hero-copy { max-width: 650px; }
.eyebrow { gap: 10px; color: #d9b46e; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.24em; }
.eyebrow-mark {
  width: 27px;
  height: 27px;
  border-color: rgba(238, 207, 140, 0.26);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 28%, rgba(247, 227, 176, 0.13), rgba(232, 201, 121, 0.035) 70%);
  box-shadow: inset 0 0 12px rgba(232, 201, 121, 0.06);
}
.eyebrow-mark .icon { width: 14px; height: 14px; color: var(--gold-bright); }
.hero h1 {
  margin: 25px 0 22px;
  color: #f4efe6;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 5.55vw, 5.8rem);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.058em;
  text-wrap: balance;
  text-shadow: 0 2px 0 rgba(226, 233, 245, 0.07), 0 20px 60px rgba(0, 0, 0, 0.45);
}
.hero h1 em {
  display: inline-block;
  padding-right: 0.09em;
  color: transparent;
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(178deg, #f7e3b0 2%, #f2dba0 34%, #e0bf7c 66%, #9f762f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 24px rgba(232, 194, 111, 0.14));
}
.hero-lede {
  max-width: 500px;
  margin: 0;
  color: #b0a89c;
  font-size: 13.5px;
  line-height: 1.8;
  letter-spacing: 0.005em;
}
.hero-actions { gap: 10px; margin: 27px 0 30px; }
.hero-actions .btn { min-height: 44px; padding: 0 18px; }
.hero-meta {
  gap: 31px;
  padding-top: 17px;
  border-top: 1px solid rgba(226, 201, 141, 0.13);
}
.hero-meta span { color: #7d776d; font-family: var(--font-mono); font-size: 6.5px; font-weight: 600; letter-spacing: 0.17em; }
.hero-meta strong { margin-top: 5px; color: #d6d0c5; font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.03em; }
.hero-index { right: 25px; bottom: 22px; color: rgba(218, 188, 124, 0.5); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.17em; }
.hero-index span:first-child { color: rgba(247, 227, 176, 0.8); }

/* ---------- Royal seal ---------- */
.orb-stage {
  width: 100%;
  max-width: 470px;
  aspect-ratio: auto;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  perspective: 1200px;
  transform-style: preserve-3d;
}
.seal-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.royal-crest {
  position: relative;
  z-index: 3;
  width: 92%;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(247, 227, 176, 0.45);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #121a25, #0b1018 72%);
  box-shadow:
    0 0 0 5px rgba(232, 201, 121, 0.045),
    0 0 0 7px rgba(247, 227, 176, 0.22),
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 90px rgba(232, 201, 121, 0.18),
    0 0 140px rgba(80, 120, 255, 0.08);
  animation: crestBreathe 7s ease-in-out infinite;
}
.royal-crest img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  filter: saturate(1.22) contrast(1.08) brightness(1.12) drop-shadow(0 0 18px rgba(232, 194, 111, 0.18));
  transform: scale(1.03);
}
.royal-crest::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(226, 233, 245, 0.18), inset 0 0 58px rgba(0, 0, 0, 0.72);
  pointer-events: none;
}
.royal-crest::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 30%, rgba(226, 233, 245, 0.12), transparent 45%),
    linear-gradient(128deg, rgba(226, 233, 245, 0.12), transparent 28%, transparent 62%, rgba(150, 205, 232, 0.08));
  mix-blend-mode: screen;
}
.crest-ring {
  position: absolute;
  z-index: 2;
  width: 96%;
  height: 96%;
  border-radius: 50%;
  pointer-events: none;
}
.crest-ring-outer {
  border: 1px solid rgba(240, 215, 158, 0.32);
  box-shadow: 0 0 38px rgba(232, 201, 121, 0.1), inset 0 0 20px rgba(232, 201, 121, 0.03);
  animation: sealSpin 60s linear infinite;
}
.crest-ring-outer::before,
.crest-ring-outer::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(247, 227, 176, 0.65);
  background: #0b1018;
  transform: translateX(-50%) rotate(45deg);
}
.crest-ring-outer::before { top: -4px; }
.crest-ring-outer::after { bottom: -4px; }
.crest-ring-inner {
  width: 92%;
  height: 92%;
  border: 1px dashed rgba(240, 215, 158, 0.23);
  animation: sealSpinReverse 56s linear infinite;
}
.crest-ring-inner::before,
.crest-ring-inner::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(247, 227, 176, 0.5);
}
.crest-ring-inner::before { left: -3px; }
.crest-ring-inner::after { right: -3px; }
.crest-aura {
  position: absolute;
  z-index: 1;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(42px);
  opacity: 0.85;
  animation: auraPulse 8s ease-in-out infinite;
}
.crest-aura-blue {
  left: -4%;
  bottom: 2%;
  background: radial-gradient(circle, rgba(64, 190, 210, 0.5), rgba(40, 120, 190, 0.12) 48%, transparent 72%);
}
.crest-aura-ember {
  right: -4%;
  top: 0%;
  background: radial-gradient(circle, rgba(196, 143, 255, 0.42), rgba(132, 96, 214, 0.12) 48%, transparent 72%);
  animation-delay: -4s;
}
.crest-caption {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #837d72;
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.crest-caption::before,
.crest-caption::after { content: ""; width: 25px; height: 1px; background: linear-gradient(90deg, transparent, rgba(226, 201, 141, 0.3)); }
.crest-caption::after { background: linear-gradient(90deg, rgba(226, 201, 141, 0.3), transparent); }
.crest-caption strong { color: #cdbd+; font-weight: 500; letter-spacing: 0.13em; }
.orb-plinth {
  position: absolute;
  bottom: -1%;
  width: 53%;
  height: 4%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(232, 201, 121, 0.2), transparent 68%);
  filter: blur(10px);
  opacity: 0.7;
}

/* ---------- Stat cards: the ledgers ---------- */
.stat-grid { gap: 13px; margin-top: 15px; }
.stat-card {
  min-height: 139px;
  padding: 19px 19px 17px;
  overflow: hidden;
  border-color: rgba(226, 201, 141, 0.12);
  border-radius: 15px;
  background:
    linear-gradient(150deg, rgba(232, 201, 121, 0.035), transparent 45%),
    linear-gradient(160deg, rgba(18, 15, 10, 0.92), rgba(7, 6, 4, 0.97));
  box-shadow: inset 0 1px 0 rgba(226, 233, 245, 0.035), 0 10px 30px rgba(0, 0, 0, 0.16);
}
.stat-card::before {
  left: 19px;
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, rgba(247, 227, 176, 0.7), rgba(232, 201, 121, 0.08));
}
.stat-card::after { background: linear-gradient(135deg, transparent 55%, rgba(232, 201, 121, 0.025)); }
.stat-icon {
  width: 39px;
  height: 39px;
  border-color: rgba(226, 201, 141, 0.15);
  border-radius: 10px;
  background: rgba(232, 201, 121, 0.055);
  color: var(--gold);
}
.stat-icon .icon { width: 17px; height: 17px; }
.stat-main > span { color: #7d776d; font-family: var(--font-mono); font-size: 6.5px; font-weight: 600; letter-spacing: 0.17em; }
.stat-main strong { margin-top: 7px; color: #efe9df; font-family: var(--font-display); font-size: clamp(25px, 2.2vw, 32px); font-weight: 500; letter-spacing: -0.035em; line-height: 1; white-space: nowrap; }
.stat-main small { margin-top: 6px; color: #7d776d; font-size: 7.5px; }
.stat-spark { opacity: 0.75; }
.stat-spark i { background: linear-gradient(180deg, rgba(247, 227, 176, 0.75), rgba(232, 201, 121, 0.12)); }

/* ---------- Panels: gilded registers ---------- */
.content-grid { gap: 14px; margin-top: 14px; }
.surface {
  border-color: rgba(226, 201, 141, 0.12);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(18, 15, 10, 0.91), rgba(7, 6, 4, 0.96));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(226, 233, 245, 0.035);
}
.surface::after { background: linear-gradient(125deg, rgba(226, 233, 245, 0.022), transparent 28%, transparent 70%, rgba(232, 201, 121, 0.025)); }
.panel { position: relative; padding: 24px; border-radius: 18px; }
.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(247, 227, 176, 0.22), transparent);
  pointer-events: none;
}
.panel-head { margin-bottom: 17px; }
.panel-kicker { color: var(--gold-dim); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.22em; }
.panel h2 { margin-top: 5px; color: #efe9df; font-family: var(--font-display); font-size: 21px; font-weight: 500; letter-spacing: -0.012em; }
.panel-icon { color: #9a9389; opacity: 0.85; }
.page-head { padding: 36px 0 25px; }
.page-head h1 { color: #f1ece2; font-family: var(--font-display); font-size: clamp(2.2rem, 3.4vw, 3.2rem); font-weight: 500; letter-spacing: -0.045em; }
.page-head p { color: #a49d92; font-size: 11px; line-height: 1.65; }
.page-kicker { color: var(--gold-dim); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.22em; }
.panel h3, .mini-head h3 { color: #d6d0c5; }

.data-table th { color: #837d72; font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.14em; }
.data-table td { border-top-color: rgba(226, 201, 141, 0.075); }
.data-table tbody tr:hover { background: rgba(232, 201, 121, 0.032); }
.member-cell strong { color: #d6d0c5; }
.member-cell span { color: #7d776d; }
.health-row { border-top-color: rgba(226, 201, 141, 0.075); }
.health-row strong { color: #cfc8bc; }
.health-row span { color: #837d72; }
.timeline-rail::before { background: rgba(226, 201, 141, 0.1); }
.timeline-dot { border-color: rgba(226, 201, 141, 0.4); background: #0b1018; box-shadow: 0 0 0 4px rgba(232, 201, 121, 0.03); }
.timeline-top strong { color: #d6d0c5; }
.timeline-top time { color: #7d776d; }
.timeline-body p { color: #aaa399; }
.console-panel { background: #0a0e16; }
.console-line { border-top-color: rgba(226, 201, 141, 0.055); }
.console-time { color: #6f6960; }
.console-msg { color: #aaa399; }
.console-msg strong { color: #b0a89c; }
.console-empty { color: #7d776d; }
.api-box { border-color: rgba(226, 201, 141, 0.12); background: rgba(0, 0, 0, 0.24); }
.api-box > span { color: #8b857b; }
.api-box code { color: #a49d92; }
.ladder-step { border-color: rgba(226, 201, 141, 0.1); background: rgba(226, 233, 245, 0.018); }
.danger-panel { border-color: rgba(255, 158, 145, 0.1); }
.save-bar {
  border-color: rgba(226, 201, 141, 0.16);
  background: linear-gradient(100deg, rgba(24, 20, 13, 0.98), rgba(9, 8, 5, 0.98));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(226, 233, 245, 0.05);
}

.input-wrap, .field > input, .modal input {
  border-color: rgba(226, 201, 141, 0.13);
  background-color: rgba(0, 0, 0, 0.22);
}
.input-wrap:focus-within, .field > input:focus, .modal input:focus {
  border-color: rgba(247, 227, 176, 0.36);
  background-color: rgba(232, 201, 121, 0.038);
  box-shadow: 0 0 0 3px rgba(232, 201, 121, 0.045);
}
.role-option { border-color: rgba(226, 201, 141, 0.075); background: rgba(226, 233, 245, 0.014); }
.role-option:hover { border-color: rgba(226, 201, 141, 0.18); background: rgba(232, 201, 121, 0.035); }
.role-option.is-selected { border-color: rgba(226, 201, 141, 0.32); background: rgba(232, 201, 121, 0.075); }
.ladder-step strong, .selected-count strong { color: var(--gold-bright); }

/* ---------- Footer, toast & token court ---------- */
.footer {
  border-top-color: rgba(226, 201, 141, 0.09);
  color: #7d776d;
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.06em;
}
.footer span:first-child { color: #c2a15e; letter-spacing: 0.13em; }
.footer-dot { background: #c2a15e; }
.toast { border-color: rgba(226, 201, 141, 0.16); background: rgba(12, 10, 7, 0.97); box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42); }
.toast-copy strong { color: #d6d0c5; }
.toast-copy span { color: #a49d92; }
.modal-backdrop { background: rgba(2, 2, 1, 0.78); }
.modal {
  width: min(430px, 100%);
  border-color: rgba(226, 201, 141, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232, 201, 121, 0.09), transparent 60%),
    linear-gradient(145deg, #131a24, #0d131c 70%);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(226, 233, 245, 0.06);
}
.modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(247, 227, 176, 0.55), transparent);
}
.modal-icon { width: 48px; height: 48px; border-radius: 50%; border-color: rgba(247, 227, 176, 0.27); background: rgba(232, 201, 121, 0.065); }
.modal h2 { color: #f1ece2; font-family: var(--font-display); font-size: 29px; font-weight: 500; letter-spacing: -0.03em; }
.modal p { color: #a89e92; font-size: 10px; line-height: 1.7; }

/* ---------- Details ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0a0e16; }
::-webkit-scrollbar-thumb { border-radius: 6px; background: #28313f; }
::-webkit-scrollbar-thumb:hover { background: #3a4455; }

@keyframes crestBreathe {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 0 0 6px rgba(212,173,91,.035), 0 0 0 7px rgba(243,221,162,.15), 0 28px 70px rgba(0,0,0,.58), 0 0 65px rgba(212,173,91,.11); }
  50% { transform: translateY(-4px) scale(1.006); box-shadow: 0 0 0 6px rgba(212,173,91,.045), 0 0 0 7px rgba(243,221,162,.2), 0 34px 80px rgba(0,0,0,.62), 0 0 82px rgba(212,173,91,.16); }
}
@keyframes sealSpin { to { transform: rotate(360deg); } }
@keyframes sealSpinReverse { to { transform: rotate(-360deg); } }
@keyframes auraPulse { 0%, 100% { opacity: .48; transform: scale(.95); } 50% { opacity: .72; transform: scale(1.06); } }

/* ---------- Responsive court ---------- */
@media (max-width: 1240px) {
  .main { padding: 0 24px 22px; }
  .hero { padding: 40px 38px; grid-template-columns: minmax(0, 1fr) minmax(300px, .82fr); }
  .hero h1 { font-size: clamp(3rem, 5.2vw, 4.7rem); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .app { grid-template-columns: 232px minmax(0, 1fr); }
  .sidebar { padding: 24px 14px 16px; }
  .brand-mark { width: 46px; height: 46px; }
  .brand-copy strong { font-size: 15px; }
  .content-grid { grid-template-columns: 1fr; }
  .hero { display: grid; grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { max-width: 590px; }
  .orb-stage { position: absolute; right: -6%; bottom: -15%; width: 370px; max-width: 42vw; opacity: .5; pointer-events: none; }
  .crest-caption { display: none; }
  .hero-index { display: none; }
}
@media (max-width: 860px) {
  .app { display: block; }
  .sidebar { padding: 16px 18px 12px; border-right: 0; border-bottom: 1px solid rgba(226, 201, 141, 0.12); }
  .brand { padding-bottom: 14px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-copy strong { font-size: 15px; }
  .nav { flex-direction: row; gap: 3px; overflow-x: auto; padding-bottom: 3px; }
  .nav-label, .side-monitor, .sidebar-foot { display: none; }
  .nav-item { width: auto; min-height: 36px; padding: 0 10px; white-space: nowrap; font-size: 9px; }
  .main { padding: 0 16px 20px; }
  .topbar { min-height: 65px; }
  .hero { padding: 32px 24px; margin-top: 16px; border-radius: 19px; }
  .hero h1 { font-size: clamp(2.8rem, 9vw, 4rem); }
  .orb-stage { right: -16%; bottom: -24%; width: 330px; max-width: 55vw; opacity: .4; }
  .page-head { align-items: flex-start; flex-direction: column; padding: 26px 0 20px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .span-2 { grid-column: auto; }
  .footer { margin-top: 18px; }
  .footer-right { display: none; }
}
@media (max-width: 560px) {
  .hero { padding: 29px 20px 25px; border-radius: 17px; }
  .hero h1 { font-size: clamp(2.75rem, 13vw, 3.55rem); }
  .hero-lede { font-size: 12px; line-height: 1.7; }
  .hero-actions { margin: 22px 0 24px; }
  .hero-actions .btn { flex: 1; }
  .hero-meta { gap: 17px; }
  .hero-meta div { min-width: 82px; }
  .orb-stage { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { min-height: 112px; padding: 15px; }
  .stat-main strong { font-size: 25px; }
  .stat-spark { display: none; }
  .panel { padding: 18px; border-radius: 16px; }
  .panel::before { left: 18px; right: 18px; }
  .panel h2 { font-size: 18px; }
  .hero-meta span { font-size: 6px; }
  .hero-meta strong { font-size: 8.5px; }
  .crest-caption { display: none; }
  .footer { flex-wrap: wrap; }
  .modal { padding: 26px 22px; }
}

/* ===========================================================
   3.1 — readable court, living gold
   Larger type, calmer compositing, breathing royal detail.
   =========================================================== */

/* Keep the browser light: no blur compositing on large shells. */
.sidebar, .topbar, .modal-backdrop, .orb-node { backdrop-filter: none !important; }
.sidebar { background: linear-gradient(180deg, #0b1018 0%, #0a0e16 60%, #080b12 100%); }
.topbar { background: linear-gradient(180deg, rgba(8, 11, 18, 0.99) 0%, rgba(8, 11, 18, 0.95) 62%, rgba(8, 11, 18, 0.7) 100%); }
.modal-backdrop { background: rgba(2, 2, 2, 0.86); }

/* Stable medallion: float the halo, never repaint the image itself. */
.royal-crest { animation: none !important; }

body { font-size: 15.5px; line-height: 1.6; }
.main { padding: 0 clamp(24px, 2.3vw, 42px) 28px; }
.view-stack, .footer { max-width: 1760px; }
.topbar { min-height: 86px; }
.breadcrumbs { font-size: 9px; letter-spacing: 0.17em; }
.live-pill { height: 38px; padding: 0 13px; font-size: 9px; letter-spacing: 0.12em; }
.connection-mode { font-size: 8px; }
.icon-btn { width: 40px; height: 40px; }
.btn { min-height: 42px; padding: 0 17px; font-size: 12.5px; }
.btn .icon { width: 16px; height: 16px; }
.top-pause { min-height: 40px; }
.operator { padding: 5px 8px; gap: 9px; }
.operator-avatar { width: 31px; height: 31px; font-size: 9px; }
.operator-copy strong { font-size: 13.5px; }
.operator-copy span { font-size: 8px; }

/* Royal standard clock */
.royal-clock { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 24px 0 auto; padding-left: 22px; border-left: 1px solid rgba(226, 201, 141, 0.1); }
.royal-clock span { color: #8b857b; font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.2em; }
.royal-clock strong { color: #d6d0c5; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }

/* Sidebar: legible at a glance */
.sidebar { padding: 30px 20px 20px; }
.brand { padding-bottom: 30px; }
.brand-mark { width: 50px; height: 50px; }
.brand-copy strong { font-size: 19px; letter-spacing: 0.025em; }
.brand-copy span { font-size: 7.5px; letter-spacing: 0.2em; }
.nav-label { margin-bottom: 9px; font-size: 8px; }
.nav-item { min-height: 48px; gap: 11px; padding: 0 12px; font-size: 13px; }
.nav-item .icon { width: 18px; height: 18px; }
.nav-count { min-width: 23px; padding: 3px 7px; font-size: 8px; }
.side-monitor { margin-top: 27px; padding: 15px; }
.side-label > span:first-child, .side-monitor-top span { font-size: 8px; letter-spacing: 0.16em; }
.side-server { margin-bottom: 10px; font-size: 10px; }
.side-state { margin: 10px 0 9px; font-size: 19px; }
.side-meter { height: 3px; margin-bottom: 9px; }
.side-meter-copy { font-size: 8px; }
.side-note { font-size: 9px; line-height: 1.55; }
.bot-chip { padding: 12px; }
.bot-copy strong { font-size: 11px; }
.bot-copy span { font-size: 8px; }
.foot-meta { padding-top: 15px; font-size: 7.5px; }

/* Hero: the room becomes warmer and larger */
.hero { min-height: 530px; border-color: rgba(232, 200, 131, 0.24); }
.hero-copy { max-width: 720px; }
.eyebrow { font-size: 9px; letter-spacing: 0.22em; }
.eyebrow-mark { width: 30px; height: 30px; }
.hero h1 { font-size: clamp(3.9rem, 5.3vw, 6.4rem); margin: 28px 0 22px; }
.hero-lede { max-width: 560px; font-size: clamp(14.5px, 1.02vw, 16.5px); line-height: 1.78; }
.hero-actions { margin: 29px 0 31px; }
.hero-actions .btn { min-height: 48px; padding: 0 21px; font-size: 13.5px; }
.hero-meta { gap: 38px; padding-top: 21px; }
.hero-meta span { font-size: 8.5px; }
.hero-meta strong { margin-top: 6px; font-size: 11.5px; }
.hero-index { right: 28px; bottom: 25px; font-size: 8px; }
.orb-stage { max-width: 540px; }

/* Gold ribbon in the title + a slow court glow */
.hero h1 em { background-size: 180% auto; animation: goldRibbon 9s linear infinite; }
@keyframes goldRibbon { 0% { background-position: 0% center; } 100% { background-position: 180% center; } }
.hero::after { animation: courtGlow 9s ease-in-out infinite alternate; }
@keyframes courtGlow { from { opacity: 0.65; transform: scale(0.95); } to { opacity: 1; transform: scale(1.08) translateY(-8px); } }
.seal-frame { transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.seal-frame:hover { transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(1.012); }

/* Motes of gold drifting through the chamber */
.hero-dust { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.hero-dust i { position: absolute; top: 82%; width: 2px; height: 2px; border-radius: 50%; background: #f7e3b0; box-shadow: 0 0 9px rgba(247, 227, 176, 0.8); opacity: 0; animation: dustRise var(--dur, 18s) linear infinite; animation-delay: var(--delay, 0s); }
.hero-dust i:nth-child(1) { left: 5%; --dur: 17s; --delay: -2s; }
.hero-dust i:nth-child(2) { left: 11%; --dur: 21s; --delay: -11s; }
.hero-dust i:nth-child(3) { left: 19%; --dur: 15s; --delay: -6s; }
.hero-dust i:nth-child(4) { left: 26%; --dur: 23s; --delay: -16s; }
.hero-dust i:nth-child(5) { left: 34%; --dur: 18s; --delay: -9s; }
.hero-dust i:nth-child(6) { left: 42%; --dur: 14s; --delay: -1s; }
.hero-dust i:nth-child(7) { left: 51%; --dur: 22s; --delay: -13s; }
.hero-dust i:nth-child(8) { left: 58%; --dur: 16s; --delay: -4s; }
.hero-dust i:nth-child(9) { left: 65%; --dur: 20s; --delay: -18s; }
.hero-dust i:nth-child(10) { left: 72%; --dur: 15s; --delay: -7s; }
.hero-dust i:nth-child(11) { left: 79%; --dur: 19s; --delay: -12s; }
.hero-dust i:nth-child(12) { left: 86%; --dur: 23s; --delay: -3s; }
.hero-dust i:nth-child(13) { left: 92%; --dur: 16s; --delay: -15s; }
.hero-dust i:nth-child(14) { left: 97%; --dur: 20s; --delay: -8s; }
@keyframes dustRise {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.5); }
  14% { opacity: 0.72; }
  78% { opacity: 0.3; }
  100% { opacity: 0; transform: translate3d(26px, -390px, 0) scale(1.15); }
}

/* Stats & registers: data you can actually read */
.stat-card { min-height: 132px; padding: 20px; transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
.stat-card:hover { transform: translateY(-2px); border-color: rgba(226, 201, 141, 0.22); box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28); }
.stat-icon { width: 40px; height: 40px; }
.stat-main > span { font-size: 8.5px; letter-spacing: 0.15em; }
.stat-main strong { font-size: clamp(31px, 2.3vw, 41px); }
.stat-main small { margin-top: 7px; font-size: 9.5px; }
.panel { padding: 27px; }
.panel::before { left: 27px; right: 27px; }
.panel-kicker { font-size: 8px; letter-spacing: 0.2em; }
.panel h2 { font-size: 23px; }
.panel-head { margin-bottom: 19px; }
.page-head p { font-size: 12.5px; }
.page-kicker { font-size: 8px; }
.data-table { font-size: 12px; }
.data-table th { padding-bottom: 11px; font-size: 8px; }
.data-table td { padding: 14px 10px; }
.member-cell { gap: 11px; }
.member-info strong { font-size: 12px; }
.member-info span { font-size: 8.5px; }
.level-badge { min-width: 29px; height: 24px; font-size: 11px; }
.countdown { font-size: 11.5px; }
.state-chip { font-size: 9px; }
.tag { font-size: 7.5px; }
.empty-row td, .timeline-empty { font-size: 11px; }
.health-row { gap: 12px; padding: 13px 0; }
.health-copy strong { font-size: 11.5px; }
.health-copy span { font-size: 9px; }
.health-state { font-size: 8px; }
.health-icon { width: 28px; height: 28px; }
.health-icon .icon { width: 14px; height: 14px; }
.health-foot { font-size: 8.5px; }
.timeline-top strong { font-size: 11.5px; }
.timeline-top time { font-size: 8px; }
.timeline-body p { font-size: 10.5px; }
.timeline-kind { font-size: 7.5px; }
.switch-row strong { font-size: 11.5px; }
.switch-row span { font-size: 9.5px; }
.control-actions .btn { min-height: 38px; font-size: 11px; }
.fine-print { font-size: 9px; }
.console { font-size: 10.5px; }
.field label, .settings-grid label { font-size: 9.5px; }
.footer { font-size: 8.5px; }
.page-clock { font-size: 10px; }

/* Hover warmth, never noise */
.surface { transition: border-color 0.25s ease, box-shadow 0.25s ease; }
.panel:hover { border-color: rgba(226, 201, 141, 0.17); }

/* Desktop room */
@media (min-width: 1081px) {
  .app { grid-template-columns: 276px minmax(0, 1fr); }
  .main { padding: 0 34px 30px; }
  .topbar { min-height: 88px; }
  .hero { padding: clamp(42px, 3.8vw, 64px) clamp(36px, 4.1vw, 62px); grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr); gap: 22px; min-height: clamp(540px, 34vw, 610px); }
  .hero h1 { font-size: clamp(4.1rem, 5.35vw, 6.4rem); }
  .orb-stage { justify-self: center; }
  .content-grid { gap: 16px; }
  .content-grid.lower { gap: 16px; }
}
@media (max-width: 1080px) {
  .royal-clock { display: none; }
  .nav-item { min-height: 44px; font-size: 11.5px; }
  .side-state { font-size: 17px; }
  .hero h1 { font-size: clamp(3.3rem, 6.3vw, 5rem); }
  .hero-lede { font-size: 14px; }
  .data-table { font-size: 11px; }
  .panel { padding: 23px; }
  .panel::before { left: 23px; right: 23px; }
}
@media (max-width: 860px) {
  body { font-size: 14.5px; }
  .main { padding: 0 16px 22px; }
  .topbar { min-height: 68px; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy span { font-size: 6.5px; }
  .brand-mark { width: 41px; height: 41px; }
  .nav-item { min-height: 38px; font-size: 11px; padding: 0 11px; }
  .nav-item .icon { width: 15px; height: 15px; }
  .hero h1 { font-size: clamp(2.9rem, 9vw, 4.1rem); }
  .hero-lede { font-size: 13.5px; }
  .hero-meta span { font-size: 8px; }
  .hero-meta strong { font-size: 10.5px; }
  .stat-main strong { font-size: 29px; }
  .stat-main > span { font-size: 8px; }
  .stat-main small { font-size: 9px; }
  .live-pill { height: 34px; padding: 0 10px; font-size: 8px; }
  .btn { min-height: 38px; font-size: 11px; padding: 0 13px; }
  .operator-copy { display: none; }
  .royal-clock { display: none; }
  .topbar .breadcrumbs { font-size: 8px; }
  .consoles, .console { font-size: 9.5px; }
}
@media (max-width: 560px) {
  .hero-lede { font-size: 13px; }
  .hero-meta { gap: 16px; }
  .hero-meta span { font-size: 7.5px; }
  .hero-meta strong { font-size: 10px; }
  .hero-dust { display: none; }
  .stat-main strong { font-size: 26px; }
  .panel { padding: 18px; }
  .panel::before { left: 18px; right: 18px; }
  .panel h2 { font-size: 20px; }
  .footer { font-size: 7.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-dust, .hero-dust i, .hero::after, .hero h1 em, .crest-aura, .crest-ring, .live-dot { animation: none !important; }
  .hero-dust i { opacity: 0.25; }
}

/* ===========================================================
   3.2 — Royal Midnight: cool, calm, WCAG-verified palette
   Ink #080b12 · Gold #e8c979 (11.5:1) · Text #f4efe6 (16:1)
   =========================================================== */
body {
  background:
    radial-gradient(ellipse 60% 46% at 88% -6%, rgba(196, 143, 255, 0.075), transparent 62%),
    radial-gradient(ellipse 52% 54% at -6% 58%, rgba(64, 190, 210, 0.065), transparent 66%),
    radial-gradient(ellipse 96% 50% at 50% -10%, rgba(232, 201, 121, 0.055), transparent 68%),
    #080b12;
}
body::after { background: radial-gradient(ellipse at 50% -2%, rgba(247, 227, 176, 0.055), transparent 38%); }
body::before {
  background-image:
    linear-gradient(rgba(148, 170, 200, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 170, 200, 0.024) 1px, transparent 1px);
}
::selection { background: rgba(232, 201, 121, 0.26); color: #fdfaf3; }

/* Sidebar reads as a deeper plane than the main room */
.sidebar { background: linear-gradient(180deg, #0b1018 0%, #080b12 62%, #070a10 100%); border-right-color: rgba(148, 170, 200, 0.1); }
.nav-item.is-active { color: #f7e3b0; background: linear-gradient(90deg, rgba(232, 201, 121, 0.13), rgba(232, 201, 121, 0.03)); border-color: rgba(232, 201, 121, 0.2); }

.topbar { background: linear-gradient(180deg, rgba(8, 11, 18, 0.99), rgba(8, 11, 18, 0.9) 70%, rgba(8, 11, 18, 0.55) 100%); border-bottom-color: rgba(148, 170, 200, 0.09); }
.live-dot { background: #5fd6a6; box-shadow: 0 0 0 3px rgba(95, 214, 166, 0.16), 0 0 12px rgba(95, 214, 166, 0.55); }

/* Hero: midnight glass with a gold horizon */
.hero { background: linear-gradient(128deg, rgba(21, 28, 39, 0.97) 0%, rgba(11, 16, 24, 0.985) 54%, rgba(14, 19, 28, 0.99) 100%); border-color: rgba(232, 201, 121, 0.17); }
.hero h1 { color: #f4efe6; }
.hero h1 em { color: #f7e3b0; text-shadow: 0 0 46px rgba(232, 201, 121, 0.2); }
.hero-lede { color: #d6d0c5; }

/* Cards & panels: cool slate, hairline gold only on the accent rule */
.surface { background: linear-gradient(180deg, rgba(19, 26, 37, 0.94), rgba(11, 16, 24, 0.96)); border-color: rgba(148, 170, 200, 0.11); }
.panel { background: linear-gradient(180deg, rgba(19, 26, 37, 0.92), rgba(12, 17, 25, 0.96)); }
.panel::before { background: linear-gradient(90deg, #e8c979, #c48fff 55%, transparent); opacity: 0.5; }
.stat-card { background: linear-gradient(180deg, rgba(21, 28, 39, 0.92), rgba(10, 15, 22, 0.96)); }
.stat-card:hover { border-color: rgba(232, 201, 121, 0.24); box-shadow: 0 22px 55px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(232, 201, 121, 0.06); }
.stat-icon.gold { color: #f7e3b0; }
.stat-icon.blue { color: #8fb6e8; }
.stat-icon.violet { color: #b8ace8; }

/* Tables & rows */
.data-table td { border-top-color: rgba(148, 170, 200, 0.08); }
.data-table tbody tr:hover { background: rgba(148, 170, 200, 0.05); }
.data-table th { color: #9a9389; }
.member-info strong { color: #f1ece2; }
.level-badge { color: #f7e3b0; border-color: rgba(232, 201, 121, 0.24); background: rgba(232, 201, 121, 0.08); }

/* Health & states */
.health-pulse, .state-chip { color: #5fd6a6; }
.state-chip { color: #8fd6b8; }

/* Buttons: gold fill reads as the single strong action */
.btn-primary { background: linear-gradient(135deg, #f9eccb 0%, #f0d795 42%, #d9b46e 100%); color: #1a1408; box-shadow: 0 10px 30px rgba(232, 201, 121, 0.16), inset 0 1px 0 rgba(255, 250, 235, 0.6); }
.btn-primary:hover { background: linear-gradient(135deg, #fdf3da 0%, #f5e0a8 42%, #e0bf7c 100%); }
.btn-ghost { color: #e6e1d7; border-color: rgba(148, 170, 200, 0.2); background: rgba(19, 26, 37, 0.6); }
.btn-ghost:hover { color: #f7e3b0; border-color: rgba(232, 201, 121, 0.4); background: rgba(232, 201, 121, 0.07); }

/* Crest: gold on midnight, cyan/amethyst auras */
.royal-crest { border-color: rgba(232, 201, 121, 0.45); background: radial-gradient(circle at 50% 42%, #131a24, #080b12 72%); }
.crest-aura-blue { background: radial-gradient(circle, rgba(64, 190, 210, 0.55), rgba(40, 120, 190, 0.1) 48%, transparent 72%); }
.crest-aura-ember { background: radial-gradient(circle, rgba(196, 143, 255, 0.5), rgba(120, 90, 210, 0.1) 48%, transparent 72%); }
.hero-dust i { background: #f7e3b0; box-shadow: 0 0 9px rgba(247, 227, 176, 0.85); }

/* Inputs, modals, toasts */
input, select, textarea { color: #f1ece2 !important; background: rgba(8, 11, 18, 0.86) !important; border-color: rgba(148, 170, 200, 0.18) !important; }
input:focus, select:focus, textarea:focus { border-color: rgba(232, 201, 121, 0.5) !important; box-shadow: 0 0 0 3px rgba(232, 201, 121, 0.13); }
.modal { background: linear-gradient(180deg, #131a24, #0b1018); border-color: rgba(232, 201, 121, 0.2); }
.modal-backdrop { background: rgba(4, 7, 12, 0.82); }
.toast { background: linear-gradient(180deg, rgba(25, 33, 45, 0.98), rgba(13, 19, 27, 0.99)); border-color: rgba(148, 170, 200, 0.16); }

/* Focus visibility for keyboard operators */
:focus-visible { outline: 2px solid #f7e3b0; outline-offset: 2px; border-radius: 6px; }

/* Contrast pass: small caps never dip below 5:1 on ink */
.data-table th, .member-info span, .timeline-kind, .health-state, .panel-kicker, .page-kicker { color: #b4ada2; }
.health-state { color: #8fd6b8; }
.health-state.warn { color: #f0d795; }
.health-state.bad { color: #f0a29a; }
.console-level.INFO { color: #9ab0c8; }
.console-level.DEBUG { color: #8f9aa9; }
.console-level.WARNING { color: #f0d795; }
.console-msg { color: #c3bdb3; }
.console-msg strong { color: #ece7dd; }
.hero-meta span, .breadcrumbs > span:first-child, .royal-clock span { color: #b4ada2; }
.stat-main > span, .side-label > span:first-child, .side-monitor-top span { color: #b4ada2; }
.operator-copy span, .bot-copy span { color: #b4ada2; }
.hero-meta strong { color: #f1ece2; }
.side-state strong { color: #f7e3b0; }
.switch-row span, .fine-print, .health-foot, .hero-index, .footer { color: #a8a196; }
