/* RegDataLab: shared by the Tailwind theme and server-rendered pages. */
:root {
  --r-color-paper: #ffffff;
  --r-color-paper-raised: #f6f7f9;
  --r-color-paper-sunk: #eceef2;
  --r-color-ink: #0e1420;
  --r-color-ink-muted: #465064;
  --r-color-ink-faint: #5d6779;
  --r-color-rule: #dfe2e8;
  --r-color-rule-strong: #c3c8d2;
  /* Interactive control border. Cool grey chosen to clear WCAG 1.4.11
     non-text contrast (>= 3:1) against both paper and paper-raised; see
     contrast-token.test.ts. rule-strong stays for decorative hairlines only. */
  --r-color-control-border: #7f8898;
  --r-color-oxblood: #1b3a8f;
  --r-color-oxblood-deep: #12296b;
  --r-color-oxblood-light: #8fa5e3;
  --r-color-oxblood-wash: #e8edfa;
  --r-color-terminal: #0e1420;
  --r-color-terminal-raised: #182033;
  --r-color-terminal-rule: #2b3550;
  --r-color-terminal-text: #e6eaf3;
  --r-color-terminal-muted: #98a2b8;
  --r-color-ok: #2f6b47;
  --r-color-ok-wash: #e4ece3;
  --r-color-warn: #8a5a15;
  --r-color-warn-wash: #f0e8d6;
  --r-color-danger: #a3232f;
  --r-color-danger-wash: #fbeced;
  --r-color-bg: var(--r-color-paper);
  --r-color-bg-card: var(--r-color-paper-raised);
  --r-color-bg-deep: var(--r-color-paper-sunk);
  --r-color-primary: var(--r-color-oxblood);
  --r-color-primary-hover: var(--r-color-oxblood-deep);
  --r-color-accent: var(--r-color-oxblood);
  --r-color-accent-hover: var(--r-color-oxblood-deep);
  --r-color-accent-light: #3a5bc0;
  --r-color-text: var(--r-color-ink);
  --r-color-text-muted: var(--r-color-ink-muted);
  --r-color-border: var(--r-color-rule);
  --r-color-shadow: rgba(14, 20, 32, 0.07);
  /* Display and body faces. --r-font-serif keeps its old name for the many
     places that reference it; it now resolves to the display grotesque. */
  --r-font-display: var(--font-archivo, "Archivo"), -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  --r-font-serif: var(--r-font-display);
  --r-font-sans: var(--font-hanken, "Hanken Grotesk"), -apple-system, BlinkMacSystemFont,
    "Segoe UI", Helvetica, Arial, sans-serif;
  --r-font-mono: var(--font-plex-mono, "IBM Plex Mono"), "SFMono-Regular", Menlo, Consolas,
    "Liberation Mono", monospace;
  --r-radius-sm: 2px;
  --r-radius-md: 3px;
  --r-radius-lg: 4px;
  --r-radius-xl: 4px;
  --r-radius-full: 999px;
}

@font-face{font-family:Archivo;font-style:normal;font-weight:100 900;font-display:swap;src:url('/fonts/site/archivo-latin.woff2?v=8f704806dbed') format('woff2')}
@font-face{font-family:'Hanken Grotesk';font-style:normal;font-weight:100 900;font-display:swap;src:url('/fonts/site/hanken-grotesk-latin.woff2?v=e9201eddf1d4') format('woff2')}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/oauth/ibm-plex-mono-latin.woff2?v=c36f509c0a8f') format('woff2')}

/* RegDataLab: white paper, navy accent, grotesque headings and hairline rules. */

:root {
  --bg: var(--r-color-paper);
  --bg-card: var(--r-color-paper-raised);
  --bg-inset: var(--r-color-paper-sunk);
  --text: var(--r-color-ink);
  --text-muted: var(--r-color-ink-muted);
  --accent: var(--r-color-oxblood);
  --accent-bright: var(--r-color-oxblood-deep);
  --accent-dim: var(--r-color-oxblood-light);
  --primary: var(--r-color-oxblood);
  --border: var(--r-color-rule);
  --border-strong: var(--r-color-rule-strong);
  --ink-on-accent: var(--r-color-paper-raised);
  --shadow: none;
  --radius: 0;
  --data-pos: var(--r-color-ok);
  --data-neg: var(--r-color-danger);
  --font-display: var(--r-font-serif);
  --font-mono: var(--r-font-mono);
  --font-body: var(--r-font-sans);

  /* Typography + spacing rhythm tokens */
  --font-size-body: 1rem;
  --font-size-h1: clamp(2.1rem, 4vw, 3.6rem);
  --font-size-h2: clamp(1.5rem, 2.6vw, 2.1rem);
  --font-size-h3: clamp(1.08rem, 1.4vw, 1.3rem);
  --line-height-body: 1.68;
  --line-height-heading: 1.2;
  --line-height-tight: 1.08;
  --section-space: clamp(3rem, 6vw, 4.5rem);
  --section-space-compact: clamp(2rem, 4vw, 3rem);
  --flow-space: clamp(0.75rem, 1.2vw, 1.125rem);
  --card-padding: clamp(1.25rem, 2.2vw, 1.9rem);
}

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

html {
  overflow-x: clip;
}

body {
  overflow-x: clip;
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: var(--line-height-body);
  text-rendering: optimizeLegibility;
}

/* ── Headings: display grotesque ── */

h1,
h2,
h3,
h4 {
  margin-top: 0;
  font-family: var(--font-display);
  font-weight: 650;
  line-height: var(--line-height-heading);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-tight);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

/* UI-level headings inside cards stay sans for legibility at small sizes */
.card h3,
.tool-card h4,
.pricing-card h3,
.big-number-card .label {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0;
}

:is(p, li, dd, dt, blockquote) {
  line-height: var(--line-height-body);
  overflow-wrap: break-word;
}

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

a:hover {
  color: var(--accent-bright);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

main :is(p, li, dd, dt, blockquote) a:not(.btn-primary):not(.btn-secondary),
.breadcrumbs a,
.page-sources a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  /* accent-dim (#8fa5e3) is 2.43:1 on paper. accent-light clears 3:1. */
  text-decoration-color: var(--r-color-accent-light);
  text-underline-offset: 0.2em;
  text-decoration-skip-ink: auto;
}

main :is(p, li, dd, dt, blockquote) a:not(.btn-primary):not(.btn-secondary):hover,
.breadcrumbs a:hover,
.page-sources a:hover {
  color: var(--accent-bright);
  text-decoration-color: var(--accent-bright);
}

summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

:where(.hero, .docs-hero, .pricing-hero, .blog-hero, .signup-hero, .account-hero) {
  padding-block: var(--section-space-compact);
}

:where(.hero, .docs-hero, .pricing-hero, .blog-hero, .signup-hero, .account-hero) h1 {
  margin-bottom: 0.75rem;
  max-width: 22ch;
}

:where(.hero, .docs-hero, .pricing-hero, .blog-hero, .signup-hero, .account-hero) p {
  max-width: 68ch;
}

:where(.section, .content-section, .stat-section) {
  scroll-margin-top: 96px;
}

.section {
  padding: var(--section-space) 0;
}

/* Ruled section header: hairline above, mono index feel */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--flow-space);
  margin-bottom: clamp(1.25rem, 2.4vw, 2rem);
  padding-top: 14px;
  border-top: 1px solid var(--border-strong);
}

:where(.hero-actions, .pricing-cta, .billing-actions) {
  align-items: stretch;
}

/* ── Ledger grids: cells share hairlines like ruled paper ── */

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

/* 2x2 grid variant for 4-item sections */
.grid-2x2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

@media (max-width: 768px) {
  .grid-2x2 {
    grid-template-columns: 1fr !important;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: var(--card-padding);
  box-shadow: none;
  min-width: 0;
  overflow: hidden;
  transition: background 200ms ease;
}

/* Inside a ledger grid the shared hairline does the work */
:is(.grid-3, .grid-2x2) > .card {
  border: none;
}

.card:hover {
  background: var(--bg-inset);
  transform: none;
  box-shadow: none;
}

.card h3 {
  margin: 0 0 12px;
  font-size: var(--font-size-h3);
  line-height: 1.3;
  color: var(--text);
}

.card p {
  margin: 0;
  color: var(--text-muted);
  line-height: var(--line-height-body);
}

:where(.blog-card h2, .pricing-card h3, .tool-card h4, .account-hero .card h3, .helper-grid .card h3) {
  line-height: 1.3;
  text-wrap: balance;
}

:where(.tool-card table, .data-table) {
  font-size: 0.95rem;
  line-height: 1.5;
}

:where(.tool-card th, .tool-card td, .data-table th, .data-table td) {
  vertical-align: top;
}

/* ── Buttons: rectangular, mono, terminal-decisive ── */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 0;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
  min-height: 44px;
}

.btn-primary {
  background: var(--primary);
  color: var(--ink-on-accent);
  border-color: var(--primary);
  box-shadow: none;
}

.btn-primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  color: var(--ink-on-accent);
  transform: none;
}

.signup-hero #submit-btn {
  background: var(--primary);
  color: var(--ink-on-accent);
}

.signup-hero #submit-btn:hover {
  background: var(--accent-bright);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  transform: none;
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary:active,
.btn-secondary:active {
  transform: none;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.7;
  cursor: wait;
}


/* ── Navigation ── */

body > nav,
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
}

.nav-inner > div:first-child a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  color: inherit;
  text-decoration: none;
}

.nav-inner > div:first-child a:hover {
  color: inherit;
}

.nav-inner > div:first-child a { gap: 10px; padding: 0; min-height: 24px; }
.nav-inner > div:first-child a strong { font-family: var(--font-body); font-size: 15px; letter-spacing: -0.01em; }
.brand-wordmark { display: block; width: auto; height: 23px; flex-shrink: 0; }
.brand-icon { display: block; width: 32px; height: 32px; flex-shrink: 0; border-radius: 6px; box-shadow: 0 0 0 1px var(--r-color-rule); }
.site-brand { display: flex; align-items: center; gap: 10px; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.btn-primary {
  margin-left: 12px;
  padding: 10px 20px;
  min-height: 40px;
  font-weight: 600;
  color: var(--ink-on-accent);
}

.nav-links a.btn-primary:hover {
  color: var(--ink-on-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
}

/* Menu icon drawn with lines. The ☰ and ✕ characters it used before showed
   as an empty box on devices whose fonts lack them. */
.nav-toggle {
  position: relative;
}

.nav-toggle::before,
.nav-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 2px;
  margin: -1px 0 0 -10px;
  background: currentColor;
}

.nav-toggle::before {
  display: none;
}

.nav-toggle::after {
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.nav-toggle[aria-expanded="true"]::before {
  display: block;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"]::after {
  box-shadow: none;
  transform: rotate(-45deg);
}

.nav-toggle:hover {
  border-color: var(--accent);
  background: var(--r-color-oxblood-wash);
}

.nav-toggle:active {
  background: var(--r-color-oxblood-wash);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ── Menu scroll lock ── */

body.menu-open {
  overflow: hidden;
}

/* ── Footer ── */

footer.site-footer {
  margin-top: 6rem;
  padding: 3.5rem 0;
  border-top: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer-grid {
  display: grid;
  gap: 2.5rem;
}

.site-footer-brand {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 0.875rem;
}

.site-footer-blurb {
  max-width: 20rem;
  margin: 0;
  line-height: 1.5;
  font-size: 0.82rem;
}

.site-footer-label {
  margin: 0 0 0.875rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--r-color-ink-faint);
}

.site-footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer-links-row,
.site-footer-hubs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.site-footer-hubs {
  margin: 0.875rem 0 0;
}

.site-footer-hubs .site-footer-label {
  margin: 0;
}

/* Second label inside the browse block (after the search-guides row). */
.site-footer-links-row + .site-footer-label {
  margin-top: 1.5rem;
}

.site-footer a {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer-browse,
.site-footer-end {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.site-footer-end {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.site-footer-end p {
  max-width: 36rem;
  margin: 0;
  color: var(--r-color-ink-faint);
  font-size: 0.75rem;
  line-height: 1.5;
}

.site-footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer a.site-footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--r-color-ink-faint);
  font-size: 0.75rem;
  text-decoration: none;
}

.site-footer a.site-footer-credit:hover {
  color: var(--accent);
}

.site-footer-credit svg {
  color: var(--accent);
}

.site-footer-credit strong {
  font-weight: 500;
}

@media (min-width: 640px) {
  .site-footer-meta {
    align-items: flex-end;
  }
}

.site-footer-copy {
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Phones: each footer link is a 44px tap row; the gaps shrink to compensate. */
@media (max-width: 639px) {
  .site-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .site-footer-links {
    gap: 0;
  }
  .site-footer-links-row,
  .site-footer-hubs {
    gap: 0 1.25rem;
  }
}

@media (min-width: 640px) {
  .site-footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

footer {
  margin-top: 80px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer .footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

footer .footer-inner p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

footer .footer-links a {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  letter-spacing: 0;
  text-transform: none;
  transition: color 150ms;
}

footer .footer-links a:hover {
  color: var(--accent);
}

/* ── Code blocks ── */

code,
pre {
  font-family: var(--font-mono);
}

pre {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-dim);
  padding: 18px;
  border-radius: 0;
  overflow-x: auto;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  -webkit-overflow-scrolling: touch;
}

code {
  background: var(--r-color-oxblood-wash);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 0;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* ── Forms ── */

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 0;
  border: 1px solid var(--r-color-control-border);
  background: var(--r-color-paper-raised);
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
}

input::placeholder {
  color: var(--r-color-ink-faint);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--r-color-oxblood-wash);
  outline: none;
}

.api-key-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 0;
  background: var(--bg-inset);
  border: 1px dashed var(--accent);
  color: var(--text);
}

/* ── Badge: filed-under stamp ── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 0;
  border: 1px solid var(--border-strong);
  border-left: 2px solid var(--accent);
  color: var(--accent);
  background: var(--r-color-oxblood-wash);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

details {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 16px;
}

details + details {
  margin-top: 12px;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

/* ── Tool List: the ledger proper ── */

.tool-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  list-style: none;
  padding: 0;
  margin: 0;
}

.tool-list li {
  padding: 16px 18px;
  background: var(--bg-card);
  border: none;
  border-radius: 0;
  transition: background 150ms ease;
}

.tool-list li:hover {
  border-color: transparent;
  background: var(--bg-inset);
}

.tool-list code {
  display: block;
  margin-bottom: 8px;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  word-break: break-all;
}

.tool-list li {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Tool list grouped (mobile categories) */
.tool-list-grouped {
  display: none;
}

.tool-list-flat {
  display: grid;
}

.sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 20px;
  background: var(--bg-card);
}

/* ── Docs page layout ── */
.docs-hero {
  padding: 48px 0 32px;
}

.docs-hero h1 {
  font-size: clamp(2rem, 2.8vw, 3rem);
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 0;
}

.sidebar nav a.active {
  color: var(--accent);
  font-weight: 500;
}

.content-section {
  margin-bottom: 36px;
}

.tool-grid {
  display: grid;
}

.tool-card {
  border: 1px solid var(--border);
  border-left: 2px solid var(--border-strong);
  border-radius: 0;
  padding: 18px;
  background: var(--bg-card);
}

.tool-card h4 {
  margin: 0 0 8px;
}

.tool-card h4[id] {
  scroll-margin-top: 96px;
}

.tool-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.tool-card th,
.tool-card td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}

.tool-card th {
  color: var(--text-muted);
  font-weight: 600;
}

.mobile-toc {
  display: none;
}

.sidebar nav a.toc-sub-link,
.mobile-toc nav a.toc-sub-link {
  padding-left: 12px;
  font-size: 0.9em;
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-toc {
    display: block;
  }
}

.table-compact {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-compact--spaced {
  margin-bottom: 24px;
}

.table-compact caption {
  text-align: left;
  font-weight: 600;
  margin-bottom: 8px;
}

.table-compact thead tr {
  border-bottom: 2px solid var(--border-strong);
}

.table-compact tbody tr {
  border-bottom: 1px solid var(--border);
}

.table-compact tbody tr:last-child {
  border-bottom: 0;
}

.table-compact th {
  text-align: left;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.table-compact td {
  padding: 6px 12px;
}

.u-mt-12 {
  margin-top: 12px;
}

.u-mt-18 {
  margin-top: 18px;
}

.u-mt-24 {
  margin-top: 24px;
}

.u-mb-24 {
  margin-bottom: 24px;
}

.u-inline {
  display: inline;
}

/* ── Blog post article template ── */

.post-hero {
  padding: 48px 0 16px;
}

.post-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 3.2vw, 3rem);
}

.post-meta {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  padding-bottom: 24px;
}

.post-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 28px;
}

.post-content h2 {
  margin-top: 32px;
  margin-bottom: 12px;
  font-size: 1.45rem;
}

.post-content h3 {
  margin-top: 24px;
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.post-content p {
  margin-top: 0;
}

.post-content ul,
.post-content ol {
  padding-left: 20px;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

.post-content th,
.post-content td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.post-content th {
  color: var(--text-muted);
  font-weight: 600;
}

.post-content pre {
  margin: 16px 0;
  overflow-x: auto;
}

.post-content code {
  word-break: break-word;
}

.callout {
  background: var(--r-color-oxblood-wash);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 0;
  padding: 16px;
}

.post-content .callout {
  margin: 18px 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
}

.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 20px 24px;
  margin: 18px 0;
}

.toc h3 {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.toc ol {
  margin: 0;
  padding-left: 20px;
}

.toc li {
  margin-bottom: 6px;
}

.toc a {
  color: var(--accent);
}

/* ── CTA box: the filing stamp ── */

.cta-box {
  background: var(--r-color-oxblood-wash);
  border: 1px solid var(--accent-dim);
  border-radius: 0;
  padding: 28px 24px;
  margin: 28px 0;
  text-align: center;
}

.cta-box h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.cta-box p {
  margin: 0 0 18px;
  color: var(--text-muted);
}

.cta-box a.btn-primary {
  display: inline-flex;
  padding: 12px 28px;
  border-radius: 0;
  text-decoration: none;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  margin-right: 8px;
  flex-shrink: 0;
}

/* ── Legal and error pages ── */

.legal {
  padding: 64px 0 80px;
}

.legal h1 {
  margin-bottom: 12px;
}

.legal h2 {
  margin-top: 28px;
  margin-bottom: 8px;
}

.legal h3 {
  margin-top: 18px;
  margin-bottom: 6px;
}

.legal p {
  color: var(--text-muted);
  max-width: 720px;
}

.legal ul {
  color: var(--text-muted);
  margin: 8px 0 16px 18px;
  max-width: 760px;
}

.legal li {
  margin-bottom: 8px;
}

.legal .effective-date {
  color: var(--text-muted);
  font-size: 0.9em;
  margin-bottom: 24px;
}

:where(.not-found, .server-error) {
  padding: 96px 0 120px;
  text-align: center;
}

:where(.not-found, .server-error) h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 12px;
}

:where(.not-found, .server-error) p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

:where(.not-found-actions, .server-error-actions) {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 800px) {
  .post-content {
    padding: 20px;
  }
}

@media (max-width: 600px) {
  .post-hero h1 {
    font-size: 1.8rem;
  }

  .post-content {
    padding: 18px;
  }

  .post-content table {
    font-size: 0.9rem;
  }
}

/* ── Responsive: tablet ── */

@media (max-width: 768px) {
  :root {
    --line-height-body: 1.65;
    --section-space: clamp(2.25rem, 8vw, 2.75rem);
    --section-space-compact: clamp(1.5rem, 6vw, 2.25rem);
  }

  body {
    font-size: 16px;
    line-height: var(--line-height-body);
  }

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

  /* Hamburger nav */
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    gap: 6px;
    padding-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
    transition: max-height 300ms ease, opacity 200ms ease, padding 200ms ease, visibility 0ms 300ms;
  }

  .nav-links.open {
    max-height: 500px;
    opacity: 1;
    padding-top: 12px;
    padding-bottom: 8px;
    pointer-events: auto;
    visibility: visible;
    transition: max-height 300ms ease, opacity 200ms ease, padding 200ms ease, visibility 0ms 0ms;
  }

  .nav-links a,
  .nav-links .btn-primary {
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    min-height: 44px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease;
  }

  .nav-links a:not(.btn-primary):hover {
    background: var(--r-color-oxblood-wash);
  }

  .nav-links a:not(.btn-primary):active {
    background: var(--r-color-oxblood-wash);
  }

  .nav-links a.btn-primary:hover,
  .nav-links a.btn-primary:active {
    background: var(--r-color-oxblood-deep);
    color: var(--ink-on-accent);
  }

  .nav-links a.btn-primary {
    margin-left: 0;
    margin-top: 8px;
    position: relative;
  }

  .nav-links .btn-primary::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: var(--border);
  }

  .nav-inner {
    padding: 14px 20px;
    flex-wrap: wrap;
  }

  .sidebar {
    position: static;
    display: none;
  }

  /* Section spacing — breathing room between sections */
  .section {
    padding: 32px 0;
  }

  .section + .section {
    border-top: 1px solid var(--border);
  }

  /* Footer */
  footer {
    margin-top: 48px;
    padding: 24px 0;
  }

  footer .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  footer .footer-links {
    justify-content: center;
  }

  footer .footer-links a {
    min-height: 44px;
    line-height: 44px;
    padding: 0 8px;
  }

  /* Code blocks on mobile */
  pre {
    font-size: 13px;
    padding: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  pre code {
    font-size: 13px;
  }

  .card pre {
    margin: 8px -8px 0;
  }

  /* Cards */
  .card {
    padding: 20px;
  }

  .card h3 {
    font-size: 1.05rem;
    margin: 0 0 8px;
  }

  .card p {
    font-size: 16px;
    margin: 0;
    line-height: 1.6;
  }

  /* Section titles */
  .section-title {
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .section-title h2 {
    font-size: 1.4rem;
  }

  /* Badge */
  .badge {
    font-size: 11px;
    padding: 4px 10px;
  }

  /* Tool list */
  .tool-list li {
    padding: 12px 14px;
  }

  .tool-list code {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .tool-list li {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  /* Tool category groups */
  .tool-category {
    margin-bottom: 12px;
  }

  .tool-category summary {
    font-size: 16px;
    padding: 12px 14px;
    color: var(--accent);
  }

  .tool-category .tool-list {
    margin-top: 8px;
    border: 1px solid var(--border);
    gap: 1px;
  }

  .tool-category .tool-list li {
    border: none;
  }

  /* Docs page tables — scrollable */
  .tool-card table {
    font-size: 13px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tool-card th,
  .tool-card td {
    padding: 6px 4px;
    white-space: nowrap;
  }

  .tool-card td:last-child {
    white-space: normal;
  }

  .tool-card h4 {
    font-size: 1rem;
  }

  .tool-card p {
    font-size: 16px;
    line-height: 1.6;
  }

  /* Callout blocks */
  .callout {
    font-size: 16px;
    padding: 14px;
  }

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

  /* Mobile TOC */
  .mobile-toc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    margin-bottom: 24px;
  }

  .mobile-toc summary {
    padding: 14px 16px;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-toc summary::-webkit-details-marker {
    display: none;
  }

  .mobile-toc summary::after {
    content: "▸";
    color: var(--text-muted);
    transition: transform 200ms;
  }

  .mobile-toc[open] summary::after {
    transform: rotate(90deg);
  }

  .mobile-toc nav {
    padding: 0 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-toc nav a {
    font-size: 15px;
  }
}

/* ── Back to top button ── */

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-size: 20px;
  cursor: pointer;
  z-index: 100;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: opacity 200ms, border-color 200ms;
  opacity: 0;
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: none;
  border-color: var(--accent);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ── Copy button focus ── */

.copy-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

pre[tabindex="0"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Skip to content ──
   Clipped until focused so the label is not visible text on the page. */

.skip-link {
  position: fixed;
  top: 8px;
  left: 16px;
  background: var(--primary);
  color: var(--ink-on-accent);
  padding: 10px 16px;
  border-radius: 0;
  z-index: 1000;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  clip-path: inset(100%);
}

.skip-link:focus {
  clip-path: none;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Details animation ── */

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

details[open] > *:not(summary) {
  animation: fadeIn 200ms ease;
}

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

/* ── Hero load choreography ── */

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

:where(.hero, .docs-hero, .pricing-hero, .blog-hero, .stats-hero, .post-hero) > * {
  animation: riseIn 500ms cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}

:where(.hero, .docs-hero, .pricing-hero, .blog-hero, .stats-hero, .post-hero) > *:nth-child(2) {
  animation-delay: 70ms;
}

:where(.hero, .docs-hero, .pricing-hero, .blog-hero, .stats-hero, .post-hero) > *:nth-child(3) {
  animation-delay: 140ms;
}

:where(.hero, .docs-hero, .pricing-hero, .blog-hero, .stats-hero, .post-hero) > *:nth-child(4) {
  animation-delay: 210ms;
}

/* ── Active nav link ── */

nav a[aria-current="page"] {
  color: var(--accent);
}

/* ── Mobile table wrapper ── */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Responsive: small mobile ── */

@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }

  pre {
    font-size: 13px;
    padding: 12px;
    border-radius: 0;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: break-word;
  }

  pre code {
    font-size: 13px;
    word-break: break-all;
    overflow-wrap: break-word;
  }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Chart data-table equivalents (stats pages): scroll inside the disclosure
   rather than overflowing the page on narrow screens. */
.chart-data-table > div {
  overflow-x: auto;
  max-width: 100%;
}

/* ── Record tabs (company and facility pages) ──
   Added by main.js. Without the script the sections below stay stacked. */

.record-tabs-list {
  display: flex;
  gap: 0;
  margin: 24px 0 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-strong);
  scroll-margin-top: 96px;
  scrollbar-width: thin;
}

.record-tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.record-tab:hover {
  color: var(--text);
}

.record-tab[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.record-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* A link to a section lands with the tab list still in view under the sticky
   header. The sections carry an inline 96px margin for the stacked layout. */
.record-tabs-ready > [role="tabpanel"] {
  scroll-margin-top: 168px !important;
}

.record-tabs-ready > [role="tabpanel"] > h2:first-child {
  margin-top: 24px;
}

/* A panel hidden as "until-found" keeps a zero-height box, so drop its margin. */
.record-tabs-ready > [role="tabpanel"][hidden] {
  margin: 0;
}

.record-tabs-ready > [role="tabpanel"][hidden]:not([hidden="until-found"]) {
  display: none;
}

@media print {
  .record-tabs-list {
    display: none;
  }

  .record-tabs-ready > [role="tabpanel"][hidden] {
    display: block !important;
    content-visibility: visible !important;
  }
}

/* A link to a row or heading inside a tab lands below the sticky header. */
.record-tabs-ready > [role="tabpanel"] [id] {
  scroll-margin-top: 96px;
}

/* ── Soft corners (2026-11-14) ──
   Page content only: everything here sits under <main>, so the shared
   header and footer keep their current look. Cards and panels get a
   rounded corner and a faint lift instead of a hard 1px frame; controls
   get a smaller radius; tags become pills. */
main {
  --soft-radius: 14px;
  --soft-radius-sm: 10px;
  --soft-edge: rgba(14, 20, 32, 0.08);
  --soft-lift: 0 1px 2px rgba(14, 20, 32, 0.04), 0 10px 30px -12px rgba(14, 20, 32, 0.12);
}

main :is(.card, .tool-card, .toc, .cta-box, .tool-tile, .sidebar-card, .text-block, details:not(td details)) {
  border-radius: var(--soft-radius);
  border-color: var(--soft-edge);
}

main :is(.card, .tool-tile, .cta-box) {
  box-shadow: var(--soft-lift);
}

main .card:hover {
  box-shadow: var(--soft-lift);
}

/* A ledger grid becomes separate tiles: no shared hairline, a gap instead. */
main :is(.grid-3, .grid-2x2):has(> .card) {
  gap: 12px;
  background: transparent;
  border: 0;
}

main :is(.grid-3, .grid-2x2) > .card {
  border: 1px solid var(--soft-edge);
}

main details:not(td details) + details {
  margin-top: 8px;
}

main :is(.btn-primary, .btn-secondary),
main .cta-box a.btn-primary {
  border-radius: var(--soft-radius-sm);
}

main :is(input, textarea, select, .api-key-box) {
  border-radius: var(--soft-radius-sm);
}

main :is(.badge, .tag) {
  border-radius: 999px;
}

main .tag {
  padding: 1px 10px;
}

main .callout,
main .entity-summary {
  border: 0;
  border-radius: var(--soft-radius-sm);
  padding: 14px 18px;
}

/* Caution callouts keep their navy accent, drawn inside the rounded edge. */
main .callout {
  box-shadow: inset 3px 0 0 var(--accent);
}

main .letter-nav a {
  border-radius: 8px;
}

main .tool-tile:hover,
main .tool-tile:focus-within {
  border-color: var(--accent);
}

main :is(pre, code) {
  border-radius: 8px;
}

main pre {
  border-radius: var(--soft-radius-sm);
}

/* ── Company record dossier (2026-11-14) ──
   Company pages only (main:has(.dossier-head)): a soft grey page with white
   cards, headline counts with UI SDK meters, a bar chart with UI SDK
   tooltips, a UI SDK timeline of recent activity and pill-shaped tabs. */
main:has(.dossier-head) {
  --dossier-card-shadow: 0 1px 2px rgba(14, 20, 32, 0.05), 0 12px 32px -16px rgba(27, 58, 143, 0.28);
  background:
    radial-gradient(1200px 420px at 15% -80px, #dfe7fb 0%, transparent 70%),
    #f4f6fa;
}

.dossier-head {
  margin: 20px 0 28px;
}

.dossier-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.dossier-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
}

.dossier-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.dossier-pill-ok { background: var(--r-color-ok-wash); color: var(--r-color-ok); }
.dossier-pill-warn { background: var(--r-color-warn-wash); color: var(--r-color-warn); }
.dossier-pill-danger { background: var(--r-color-danger-wash); color: var(--r-color-danger); }
.dossier-pill-muted { background: var(--r-color-paper-sunk); color: var(--r-color-ink-muted); }
.dossier-pill-navy { background: var(--r-color-oxblood-wash); color: var(--accent); }

.dossier-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dossier-stat,
.dossier-card,
main:has(.dossier-head) .entity-section {
  background: var(--r-color-paper);
  border-radius: 18px;
  box-shadow: var(--dossier-card-shadow);
}

.dossier-stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
}

.dossier-stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.dossier-stat-value {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.dossier-stat-sub {
  color: var(--text-muted);
  font-size: 0.8rem;
}

ui-meter.dossier-meter { display: block; }
.dossier-meter ui-meter-track {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--r-color-paper-sunk);
  overflow: hidden;
}
.dossier-meter ui-meter-indicator {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 999px;
  background: var(--r-color-danger);
}

.dossier-overview {
  display: grid;
  gap: 24px;
  margin: 12px 0 16px;
}
.dossier-overview.has-aside {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}

.dossier-card {
  padding: 24px;
}

.dossier-card h3,
.dossier-chart h3 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  line-height: 1.3;
}

.dossier-bars {
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: 200px;
}

.dossier-bars ui-tooltip,
.dossier-bars ui-tooltip-trigger {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
}

/* Screen-reader-only text for each year bar's description (aria-describedby). */
.dossier-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dossier-bar {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  font: inherit;
  cursor: default;
}

.dossier-bar-fill {
  width: 100%;
  max-width: 44px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(0deg, var(--accent), var(--r-color-accent-light));
  transition: opacity 150ms ease;
}

.dossier-bar.is-empty .dossier-bar-fill {
  background: var(--r-color-rule);
}

.dossier-bar:hover .dossier-bar-fill,
.dossier-bar:focus-visible .dossier-bar-fill {
  opacity: 0.8;
}

.dossier-bar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dossier-bar-value {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.dossier-bar-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.dossier-tip {
  max-width: 280px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--r-color-ink);
  color: var(--r-color-paper);
  font-size: 0.8rem;
  line-height: 1.4;
  box-shadow: 0 10px 30px -10px rgba(14, 20, 32, 0.5);
}

ui-timeline {
  display: flex;
  flex-direction: column;
}

.dossier-event {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  padding-bottom: 18px;
}

.dossier-event:last-child { padding-bottom: 0; }

.dossier-event ui-timeline-marker {
  grid-row: 1;
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 4px var(--r-color-paper);
}

.dossier-event ui-timeline-connector {
  position: absolute;
  top: 16px;
  bottom: 0;
  left: 5px;
  width: 2px;
  background: var(--r-color-rule);
}

.dossier-event:last-child ui-timeline-connector { display: none; }

.dossier-event :is(ui-timeline-time, ui-timeline-title, ui-timeline-description) {
  display: block;
  grid-column: 2;
}

.dossier-event ui-timeline-time {
  grid-row: 1;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dossier-event ui-timeline-title {
  margin-top: 2px;
  font-weight: 600;
}

.dossier-event ui-timeline-title a { color: var(--text); }

.dossier-event ui-timeline-description {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.dossier-event-ok ui-timeline-marker { background: var(--r-color-ok); }
.dossier-event-warn ui-timeline-marker { background: #c08a2d; }
.dossier-event-danger ui-timeline-marker { background: var(--r-color-danger); }
.dossier-event-navy ui-timeline-marker { background: var(--accent); }

main:has(.dossier-head) .entity-section {
  padding: 24px 28px;
  margin-bottom: 24px;
}

main:has(.dossier-head) .entity-section h2 {
  border-bottom: 0;
  padding-bottom: 0;
}

main:has(.dossier-head) .entity-section .entity-section {
  padding: 0;
  box-shadow: none;
}

main:has(.dossier-head) .record-tabs-list {
  gap: 4px;
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 2px rgba(14, 20, 32, 0.06);
  backdrop-filter: blur(8px);
}

main:has(.dossier-head) .record-tab {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
}

main:has(.dossier-head) .record-tab[aria-selected="true"] {
  background: var(--accent);
  color: var(--r-color-paper);
}

@media (max-width: 900px) {
  .dossier-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dossier-overview.has-aside { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .dossier-stat { padding: 16px; }
  .dossier-card { padding: 18px; }
  .dossier-bars { gap: 4px; height: 170px; }
  main:has(.dossier-head) .entity-section { padding: 18px 16px; border-radius: 14px; }
}

/* Inside a section card, the chart and timeline are tinted panels, not cards. */
main:has(.dossier-head) .entity-section .dossier-card {
  background: var(--r-color-paper-raised);
  box-shadow: none;
  border-radius: 14px;
}

.dossier-overview { align-items: start; }

.dossier-card .dossier-event ui-timeline-marker { box-shadow: 0 0 0 4px var(--r-color-paper-raised); }

/* Collapsed record-tab panels (hidden="until-found") keep their box, so drop the card chrome. */
main:has(.dossier-head) .entity-section[hidden] {
  padding: 0;
  margin: 0;
  box-shadow: none;
  background: none;
}

/* ══════════════════════════════════════════════════════════════
   mobile-fixes.css — Global mobile spacing & padding overrides
   Applied after style.css on every page.
   ══════════════════════════════════════════════════════════════ */

/* ── Global spacing improvements (all viewports) ── */
.section {
  padding: var(--section-space);
}

.section-title {
  margin-bottom: clamp(1.25rem, 2.4vw, 1.75rem);
}

.section-title h2,
.section h2,
.stat-section h2,
.content-section h2 {
  margin-top: 2.75rem;
  margin-bottom: 0.9rem;
}

.content-section h3 {
  margin-top: 2.1rem;
  margin-bottom: 0.8rem;
}

.section p,
.content-section p,
.card p,
.pricing-card p,
.blog-card p,
.faq details p,
.account-hero p,
.signup-hero p,
.docs-hero p,
.pricing-hero p,
.blog-hero p {
  line-height: var(--line-height-body);
}

.pricing-grid {
  gap: 2rem;
}

.pricing-card {
  gap: 22px;
  padding: 26px;
}

.helper-grid {
  gap: 1.75rem;
}

/* Ledger grids keep their 1px shared-hairline gap */
.grid-3,
.grid-2-desktop {
  gap: 1px;
}

.card {
  padding: var(--card-padding);
}

.blog-list,
.tool-grid,
.faq-grid {
  gap: 1.125rem;
}

.faq {
  padding: 72px 0 84px;
}

.faq details + details {
  margin-top: 18px;
}

.faq details summary {
  padding: 16px 18px;
}

.data-table {
  width: 100%;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  line-height: 1.45;
}

/* ── Medium desktop / tablet landscape (≤1024px) ── */
@media (max-width: 1024px) {
  .signup-hero,
  .account-hero {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1.75rem !important;
  }

  .docs-layout {
    gap: 1.75rem;
  }

  .pricing-grid {
    gap: 1.5rem;
  }

  .blog-card h2 {
    font-size: 1.25rem;
  }

  .hero-actions,
  .pricing-cta,
  .billing-actions {
    align-items: stretch;
  }
}

/* ── Tablet & Mobile (≤768px) ── */
@media (max-width: 768px) {

  /* 1. Horizontal Padding — increase breathing room on edges */
  .container {
    padding-left: 22px !important;
    padding-right: 22px !important;
  }

  .section-title {
    margin-bottom: 1.25rem;
  }

  /* Hero: force single-column + prevent overlaps */
  .hero {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }

  .pricing-hero,
  .docs-hero,
  .signup-hero,
  .blog-hero,
  .account-hero {
    padding-top: 40px !important;
    padding-bottom: 28px !important;
  }

  .hero h1 {
    font-size: 1.6rem !important;
    line-height: 1.15 !important;
  }

  .hero p {
    font-size: 0.95rem !important;
  }

  .pricing-hero h1,
  .docs-hero h1,
  .signup-hero h1,
  .blog-hero h1,
  .account-hero h1 {
    font-size: 1.9rem !important;
    line-height: 1.15 !important;
  }

  .pricing-hero p,
  .docs-hero p,
  .signup-hero p,
  .blog-hero p,
  .account-hero p {
    font-size: 1rem !important;
    line-height: 1.65 !important;
    margin-top: 0.75rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .pricing-cta .btn-primary,
  .pricing-cta .btn-secondary,
  .billing-actions .btn-secondary {
    justify-content: center;
  }

  .hero-panel {
    padding: 16px !important;
  }

  /* Copy button should not overlap code on mobile */
  .connect-block .copy-btn {
    position: static !important;
    width: 100%;
    margin: 8px 0 12px 0;
    border-radius: 10px;
    font-size: 0.85rem;
    min-height: 40px;
  }

  .connect-block pre {
    font-size: 11px !important;
    word-break: break-all !important;
    white-space: pre-wrap !important;
    padding-top: 12px !important;
  }

  /* Metrics grid (home page) */
  .metrics {
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem;
  }

  /* Tool list — single column */
  .tool-list {
    grid-template-columns: 1fr !important;
  }

  /* 2. Vertical Spacing — section headings & content */
  .section {
    padding: 40px 0;
  }

  .section + .section {
    margin-top: 0.5rem;
  }

  .section h2,
  .stat-section h2,
  .content-section h2 {
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
  }

  .section h2 + p,
  .stat-section h2 + p,
  .content-section h2 + p,
  .section-title + .grid-3,
  .section-title + .grid-2-desktop {
    margin-top: 1rem;
  }

  .section-title {
    margin-bottom: 1.25rem;
  }

  .content-section h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
  }

  /* Ledger grids: keep shared hairlines on mobile */
  .grid-3 {
    gap: 1px;
  }

  .card {
    padding: 20px;
  }

  /* Ledger-grid cards keep the 1px shared hairline; no extra margin */
  :not(.grid-3):not(.grid-2x2) > .card + .card {
    margin-top: 12px;
  }

  .card h3 {
    margin-bottom: 0.75rem;
  }

  .card p {
    line-height: 1.7;
  }

  /* 3. Pricing page — card internal spacing */
  .pricing-card {
    gap: 18px;
    padding: 22px;
  }

  .pricing-card ul {
    margin-top: 6px;
  }

  .pricing-card .price {
    margin-bottom: 0.5rem;
  }

  .pricing-card > div {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
  }

  .pricing-card li {
    margin-bottom: 10px;
  }

  .pricing-grid {
    gap: 1.5rem;
  }

  /* Pricing CTA — "Coming Soon" / "Join waitlist" spacing */
  .pricing-cta {
    gap: 12px;
    margin-top: 1rem;
  }

  /* FAQ breathing room (pricing & general) */
  .faq {
    padding: 48px 0 56px;
  }

  details + details {
    margin-top: 14px;
  }

  .faq details summary {
    padding: 14px 16px;
  }

  .faq details p {
    padding: 4px 4px 8px;
    line-height: 1.7;
  }

  .faq-grid {
    gap: 16px;
  }

  /* Tables — allow horizontal scroll on mobile */
  .data-table,
  .table-compact {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .data-table th,
  .data-table td,
  .table-compact th,
  .table-compact td,
  .tool-card th,
  .tool-card td {
    vertical-align: top;
    line-height: 1.45;
  }

  /* /stats pages: narrow tables (up to four columns) fit the screen and wrap
     instead of scrolling sideways. Wider tables keep the scroll above. */
  .stat-section .data-table:not(:has(tr > :nth-child(5))) {
    display: table;
    width: 100%;
    table-layout: auto;
    white-space: normal;
  }

  .stat-section .data-table:not(:has(tr > :nth-child(5))) td {
    overflow-wrap: anywhere;
  }

  /* 4. Docs page — code blocks & readability */
  .content-section {
    margin-bottom: 2.5rem;
  }

  .content-section p {
    line-height: 1.7 !important;
    margin-bottom: 1rem;
  }

  .tool-card {
    padding: 18px;
    margin-bottom: 0;
  }

  .tool-card p {
    line-height: 1.7 !important;
  }

  .tool-card pre {
    padding: 1rem !important;
    margin: 1rem 0 !important;
  }

  pre {
    padding: 1rem !important;
    margin: 1rem 0;
  }

  .tool-card code,
  .content-section code,
  p code {
    padding: 2px 6px;
  }

  .tool-grid {
    gap: 1.25rem;
  }

  .blog-card {
    padding: 20px;
    gap: 0.75rem;
  }

  .blog-card h2 {
    font-size: 1.2rem;
    line-height: 1.3;
  }

  .blog-meta {
    font-size: 0.82rem;
  }

  /* Docs callout */
  .callout {
    padding: 16px;
    margin-bottom: 1.25rem;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .callout code {
    word-break: break-all;
  }

  .callout p {
    line-height: 1.65;
  }

  /* 5. Stats pages — tables, cards, charts */

  /* Tables: scrollable with momentum */
  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Stats big-number cards */
  .big-numbers {
    gap: 1rem;
    margin-bottom: 2.5rem;
  }

  .big-number-card {
    padding: 20px;
  }

  /* Chart containers */
  .chart-wrap {
    margin: 1.5rem 0;
    padding: 16px;
  }

  /* Stat sections */
  .stat-section {
    margin-bottom: 3rem;
  }

  .stat-section h2 {
    padding-bottom: 10px;
    margin-bottom: 12px;
  }

  .stat-section .section-intro {
    margin-bottom: 1.25rem;
    line-height: 1.65;
  }

  .stat-sentence {
    margin: 1.25rem 0;
    line-height: 1.6;
  }

  /* FAQ items in stats pages */
  .faq-item {
    margin-bottom: 1.25rem;
    padding: 20px 22px;
  }

  .faq-item h3 {
    margin-bottom: 0.625rem;
  }

  .faq-item p {
    line-height: 1.65;
    margin-bottom: 0.625rem;
  }

  /* 6. Signup page — form spacing */
  .form-card {
    padding: 24px;
  }

  .form-card form {
    gap: 1.25rem;
  }

  .form-card label {
    margin-bottom: 0.5rem;
  }

  .form-card button[type="submit"],
  .form-card .btn-primary {
    margin-top: 0.75rem;
  }

  .helper-grid {
    gap: 1.25rem;
    margin-top: 2rem;
  }

  .helper-grid .card {
    padding: 20px;
  }

  .result-card {
    margin-top: 1.5rem;
    padding: 20px;
  }

  /* TOC spacing */
  .toc {
    margin-bottom: 2rem;
    padding: 18px 20px;
  }

  .toc li {
    margin-bottom: 0;
  }

  .toc a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 0;
  }

  /* Bar chart rows */
  .bar-row {
    margin-bottom: 10px;
  }

  /* Two-col grids */
  .two-col {
    gap: 1.5rem;
  }

  /* Metrics grid (home page) */
  .metrics {
    gap: 1rem;
  }

  .metrics div {
    padding: 16px;
  }

  /* Hero sections */
  .pricing-hero,
  .docs-hero,
  .signup-hero,
  .blog-hero,
  .account-hero {
    padding-top: 40px !important;
    padding-bottom: 28px !important;
  }

  .pricing-hero p,
  .docs-hero p,
  .signup-hero p,
  .blog-hero p,
  .account-hero p {
    line-height: 1.65 !important;
    margin-top: 0.75rem;
  }

  /* Stats hero */
  .stats-hero {
    padding: 40px 0 24px;
  }

  .stats-hero .subtitle {
    line-height: 1.6;
  }

  /* CTA section in stats pages */
  .cta-section {
    margin-top: 2rem;
    padding: 28px 24px;
  }
}


/* ── Small Mobile (≤600px) ── */
@media (max-width: 600px) {
  .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .section {
    padding: 28px 0;
  }

  .hero {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }

  .hero h1 {
    font-size: 1.4rem !important;
  }

  .pricing-hero h1,
  .docs-hero h1,
  .signup-hero h1,
  .blog-hero h1,
  .account-hero h1 {
    font-size: 1.6rem !important;
    line-height: 1.2 !important;
  }

  .pricing-hero p,
  .docs-hero p,
  .signup-hero p,
  .blog-hero p,
  .account-hero p {
    font-size: 0.98rem !important;
    line-height: 1.65 !important;
  }

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

  .section h2,
  .stat-section h2,
  .content-section h2 {
    margin-top: 2rem;
  }

  .pricing-card {
    padding: 20px;
    gap: 16px;
  }

  .pricing-grid {
    gap: 1.25rem;
  }

  .blog-card {
    padding: 18px;
  }

  .blog-card h2 {
    font-size: 1.15rem;
    line-height: 1.3;
  }

  .stats-hero {
    padding: 28px 0 16px;
  }

  .stat-section {
    margin-bottom: 2.5rem;
  }

  .big-numbers {
    margin-bottom: 2rem;
  }

  .form-card,
  .account-form {
    padding: 20px;
  }

  .form-card form,
  .account-form form {
    gap: 1.25rem;
  }

  .result-card,
  .account-details {
    padding: 18px;
  }

  .signup-hero,
  .docs-hero,
  .blog-hero,
  .account-hero {
    padding: 28px 0 20px !important;
  }

  .tool-card {
    padding: 16px;
  }

  .tool-card pre {
    padding: 0.875rem;
    margin: 0.875rem 0;
  }

  .tool-card pre code {
    word-break: break-all;
    white-space: pre-wrap;
    font-size: 13px;
  }

  .content-section table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .content-section th,
  .content-section td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .content-section td code {
    word-break: break-all;
  }

  .content-section h2 {
    font-size: 1.35rem;
  }

  .content-section h3 {
    font-size: 1.1rem;
  }

  .content-section {
    margin-bottom: 2rem;
  }

  .hero-panel pre {
    font-size: 11px !important;
  }

  .faq {
    padding: 32px 0 44px;
  }

  .faq-grid {
    gap: 12px;
  }
}

/* ── Large phones (≤414px) ── */
@media (max-width: 414px) {
  .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .hero h1,
  .pricing-hero h1,
  .docs-hero h1,
  .signup-hero h1,
  .blog-hero h1,
  .account-hero h1 {
    font-size: 1.45rem !important;
    line-height: 1.22 !important;
  }

  .hero p,
  .pricing-hero p,
  .docs-hero p,
  .signup-hero p,
  .blog-hero p,
  .account-hero p {
    font-size: 0.95rem !important;
    line-height: 1.64 !important;
  }

  .card,
  .pricing-card,
  .blog-card,
  .tool-card,
  .form-card,
  .account-form,
  .result-card,
  .account-details {
    padding: 16px !important;
  }

  .blog-card h2 {
    font-size: 1.1rem;
  }

  .tool-card table,
  .data-table {
    font-size: 0.82rem;
  }
}

/* ── Compact phones (≤375px) ── */
@media (max-width: 375px) {
  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .hero h1,
  .pricing-hero h1,
  .docs-hero h1,
  .signup-hero h1,
  .blog-hero h1,
  .account-hero h1 {
    font-size: 1.32rem !important;
  }

  .hero-actions {
    gap: 10px;
  }

  .btn-primary,
  .btn-secondary {
    padding-left: 16px;
    padding-right: 16px;
  }
}
