:root {
  --bg-canvas: #fafaf7;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-muted: #f3f2ec;
  --bg-subtle: #f7f6f1;
  --bg-sidebar: #f3f2ec;
  --bg-sidebar-hover: #e9e7de;
  --border: #e4e2da;
  --border-strong: #d3d0c5;
  --text-primary: #141413;
  --text-secondary: #4a4943;
  --text-muted: #716f67;
  --ink: #141413;
  --ink-text: #ffffff;
  --accent: #0e5a43;
  --accent-hover: #0a4332;
  --accent-soft: rgba(14, 90, 67, 0.08);
  --emerald: #0e5a43;
  --emerald-soft: rgba(14, 90, 67, 0.09);
  --amber: #9a5b13;
  --amber-soft: rgba(154, 91, 19, 0.09);
  --rose: #b42318;
  --rose-soft: rgba(180, 35, 24, 0.09);
  --stone-bar: #c8c4b6;
  --nav-glass: rgba(250, 250, 247, 0.92);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 19, 0.04);
  --shadow-md: 0 6px 18px rgba(20, 20, 19, 0.06);
  --shadow-lg: 0 18px 40px rgba(20, 20, 19, 0.11);
  --font-serif: 'Georgia', 'Cambria', 'Times New Roman', serif;
  --font-sans: 'Segoe UI Variable', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-mono: 'Cascadia Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg-canvas: #111110;
  --bg-surface: #171715;
  --bg-elevated: #1d1d1a;
  --bg-muted: #22221f;
  --bg-subtle: #1a1a18;
  --bg-sidebar: #0c0c0b;
  --bg-sidebar-hover: #1a1a18;
  --border: #262623;
  --border-strong: #383833;
  --text-primary: #f2f1ec;
  --text-secondary: #c4c2b8;
  --text-muted: #9c9a92;
  --ink: #f2f1ec;
  --ink-text: #111110;
  --accent: #2dae82;
  --accent-hover: #3bc193;
  --accent-soft: rgba(45, 174, 130, 0.13);
  --emerald: #2dae82;
  --emerald-soft: rgba(45, 174, 130, 0.14);
  --amber: #e29d48;
  --amber-soft: rgba(226, 157, 72, 0.14);
  --rose: #e35d52;
  --rose-soft: rgba(227, 93, 82, 0.14);
  --stone-bar: #54534c;
  --nav-glass: rgba(17, 17, 16, 0.92);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 44px rgba(0, 0, 0, 0.65);
}

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

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.18s ease, color 0.18s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 14px;
}

.num, .kpi-value, .price-tag, .roi-big, td strong {
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fade-in {
  animation: fadeIn 0.16s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.boot-loader {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-secondary);
}

.spinner {
  width: 26px;
  height: 26px;
  border: 2px solid var(--border);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--border) 50%, var(--bg-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Editorial Typography */
.display-serif {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.eyebrow-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Restrained Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  white-space: nowrap;
  text-decoration: none !important;
}

.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12.5px;
}

.btn-lg {
  min-height: 42px;
  padding: 10px 20px;
  font-size: 14.5px;
}

.btn-icon {
  min-width: 32px;
  min-height: 32px;
  padding: 5px;
}

.btn-primary {
  background: var(--ink);
  color: var(--ink-text);
  border-color: var(--ink);
}
.btn-primary:hover:not(:disabled) { opacity: 0.88; }

.btn-accent, .btn-emerald {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.btn-accent:hover:not(:disabled), .btn-emerald:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-muted);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--rose-soft);
  color: var(--rose);
  border-color: rgba(180, 35, 24, 0.25);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(180, 35, 24, 0.16);
}

/* Form Inputs */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input, .select, .textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Understated Badges & Status Chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.badge-emerald {
  color: var(--emerald);
  background: var(--emerald-soft);
  border-color: rgba(14, 90, 67, 0.22);
}
.badge-emerald::before { background: var(--emerald); }

.badge-amber {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: rgba(154, 91, 19, 0.24);
}
.badge-amber::before { background: var(--amber); }

.badge-rose {
  color: var(--rose);
  background: var(--rose-soft);
  border-color: rgba(180, 35, 24, 0.24);
}
.badge-rose::before { background: var(--rose); }

.badge-indigo {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(14, 90, 67, 0.22);
}
.badge-indigo::before { background: var(--accent); }

.badge-slate::before { background: var(--text-muted); }

/* Cards & Architectural Hairline Grids */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.card-hover {
  transition: border-color 0.14s ease;
}
.card-hover:hover {
  border-color: var(--border-strong);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.metric-strip.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-cell {
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.metric-strip:not(.cols-4) .metric-cell:nth-child(3n) { border-right: none; }
.metric-strip:not(.cols-4) .metric-cell:nth-last-child(-n+3) { border-bottom: none; }
.metric-strip.cols-4 .metric-cell:nth-child(4n) { border-right: none; }
.metric-strip.cols-4 .metric-cell { border-bottom: none; }

.ruled-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ruled-col {
  padding: 24px 22px;
  border-right: 1px solid var(--border);
}
.ruled-col:last-child { border-right: none; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flex-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.mono { font-family: var(--font-mono); font-size: 12px; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  font-weight: 600;
}

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

/* Brand Mark — Architectural Typographic Monogram */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-decoration: none !important;
}

.brand-shield {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--ink-text);
  display: grid;
  place-items: center;
}

/* Landing Page */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--nav-glass);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.landing-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 12px;
}

.landing-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.landing-links a {
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
}
.landing-links a:hover { color: var(--text-primary); text-decoration: none; }

.hero {
  padding: 58px 0 54px;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(32px, 4.3vw, 50px);
  line-height: 1.08;
  margin: 12px 0 18px;
  letter-spacing: -0.025em;
}

.hero p.lead {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 24px;
  max-width: 520px;
  line-height: 1.6;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 18px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

/* Authentic Legal Scope Ledger Sheet (Replaces AI Dark Browser Mockup) */
.ledger-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}

.ledger-tabs {
  display: flex;
  gap: 4px;
}

.ledger-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.ledger-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.ledger-body {
  padding: 18px;
  min-height: 295px;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ledger-row:last-child { border-bottom: none; }

.section {
  padding: 60px 0;
}

.section-alt {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 6px 0 10px;
}

/* P&L ROI Worksheet */
.roi-worksheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.roi-worksheet input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.roi-summary-line {
  border-top: 2px solid var(--ink);
  padding-top: 14px;
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.roi-big {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

/* Billing Switch & Pricing */
.billing-switch {
  display: inline-flex;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.billing-switch button {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
}

.billing-switch button.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.pricing-table-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
}

.pricing-col {
  padding: 22px 20px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}
.pricing-col:last-child { border-right: none; }
.pricing-col.featured {
  border-top: 3px solid var(--accent);
  background: var(--bg-subtle);
}

.price-tag {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Ruled Editorial FAQ */
.faq-list {
  border-top: 1px solid var(--border);
  max-width: 820px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-q {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 16px 2px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.faq-a {
  padding: 0 2px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 720px;
}

/* Auth Shell */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: var(--bg-canvas);
}

.auth-card {
  width: 100%;
  max-width: 430px;
}

/* Unified Tonal App Shell */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  border-right: 1px solid var(--border);
}

.sidebar .brand-mark {
  padding: 4px 8px 12px;
}

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 10px 4px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13.5px;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  text-decoration: none !important;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  position: relative;
}

.mobile-menu-btn {
  display: none;
}

.cmd-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12.5px;
}
.cmd-trigger:hover {
  border-color: var(--ink);
  color: var(--text-primary);
}

.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

/* Notification Bell & Popover */
.notif-wrap { position: relative; }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--rose);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.notif-popover {
  position: absolute;
  top: 40px;
  right: 0;
  width: 330px;
  max-width: calc(100vw - 24px);
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 45;
  padding: 12px;
}

.notif-item {
  display: block;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--text-primary);
  text-decoration: none !important;
  margin-top: 6px;
}
.notif-item.unread {
  background: var(--accent-soft);
  border-color: rgba(14, 90, 67, 0.2);
}
.notif-item:hover { background: var(--bg-muted); }

.page-content {
  padding: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 5px;
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* Sub-tabs */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* Progress Bar */
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-muted);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease;
}
.progress-fill.warn { background: var(--amber); }
.progress-fill.danger { background: var(--rose); }
.progress-fill.emerald { background: var(--emerald); }

/* Hairline List Items (Replaces Neon Left-Border Cards) */
.verdict-card {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.verdict-card.OUT_OF_SCOPE { border-left: 3px solid var(--rose); }
.verdict-card.BOUNDARY_WARNING { border-left: 3px solid var(--amber); }
.verdict-card.IN_SCOPE { border-left: 3px solid var(--emerald); }

/* SVG Charts */
.chart-box {
  width: 100%;
  overflow-x: auto;
}
.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}
.chart-bar { transition: opacity 0.14s ease; }
.chart-bar:hover { opacity: 0.8; }

/* Formal Legal SOW Addendum Portal */
.portal-shell {
  min-height: 100vh;
  background: var(--bg-canvas);
  padding: 28px 16px 64px;
}

.portal-container {
  max-width: 900px;
  margin: 0 auto;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  overflow: hidden;
  margin-bottom: 18px;
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-right: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.step-pill:last-child { border-right: none; }
.step-pill.done {
  background: var(--emerald-soft);
  color: var(--emerald);
}
.step-pill.current {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.sig-pad-wrap {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  touch-action: none;
}

.sig-canvas {
  display: block;
  width: 100%;
  height: 126px;
  cursor: crosshair;
}

.certificate-box {
  border: 1px solid var(--emerald);
  background: var(--emerald-soft);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-wrap: anywhere;
}
.certificate-box .mono {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Modals, Command Palette & Toast */
.modal-root {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-lg);
}

.cmd-modal {
  max-width: 540px;
  padding: 14px;
}

.cmd-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none !important;
}
.cmd-result:hover { background: var(--bg-muted); }

.toast-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: var(--ink-text);
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
}
.toast.error { background: var(--rose); color: #ffffff; }
.toast.success { background: var(--emerald); color: #ffffff; }

.sidebar-backdrop { display: none; }

@media (max-width: 880px) {
  .hero-grid, .grid-2, .grid-3, .grid-4, .metric-strip, .metric-strip.cols-4, .ruled-grid-3, .pricing-table-grid, .stepper {
    grid-template-columns: 1fr;
  }

  .metric-cell, .ruled-col, .pricing-col, .step-pill {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .metric-cell:last-child, .ruled-col:last-child, .pricing-col:last-child, .step-pill:last-child {
    border-bottom: none;
  }

  .landing-links, .cmd-trigger .kbd {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.2s ease, visibility 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 19, 0.5);
    z-index: 40;
  }

  .topbar, .page-content, .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .landing-nav-inner {
    flex-wrap: wrap;
    padding: 10px 0;
    gap: 8px;
  }

  .landing-nav-inner .flex-row {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }
}

@media print {
  .sidebar, .topbar, .no-print, .toast-root, .modal-root {
    display: none !important;
  }
  body, .portal-shell, .page-content {
    background: #ffffff !important;
    color: #141413 !important;
    padding: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border-color: #d3d0c5 !important;
  }
}


/* Iteration 1.1: Filter Bar, Dropzone & Onboarding Checklist */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.filter-pill {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  padding: 12px 14px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 12px;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.dropzone.dragover, .dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.onboarding-card {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.onboarding-step {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.onboarding-step.done {
  border-color: rgba(14, 90, 67, 0.3);
  background: var(--emerald-soft);
}

@media (max-width: 880px) {
  .onboarding-steps {
    grid-template-columns: 1fr;
  }
}

/* Iteration 1.2: Demo Sandbox Banner, Public Verifier & Legal Pages */
.demo-banner {
  background: var(--amber-soft);
  border-bottom: 1px solid rgba(154, 103, 0, 0.25);
  padding: 9px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.public-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
}

.public-container {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.legal-doc {
  max-width: 820px;
  margin: 10px auto;
  padding: 28px;
}

.legal-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.verify-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.footer-links a, .landing-links a.active-link {
  color: var(--text-primary);
  font-weight: 500;
}

@media (max-width: 880px) {
  .demo-banner {
    padding: 10px 14px;
  }

  .public-container {
    padding: 18px 14px 36px;
  }

  .legal-doc {
    padding: 18px;
  }

  .verify-input-row {
    flex-direction: column;
    align-items: stretch;
  }
}
