:root {
  /* Stone & charcoal — quiet luxury */
  --bg: #F6F5F2;
  --bg-subtle: #EFEDE8;
  --bg-elevated: #FFFFFF;
  --bg-overlay: #FFFFFF;
  
  --text: #141414;
  --text-strong: #141414;
  --text-soft: #5C5C62;
  --text-faint: #8A8A8F;
  
  --border: #E4E2DD;
  --border-light: #ECEAE5;
  --border-faint: #F0EEEA;
  
  --sidebar-bg: #000;
  --sidebar-bg-2: #141414;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #F5F5F4;
  --sidebar-text-muted: #A1A1AA;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(255, 255, 255, 0.08);
  --sidebar-active-border: #F5F5F4;
  
  --accent: #1E3A5F;
  --accent-hover: #152A45;
  --accent-active: #0F1F33;
  --accent-bg: #EEF2F6;
  --accent-border: #C5D0DC;
  --primary-btn: #141414;
  --primary-btn-hover: #2A2A2E;
  
  --success: #166534;
  --success-bg: #ECFDF3;
  --success-border: #BBF7D0;
  --warning: #92400E;
  --warning-bg: #FFFBEB;
  --warning-border: #FDE68A;
  --critical: #991B1B;
  --critical-bg: #FEF2F2;
  --critical-border: #FECACA;
  --info: #1E3A5F;
  --info-bg: #EEF2F6;
  --info-border: #C5D0DC;
  
  --shadow-xs: 0 1px 2px rgba(20, 20, 20, 0.04);
  --shadow-sm: 0 1px 3px rgba(20, 20, 20, 0.06);
  --shadow-md: 0 4px 12px rgba(20, 20, 20, 0.06);
  --shadow-lg: 0 8px 24px rgba(20, 20, 20, 0.08);
  --shadow-xl: 0 12px 32px rgba(20, 20, 20, 0.08);
  
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-2xl: 12px;
  
  /* Spacing system - refined rhythm */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 20px;
  --space-7: 24px;
  --space-8: 32px;
  --space-9: 40px;
  --space-10: 48px;
  --space-11: 56px;
  --space-12: 64px;
  
  /* Typography scale */
  --font-xs: 12px;
  --font-sm: 13px;
  --font-base: 14px;
  --font-md: 16px;
  --font-lg: 18px;
  --font-xl: 20px;
  --font-2xl: 24px;
  --font-3xl: 30px;
  --font-4xl: 36px;
  --font-5xl: 42px;
  --font-6xl: 48px;
  
  /* Content widths */
  --width-max: 1480px;
  --width-content: 1280px;
  --width-form: 680px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  height: 100%;
  width: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--font-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.display-serif {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  letter-spacing: -0.02em;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--font-5xl);
  line-height: 1.1;
  font-weight: 700;
}

h2 {
  font-size: var(--font-2xl);
  line-height: 1.3;
}

h3 {
  font-size: var(--font-lg);
  line-height: 1.4;
}

p {
  margin: 0;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

input, textarea, select {
  font: inherit;
}

/* App Shell */
.app-shell {
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: 1fr;
  overflow: hidden;
}

/* Sidebar Navigation */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  border-right: 1px solid var(--sidebar-border);
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 260px;
}

.sidebar-premium {
  box-shadow: none;
}

.sidebar-top {
  padding: var(--space-2) var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: var(--space-1);
}

.sidebar > * {
  min-width: 0;
  flex-shrink: 0;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: var(--font-xl);
  line-height: 1.1;
  text-decoration: none;
  transition: opacity 200ms;
  min-width: 0;
}

.brand:hover {
  opacity: 0.88;
}

.brand-mark {
  flex-shrink: 0;
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: none;
  align-self: baseline;
}

.brand-text {
  display: inline-block;
  min-width: 0;
  line-height: inherit;
  margin-top: 4px;
  margin-left: -4px;
}

.brand-name {
  font-size: inherit;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: inherit;
  text-wrap: balance;
}

.brand-tagline {
  display: block;
  margin-top: 2px;
  font-size: var(--font-xs);
  color: var(--text-faint);
  line-height: 1.4;
}

.brand--dark .brand-name {
  color: #ffffff;
}

.brand--dark .brand-tagline {
  color: var(--sidebar-text-muted);
}

.brand--light .brand-name {
  color: var(--text-strong);
}

.brand--light .brand-tagline {
  color: var(--text-soft);
}

.brand-copy {
  font-size: var(--font-xs);
  color: var(--sidebar-text-muted);
  line-height: 1.5;
}

.sidebar .brand-text{
  margin-top: 2px;
}

/* Mobile top bar */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 56px;
  padding: max(var(--space-3), env(safe-area-inset-top)) var(--space-4) var(--space-3) var(--space-5);
  background: #000;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mobile-topbar .brand {
  min-width: 0;
  flex: 1;
  font-size: var(--font-lg);
}

.mobile-topbar .brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-topbar .brand-tagline {
  display: none;
}

.mobile-menu-btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  gap: 5px;
  padding: 16px;
  justify-content: center;
  align-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 999px;
  transition: transform 200ms ease, opacity 200ms ease;
}

.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

body.mobile-nav-open {
  overflow: hidden;
}

body.mobile-nav-open .mobile-nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.mobile-nav-open .mobile-menu-btn span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.mobile-nav-open .mobile-menu-btn span:nth-child(2) {
  opacity: 0;
}

body.mobile-nav-open .mobile-menu-btn span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Sidebar groups */
.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex-shrink: 0;
  min-height: 0;
}

.sidebar-nav-group {
  flex: 1;
  min-height: 0;
}

.sidebar-label {
  font-size: var(--font-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sidebar-text-muted);
  padding: 0 var(--space-3);
}

/* Navigation */
.nav {
  display: grid;
  gap: var(--space-2);
}

.nav-premium {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: var(--space-5);
}

.nav-section {
  display: grid;
  gap: var(--space-1);
}

.nav-cta-wrap {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--sidebar-border);
}

.nav-premium .nav-item,
.nav-premium .nav-cta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--sidebar-text-muted);
  transition: 140ms ease-in-out;
  text-decoration: none;
  font-size: var(--font-sm);
  font-weight: 500;
  border: 1px solid transparent;
  min-width: 0;
}

.nav-premium .nav-item:hover,
.nav-premium .nav-cta:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.nav-premium .nav-item.active {
  background: var(--sidebar-active);
  color: #ffffff;
}

.nav-premium .nav-cta {
  background: #F6F5F2;
  color: #141414;
  font-weight: 600;
  border-color: transparent;
}

.nav-premium .nav-cta:hover {
  background: #ffffff;
  color: #141414;
}

.nav-premium .nav-cta.active {
  background: #ffffff;
  color: #141414;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.nav-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
}

.nav-premium .nav-item.active .nav-icon,
.nav-premium .nav-cta .nav-icon {
  background: rgba(255, 255, 255, 0.1);
}

.nav-premium .nav-cta .nav-icon {
  background: rgba(20, 20, 20, 0.08);
  color: #141414;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.nav-label {
  min-width: 0;
  line-height: 1.3;
}

.nav:not(.nav-premium) a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  color: var(--sidebar-text-muted);
  transition: 140ms ease-in-out;
  text-decoration: none;
  font-size: var(--font-sm);
  min-width: 0;
  font-weight: 500;
}

.nav:not(.nav-premium) a:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.nav:not(.nav-premium) a.active {
  background: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--sidebar-active-border);
}

.nav-meta {
  font-size: var(--font-xs);
  color: var(--sidebar-text-muted);
  flex-shrink: 0;
  opacity: 0.8;
}

/* Workspace cards */
.workspace-card {
  margin-top: auto;
  padding: var(--space-5);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  display: grid;
  gap: var(--space-3);
  flex-shrink: 0;
}

.workspace-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: #ffffff;
}

.workspace-copy {
  font-size: var(--font-xs);
  color: var(--sidebar-text-muted);
  line-height: 1.5;
}

/* Sidebar footer */
.sidebar-foot {
  margin-top: auto;
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: var(--space-4);
  flex-shrink: 0;
}

.user-chip {
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.user-chip strong {
  font-size: var(--font-sm);
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2A2A2E;
  color: #fff;
  font-size: var(--font-sm);
  font-weight: 600;
  flex-shrink: 0;
}

.user-chip-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-chip span {
  font-size: var(--font-xs);
  color: var(--sidebar-text-muted);
}

.sidebar-foot-copy {
  font-size: var(--font-xs);
  color: var(--sidebar-text-muted);
  line-height: 1.5;
}

.powered-by {
  font-size: var(--font-xs);
  line-height: 1.5;
  color: var(--text-faint);
}

.powered-by a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.powered-by a:hover {
  text-decoration: underline;
}

.powered-by--dark {
  color: var(--sidebar-text-muted);
}

.powered-by--dark a {
  color: #E4E2DD;
}

.powered-by--dark a:hover {
  color: #ffffff;
}

.sidebar-foot-actions {
  display: grid;
  gap: var(--space-3);
}

/* Main content area */
.main {
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--bg);
}

.content-wrap {
  display: grid;
  gap: var(--space-9);
  width: 100%;
  max-width: var(--width-max);
  margin: 0 auto;
  padding: var(--space-9) var(--space-8);
  min-width: 0;
}

/* Page header */
.page-header {
  display: grid;
  gap: var(--space-5);
  min-width: 0;
}

.page-header-main {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.breadcrumb {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  font-size: var(--font-xs);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  flex-wrap: wrap;
}

.breadcrumb span::after {
  content: "/";
  margin-left: var(--space-3);
  opacity: 0.5;
}

.breadcrumb span:last-child::after {
  content: "";
  margin: 0;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--accent);
}

.page-kicker::before {
  content: "";
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
  flex-shrink: 0;
}

.page-title {
  font-size: clamp(var(--font-3xl), 5vw, var(--font-6xl));
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--text-strong);
}

.page-copy {
  font-size: var(--font-md);
  color: var(--text-soft);
  line-height: 1.6;
  max-width: 680px;
  text-wrap: pretty;
}

.page-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  align-items: center;
  margin-top: var(--space-4);
}

/* Grid layouts */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: var(--space-6);
  min-width: 0;
}

.two-column {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-6);
  min-width: 0;
  align-items: start;
}

.job-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: var(--space-6);
  min-width: 0;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-6);
  min-width: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-6);
  min-width: 0;
}

/* Cards and panels */
.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: var(--space-7);
  min-width: 0;
  overflow: hidden;
  transition: box-shadow 200ms ease;
  display: flex;
  flex-direction: column;
}

.panel:hover {
  box-shadow: var(--shadow-sm);
}

.panel-muted {
  background: var(--bg-subtle);
}

.panel-head {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  align-items: start;
  justify-content: space-between;
}

.panel-title {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.3;
}

.panel-subtitle {
  font-size: var(--font-sm);
  color: var(--text-soft);
  line-height: 1.5;
}

.panel-link {
  color: var(--accent);
  font-weight: 600;
  font-size: var(--font-sm);
  transition: 140ms ease;
}

.panel-link:hover {
  color: var(--accent-hover);
}

/* Stat cards */
.stat-card {
  display: grid;
  gap: var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: all 200ms ease;
  overflow: hidden;
}

.stat-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.stat-label {
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.stat-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--font-xs);
  flex-shrink: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.stat-value {
  font-size: clamp(var(--font-2xl), 3vw, var(--font-4xl));
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-strong);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.stat-value.small {
  font-size: var(--font-lg);
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  display: block;
  max-width: 100%;
}

.metric-meta {
  font-size: var(--font-xs);
  color: var(--text-faint);
  line-height: 1.5;
}

/* List cards */
.stack-list {
  display: grid;
  gap: var(--space-4);
}

.list-card,
.report-link {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  transition: all 140ms ease;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}

.report-link strong {
  font-size: var(--font-sm);
  color: var(--text-strong);
}

.report-link span {
  font-size: var(--font-xs);
  color: var(--text-faint);
  line-height: 1.5;
}

.report-link:hover {
  border-color: var(--accent-border);
  background: var(--bg-subtle);
}

.report-link.active {
  border-color: var(--border);
  background: var(--bg-subtle);
  box-shadow: inset 3px 0 0 var(--primary-btn);
}

.list-card:hover,
.report-link:hover {
  border-color: var(--border);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-sm);
}

.list-card strong,
.report-link strong {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-strong);
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.list-card span,
.report-link span {
  font-size: var(--font-xs);
  color: var(--text-faint);
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.insight-card {
  padding: var(--space-5);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  display: grid;
  gap: var(--space-2);
  overflow: hidden;
}

.insight-card strong {
  font-size: var(--font-sm);
  color: var(--text-strong);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.insight-card span {
  font-size: var(--font-xs);
  color: var(--text-faint);
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Empty state */
.empty-state {
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  color: var(--text-faint);
  text-align: center;
  font-size: var(--font-sm);
  line-height: 1.6;
}

/* Toolbar and chips */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  min-width: 0;
}

.toolbar-group {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

.metric-chip {
  padding: var(--space-3) var(--space-4);
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-faint);
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* Status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  font-size: var(--font-xs);
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-completed {
  background: var(--success-bg);
  color: var(--success);
}

.status-running {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-queued {
  background: #f0f4f8;
  color: #344054;
}

.status-failed,
.status-partial {
  background: var(--critical-bg);
  color: var(--critical);
}

.status-pending {
  background: var(--info-bg);
  color: var(--info);
}

/* Tables */
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-sm);
  table-layout: auto;
}

.data-table thead th {
  background: var(--bg-subtle);
  color: var(--text-faint);
  text-align: left;
  font-size: var(--font-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.data-table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-faint);
  vertical-align: top;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 250px;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 140ms ease;
}

.data-table tbody tr:hover {
  background: var(--bg-subtle);
}

.table-primary {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.table-primary strong {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-strong);
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  display: block;
}

.table-primary span {
  font-size: var(--font-xs);
  color: var(--text-faint);
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  display: block;
  line-height: 1.4;
}

.table-date-sub {
  font-size: var(--font-xs);
  color: var(--text-faint);
}

/* Forms */
.field-grid {
  display: grid;
  gap: var(--space-5);
  min-width: 0;
}

.field-group {
  display: grid;
  gap: var(--space-2);
}

.field-group label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-strong);
  display: block;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: var(--font-sm);
  transition: all 140ms ease;
  box-shadow: var(--shadow-xs);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.helper-text,
.soft-text {
  font-size: var(--font-xs);
  color: var(--text-faint);
  line-height: 1.6;
  margin-top: var(--space-1);
}

/* Module grid */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.module-option {
  display: block;
  position: relative;
}

.module-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.module-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all 140ms ease;
  min-height: 140px;
  justify-content: space-between;
  overflow: hidden;
}

.module-option input:checked + .module-card {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 0 0 1px var(--accent-border);
}

.module-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.module-title {
  font-weight: 700;
  text-transform: capitalize;
  color: var(--text-strong);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.module-copy {
  font-size: var(--font-xs);
  color: var(--text-faint);
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Buttons */
.primary-button,
.ghost-button,
.primary-link,
.sidebar-logout {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
  text-decoration: none;
  outline: none;
  margin: 0;
  line-height: 1.5;
}

.primary-button,
.primary-link {
  background: var(--primary-btn);
  color: #ffffff;
  box-shadow: none;
  border: 1px solid var(--primary-btn);
}

.primary-button:hover,
.primary-link:hover {
  background: var(--primary-btn-hover);
  border-color: var(--primary-btn-hover);
  box-shadow: none;
}

.primary-button:focus-visible,
.primary-link:focus-visible,
.ghost-button:focus-visible,
.tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.primary-button:active,
.primary-link:active {
  background: var(--text-strong);
}

.ghost-button {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.ghost-button:hover {
  background: var(--bg-subtle);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.sidebar-logout {
  background: transparent;
  color: var(--sidebar-text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: var(--font-xs);
  padding: var(--space-2) var(--space-3);
}

.sidebar-logout:hover {
  background: var(--sidebar-hover);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Status boxes and callouts */
.status-box,
.callout {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-soft);
  font-size: var(--font-sm);
  line-height: 1.6;
}

.callout-accent {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--text-strong);
}

/* Report viewer */
.report-nav {
  display: grid;
  gap: var(--space-3);
}

.report-panel {
  display: grid;
  gap: var(--space-6);
  min-width: 0;
  min-height: 0;
}

.report-toolbar {
  display: grid;
  gap: var(--space-5);
}

.report-toolbar-head {
  display: grid;
  gap: var(--space-2);
}

.report-export-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, max-content);
  align-items: stretch;
  gap: var(--space-6);
  padding: var(--space-5) var(--space-6);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.report-export-group {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.report-export-label {
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.report-export-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.report-export-url {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-strong);
  font-size: var(--font-sm);
  line-height: 1.4;
  font-family: var(--font-mono, ui-monospace, monospace);
}

.report-export-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.report-export-downloads {
  flex-wrap: wrap;
}

.report-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-strong);
  font-size: var(--font-sm);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.report-export-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-soft);
}

.report-export-btn:hover {
  background: var(--bg);
  border-color: var(--border-strong, var(--border));
  color: var(--text-strong);
}

.report-export-btn-primary {
  background: var(--primary-btn);
  border-color: var(--primary-btn);
  color: #ffffff;
}

.report-export-btn-primary svg {
  color: rgba(255, 255, 255, 0.88);
}

.report-export-btn-primary:hover {
  background: var(--primary-btn-hover);
  border-color: var(--primary-btn-hover);
  color: #ffffff;
}

.report-export-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
}

.report-export-message {
  margin: 0;
  font-size: var(--font-sm);
  color: var(--success);
}

.report-share {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  max-width: 100%;
}

.share-url-input {
  min-width: min(320px, 100%);
  max-width: 360px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text-soft);
  font-size: var(--font-xs);
}

.report-share-btn {
  font-size: var(--font-xs);
  padding: var(--space-2) var(--space-4);
  white-space: nowrap;
}

.share-message {
  margin: 0 0 var(--space-3);
  color: var(--success);
}

.report-downloads {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.report-download-btn {
  font-size: var(--font-xs);
  padding: var(--space-2) var(--space-4);
  white-space: nowrap;
}

.sample-report-layout {
  margin-top: var(--space-2);
}

.auth-wrap-narrow {
  width: min(520px, 100%);
  grid-template-columns: 1fr;
}

.sidebar-login {
  width: 100%;
  justify-content: center;
}

.report-toolbar-meta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.report-toolbar-chip {
  padding: var(--space-3) var(--space-4);
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-faint);
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.report-body {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  min-height: 400px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.report-markup h1 {
  font-size: var(--font-2xl);
  margin: 0 0 var(--space-5) 0;
  color: var(--text-strong);
}

.report-markup h2 {
  font-size: var(--font-lg);
  margin: var(--space-6) 0 var(--space-3) 0;
  color: var(--text-strong);
}

.report-markup p {
  line-height: 1.7;
  color: var(--text-soft);
  margin: 0 0 var(--space-4) 0;
  overflow-wrap: break-word;
}

.report-markup ul {
  padding-left: var(--space-5);
  margin: var(--space-4) 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.report-markup li {
  margin-bottom: var(--space-3);
}

.report-markup.combined-report {
  display: grid;
  gap: var(--space-6);
}

.report-markup.combined-report h1 {
  display: none;
}

.report-grade-hero {
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}

.report-grade-kicker {
  margin: 0 0 var(--space-2);
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.report-grade-value {
  margin: 0 0 var(--space-3);
  font-family: var(--font-serif, Georgia, serif);
  font-size: var(--font-4xl);
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.1;
}

.report-grade-value span {
  font-family: var(--font-sans);
  font-size: var(--font-lg);
  font-weight: 500;
  color: var(--text-soft);
}

.report-grade-summary p:last-child,
.report-grade-summary ul:last-child {
  margin-bottom: 0;
}

.report-section-block {
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-faint);
}

.report-section-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.report-section-block > h2:first-child {
  margin-top: 0;
}

.report-kv-table th,
.report-kv-table td.report-kv-label {
  width: 34%;
  background: var(--bg-subtle);
  font-size: var(--font-sm);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-strong);
}

.report-score-table th:last-child,
.report-score-table td:last-child {
  text-align: right;
  white-space: nowrap;
}

.report-markup h3 {
  font-size: var(--font-md);
  margin: var(--space-5) 0 var(--space-3);
  color: var(--text-strong);
}

.report-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: var(--space-5) 0;
  -webkit-overflow-scrolling: touch;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.report-table th,
.report-table td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

.report-table thead th {
  background: var(--bg-subtle);
  color: var(--text-faint);
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* Auth screens */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-8) var(--space-5);
  background: var(--bg);
}

.auth-body-premium {
  padding: 0;
  display: block;
  min-height: 100dvh;
  background: var(--bg-elevated);
}

.auth-shell {
  min-height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.auth-brand-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(var(--space-7), 4vw, var(--space-12));
  color: var(--sidebar-text);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
}

.auth-brand-panel::after {
  display: none;
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
  min-height: 100%;
  display: grid;
  align-content: center;
  gap: var(--space-8);
}

.auth-brand-copy h1 {
  margin: var(--space-4) 0 var(--space-3);
  font-size: clamp(var(--font-3xl), 3.6vw, var(--font-5xl));
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #fff;
  font-weight: 700;
}

.auth-brand-copy p {
  margin: 0;
  font-size: var(--font-md);
  line-height: 1.65;
  color: var(--sidebar-text-muted);
  max-width: 46ch;
}

.auth-eyebrow {
  display: inline-block;
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
}

.auth-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.auth-feature-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
}

.auth-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: #E4E2DD;
  flex-shrink: 0;
  justify-self: center;
}

.auth-feature-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.auth-feature-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.auth-feature-list strong {
  display: block;
  font-size: var(--font-sm);
  color: #fff;
  margin-bottom: 2px;
}

.auth-feature-list span {
  display: block;
  font-size: var(--font-xs);
  color: var(--sidebar-text-muted);
  line-height: 1.55;
}

.auth-preview-card {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.auth-preview-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.auth-preview-label {
  font-size: var(--font-xs);
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-preview-bars .score-bar {
  color: #e2e8f0;
  font-size: var(--font-xs);
}

.auth-preview-bars .bar {
  background: rgba(255, 255, 255, 0.12);
}

.auth-form-panel {
  display: grid;
  place-items: center;
  padding: clamp(var(--space-6), 4vw, var(--space-10));
  background: var(--bg);
}

.auth-shell-single {
  grid-template-columns: 1fr;
}

.auth-form-card {
  width: min(440px, 100%);
  padding: clamp(var(--space-7), 3vw, var(--space-9));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.auth-form-header {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.auth-form-header h2 {
  margin: 0;
  font-size: var(--font-3xl);
  letter-spacing: -0.03em;
  color: var(--text-strong);
}

.auth-form-header p {
  margin: 0;
  color: var(--text-soft);
  font-size: var(--font-sm);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  padding: var(--space-1);
  margin-bottom: var(--space-5);
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-faint);
}

.auth-tab {
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-weight: 600;
  font-size: var(--font-sm);
  padding: var(--space-3) var(--space-4);
  border-radius: 999px;
  cursor: pointer;
  transition: all 140ms ease;
}

.auth-tab.active {
  background: var(--bg-elevated);
  color: var(--text-strong);
  box-shadow: var(--shadow-sm);
}

.auth-status {
  margin-bottom: var(--space-5);
}

.auth-fields {
  margin-bottom: var(--space-5);
}

.auth-input {
  padding: var(--space-4) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--font-sm);
}

.auth-actions {
  display: grid;
  gap: var(--space-4);
}

.auth-submit {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-size: var(--font-md);
  border-radius: var(--radius-lg);
}

.auth-text-link {
  text-align: center;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--accent);
}

.auth-text-link:hover {
  color: var(--accent-hover);
}

.auth-footnote {
  margin: 0;
  text-align: center;
  font-size: var(--font-xs);
  color: var(--text-faint);
}

.auth-legal {
  margin: var(--space-6) 0 0;
  text-align: center;
  font-size: var(--font-xs);
  color: var(--text-faint);
}

.auth-mobile-header {
  display: none;
}

.auth-form-panel-body {
  width: 100%;
}

.auth-form-card-brand--desktop {
  display: block;
  margin-bottom: var(--space-6);
}

.auth-wrap {
  width: min(1260px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  max-width: 1260px;
  margin: 0 auto;
  align-items: stretch;
}

.auth-panel {
  background: var(--bg-overlay);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-panel {
  display: grid;
  gap: var(--space-6);
  align-content: center;
  justify-content: center;
  background: var(--bg-elevated);
  padding: var(--space-8);
}

.hero-panel h1 {
  margin: 0;
  font-size: clamp(var(--font-3xl), 4vw, var(--font-5xl));
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
  font-weight: 700;
}

.hero-panel p {
  margin: 0;
  font-size: var(--font-base);
  line-height: 1.6;
  color: var(--text-soft);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.feature-card {
  padding: var(--space-4);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  min-width: 0;
  display: grid;
  gap: var(--space-2);
  overflow: hidden;
}

.feature-card strong {
  font-size: var(--font-sm);
  color: var(--text-strong);
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: block;
}

.feature-card span {
  font-size: var(--font-xs);
  color: var(--text-faint);
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: block;
}

.tab-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.tab {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-soft);
  font-weight: 600;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all 140ms ease;
}

.tab:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.tab.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Landing page */
.landing-body { background: var(--bg); width: 100%; }
.landing-header, .public-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: max(var(--space-4), env(safe-area-inset-top)) var(--space-8) var(--space-4);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.landing-nav {
  display: flex;
  gap: var(--space-5);
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}
.landing-nav a:not(.primary-link) {
  color: var(--text-soft);
  font-weight: 500;
  font-size: var(--font-sm);
  padding: var(--space-2) 0;
  border-radius: 0;
  text-decoration: none;
}
.landing-nav a:not(.primary-link):hover {
  color: var(--text-strong);
  background: transparent;
}
.landing-nav .primary-link {
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-5);
  font-size: var(--font-sm);
  white-space: nowrap;
}
.landing-sample {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--space-8);
}
.landing-main {
  width: 100%;
  max-width: var(--width-content);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  box-sizing: border-box;
}
.landing-hero { text-align: center; padding: var(--space-10) 0 var(--space-8); max-width: 760px; margin: 0 auto; }
.landing-hero h1 {
  font-size: clamp(var(--font-3xl), 5vw, var(--font-6xl));
  margin: var(--space-5) 0;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text-strong);
}
.landing-hero p {
  font-size: var(--font-lg);
  color: var(--text-soft);
  line-height: 1.65;
  max-width: 560px;
  margin: 0 auto;
}
.landing-badge {
  display: inline-block;
  background: var(--bg-subtle);
  color: var(--text-soft);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border);
}
.landing-cta { display: flex; gap: var(--space-4); justify-content: center; margin: var(--space-7) 0 var(--space-4); flex-wrap: wrap; }
.landing-disclaimer { color: var(--text-faint); font-size: var(--font-sm); }
.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.landing-usp {
  margin-bottom: var(--space-8);
  padding: var(--space-8);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.landing-usp-intro {
  display: grid;
  gap: var(--space-4);
  max-width: 720px;
  margin-bottom: var(--space-7);
}

.landing-usp-lead {
  font-size: var(--font-md);
  line-height: 1.65;
  color: var(--text-soft);
  max-width: none;
}

.landing-usp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.landing-usp-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.landing-usp-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--accent);
}

.landing-usp-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.landing-usp-card strong {
  font-size: var(--font-sm);
  color: var(--text-strong);
}

.landing-usp-card span {
  font-size: var(--font-sm);
  color: var(--text-soft);
  line-height: 1.6;
}

.landing-usp-footnote {
  margin: var(--space-6) 0 0;
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-faint);
  font-size: var(--font-sm);
  color: var(--text-faint);
  text-align: center;
}

.landing-sample, .landing-waitlist { margin-bottom: var(--space-8); }
.sample-grade { display: flex; gap: var(--space-5); align-items: center; margin-bottom: var(--space-5); flex-wrap: wrap; }
.grade-circle {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--font-3xl); font-weight: 700; color: #fff;
  box-shadow: var(--shadow-md);
}
.grade-b { background: #166534; }
.score-bar { display: grid; grid-template-columns: 100px 1fr 40px; gap: var(--space-3); align-items: center; margin: var(--space-2) 0; }
.score-bar .bar { height: 6px; background: var(--border-faint); border-radius: 999px; overflow: hidden; }
.score-bar .fill { height: 100%; background: var(--accent); border-radius: 999px; }
.waitlist-form { display: grid; gap: var(--space-4); max-width: 480px; }
.waitlist-form input { padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-elevated); }
.landing-footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4);
  padding: var(--space-6) var(--space-8);
  color: var(--text-soft); font-size: var(--font-sm); border-top: 1px solid var(--border-faint);
}
.public-report-main {
  width: 100%;
  max-width: var(--width-content);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  box-sizing: border-box;
}
.public-report-actions { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; min-width: 0; }
.public-report-cta { text-align: center; padding: var(--space-8); margin-top: var(--space-6); }

/* Jobs mobile cards */
.jobs-cards-mobile {
  display: none;
  gap: var(--space-4);
}

.job-card-mobile {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  text-decoration: none;
  color: inherit;
}

.job-card-mobile:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-sm);
}

.job-card-mobile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.job-card-mobile-url {
  font-weight: 600;
  color: var(--text-strong);
  word-break: break-word;
}

.job-card-mobile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--font-xs);
  color: var(--text-faint);
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.form-submit-bar {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Grades and history */
.grade-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--font-sm);
  font-weight: 600;
}
.grade-a { background: #dafbe1; color: #1a7f37; }
.grade-b { background: #EEF2F6; color: #1E3A5F; }
.grade-c { background: #fff3cd; color: #9a6700; }
.grade-d { background: #ffe2e2; color: #cf222e; }
.grade-f { background: #ffcccc; color: #a40e26; }
.beta-tag {
  background: var(--accent-bg);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--font-xs);
}
.history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-4); }
.history-card {
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: var(--bg-elevated);
}
.history-card-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.history-meta { display: flex; gap: var(--space-4); color: var(--text-soft); font-size: var(--font-sm); margin: var(--space-3) 0; }
.delta-up { color: var(--success); }
.delta-down { color: var(--critical); }
.history-sparkline { display: flex; gap: 4px; align-items: flex-end; height: 40px; }
.spark-bar { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 4px; opacity: 0.7; }
.history-timeline { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.history-timeline-item {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
}
.history-timeline-item.active { border-color: var(--accent); background: var(--accent-bg); }
.list-card-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }

/* Feedback widget */
.feedback-widget {
  border-top: 1px solid var(--border-faint);
  padding: var(--space-5);
  margin-top: var(--space-5);
  text-align: center;
}
.feedback-actions { display: flex; gap: var(--space-3); justify-content: center; margin-top: var(--space-3); }

/* Jobs view toggle + domain groups */
.jobs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.jobs-view-tabs {
  display: inline-flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.jobs-view-tab {
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: var(--font-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.jobs-view-tab.active {
  background: var(--bg-elevated);
  color: var(--text-strong);
  box-shadow: var(--shadow-xs);
}

.jobs-view-panel.hidden {
  display: none;
}

.domain-group-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.domain-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
}

.domain-group-title {
  margin: 0;
  font-size: var(--font-md);
  color: var(--text-strong);
}

.domain-group-meta {
  margin: 2px 0 0;
  font-size: var(--font-xs);
  color: var(--text-faint);
}

.domain-group-jobs {
  display: grid;
}

.domain-job-row {
  display: grid;
  grid-template-columns: 64px 1fr auto 120px;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-faint);
  text-decoration: none;
  color: inherit;
  font-size: var(--font-sm);
}

.domain-job-row:last-child {
  border-bottom: none;
}

.domain-job-row:hover {
  background: var(--bg-subtle);
}

.domain-job-id {
  font-weight: 700;
  color: var(--text-strong);
}

.domain-job-modules {
  color: var(--text-soft);
  min-width: 0;
}

.domain-job-date {
  color: var(--text-faint);
  font-size: var(--font-xs);
  text-align: right;
}

/* Dashboard */
.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
  margin-bottom: var(--space-7);
}

.dash-hero-main {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  flex: 1;
}

.dash-hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

.dash-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.dash-metric-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 0;
}

.dash-metric-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  color: var(--accent);
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.dash-metric-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.dash-metric-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dash-metric-label {
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.dash-metric-value {
  font-size: var(--font-2xl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-strong);
}

.dash-metric-unit {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-faint);
  margin-left: 2px;
}

.dash-metric-meta {
  font-size: var(--font-xs);
  color: var(--text-soft);
  line-height: 1.4;
}

.dash-usage {
  margin-bottom: var(--space-6);
  padding: var(--space-5) var(--space-6);
}

.dash-usage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.dash-usage-pct {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1;
}

.dash-usage-bar {
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.dash-usage-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 300ms ease;
}

.dash-highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
  padding: var(--space-5) var(--space-6);
}

.dash-latest {
  margin-bottom: var(--space-6);
  padding: 0;
  overflow: hidden;
}

.dash-latest-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 0;
  align-items: stretch;
  min-width: 0;
}

.dash-latest-grade-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-5);
  background: var(--bg-subtle);
  border-right: 1px solid var(--border-light);
  text-align: center;
}

.dash-latest-kicker {
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.dash-latest-letter {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-strong);
}

.dash-latest-points {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-strong);
}

.dash-latest-points small {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-faint);
}

.dash-latest-delta {
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
}

.dash-latest-body {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6);
  min-width: 0;
}

.dash-latest-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.dash-latest-domain {
  margin: 0;
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.2;
}

.dash-latest-url {
  margin: var(--space-2) 0 0;
  font-size: var(--font-sm);
  color: var(--text-soft);
  word-break: break-word;
  line-height: 1.5;
}

.dash-latest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  font-size: var(--font-xs);
  color: var(--text-faint);
}

.dash-latest-breakdown {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-faint);
}

.dash-score-row {
  display: grid;
  grid-template-columns: 88px 1fr 36px;
  gap: var(--space-3);
  align-items: center;
  font-size: var(--font-xs);
  color: var(--text-soft);
}

.dash-score-row .bar {
  height: 6px;
  background: var(--border-faint);
  border-radius: 999px;
  overflow: hidden;
}

.dash-score-row .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.dash-score-val {
  text-align: right;
  font-weight: 600;
  color: var(--text-strong);
}

.dash-latest-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6);
  border-left: 1px solid var(--border-light);
  background: var(--bg-subtle);
  min-width: 168px;
}

.dash-latest-actions .primary-link,
.dash-latest-actions .ghost-button {
  text-align: center;
  justify-content: center;
  white-space: nowrap;
}

.dash-highlight-main {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.dash-highlight-label {
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.dash-highlight-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.dash-highlight-row strong {
  font-size: var(--font-sm);
  color: var(--text-strong);
  word-break: break-word;
}

.dash-job-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.dash-job-row {
  display: grid;
  grid-template-columns: 1.6fr 0.5fr 0.7fr 0.6fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-faint);
  text-decoration: none;
  color: inherit;
  font-size: var(--font-sm);
  transition: background 140ms ease;
}

.dash-job-row:last-child {
  border-bottom: none;
}

.dash-job-row:not(.dash-job-head):hover {
  background: var(--bg-subtle);
}

.dash-job-head {
  background: var(--bg-subtle);
  font-size: var(--font-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.dash-job-site {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dash-job-site strong {
  color: var(--text-strong);
  word-break: break-word;
}

.dash-job-site small {
  color: var(--text-faint);
  font-size: var(--font-xs);
}

.dash-job-date {
  color: var(--text-soft);
  font-size: var(--font-xs);
}

.dash-empty {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-7);
  text-align: center;
  color: var(--text-soft);
}

.dash-actions-list {
  display: grid;
  gap: var(--space-2);
}

.dash-action-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: background 140ms ease, border-color 140ms ease;
}

.dash-action-item:hover {
  background: var(--bg-subtle);
  border-color: var(--border);
}

.dash-action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: var(--accent);
  border: 1px solid var(--border-light);
}

.dash-action-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.dash-action-item strong {
  display: block;
  font-size: var(--font-sm);
  color: var(--text-strong);
  margin-bottom: 2px;
}

.dash-action-item small {
  display: block;
  font-size: var(--font-xs);
  color: var(--text-faint);
  line-height: 1.45;
}

/* ==========================================================================
   Responsive — must remain last so overrides apply correctly
   ========================================================================== */

@media (max-width: 1280px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .job-layout {
    grid-template-columns: minmax(260px, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {
  .mobile-topbar {
    display: flex;
    width: 100%;
    padding-top: max(var(--space-4), env(safe-area-inset-top));
  }

  .mobile-nav-backdrop {
    display: block;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 56px);
    overflow: visible;
  }

  .main {
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .content-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--space-6) var(--space-5);
    gap: var(--space-6);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    height: 100dvh;
    z-index: 160;
    transform: translateX(-105%);
    transition: transform 240ms ease;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    padding-top: max(var(--space-8), env(safe-area-inset-top));
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .sidebar > .sidebar-top {
    display: none;
  }

  .nav {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .stats-grid,
  .dash-metrics,
  .two-column,
  .job-layout,
  .form-grid,
  .admin-grid,
  .auth-wrap,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-mobile-header {
    display: flex;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
    padding: max(var(--space-4), env(safe-area-inset-top)) var(--space-5) var(--space-4);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-sizing: border-box;
  }

  .auth-body-premium {
    background: var(--bg);
    width: 100%;
  }

  .auth-shell {
    width: 100%;
  }

  .auth-form-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 0;
    min-height: 100dvh;
    place-items: stretch;
    align-content: stretch;
  }

  .auth-form-panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    padding: 0 0 max(var(--space-6), env(safe-area-inset-bottom));
    gap: 0;
  }

  .auth-form-card {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--space-7) var(--space-5);
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border-faint);
    background: var(--bg-elevated);
    box-shadow: none;
    flex: 1;
    box-sizing: border-box;
  }

  .auth-form-card-brand--desktop {
    display: none;
  }

  .auth-form-header {
    margin-top: 0 !important;
  }

  .auth-form-header h2 {
    font-size: var(--font-2xl);
  }

  .auth-input {
    min-height: 48px;
    font-size: var(--font-md);
    width: 100%;
  }

  .auth-submit {
    min-height: 48px;
    width: 100%;
  }

  .auth-legal {
    margin: 0;
    width: 100%;
    max-width: none;
    padding: var(--space-5) var(--space-5) 0;
  }

  .landing-main,
  .public-report-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
    padding-left: 0;
    padding-right: 0;
  }

  .landing-header,
  .public-report-header {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .field-row,
  .module-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .jobs-table-desktop {
    display: none;
  }

  .jobs-cards-mobile {
    display: grid;
  }
}

@media (max-width: 768px) {
  .content-wrap {
    width: 100%;
    max-width: none;
    padding: var(--space-5) 0;
    gap: var(--space-5);
  }

  .content-wrap > * {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    box-sizing: border-box;
  }

  .panel,
  .stat-card,
  .dash-metric-card {
    width: 100%;
  }

  .page-header,
  .stats-grid,
  .dash-metrics,
  .job-layout,
  .form-grid {
    width: 100%;
  }

  .page-title {
    font-size: var(--font-3xl);
  }

  .page-copy {
    font-size: var(--font-sm);
  }

  .panel {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
  }

  .content-wrap > .panel,
  .content-wrap > .stat-card,
  .content-wrap > .dash-metric-card,
  .content-wrap > .report-export-bar {
    padding: var(--space-5) var(--space-4);
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    border-left: none;
    border-right: none;
    border-radius: 0;
    box-sizing: border-box;
  }

  .field-grid,
  .auth-fields {
    width: 100%;
  }

  .panel-head {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    padding: var(--space-6) var(--space-5);
  }

  .auth-wrap {
    gap: var(--space-5);
  }

  .page-actions {
    width: 100%;
  }

  .page-actions > * {
    flex: 1;
  }

  .page-actions .primary-button,
  .page-actions .ghost-button,
  .page-actions .primary-link {
    width: 100%;
  }

  .form-submit-bar {
    flex-direction: column;
  }

  .form-submit-bar > * {
    width: 100%;
  }

  .dash-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-hero-actions {
    width: 100%;
  }

  .dash-hero-actions > * {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

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

  .dash-job-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .dash-job-head {
    display: none;
  }

  .dash-job-site small {
    display: block;
  }

  .domain-job-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .domain-job-date {
    text-align: left;
  }

  .jobs-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .jobs-view-tabs {
    width: 100%;
    justify-content: stretch;
  }

  .jobs-view-tab {
    flex: 1;
    text-align: center;
  }

  .dash-latest-layout {
    grid-template-columns: 1fr;
  }

  .dash-latest-grade-card {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    grid-template-columns: auto 1fr auto;
    grid-auto-flow: column;
    justify-content: start;
    text-align: left;
    align-items: center;
    gap: var(--space-4) var(--space-5);
  }

  .dash-latest-actions {
    border-left: none;
    border-top: 1px solid var(--border-light);
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
  }

  .dash-latest-actions .primary-link,
  .dash-latest-actions .ghost-button {
    flex: 1;
  }

  .report-export-bar {
    grid-template-columns: 1fr;
    gap: var(--space-5);
    padding: var(--space-5);
    width: 100%;
    box-sizing: border-box;
  }

  .report-export-sep {
    width: 100%;
    height: 1px;
  }

  .report-export-row {
    flex-direction: column;
    align-items: stretch;
  }

  .report-export-actions {
    width: 100%;
  }

  .report-export-btn {
    flex: 1;
  }

  .report-body,
  .report-markup {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .report-markup .report-table,
  .report-body .report-table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }

  .landing-hero h1 {
    font-size: var(--font-3xl);
  }

  .landing-header,
  .public-report-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: max(var(--space-3), env(safe-area-inset-top)) var(--space-5) var(--space-3);
    gap: var(--space-3);
  }

  .landing-header .brand,
  .public-report-header .brand {
    min-width: 0;
    flex-shrink: 1;
    font-size: var(--font-lg);
  }

  .landing-header .brand-name,
  .public-report-header .brand-name {
    font-size: inherit;
  }

  .landing-nav,
  .public-report-actions {
    width: auto;
    flex-shrink: 0;
    justify-content: flex-end;
    min-width: 0;
    gap: var(--space-2);
    align-items: center;
  }

  .landing-nav a:not(.primary-link) {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-sm);
    white-space: nowrap;
  }

  .landing-nav .primary-link {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-sm);
  }

  .public-report-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .public-report-actions > * {
    width: auto;
    text-align: center;
    justify-content: center;
  }

  .public-report-actions .primary-link {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-sm);
  }

  .landing-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .landing-cta .primary-button,
  .landing-cta .ghost-button {
    width: 100%;
  }

  .landing-main,
  .public-report-main {
    padding: var(--space-5) 0;
    width: 100%;
    max-width: none;
  }

  .landing-hero,
  .landing-features,
  .landing-usp,
  .landing-sample,
  .landing-waitlist,
  .landing-footer,
  .public-report-main .page-header,
  .public-report-main .panel {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .landing-usp.panel,
  .landing-waitlist.panel,
  .landing-features .panel {
    border-left: none;
    border-right: none;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
  }

  .landing-header,
  .public-report-header {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .landing-usp {
    padding-top: var(--space-5);
    padding-bottom: var(--space-5);
  }

  .landing-sample {
    padding: var(--space-5) var(--space-4);
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: none;
    border-left: none;
    border-right: none;
    border-radius: 0;
    box-sizing: border-box;
  }

  .landing-usp-grid {
    grid-template-columns: 1fr;
  }

  .landing-footer {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
    padding: var(--space-5) var(--space-4);
  }

  .score-bar {
    grid-template-columns: minmax(72px, 88px) 1fr 36px;
    gap: var(--space-2);
    font-size: var(--font-xs);
  }

  .report-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
  }

  .report-link {
    flex-shrink: 0;
  }

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

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

@media (max-width: 480px) {
  :root {
    --space-7: 16px;
    --space-8: 20px;
    --space-9: 24px;
  }

  .content-wrap {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
    gap: var(--space-4);
  }

  .content-wrap > * {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .page-title {
    font-size: var(--font-2xl);
  }

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

  .dash-metrics {
    grid-template-columns: 1fr;
  }

  .landing-features {
    grid-template-columns: 1fr;
  }

  .panel,
  .stat-card {
    padding: var(--space-4);
  }

  .content-wrap > .panel,
  .content-wrap > .stat-card,
  .content-wrap > .dash-metric-card,
  .content-wrap > .report-export-bar {
    padding: var(--space-4) var(--space-3);
    border-radius: 0;
  }

  .auth-panel {
    padding: var(--space-4);
    border-radius: var(--radius-xl);
  }

  .hero-panel h1 {
    font-size: var(--font-2xl);
  }

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

  .score-bar,
  .dash-score-row {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }

  .score-bar .bar,
  .dash-score-row .bar {
    grid-column: 1 / -1;
  }

  .dash-latest-letter {
    font-size: 2.5rem;
  }

  .dash-latest-actions {
    min-width: 0;
  }

  .landing-nav {
    flex-direction: row;
    align-items: center;
  }

  .landing-nav .primary-link {
    width: auto;
    text-align: center;
  }

  .auth-form-card {
    padding: var(--space-6) var(--space-4);
  }

  .auth-legal {
    padding: var(--space-4) var(--space-4) 0;
  }
}
