/* Small Levers UI kit: brand tokens and components shared by every product page.
   Self-contained on purpose: system fonts, no images, no webfonts, no external requests, so it
   works under the products' strict CSP (img-src 'none'; font-src 'none'). Icons are inline SVG.
   Copy this file into the app's static/ folder at build time; do not fork it per product.
   Product-specific styles go in the app's own small stylesheet and use these tokens. */

:root {
  color-scheme: light dark;
  --sl-ink: #14202e;
  --sl-muted: #55616e;
  --sl-bg: #f6f4ef;
  --sl-surface: #ffffff;
  --sl-surface-2: #faf8f4;
  --sl-line: #e3ddd2;
  --sl-brand: #0e5e63;
  --sl-brand-strong: #094548;
  --sl-brand-soft: #e2f0ee;
  --sl-on-brand: #ffffff;
  --sl-accent: #f2a541;
  --sl-accent-soft: #fdf1de;
  --sl-ok: #1d7a46;
  --sl-ok-soft: #e6f4ec;
  --sl-warn: #8a5a00;
  --sl-warn-soft: #fbf1d9;
  --sl-danger: #b42318;
  --sl-danger-soft: #fdecea;
  --sl-focus: #2563eb;
  --sl-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sl-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sl-radius: 14px;
  --sl-radius-sm: 9px;
  --sl-shadow: 0 1px 2px rgb(20 32 46 / 6%), 0 8px 24px rgb(20 32 46 / 7%);
  --sl-width: 1080px;
  --sl-narrow: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sl-ink: #e9eef2;
    --sl-muted: #a3afba;
    --sl-bg: #0f171f;
    --sl-surface: #16212b;
    --sl-surface-2: #1b2833;
    --sl-line: #2a3946;
    --sl-brand: #4fb3b0;
    --sl-brand-strong: #7ccbc8;
    --sl-brand-soft: #173a3d;
    --sl-on-brand: #0b1a1c;
    --sl-accent-soft: #3a2c15;
    --sl-ok: #5cc98a;
    --sl-ok-soft: #15301f;
    --sl-warn: #e6b450;
    --sl-warn-soft: #33290f;
    --sl-danger: #f2877d;
    --sl-danger-soft: #3a1a17;
    --sl-focus: #7aa7ff;
    --sl-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--sl-font); color: var(--sl-ink); background: var(--sl-bg); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--sl-brand); text-underline-offset: 3px; }
a:hover { color: var(--sl-brand-strong); }
code, pre, kbd { font-family: var(--sl-mono); font-size: 0.9em; }
code { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--sl-focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.sl-container { width: 100%; max-width: var(--sl-width); margin: 0 auto; padding: 0 20px; }
.sl-narrow { max-width: var(--sl-narrow); }
.sl-section { padding: 56px 0; }
.sl-section--tight { padding: 32px 0; }
.sl-section-head { max-width: 640px; margin-bottom: 28px; }
.sl-section-head p { color: var(--sl-muted); }
.sl-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Brand bar */
.sl-nav { border-bottom: 1px solid var(--sl-line); background: var(--sl-surface); }
.sl-nav .sl-container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.sl-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--sl-ink); text-decoration: none; }
.sl-brand svg { width: 28px; height: 28px; flex: none; }
.sl-brand small { font-weight: 500; color: var(--sl-muted); }
.sl-nav-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.95rem; }
.sl-nav-links a { color: var(--sl-muted); text-decoration: none; }
.sl-nav-links a:hover { color: var(--sl-ink); }

/* Hero */
.sl-hero { padding: 64px 0 40px; background: radial-gradient(1200px 400px at 85% -10%, var(--sl-brand-soft), transparent 70%), var(--sl-bg); }
.sl-hero-grid { display: grid; gap: 40px; align-items: center; grid-template-columns: 1.1fr 0.9fr; }
.sl-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--sl-brand); background: var(--sl-brand-soft); border-radius: 999px; padding: 4px 12px; margin-bottom: 16px; }
.sl-lead { font-size: 1.2rem; color: var(--sl-muted); max-width: 36em; }
.sl-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 16px; }
.sl-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--sl-muted); font-size: 0.95rem; }
.sl-checks li::before { content: "✓"; color: var(--sl-ok); font-weight: 700; margin-right: 6px; }

/* Cards and steps */
.sl-card { background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: var(--sl-radius); box-shadow: var(--sl-shadow); padding: 24px; }
.sl-card--flat { box-shadow: none; }
.sl-steps { counter-reset: sl-step; list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.sl-steps li { counter-increment: sl-step; background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: var(--sl-radius); padding: 20px; }
.sl-steps li::before { content: counter(sl-step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sl-brand); color: var(--sl-on-brand); font-weight: 700; margin-bottom: 12px; }
.sl-steps h3 { margin-bottom: 4px; }
.sl-steps p { color: var(--sl-muted); margin: 0; }

/* Tool panel: the working app sits in one card with numbered stages */
.sl-tool { background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: var(--sl-radius); box-shadow: var(--sl-shadow); overflow: hidden; }
.sl-stage { padding: 24px; border-top: 1px solid var(--sl-line); }
.sl-stage:first-child { border-top: 0; }
.sl-stage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sl-stage-head h2, .sl-stage-head h3 { margin: 0; font-size: 1.15rem; }
.sl-stage-num { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--sl-brand-soft); color: var(--sl-brand); font-weight: 700; font-size: 0.9rem; }
.sl-hint { color: var(--sl-muted); font-size: 0.92rem; margin: 4px 0 0; }

/* Forms */
.sl-field { margin-bottom: 16px; }
.sl-label { display: block; font-weight: 600; margin-bottom: 6px; }
.sl-input, .sl-textarea, .sl-select { width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--sl-ink); background: var(--sl-surface-2); border: 1px solid var(--sl-line); border-radius: var(--sl-radius-sm); }
.sl-textarea { min-height: 120px; font-family: var(--sl-mono); font-size: 0.88rem; resize: vertical; }
.sl-input:focus, .sl-textarea:focus, .sl-select:focus { border-color: var(--sl-brand); outline: 3px solid var(--sl-brand-soft); }
.sl-choices { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0 0 16px; }
.sl-choices legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.sl-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--sl-line); border-radius: 999px; background: var(--sl-surface-2); cursor: pointer; font-weight: 500; }
.sl-chip:has(input:checked) { border-color: var(--sl-brand); background: var(--sl-brand-soft); }
.sl-chip input { accent-color: var(--sl-brand); width: 18px; height: 18px; margin: 0; }
/* File drop zone: a <label for="file-input"> styled as the target, with the native input visually hidden but focusable. */
.sl-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; padding: 24px; text-align: center; border: 2px dashed var(--sl-line); border-radius: var(--sl-radius); background: var(--sl-surface-2); cursor: pointer; color: var(--sl-muted); }
.sl-drop strong { color: var(--sl-ink); }
.sl-drop:hover, .sl-drop.is-over, .sl-drop:focus-within { border-color: var(--sl-brand); background: var(--sl-brand-soft); }
.sl-drop svg { width: 32px; height: 32px; color: var(--sl-brand); }
.sl-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sl-or { display: flex; align-items: center; gap: 12px; color: var(--sl-muted); font-size: 0.85rem; margin: 16px 0; }
.sl-or::before, .sl-or::after { content: ""; flex: 1; border-top: 1px solid var(--sl-line); }

/* Buttons */
.sl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; font: inherit; font-weight: 650; text-decoration: none; color: var(--sl-on-brand); background: var(--sl-brand); border: 1px solid var(--sl-brand); border-radius: var(--sl-radius-sm); cursor: pointer; transition: background 0.15s, transform 0.05s; }
.sl-btn:hover:not(:disabled) { background: var(--sl-brand-strong); color: var(--sl-on-brand); }
.sl-btn:active:not(:disabled) { transform: translateY(1px); }
.sl-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.sl-btn--secondary { color: var(--sl-brand); background: var(--sl-surface); border-color: var(--sl-line); }
.sl-btn--secondary:hover:not(:disabled) { color: var(--sl-brand-strong); background: var(--sl-brand-soft); }
.sl-btn--ghost { color: var(--sl-brand); background: transparent; border-color: transparent; padding: 0 8px; }
.sl-btn--ghost:hover:not(:disabled) { color: var(--sl-brand-strong); background: var(--sl-brand-soft); }
.sl-btn--lg { min-height: 52px; padding: 0 26px; font-size: 1.05rem; }
.sl-btn svg { width: 18px; height: 18px; }

/* Messages */
.sl-callout { display: flex; gap: 10px; padding: 12px 16px; border-radius: var(--sl-radius-sm); border: 1px solid; margin: 12px 0; }
.sl-callout--ok { color: var(--sl-ok); background: var(--sl-ok-soft); border-color: currentColor; }
.sl-callout--warn { color: var(--sl-warn); background: var(--sl-warn-soft); border-color: currentColor; }
.sl-callout--error { color: var(--sl-danger); background: var(--sl-danger-soft); border-color: currentColor; }
.sl-callout--note { color: var(--sl-muted); background: var(--sl-surface-2); border-color: var(--sl-line); }
.sl-callout > * { margin: 0; }
.sl-callout p, .sl-callout li { color: var(--sl-ink); }

/* Results */
.sl-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin: 0 0 20px; }
.sl-stat { padding: 16px; border: 1px solid var(--sl-line); border-radius: var(--sl-radius-sm); background: var(--sl-surface-2); }
.sl-stat b { display: block; font-size: 1.8rem; line-height: 1.1; }
.sl-stat span { color: var(--sl-muted); font-size: 0.9rem; }
.sl-stat--ok b { color: var(--sl-ok); }
.sl-stat--fail b { color: var(--sl-danger); }
.sl-stat--warn b { color: var(--sl-warn); }
.sl-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.sl-badge--ok { color: var(--sl-ok); background: var(--sl-ok-soft); }
.sl-badge--fail { color: var(--sl-danger); background: var(--sl-danger-soft); }
.sl-badge--warn { color: var(--sl-warn); background: var(--sl-warn-soft); }
.sl-badge--muted { color: var(--sl-muted); background: var(--sl-surface-2); }
.sl-table-wrap { overflow-x: auto; border: 1px solid var(--sl-line); border-radius: var(--sl-radius-sm); }
.sl-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.sl-table th, .sl-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--sl-line); }
.sl-table th { position: sticky; top: 0; background: var(--sl-surface-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sl-muted); }
.sl-table tr:last-child td { border-bottom: 0; }
.sl-empty { text-align: center; color: var(--sl-muted); padding: 32px 16px; }

/* Output preview: a static mock of what the user gets, shown in the hero or "what you get" */
.sl-preview { background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: var(--sl-radius); box-shadow: var(--sl-shadow); padding: 18px; font-size: 0.9rem; }
.sl-preview-bar { display: flex; gap: 6px; margin-bottom: 14px; }
.sl-preview-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--sl-line); }
.sl-preview-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--sl-line); }
.sl-preview-row:last-child { border-bottom: 0; }

/* FAQ */
.sl-faq details { border-bottom: 1px solid var(--sl-line); padding: 14px 0; }
.sl-faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.sl-faq summary::-webkit-details-marker { display: none; }
.sl-faq summary::after { content: "+"; color: var(--sl-brand); font-weight: 700; }
.sl-faq details[open] summary::after { content: "−"; }
.sl-faq details p { color: var(--sl-muted); margin: 10px 0 0; }

/* Footer */
.sl-footer { border-top: 1px solid var(--sl-line); padding: 28px 0 40px; color: var(--sl-muted); font-size: 0.9rem; }
.sl-footer .sl-container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.sl-footer a { color: var(--sl-muted); }

/* Long-form pages (guides, privacy) */
.sl-prose { max-width: var(--sl-narrow); margin: 0 auto; padding: 40px 20px 64px; font-size: 1.05rem; line-height: 1.7; }
.sl-prose h2 { margin-top: 2em; }
.sl-prose pre { overflow-x: auto; background: var(--sl-surface-2); border: 1px solid var(--sl-line); border-radius: var(--sl-radius-sm); padding: 16px; }
.sl-prose li { margin-bottom: 8px; }

@media (max-width: 820px) {
  .sl-hero { padding: 40px 0 24px; }
  .sl-hero-grid { grid-template-columns: 1fr; }
  .sl-section { padding: 40px 0; }
}
@media (max-width: 480px) {
  .sl-container { padding: 0 16px; }
  .sl-stage, .sl-card { padding: 18px; }
  .sl-actions .sl-btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
