*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

:root {
  --ink-0: #000000;
  --ink-1: #0a0a0a;
  --ink-2: #121212;
  --ink-3: #1c1c1c;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.17);
  --line-3: rgba(255,255,255,.3);
  --fg: #f5f5f5;
  --fg-2: #9a9a9a;
  --fg-3: #868686;
  --fg-4: #5e5e5e;
  --r-sm: 6px;
  --r: 9px;
  --r-lg: 14px;
  --sidebar-w: 258px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: .16s;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

html { -webkit-text-size-adjust: 100%; scrollbar-color: #202020 #000; scrollbar-width: thin; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--ink-0);
  color: var(--fg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse 130% 90% at 50% -10%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 130% 90% at 50% -10%, #000 0%, transparent 78%);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #202020; border: 3px solid #000; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #2e2e2e; }

::selection { background: var(--fg); color: #000; }

:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }

a { color: inherit; }

.sprite { display: none; }

.ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.faint { color: var(--fg-4); }
.nowrap { white-space: nowrap; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes sweep {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .3; transform: scale(.7); }
}

@keyframes sheen {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@keyframes grow-x {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes beam {
  0%   { transform: translateX(-55%); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(55%); opacity: 0; }
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

@keyframes rise-particle {
  0%   { transform: translateY(0); opacity: 0; }
  15%  { opacity: .7; }
  85%  { opacity: .45; }
  100% { transform: translateY(-102vh); opacity: 0; }
}

.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #050505 0%, #000 100%);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--fg);
  color: #000;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.04em;
  flex-shrink: 0;
}

.brand-text { min-width: 0; }

.brand-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.025em;
  color: var(--fg);
}

.brand-tag {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-4);
  margin-top: 1px;
}

.nav { flex: 1; padding: 12px 10px; }

.nav-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-4);
  padding: 16px 10px 7px;
}

.nav-label:first-child { padding-top: 4px; }

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 450;
  color: var(--fg-2);
  text-decoration: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.nav-link .ico { color: var(--fg-4); transition: color var(--dur) var(--ease); }

.nav-link:hover { background: rgba(255,255,255,.035); color: var(--fg); }
.nav-link:hover .ico { color: var(--fg-2); }

.nav-link::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  width: 2px;
  height: 16px;
  margin-top: -8px;
  border-radius: 0 2px 2px 0;
  background: var(--fg);
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.nav-link.active { background: rgba(255,255,255,.07); color: var(--fg); font-weight: 550; }
.nav-link.active .ico { color: var(--fg); }
.nav-link.active::before { opacity: 1; transform: none; }

.sidebar-foot { padding: 12px 10px 14px; border-top: 1px solid var(--line); flex-shrink: 0; }

.who {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px 11px;
}

.who-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: var(--ink-3);
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--fg-2);
  flex-shrink: 0;
}

.who-text { min-width: 0; }

.who-name {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who-role {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--fg-4);
}

.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 80;
}

.burger {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
}

.burger:hover { color: var(--fg); border-color: var(--line-3); }

.scrim { display: none; }

.main {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 30px 34px 80px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.crumb {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.crumb .ico { width: 13px; height: 13px; }
.crumb a { color: inherit; text-decoration: none; transition: color var(--dur) var(--ease); }
.crumb a:hover { color: var(--fg); }

.page-head h1 {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.15;
}

.page-sub { font-size: 13px; color: var(--fg-3); margin-top: 6px; }

.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg);
  flex-shrink: 0;
}

.live-dot.off {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--fg-4);
  animation: none;
}

.grid-kpi {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 17px 19px 15px;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.kpi::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(165deg, rgba(255,255,255,.035) 0%, transparent 52%);
}

.kpi:hover { border-color: var(--line-2); transform: translateY(-2px); }

.kpi-mark {
  position: absolute;
  top: 17px;
  right: 18px;
  color: var(--fg-4);
  opacity: .7;
  transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.kpi:hover .kpi-mark { color: var(--fg-2); opacity: 1; }

.kpi-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--fg-3);
  min-height: 15px;
  padding-right: 26px;
}

.kpi-value {
  position: relative;
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1;
  margin: auto 0 11px;
  font-variant-numeric: tabular-nums;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-3);
}

.kpi-foot > :empty { display: none; }

.kpi-delta { color: var(--fg); }
.kpi-delta.flat { color: var(--fg-4); }

.flash { position: relative; }

.flash::before {
  content: '';
  position: absolute;
  inset: -2px -6px;
  border-radius: var(--r);
  pointer-events: none;
  background: rgba(255,255,255,.09);
  opacity: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.panel {
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color var(--dur) var(--ease);
}

.panel:hover { border-color: var(--line-2); }

.panel.fill { display: flex; flex-direction: column; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 auto;
  height: 56px;
  padding: 0 19px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: -.01em;
}

.panel-title .ico { color: var(--fg-4); }

.panel-note {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-4);
}

.panel-body { padding: 19px; }

.panel.fill > .panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.panel-body.flush { padding: 0 0 4px; }
.panel-body.flush th:first-child, .panel-body.flush td:first-child { padding-left: 19px; }
.panel-body.flush th:last-child,  .panel-body.flush td:last-child  { padding-right: 19px; }

.chart-box { flex: 1; min-height: 232px; position: relative; }

.chart-fill { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.range-switch { display: flex; gap: 4px; }

.range-switch button {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg-4);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.range-switch button:hover { color: var(--fg-2); border-color: var(--line-2); }

.range-switch button[aria-pressed="true"] {
  background: rgba(255,255,255,.08);
  border-color: var(--line-2);
  color: var(--fg);
}

.hours {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  flex: 1;
  min-height: 200px;
  align-items: end;
}

.hour-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }

.hour-bar {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 2px;
  background: var(--fg-3);
}

.hour-bar.zero { opacity: .22; }
.hour-bar.peak { background: var(--fg); }

.hours-axis {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--fg-4);
  text-align: center;
}

.bars { display: flex; flex-direction: column; gap: 15px; }

.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: baseline; }

.bar-name {
  font-size: 12.5px;
  color: var(--fg-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-count {
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

.bar-track {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 999px;
  background: var(--ink-3);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--fg-2);
  transform-origin: left center;
}

.bars .bar-row:first-child .bar-fill { background: var(--fg); }

.feed { display: flex; flex-direction: column; }

.feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 19px;
  border-bottom: 1px solid var(--line);
  transition: background var(--dur) var(--ease);
}

.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { background: rgba(255,255,255,.025); }

.feed-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--fg-2);
  flex-shrink: 0;
}

.feed-info { flex: 1; min-width: 0; }

.feed-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-4);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th {
  text-align: left;
  padding: 15px 14px 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-2);
  vertical-align: middle;
}

tbody tr { transition: background var(--dur) var(--ease); }
tbody tr:hover td { background: rgba(255,255,255,.025); }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: var(--fg); font-weight: 550; }

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  opacity: .5;
  transition: opacity var(--dur) var(--ease);
}

tbody tr:hover .row-actions { opacity: 1; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--fg-2);
  white-space: nowrap;
  line-height: 1.6;
}

.chip::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.chip-ok { color: var(--fg-2); }

.chip-danger {
  background: var(--fg);
  border-color: var(--fg);
  color: #000;
  font-weight: 700;
}

.chip-pending { border-style: dashed; color: var(--fg-3); }
.chip-pending::before { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }

.chip-idle { border-color: var(--line); color: var(--fg-4); }

.alert {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px 12px 17px;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 13px;
  color: var(--fg-2);
  margin-bottom: 12px;
  overflow: hidden;
}

.main > .alert { margin-bottom: 0; }

.alert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--fg-4);
}

.alert .ico { width: 15px; height: 15px; margin-top: 2px; color: var(--fg-3); }
.alert-error::before { background: var(--fg); }
.alert-error .ico { color: var(--fg); }
.alert-error { color: var(--fg); }
.alert-success::before { background: var(--fg-2); }
.alert-info::before { background: var(--fg-4); }
.alert-text { flex: 1; min-width: 0; }
.alert-text a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }

.alert-close {
  background: none;
  border: 0;
  padding: 2px;
  line-height: 0;
  color: var(--fg-4);
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}

.alert-close:hover { color: var(--fg); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -.005em;
  color: var(--fg-2);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform .1s var(--ease);
}

.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .32; cursor: not-allowed; pointer-events: none; }
.btn .ico { width: 14px; height: 14px; }

.btn-primary { background: var(--fg); color: #000; font-weight: 600; }
.btn-primary:hover { background: #fff; }

.btn-ghost { border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(255,255,255,.05); border-color: var(--line-3); color: var(--fg); }

.btn-danger { border-color: var(--line-2); }
.btn-danger:hover { background: var(--fg); border-color: var(--fg); color: #000; }

.btn-sm { height: 28px; padding: 0 10px; font-size: 11.5px; }
.btn-block { width: 100%; height: 40px; }

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field > label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}

input:hover, select:hover, textarea:hover { border-color: var(--line-2); }

input:focus, select:focus, textarea:focus {
  border-color: rgba(255,255,255,.45);
  background: var(--ink-2);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}

input:disabled, textarea:disabled, select:disabled {
  color: var(--fg-3);
  cursor: not-allowed;
}

input::placeholder, textarea::placeholder { color: var(--fg-4); }

select {
  appearance: none;
  cursor: pointer;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236a6a6a' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

select option { background: #0a0a0a; color: var(--fg); }

input[type="checkbox"] { accent-color: #d4d4d4; }

.hint {
  font-size: 11.5px;
  color: var(--fg-4);
  margin-top: 7px;
  line-height: 1.55;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 15px 19px;
}

.toolbar .field { margin-bottom: 0; }

.form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.autjoin-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.autjoin-row input { flex: 1; min-width: 0; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); gap: 20px; }
.kv > * { min-width: 0; }

.kv-key {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--fg-4);
  margin-bottom: 7px;
  min-height: 14px;
}

.kv-val {
  font-size: 13px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.split { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

.metrics {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 20px;
}

.metric-v {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.metric-v.quiet { color: var(--fg-4); }

.metric-k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--fg-4);
  margin-top: 4px;
}

.progress {
  height: 4px;
  border-radius: 999px;
  background: var(--ink-3);
  overflow: hidden;
}

.progress-fill {
  position: relative;
  height: 100%;
  border-radius: 999px;
  background: var(--fg);
  transition: width .5s var(--ease);
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 15px 19px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--fg-4);
}

.pager a {
  color: var(--fg-2);
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: all var(--dur) var(--ease);
}

.pager a:hover { color: var(--fg); background: rgba(255,255,255,.05); border-color: var(--line-2); }
.pager .spacer { flex: 1; }
.pager .current { color: var(--fg-2); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 46px 20px;
  text-align: center;
}

.empty .ico { width: 22px; height: 22px; color: var(--fg-4); stroke-width: 1.3; }

.empty-text {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-4);
}

.log {
  max-height: 420px;
  overflow: auto;
  padding: 16px 19px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--fg-3);
  white-space: pre-wrap;
  word-break: break-word;
}

code {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--fg-2);
}

.auth, .result {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.auth::after {
  content: '';
  position: absolute;
  inset: -30% -10%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 44%, rgba(255,255,255,.05) 50%, transparent 56%);
  opacity: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 386px;
  padding: 32px 30px 30px;
  background: rgba(8,8,8,.88);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: 0 40px 90px -24px #000;
}

.auth-head { margin-bottom: 26px; }

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.auth-head h1 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.auth-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--fg-4);
  margin-top: 7px;
}

.code-input {
  text-align: center;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .32em;
  text-indent: .32em;
  height: 48px;
}

.qr {
  display: block;
  margin: 0 auto 22px;
  padding: 12px;
  width: 190px;
  border-radius: var(--r);
  background: #fff;
}

.result-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 452px;
  padding: 40px 34px 34px;
  text-align: center;
  background: var(--ink-1);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  box-shadow: 0 40px 90px -24px #000;
}

.result-mark { width: 78px; height: 78px; margin: 0 auto 26px; }

.result-mark svg { width: 78px; height: 78px; overflow: visible; }

.result-mark .ring {
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.5;
}

.result-mark .tick {
  fill: none;
  stroke: var(--fg);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-mark .cross {
  fill: none;
  stroke: var(--fg);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.result-card h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.035em;
}

.result-sub { font-size: 13.5px; color: var(--fg-3); line-height: 1.65; margin-top: 10px; }

.result-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 26px 0;
  padding: 16px 18px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--ink-0);
}

.result-list .kv-key { margin-bottom: 12px; }

.result-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--fg-3);
  line-height: 1.55;
}

.result-item .ico { width: 13px; height: 13px; margin-top: 2px; color: var(--fg-3); }

.particle {
  position: fixed;
  bottom: -12px;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
}

.result-actions { margin-top: 28px; }

@media (max-width: 1200px) {
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-kpi > :last-child { grid-column: 1 / -1; }
  .kpi-value { font-size: 32px; }
}

@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .24s var(--ease);
    box-shadow: 24px 0 60px rgba(0,0,0,.8);
  }

  html.nav-open .sidebar { transform: none; }
  html.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.65); }
  html.nav-open body { overflow: hidden; }

  .topbar { display: flex; }
  .main { margin-left: 0; padding: 20px 16px 60px; }
  .page-head h1 { font-size: 20px; }
}

@media (max-width: 640px) {
  .metrics {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 20px;
  }

  .metrics > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .kpi-value { font-size: 26px; }
  .toolbar { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: no-preference) {
  .stagger > * { animation: rise .46s var(--ease) both; }
  .stagger > *:nth-child(1) { animation-delay: 0s; }
  .stagger > *:nth-child(2) { animation-delay: .05s; }
  .stagger > *:nth-child(3) { animation-delay: .1s; }
  .stagger > *:nth-child(4) { animation-delay: .15s; }
  .stagger > *:nth-child(5) { animation-delay: .2s; }
  .stagger > *:nth-child(6) { animation-delay: .25s; }
  .stagger > *:nth-child(7) { animation-delay: .3s; }
  .stagger > *:nth-child(8) { animation-delay: .35s; }

  .page-head { animation: rise .4s var(--ease) both; }

  html.js .reveal { opacity: 0; transform: translateY(14px); }
  html.js .reveal.in { opacity: 1; transform: none; }

  .alert { animation: rise .32s var(--ease) both; }

  .bar-fill { animation: grow-x .75s var(--ease) both; }
  .bars .bar-row:nth-child(2) .bar-fill { animation-delay: .06s; }
  .bars .bar-row:nth-child(3) .bar-fill { animation-delay: .12s; }
  .bars .bar-row:nth-child(4) .bar-fill { animation-delay: .18s; }
  .bars .bar-row:nth-child(5) .bar-fill { animation-delay: .24s; }
  .bars .bar-row:nth-child(6) .bar-fill { animation-delay: .3s; }
  .bars .bar-row:nth-child(7) .bar-fill { animation-delay: .36s; }
  .bars .bar-row:nth-child(8) .bar-fill { animation-delay: .42s; }

  .chip-running::before { animation: pulse-dot 1.4s ease-in-out infinite; }

  .live-dot { animation: pulse-dot 2.2s ease-in-out infinite; }

  .progress-fill.running::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,.6), transparent);
    background-size: 200% 100%;
    animation: sheen 1.5s linear infinite;
  }

  .flash::before { animation: sweep .85s ease-out forwards; }

  .auth::after { animation: beam 9s var(--ease) infinite; }
  .auth-card { animation: rise .5s var(--ease) both; }

  .result-card { animation: rise .55s var(--ease) both; }

  .result-mark .ring { stroke-dasharray: 214; stroke-dashoffset: 214; animation: draw .65s var(--ease) .1s forwards; }
  .result-mark .tick { stroke-dasharray: 60;  stroke-dashoffset: 60;  animation: draw .4s var(--ease) .7s forwards; }
  .result-mark .cross { stroke-dasharray: 40; stroke-dashoffset: 40;  animation: draw .34s var(--ease) .7s forwards; }
  .result-card h1 { animation: rise .5s var(--ease) .35s both; }
  .result-sub { animation: rise .5s var(--ease) .45s both; }
  .result-list { animation: rise .5s var(--ease) .55s both; }
  .result-actions { animation: rise .5s var(--ease) .65s both; }

  .particle { animation: rise-particle var(--p-dur, 14s) linear var(--p-delay, 0s) infinite; }

  .brand-mark { animation: drift 5s ease-in-out infinite; }
}

.reveal { transition: opacity .5s var(--ease), transform .5s var(--ease); }
