/* AlgosWay Tools v3 (2026-10-25): the public site's design system. Public build only; the private dashboard keeps
   styles.css. Self-hosted OFL fonts (Geist and Geist Mono, same origin; licence files ship beside them).
   Five colour themes (the owner, 2026-10-25): crimson (v2's original look, the default), ocean, light, gold and violet,
   chosen in the header and kept by site-theme.js (html[data-theme]).
   Rules (as v2): brand and accent colours never colour numbers. Numbers use only the data tokens (gain, loss,
   neutral), always with a sign and a glyph; where a theme's accent sits near the loss hue (gold), the loss token
   moves away from it. Charts use a neutral or theme colour that carries no gain/loss meaning.
   3D lives in the frame only (the landing stage of sourced rule cards, the header medallion, a drifting aura and a
   pointer tilt on the landing's tool cards): CSS transforms and opacity only, nothing that implies returns, and
   all of it stops under prefers-reduced-motion. Minimum text size 12px. WCAG 2.2 AA contrast in every theme
   (checked on every route by tests/v3-browser.cjs). */
/* the fonts are preloaded in the head and block briefly (same origin, small), so text never reflows when they arrive */
@font-face { font-family: "Geist"; src: url("geist-latin-v1401.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: block; }
@font-face { font-family: "Geist Mono"; src: url("geist-mono-latin-v1401.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: block; }

/* ---------- theme 1 (default): crimson, the original v2 look ---------- */
:root {
  color-scheme: dark;
  --page: #060506; --surface: #121011; --surface-2: #1b1718; --sunken: #0c0a0b; --glass: rgba(18, 16, 17, 0.86);
  --line: #2a2224; --line-2: #3a2e30; --border: var(--line);
  --ink: #f4eeec; --ink-2: #cbbfbc; --muted: #a29693;
  --accent: #e3192f; --accent-hi: #ff4053; --accent-deep: #b3101f; --accent-ink: #ffffff; --accent-wash: rgba(227, 25, 47, 0.16);
  --button-hover: #b3101f; --focus: #ff4053; --ring: rgba(255, 72, 72, 0.14); --ring-strong: rgba(255, 88, 88, 0.3);
  --emblem: #d6b77a; --wordmark: #d6b77a;
  --gain: #2ec4b6; --loss: #f2a33a; --neutral: #cbbfbc;
  --gain-mark: #1fa898; --loss-mark: #cf7f1a; --gain-wash: rgba(31, 168, 152, 0.15); --loss-wash: rgba(207, 127, 26, 0.17);
  --cal-gain: #2ec4b6; --cal-loss: #f2a33a;
  --chart-line: #ece4e2; --chart-grid: #2a2224; --chart-axis: #a89b98; --chart-base: #9a8e8c;
  --fan-outer: rgba(236, 228, 226, 0.12); --fan-inner: rgba(236, 228, 226, 0.26); --fan-line: #ece4e2;
  --wf-step: #7d706d; --wf-total: #d9cfcc;
  --aura-1: rgba(200, 10, 30, 0.30); --aura-2: rgba(120, 0, 20, 0.34);
  --stage-line: rgba(255, 64, 83, 0.28); --stage-glow: rgba(227, 25, 47, 0.28);
  --radius: 16px; --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.45);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: var(--font);
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --header-h: 64px;
}
/* ---------- theme 2: ocean (calm blue on deep navy) ---------- */
:root[data-theme="ocean"] {
  color-scheme: dark;
  --page: #0b0f14; --surface: #121821; --surface-2: #18202b; --sunken: #0e141b; --glass: rgba(18, 24, 33, 0.86);
  --line: #232d39; --line-2: #33404f;
  --ink: #e9eef4; --ink-2: #c0c9d5; --muted: #95a1b0;
  --accent: #7ea4ff; --accent-hi: #a3bdff; --accent-deep: #5f8cf5; --accent-ink: #0b0f14; --accent-wash: rgba(126, 164, 255, 0.14);
  --button-hover: #a3bdff; --focus: #a3bdff; --ring: rgba(126, 164, 255, 0.2); --ring-strong: rgba(126, 164, 255, 0.45);
  --emblem: #7ea4ff; --wordmark: #e9eef4;
  --gain: #2ec4b6; --loss: #f2a33a; --neutral: #c0c9d5;
  --gain-mark: #1fa898; --loss-mark: #cf7f1a; --gain-wash: rgba(31, 168, 152, 0.16); --loss-wash: rgba(207, 127, 26, 0.17);
  --cal-gain: #2ec4b6; --cal-loss: #f2a33a;
  --chart-line: #e9eef4; --chart-grid: #232d39; --chart-axis: #a2adbb; --chart-base: #8e9aa9;
  --fan-outer: rgba(126, 164, 255, 0.16); --fan-inner: rgba(126, 164, 255, 0.32); --fan-line: #a3bdff;
  --wf-step: #4f6ea8; --wf-total: #7ea4ff;
  --aura-1: rgba(60, 110, 230, 0.22); --aura-2: rgba(20, 60, 140, 0.30);
  --stage-line: rgba(126, 164, 255, 0.3); --stage-glow: rgba(126, 164, 255, 0.24);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}
/* ---------- theme 3: light (clean, paper white) ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f5f7fa; --surface: #ffffff; --surface-2: #f0f3f7; --sunken: #eef2f6; --glass: rgba(255, 255, 255, 0.9);
  --line: #dde3ea; --line-2: #c3ccd7;
  --ink: #101820; --ink-2: #344150; --muted: #556170;
  --accent: #2458d3; --accent-hi: #1b46ad; --accent-deep: #1b46ad; --accent-ink: #ffffff; --accent-wash: rgba(36, 88, 211, 0.09);
  --button-hover: #1b46ad; --focus: #1b46ad; --ring: rgba(36, 88, 211, 0.18); --ring-strong: rgba(36, 88, 211, 0.42);
  --emblem: #2458d3; --wordmark: #101820;
  --gain: #0b7468; --loss: #9c4f05; --neutral: #4a5563;
  --gain-mark: #14a091; --loss-mark: #d4861f; --gain-wash: rgba(20, 160, 145, 0.12); --loss-wash: rgba(212, 134, 31, 0.13);
  --cal-gain: #075a51; --cal-loss: #7a3d03;
  --chart-line: #1d2733; --chart-grid: #e3e8ee; --chart-axis: #556170; --chart-base: #6b7685;
  --fan-outer: rgba(36, 88, 211, 0.14); --fan-inner: rgba(36, 88, 211, 0.28); --fan-line: #1b46ad;
  --wf-step: #7f9bd8; --wf-total: #2458d3;
  --aura-1: rgba(36, 88, 211, 0.10); --aura-2: rgba(20, 160, 145, 0.08);
  --stage-line: rgba(36, 88, 211, 0.24); --sheen: rgba(36, 88, 211, 0.08); --stage-glow: rgba(36, 88, 211, 0.14);
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.06), 0 8px 24px rgba(16, 24, 32, 0.07);
}
/* ---------- theme 4: gold (v2's gold variant): gold chrome; the loss colour moves to coral, away from gold ---------- */
:root[data-theme="gold"] {
  color-scheme: dark;
  --page: #090806; --surface: #15130e; --surface-2: #1d1a13; --sunken: #100e0a; --glass: rgba(21, 19, 14, 0.86);
  --line: #2c271c; --line-2: #3d3626;
  --ink: #f3ede0; --ink-2: #d2c8b4; --muted: #a89c84;
  --accent: #d6b77a; --accent-hi: #e8cf98; --accent-deep: #b8975a; --accent-ink: #15130e; --accent-wash: rgba(214, 183, 122, 0.14);
  --button-hover: #e8cf98; --focus: #e8cf98; --ring: rgba(214, 183, 122, 0.14); --ring-strong: rgba(214, 183, 122, 0.32);
  --emblem: #d6b77a; --wordmark: #d6b77a;
  --gain: #2ec4b6; --loss: #ff7a7a; --neutral: #d2c8b4;
  --gain-mark: #1fa898; --loss-mark: #e0484f; --gain-wash: rgba(31, 168, 152, 0.15); --loss-wash: rgba(224, 72, 79, 0.15);
  --cal-gain: #2ec4b6; --cal-loss: #ff8f8f;
  --chart-line: #f3ede0; --chart-grid: #2c271c; --chart-axis: #b3a68c; --chart-base: #a89c84;
  --fan-outer: rgba(214, 183, 122, 0.14); --fan-inner: rgba(214, 183, 122, 0.30); --fan-line: #e8cf98;
  --wf-step: #8f7a4f; --wf-total: #d6b77a;
  --aura-1: rgba(214, 183, 122, 0.16); --aura-2: rgba(120, 90, 30, 0.22);
  --stage-line: rgba(214, 183, 122, 0.3); --stage-glow: rgba(214, 183, 122, 0.2);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.45);
}
/* ---------- theme 5: violet (graphite with a soft violet accent) ---------- */
:root[data-theme="violet"] {
  color-scheme: dark;
  --page: #0b0a10; --surface: #16141d; --surface-2: #1e1b27; --sunken: #110f17; --glass: rgba(22, 20, 29, 0.86);
  --line: #2a2635; --line-2: #3a3448;
  --ink: #efecf6; --ink-2: #c9c3d9; --muted: #a29bb5;
  --accent: #a78bfa; --accent-hi: #c4b5fd; --accent-deep: #8b5cf6; --accent-ink: #120f1a; --accent-wash: rgba(167, 139, 250, 0.15);
  --button-hover: #c4b5fd; --focus: #c4b5fd; --ring: rgba(167, 139, 250, 0.16); --ring-strong: rgba(167, 139, 250, 0.36);
  --emblem: #c4b5fd; --wordmark: #efecf6;
  --gain: #2ec4b6; --loss: #f2a33a; --neutral: #c9c3d9;
  --gain-mark: #1fa898; --loss-mark: #cf7f1a; --gain-wash: rgba(31, 168, 152, 0.15); --loss-wash: rgba(207, 127, 26, 0.17);
  --cal-gain: #2ec4b6; --cal-loss: #f2a33a;
  --chart-line: #efecf6; --chart-grid: #2a2635; --chart-axis: #a9a2bc; --chart-base: #8f88a3;
  --fan-outer: rgba(167, 139, 250, 0.15); --fan-inner: rgba(167, 139, 250, 0.32); --fan-line: #c4b5fd;
  --wf-step: #6d5bb0; --wf-total: #a78bfa;
  --aura-1: rgba(139, 92, 246, 0.22); --aura-2: rgba(60, 30, 140, 0.28);
  --stage-line: rgba(167, 139, 250, 0.3); --stage-glow: rgba(139, 92, 246, 0.24);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); background: var(--page); }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); font: 16px/1.6 var(--font); font-feature-settings: "ss01"; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
button[aria-disabled="true"] { cursor: progress; opacity: 0.7; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: 32px; line-height: 1.15; } h2 { font-size: 21px; line-height: 1.3; } h3 { font-size: 17px; line-height: 1.35; } h4 { font-size: 15px; }
small { font-size: 12px; }
strong, b { font-weight: 650; }
svg { display: block; }
.num, .pnl, .kpi-value, .rule-value, .status, .timer-clock, table td.n, table th.n { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 200; background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: 8px; border: 2px solid var(--focus); }
.skip-link:focus { top: 12px; }

/* numbers: sign, glyph and the data tokens only */
.pnl { display: inline-flex; align-items: baseline; gap: 0.3em; white-space: nowrap; }
.pnl .glyph { font-size: max(12px, 0.7em); }
.tone-gain { color: var(--gain); }
.tone-loss { color: var(--loss); }
.tone-zero, .tone-unknown { color: var(--neutral); }
.tone-plain { color: var(--ink-2); }

/* ---------- ambience: a slowly drifting glow behind the page (decorative, never over text contrast) ---------- */
.aura { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aura::before, .aura::after { content: ""; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; will-change: transform; }
.aura::before { background: radial-gradient(circle, var(--aura-1), transparent 62%); left: -25vmax; top: -32vmax; animation: drift1 28s ease-in-out infinite alternate; }
.aura::after { background: radial-gradient(circle, var(--aura-2), transparent 60%); right: -30vmax; bottom: -38vmax; animation: drift2 34s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate3d(18vmax, 12vmax, 0) scale(1.1); } }
@keyframes drift2 { to { transform: translate3d(-16vmax, -12vmax, 0) scale(1.15); } }

/* ---------- layout and shared components ---------- */
.content { max-width: 1200px; margin: 0 auto; padding: 40px 32px 56px; outline: none; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.page-heading h1 { font-size: 32px; }
.page-heading p { margin-top: 8px; color: var(--ink-2); font-size: 16px; max-width: 720px; }
.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.info-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.kpi { display: flex; flex-direction: column; min-height: 120px; padding: 20px; }
.kpi-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.kpi-value { margin-top: 10px; font-size: 26px; font-weight: 600; line-height: 1.2; color: var(--ink); }
.kpi-foot { margin-top: auto; padding-top: 10px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.panel-head p { margin-top: 4px; font-size: 14px; color: var(--muted); }
.chart-card, .table-card { min-width: 0; }
.info-card { padding: 22px; }
.info-card h2 { margin: 0 0 8px; }
.info-card > h3 { margin-bottom: 10px; }
.info-card p { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.info-card .panel-head { padding: 0 0 4px; }
.detail-list { display: grid; margin: 12px 0 0; padding: 0; list-style: none; }
.detail-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 15px; }
.detail-list li:last-child { border-bottom: 0; }
.detail-list b { color: var(--ink); font-weight: 600; text-align: right; }
.detail-list small { flex-basis: 100%; color: var(--muted); }
.detail-list.compact li { padding: 8px 0; }
.small-note { margin-top: 10px; color: var(--muted); font-size: 14px; }
.callout { padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 15px; }
.callout strong { color: var(--ink); }
.callout p { margin: 4px 0 8px; }
.tag { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.pill.gray { color: var(--ink-2); }
select { max-width: 100%; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 550; white-space: nowrap; transition: background 150ms, border-color 150ms, transform 150ms, box-shadow 150ms; }
.button:hover { border-color: var(--accent); background: var(--accent-wash); }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; box-shadow: 0 8px 24px -10px var(--accent); }
.button.primary:hover { background: var(--button-hover); border-color: var(--button-hover); }
.button.small { min-height: 36px; padding: 7px 13px; font-size: 14px; }
.button.danger { border-color: var(--loss-mark); }

/* tables (stacked into cards on small screens) */
.table-wrap { overflow-x: auto; padding: 8px 8px 10px; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
th.n, td.n { text-align: right; }
.actual-empty { padding: 22px 12px; color: var(--muted); text-align: center; }

/* ---------- public shell: header, menus, footer ---------- */
.pub { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.pub [hidden] { display: none !important; }
.pub-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: saturate(1.2) blur(12px); -webkit-backdrop-filter: saturate(1.2) blur(12px); }
.pub-header-inner { max-width: 1200px; margin: 0 auto; padding: 8px 32px; min-height: var(--header-h); display: flex; align-items: center; gap: 18px; flex-wrap: nowrap; }
.pub-brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; flex: none; }
.pub-brand .wordmark { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--wordmark); }
.pub-brand .pub-tag { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line-2); }
.emblem .emblem-core, .layer .emblem-core { fill: currentColor; }
/* the 3D medallion: six copies of the emblem at increasing depth, swaying (never side-on, so it stays legible) */
.medallion { position: relative; flex: none; width: 34px; height: 34px; perspective: 420px; }
.medallion::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--ring-strong); box-shadow: 0 0 14px var(--stage-glow); }
.medallion .spin { position: absolute; inset: 0; transform-style: preserve-3d; animation: sway3d 7s ease-in-out infinite alternate; will-change: transform; }
.medallion .layer { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--emblem); opacity: 0.18; }
.medallion .l0 { transform: translateZ(-6px); } .medallion .l1 { transform: translateZ(-4.8px); opacity: 0.24; } .medallion .l2 { transform: translateZ(-3.6px); opacity: 0.32; }
.medallion .l3 { transform: translateZ(-2.4px); opacity: 0.42; } .medallion .l4 { transform: translateZ(-1.2px); opacity: 0.56; } .medallion .front { transform: translateZ(0); opacity: 1; filter: drop-shadow(0 0 4px var(--stage-glow)); }
@keyframes sway3d { from { transform: rotateX(12deg) rotateY(-32deg); } to { transform: rotateX(12deg) rotateY(32deg); } }
.pub-nav { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; margin-left: auto; min-width: 0; }
.pub-nav > a, .nav-more > summary { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-size: 15px; white-space: nowrap; }
.pub-nav > a:hover, .nav-more > summary:hover { color: var(--ink); background: var(--surface-2); }
.pub-nav a.active, .nav-menu nav a.active, .more-list a.active { color: var(--accent-hi); background: var(--accent-wash); font-weight: 600; }
.nav-more { position: relative; }
.nav-more > summary { list-style: none; gap: 6px; cursor: pointer; }
.nav-more > summary::-webkit-details-marker, .theme-menu > summary::-webkit-details-marker, .nav-menu > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after, .nav-menu > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.nav-more[open] > summary::after, .nav-menu[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.more-list, .theme-list, .nav-menu nav { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; display: grid; padding: 8px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35); }
.more-list { width: 220px; }
.more-list a, .nav-menu nav a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: 9px; color: var(--ink-2); font-size: 15px; }
.more-list a:hover, .nav-menu nav a:hover { background: var(--surface-2); color: var(--ink); }
.pub-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.theme-menu { position: relative; display: none; }
.js .theme-menu { display: block; }
.theme-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface); color: var(--ink-2); font-size: 14px; cursor: pointer; }
.theme-menu > summary:hover { border-color: var(--accent); color: var(--ink); }
.swatch { display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, var(--accent) 0 50%, var(--surface-2) 50% 100%); box-shadow: 0 0 0 1px var(--line-2); }
.sw-crimson { background: linear-gradient(135deg, #e3192f 0 50%, #121011 50% 100%); }
.sw-ocean { background: linear-gradient(135deg, #7ea4ff 0 50%, #121821 50% 100%); }
.sw-light { background: linear-gradient(135deg, #2458d3 0 50%, #ffffff 50% 100%); }
.sw-gold { background: linear-gradient(135deg, #d6b77a 0 50%, #15130e 50% 100%); }
.sw-violet { background: linear-gradient(135deg, #a78bfa 0 50%, #16141d 50% 100%); }
.theme-list { width: 210px; gap: 2px; }
.theme-list button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 9px; color: var(--ink-2); font-size: 15px; text-align: left; }
.theme-list button small { margin-left: auto; color: var(--muted); font-size: 12px; }
.theme-list button:hover { background: var(--surface-2); color: var(--ink); }
.theme-list button[aria-pressed="true"] { color: var(--ink); background: var(--accent-wash); font-weight: 600; }
.theme-list button[aria-pressed="true"]::after { content: "✓"; margin-left: 6px; color: var(--accent-hi); }
.theme-list button[aria-pressed="true"] small { margin-left: auto; }
.nav-menu { display: none; position: relative; }
.nav-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 550; cursor: pointer; }
.nav-menu nav { width: min(300px, calc(100vw - 32px)); }
.nav-menu .menu-sub { padding: 10px 12px 4px; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.pub-main { flex: 1; width: 100%; }
.pub-footer { border-top: 1px solid var(--line); background: var(--glass); }
.pub-footer-inner { max-width: 1200px; margin: 0 auto; padding: 22px 32px 30px; display: grid; gap: 10px; color: var(--muted); font-size: 14px; }
.pub-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.pub-footer nav a { display: inline-flex; align-items: center; min-height: 24px; color: var(--ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.pub-footer nav a:hover { color: var(--ink); text-decoration-color: var(--accent); }
.pub-footer p { max-width: 900px; }

/* ---------- landing: one hero, four tools, a short list, two lines ---------- */
.landing { display: grid; gap: 56px; }
.landing-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 40px; align-items: center; padding: 24px 0 8px; }
.landing-hero h1 { margin-top: 14px; font-size: 52px; line-height: 1.05; letter-spacing: -0.03em; max-width: 640px; }
.landing-hero .lede { max-width: 580px; margin-top: 18px; color: var(--ink-2); font-size: 18px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-actions .button { min-height: 48px; padding: 12px 22px; font-size: 16px; }
.hero-note { margin-top: 18px; color: var(--muted); font-size: 14px; }

/* the 3D stage: the three sourced rule cards as a slowly turning stack (CSS 3D, frame only) */
.hero-stage { position: relative; height: 500px; perspective: 1200px; perspective-origin: 50% 35%; }
.stage-glow { position: absolute; left: 50%; top: 50%; width: 420px; height: 420px; margin: -210px 0 0 -210px; border-radius: 50%; background: radial-gradient(circle, var(--stage-glow), transparent 65%); animation: glow 7s ease-in-out infinite alternate; pointer-events: none; }
@keyframes glow { from { opacity: 0.55; transform: scale(0.94); } to { opacity: 1; transform: scale(1.06); } }
.stack3d { position: absolute; inset: 0; transform-style: preserve-3d; animation: stackTurn 16s ease-in-out infinite alternate; will-change: transform; }
@keyframes stackTurn { from { transform: rotateX(16deg) rotateY(-24deg); } to { transform: rotateX(9deg) rotateY(24deg); } }
.slot { position: absolute; left: 50%; top: 50%; width: 350px; margin: -52px 0 0 -175px; transform-style: preserve-3d; }
.slot-1 { transform: translate3d(-64px, -156px, -110px); }
.slot-2 { transform: translate3d(0, 0, 0); }
.slot-3 { transform: translate3d(64px, 156px, 110px); }
.slot .rule-row { animation: bob 5.5s ease-in-out infinite alternate; backface-visibility: hidden; }
.slot-2 .rule-row { animation-delay: -1.8s; } .slot-3 .rule-row { animation-delay: -3.6s; }
@keyframes bob { from { transform: translateZ(0); } to { transform: translate3d(0, -6px, 26px); } }
.stage-floor { position: absolute; left: 50%; top: 50%; width: 620px; height: 620px; margin: -310px 0 0 -310px; transform: translateY(250px) rotateX(90deg); background-image: linear-gradient(var(--stage-line) 1px, transparent 1px), linear-gradient(90deg, var(--stage-line) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 62%); mask-image: radial-gradient(circle, #000 0%, transparent 62%); pointer-events: none; }
.stage-orbit { position: absolute; left: 50%; top: 50%; width: 500px; height: 500px; margin: -250px 0 0 -250px; border-radius: 50%; border: 1.5px dashed var(--ring-strong); box-shadow: 0 0 28px var(--stage-glow), inset 0 0 28px var(--stage-glow); transform: rotateX(76deg); animation: orbit 26s linear infinite; pointer-events: none; }
.stage-orbit::before { content: ""; position: absolute; left: 50%; top: -4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--accent-hi); box-shadow: 0 0 12px var(--accent); }
/* a soft light sweeps across each card now and then (transform only) */
.slot .rule-row::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, var(--sheen, rgba(255, 255, 255, 0.07)) 50%, transparent 65%); transform: translateX(-110%); animation: sheen 7s ease-in-out infinite; pointer-events: none; }
.slot-2 .rule-row::after { animation-delay: 2.3s; } .slot-3 .rule-row::after { animation-delay: 4.6s; }
@keyframes sheen { 0%, 55% { transform: translateX(-110%); } 85%, 100% { transform: translateX(110%); } }
@keyframes orbit { from { transform: rotateX(76deg) rotateZ(0deg); } to { transform: rotateX(76deg) rotateZ(360deg); } }
.rule-row { position: relative; overflow: hidden; display: grid; gap: 6px; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--ring) inset; }
.rule-row .rr-plan { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.rule-row .rr-value { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.rule-row .rr-value span:first-child { color: var(--ink-2); font-size: 15px; }
.rule-row .rr-value b { font-family: var(--mono); font-size: 16px; font-weight: 600; color: var(--ink); }
.rule-row .rr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.rule-row .rr-meta a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); }
.rule-row .status { display: inline-flex; align-items: center; padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--ink-2); white-space: nowrap; font-size: 12px; }

.section-title { margin-bottom: 18px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tool-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tool-card { display: flex; flex-direction: column; gap: 10px; padding: 24px 22px; color: var(--ink); transition: border-color 200ms, box-shadow 200ms; }
.tool-card h3 { font-size: 19px; }
.tool-card p { color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.tool-card .go { margin-top: auto; padding-top: 6px; color: var(--accent-hi); font-weight: 600; font-size: 15px; }
.tool-card .go::after { content: " →"; }
.tool-card:hover { border-color: var(--ring-strong); }
/* tilt: the landing's tool cards lean toward a fine pointer (site-theme.js sets --rx/--ry), at most 4 degrees */
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 450ms cubic-bezier(.2, .7, .2, 1), border-color 200ms, box-shadow 200ms; }
.tilt.tilting { transition: transform 90ms linear, border-color 200ms, box-shadow 200ms; box-shadow: var(--shadow), 0 22px 44px -12px rgba(0, 0, 0, 0.5), 0 0 30px var(--ring); }
.tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 300ms; background: radial-gradient(380px circle at var(--gx, 50%) var(--gy, 50%), var(--accent-wash), transparent 45%); }
.tilt.tilting::after { opacity: 1; }
.more-tools ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 32px; margin: 0; padding: 0; list-style: none; }
.more-tools li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.more-tools li a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink); font-weight: 600; font-size: 16px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-2); }
.more-tools li a:hover { text-decoration-color: var(--accent-hi); }
.more-tools li span { color: var(--muted); font-size: 15px; }
.legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }

/* ---------- legal pages ---------- */
.legal { max-width: 800px; margin: 0 auto; display: grid; gap: 18px; }
.legal h1 { font-size: 34px; }
.legal .updated { color: var(--muted); font-size: 14px; margin-top: 6px; }
.legal section { display: grid; gap: 8px; }
.legal h2 { margin-top: 10px; font-size: 21px; }
.legal p, .legal li { color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.legal ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legal .caps { color: var(--ink); font-size: 14px; letter-spacing: 0.01em; }
.legal .cftc-box { padding: 16px 18px; border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 12px; background: var(--surface); }
.legal .cftc-box p { color: var(--ink); font-size: 14px; }
.legal .cftc-box .src { margin-top: 8px; color: var(--muted); font-size: 13px; }
.legal table.storage { margin-top: 4px; font-size: 14px; }
.legal table.storage code, .legal code { font-family: var(--mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.legal .table-wrap { padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.draft-banner { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border: 1px dashed var(--accent); border-radius: 12px; background: var(--accent-wash); color: var(--ink); font-size: 14px; line-height: 1.5; }

/* ---------- tool overrides on top of tools.css (public look) ---------- */
.tool a.ext, .tool .link { color: var(--accent-hi); text-decoration-color: color-mix(in srgb, var(--accent-hi) 45%, transparent); }
.tool .tool-tabs button[aria-selected="true"] { color: var(--accent-hi); border-color: var(--accent); background: var(--accent-wash); font-weight: 600; }
.tool .tool-tabs button { min-height: 42px; background: var(--surface); font-size: 15px; }
.tool-dialog { background: var(--surface); border-color: var(--line-2); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.tool-dialog::backdrop { background: rgba(4, 4, 6, 0.6); }
.tool .results-empty { background: var(--surface); border-color: var(--line-2); }
.tool .tool-warning { background: var(--surface-2); }
.tool input[type="text"], .tool input[type="number"], .tool input[type="date"], .tool input[type="time"], .tool input[type="url"], .tool input[type="search"], .tool textarea, .tool select { min-height: 44px; background: var(--sunken); border-color: var(--line-2); font-size: 16px; }
.tool input:focus-visible, .tool select:focus-visible, .tool textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.tool .check input, .tool .seg input { accent-color: var(--accent); }
.tool .hist svg, .tool .jr-eq svg { background: var(--sunken); }
.tool .cal td { background: var(--sunken); }
/* calendar: the shade comes from the theme's own gain and loss marks, and the amounts use an ink that keeps 4.5:1 */
.pub .tool .cal td.gain { background: color-mix(in srgb, var(--gain-mark) calc(var(--heat, 0.12) * 100%), var(--surface)); }
.pub .tool .cal td.loss { background: color-mix(in srgb, var(--loss-mark) calc(var(--heat, 0.12) * 100%), var(--surface)); }
.pub .tool .cal td.gain .v { color: var(--cal-gain); } .pub .tool .cal td.loss .v { color: var(--cal-loss); }
.pub .tool .row-bad td { background: var(--loss-wash); }
/* a figure inside a sentence reads better in the text face (the mono face spaces the decimal point) */
.pub .tool .readout b.num { font-family: var(--font); font-variant-numeric: tabular-nums; }
.tool .status-edited { border-color: var(--accent); }
.tool legend, .tool .legend-like { font-family: var(--display); }
/* the CFTC Rule 4.41 statement: small and quiet, always visible beside the simulated results (binding) */
.pub .tool .cftc { color: var(--muted); font-size: 12px; line-height: 1.5; letter-spacing: 0; }
.pub .tool .flag { border: 1px solid var(--ring-strong); background: var(--surface-2); color: var(--ink); }
.pub .tool .status { font-size: 12px; padding: 1px 6px; }
.tool .button.tiny { min-height: 32px; }

/* ---------- v3 revision 4: plans (tags, the plan panel, upgrade prompts), Pro, Edge Lab and the pricing page ---------- */
.tier-tag { display: inline-flex; align-items: center; margin-left: 8px; padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; line-height: 1.5; white-space: nowrap; }
.tool-card .tier-tag { align-self: flex-start; margin-left: 0; }
.more-tools li .tier-tag { margin-left: 0; font-size: 12px; }
.more-list .more-sub { padding: 10px 12px 4px; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.more-list { width: 250px; }
.more-list a .tier-tag, .nav-menu nav a .tier-tag { margin-left: auto; }
.pub-nav > a.nav-pricing[aria-current="page"], .nav-menu nav a.nav-pricing[aria-current="page"] { color: var(--accent-hi); background: var(--accent-wash); font-weight: 600; }
.lab-tools .hint { margin: -4px 0 10px; color: var(--muted); font-size: 15px; }
.lab-tools > p:last-child { margin-top: 16px; }
.plan-gate { display: grid; gap: 10px; max-width: 720px; margin-top: 18px; padding: 24px 22px; }
.plan-gate .form-actions, .pricing-page .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.plan-gate h2 { font-size: 21px; }
.plan-gate p { color: var(--ink-2); line-height: 1.6; }
.upgrade-note { margin: 6px 0 0; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.upgrade-note .link { margin-left: 4px; font-weight: 600; }
.pub .tool .account-card { display: grid; gap: 10px; }
.pub .tool [data-part="account-form"] h2 { margin-bottom: 8px; }
.pub .tool .rs-plan { display: grid; gap: 8px; align-content: start; }
.pub .tool .rs-plan > h3, .pub .tool .rs-plan p { margin: 0; }
.pub .tool .rs-plan .table-wrap { padding: 0; }
@media (max-width: 560px) { .pub .tool .rs-plan { padding: 16px; } .pub .tool table.resample th, .pub .tool table.resample td { padding: 8px 6px; } }
.pub .tool .rs-plan .rule-note { color: var(--muted); font-size: 13px; }
.pub .tool .rs-history { color: var(--ink); font-size: 14px; line-height: 1.55; }
.pub .tool table.resample th[scope="col"] { white-space: normal; }
.pub .tool table.resample th[scope="row"] { color: var(--ink-2); font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; white-space: normal; text-align: left; }
.pub .tool table.resample th[scope="row"] { width: 48%; }
.pub .tool table.resample td, .pub .tool .nowrap { white-space: nowrap; }
.pub .tool .rs-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.pub .tool .account-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.pub .tool .standing { padding: 12px 14px; border: 1px solid var(--line-2); border-left: 3px solid var(--line-2); border-radius: 12px; background: var(--surface-2); color: var(--ink); font-size: 14px; line-height: 1.55; }
.pub .tool .lab-card { display: grid; gap: 8px; align-content: start; }
.pub .tool .lab-card h3 { font-size: 16px; }
.pub .tool .lab-value { color: var(--ink); font-size: 15px; line-height: 1.55; }
.pub .tool .explain > summary { display: inline-flex; align-items: center; min-height: 32px; color: var(--accent-hi); font-size: 14px; cursor: pointer; }
.pub .tool .explain p { margin-top: 4px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.pub .tool [data-audit] { font-size: 12px; }
.pub .tool details.audit-plan > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; list-style: none; }
.pub .tool details.audit-plan > summary::-webkit-details-marker { display: none; }
.pub .tool details.audit-plan > summary::after { flex: none; white-space: nowrap; }
.pub .tool .audit-tally { margin-top: 4px; color: var(--ink-2); font-size: 13px; }
.pub .tool [data-audit="breach"] { border-color: var(--ink-2); color: var(--ink); font-weight: 600; }
.pub .tool [data-audit="none"] { border-style: dashed; color: var(--muted); }
.pricing-page { max-width: 1100px; margin: 0 auto; display: grid; gap: 22px; }
.pricing-head h1 { font-size: 34px; }
.pricing-head .lede { margin-top: 8px; color: var(--ink-2); font-size: 17px; line-height: 1.6; max-width: 720px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan-card { display: grid; gap: 12px; align-content: start; padding: 24px 22px; }
.plan-card h2 { font-size: 22px; }
.plan-descriptor { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.plan-price { color: var(--ink); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.plan-list { margin: 0; padding-left: 18px; display: grid; gap: 7px; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.plan-for { color: var(--ink); font-size: 15px; line-height: 1.5; }
.plan-limits { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
/* revision 5: each card ends with its button; the cards stretch so the buttons line up */
.plan-grid { align-items: stretch; }
.plan-card { display: flex; flex-direction: column; }
.plan-action { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 6px; }
.checkout { display: grid; gap: 16px; }
.checkout > .callout { margin: 0; }
.pricing-page .buy-terms > h2 { font-size: 21px; margin-bottom: 12px; }
.pricing-page .card { padding: 24px 22px; }
.pricing-page section.card > h2 { font-size: 21px; margin-bottom: 10px; }
.pricing-page section.card > p { color: var(--ink-2); line-height: 1.6; }
.pricing-page .small-note { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.pricing-page code { font-family: var(--mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.pricing-page a:not(.button) { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }
.terms-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 22px; margin: 0; }
.terms-list dt { color: var(--ink); font-weight: 600; font-size: 15px; }
.terms-list dd { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.strategy-line { margin: 16px 0 12px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.license-form { display: grid; gap: 12px; max-width: 560px; margin-top: 12px; }
.license-form .field { display: grid; gap: 6px; }
.license-form .field span { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.license-form input { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--sunken); color: var(--ink); font-family: var(--mono); font-size: 16px; }
.license-form input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.license-form .hint:empty { display: none; }
.license-form .hint { color: var(--ink-2); font-size: 14px; }
.pricing-page .button.ghost { background: transparent; }
.button:disabled, .button.primary:disabled { background: var(--surface-2); border-color: var(--line-2); color: var(--muted); box-shadow: none; cursor: not-allowed; transform: none; }
@media (max-width: 960px) { .plan-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .terms-list { grid-template-columns: minmax(0, 1fr); gap: 2px 0; } .terms-list dd { margin-bottom: 10px; } .pricing-head h1 { font-size: 28px; } }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
  .pub-nav { display: none; }
  .nav-menu { display: block; }
  .pub-actions { margin-left: auto; }
  .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-hero { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 4px; }
  .hero-stage { height: 420px; }
}
@media (max-width: 900px) {
  .content { padding: 26px 16px 36px; }
  .pub-header-inner, .pub-footer-inner { padding-left: 16px; padding-right: 16px; }
  .landing-hero h1 { font-size: 38px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing { gap: 40px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .pub-brand .pub-tag, .theme-menu .tm-text { display: none; }
  .pub-header-inner { gap: 8px; }
  .landing { gap: 32px; }
  .landing-hero { overflow: hidden; margin: 0 -16px; padding: 0 16px; }
  .landing-hero h1 { font-size: 33px; }
  .landing-hero .lede { font-size: 17px; }
  .hero-actions .button { flex: 1 1 100%; }
  .hero-stage { height: 460px; perspective: 900px; }
  .slot { width: 280px; margin: -50px 0 0 -140px; }
  .slot-1 { transform: translate3d(-22px, -124px, -70px); }
  .slot-3 { transform: translate3d(22px, 124px, 70px); }
  .stage-floor { width: 440px; height: 440px; margin: -220px 0 0 -220px; transform: translateY(200px) rotateX(90deg); }
  .stage-orbit { width: 360px; height: 360px; margin: -180px 0 0 -180px; }
  .stage-glow { width: 300px; height: 300px; margin: -150px 0 0 -150px; }
  .rule-row { padding: 12px 14px; }
  .tool-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tool-card { padding: 18px; gap: 6px; }
  .more-tools ul { grid-template-columns: minmax(0, 1fr); }
  .page-heading h1 { font-size: 26px; }
  .kpi { min-height: 0; padding: 16px; }
  .kpi-value { font-size: 21px; }
  .panel-head { padding: 16px 16px 0; }
  .detail-list li { flex-direction: column; gap: 2px; }
  .detail-list b { text-align: left; }
  .detail-list small { flex-basis: auto; }
  /* the Privacy storage list: one block per key on a phone, so the key names never break mid-word */
  .legal table.storage thead { display: none; }
  .legal table.storage tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .legal table.storage tr:last-child { border-bottom: 0; }
  .legal table.storage td { display: block; padding: 2px 0; border: 0; }
  .legal table.storage td:first-child { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
  .legal table.storage code { overflow-wrap: break-word; }
  .legal h1 { font-size: 28px; }
  .legal p, .legal li { font-size: 16px; }
  table.stack thead { display: none; }
  table.stack tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td, table.stack tbody th { display: block; padding: 0; border: 0; text-align: left; min-width: 0; overflow-wrap: anywhere; }
  table.stack td::before, table.stack tbody th::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--font); }
  table.stack tbody th { grid-column: 1 / -1; }
  table.stack td[data-label="Net"] { order: -1; grid-column: 1 / -1; font-size: 16px; font-weight: 600; }
  table.stack tr.empty-row { display: block; }
  table.stack tr.empty-row td::before { content: none; }
}
/* reduced motion: no drift, no turning stack, no sway, no tilt; the stack and medallion rest at a fixed angle */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .stack3d { transform: rotateX(12deg) rotateY(-16deg); }
  .medallion .spin { transform: rotateX(12deg) rotateY(-24deg); }
  .tilt, .tilt.tilting { transform: none !important; }
  .tilt::after { display: none; }
}
@media print {
  .pub-header, .pub-footer, .run-bar, .theme-menu, .aura, .hero-stage { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Public tools workspace. The app frame is index-only; pricing and legal pages keep their existing layout. */
.tools-workspace .pub { display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: auto 1fr auto; }
.tools-workspace .workspace-side { grid-column: 1; grid-row: 1 / 4; position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; min-width: 0; padding: 24px 14px 16px; display: flex; flex-direction: column; gap: 24px; background: var(--surface); border-right: 1px solid var(--line); }
.workspace-brand { padding: 0 10px; }
.workspace-brand .pub-brand { gap: 12px; }
.workspace-brand .pub-tag { display: none; }
.workspace-navigation { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; }
.workspace-nav-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; margin: 22px 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.workspace-nav-label:first-child { margin-top: 0; }
.workspace-nav-link { display: flex; align-items: center; gap: 11px; min-height: 40px; margin: 3px 0; padding: 9px 12px; border: 1px solid transparent; border-radius: 10px; color: var(--ink-2); font-size: 13px; line-height: 1.4; text-decoration: none; }
.workspace-nav-link svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.workspace-nav-link:hover { color: var(--ink); background: var(--surface-2); }
.workspace-nav-link.active { color: var(--ink); background: var(--accent-wash); border-color: var(--ring-strong); font-weight: 600; }
.workspace-nav-link.active svg { color: var(--accent-hi); opacity: 1; }
.workspace-side-foot { display: flex; align-items: center; gap: 8px; padding: 15px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.workspace-local-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--wordmark); }
.tools-workspace .pub-header, .tools-workspace .pub-main, .tools-workspace .pub-footer { grid-column: 2; min-width: 0; }
.tools-workspace .pub-header-inner { max-width: none; min-height: 76px; padding: 12px 28px; }
.tools-workspace .pub-header .pub-brand, .tools-workspace .pub-nav { display: none; }
.workspace-top-title { flex: 1; min-width: 0; display: grid; gap: 4px; }
.workspace-top-kicker { color: var(--muted); font-size: 12px; }
.workspace-top-title strong { color: var(--ink); font-size: 19px; font-weight: 600; }
.workspace-mobile-nav { display: none; }
.tools-workspace .pub-main { max-width: 1440px; padding: 28px 28px 48px; }
.tools-workspace .pub-footer-inner { max-width: none; padding-left: 28px; padding-right: 28px; }
.tools-workspace .landing { display: grid; gap: 28px; }
.tools-workspace .workspace-welcome { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 28px; padding: 28px; border: 1px solid var(--line-2); border-radius: 20px; background: radial-gradient(ellipse at 0 0, var(--accent-wash), transparent 70%), var(--surface); box-shadow: var(--shadow); overflow: clip; }
.workspace-welcome .hero-copy { min-width: 0; }
.tools-workspace .workspace-welcome h1 { max-width: 25ch; margin-top: 14px; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.16; letter-spacing: -.035em; }
.tools-workspace .workspace-welcome .lede { margin-top: 16px; font-size: 15px; line-height: 1.6; max-width: 44ch; }
.tools-workspace .workspace-welcome .hero-actions { margin-top: 22px; gap: 10px; }
.tools-workspace .workspace-welcome .hero-actions .button { font-size: 14px; padding: 11px 16px; min-height: 44px; }
/* Keep the same dated reference facts readable in a compact stack beside the welcome. */
.tools-workspace .workspace-welcome .hero-stage { height: auto; min-width: 0; perspective: none; }
.workspace-welcome .stack3d { position: relative; inset: auto; display: grid; gap: 10px; animation: none; transform: none; will-change: auto; }
.workspace-welcome .slot { position: relative; left: auto; top: auto; width: auto; margin: 0; transform: none; }
.workspace-welcome .slot .rule-row { animation: none; padding: 13px 15px; box-shadow: 0 5px 16px rgba(0, 0, 0, .12); }
.workspace-welcome .rule-row .rr-plan { font-size: 12px; letter-spacing: .025em; }
.workspace-welcome .rule-row .rr-value span:first-child { font-size: 13px; }
.workspace-welcome .rule-row .rr-value b { font-size: 14px; }
.workspace-welcome .stage-floor, .workspace-welcome .stage-orbit, .workspace-welcome .stage-glow { display: none; }
.workspace-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.workspace-section-head .section-title { margin-bottom: 0; }
.workspace-section-head > span { color: var(--muted); font-size: 12px; }
.tools-workspace .main-tools { margin: 0; padding: 0; }
.tools-workspace .tool-cards { gap: 14px; }
.tools-workspace .tool-card { min-height: 210px; padding: 20px; }
.workspace-tool-number { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 14px; border: 1px solid var(--ring-strong); border-radius: 10px; color: var(--wordmark); background: var(--accent-wash); font: 500 12px var(--mono); }
.tools-workspace .tool-card h3 { font-size: 17px; }
.tools-workspace .tool-card p { font-size: 13px; line-height: 1.6; }
.workspace-more { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.tools-workspace .workspace-more .more-tools { min-width: 0; margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tools-workspace .workspace-more .more-tools ul { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.tools-workspace .workspace-more .lab-tools > p { font-size: 13px; }
@media (min-width: 961px) {
  .tools-workspace .pub-header .nav-menu { display: none; }
}
@media (min-width: 961px) and (max-width: 1200px) {
  .tools-workspace .workspace-welcome { grid-template-columns: minmax(0, 1fr); }
  .tools-workspace .workspace-welcome .hero-stage { display: none; }
  .tools-workspace .workspace-welcome h1 { max-width: 33ch; }
  .tools-workspace .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-more { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .tools-workspace .pub { grid-template-columns: minmax(0, 1fr); }
  .tools-workspace .workspace-side { display: none; }
  .tools-workspace .pub-header, .tools-workspace .pub-main, .tools-workspace .pub-footer { grid-column: 1; }
  .tools-workspace .pub-header-inner { min-height: 68px; padding: 10px 20px; }
  .tools-workspace .pub-header .pub-brand { display: inline-flex; }
  .workspace-top-title { display: none; }
  .workspace-mobile-nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain; padding: 0 16px 10px; scrollbar-width: thin; }
  .workspace-mobile-nav a { flex: none; padding: 10px 12px; min-height: 40px; border-radius: 9px; font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
  .workspace-mobile-nav a.active { background: var(--accent-wash); color: var(--ink); font-weight: 600; }
  .tools-workspace .pub-main { padding: 22px 20px 40px; }
  .tools-workspace .workspace-welcome { grid-template-columns: minmax(0, 1fr); padding: 24px; }
  .tools-workspace .workspace-welcome .hero-stage { display: none; }
  .tools-workspace .workspace-welcome h1 { max-width: 30ch; font-size: clamp(26px, 4.3vw, 34px); }
  .tools-workspace .pub-footer-inner { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 600px) {
  .tools-workspace .pub-header-inner { padding: 10px 16px; gap: 8px; }
  .tools-workspace .pub-header .pub-tag { display: none; }
  .tools-workspace .pub-main { padding: 18px 16px 36px; }
  .tools-workspace .landing { gap: 22px; }
  .tools-workspace .workspace-welcome { padding: 22px 18px; }
  .tools-workspace .workspace-welcome .hero-actions .button { flex: 1 1 100%; text-align: center; }
  .tools-workspace .tool-cards { grid-template-columns: minmax(0, 1fr); }
  .tools-workspace .tool-card { min-height: 0; padding: 20px; }
  .workspace-tool-number { margin-bottom: 10px; }
  .workspace-more { grid-template-columns: minmax(0, 1fr); }
  .tools-workspace .workspace-more .more-tools { padding: 20px; }
  .workspace-section-head > span { display: none; }
}
@media print {
  .tools-workspace .pub { display: block; }
  .tools-workspace .workspace-side, .workspace-mobile-nav { display: none; }
}

/* New revision applies to DESKTOP ONLY. Mobile below961px retains exact publicv6 rules. */
@media (min-width: 961px) {

/* HQ-inspired presentation: natural document scroll, compact spacing and feedback. Tools/data are unchanged. */
.tools-workspace .pub-main { max-width: none; width: 100%; padding: 22px 24px 40px; overflow-x: clip; overflow-y: visible; }
.tools-workspace .pub-header-inner { min-height: 68px; padding: 10px 24px; }
.tools-workspace .workspace-side { padding: 22px 12px 14px; gap: 20px; }
.workspace-navigation { position: relative; }
.workspace-nav-label { margin: 16px 0 6px; }
.workspace-nav-link { position: relative; transition: background 160ms, color 160ms, border-color 160ms, transform 160ms; }
.workspace-nav-link:hover { transform: translateX(3px); }
.workspace-nav-link.active { background: linear-gradient(90deg, var(--accent-wash), var(--surface)); border-color: transparent; }
.workspace-nav-link.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent-hi); box-shadow: 0 0 10px var(--stage-glow); }
.has-active-rail .workspace-nav-link.active::before { display: none; }
.workspace-active-rail { position: absolute; z-index: 2; left: 0; top: 0; width: 3px; border-radius: 3px; pointer-events: none; background: var(--accent-hi); box-shadow: 0 0 10px var(--stage-glow); }
.workspace-active-rail.ready { transition: transform 300ms cubic-bezier(.2,.7,.2,1), height 200ms, width 200ms, opacity 160ms; }
.tools-workspace .landing { gap: 22px; }
.tools-workspace .workspace-welcome { padding: 24px; gap: 24px; }
.tools-workspace .workspace-welcome h1 { font-size: clamp(26px, 2.4vw, 34px); max-width: 29ch; }
.tools-workspace .workspace-welcome .hero-actions { margin-top: 20px; }
.tools-workspace .tool-cards { gap: 12px; }
.tools-workspace .tool-card { min-height: 182px; padding: 18px; }
.tools-workspace .tool-card .workspace-tool-number { width: 30px; height: 30px; margin-bottom: 12px; border-radius: 9px; }
.tools-workspace .tool-card p { font-size: 14px; }
.tools-workspace .workspace-more { gap: 16px; }
.tools-workspace .workspace-more .more-tools { padding: 20px; }
.tools-workspace .card { transition: border-color 200ms, box-shadow 200ms; }
.tools-workspace .card:hover { border-color: var(--ring-strong); box-shadow: var(--shadow), 0 0 26px var(--accent-wash); }
.tools-workspace .button, .tools-workspace button, .tools-workspace .theme-menu > summary { transition: background 150ms, box-shadow 150ms, transform 150ms; }
.tools-workspace .button:hover, .tools-workspace button:not(:disabled):hover { box-shadow: 0 0 0 1px var(--ring-strong), 0 0 12px var(--accent-wash); }
.tools-workspace .button:active, .tools-workspace button:not(:disabled):active, .tools-workspace .theme-menu > summary:active { transform: translateY(1px); }
@media (hover: hover) and (pointer: fine) {
  .tools-workspace .tool-card.tilting { transform: perspective(900px) rotateX(calc(var(--rx, 0deg) * .45)) rotateY(calc(var(--ry, 0deg) * .45)); }
}
@media (prefers-reduced-motion: reduce) {
  .tools-workspace .workspace-nav-link, .tools-workspace .workspace-active-rail.ready, .tools-workspace .card,
  .tools-workspace .button, .tools-workspace button, .tools-workspace .theme-menu > summary { transition: none; }
  .tools-workspace .workspace-nav-link:hover, .tools-workspace .button:active,
  .tools-workspace button:not(:disabled):active, .tools-workspace .theme-menu > summary:active,
  .tools-workspace .tool-card.tilting { transform: none; }
}

}
