/* Loomwork design system. Shared by /login and every UI page (T7). No external requests.
   Tokens follow the design spec (--lw-*); fonts are self-hosted (OFL, see public/licenses). */
@font-face {
  font-family: 'Inter';
  src: url('InterVariable.woff2?v=693b77d4f3') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('JetBrainsMono-Regular.woff2?v=a9cb1cd823') format('woff2');
  font-weight: 400;
  font-display: swap;
}
:root {
  --lw-gray-0: #07080c;
  --lw-gray-50: #0a0b10;
  --lw-gray-100: #101219;
  --lw-gray-200: #161922;
  --lw-gray-300: #1f2330;
  --lw-gray-400: #2a2f3e;
  --lw-gray-500: #3a4052;
  --lw-gray-600: #5b6275;
  --lw-gray-700: #8b92a5;
  --lw-gray-800: #a9afbf;
  --lw-gray-900: #c9cdd8;
  --lw-gray-1000: #edeff4;
  --lw-warp-400: #7dd3fc;
  --lw-indigo-400: #818cf8;
  --lw-indigo-500: #6366f1;
  --lw-weft-400: #fbbf77;
  --lw-rose-400: #f472b6;
  --lw-bg: var(--lw-gray-50);
  --lw-surface: rgba(16, 18, 25, 0.72);
  --lw-surface-solid: #11131b;
  --lw-border: rgba(255, 255, 255, 0.08);
  --lw-border-strong: rgba(255, 255, 255, 0.14);
  --lw-text: var(--lw-gray-1000);
  --lw-text-muted: var(--lw-gray-800); /* 8.3:1 on --lw-surface-solid */
  --lw-text-subtle: var(--lw-gray-700); /* 5.8:1, decorative/meta only */
  --lw-focus: #a5b4fc;
  --lw-success: #4ade80;
  --lw-warn: #fbbf24;
  --lw-warn-bg: rgba(251, 191, 36, 0.12);
  --lw-warn-fg: #fde68a;
  --lw-danger: #f87171;
  --lw-danger-bg: rgba(248, 113, 113, 0.12);
  --lw-danger-border: rgba(248, 113, 113, 0.45);
  --lw-danger-fg: #fecaca; /* ≥ 10:1 on the tinted banner */
  --lw-info: #60a5fa;
  --lw-info-bg: rgba(96, 165, 250, 0.12);
  --lw-info-fg: #bfdbfe;
  --lw-gradient-thread: linear-gradient(
    90deg,
    var(--lw-warp-400),
    var(--lw-indigo-400) 45%,
    var(--lw-rose-400) 75%,
    var(--lw-weft-400)
  );
  --lw-font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --lw-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --lw-ring: 0 0 0 2px var(--lw-bg), 0 0 0 4px var(--lw-focus);

  color-scheme: dark;
  --font: var(--lw-font-sans);
  --mono: var(--lw-font-mono);
  --bg: var(--lw-bg);
  --bg-2: #0d0d16;
  --surface: var(--lw-surface);
  --surface-solid: var(--lw-surface-solid);
  --border: var(--lw-border);
  --border-strong: var(--lw-border-strong);
  --text: var(--lw-text);
  --muted: var(--lw-text-muted); /* 7.4:1 on --bg */
  --faint: var(--lw-text-muted);
  --accent: #8b5cf6;
  --accent-2: #6366f1;
  --accent-3: #22d3ee;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #22d3ee 100%);
  --danger: var(--lw-danger);
  --danger-bg: var(--lw-danger-bg);
  --warn: var(--lw-warn);
  --warn-bg: var(--lw-warn-bg);
  --ok: var(--lw-success);
  --ring: var(--lw-ring);
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 24px 80px -24px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 15px/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a {
  color: #c4b5fd;
  text-decoration: none;
}
a:hover {
  color: #ddd6fe;
  text-decoration: underline;
}
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}
code,
pre {
  font-family: var(--mono);
  font-size: 0.9em;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- animated mesh background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(1200px 600px at 50% -10%, #1a1630 0%, var(--bg) 60%);
}
.bg::after {
  /* fine grid */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}
.blob {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.38;
  will-change: transform;
}
.blob.b1 {
  background: #7c3aed;
  top: -18vmax;
  left: -12vmax;
  animation: drift1 22s ease-in-out infinite alternate;
}
.blob.b2 {
  background: #4f46e5;
  bottom: -22vmax;
  right: -14vmax;
  animation: drift2 26s ease-in-out infinite alternate;
}
.blob.b3 {
  background: #0891b2;
  top: 30%;
  left: 55%;
  width: 30vmax;
  height: 30vmax;
  opacity: 0.22;
  animation: drift3 30s ease-in-out infinite alternate;
}
@keyframes drift1 {
  to {
    transform: translate(14vmax, 10vmax) scale(1.12);
  }
}
@keyframes drift2 {
  to {
    transform: translate(-12vmax, -8vmax) scale(1.08);
  }
}
@keyframes drift3 {
  to {
    transform: translate(-18vmax, 6vmax) scale(0.9);
  }
}

/* ---------- brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand:hover {
  color: var(--text);
  text-decoration: none;
}
.brand img {
  width: 28px;
  height: 28px;
  display: block;
}
.brand .word {
  font-size: 17px;
}
.brand.lg img {
  width: 44px;
  height: 44px;
}
.brand.lg .word {
  font-size: 26px;
  letter-spacing: -0.02em;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- glass card ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

/* ---------- forms ---------- */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-size: 13px;
  font-weight: 550;
  color: var(--muted);
}
.input-wrap {
  position: relative;
}
.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font: inherit;
  color: var(--text);
  background: rgba(8, 8, 14, 0.6);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
.input::placeholder {
  color: #6b6b85;
}
.input:hover {
  border-color: rgba(255, 255, 255, 0.24);
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: rgba(8, 8, 14, 0.85);
}
.input[aria-invalid='true'] {
  border-color: var(--danger);
}
/* Invalid + focused: keep the red border visible; ring is a danger-tinted outline offset from it. */
.input[aria-invalid='true']:focus {
  border-color: var(--danger);
  box-shadow: none;
  outline: 2px solid rgba(248, 113, 113, 0.7);
  outline-offset: 2px;
}
.input-wrap .input {
  padding-right: 76px;
}
.toggle {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 32px;
  padding: 0 10px;
  font: 600 12px var(--font);
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}
.toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.toggle:focus-visible {
  box-shadow: var(--ring);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  font: 600 15px var(--font);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    transform 0.12s,
    box-shadow 0.2s,
    filter 0.2s,
    background 0.2s;
}
.btn-primary {
  width: 100%;
  background: var(--grad);
  background-size: 160% 160%;
  background-position: 0% 50%;
  box-shadow:
    0 8px 28px -10px rgba(124, 58, 237, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover {
  background-position: 100% 50%;
  filter: brightness(1.08);
  box-shadow:
    0 12px 36px -10px rgba(99, 102, 241, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:active {
  transform: translateY(1px) scale(0.995);
}
.btn-primary:focus-visible {
  box-shadow:
    var(--ring),
    0 8px 28px -10px rgba(124, 58, 237, 0.8);
}
.btn[aria-busy='true'] {
  cursor: progress;
  filter: saturate(0.8) brightness(0.95);
}
.btn .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn[aria-busy='true'] .spinner {
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.btn-ghost {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- alerts ---------- */
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid;
  animation: pop 0.25s ease-out;
}
.alert svg {
  flex: none;
  margin-top: 2px;
}
.alert-error {
  color: var(--lw-danger-fg);
  background: var(--lw-danger-bg);
  border-color: var(--lw-danger-border);
}
.alert-error svg {
  color: var(--lw-danger);
}
.alert-warn {
  color: var(--lw-warn-fg);
  background: var(--lw-warn-bg);
  border-color: rgba(251, 191, 36, 0.4);
}
.alert-info {
  color: var(--lw-info-fg);
  background: var(--lw-info-bg);
  border-color: rgba(96, 165, 250, 0.4);
}
.alert strong {
  font-variant-numeric: tabular-nums;
}
/* Transform-only: the banner is never rendered transparent. */
@keyframes pop {
  from {
    transform: translateY(-4px);
  }
}

/* ---------- auth layout ---------- */
.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 28px 28px;
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}
/* Re-rendered after a POST (invalid/locked/expired): fully opaque, no entrance replay. */
.auth-card[data-state] {
  animation: none;
  opacity: 1;
}
.auth-card[data-state] .alert {
  animation: none;
}
.auth-head {
  text-align: center;
  margin-bottom: 26px;
}
.auth-head .tagline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.auth-card h1 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 18px;
  color: var(--text);
}
.auth-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--faint);
}
.auth-foot a {
  color: var(--lw-text);
  text-decoration: underline;
  text-decoration-color: rgba(237, 239, 244, 0.45);
  text-underline-offset: 3px;
  border-radius: 4px;
}
.auth-foot a:hover {
  text-decoration-color: currentColor;
}
.auth-foot a:focus-visible {
  outline: none;
  box-shadow: var(--lw-ring);
}
.btn-primary:disabled {
  cursor: not-allowed;
  filter: saturate(0.35);
  opacity: 0.75;
}

/* ---------- app shell (T7 pages) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 24px;
  background: rgba(7, 7, 12, 0.7);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.topbar .right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar form {
  margin: 0;
}
.user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 12px var(--font);
  color: #fff;
  background: var(--grad);
}
.crumbs {
  color: var(--faint);
  font-size: 13px;
}
.crumbs a {
  color: var(--muted);
}
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.page-title {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.page-sub {
  color: var(--muted);
  margin: 0 0 28px;
}
.card {
  padding: 20px 22px;
}
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.stat .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.stat .value {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.03);
}
table.data th,
table.data td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data tr:last-child td {
  border-bottom: 0;
}
table.data tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}
table.data td.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.badge.ok {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
}
.badge.bad {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.35);
  background: var(--danger-bg);
}
.badge.pending {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.35);
  background: var(--warn-bg);
}
pre.payload {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  overflow: auto;
  max-height: 420px;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
}
.site-foot {
  text-align: center;
  color: var(--faint);
  font-size: 12px;
  padding: 24px;
}

@media (max-width: 520px) {
  .blob.b1 {
    opacity: 0.26;
  }
  .auth-card {
    padding: 26px 20px 22px;
    border-radius: 16px;
  }
  .topbar {
    padding: 0 14px;
  }
  .user .name {
    display: none;
  }
  .container {
    padding: 24px 14px 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: rgba(255, 255, 255, 0.3);
    --border-strong: rgba(255, 255, 255, 0.5);
    --muted: #d0d0e0;
  }
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: var(--lw-surface-solid);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ===================== App shell v2 (T7: Runs / Metrics / Costs) ===================== */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app > main {
  flex: 1 0 auto;
  width: 100%;
}
.topbar {
  height: 56px;
  background: rgba(10, 11, 16, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar .brand img {
  width: 20px;
  height: 20px;
}
.topbar .brand .word {
  font-size: 15px;
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}
.nav a {
  position: relative;
  padding: 8px 10px;
  border-radius: var(--lw-radius-sm, 6px);
  font-size: 13px;
  font-weight: 500;
  color: var(--lw-text-muted);
  text-decoration: none;
}
.nav a:hover {
  color: var(--lw-text);
  background: rgba(255, 255, 255, 0.04);
}
.nav a[aria-current='page'] {
  color: var(--lw-text);
}
.nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -11px;
  height: 2px;
  border-radius: 2px;
  background: var(--lw-gradient-thread);
}
.nav a:focus-visible,
.crumbs a:focus-visible,
.seg a:focus-visible,
.link:focus-visible,
table.data a:focus-visible {
  outline: none;
  box-shadow: var(--lw-ring);
  border-radius: 4px;
}
.container {
  max-width: 1280px;
  padding: 32px;
}
.crumbs-bar {
  margin-bottom: 12px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head .page-sub {
  margin: 0;
}
.page-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
h2.section {
  font-size: 16px;
  font-weight: 600;
  margin: 32px 0 12px;
  letter-spacing: -0.01em;
}
.muted {
  color: var(--lw-text-muted);
}
.mono,
code {
  font-family: var(--lw-font-mono);
  font-size: 0.92em;
}
.link {
  color: var(--lw-accent, #818cf8);
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}
table.data a {
  color: var(--lw-text);
  text-decoration: none;
}
table.data a:hover {
  text-decoration: underline;
  text-decoration-color: var(--lw-text-subtle);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Segmented control (window: 7 / 30 days), plain links. */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--lw-radius-md, 8px);
  border: 1px solid var(--lw-border);
  background: rgba(255, 255, 255, 0.02);
}
.seg a {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--lw-text-muted);
  text-decoration: none;
}
.seg a[aria-current='true'] {
  color: var(--lw-text);
  background: var(--lw-gray-300, #1f2330);
}

/* KPI cards */
.kpis {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.kpi {
  padding: 20px;
  border-radius: var(--lw-radius-lg, 12px);
  background: var(--lw-surface-solid);
  border: 1px solid var(--lw-border);
}
.kpi .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--lw-text-muted);
}
.kpi .value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi .sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--lw-text-subtle);
}
.kpi .value.ok {
  color: var(--lw-success);
}
.kpi .value.warn {
  color: var(--lw-warn);
}
.kpi .value.bad {
  color: var(--lw-danger);
}

/* Panels */
.panel {
  border-radius: var(--lw-radius-lg, 12px);
  background: var(--lw-surface-solid);
  border: 1px solid var(--lw-border);
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 0;
}
.panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.panel-body {
  padding: 16px 20px 20px;
}
.cols-2 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.table-wrap {
  background: var(--lw-surface-solid);
}
table.data th {
  position: sticky;
  top: 0;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--lw-text-subtle);
  background: var(--lw-gray-200, #161922);
}
table.data td,
table.data th {
  height: 44px;
  font-size: 13px;
}
table.data th.n {
  text-align: right;
}
table.data .trunc {
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

/* Status pills (text + dot, never colour alone) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--lw-gray-900, #c9cdd8);
  background: rgba(255, 255, 255, 0.06);
}
.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.success {
  color: var(--lw-success);
  background: rgba(74, 222, 128, 0.12);
}
.pill.danger {
  color: var(--lw-danger);
  background: var(--lw-danger-bg);
}
.pill.warn {
  color: var(--lw-warn);
  background: var(--lw-warn-bg);
}
.pill.info {
  color: var(--lw-info);
  background: var(--lw-info-bg);
}
.pill.info::before {
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* Bars (cost share) */
.bar {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  min-width: 80px;
}
.bar > svg {
  display: block;
  width: 100%;
  height: 6px;
}

/* Charts (server-rendered SVG; data also in an sr-only table) */
figure.chart {
  margin: 0;
}
figure.chart svg {
  display: block;
  width: 100%;
  height: auto;
}
figure.chart figcaption {
  font-size: 12px;
  color: var(--lw-text-subtle);
  margin-top: 8px;
}
.chart .grid-line {
  stroke: var(--lw-border);
}
.chart .axis {
  fill: var(--lw-text-subtle);
  font-size: 11px;
  font-family: var(--lw-font-sans);
}
.chart .s-ok {
  fill: var(--lw-success);
}
.chart .s-bad {
  fill: var(--lw-danger);
}
.chart .s-pending {
  fill: var(--lw-info);
}
.chart .s-cost {
  fill: var(--lw-indigo-400, #818cf8);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--lw-text-muted);
}
.legend .key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend .key::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}
.legend .k-ok {
  color: var(--lw-success);
}
.legend .k-bad {
  color: var(--lw-danger);
}
.legend .k-pending {
  color: var(--lw-info);
}
.legend .key span {
  color: var(--lw-text-muted);
}

/* Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 56px 24px;
  border: 1px dashed var(--lw-border-strong);
  border-radius: var(--lw-radius-lg, 12px);
  background: rgba(255, 255, 255, 0.015);
}
.empty-state img {
  width: 40px;
  height: 40px;
  filter: grayscale(1);
  opacity: 0.7;
  margin-bottom: 8px;
}
.empty-state h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.empty-state p {
  margin: 0;
  max-width: 46ch;
  color: var(--lw-text-muted);
}
.empty-state .btn {
  margin-top: 12px;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--lw-radius-md, 8px);
  border: 1px solid var(--lw-border-strong);
  background: var(--lw-gray-200, #161922);
  color: var(--lw-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.btn-secondary:hover {
  background: var(--lw-gray-300, #1f2330);
}
.btn-secondary:focus-visible {
  outline: none;
  box-shadow: var(--lw-ring);
}
dl.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px 24px;
  margin: 0;
}
dl.meta dt {
  font-size: 12px;
  color: var(--lw-text-subtle);
}
dl.meta dd {
  margin: 4px 0 0;
  font-size: 14px;
}
.notice {
  font-size: 13px;
  color: var(--lw-text-muted);
  padding: 12px 16px;
  border-radius: var(--lw-radius-md, 8px);
  border: 1px solid var(--lw-border);
  background: rgba(255, 255, 255, 0.02);
}
.site-foot {
  flex-shrink: 0;
  border-top: 1px solid var(--lw-border);
  color: var(--lw-text-muted);
}
.site-foot .mono {
  color: var(--lw-text-subtle);
}

@media (max-width: 1023px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cols-2 {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding-top: 10px;
  }
  /* No JS sheet: the nav becomes a scrollable second row. */
  .nav {
    order: 3;
    width: 100%;
    margin: 0 -10px;
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .nav a[aria-current='page']::after {
    bottom: 0;
  }
}
@media (max-width: 639px) {
  .container {
    padding: 20px 16px 40px;
  }
  .kpis {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: 22px;
  }
  /* Tables become stacked cards; labels come from data-label (CSP-safe). */
  .table-wrap.stack {
    border: 0;
    background: none;
  }
  table.data.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  table.data.stack,
  table.data.stack tbody,
  table.data.stack tr,
  table.data.stack td {
    display: block;
    width: 100%;
  }
  table.data.stack tr {
    margin-bottom: 10px;
    padding: 8px 14px;
    border: 1px solid var(--lw-border);
    border-radius: var(--lw-radius-lg, 12px);
    background: var(--lw-surface-solid);
  }
  table.data.stack td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    height: auto;
    padding: 6px 0;
    border: 0;
    white-space: normal;
    text-align: right;
  }
  table.data.stack td::before {
    content: attr(data-label);
    color: var(--lw-text-subtle);
    font-size: 12px;
    text-align: left;
  }
  table.data.stack td.n {
    text-align: right;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pill.info::before {
    animation: none;
  }
}
@media (forced-colors: active) {
  .bg {
    display: none;
  }
}

/* ---------- PR #10 review fixes ---------- */
.kpis + .panel,
.kpis + section.panel {
  margin-top: var(--lw-space-4, 16px);
}
/* Cost share: indigo fill on a faint track, % as text (not colour-only). */
.share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  width: 100%;
}
.share .bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: none;
  min-width: 60px;
}
.share .bar .track {
  fill: rgba(255, 255, 255, 0.08);
}
.share .bar .fill {
  fill: var(--lw-indigo-400);
}
.share-pct {
  font-size: 12px;
  color: var(--lw-text-muted);
  min-width: 4ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* Run detail: why it is not successful. */
.cause {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--lw-text-muted);
}
.pill.danger.outline {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.4);
}
.mono,
td.n {
  font-variant-numeric: tabular-nums;
}
/* Desktop: nav sits next to the logo, user on the right. */
.app-top .nav {
  margin-right: auto;
}
/* Logout: label on desktop, icon-only on phones. */
.btn-logout .ico {
  display: none;
}
/* Charts: desktop SVG by default, the 360-wide variant on phones. */
figure.chart svg.chart-mob {
  display: none;
}
@media (max-width: 1023px) {
  .nav {
    scroll-snap-type: x proximity;
    mask-image: linear-gradient(90deg, #000 85%, transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .nav a {
    scroll-snap-align: start;
    flex: 0 0 auto;
  }
}
@media (max-width: 639px) {
  .topbar.app-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: 'logo . user' 'nav nav nav';
    grid-template-rows: 48px 40px;
    height: auto;
    padding: 0 16px;
    gap: 0;
    flex-wrap: nowrap;
  }
  .app-top .brand {
    grid-area: logo;
  }
  .app-top .top-user {
    grid-area: user;
    gap: 8px;
  }
  .app-top .nav {
    grid-area: nav;
    margin: 0 -8px;
    padding: 0;
    width: auto;
    order: 0;
    align-items: center;
    white-space: nowrap;
  }
  .app-top .user .name {
    display: none;
  }
  .app-top .avatar {
    width: 28px;
    height: 28px;
  }
  .btn-logout {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    display: inline-grid;
    place-items: center;
  }
  .btn-logout .ico {
    display: block;
  }
  .btn-logout .lbl {
    display: none;
  }
  figure.chart svg.chart-desk {
    display: none;
  }
  figure.chart svg.chart-mob {
    display: block;
  }
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  /* Card rows: label left, one right-aligned value that wraps instead of splitting. */
  table.data.stack td > * {
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  table.data.stack td .share {
    max-width: 60%;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .kpi {
    padding: 16px;
  }
  .kpi .value {
    font-size: 20px;
  }
}
@media (max-width: 359px) {
  .app-top .brand .word {
    display: none;
  }
  .kpis {
    grid-template-columns: 1fr;
  }
}
@media (forced-colors: active) {
  .share .bar .fill {
    fill: Highlight;
  }
  .share .bar .track {
    fill: Canvas;
    stroke: CanvasText;
  }
}
