/* ===== Jsonflat — style.css ===== */
/* Brand: green primary, IBM Plex Mono headings/data, Source Sans 3 body, 0px radius, dense */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Source+Sans+3:wght@400;500;600&display=swap');

/* --- Variables --- */
:root {
  --color-primary: #15803d;
  --color-primary-hover: #166534;
  --color-primary-badge: #bbf7d0;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-urgent: #dc2626;
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-surface-muted: #f5f5f5;
  --color-text: #171717;
  --color-text-muted: #737373;
  --color-text-placeholder: #a3a3a3;
  --color-border: #d4d4d4;
  --color-rule: #e5e5e5;

  --font-display: 'IBM Plex Mono', 'Consolas', 'SF Mono', monospace;
  --font-body: 'Source Sans 3', 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', 'SF Mono', monospace;

  --radius: 0px;
  --space-unit: 4px;
}

/* --- Dark theme (via toggle or system preference) --- */
[data-theme="dark"] {
  --color-bg: #0a0a0a;
  --color-surface: #1a1a1a;
  --color-surface-muted: #262626;
  --color-text: #e5e5e5;
  --color-text-muted: #a3a3a3;
  --color-text-placeholder: #525252;
  --color-border: #404040;
  --color-rule: #333333;
  --color-primary-badge: #14532d;
  --color-primary: #22c55e;
  --color-primary-hover: #16a34a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0a0a0a;
    --color-surface: #1a1a1a;
    --color-surface-muted: #262626;
    --color-text: #e5e5e5;
    --color-text-muted: #a3a3a3;
    --color-text-placeholder: #525252;
    --color-border: #404040;
    --color-rule: #333333;
    --color-primary-badge: #14532d;
    --color-primary: #22c55e;
    --color-primary-hover: #16a34a;
  }
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

/* --- Shared nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-rule);
}

.site-header .nav-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: calc(4 * var(--space-unit));
  padding: calc(2 * var(--space-unit)) calc(6 * var(--space-unit));
}

.site-header .logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-right: auto;
}

.site-header .logo-link svg {
  display: block;
  height: 24px;
  width: auto;
}

.site-header .nav-links {
  display: flex;
  align-items: center;
  gap: calc(3 * var(--space-unit));
  list-style: none;
}

.site-header .nav-links a {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: calc(1 * var(--space-unit)) 0;
  transition: color 150ms linear;
}

.site-header .nav-links a:hover,
.site-header .nav-links a.active {
  color: var(--color-primary);
}

/* --- Theme toggle --- */
.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  cursor: pointer;
  padding: calc(1 * var(--space-unit));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  line-height: 1;
  border-radius: var(--radius);
  transition: background-color 150ms linear, color 150ms linear;
}

.theme-toggle:hover {
  background: var(--color-surface-muted);
  color: var(--color-text);
}

.theme-toggle .icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  line-height: 1;
  font-size: 14px;
}

/* --- Page layout --- */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: calc(6 * var(--space-unit)) calc(6 * var(--space-unit)) calc(3 * var(--space-unit));
}

.page-wide {
  max-width: 100%;
  margin: 0 auto;
  padding: calc(6 * var(--space-unit)) calc(6 * var(--space-unit)) calc(3 * var(--space-unit));
}

/* --- Section eyebrow --- */
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: calc(2 * var(--space-unit));
  line-height: 1.4;
}

/* --- Section heading --- */
.section-heading {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text);
  margin-bottom: calc(3 * var(--space-unit));
}

.section-heading strong {
  color: var(--color-primary);
  font-weight: 500;
}

/* --- Section body text --- */
.section-body {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: calc(4 * var(--space-unit));
}

.section-body p {
  margin-bottom: calc(2 * var(--space-unit));
}

.section-body p:last-child {
  margin-bottom: 0;
}

/* --- Section separator --- */
.section {
  margin-bottom: calc(8 * var(--space-unit));
  padding-bottom: calc(4 * var(--space-unit));
  border-bottom: 1px solid var(--color-rule);
}

.section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

/* --- Hero (home page) --- */
.hero {
  margin-top: calc(4 * var(--space-unit));
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text);
  margin-bottom: calc(3 * var(--space-unit));
}

.hero h1 .highlight {
  color: var(--color-primary);
}

.hero .subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: calc(4 * var(--space-unit));
}

/* --- Hero split (screenshot beside headline) --- */
.hero-split {
  display: flex;
  gap: calc(4 * var(--space-unit));
  align-items: flex-start;
  margin-bottom: calc(4 * var(--space-unit));
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-shot {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--color-border);
}

@media (max-width: 700px) {
  .hero-split {
    flex-direction: column;
  }
  .hero-shot {
    width: 100%;
  }
}

/* --- Before/after code block --- */
.code-demo {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  padding: calc(3 * var(--space-unit));
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  margin-bottom: calc(6 * var(--space-unit));
}

.code-demo .label {
  display: block;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: calc(2 * var(--space-unit));
}

.code-demo .arrow {
  display: block;
  text-align: center;
  color: var(--color-primary);
  padding: calc(3 * var(--space-unit)) 0;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
}

/* --- Feature list --- */
.features {
  margin: 0;
}

.features dt {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: calc(1 * var(--space-unit));
}

.features dd {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: calc(3 * var(--space-unit));
  margin-left: 0;
}

.features dd:last-child {
  margin-bottom: 0;
}

/* --- Inline SVG figure --- */
.product-figure {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  padding: calc(4 * var(--space-unit));
  margin-bottom: calc(6 * var(--space-unit));
  overflow-x: auto;
}

.product-figure svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
}

.product-figure .fig-caption {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--color-text-muted);
  margin-top: calc(2 * var(--space-unit));
  letter-spacing: 0.03em;
}

/* --- Proof strip --- */
.proof-strip {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: calc(4 * var(--space-unit)) 0;
  margin-bottom: calc(6 * var(--space-unit));
}

.proof-cell {
  flex: 1;
  text-align: center;
  border-right: 1px solid var(--color-rule);
  padding: 0 calc(3 * var(--space-unit));
}

.proof-cell:last-child {
  border-right: none;
}

.proof-cell .number {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-primary);
  display: block;
  line-height: 1.2;
}

.proof-cell .label {
  font-size: 0.625rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: calc(1 * var(--space-unit));
  display: block;
}

/* --- Compound controls --- */
.copy-group {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
}

.copy-group .copy-value {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text);
  padding: calc(1 * var(--space-unit)) calc(2 * var(--space-unit));
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}

.copy-group .copy-btn {
  background: var(--color-surface-muted);
  border: none;
  cursor: pointer;
  padding: calc(1 * var(--space-unit)) calc(2 * var(--space-unit));
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  transition: background-color 150ms linear, color 150ms linear;
}

.copy-group .copy-btn:hover {
  background: var(--color-primary);
  color: #ffffff;
}

.copy-group .copy-btn svg {
  display: block;
  width: 12px;
  height: 12px;
}

/* --- CTA buttons --- */
.cta-row {
  display: flex;
  align-items: center;
  gap: calc(3 * var(--space-unit));
  margin-top: calc(4 * var(--space-unit));
}

.cta-primary {
  display: inline-flex;
  align-items: center;
  padding: calc(2 * var(--space-unit)) calc(6 * var(--space-unit));
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background-color 150ms linear;
}

.cta-primary:hover {
  background: var(--color-primary-hover);
}

.cta-secondary {
  display: inline-flex;
  align-items: center;
  padding: calc(2 * var(--space-unit)) calc(4 * var(--space-unit));
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background-color 150ms linear, color 150ms linear;
}

.cta-secondary:hover {
  background: var(--color-surface-muted);
  color: var(--color-text);
}

/* --- Tool area (app page) --- */
.tool-section {
  max-width: 100%;
  margin: 0 auto;
  padding: calc(4 * var(--space-unit)) calc(6 * var(--space-unit));
}

.tool-header {
  margin-bottom: calc(4 * var(--space-unit));
}

.tool-header h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
}

/* Input area */
.input-area {
  margin-bottom: calc(3 * var(--space-unit));
}

.input-area textarea {
  width: 100%;
  min-height: 200px;
  max-height: 500px;
  padding: calc(3 * var(--space-unit));
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  resize: vertical;
  border-radius: var(--radius);
}

.input-area textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.input-area textarea::placeholder {
  color: var(--color-text-placeholder);
}

/* --- Toolbar --- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(3 * var(--space-unit));
  margin-bottom: calc(3 * var(--space-unit));
  padding: calc(2 * var(--space-unit)) 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: calc(2 * var(--space-unit)) calc(4 * var(--space-unit));
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: var(--radius);
  line-height: 1.4;
  transition: background-color 150ms linear, opacity 150ms linear;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--color-accent);
  color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

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

.btn-outline:hover:not(:disabled) {
  background: var(--color-surface-muted);
}

/* --- Array mode toggle --- */
.array-mode {
  display: flex;
  align-items: center;
  gap: calc(2 * var(--space-unit));
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.array-mode select {
  padding: calc(1 * var(--space-unit)) calc(2 * var(--space-unit));
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius);
  cursor: pointer;
}

.array-mode select:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* --- Output area --- */
.output-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: calc(2 * var(--space-unit));
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.output-info .stats span {
  margin-right: calc(4 * var(--space-unit));
}

.output-info .stats strong {
  font-family: var(--font-mono);
  color: var(--color-text);
}

/* --- Table --- */
.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 500px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

table.flattened {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.5;
}

table.flattened thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

table.flattened th {
  background: var(--color-surface-muted);
  border-bottom: 2px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  padding: calc(2 * var(--space-unit)) calc(3 * var(--space-unit));
  text-align: left;
  font-weight: 500;
  font-size: 0.625rem;
  white-space: nowrap;
  color: var(--color-text);
}

table.flattened th:last-child {
  border-right: none;
}

table.flattened td {
  border-bottom: 1px solid var(--color-rule);
  border-right: 1px solid var(--color-rule);
  padding: calc(1 * var(--space-unit)) calc(3 * var(--space-unit));
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text);
}

table.flattened td:last-child {
  border-right: none;
}

table.flattened tbody tr:nth-child(even) {
  background: var(--color-surface-muted);
}

table.flattened tbody tr:hover {
  background: #e8f5e9;
  transition: background-color 150ms linear;
}

[data-theme="dark"] table.flattened tbody tr:nth-child(even) {
  background: #1f1f1f;
}

[data-theme="dark"] table.flattened tbody tr:hover {
  background: #1a3325;
}

@media (prefers-color-scheme: dark) {
  table.flattened tbody tr:nth-child(even) {
    background: #1f1f1f;
  }
  table.flattened tbody tr:hover {
    background: #1a3325;
  }
}

/* --- Column coverage badge --- */
.coverage-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  padding: 0 calc(1 * var(--space-unit));
  background: var(--color-primary-badge);
  color: var(--color-text);
  margin-left: calc(1 * var(--space-unit));
  border-radius: var(--radius);
  animation: fadeIn 300ms ease-out;
}

.coverage-badge.low {
  background: #fef9c3;
}

.coverage-badge.missing {
  background: #fecaca;
}

[data-theme="dark"] .coverage-badge.low {
  background: #422006;
  color: #fde68a;
}

[data-theme="dark"] .coverage-badge.missing {
  background: #450a0a;
  color: #fca5a5;
}

@media (prefers-color-scheme: dark) {
  .coverage-badge.low {
    background: #422006;
    color: #fde68a;
  }
  .coverage-badge.missing {
    background: #450a0a;
    color: #fca5a5;
  }
}

/* --- Error / Warning --- */
.error-message {
  padding: calc(3 * var(--space-unit));
  background: #fef2f2;
  border: 1px solid var(--color-urgent);
  color: var(--color-urgent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-bottom: calc(3 * var(--space-unit));
}

[data-theme="dark"] .error-message {
  background: #2d0a0a;
}

@media (prefers-color-scheme: dark) {
  .error-message {
    background: #2d0a0a;
  }
}

.warning-message {
  padding: calc(3 * var(--space-unit));
  background: #fefce8;
  border: 1px solid #ca8a04;
  color: #713f12;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  margin-bottom: calc(3 * var(--space-unit));
}

[data-theme="dark"] .warning-message {
  background: #2d1f0a;
  border-color: #a16207;
  color: #fde68a;
}

@media (prefers-color-scheme: dark) {
  .warning-message {
    background: #2d1f0a;
    border-color: #a16207;
    color: #fde68a;
  }
}

/* --- Hidden utility --- */
.is-hidden {
  display: none !important;
}

/* --- Character count --- */
.char-count {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
}

/* --- Empty state --- */
.empty-state {
  padding: calc(8 * var(--space-unit)) calc(3 * var(--space-unit));
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  border: 1px dashed var(--color-border);
}

/* --- History Panel --- */
.history-panel {
  display: none;
  margin-top: calc(3 * var(--space-unit));
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: calc(3 * var(--space-unit));
}

.history-panel.history-open {
  display: block;
  animation: fadeIn 200ms ease-out;
}

.history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: calc(2 * var(--space-unit));
}

.history-panel-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-clear-btn {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--color-urgent);
  background: none;
  border: 1px solid var(--color-urgent);
  padding: calc(1 * var(--space-unit)) calc(2 * var(--space-unit));
  cursor: pointer;
  border-radius: var(--radius);
  transition: background-color 150ms linear;
}

.history-clear-btn:hover {
  background: var(--color-urgent);
  color: #ffffff;
}

.history-list {
  max-height: 300px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: flex-start;
  gap: calc(2 * var(--space-unit));
  padding: calc(2 * var(--space-unit)) 0;
  border-bottom: 1px solid var(--color-rule);
  font-size: 0.75rem;
}

.history-item:last-child {
  border-bottom: none;
}

.history-item-meta {
  display: flex;
  flex-direction: column;
  gap: calc(0.5 * var(--space-unit));
  min-width: 90px;
  flex-shrink: 0;
}

.history-item-time {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--color-text-muted);
}

.history-item-rows {
  font-size: 0.625rem;
  color: var(--color-text-placeholder);
}

.history-item-preview {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--color-text);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.history-item-actions {
  display: flex;
  gap: calc(1 * var(--space-unit));
  flex-shrink: 0;
  align-items: center;
}

.history-load-btn {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  padding: calc(1 * var(--space-unit)) calc(3 * var(--space-unit));
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius);
  transition: background-color 150ms linear;
}

.history-load-btn:hover {
  background: var(--color-primary-hover);
}

.history-del-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-placeholder);
  background: none;
  border: 1px solid var(--color-border);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius);
  line-height: 1;
  transition: color 150ms linear, border-color 150ms linear;
}

.history-del-btn:hover {
  color: var(--color-urgent);
  border-color: var(--color-urgent);
}

.history-note {
  font-size: 0.625rem;
  color: var(--color-text-placeholder);
  margin-top: calc(2 * var(--space-unit));
  text-align: center;
}

/* --- Pricing page --- */
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: calc(6 * var(--space-unit));
}

.pricing-table th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  padding: calc(3 * var(--space-unit)) calc(3 * var(--space-unit));
  text-align: left;
  font-weight: 500;
}

.pricing-table td {
  padding: calc(3 * var(--space-unit));
  border-bottom: 1px solid var(--color-rule);
  font-size: 0.8125rem;
  color: var(--color-text);
  vertical-align: top;
}

.pricing-table .price {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--color-primary);
  font-weight: 500;
}

.pricing-table .feature-unavailable {
  color: var(--color-text-placeholder);
}

/* --- Mock checkout --- */
.checkout-demo {
  border: 1px solid var(--color-border);
  padding: calc(4 * var(--space-unit));
  background: var(--color-surface-muted);
  margin-bottom: calc(6 * var(--space-unit));
}

.checkout-demo .demo-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: calc(3 * var(--space-unit));
  display: block;
}

.checkout-demo form label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: calc(1 * var(--space-unit));
}

.checkout-demo form input {
  width: 100%;
  padding: calc(2 * var(--space-unit)) calc(3 * var(--space-unit));
  font-family: var(--font-body);
  font-size: 0.8125rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius);
  margin-bottom: calc(3 * var(--space-unit));
}

.checkout-demo form input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.checkout-demo .form-row {
  display: flex;
  gap: calc(3 * var(--space-unit));
}

.checkout-demo .form-row > div {
  flex: 1;
}

/* --- Legal pages --- */
.legal-section {
  margin-bottom: calc(6 * var(--space-unit));
}

.legal-section h3 {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: calc(2 * var(--space-unit));
}

.legal-section p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: calc(2 * var(--space-unit));
}

.legal-section .legal-notice {
  padding: calc(3 * var(--space-unit));
  background: #fef9c3;
  border: 1px solid #ca8a04;
  font-size: 0.8125rem;
  color: #713f12;
  margin-bottom: calc(3 * var(--space-unit));
}

[data-theme="dark"] .legal-section .legal-notice {
  background: #2d1f0a;
  border-color: #a16207;
  color: #fde68a;
}

@media (prefers-color-scheme: dark) {
  .legal-section .legal-notice {
    background: #2d1f0a;
    border-color: #a16207;
    color: #fde68a;
  }
}

/* --- Separator --- */
hr {
  border: none;
  border-top: 1px solid var(--color-rule);
  margin: calc(4 * var(--space-unit)) 0 calc(2 * var(--space-unit)) 0;
}

/* --- Footer --- */
.site-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: calc(6 * var(--space-unit)) calc(6 * var(--space-unit)) calc(8 * var(--space-unit));
  border-top: 1px solid var(--color-rule);
}

.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: calc(2 * var(--space-unit));
  margin-bottom: calc(3 * var(--space-unit));
}

.site-footer .footer-links a {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 150ms linear;
}

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

.site-footer .footer-copy {
  font-size: 0.625rem;
  color: var(--color-text-placeholder);
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .site-header .nav-inner {
    padding: calc(2 * var(--space-unit)) calc(3 * var(--space-unit));
    flex-wrap: wrap;
  }
  .site-header .nav-links {
    gap: calc(2 * var(--space-unit));
  }
  .page {
    padding: calc(4 * var(--space-unit)) calc(3 * var(--space-unit));
  }
  .tool-section {
    padding: calc(3 * var(--space-unit)) calc(3 * var(--space-unit));
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar .btn {
    justify-content: center;
  }
  table.flattened {
    font-size: 0.625rem;
  }
  .proof-strip {
    flex-direction: column;
  }
  .proof-cell {
    border-right: none;
    border-bottom: 1px solid var(--color-rule);
    padding: calc(2 * var(--space-unit)) 0;
  }
  .proof-cell:last-child {
    border-bottom: none;
  }
  .code-demo {
    font-size: 0.625rem;
    padding: calc(2 * var(--space-unit));
  }
  .checkout-demo .form-row {
    flex-direction: column;
  }
  .site-footer .footer-links {
    flex-direction: column;
  }
}