@font-face {
  font-family: "Space Grotesk";
  src: url("space-grotesk-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("space-grotesk-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("jetbrains-mono-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("jetbrains-mono-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

:root {
  --ink: #070a08;
  --ink-2: #0c110e;
  --panel: #111813;
  --panel-raised: #172019;
  --paper: #eff5ee;
  --white: #111813;
  --line: #2b392e;
  --muted: #a1b0a3;
  --signal: #00e85a;
  --font: "Space Grotesk", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
}

html { scroll-behavior: smooth; }
body { min-width: 320px; color: var(--paper); background: var(--ink); text-rendering: optimizeLegibility; }
::selection { color: var(--ink); background: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
em { color: var(--signal); }

.kicker, .side-section-label, .panel-tag, .stat-card > span, .filter-row > label,
th, .side-status, .topbar-date, .main-footer, .panel-top, .auth-card > small {
  font-weight: 600;
  letter-spacing: .12em;
}
.kicker { color: var(--signal); }

.button { border-radius: 3px; font-weight: 700; letter-spacing: -.01em; }
.button-primary { background: var(--signal); color: var(--ink); }
.button-primary:hover:not(:disabled) { background: #7bff9b; }
.button-secondary { background: var(--paper); color: var(--ink); }
.button-secondary:hover:not(:disabled) { background: #d9e9d8; }
.button-quiet { background: #19221b; border-color: #39483c; color: var(--paper); }
.button-quiet:hover:not(:disabled) { border-color: var(--signal); }
.theme-switch { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; padding: 3px; background: #0b120d; border: 1px solid #3b4b3e; border-radius: 4px; }
.theme-switch button { min-height: 30px; padding: .35rem .55rem; border: 0; border-radius: 2px; background: transparent; color: #a7baa9; font: 600 .65rem var(--mono); cursor: pointer; }
.theme-switch button:hover { color: var(--paper); }
.theme-switch button[aria-pressed="true"] { background: var(--signal); color: var(--ink); }
.theme-switch button:focus-visible { outline-offset: 1px; }
.alert { border-radius: 3px; }
.alert-error { background: #3b1e1d; color: #ffc7c0; border-color: #87463e; }
.alert-success { background: #153b24; color: #b1ffc9; border-color: #327851; }

/* The login gives the official mark the same prominence it has on the main site. */
.auth-body {
  min-height: 100vh;
  padding: clamp(.8rem, 2.4vw, 2rem);
  background: #070a08;
  background-image: linear-gradient(#ffffff08 1px, transparent 1px), linear-gradient(90deg, #ffffff08 1px, transparent 1px);
  background-size: 76px 76px;
}
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(400px, .88fr);
  width: min(100%, 1320px);
  min-height: min(760px, calc(100vh - 4rem));
  border: 1px solid #2a382d;
  box-shadow: 0 30px 90px #0009;
}
.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(2rem, 4vw, 4rem);
  background: #090d0a;
  border-right: 1px solid #2a382d;
  isolation: isolate;
}
.auth-story::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(82vw, 780px);
  aspect-ratio: 1;
  right: -32%;
  bottom: -48%;
  border: 1px solid #00e85a44;
  border-radius: 50%;
  box-shadow: 0 0 0 72px #00e85a08, 0 0 0 144px #00e85a06, 0 0 120px #00e85a1a;
}
.auth-story::after {
  content: "07";
  position: absolute;
  z-index: -1;
  right: .05em;
  top: 28%;
  color: #ffffff07;
  font: 700 clamp(12rem, 29vw, 28rem)/1 var(--font);
  letter-spacing: -.12em;
  pointer-events: none;
}
.auth-wordmark { display: block; width: clamp(150px, 19vw, 210px); height: auto; }
.auth-story-copy { max-width: 670px; margin: 3rem 0; }
.auth-story-copy h1 {
  margin: 1.4rem 0 1rem;
  font-size: clamp(3.5rem, 6.2vw, 6.5rem);
  letter-spacing: -.075em;
  line-height: .99;
  font-weight: 700;
}
.auth-story-copy p { max-width: 390px; color: #b5c1b6; font-size: 1.02rem; line-height: 1.55; }
.auth-story-footer { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.15rem; border-top: 1px solid #2c392e; color: #8c9c8d; font: 500 .66rem var(--mono); letter-spacing: .1em; }
.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: clamp(2rem, 4vw, 4.2rem);
  border: 0;
  border-radius: 0;
  background: #121914;
  box-shadow: none;
}
.auth-card::before { width: 100%; height: 3px; }
.auth-card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.setup-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.auth-card-index { color: #708271; font: 600 .68rem var(--mono); letter-spacing: .1em; }
.auth-emblem { width: 66px; height: 72px; margin: 3.5rem 0 1.35rem; background: transparent; }
.auth-emblem img { width: 100%; height: 100%; object-fit: contain; }
.auth-card h2, .auth-card h1 { margin: 0 0 1rem; font-size: clamp(2.5rem, 4.3vw, 4rem); font-weight: 700; line-height: 1.05; letter-spacing: -.065em; }
.auth-card h2 em, .auth-card h1 em { color: var(--signal); }
.auth-card > p { max-width: 390px; color: #b3c1b5; }
.auth-card .alert-error { color: #ffc7c0; }
.auth-card > small { margin-top: 2.2rem; color: #849688; }
.auth-card .stack-form { margin-top: 2rem; }
.auth-card .stack-form input { background: #0a110c; border-color: #405044; color: var(--paper); }
.auth-card .stack-form input:focus { border-color: var(--signal); }
.auth-card-setup { max-width: 520px; border: 1px solid #2a382d; box-shadow: 0 30px 90px #0009; }
.setup-wordmark { display: block; width: 155px; height: auto; margin-bottom: 2rem; }
.setup-top .setup-wordmark { margin-bottom: 0; }

/* Dashboard: dark telemetry surfaces with one bright metric as an anchor. */
.dashboard-body { background: #0b100c; background-image: linear-gradient(#ffffff05 1px, transparent 1px), linear-gradient(90deg, #ffffff05 1px, transparent 1px); background-size: 88px 88px; }
.app-shell { grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { background: #070a08; border-right-color: #2a382d; }
.side-brand { gap: .7rem; }
.brand-icon { width: 38px; height: 45px; display: block; object-fit: contain; transform: none; background: transparent; }
.side-brand strong { font-size: .84rem; letter-spacing: .09em; color: var(--paper); }
.side-brand small { font-size: .52rem; letter-spacing: .08em; color: #9bae9d; }
.side-section-label { color: #829585; }
.side-nav { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #34523b transparent; }
.side-nav a { color: #b1c0b3; border: 1px solid transparent; border-radius: 3px; font-weight: 500; }
.side-nav a:hover, .side-nav .is-active { color: var(--signal); background: #142219; border-color: #2c4935; }
.side-status { color: #a3b4a5; border-top-color: #29372c; }
.side-status i, .status-dot { background: var(--signal); box-shadow: 0 0 11px #00e85a8c; }
.logout-button { color: #bdcbbf; }
.logout-button:hover { color: var(--signal); }
.main-content { width: min(100%, 1600px); }
.main-topbar { min-height: 74px; border-bottom-color: #304034; }
.topbar-actions { display: flex; align-items: center; gap: 1.15rem; }
.topbar-date { color: #a8b9aa; }
.topbar-date .status-dot { background: var(--signal); }
.page-heading { position: relative; padding: 3.4rem 0 2.5rem; }
.overview-heading::after { content: "07"; position: absolute; z-index: -1; right: 3rem; top: 1rem; color: #ffffff07; font: 700 clamp(7rem, 15vw, 15rem)/1 var(--font); letter-spacing: -.12em; }
.page-heading h1 { font-size: clamp(2.5rem, 4.5vw, 5rem); font-weight: 700; color: var(--paper); }
.page-heading p { color: #acbbae; }
.filter-row > label { color: #a4b5a6; }
.filter-row > span { color: #92a395; }
.stack-form label { color: #d9e5da; font-weight: 600; }
.stack-form input, .stack-form select, .stack-form textarea, .copy-row input, .filter-row select {
  border: 1px solid #405044;
  border-radius: 3px;
  background: #0b110d;
  color: var(--paper);
  color-scheme: dark;
}
.stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus, .copy-row input:focus, .filter-row select:focus { border-color: var(--signal); box-shadow: 0 0 0 3px #00e85a26; }
.stack-form input::placeholder, .stack-form textarea::placeholder { color: #8b9d8d; }
.stat-card { border-radius: 4px; background: var(--panel); border-color: #2b3b2e; }
.stat-card > span { color: #a5baa8; }
.stat-card strong { color: var(--paper); }
.stat-card small { color: #9fb1a1; }
.stat-card i { color: #7f9c85; }
.stat-card-primary { background: var(--signal); border-color: var(--signal); color: var(--ink); }
.stat-card-primary > span, .stat-card-primary small, .stat-card-primary strong, .stat-card-primary i { color: #07180c; }
.panel { border-radius: 4px; border-color: #2c3b2f; background: var(--panel); }
.panel h2 { color: var(--paper); font-weight: 700; }
.panel > p { color: #acbcaf; }
.panel-tag, .panel-top { color: #91a594; }
.empty-state { background: #0d140f; border-color: #405344; border-radius: 3px; color: #b4c3b6; }
.rank-item, .region-item { border-top-color: #2c3b2f; }
.rank-item:hover .rank-main strong { color: var(--signal); }
.rank-number { color: #829a86; }
.rank-main strong, .region-item strong { color: var(--paper); }
.rank-main small, .region-item small { color: #9fb1a2; }
.rank-progress, .rank-progress::-webkit-progress-bar { background: #2a392d; }
.rank-progress::-webkit-progress-value { background: var(--signal); }
.rank-progress::-moz-progress-bar { background: var(--signal); }
.rank-item b, .region-item b { color: var(--paper); }
.muted-note { color: #9aab9d !important; }
th { color: #a8baaa; border-bottom-color: #344537; }
td { color: #c5d2c7; border-bottom-color: #29372c; }
td strong { color: var(--paper); }
td small { color: #9dad9f; }
.numeric { color: var(--paper); }
.table-link, .text-link, .client-detail summary span { color: var(--signal); }
.pill-active { color: #a3ffc1; background: #17452a; }
.pill-paused { color: #ffca9f; background: #49301f; }
.client-list { border-top-color: #344537; }
.client-detail { border-bottom-color: #29372c; }
.client-detail summary { color: var(--paper); }
.back-link { color: #b6c8b9; }
.back-link:hover { color: var(--signal); }
.qr-artboard { background: #fff; border-color: #a8bbaa; border-radius: 2px; box-shadow: 0 16px 38px #0004; }
#qr-canvas { color: #67776b; }
.qr-help { color: #b1c1b3; }
.mini-metrics strong { color: var(--signal); }
.mini-metrics span { color: #afc0b1; }
.toggle-form { border-top-color: #344537; }
.text-button { color: #ffceab; }
.main-footer { color: #9eafa0; border-top: 1px solid #304034; margin-top: 2rem; }

@media (max-width: 980px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(365px, .9fr); }
  .auth-story-copy h1 { font-size: clamp(3.1rem, 5.6vw, 4.5rem); }
}
@media (max-width: 760px) {
  .auth-body { display: block; padding: 0; }
  .auth-layout { display: block; min-height: 100vh; border: 0; box-shadow: none; }
  .auth-story { padding: 1.2rem 1.5rem; border: 0; border-bottom: 1px solid #2a382d; }
  .auth-wordmark { width: 102px; }
  .auth-story-copy, .auth-story-footer, .auth-story::after, .auth-story::before { display: none; }
  .auth-card { min-height: calc(100vh - 110px); padding: 2rem 1.5rem 3rem; }
  .auth-emblem { margin-top: 2.5rem; }
  .auth-card-setup { min-height: 100vh; max-width: none; }
  .app-shell { display: block; }
  .sidebar { position: relative; height: auto; padding: .9rem 1rem; }
  .side-brand { padding: 0; }
  .side-section-label, .side-status { display: none; }
  .side-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; overflow: visible; margin-top: .85rem; padding-bottom: .2rem; }
  .side-nav a { min-width: 0; white-space: normal; line-height: 1.25; }
  .side-bottom { position: absolute; top: .55rem; right: 1rem; }
  .main-content { padding: 0 1rem; }
  .main-topbar { gap: .75rem; }
  .topbar-date { display: none; }
  .page-heading { align-items: start; flex-direction: column; padding: 2.2rem 0 1.8rem; }
  .overview-heading::after { display: none; }
  .header-cta { align-self: stretch; }
  .filter-row { flex-wrap: wrap; }
  .filter-row > span { display: none; }
  .detail-layout { grid-template-columns: 1fr; }
  .main-footer { display: grid; line-height: 1.5; }
}
@media (max-width: 460px) {
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-topbar > .kicker { font-size: .59rem; letter-spacing: .06em; }
  .theme-switch button { padding: .35rem .43rem; font-size: .6rem; }
  .stats-grid { gap: .5rem; }
  .stat-card { min-height: 130px; padding: .85rem; }
  .stat-card > span { font-size: .56rem; }
  .stat-card strong { font-size: 1.9rem; }
  .stat-card small { font-size: .62rem; }
  .panel { padding: 1rem; }
  .page-heading h1 { font-size: 2.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
