/* ==========================================================================
   Upflexity — site-wide design system
   Carried over from the home page design: Noto Sans / Noto Sans Mono, one
   1240px column aligned with the fixed nav bar, boxed "panel" bookends over
   the neural-sphere backdrop, mono uppercase labels, light + dark themes.
   Every page (public, auth, legal, dashboard, workflow editor) uses these
   tokens — never hard-code a colour in a template; add a token here instead.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --nav-h: 64px;

  /* backdrop (neural sphere) */
  --bg: #F5F6F8;
  --halo: #FFFFFF;
  --node: #243047;
  --edge: #52647F;
  --signal: #2A64D6;
  --signal-2: #17798D;
  --core: #4C84E6;
  --blend: source-over;

  /* text + lines */
  --fg: #0F1626;
  --muted: #475369;
  --subtle: #5B6679;
  --line: rgba(15, 22, 38, 0.1);
  --line-strong: rgba(15, 22, 38, 0.18);
  --hover: rgba(15, 22, 38, 0.05);

  /* surfaces */
  --nav-bg: rgba(245, 246, 248, 0.72);
  --panel-bg: rgba(255, 255, 255, 0.48);
  --panel-fg: #0F1626;
  --panel-muted: #3E4A5F;
  --panel-border: rgba(15, 22, 38, 0.08);
  --panel-shadow: 0 1px 2px rgba(15, 22, 38, 0.04), 0 28px 64px -28px rgba(15, 22, 38, 0.22);
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --surface-shadow: 0 1px 2px rgba(15, 22, 38, 0.04);
  --field-bg: #FFFFFF;
  --field-border: rgba(15, 22, 38, 0.18);
  --footer-bg: #FFFFFF;

  /* accents + actions */
  --label: #2A5BC4;
  --accent: #2A64D6;
  --cta: #343E52;
  --on-cta: #F1F4F8;
  --cta-edge: rgba(255, 255, 255, 0);
  --ghost-border: rgba(15, 22, 38, 0.2);

  /* status */
  --ok: #15803D;
  --ok-bg: rgba(22, 163, 74, 0.08);
  --ok-border: rgba(22, 163, 74, 0.28);
  --warn: #B45309;
  --warn-bg: rgba(217, 119, 6, 0.09);
  --warn-border: rgba(217, 119, 6, 0.3);
  --danger: #B91C1C;
  --danger-bg: rgba(220, 38, 38, 0.07);
  --danger-border: rgba(220, 38, 38, 0.28);
  --info: #2A64D6;

  --font-display: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ui: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Noto Sans Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* aliases kept for older stylesheets/scripts (workflows.css, workflow_editor.js) */
  --text-primary: var(--fg);
  --text-secondary: var(--muted);
  --text-muted: var(--subtle);
  --border-color: var(--line);
  --bg-primary: var(--surface);
  --bg-secondary: var(--surface-2);
  --font-sans: var(--font-ui);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0B10;
    --halo: #15171E;
    --node: #CCD8EA;
    --edge: #6A83A8;
    --signal: #6FA6FF;
    --signal-2: #74D3E5;
    --core: #4F8BFF;
    --blend: lighter;

    --fg: #E6EBF3;
    --muted: #9AA6BA;
    --subtle: #8390A6;
    --line: rgba(204, 216, 234, 0.11);
    --line-strong: rgba(204, 216, 234, 0.2);
    --hover: rgba(204, 216, 234, 0.07);

    --nav-bg: rgba(10, 11, 16, 0.6);
    --panel-bg: rgba(0, 0, 0, 0.42);
    --panel-fg: #F1F5FB;
    --panel-muted: #C3CCDA;
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-shadow: 0 0 0 transparent;
    --surface: #12141B;
    --surface-2: #0E1016;
    --surface-shadow: 0 0 0 transparent;
    --field-bg: #0C0E14;
    --field-border: rgba(204, 216, 234, 0.18);
    --footer-bg: #0C0D13;

    --label: #7FAEFF;
    --accent: #6FA6FF;
    --cta: #343E52;
    --on-cta: #E9EDF3;
    --cta-edge: rgba(255, 255, 255, 0.14);
    --ghost-border: rgba(255, 255, 255, 0.22);

    --ok: #4ADE80;
    --ok-bg: rgba(74, 222, 128, 0.08);
    --ok-border: rgba(74, 222, 128, 0.26);
    --warn: #FBBF24;
    --warn-bg: rgba(251, 191, 36, 0.08);
    --warn-border: rgba(251, 191, 36, 0.26);
    --danger: #F87171;
    --danger-bg: rgba(248, 113, 113, 0.08);
    --danger-border: rgba(248, 113, 113, 0.28);
    --info: #6FA6FF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0B10;
  --halo: #15171E;
  --node: #CCD8EA;
  --edge: #6A83A8;
  --signal: #6FA6FF;
  --signal-2: #74D3E5;
  --core: #4F8BFF;
  --blend: lighter;

  --fg: #E6EBF3;
  --muted: #9AA6BA;
  --subtle: #8390A6;
  --line: rgba(204, 216, 234, 0.11);
  --line-strong: rgba(204, 216, 234, 0.2);
  --hover: rgba(204, 216, 234, 0.07);

  --nav-bg: rgba(10, 11, 16, 0.6);
  --panel-bg: rgba(0, 0, 0, 0.42);
  --panel-fg: #F1F5FB;
  --panel-muted: #C3CCDA;
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-shadow: 0 0 0 transparent;
  --surface: #12141B;
  --surface-2: #0E1016;
  --surface-shadow: 0 0 0 transparent;
  --field-bg: #0C0E14;
  --field-border: rgba(204, 216, 234, 0.18);
  --footer-bg: #0C0D13;

  --label: #7FAEFF;
  --accent: #6FA6FF;
  --cta: #343E52;
  --on-cta: #E9EDF3;
  --cta-edge: rgba(255, 255, 255, 0.14);
  --ghost-border: rgba(255, 255, 255, 0.22);

  --ok: #4ADE80;
  --ok-bg: rgba(74, 222, 128, 0.08);
  --ok-border: rgba(74, 222, 128, 0.26);
  --warn: #FBBF24;
  --warn-bg: rgba(251, 191, 36, 0.08);
  --warn-border: rgba(251, 191, 36, 0.26);
  --danger: #F87171;
  --danger-bg: rgba(248, 113, 113, 0.08);
  --danger-border: rgba(248, 113, 113, 0.28);
  --info: #6FA6FF;
  color-scheme: dark;
}

/* ---------- base ---------- */
[hidden] { display: none !important; }
img { max-width: 100%; }
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- type ---------- */
.label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.small { font-size: 13px; }
.text-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.text-link:hover { text-decoration-thickness: 2px; }
.section-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
}
.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.022em;
  color: var(--fg);
  text-wrap: balance;
}
.intro {
  margin: 0;
  max-width: 56ch;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  text-wrap: pretty;
}
.body {
  margin: 0;
  max-width: 60ch;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}
.lead {
  margin: 0;
  max-width: 54ch;
  font-size: 20px;
  line-height: 1.6;
  text-wrap: pretty;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 56px;
}
.stack--sm { gap: 24px; }

/* ---------- buttons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 15px 24px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn--primary {
  color: var(--on-cta);
  background: var(--cta);
  box-shadow: inset 0 0 0 1px var(--cta-edge);
}
.btn--primary:hover { filter: brightness(1.2); }
.btn--ghost {
  color: var(--fg);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--ghost-border);
}
.panel .btn--ghost { color: var(--panel-fg); }
.btn--ghost:hover { background: var(--hover); }
.btn--danger {
  color: var(--danger);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--danger-border);
}
.btn--danger:hover { background: var(--danger-bg); }
.btn--sm { padding: 10px 16px; font-size: 12px; letter-spacing: 0.1em; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] {
  cursor: not-allowed;
  filter: none;
  color: var(--subtle);
  background: var(--hover);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn__arrow { font-family: var(--font-ui); letter-spacing: 0; transition: transform 0.2s ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- nav bar ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  font-family: var(--font-ui);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: 1304px;
  height: var(--nav-h);
  margin-inline: auto;
  padding-inline: 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}
@media (min-width: 720px) {
  .nav__inner { padding-inline: 32px; }
}
.body--app .nav__inner { max-width: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
  border-radius: 6px;
}
.brand__mark { width: 26px; height: 26px; flex: none; }
.brand__mark .ring,
.brand__mark .fibre { fill: none; stroke: var(--fg); stroke-width: 1.2; }
.brand__mark .ring { opacity: 0.35; }
.brand__mark .cell { fill: var(--accent); }
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.links a,
.menu-panel a:not(.cta) {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.links a:hover,
.menu-panel a:not(.cta):hover { color: var(--fg); background: var(--hover); }
.links a[aria-current="page"],
.menu-panel a[aria-current="page"] { color: var(--fg); }
.nav__user {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--subtle);
  padding: 8px 4px 8px 12px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Log out is a POST form (Django's LogoutView rejects GET); styled to match the nav links. */
.logout-form { margin: 0; display: flex; }
.link-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.link-btn:hover { color: var(--fg); background: var(--hover); }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.cta {
  flex: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-cta);
  background: var(--cta);
  box-shadow: inset 0 0 0 1px var(--cta-edge);
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 999px;
  transition: filter 0.2s ease;
}
.cta:hover { filter: brightness(1.2); }

.menu-btn {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s ease;
}
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.menu-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 16px 16px;
  border-top: 1px solid var(--line);
}
.menu-panel a:not(.cta) { font-size: 16px; padding: 12px; }
.menu-panel .link-btn { width: 100%; font-size: 16px; padding: 12px; }
.menu-panel .nav__user { padding: 12px; max-width: none; }
.menu-panel .cta { margin-top: 8px; text-align: center; padding: 12px 18px; font-size: 15px; }

@media (max-width: 719px) {
  .links, .nav__inner > .cta { display: none; }
  .menu-btn { display: inline-flex; }
}
@media (min-width: 720px) {
  .menu-panel { display: none !important; }
}
.nav a:focus-visible,
.menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  background: var(--footer-bg);
  border-top: 1px solid var(--line);
}
.footer__inner,
.footer__bottom {
  max-width: 1304px;
  margin-inline: auto;
  padding-inline: 32px;
}
.footer__inner {
  padding-block: 64px 48px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.footer__brand p {
  margin: 16px 0 0;
  max-width: 38ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
.footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.footer__col h2 {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer__col a {
  font-size: 15px;
  color: var(--fg);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.2s ease;
}
.footer__col a:hover { color: var(--accent); }
.footer__col a:focus-visible,
.footer .brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.footer__bottom { padding-block: 24px 40px; }
.footer__bottom p {
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

/* ---------- animated backdrop ---------- */
#mind {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
  background: radial-gradient(circle at 50% 50%, var(--halo) 0, var(--bg) 62vmin);
}
[data-reveal] { will-change: opacity, transform; }

/* ---------- marketing page column (home, how it works) ---------- */
.flow {
  --gap: 180px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  /* top offset centers the first block on screen; set by backdrop.js, with a fallback */
  padding: var(--hero-top, clamp(96px, 18svh, 200px)) 16px var(--gap);
}
.flow--compact { --gap: 128px; padding-top: calc(var(--nav-h) + clamp(40px, 9svh, 96px)); }
@media (min-width: 720px) {
  .flow { padding-inline: 32px; }
}
.section {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  scroll-margin-top: 100px;
}

/* ---------- boxed surfaces ---------- */
.panel {
  color: var(--panel-fg);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--panel-shadow);
}
.panel .section-title { color: var(--panel-fg); }
.panel .body,
.panel .lead { color: var(--panel-muted); }
/* Solid surface for app content (dashboard cards, forms that sit on the plain background). */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--surface-shadow);
  min-width: 0;
}
.card--tight { padding: 18px 22px; }
.card--link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card--link:hover { border-color: var(--line-strong); }
.card--link:hover .card__arrow { transform: translateX(3px); color: var(--accent); }
.card--current { border-color: var(--accent); }
.card--current::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 28px;
  width: 40px;
  height: 2px;
  background: var(--accent);
}
.card__label {
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.card__text { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.card__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--subtle);
}
.card__arrow { display: inline-block; transition: transform 0.2s ease, color 0.2s ease; color: var(--subtle); }

/* ---------- home: hero ---------- */
.hero__panel {
  max-width: 940px;
  margin-inline: auto;
  padding: 88px 80px;
}
.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}
.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.07;
  letter-spacing: -0.028em;
  text-wrap: balance;
}
.hero .actions { margin-top: 12px; }

/* ---------- problem / solution ---------- */
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 96px;
}
.split__item {
  position: relative;
  min-width: 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.split__item--answer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
}
.split__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 2.8vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.018em;
  color: var(--fg);
  text-wrap: balance;
}

/* ---------- steps ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 40px;
}
.steps--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 64px; }
.step {
  position: relative;
  min-width: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent);
}
.num {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--label);
  font-variant-numeric: tabular-nums;
}
.step h3,
.feature h3,
.industry h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.step .body,
.feature .body,
.industry .body { font-size: 16px; }

/* ---------- platform features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 80px;
  border-top: 1px solid var(--line);
}
.feature {
  position: relative;
  min-width: 0;
  padding-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feature + .feature::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40px;
  width: 1px;
  background: var(--line);
}
.feature h3 { font-size: 22px; }

/* ---------- industries / ruled lists ---------- */
.industries {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px 96px;
  align-items: start;
}
.industry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.industry {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 10px 40px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

/* ---------- ledger: label/value rows (token example, plans) ---------- */
.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.ledger__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  flex-wrap: wrap;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.ledger__key { color: var(--muted); font-size: 16px; line-height: 1.5; min-width: 0; }
.ledger__key strong { display: block; color: var(--fg); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.ledger__key span { font-size: 15px; }
.ledger__value {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ledger__value small { display: block; margin-top: 4px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--subtle); }
.ledger__value--ok { color: var(--ok); }
.note { font-size: 15px; line-height: 1.6; color: var(--muted); max-width: 64ch; }

/* ---------- closing call to action ---------- */
.closing {
  padding: 88px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px 64px;
}
.closing__text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.closing .body { font-size: 18px; max-width: 48ch; }

/* ---------- centered single-panel pages (sign in, get started, errors) ---------- */
.auth {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 40px) 16px 72px;
}
.auth__panel {
  width: 100%;
  max-width: 460px;
  padding: 48px 44px;
}
.auth__panel--wide { max-width: 580px; }
.auth__panel--center { text-align: center; }
.auth__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}
.auth__panel--center .auth__head { align-items: center; }
.auth__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.022em;
  color: var(--panel-fg);
  text-wrap: balance;
}
.auth__text { font-size: 16px; line-height: 1.6; color: var(--panel-muted); text-wrap: pretty; }
.auth__foot {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 14px;
}
.auth__foot a { color: var(--panel-muted); text-decoration: none; }
.auth__foot a:hover { color: var(--accent); }
.auth__panel--center .actions { justify-content: center; }
.auth .alert + .actions { margin-top: 24px; }
.glyph {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
}
.glyph--ok { color: var(--ok); border-color: var(--ok-border); background: var(--ok-bg); }
.error-code {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(64px, 12vw, 104px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--panel-fg);
}

/* ---------- long-form text pages (terms, privacy) ---------- */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding: calc(var(--nav-h) + clamp(48px, 10svh, 112px)) 16px 120px;
}
@media (min-width: 720px) {
  .page { padding-inline: 32px; }
}
.page--narrow { max-width: 824px; }
.page__head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 40px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.page__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.026em;
  text-wrap: balance;
}
.page__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
}
.legal {
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
}
.legal p + p { margin-top: 12px; }
.legal > p:first-child { font-size: 18px; line-height: 1.7; }
.legal h2 {
  position: relative;
  margin: 56px 0 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.legal h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent);
}
.legal strong { color: var(--fg); font-weight: 600; }
.legal ul { margin: 12px 0; padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.legal li::marker { color: var(--subtle); }
.legal a { color: var(--accent); text-underline-offset: 3px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 20px; }
.form--narrow { max-width: 420px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field__label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel .field__label { color: var(--panel-muted); }
.field__aside { font-size: 13px; color: var(--subtle); text-decoration: none; }
.field__aside:hover { color: var(--accent); }
.input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.4;
  color: var(--fg);
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input::placeholder { color: var(--subtle); }
.input:hover { border-color: var(--line-strong); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
textarea.input { resize: vertical; min-height: 96px; }
select.input {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--panel-muted);
}
.check input { margin: 3px 0 0; width: 16px; height: 16px; flex: none; accent-color: var(--accent); cursor: pointer; }
.check label { cursor: pointer; }
.check a { color: var(--fg); text-underline-offset: 3px; }
.dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 36px 24px;
  text-align: center;
  background: var(--surface-2);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); }
.dropzone p { margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.dropzone input[type="file"] { max-width: 100%; font-size: 14px; color: var(--muted); }
.dropzone input[type="file"]::file-selector-button {
  margin-right: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--ghost-border);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
}

/* ---------- alerts ---------- */
.alert {
  font-size: 14px;
  line-height: 1.55;
  border-radius: 8px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  color: var(--fg);
  background: var(--hover);
}
.alert a { color: inherit; font-weight: 600; text-underline-offset: 3px; }
.alert--error { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.alert--success { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }
.alert--warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.alert + .form, .alert + .alert { margin-top: 16px; }
.auth__head + .alert { margin-top: -8px; }
.alert-stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.alert-stack:empty { display: none; }

/* ---------- status text ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}
.status--complete, .status--resolved { color: var(--ok); }
.status--processing, .status--running, .status--in_progress { color: var(--warn); }
.status--failed { color: var(--danger); }
.status--open { color: var(--info); }
.status--pending, .status--waiting, .status--skipped, .status--closed { color: var(--subtle); }

/* ---------- responsive (marketing + auth + page) ---------- */
@media (max-width: 1080px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 40px; }
  .steps--3 { grid-template-columns: 1fr; gap: 40px; }
  .industries { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .features { grid-template-columns: 1fr; }
  .feature { padding: 28px 0; }
  .feature:last-child { padding-bottom: 0; }
  .feature + .feature::before { left: 0; right: 0; bottom: auto; width: auto; height: 1px; }
  .footer__inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .flow { --gap: 112px; }
  .flow--compact { --gap: 96px; }
  .hero__panel { padding: 56px 32px; }
  .lead { font-size: 18px; }
  .split { grid-template-columns: 1fr; gap: 48px; }
  .closing { grid-template-columns: 1fr; padding: 56px 32px; }
  .industry { grid-template-columns: 1fr; }
  .stack { gap: 40px; }
  .footer__inner,
  .footer__bottom { padding-inline: 16px; }
  .footer__inner { padding-block: 48px 32px; }
  .auth__panel { padding: 40px 28px; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger__value { text-align: left; }
}
@media (max-width: 480px) {
  .hero__panel { padding: 44px 24px; }
  .closing { padding: 44px 24px; }
  .body, .closing .body { font-size: 16px; }
  .intro { font-size: 17px; }
  .actions .btn { flex: 1 1 auto; }
  .auth__panel { padding: 36px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav *, .nav *::after, .btn, .btn__arrow, .card--link, .card__arrow { transition: none !important; }
}
