/* Quiet and precise: the brand kit's ink and paper, one mint accent for what the evidence shows,
   mono labels that read like citations, and pass and fail colours that only ever mean pass and
   fail. One sans family carries headings and text; the wordmark keeps the kit's IBM Plex Sans. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/instrument-sans-latin.woff2") format("woff2");
}

/* The wordmark's face, per the brand kit (kwikqa-brand/README.md): IBM Plex Sans SemiBold. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-latin-600.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
  /* Brand kit tokens (kwikqa-brand/brand-colors.css): brand colours for the logo and marketing,
     kept apart from the pass and fail colours below. */
  --kwikqa-ink: #0b0f17;
  --kwikqa-paper: #f4f5f7;
  --kwikqa-on-dark: #e8ecf4;
  --kwikqa-muted: #8a93a6;
  --kwikqa-coral: #ff6b57;
  --kwikqa-mint: #34d399;
  --kwikqa-coral-on-light: #d9432f;
  --kwikqa-mint-on-light: #0e9f6e;
  --kwikqa-status-pass: #16a34a;
  --kwikqa-status-fail: #dc2626;
  /* The themeable mark's colours, light; the dark themes below swap them. */
  --kwikqa-mark-stem: var(--kwikqa-ink);
  --kwikqa-mark-fail: var(--kwikqa-coral-on-light);
  --kwikqa-mark-pass: var(--kwikqa-mint-on-light);
  --kwikqa-icon-accent: var(--kwikqa-mint-on-light);

  /* Color */
  --paper: #f7f8fa;
  --sheet: #ffffff;
  --ink: #0b0f17;
  --ink-2: #464f63;
  --ink-3: #687186;
  --rule: #e4e7ee;
  --rule-2: #d1d6e0;
  /* The kit's mint; as text on light it is darkened to keep 4.5:1 contrast. */
  --accent: #0e9f6e;
  --accent-text: #087a55;
  --accent-soft: rgb(14 159 110 / 0.09);
  /* Emphasis without a status: inverted ink, e.g. "awaiting-validation". */
  --mark: #0b0f17;
  --mark-ink: #ffffff;
  /* A wash for the current docs page and marked text. */
  --mark-wash: var(--accent-soft);
  --on-ink: #ffffff;
  --console: #0b0f17;
  --console-2: #121826;
  --console-rule: rgb(255 255 255 / 0.08);
  --console-ink: #d9dee8;
  --console-dim: #8a93a6;
  --console-mark: rgb(52 211 153 / 0.14);
  --console-mark-ink: #86ebc0;
  --console-add: #5fd4a0;
  --console-del: #ff8f80;
  --pass: #17784a;
  --pass-soft: #e3f3ea;
  --fail: #b5372f;
  --fail-soft: #fbe9e7;
  --warn: #8f5600;
  --warn-soft: #fff1d1;
  --focus: #2f54ff;
  /* Chart series, in this order (checked with the dataviz palette validator on --sheet). */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --shadow-sm: 0 1px 2px rgb(11 15 23 / 0.05);
  --shadow: 0 1px 2px rgb(11 15 23 / 0.04), 0 10px 28px -14px rgb(11 15 23 / 0.16);
  --shadow-lg: 0 2px 4px rgb(11 15 23 / 0.05), 0 32px 72px -28px rgb(11 15 23 / 0.42);
  --grid-dot: rgb(11 15 23 / 0.075);
  --glow-mint: rgb(52 211 153 / 0.2);
  --glow-coral: rgb(255 107 87 / 0.12);

  /* Type */
  --font-display: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.3125rem;
  --step-3: 1.625rem;
  --step-4: clamp(1.8rem, 1.5vw + 1.15rem, 2.6rem);
  --step-5: clamp(2.35rem, 2.3vw + 1.4rem, 3.6rem);

  /* Shape */
  --radius: 14px;
  --radius-sm: 8px;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --kwikqa-mark-stem: var(--kwikqa-on-dark);
    --kwikqa-mark-fail: var(--kwikqa-coral);
    --kwikqa-mark-pass: var(--kwikqa-mint);
    --kwikqa-icon-accent: var(--kwikqa-mint);
    --paper: #0b0f17;
    --sheet: #111621;
    --ink: #e8ecf4;
    --ink-2: #a5adbf;
    --ink-3: #7f889b;
    --rule: #1c2230;
    --rule-2: #2a3243;
    --accent: #34d399;
    --accent-text: #34d399;
    --accent-soft: rgb(52 211 153 / 0.12);
    --mark: #e8ecf4;
    --mark-ink: #0b0f17;
    --on-ink: #0b0f17;
    --console: #070a10;
    --console-2: #0d121b;
    --console-rule: rgb(255 255 255 / 0.07);
    --pass: #56c48f;
    --pass-soft: rgb(86 196 143 / 0.13);
    --fail: #f2837a;
    --fail-soft: rgb(242 131 122 / 0.13);
    --warn: #f0b94e;
    --warn-soft: rgb(240 185 78 / 0.13);
    --focus: #8fa3ff;
    --series-1: #3987e5;
    --series-2: #d95926;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 12px 32px -16px rgb(0 0 0 / 0.7);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.3), 0 32px 80px -24px rgb(0 0 0 / 0.85);
    --grid-dot: rgb(232 236 244 / 0.07);
    --glow-mint: rgb(52 211 153 / 0.16);
    --glow-coral: rgb(255 107 87 / 0.1);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --kwikqa-mark-stem: var(--kwikqa-on-dark);
  --kwikqa-mark-fail: var(--kwikqa-coral);
  --kwikqa-mark-pass: var(--kwikqa-mint);
  --kwikqa-icon-accent: var(--kwikqa-mint);
  --paper: #0b0f17;
  --sheet: #111621;
  --ink: #e8ecf4;
  --ink-2: #a5adbf;
  --ink-3: #7f889b;
  --rule: #1c2230;
  --rule-2: #2a3243;
  --accent: #34d399;
  --accent-text: #34d399;
  --accent-soft: rgb(52 211 153 / 0.12);
  --mark: #e8ecf4;
  --mark-ink: #0b0f17;
  --on-ink: #0b0f17;
  --console: #070a10;
  --console-2: #0d121b;
  --console-rule: rgb(255 255 255 / 0.07);
  --pass: #56c48f;
  --pass-soft: rgb(86 196 143 / 0.13);
  --fail: #f2837a;
  --fail-soft: rgb(242 131 122 / 0.13);
  --warn: #f0b94e;
  --warn-soft: rgb(240 185 78 / 0.13);
  --focus: #8fa3ff;
  --series-1: #3987e5;
  --series-2: #d95926;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 12px 32px -16px rgb(0 0 0 / 0.7);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.3), 0 32px 80px -24px rgb(0 0 0 / 0.85);
  --grid-dot: rgb(232 236 244 / 0.07);
  --glow-mint: rgb(52 211 153 / 0.16);
  --glow-coral: rgb(255 107 87 / 0.1);
  color-scheme: dark;
}

/* Base */

/* Elements toggled with the hidden attribute stay hidden even when a class sets display. */
[hidden] {
  display: none !important;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--paper);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: var(--step-5);
  line-height: 1.04;
  letter-spacing: -0.038em;
}

h2 {
  font-size: var(--step-4);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h3 {
  font-size: var(--step-2);
  letter-spacing: -0.012em;
}

p {
  margin: 0;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--rule-2);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

code,
kbd,
pre,
.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.skip-link {
  position: absolute;
  left: max(16px, env(safe-area-inset-left, 0px));
  top: -100px;
  z-index: 50;
  background: var(--ink);
  color: var(--on-ink);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: calc(8px + env(safe-area-inset-top, 0px));
}

.draft-banner {
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--step--1);
  font-weight: 600;
  text-align: center;
  padding-block: 0.45rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 40rem;
}

/* The one phrase a headline turns on, in the accent. */
.hl {
  color: var(--accent-text);
}

/* Brand */

/* The Diff K mark at 24 px (the kit's `s` size) beside the wordmark as live text. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-family: "IBM Plex Sans", var(--font-body);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}

.logo-mark {
  width: 24px;
  height: 24px;
  flex: none;
}

.kq-stem {
  fill: var(--kwikqa-mark-stem);
}

.kq-fail {
  stroke: var(--kwikqa-mark-fail);
}

.kq-pass {
  stroke: var(--kwikqa-mark-pass);
}

/* Product icons (icon system v2): drawn in currentColor, with one accent element each. */
.icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  vertical-align: middle;
}

.kq-accent-fill {
  fill: var(--kwikqa-icon-accent, currentColor);
}

.kq-accent-stroke {
  stroke: var(--kwikqa-icon-accent, currentColor);
}

.icon-heading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.icon-heading .icon {
  color: var(--ink-2);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 600 0.9375rem / 1.2 var(--font-body);
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.14),
    0 1px 2px rgb(11 15 23 / 0.24);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--ink) 84%, var(--paper));
}

.btn-ghost {
  background: var(--sheet);
  color: var(--ink);
  border-color: var(--rule-2);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  border-color: var(--ink-3);
}

.btn-lg {
  min-height: 46px;
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
}

.btn-danger {
  background: var(--fail);
  color: var(--on-ink);
}

.btn-sm {
  min-height: 32px;
  padding: 0.3rem 0.7rem;
  font-size: 0.875rem;
}

.btn[disabled],
.btn[aria-busy="true"] {
  opacity: 0.55;
  cursor: progress;
}

/* A paid plan's button while the paid plans are coming soon: text, not a control. */
.btn-soon,
.btn-soon:hover {
  border-style: dashed;
  border-color: var(--rule-2);
  color: var(--ink-3);
  cursor: default;
}

.btn-soon:active {
  transform: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Site header */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 80%, transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  min-height: 62px;
}

.primary-nav {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.primary-nav a,
.mobile-nav nav a:not(.btn) {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
}

.primary-nav a {
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--ink);
}

.primary-nav a:hover {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.primary-nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.header-actions .btn {
  min-height: 36px;
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
}

.mobile-nav {
  display: none;
  margin-left: auto;
  position: relative;
}

.mobile-nav summary {
  list-style: none;
  display: grid;
  gap: 4px;
  place-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  cursor: pointer;
}

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

.mobile-nav summary span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.mobile-nav nav {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  gap: 0.25rem;
  min-width: 220px;
  padding: 0.75rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mobile-nav nav a:not(.btn) {
  padding: 0.5rem 0.4rem;
}

@media (max-width: 860px) {
  .primary-nav,
  .header-actions {
    display: none;
  }

  .mobile-nav {
    display: block;
  }
}

/* Sections */

.section {
  padding-block: clamp(4rem, 8vw, 6.5rem);
}

.section-sheet {
  background: var(--sheet);
  border-block: 1px solid var(--rule);
}

.section-head {
  display: grid;
  gap: 0.85rem;
  max-width: 46rem;
  margin-bottom: clamp(2.25rem, 4vw, 3.25rem);
}

/* A heading column beside its content, for short sections such as questions. */
.split {
  display: grid;
  gap: clamp(1.5rem, 4vw, 4rem);
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
    align-items: start;
  }

  .split > .section-head {
    position: sticky;
    top: 104px;
  }
}

/* Hero: the claim and the proof side by side, short enough to leave the next section in view. */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(3rem, 6vw, 5rem) clamp(3rem, 5vw, 4.25rem);
}

/* A faint dot grid that fades out from behind the terminal, and two soft glows in the kit's mint
   and coral. Decoration only. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero::before {
  background-image: radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 0);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 72% 45%, #000 20%, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 70% at 72% 45%, #000 20%, transparent 72%);
}

.hero::after {
  background:
    radial-gradient(36rem 22rem at 78% 52%, var(--glow-mint), transparent 70%),
    radial-gradient(26rem 18rem at 92% 12%, var(--glow-coral), transparent 70%);
}

.hero-grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 1040px) {
  .hero-grid {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  }
}

.hero-copy {
  display: grid;
  gap: 1.35rem;
  justify-items: start;
  min-width: 0;
}

.hero-copy h1 {
  max-width: 14em;
}

.hero-copy .lede {
  font-size: clamp(1.05rem, 0.35vw + 0.98rem, 1.18rem);
  max-width: 34rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.8rem 0.3rem 0.6rem;
  background: var(--sheet);
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
}

.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.install {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  max-width: 100%;
  min-height: 46px;
  padding: 0.3rem 0.35rem 0.3rem 1rem;
  background: var(--sheet);
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.install code {
  overflow-x: auto;
  white-space: nowrap;
}

.install code::before {
  content: "$ ";
  color: var(--ink-3);
}

.hero-note {
  font-size: var(--step--1);
  color: var(--ink-3);
}

/* What KwikQA works with, under the hero. */

.proofbar {
  border-block: 1px solid var(--rule);
  background: var(--sheet);
}

.proofbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.1rem;
}

.proofbar-names {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.proofbar-names li {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-2);
}

.proofbar-names-more {
  gap: 0.4rem 1.25rem;
}

.proofbar-names-more li {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-3);
}

.proofbar-label,
.proofbar-note {
  font-size: var(--step--1);
  color: var(--ink-3);
}

.proofbar-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.proofbar-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
}

/* Console: a terminal window that is always dark, in both themes. */

.console {
  position: relative;
  min-width: 0;
  margin: 0;
  background: var(--console);
  color: var(--console-ink);
  border: 1px solid var(--console-rule);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgb(11 15 23 / 0.06),
    var(--shadow-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.65;
}

/* Beside the hero copy on a laptop-width screen, the longest line (72 columns) still fits. */
@media (min-width: 1040px) and (max-width: 1239px) {
  .console {
    font-size: 0.6875rem;
  }
}

.console-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  background: var(--console-2);
  border-bottom: 1px solid var(--console-rule);
  color: var(--console-dim);
  font-size: 0.72rem;
}

/* Window controls, drawn with one element. */
.console-bar::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2a3242;
  box-shadow:
    15px 0 0 #2a3242,
    30px 0 0 #2a3242;
  margin-right: 30px;
}

.console-bar span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.console-bar span:last-child {
  margin-left: auto;
}

@media (max-width: 520px) {
  .console {
    font-size: 0.6875rem;
  }

  .console-bar span:last-child {
    display: none;
  }
}

.console pre {
  margin: 0;
  padding: 1.1rem 1.25rem 1.3rem;
  overflow-x: auto;
  font: inherit;
}

.c-dim {
  color: var(--console-dim);
}

.c-cmd {
  color: #ffffff;
  font-weight: 600;
}

.c-pass {
  color: var(--console-add);
}

.c-fail {
  color: var(--console-del);
}

.c-add {
  color: var(--console-add);
}

.c-del {
  color: var(--console-del);
}

.c-mark {
  background: var(--console-mark);
  color: var(--console-mark-ink);
  border-radius: 3px;
}

/* The loop: a real sequence, so it is numbered */

.steps {
  display: grid;
  gap: 1rem;
  counter-reset: step;
  padding: 0;
  margin: 0;
  list-style: none;
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.step {
  display: grid;
  gap: 0.9rem;
  align-content: start;
  padding: 1.6rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  counter-increment: step;
}

.step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.step-head::before {
  content: "0" counter(step);
  flex-basis: 100%;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-text);
}

.step-head .icon,
.rule .icon-heading .icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.55rem;
  border-radius: 10px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

.step code.cmd {
  font-size: 0.95rem;
  font-weight: 600;
}

.step p {
  color: var(--ink-2);
}

.outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

/* Chips */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--rule-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-2);
  white-space: nowrap;
}

.chip-pass {
  color: var(--pass);
  background: var(--pass-soft);
  border-color: transparent;
}

.chip-fail {
  color: var(--fail);
  background: var(--fail-soft);
  border-color: transparent;
}

.chip-warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: transparent;
}

.chip-mark {
  color: var(--mark-ink);
  background: var(--mark);
  border-color: transparent;
}

/* Guarantees: a grid of cards, three across on wide screens. */

.rules {
  display: grid;
  gap: 1rem;
}

@media (min-width: 680px) {
  .rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .rules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rules-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.rule {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.6rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.section-sheet .rule {
  background: var(--paper);
}

.rule h3 {
  font-size: var(--step-1);
}

.rule .icon-heading {
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.rule p {
  color: var(--ink-2);
}

.rule .proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.6rem;
}

/* On a phone, cards are tighter and a rule's icon sits beside its title. */
@media (max-width: 679px) {
  .step,
  .rule,
  .flow,
  .plan {
    padding: 1.25rem;
  }

  .rule .icon-heading {
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
  }
}

/* Short inline code in cards (a flag, a file name) stays on one line. */
.step p code,
.rule p code,
.flow li code {
  white-space: nowrap;
}

.flows + .muted {
  margin-top: 1.5rem;
}

.refused {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--fail);
  text-decoration: line-through;
  text-decoration-color: currentColor;
}

/* Data flow */

.flows {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .flows {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.flow {
  display: grid;
  gap: 1.1rem;
  align-content: start;
  padding: 1.6rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.flow h3 {
  font-size: var(--step-1);
}

.flow-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.flow-path span {
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: var(--sheet);
}

.flow-path span:first-child {
  border-color: transparent;
  background: var(--ink);
  color: var(--on-ink);
}

.flow-path i {
  font-style: normal;
  color: var(--ink-3);
}

.flow ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-2);
  display: grid;
  gap: 0.4rem;
}

/* Pricing */

.plans {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .plans {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .plans-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .plans-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 640px) and (max-width: 1099px) {
  .plans-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding: 1.5rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* The plan you can choose today. */
.plan-featured {
  border-color: var(--ink);
  box-shadow:
    inset 0 0 0 1px var(--ink),
    var(--shadow);
}

.plan > .btn {
  margin-top: auto;
}

.plan .plan-for {
  margin-top: -0.5rem;
  font-size: 0.86rem;
  color: var(--ink-3);
}

.plan[data-current] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.plan-name {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem 0.5rem;
  min-width: 0;
}

.plan-name h2,
.plan-name h3 {
  font-size: var(--step-1);
  overflow-wrap: anywhere;
}

/* Scoped to .plan so the card's paragraph rule below doesn't shrink the price. */
.plan .plan-price {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.plan .plan-price small {
  display: block;
  margin-top: 0.4rem;
  line-height: 1.3;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-3);
}

.plan dl {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  align-content: start;
}

.plan dl div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed var(--rule);
}

.plan dt {
  color: var(--ink-2);
}

.plan dd {
  margin: 0;
  white-space: nowrap;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.plan-limits {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-limits li {
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed var(--rule);
  color: var(--ink-2);
}

.plan-limits strong {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plan-terms {
  margin-top: 1rem;
  max-width: 62rem;
  color: var(--ink-2);
}

.plan-terms strong {
  color: var(--ink);
}

.plan-terms + .muted {
  margin-top: 0.5rem;
}

.plan p {
  font-size: 0.92rem;
  color: var(--ink-2);
}

/* Plans by tier: Hobby across the top, then Solo, Teams, and Enterprise, each offered with hosted
   models or the customer's own model key. */

.pricing {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .plan-hobby {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) minmax(0, 2fr) auto;
    align-items: center;
    gap: 1.5rem;
  }

  .plan-hobby > .btn {
    margin-top: 0;
  }
}

.plan-hobby-head {
  display: grid;
  gap: 0.6rem;
}

.plan-hobby .plan-for {
  margin-top: 0;
}

.pricing-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 0.5rem;
}

.pricing-switch-note {
  flex: 1 1 28rem;
  max-width: 48rem;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.pricing-switch-note strong {
  color: var(--ink);
}

/* Yearly or monthly prices, by the switch above; a browser without :has() shows both. */
.pricing:has(input[value="year"]:checked) [data-interval="month"],
.pricing:has(input[value="month"]:checked) [data-interval="year"] {
  display: none;
}

.tiers {
  display: grid;
  gap: 1rem;
}

@media (min-width: 1040px) {
  .tiers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tier {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding: 1.5rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.tier-head {
  display: grid;
  gap: 0.35rem;
}

.tier-head .plan-name h2,
.tier-head .plan-name h3 {
  font-size: var(--step-2);
  letter-spacing: -0.015em;
}

.tier-head p {
  font-size: 0.9rem;
  color: var(--ink-3);
}

.plan-options {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
}

.plan-option {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}

.plan-option-head {
  display: grid;
  gap: 0.15rem;
}

.plan-option-head h3,
.plan-option-head h4 {
  font-size: var(--step-0);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.plan-models {
  font-size: 0.8rem;
  color: var(--ink-3);
}

.plan-option .plan-price {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.plan-option .plan-price small {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-3);
}

.plan-option .plan-limits {
  gap: 0.4rem;
  font-size: 0.9rem;
}

.plan-option .plan-limits li {
  padding-bottom: 0.4rem;
}

.plan-option > .btn {
  margin-top: auto;
}

.plan-features {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}

.plan-features li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--ink-2);
}

.plan-features li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.45em;
  width: 0.65rem;
  height: 0.35rem;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* The comparison table: tier groups over the plan names, and the row labels kept in view while the
   table scrolls sideways. */
.compare-groups th {
  text-align: center;
  color: var(--ink);
  border-left: 1px solid var(--rule);
}

.compare-groups td,
.compare-groups th {
  background: var(--sheet);
}

.compare tbody th[scope="row"] {
  position: sticky;
  left: 0;
  background: var(--sheet);
  box-shadow: 1px 0 0 var(--rule);
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--sheet);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

thead th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--paper);
  white-space: nowrap;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

td.num,
th.num {
  text-align: right;
}

/* FAQ */

.faq {
  display: grid;
  gap: 0.6rem;
  max-width: 52rem;
}

.faq details {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  transition: border-color 140ms ease;
}

.section:not(.section-sheet) .faq details {
  background: var(--sheet);
}

.faq details[open] {
  border-color: var(--rule-2);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

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

.faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--rule-2);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink-2);
}

.faq details[open] summary::after {
  content: "−";
}

.faq details > div {
  display: grid;
  gap: 0.75rem;
  padding: 0 1.15rem 1.15rem;
  color: var(--ink-2);
  max-width: 46rem;
}

/* Closing call to action: a dark panel with the hero's glows. */

.band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  padding: clamp(2rem, 5vw, 3.5rem);
  background: var(--console);
  color: var(--console-ink);
  border: 1px solid var(--console-rule);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow-lg);
}

.band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(30rem 16rem at 88% 0%, rgb(52 211 153 / 0.22), transparent 70%),
    radial-gradient(22rem 14rem at 100% 100%, rgb(255 107 87 / 0.14), transparent 70%);
}

.band > div:first-child {
  display: grid;
  gap: 0.6rem;
  max-width: 34rem;
}

.band h2 {
  font-size: var(--step-4);
  color: #ffffff;
}

.band p {
  color: var(--console-dim);
}

.band .btn-primary {
  background: #ffffff;
  color: var(--kwikqa-ink);
  box-shadow: none;
}

.band .btn-primary:hover {
  background: var(--kwikqa-on-dark);
}

.band .btn-ghost {
  background: transparent;
  color: #ffffff;
  border-color: rgb(255 255 255 / 0.22);
  box-shadow: none;
}

.band .btn-ghost:hover {
  border-color: rgb(255 255 255 / 0.5);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--sheet);
  padding-block: 3.5rem 1.75rem;
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  }
}

.footer-brand {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.footer-brand p {
  color: var(--ink-2);
  max-width: 24rem;
}

.site-footer nav {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.site-footer h2 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.3rem;
}

.site-footer nav a {
  text-decoration: none;
  color: var(--ink-2);
}

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

.footer-base {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 0.82rem;
}

/* Plain pages: legal, support, notices */

.page {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.page-narrow {
  max-width: 46rem;
}

.page-head {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 2.5rem;
}

.page-head p.meta {
  font-size: var(--step--1);
  color: var(--ink-3);
}

/* Prose (docs, legal) */

.prose {
  max-width: 46rem;
  min-width: 0;
}

.prose > * + * {
  margin-top: 1.1rem;
}

.prose h1 {
  font-size: var(--step-4);
  margin-top: 0.35rem;
}

.prose h2 {
  font-size: var(--step-3);
  margin-top: 2.75rem;
  padding-top: 0.25rem;
}

.prose h3 {
  font-size: var(--step-1);
  margin-top: 2rem;
}

.prose h2 time {
  font-size: var(--step--1);
  font-weight: 400;
  color: var(--ink-3);
  margin-inline-start: 0.6rem;
}

.prose p,
.prose li {
  color: var(--ink-2);
}

.prose strong {
  color: var(--ink);
}

.prose ul,
.prose ol {
  padding-left: 1.3rem;
  display: grid;
  gap: 0.45rem;
}

.prose :not(pre) > code {
  font-size: 0.86em;
  padding: 0.1em 0.38em;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.prose pre,
pre.code {
  position: relative;
  margin-block: 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--console);
  color: var(--console-ink);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
}

.prose pre code {
  font: inherit;
}

.prose .table-wrap {
  margin-block: 1.25rem;
}

.prose td code,
.prose th code {
  white-space: nowrap;
}

.prose dl {
  display: grid;
  gap: 0.25rem 1.5rem;
}

.prose dt {
  font-weight: 650;
}

.prose dd {
  margin: 0 0 0.75rem;
  color: var(--ink-2);
}

.callout {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--sheet);
  border: 1px solid var(--rule);
}

.callout::before {
  content: attr(data-label);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.callout-warn {
  background: var(--warn-soft);
  border-color: transparent;
}

.callout-warn::before {
  color: var(--warn);
}

.callout p {
  color: var(--ink);
}

kbd {
  font-size: 0.82em;
  padding: 0.05em 0.35em;
  border: 1px solid var(--rule-2);
  border-bottom-width: 2px;
  border-radius: 4px;
}

mark {
  background: var(--mark-wash);
  color: inherit;
  padding-inline: 0.15em;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 6px;
  background: var(--console-2);
  color: var(--console-dim);
  font: 600 0.7rem / 1.4 var(--font-mono);
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease;
}

pre:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
}

.install .copy-btn {
  position: static;
  opacity: 1;
  background: var(--paper);
  color: var(--ink-2);
  border-color: var(--rule-2);
}

@media (hover: none) {
  .copy-btn {
    opacity: 1;
  }
}

/* Docs layout */

.docs-layout {
  display: grid;
  gap: 2.5rem;
  padding-block: 2.5rem 4rem;
}

@media (min-width: 980px) {
  .docs-layout {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 4rem;
  }
}

.docs-sidebar {
  display: none;
}

@media (min-width: 980px) {
  .docs-sidebar {
    display: block;
    position: sticky;
    top: calc(84px + env(safe-area-inset-top, 0px));
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }

  .docs-mobile-nav {
    display: none;
  }
}

.docs-nav-section + .docs-nav-section {
  margin-top: 1.5rem;
}

.docs-nav-section h2 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
}

.docs-nav-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.1rem;
}

.docs-nav-section a {
  display: block;
  padding: 0.3rem 0.6rem;
  margin-left: -0.6rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.93rem;
}

.docs-nav-section a:hover {
  color: var(--ink);
  background: var(--sheet);
}

.docs-nav-section a[aria-current="page"] {
  color: var(--ink);
  background: var(--mark-wash);
  font-weight: 600;
}

.docs-mobile-nav {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--sheet);
}

.docs-mobile-nav summary {
  padding: 0.75rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

.docs-mobile-nav nav {
  padding: 0 1rem 1rem;
}

.docs-content {
  min-width: 0;
}

.docs-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 46rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.docs-pager a {
  display: grid;
  gap: 0.15rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
}

.docs-pager a:hover {
  border-color: var(--ink);
}

.docs-pager .next {
  text-align: right;
}

.docs-pager small {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Sign-in */

.signin {
  display: grid;
  place-items: center;
  padding-block: clamp(3rem, 10vw, 7rem);
}

/* The card is narrower than .wrap, so it centres itself within it. */
.signin-card {
  display: grid;
  gap: 1.25rem;
  width: 100%;
  max-width: 26rem;
  margin-inline: auto;
  padding: 2rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.signin-card h1 {
  font-size: var(--step-3);
}

.signin-card p {
  color: var(--ink-2);
}

.signin-card small {
  color: var(--ink-3);
}

/* The card's two ways in: a personal account and a company account (KQA-140). */
.signin-card .signin-method {
  margin-bottom: -0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: var(--step-0);
  font-weight: 650;
}

.notice {
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  font-size: 0.92rem;
}

.notice-fail {
  background: var(--fail-soft);
  color: var(--fail);
}

.notice-pass {
  background: var(--pass-soft);
  color: var(--pass);
}

/* Dashboard */

.layout-app {
  background: var(--paper);
}

.app-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
}

.app-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 2rem;
  min-height: 60px;
}

.app-nav {
  display: flex;
  gap: 0.25rem;
  flex: 1;
  order: 2;
  overflow-x: auto;
}

.app-nav a {
  padding: 0.45rem 0.75rem;
  border-radius: 7px;
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.93rem;
  white-space: nowrap;
}

.app-nav a:hover {
  background: var(--paper);
  color: var(--ink);
}

.app-nav a[aria-current="page"] {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--mark);
}

.app-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  order: 3;
  font-size: 0.9rem;
}

.avatar {
  border-radius: 50%;
  border: 1px solid var(--rule);
}

.app-docs {
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: none;
}

.app-docs:hover {
  color: var(--ink);
}

.app-login {
  font-weight: 600;
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .app-nav {
    order: 4;
    flex-basis: 100%;
    margin-inline: -0.5rem;
    padding-bottom: 0.4rem;
  }

  .app-user {
    margin-left: auto;
  }

  .app-docs {
    color: var(--ink-2);
    font-weight: 600;
    text-decoration: none;
  }

  .app-docs:hover {
    color: var(--ink);
  }

  .app-login {
    display: none;
  }
}

.app-main {
  display: grid;
  gap: 1.5rem;
  padding-block: 2rem 3rem;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
}

.app-footer a {
  color: var(--ink-3);
  text-decoration: none;
}

.app-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.app-head h1 {
  font-size: var(--step-4);
}

.app-head p {
  color: var(--ink-2);
}

.panel {
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
  padding: 1.35rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

/* A role picker in a table keeps its width; the table scrolls instead. */
.table-wrap select {
  width: auto;
  min-width: 8.5rem;
  min-height: 34px;
  padding-block: 0.3rem;
}

/* A panel's parts are grid items: none may grow to its table's width, which scrolls instead. */
.panel > * {
  min-width: 0;
}

.panel > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.panel h2 {
  font-size: var(--step-1);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.panel p {
  color: var(--ink-2);
}

.panel .table-wrap {
  border: 0;
  border-radius: 0;
  margin-inline: -1.35rem;
}

.panel .table-wrap th:first-child,
.panel .table-wrap td:first-child {
  padding-left: 1.35rem;
}

.panel .table-wrap th:last-child,
.panel .table-wrap td:last-child {
  padding-right: 1.35rem;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 820px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid-4 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.meter {
  display: grid;
  gap: 0.55rem;
}

.meter-figure {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-variant-numeric: tabular-nums;
}

.meter-figure strong {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

.meter-figure span {
  color: var(--ink-3);
}

.meter-track {
  height: 8px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--rule);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: inherit;
  transition: width 400ms ease;
}

.meter[data-level="warn"] .meter-fill {
  background: var(--warn);
}

.meter[data-level="full"] .meter-fill {
  background: var(--fail);
}

.meter small {
  color: var(--ink-3);
}

.panel .meter-kept {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pass);
}

.kpi {
  display: grid;
  gap: 0.3rem;
  padding: 1.1rem 1.2rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.kpi strong {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi small {
  color: var(--ink-3);
}

.empty {
  display: grid;
  gap: 0.6rem;
  padding: 1.25rem;
  border: 1px dashed var(--rule-2);
  border-radius: var(--radius);
  color: var(--ink-2);
}

.empty pre {
  margin: 0;
}

.loading {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 600;
  font-size: 0.9rem;
}

.field small {
  color: var(--ink-3);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="month"],
input[type="date"],
select {
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="number"]:focus-visible,
input[type="search"]:focus-visible,
input[type="month"]:focus-visible,
input[type="date"]:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: transparent;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
}

.inline-form .field {
  flex: 1 1 14rem;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0.25rem;
  border: 1px solid var(--rule-2);
  border-radius: 9px;
  background: var(--paper);
}

.segmented label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}

.segmented label:has(input:checked) {
  background: var(--sheet);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--mark);
}

.segmented label:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.segmented input {
  accent-color: var(--ink);
}

.seats-field {
  max-width: 18rem;
}

.confirm {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--rule-2);
}

.confirm p {
  color: var(--ink);
}

.notice-info {
  background: var(--sheet);
  border: 1px solid var(--rule-2);
  color: var(--ink);
}

.invitation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.75rem;
  border-top: 1px solid var(--rule);
}

.invitation:first-child {
  border-top: 0;
}

/* Monthly totals as tiles (app.js `monthTiles`). */
.month-tiles {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
}

.month-tile {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.month-tile strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.month-tile small {
  color: var(--ink-3);
}

.month-track {
  height: 4px;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: var(--rule);
  overflow: hidden;
}

.month-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

/* A page's sections as tabs (app.js `tabs`): one shown at a time. */
.tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--rule-2);
  scrollbar-width: thin;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--ink-2);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

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

.tab[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.tab:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
  border-radius: 6px 6px 0 0;
}

.tab-count {
  min-width: 1.5rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* A long list's search and filters, and its pages (app.js `pagedTable`). */
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.list-toolbar input[type="search"] {
  flex: 1 1 14rem;
  width: auto;
}

.list-toolbar select {
  flex: 0 1 auto;
  width: auto;
  min-width: 9rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-size: 0.88rem;
}

/* A grid item, so it must not grow to its widest table: tables scroll inside their panels. */
.app-stack {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
}

.secret {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--rule-2);
}

.secret code {
  display: block;
  padding: 0.6rem 0.75rem;
  background: var(--sheet);
  border-radius: 6px;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.danger {
  border-color: var(--fail);
}

.danger h2 {
  color: var(--fail);
}

.bars {
  display: flex;
  align-items: end;
  gap: 3px;
  height: 140px;
  padding-top: 0.5rem;
  border-bottom: 1px solid var(--rule-2);
}

.bars span {
  flex: 1;
  min-width: 4px;
  background: var(--ink-2);
  border-radius: 3px 3px 0 0;
}

.bars span:last-child {
  background: var(--accent);
}

.bars span.zero {
  background: var(--rule-2);
}

.profile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.kv {
  display: grid;
  gap: 0.6rem 2rem;
  margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  flex: 1;
  min-width: 0;
}

.kv dt {
  font-size: 0.8rem;
  color: var(--ink-3);
}

.kv dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.test-cell {
  display: grid;
  gap: 0.1rem;
  min-width: 14rem;
}

.test-cell small {
  font-size: 0.74rem;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.kpi .chip {
  justify-self: start;
}

.bars-axis {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-3);
}

/* The operator view: its period, its blocks, and its charts (app.js `admin`, `columnChart`). */
.period-bar {
  display: grid;
  gap: 0.75rem;
}

.period-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem;
}

.period-custom .field {
  flex: 0 1 11rem;
}

.period-caption {
  font-size: 0.9rem;
}

.segmented-sm label {
  padding: 0.25rem 0.6rem;
  font-size: 0.84rem;
}

/* Figures in rows of four on a wide screen, so eight make two full rows. */
@media (min-width: 900px) {
  .kpis-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.section-block {
  display: grid;
  gap: 0.75rem;
}

.block-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* New figures replace the old ones in place; until then the old ones stay, faded. */
.is-loading {
  opacity: 0.5;
  transition: opacity 120ms ease;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.85rem;
  color: var(--ink-2);
}

.chart-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chart-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.chart-frame {
  position: relative;
}

.chart {
  display: block;
  max-width: 100%;
  overflow: visible;
  touch-action: pan-y;
}

.chart:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 4px;
}

.chart-grid {
  stroke: var(--rule);
  stroke-width: 1;
}

.chart-axis {
  stroke: var(--rule-2);
  stroke-width: 1;
}

.chart-tick {
  fill: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chart-column {
  transition: opacity 100ms ease;
}

.chart.has-active .chart-column:not(.is-active) {
  opacity: 0.4;
}

.chart-tip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 0.3rem;
  min-width: 10rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-sm);
  background: var(--sheet);
  box-shadow: var(--shadow);
  font-size: 0.84rem;
  pointer-events: none;
}

.chart-tip-title {
  font-weight: 600;
  color: var(--ink-2);
}

.chart-tip-row {
  display: grid;
  grid-template-columns: 12px auto 1fr;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-3);
}

.chart-tip-row strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.chart-key {
  width: 12px;
  height: 2px;
  border-radius: 1px;
}

.table-view summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}

.table-view[open] summary {
  margin-bottom: 0.75rem;
}

td .negative {
  color: var(--fail);
}

/* The operator view's signup funnel (app.js `renderCustomers`). */
.funnel {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.funnel-step {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) minmax(6rem, 1fr) 4rem;
  align-items: center;
  gap: 0.35rem 1rem;
}

.funnel-step small {
  grid-column: 2 / 4;
  color: var(--ink-3);
}

.funnel-step strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.funnel-label {
  color: var(--ink-2);
}

.funnel-track {
  height: 10px;
  border-radius: 999px;
  background: var(--rule);
  overflow: hidden;
}

.funnel-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--series-1);
}

.share {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 8rem;
  font-variant-numeric: tabular-nums;
}

.share-track {
  flex: 1;
  height: 6px;
  min-width: 4rem;
  border-radius: 999px;
  background: var(--rule);
  overflow: hidden;
}

.share-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--series-1);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  max-width: calc(100% - 32px);
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.muted {
  color: var(--ink-3);
}

.nowrap {
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
