:root {
  --font-sans:
    "Geist", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-mono:
    "Geist Mono", "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono",
    ui-monospace, monospace;
  --bg: #07090d;
  --surface-1: #0d1118;
  --surface-2: #111827;
  --surface-3: #172033;
  --panel: var(--surface-1);
  --panel-soft: var(--surface-2);
  --ink: #f8fafc;
  --text: var(--ink);
  --muted: #9ca3af;
  --muted-strong: #cbd5e1;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(186, 230, 253, 0.22);
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --accent-3: #f59e0b;
  --blue: var(--accent);
  --green: var(--accent-2);
  --amber: #a16207;
  --red: #b42318;
  --teal: #0f766e;
  --violet: #6d28d9;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --shadow-strong: 0 24px 80px rgba(0, 0, 0, 0.42);
  --focus-ring: 0 0 0 3px rgba(56, 189, 248, 0.28);
  --hero: #0b1220;
  --hero-line: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #07090d 0%, #0b0f17 48%, #090b10 100%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  text-rendering: geometricPrecision;
}

button,
table {
  font: inherit;
}

button {
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

code,
.rank,
.feature-card > strong,
.scale-number,
.hero-insight-card strong,
.bar-meta span,
.stat-block strong,
.trend-up,
.trend-down {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.app-shell {
  min-height: 100vh;
}

.top-shell {
  display: block;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  min-height: 70px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(7, 9, 13, 0.88)),
    rgba(7, 9, 13, 0.86);
  color: var(--ink);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.brand:hover h1 {
  color: #ffffff;
}

.brand:hover .brand-logo {
  opacity: 0.96;
}

.brand-logo {
  display: block;
  width: 164px;
  height: auto;
  object-fit: contain;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.panel p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.15;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.nav-tabs {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.nav-tab:hover {
  transform: translateY(-1px);
}

.nav-tab[hidden] {
  display: none !important;
}

.nav-tab:hover,
.nav-tab.active {
  border-color: rgba(125, 211, 252, 0.28);
  background: rgba(56, 189, 248, 0.11);
  color: #ffffff;
}

.nav-tab.active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-label {
  white-space: nowrap;
}

.main {
  min-width: 0;
  max-width: 1220px;
  margin: 0 auto;
  padding: 32px 30px 46px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
}

.topbar.periodless #period-title,
.topbar.periodless .topbar-controls {
  display: none;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pill,
.source-type {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  white-space: nowrap;
}

.topbar-controls {
  position: relative;
  display: grid;
  grid-template-columns: minmax(184px, auto) minmax(320px, 1fr);
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  align-self: start;
}

.period-tabs,
.metric-tabs {
  display: inline-grid;
  gap: 4px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.period-tabs {
  grid-template-columns: repeat(5, minmax(72px, 1fr));
}

.metric-tabs {
  grid-template-columns: repeat(2, minmax(92px, 1fr));
}

.period-tab,
.metric-tab {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.period-tab:hover,
.period-tab.active,
.metric-tab:hover,
.metric-tab.active {
  background: linear-gradient(180deg, #f8fafc, #dbeafe);
  color: #075985;
  box-shadow: 0 8px 18px rgba(56, 189, 248, 0.16);
}

.custom-period-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(132px, 1fr) auto minmax(132px, 1fr) auto;
  align-items: end;
  gap: 10px;
  width: min(560px, 100%);
  padding: 12px;
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(56, 189, 248, 0.12), rgba(15, 23, 42, 0.96)),
    #0f172a;
  box-shadow: var(--shadow-strong);
}

.custom-period-popover[hidden] {
  display: none;
}

.custom-period-popover label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.custom-period-popover input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #050607;
  color-scheme: light;
}

.custom-period-popover > span {
  align-self: center;
  color: var(--muted);
}

.custom-period-popover button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #f8fafc;
  color: #050607;
  font-weight: 900;
  cursor: pointer;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
    var(--panel);
  box-shadow: var(--shadow);
}

.content-grid {
  display: grid;
  gap: 18px;
}

.two-columns {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.setting-grid {
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel:hover {
  border-color: rgba(186, 230, 253, 0.24);
}

.onboarding-status {
  margin-bottom: 18px;
}

.onboarding-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.1), transparent 46%),
    var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.onboarding-card.connected {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(460px, 1.25fr) auto;
  border-color: rgba(34, 197, 94, 0.28);
}

.onboarding-card.private {
  border-color: rgba(148, 163, 184, 0.2);
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.08), transparent 46%),
    var(--surface-2);
}

.onboarding-card h3,
.onboarding-card p {
  margin: 0;
}

.onboarding-card h3 {
  font-size: 18px;
}

.onboarding-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.onboarding-card p:last-child {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.onboarding-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(147, 197, 253, 0.36);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.2);
  color: #dbeafe;
  font-weight: 800;
  cursor: pointer;
}

.onboarding-actions button:hover,
.profile-form button:hover,
.auth-form button:hover,
.command-row button:hover {
  transform: translateY(-1px);
}

.onboarding-actions .secondary-action {
  border-color: var(--line);
  background: rgba(15, 23, 42, 0.72);
  color: var(--muted);
}

.collector-status {
  display: grid;
  justify-self: start;
  gap: 8px;
  width: min(560px, 100%);
  min-width: min(460px, 100%);
  max-width: 560px;
  flex: 0 1 520px;
}

.collector-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
}

.collector-status-head span {
  font-size: 12px;
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
}

.status-badge.active {
  border-color: rgba(34, 197, 94, 0.34);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.collector-status-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr);
  gap: 8px;
}

.collector-status-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.09), transparent 62%),
    rgba(15, 23, 42, 0.58);
}

.collector-status-item span,
.collector-status-note {
  color: var(--muted);
  font-size: 12px;
}

.collector-status-item strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collector-status-note {
  margin: 0;
}

.collector-update-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
}

.collector-update-notice strong,
.collector-update-notice span {
  display: block;
}

.collector-update-notice strong {
  color: #fde68a;
  font-size: 12px;
}

.collector-update-notice span {
  margin-top: 2px;
  color: #d6d3d1;
  font-size: 11px;
}

.collector-update-notice code {
  display: block;
  overflow-wrap: anywhere;
  min-width: 0;
  padding: 6px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  font-size: 10px;
  line-height: 1.4;
  white-space: normal;
}

.collector-update-command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.collector-update-command-row button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(147, 197, 253, 0.34);
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.18);
  color: #dbeafe;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.collector-update-command-row button.copied {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.scale-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr);
  gap: 18px;
  margin-bottom: 20px;
  padding: 26px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(245, 158, 11, 0.1), transparent 28%),
    linear-gradient(135deg, rgba(56, 189, 248, 0.13), transparent 38%),
    linear-gradient(180deg, #101827 0%, #0d1118 100%);
  color: #f8fafc;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.scale-hero-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 260px;
}

.hero-kicker,
.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta-row {
  margin-top: 18px;
}

.hero-kicker span,
.hero-meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(186, 230, 253, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 700;
}

.scale-hero h3 {
  margin: 16px 0 10px;
  font-size: 58px;
  line-height: 1;
  letter-spacing: 0;
}

.scale-hero p {
  max-width: 680px;
  margin: 0;
  color: #cbd5e1;
  line-height: 1.6;
}

.scale-hero-side {
  display: grid;
  gap: 12px;
}

.hero-insight-card {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid rgba(186, 230, 253, 0.16);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero-insight-card.primary {
  border-color: rgba(56, 189, 248, 0.34);
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.16), transparent 58%),
    rgba(15, 23, 42, 0.68);
}

.hero-insight-card .eyebrow {
  color: #93c5fd;
}

.hero-insight-card strong {
  display: block;
  color: #fff;
  font-size: 24px;
  line-height: 1.05;
}

.hero-insight-card span {
  color: #cbd5e1;
  font-size: 13px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel h3 {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.25;
}

.pill {
  padding: 4px 10px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.pill.muted {
  background: #f1f5f9;
  color: #475569;
}

.definition-box {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.definition-box strong {
  color: var(--ink);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 112px;
  padding: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.54);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 15px;
}

.empty-state span {
  max-width: 420px;
  font-size: 13px;
  line-height: 1.5;
}

.bar-list,
.stack-list,
.tool-share {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.bar-meta strong {
  color: var(--ink);
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: rgba(15, 23, 42, 0.9);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

td {
  font-size: 14px;
}

tbody tr:hover {
  background: rgba(56, 189, 248, 0.055);
}

.rank {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 28px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.54);
  color: #f8fafc;
  font-weight: 800;
}

.rank-gold {
  border-color: rgba(250, 204, 21, 0.3);
  background: rgba(250, 204, 21, 0.1);
  color: #facc15;
}

.rank-silver {
  border-color: rgba(203, 213, 225, 0.26);
  background: rgba(203, 213, 225, 0.08);
  color: #cbd5e1;
}

.rank-bronze {
  border-color: rgba(217, 119, 6, 0.3);
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
}

.board-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
  gap: 12px;
  margin-bottom: 16px;
}

.feature-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--panel-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.feature-card h4 {
  margin: 4px 0 6px;
  font-size: 22px;
  line-height: 1.2;
}

.feature-card span {
  color: var(--muted);
  font-size: 13px;
}

.feature-card > strong {
  flex: 0 0 auto;
  font-size: 28px;
  line-height: 1;
}

.dark-feature {
  border-color: rgba(125, 211, 252, 0.24);
  background:
    linear-gradient(90deg, rgba(245, 158, 11, 0.1), transparent 40%),
    linear-gradient(135deg, rgba(56, 189, 248, 0.16), transparent 62%),
    linear-gradient(180deg, #121a2a, #0f172a);
  color: #f8fafc;
}

.dark-feature .eyebrow,
.dark-feature span {
  color: #cbd5e1;
}

.trend-up {
  color: var(--green);
  font-weight: 700;
}

.trend-down {
  color: var(--red);
  font-weight: 700;
}

.trend-neutral {
  color: var(--muted);
  font-weight: 700;
}

.source-type {
  gap: 6px;
  width: fit-content;
  padding: 4px 10px;
  background: rgba(103, 232, 249, 0.14);
  color: #a5f3fc;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.source-type.measured {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.source-type.estimated {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
}

.tier-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: 8px;
  vertical-align: middle;
}

.tier-emoji {
  font-size: 34px;
  line-height: 1;
}

.division-elite {
  width: 48px;
  height: 48px;
}

.division-elite .tier-emoji {
  font-size: 38px;
}

.compact-tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

.compact-tier .tier-icon {
  width: 30px;
  height: 30px;
  margin-left: 0;
}

.compact-tier .tier-emoji {
  font-size: 24px;
}

.personal-tier-badge {
  display: inline-grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 88px;
}

.personal-tier-image {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.personal-tier-image .tier-icon {
  width: 26px;
  height: 26px;
  margin-left: 0;
}

.personal-tier-image .tier-emoji {
  font-size: 22px;
}

.personal-tier-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.personal-tier-label strong,
.personal-tier-label small {
  display: block;
}

.personal-tier-label strong {
  color: var(--text);
  font-size: 14px;
}

.personal-tier-label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tool-policy-table {
  min-width: 1040px;
  table-layout: fixed;
}

.tool-policy-table th,
.tool-policy-table td {
  white-space: normal;
  vertical-align: top;
}

.tool-policy-table td {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.tool-policy-table td:first-child {
  color: var(--text);
}

.tool-policy-table th:nth-child(1),
.tool-policy-table td:nth-child(1) {
  width: 98px;
}

.tool-policy-table th:nth-child(2),
.tool-policy-table td:nth-child(2) {
  width: 178px;
}

.tool-policy-table th:nth-child(3),
.tool-policy-table td:nth-child(3) {
  width: 205px;
}

.tool-policy-table th:nth-child(4),
.tool-policy-table td:nth-child(4) {
  width: 210px;
}

.tool-policy-table th:nth-child(5),
.tool-policy-table td:nth-child(5) {
  width: 190px;
}

.tool-policy-table th:nth-child(6),
.tool-policy-table td:nth-child(6) {
  width: 150px;
  white-space: nowrap;
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--hero-line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(34, 197, 94, 0.1), transparent 32%),
    linear-gradient(135deg, rgba(56, 189, 248, 0.12), transparent 58%),
    linear-gradient(180deg, #101827 0%, #0d1118 100%);
  color: #f8fafc;
  box-shadow: var(--shadow);
}

.guide-hero .eyebrow {
  color: #93c5fd;
}

.guide-hero h3 {
  margin: 6px 0 10px;
  font-size: 28px;
}

.guide-hero p {
  max-width: 680px;
  color: #cbd5e1;
  line-height: 1.6;
}

.quickstart-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--hero-line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
}

.quickstart-box span {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quickstart-box p {
  margin: 0 0 2px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.5;
}

.quickstart-secondary {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hero-line);
}

.quickstart-box .quickstart-subtitle {
  color: #94a3b8;
}

.command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
}

.command-row code {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.58);
  overflow-wrap: anywhere;
  color: #e0f2fe;
  font-size: 13px;
  line-height: 1.5;
}

.primary-command code {
  border-color: rgba(59, 130, 246, 0.38);
  background: rgba(15, 23, 42, 0.82);
}

.command-row button {
  min-width: 58px;
  border: 1px solid rgba(147, 197, 253, 0.36);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.18);
  color: #dbeafe;
  font-weight: 800;
  cursor: pointer;
}

.command-row button:hover {
  background: rgba(59, 130, 246, 0.28);
}

.command-row button.copied {
  border-color: rgba(34, 197, 94, 0.52);
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.quickstart-note {
  color: #94a3b8;
}

.tier-guide-panel {
  margin-bottom: 18px;
}

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

.tier-guide-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  transition:
    border-color 0.16s ease,
    transform 0.16s ease;
}

.tier-guide-card:hover {
  border-color: rgba(186, 230, 253, 0.26);
  transform: translateY(-1px);
}

.tier-guide-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tier-guide-head .tier-icon {
  width: 58px;
  height: 58px;
  margin-left: 0;
}

.tier-guide-head .tier-emoji {
  font-size: 46px;
}

.tier-guide-head strong,
.tier-guide-head span {
  display: block;
}

.tier-guide-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.tier-guide-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.stat-block,
.share-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

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

.identity-panel {
  background:
    linear-gradient(180deg, rgba(148, 163, 184, 0.08), transparent 42%),
    var(--panel);
  border-color: rgba(255, 255, 255, 0.08);
}

.stat-block {
  padding: 14px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.stat-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.stat-block span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat-block strong {
  display: block;
  margin-top: 7px;
  font-size: 22px;
}

.my-tool-summary {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.my-tool-summary-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.85fr) minmax(70px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.my-tool-summary-row span {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-tool-summary-row em {
  color: var(--ink);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.my-tool-summary-empty {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.stat-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.stat-block.wide {
  grid-column: 1 / -1;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.12), transparent 60%),
    var(--panel-soft);
}

.usage-stat {
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.12), transparent 62%),
    var(--panel-soft);
}

.stat-block.wide .tier-icon {
  width: 58px;
  height: 58px;
  margin: 0 8px 0 0;
}

.stat-block.wide .tier-emoji {
  font-size: 46px;
}

.settings-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%),
    rgba(7, 8, 10, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.settings-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(186, 230, 253, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  color: #e0f2fe;
  font-size: 24px;
  font-weight: 900;
}

.settings-card-head span,
.settings-card-head p {
  color: var(--muted);
}

.settings-card-head span {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.settings-card-head strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.settings-card-head p {
  margin-top: 4px;
  font-size: 13px;
}

.profile-form {
  display: grid;
  gap: 12px;
}

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

.wide-field {
  grid-column: 1 / -1;
}

.input-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.input-copy-button {
  min-width: 58px;
  padding: 0 12px !important;
  border: 1px solid var(--line) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--ink) !important;
}

.input-copy-button:hover,
.input-copy-button.copied {
  border-color: rgba(56, 189, 248, 0.5) !important;
  background: rgba(56, 189, 248, 0.16) !important;
}

.settings-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.danger-zone {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(248, 113, 113, 0.24);
}

.danger-zone strong {
  color: #f87171;
  font-size: 14px;
}

.danger-zone p {
  max-width: 620px;
  color: #fca5a5;
  font-size: 12px;
  line-height: 1.45;
}

.danger-action {
  justify-self: start;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(248, 113, 113, 0.44);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
  font-weight: 900;
}

.danger-action:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.auth-panel {
  max-width: 560px;
  margin: 0 auto;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.profile-form label,
.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.profile-form input,
.profile-form select,
.auth-form input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  outline: none;
}

.profile-form select {
  background: #f8fafc;
  color: #050607;
  color-scheme: light;
}

.profile-form input:focus,
.profile-form select:focus,
.auth-form input:focus {
  border-color: rgba(56, 189, 248, 0.7);
  background: rgba(255, 255, 255, 0.08);
}

.profile-form select:focus {
  background: #ffffff;
  color: #050607;
}

.profile-form select option,
.profile-form select optgroup {
  background: #f8fafc !important;
  color: #050607 !important;
}

.tool-selection {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-selection legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.tool-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.tool-checkbox {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink) !important;
}

.tool-checkbox:hover {
  border-color: rgba(186, 230, 253, 0.22);
  background: rgba(255, 255, 255, 0.065);
}

.tool-checkbox input {
  width: 16px;
  height: 16px;
}

.profile-form button,
.auth-form button {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: #f8fafc;
  color: #050607;
  font-weight: 800;
  cursor: pointer;
}

.secondary-action {
  border: 1px solid var(--line) !important;
  background: transparent !important;
  color: var(--ink) !important;
}

.secondary-action:hover {
  border-color: rgba(186, 230, 253, 0.24) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.profile-form button:disabled,
.auth-form button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.profile-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.profile-status.success {
  color: var(--green);
}

.profile-status.error {
  color: var(--red);
}

.level-progress {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.level-progress-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.analysis-panel {
  grid-column: 1 / -1;
  min-height: 300px;
}

.analysis-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.analysis-summary article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.analysis-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.analysis-summary strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 22px;
}

.analysis-summary em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;
}

.my-usage-chart {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 300px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(15, 23, 42, 0.52);
}

.my-usage-line-chart {
  width: 100%;
  height: 230px;
  overflow: visible;
}

.usage-area {
  fill: rgba(34, 197, 94, 0.13);
}

.usage-line {
  fill: none;
  stroke: #22c55e;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  filter: drop-shadow(0 8px 18px rgba(34, 197, 94, 0.22));
}

.usage-point {
  fill: #bbf7d0;
  stroke: #102a18;
  stroke-width: 2;
}

.usage-point-group {
  outline: none;
}

.usage-point-group:hover .usage-point,
.usage-point-group:focus .usage-point {
  fill: #f0fdf4;
  stroke: #39d353;
  stroke-width: 3;
}

.usage-point-hit {
  cursor: crosshair;
  fill: transparent;
}

.usage-axis-labels {
  display: grid;
  grid-template-columns: repeat(var(--usage-day-count), minmax(0, 1fr));
  color: var(--muted);
  font-size: 11px;
}

.usage-axis-labels span {
  min-width: 0;
}

.usage-axis-labels span:nth-child(2) {
  text-align: center;
}

.usage-axis-labels span:last-child {
  text-align: right;
}

.usage-heatmap-wrap {
  display: flex;
  justify-content: flex-start;
  overflow: hidden;
}

.usage-activity-section {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.usage-activity-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.usage-activity-head strong {
  color: var(--ink);
  font-size: 13px;
}

.usage-activity-head span {
  color: var(--muted);
  font-size: 11px;
}

.usage-heatmap {
  --heat-cell-size: clamp(4px, calc((100vw - 210px) / 56), 10px);
  display: grid;
  grid-template-rows: repeat(7, var(--heat-cell-size));
  grid-auto-flow: column;
  grid-auto-columns: var(--heat-cell-size);
  gap: 2px;
}

.usage-heat-dates {
  --heat-cell-size: clamp(4px, calc((100vw - 210px) / 56), 10px);
  display: grid;
  grid-template-columns: repeat(var(--usage-week-count), var(--heat-cell-size));
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
}

.usage-heat-dates span:last-child {
  text-align: right;
}

.usage-heat-cell {
  display: block;
  min-width: 0;
  width: var(--heat-cell-size);
  height: var(--heat-cell-size);
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: 2px;
  background: #f8fafc;
  outline: none;
}

.usage-heat-cell.level-1 {
  background: #0e4429;
}

.usage-heat-cell.level-2 {
  background: #006d32;
}

.usage-heat-cell.level-3 {
  background: #26a641;
}

.usage-heat-cell.level-4 {
  background: #39d353;
}

.analysis-tooltip {
  position: fixed;
  z-index: 10;
  display: none;
  width: max-content;
  max-width: 260px;
  transform: translate(-50%, calc(-100% - 12px));
  padding: 6px 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 6px;
  background: #05070b;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.analysis-tooltip.visible {
  display: block;
}

.analysis-tooltip b {
  display: block;
  margin-bottom: 6px;
  white-space: nowrap;
}

.analysis-tooltip-list {
  display: grid;
  gap: 4px;
}

.analysis-tooltip-list span {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) auto;
  gap: 12px;
}

.analysis-tooltip-list em {
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-heat-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.usage-heat-legend span {
  color: var(--muted);
  font-size: 11px;
}

.usage-heat-legend .usage-heat-cell {
  --heat-cell-size: 12px;
  width: 12px;
  height: 12px;
}

.stack-item {
  display: grid;
  grid-template-columns: 132px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.share-card {
  padding: 12px;
}

.share-card strong {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

.share-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.level-up-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
}

.level-up-fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.level-up-firework-burst {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: 0;
  height: 0;
}

.level-up-spark {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--size);
  height: var(--size);
  border-radius: 999px;
  background: var(--spark);
  box-shadow: 0 0 18px var(--spark);
  transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(0);
  animation: level-up-burst 1080ms ease-out var(--delay) both;
}

.level-up-card {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(147, 197, 253, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(56, 189, 248, 0.14), transparent 42%),
    linear-gradient(135deg, #0b0d10, #111827);
  box-shadow: var(--shadow-strong);
  text-align: center;
}

.level-up-kicker {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.level-up-icon {
  margin: 12px 0;
  font-size: 72px;
  line-height: 1;
}

.level-up-card strong {
  font-size: 28px;
}

.level-up-card p {
  margin: 10px 0 18px;
  color: #cbd5e1;
  line-height: 1.5;
}

.level-up-card button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: #f8fafc;
  color: #050607;
  font-weight: 800;
  cursor: pointer;
}

@keyframes level-up-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(0.5);
  }

  12% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--distance)) scale(0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .level-up-spark {
    animation: none;
    opacity: 0;
  }
}

@media (max-width: 1120px) {
  .site-nav {
    grid-template-columns: 1fr;
    padding: 14px 18px;
  }

  .nav-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .tier-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scale-hero,
  .guide-hero {
    grid-template-columns: 1fr;
  }

  .board-feature {
    grid-template-columns: 1fr;
  }

  .two-columns {
    grid-template-columns: 1fr;
  }

  .setting-grid {
    grid-template-columns: 1fr;
  }

  .settings-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-nav {
    gap: 12px;
  }

  .brand-logo {
    width: 128px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    font-size: 12px;
  }

  .nav-tab {
    min-height: 38px;
    padding: 0 11px;
  }

  .nav-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    overflow-x: visible;
  }

  .nav-icon {
    font-size: 16px;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .panel-header,
  .onboarding-card {
    align-items: stretch;
    flex-direction: column;
  }

  .onboarding-card.connected {
    grid-template-columns: 1fr;
  }

  .onboarding-actions {
    justify-content: stretch;
  }

  .onboarding-actions button {
    flex: 1 1 150px;
  }

  .collector-status {
    min-width: 0;
    width: 100%;
    max-width: none;
    flex: none;
  }

  .collector-status-grid {
    grid-template-columns: 1fr;
  }

  .tier-guide,
  .my-stats {
    grid-template-columns: 1fr;
  }

  .topbar h2 {
    font-size: 22px;
  }

  .topbar-controls,
  .period-tabs,
  .metric-tabs {
    width: 100%;
  }

  .topbar-controls {
    grid-template-columns: 1fr;
  }

  .period-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scale-hero {
    padding: 18px;
  }

  .scale-hero-main {
    min-height: 0;
  }

  .scale-hero h3 {
    font-size: 38px;
  }

  .hero-meta-row span {
    flex: 1 1 150px;
    justify-content: center;
  }

  .feature-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .feature-card > strong {
    font-size: 24px;
  }

  .table-wrap {
    scrollbar-color: rgba(125, 211, 252, 0.44) rgba(15, 23, 42, 0.72);
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding: 12px 10px;
  }

  .stack-item {
    grid-template-columns: 1fr;
  }

  .custom-period-popover,
  .analysis-summary {
    grid-template-columns: 1fr;
  }

  .my-tool-summary-row {
    grid-template-columns: 1fr;
  }

  .profile-form {
    grid-template-columns: 1fr;
  }
}

.api-error-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 10px 16px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.18);
  color: #fca5a5;
  font-size: 13px;
  text-align: center;
}

.api-error-banner[hidden] {
  display: none;
}
