/* AACC website - shared stylesheet for the public pages (home, download,
   legal). admin.html still uses assets/style.css.

   Layout concept: a long scroll read like an operations console - each
   section pairs plain-words copy with a live, animated instrument panel
   drawn from what the app really shows (process chains, verdicts, the map).

   Colors are the desktop app's own (packages/ui/src/index.css), so the site
   and the app read as one product. The site is dark by design, like the app.
   Fonts are self-hosted (assets/fonts, SIL Open Font License): no request
   to a third-party font host, which keeps visitors' IP addresses with us. */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* Color */
  --ink: #080b11;
  --surface: #0d121b;
  --panel: #121926;
  --panel-2: #172031;
  --line: #222c3e;
  --line-soft: #1a2232;
  --text: #e7ebf3;
  --muted: #95a0b6;
  --faint: #66718a;
  --signal: #4f8cff;
  --signal-soft: rgba(79, 140, 255, 0.14);
  --ok: #3fb97f;
  --ok-soft: rgba(63, 185, 127, 0.13);
  --warn: #e0a336;
  --warn-soft: rgba(224, 163, 54, 0.13);
  --crit: #e0554f;
  --crit-soft: rgba(224, 85, 79, 0.13);
  /* Type */
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --body: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  /* Scale */
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.4rem + 3.4vw, 4rem);
  --radius: 14px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  /* Pinch-to-zoom off, as requested (see site.js for iOS Safari, which
     ignores the viewport tag). Scrolling still works. */
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

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

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

a {
  color: var(--signal);
  text-underline-offset: 3px;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0;
}

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

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

.wrap--narrow {
  max-width: 820px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 50;
  background: var(--signal);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
}
.skip-link:focus {
  left: 16px;
}

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: rgba(8, 11, 17, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  margin-right: auto;
  min-width: 0;
}

.nav__brand img {
  width: 30px;
  height: 30px;
  flex: none;
}

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

.nav__links {
  display: flex;
  gap: 24px;
  font-size: 0.9375rem;
}

.nav__links a {
  color: var(--muted);
  text-decoration: none;
}

.nav__links a:hover,
.nav__links a[aria-current='page'] {
  color: var(--text);
}

.nav__links a.btn--primary {
  color: #fff;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
  font: 600 0.9375rem/1.2 var(--body);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}

.btn--primary {
  background: var(--signal);
  color: #fff;
  box-shadow: 0 8px 28px -10px rgba(79, 140, 255, 0.7);
}
.btn--primary:hover {
  background: #6a9dff;
}

.btn--secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn--secondary:hover {
  border-color: var(--muted);
}

.btn--small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.875rem;
}

.btn[disabled],
.btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: 72px 56px;
  overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(79, 140, 255, 0.16), transparent 60%),
    radial-gradient(40rem 24rem at -10% 110%, rgba(63, 185, 127, 0.07), transparent 60%);
}

.hero::after {
  /* A faint console grid behind the hero. */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 48px;
  align-items: center;
}

.hero__copy {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(63, 185, 127, 0.6);
  animation: live 2s infinite;
  flex: none;
}

@keyframes live {
  70% {
    box-shadow: 0 0 0 8px rgba(63, 185, 127, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(63, 185, 127, 0);
  }
}

.hero h1 {
  font-size: var(--step-4);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.hero h1 em {
  font-style: normal;
  color: var(--signal);
}

.lede {
  font-size: var(--step-1);
  color: var(--muted);
  max-width: 34em;
}

.hero__note {
  font-size: var(--step--1);
  color: var(--faint);
}

.works-with {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: var(--step--1);
  color: var(--faint);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

/* ---------- Diagram frames ---------- */

.instrument {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--surface));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
  min-width: 0;
}

.instrument__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 12px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.instrument__bar .live-dot {
  width: 6px;
  height: 6px;
}

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

.instrument svg {
  display: block;
  width: 100%;
  height: auto;
}

/* SVG text and shapes take theme tokens */
.d-label {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  fill: var(--text);
}
.d-sub {
  font-family: var(--body);
  font-size: 10px;
  fill: var(--faint);
}
.d-kind {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  fill: var(--faint);
}
.d-node {
  fill: var(--panel-2);
  stroke: var(--line);
  stroke-width: 1;
}
.d-wire {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
}
.d-flow {
  fill: none;
  stroke: var(--signal);
  stroke-width: 1.5;
  stroke-dasharray: 3 9;
  stroke-linecap: round;
  animation: flow 1.4s linear infinite;
  opacity: 0.8;
}
.d-flow--ok {
  stroke: var(--ok);
}
.d-flow--warn {
  stroke: var(--warn);
}
.d-flow--crit {
  stroke: var(--crit);
}
.d-likely {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
  stroke-dasharray: 5 6;
  opacity: 0.7;
}
.d-packet {
  fill: var(--signal);
}
.d-packet--ok {
  fill: var(--ok);
}
.d-packet--warn {
  fill: var(--warn);
}
.d-packet--crit {
  fill: var(--crit);
}

@keyframes flow {
  to {
    stroke-dashoffset: -24;
  }
}

.d-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.12);
  }
}

.d-ring {
  fill: none;
  stroke: var(--signal);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: ring 3.2s ease-out infinite;
}
@keyframes ring {
  0% {
    opacity: 0.7;
    transform: scale(0.7);
  }
  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: 96px;
  border-top: 1px solid var(--line-soft);
}

.section--tint {
  background: linear-gradient(180deg, var(--surface), var(--ink));
}

.section__head {
  display: grid;
  gap: 14px;
  max-width: 44rem;
  margin-bottom: 48px;
}

.section__head h2 {
  font-size: var(--step-3);
}

.section__head p {
  color: var(--muted);
  font-size: var(--step-1);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.split--flip > :first-child {
  order: 2;
}

.split__copy {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.split__copy h2 {
  font-size: var(--step-3);
}

.split__copy > p {
  color: var(--muted);
  font-size: 1.0625rem;
}

.ticks {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: grid;
  gap: 12px;
}

.ticks li {
  position: relative;
  padding-left: 28px;
  color: var(--muted);
}

.ticks li strong {
  color: var(--text);
  font-weight: 600;
}

.ticks li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}

/* ---------- Alert card (mirrors the app's alert guide) ---------- */

.alert-demo {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.verdicts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.verdict::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.verdict--ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: rgba(63, 185, 127, 0.35);
}
.verdict--warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: rgba(224, 163, 54, 0.35);
}
.verdict--crit {
  color: var(--crit);
  background: var(--crit-soft);
  border-color: rgba(224, 85, 79, 0.35);
}

.alert-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--crit);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.alert-card__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

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

.alert-card dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.alert-card dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.alert-card dd {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.alert-card dd code {
  color: var(--text);
}

.alert-card ol {
  margin: 4px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.9375rem;
  display: grid;
  gap: 4px;
}

.chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.chain code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.8125rem;
}

.chain i {
  font-style: normal;
  color: var(--faint);
}

/* ---------- Process chain (animated) ---------- */

.proc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: none;
}

.proc li {
  position: relative;
  padding: 0 0 22px 40px;
  min-width: 0;
}

.proc li::before {
  /* The connector between steps */
  content: '';
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.proc li:last-child::before {
  display: none;
}

.proc__dot {
  position: absolute;
  left: 4px;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--ink);
  animation: procdot 10s infinite;
}

.proc__box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  display: grid;
  gap: 2px;
  animation: procbox 10s infinite;
  min-width: 0;
}

.proc__box b {
  font-weight: 600;
  font-size: 0.9375rem;
}

.proc__box code {
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.proc li:nth-child(2) > * {
  animation-delay: 1.2s;
}
.proc li:nth-child(3) > * {
  animation-delay: 2.4s;
}
.proc li:nth-child(4) > * {
  animation-delay: 3.6s;
}
.proc li:nth-child(5) > * {
  animation-delay: 4.8s;
}

.proc li.is-flag .proc__box {
  animation-name: procflag;
}
.proc li.is-flag .proc__dot {
  animation-name: procdotflag;
}

@keyframes procdot {
  0%,
  4% {
    border-color: var(--line);
    background: var(--ink);
  }
  8%,
  80% {
    border-color: var(--signal);
    background: var(--signal-soft);
  }
  92%,
  100% {
    border-color: var(--line);
    background: var(--ink);
  }
}
@keyframes procbox {
  0%,
  4% {
    border-color: var(--line);
  }
  8%,
  80% {
    border-color: rgba(79, 140, 255, 0.55);
  }
  92%,
  100% {
    border-color: var(--line);
  }
}
@keyframes procdotflag {
  0%,
  4% {
    border-color: var(--line);
    background: var(--ink);
  }
  8%,
  80% {
    border-color: var(--crit);
    background: var(--crit-soft);
  }
  92%,
  100% {
    border-color: var(--line);
    background: var(--ink);
  }
}
@keyframes procflag {
  0%,
  4% {
    border-color: var(--line);
    background: var(--panel);
  }
  8%,
  80% {
    border-color: rgba(224, 85, 79, 0.6);
    background: var(--crit-soft);
  }
  92%,
  100% {
    border-color: var(--line);
    background: var(--panel);
  }
}

/* ---------- Feature grid ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  overflow: hidden;
}

.feature {
  background: var(--ink);
  padding: 28px 26px;
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.feature__tag {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.feature h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.feature p {
  color: var(--muted);
  font-size: 0.9375rem;
}

.feature__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--signal-soft);
  color: var(--signal);
}
.feature__icon svg {
  width: 20px;
  height: 20px;
}

/* ---------- Agents status board ---------- */

.board {
  display: grid;
  gap: 10px;
}

.board__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.board__mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.875rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
}

.board__name {
  display: grid;
  min-width: 0;
}
.board__name b {
  font-weight: 600;
  font-size: 0.9375rem;
}
.board__name span {
  font-size: 0.8125rem;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.state::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.state--working {
  color: var(--ok);
  background: var(--ok-soft);
}
.state--working::before {
  animation: blink 1.2s ease-in-out infinite;
}
.state--recent {
  color: var(--warn);
  background: var(--warn-soft);
}
.state--cloud {
  color: var(--signal);
  background: var(--signal-soft);
}
.state--idle {
  color: var(--muted);
  background: var(--surface);
}
@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

/* ---------- Privacy boundary ---------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 12px;
  padding: 0 4px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend i {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top: 2px solid var(--signal);
}
.legend i.is-likely {
  border-top: 2px dashed var(--muted);
}
.legend i.is-optional {
  border-top: 2px dashed var(--faint);
}

/* ---------- Limits ---------- */

.limits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.limit {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: grid;
  gap: 6px;
  background: var(--surface);
}

.limit h3 {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}

.limit p {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------- CTA ---------- */

.cta {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 48px clamp(20px, 5vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  background:
    radial-gradient(40rem 20rem at 100% 0%, rgba(79, 140, 255, 0.18), transparent 60%),
    var(--surface);
}

.cta h2 {
  font-size: var(--step-3);
}

.cta p {
  color: var(--muted);
  margin-top: 10px;
}

/* ---------- Download page ---------- */

.dl-hero {
  padding-block: 64px 40px;
}

.hero.dl-hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.dl-hero .lede {
  margin-bottom: 20px;
}

.dl-hero h1 {
  font-size: var(--step-4);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.dl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(20px, 4vw, 32px);
  display: grid;
  gap: 16px;
  min-width: 0;
}

.panel h2 {
  font-size: var(--step-2);
}

.panel > p,
.panel .hint {
  color: var(--muted);
  font-size: 0.9375rem;
}

.panel + .panel {
  margin-top: 20px;
}

.stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.account-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--surface);
  overflow-wrap: anywhere;
}

.form-row {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 0.8125rem;
  color: var(--muted);
}

.text-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  /* 16px keeps iOS from zooming into the field on focus. */
  font: 400 1rem/1.3 var(--body);
}

.text-input:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-soft);
}

.form-error {
  color: var(--crit);
  font-size: 0.875rem;
  min-height: 1.2em;
}

.form-hint {
  color: var(--muted);
  font-size: 0.875rem;
}

.note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--muted);
}

.note strong {
  color: var(--text);
}

.note ul {
  margin: 8px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}

.note--info {
  border-left-color: var(--signal);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 520px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  vertical-align: top;
}

.data-table th {
  color: var(--text);
  font-weight: 600;
  background: var(--surface);
  font-size: 0.8125rem;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table code {
  word-break: break-all;
  font-size: 0.75rem;
}

.token-value {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 0.875rem;
  word-break: break-all;
  color: var(--text);
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-pill--active {
  color: var(--ok);
  background: var(--ok-soft);
}
.status-pill--unactivated {
  color: var(--muted);
  background: var(--surface);
  border-color: var(--line);
}
.status-pill--paused {
  color: var(--warn);
  background: var(--warn-soft);
}
.status-pill--revoked,
.status-pill--expired {
  color: var(--crit);
  background: var(--crit-soft);
}

.release-meta {
  color: var(--muted);
  font-size: 0.875rem;
}

.whats-new {
  border-left-color: var(--ok);
}

.specs {
  display: grid;
  gap: 0;
  margin: 0;
}

.specs div {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.875rem;
}

.specs div:last-child {
  border-bottom: 0;
}

.specs dt {
  color: var(--faint);
}

.specs dd {
  margin: 0;
  color: var(--text);
}

/* Install steps - a real sequence, so numbered */
.install {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  position: relative;
}

.install::before {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 21px;
  height: 2px;
  background: var(--line);
}

.install::after {
  content: '';
  position: absolute;
  left: 10%;
  top: 21px;
  height: 2px;
  width: 0;
  background: var(--signal);
  animation: install 12s ease-in-out infinite;
}

@keyframes install {
  0% {
    width: 0;
  }
  80%,
  92% {
    width: 80%;
  }
  100% {
    width: 80%;
    opacity: 0;
  }
}

.install li {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  text-align: center;
  gap: 10px;
  min-width: 0;
}

.install__n {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.875rem;
  background: var(--panel);
  border: 2px solid var(--line);
  color: var(--muted);
  animation: installn 12s infinite;
}

.install li:nth-child(2) .install__n {
  animation-delay: 2.4s;
}
.install li:nth-child(3) .install__n {
  animation-delay: 4.8s;
}
.install li:nth-child(4) .install__n {
  animation-delay: 7.2s;
}
.install li:nth-child(5) .install__n {
  animation-delay: 9.6s;
}

@keyframes installn {
  0%,
  3% {
    border-color: var(--line);
    color: var(--muted);
    background: var(--panel);
  }
  6%,
  20% {
    border-color: var(--signal);
    color: #fff;
    background: var(--signal);
  }
  26%,
  100% {
    border-color: var(--signal);
    color: var(--signal);
    background: var(--panel);
  }
}

.install b {
  font-size: 0.9375rem;
  font-weight: 600;
}

.install p {
  font-size: 0.8125rem;
  color: var(--muted);
}

.smartscreen {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ---------- Legal pages ---------- */

.legal-hero {
  padding-block: 56px 32px;
  border-bottom: 1px solid var(--line-soft);
}

.legal-hero .wrap {
  display: grid;
  gap: 12px;
}

.legal-hero h1 {
  font-size: var(--step-4);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.legal-hero p {
  color: var(--muted);
}

.legal {
  padding-block: 40px 96px;
}

.legal .wrap {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 88px);
  display: grid;
  gap: 4px;
  font-size: 0.875rem;
}

.toc b {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
  margin-bottom: 6px;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
  padding: 3px 0;
}

.toc a:hover {
  color: var(--text);
}

.prose {
  max-width: 44rem;
  min-width: 0;
  color: var(--muted);
  font-size: 1rem;
}

.prose h2 {
  font-size: var(--step-2);
  color: var(--text);
  margin: 44px 0 12px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-family: var(--body);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
  margin: 24px 0 8px;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 14px;
}

.prose ul,
.prose ol {
  padding-left: 22px;
  display: grid;
  gap: 6px;
}

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

.prose .caps {
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  color: var(--text);
}

.prose .table-scroll {
  margin: 0 0 18px;
}

.draft-note {
  border: 1px dashed var(--warn);
  background: var(--warn-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.875rem;
}

/* Details the owner still has to supply - shown highlighted so they are
   impossible to miss before the page goes live. */
.fill {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 4px;
  padding: 0 4px;
  font-style: normal;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 48px calc(32px + env(safe-area-inset-bottom, 0px));
  font-size: 0.875rem;
  color: var(--muted);
}

.footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.footer__brand {
  display: grid;
  gap: 10px;
  align-content: start;
}

.footer__brand p {
  max-width: 26rem;
  color: var(--faint);
}

.footer__col {
  display: grid;
  gap: 8px;
  align-content: start;
}

.footer__col b {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
  margin-bottom: 4px;
}

.footer a,
.linkish {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover,
.linkish:hover {
  color: var(--text);
}

.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.footer__base {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 20px;
  color: var(--faint);
  font-size: 0.8125rem;
}

/* ---------- Cookie consent ---------- */

.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 0 var(--gutter-r) calc(16px + env(safe-area-inset-bottom, 0px)) var(--gutter);
  pointer-events: none;
}

.consent__box {
  pointer-events: auto;
  max-width: 980px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: center;
  animation: rise 0.35s ease-out;
}

@keyframes rise {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
}

.consent__box h2 {
  font-size: 1.0625rem;
  margin-bottom: 4px;
}

.consent__box p {
  font-size: 0.875rem;
  color: var(--muted);
}

.consent__prefs {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.pref {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  font-size: 0.875rem;
}

.pref b {
  color: var(--text);
  font-weight: 600;
  display: block;
}

.pref span {
  color: var(--muted);
}

.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  margin: 0;
  transition: background 0.15s;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.15s;
}

.switch:checked {
  background: var(--signal);
}

.switch:checked::after {
  transform: translateX(18px);
}

.switch:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero .wrap,
  .split,
  .dl-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .split--flip > :first-child {
    order: 0;
  }
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .legal .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
  }
  .toc b {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .nav__links a:not(.btn) {
    display: none;
  }
  .hero {
    padding-block: 40px 40px;
  }
  .section {
    padding-block: 64px;
  }
  .features,
  .limits {
    grid-template-columns: minmax(0, 1fr);
  }
  .cta {
    grid-template-columns: minmax(0, 1fr);
  }
  .footer .wrap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer__brand {
    grid-column: 1 / -1;
  }
  .consent__box {
    grid-template-columns: minmax(0, 1fr);
  }
  .consent__box .btn-row .btn {
    flex: 1 1 auto;
  }
  .install {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .install::before,
  .install::after {
    display: none;
  }
  .install li {
    grid-template-columns: 44px minmax(0, 1fr);
    justify-items: start;
    text-align: left;
    column-gap: 14px;
    row-gap: 2px;
  }
  .install__n {
    grid-row: span 2;
  }
  .specs div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .toc {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

/* ---------- Admin console ---------- */

.admin-head {
  padding-block: 40px 28px;
}

.admin-head .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
}

.admin-head h1 {
  font-size: var(--step-3);
  font-weight: 700;
  margin-top: 8px;
}

.admin-head p {
  color: var(--muted);
  margin-top: 6px;
}

.admin-main {
  padding-block: 0 72px;
}

.admin-main .wrap {
  display: grid;
  gap: 24px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tile__label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tile__value {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.tile__sub {
  font-size: 0.8125rem;
  color: var(--muted);
}

.tile--ok .tile__value {
  color: var(--ok);
}
.tile--warn .tile__value {
  color: var(--warn);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.toolbar .text-input {
  max-width: 340px;
  min-height: 42px;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.segmented button {
  font: 500 0.8125rem/1 var(--body);
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}

.segmented button[aria-pressed='true'] {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.segmented button span {
  color: var(--faint);
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.users {
  display: grid;
  gap: 16px;
}

.user {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.user__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--signal-soft);
  color: var(--signal);
  font: 700 1rem/1 var(--display);
  text-transform: uppercase;
}

.user__who {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user__email {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.user__meta {
  font-size: 0.8125rem;
  color: var(--muted);
}

.tag {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--signal);
  border: 1px solid rgba(79, 140, 255, 0.4);
  border-radius: 6px;
  padding: 1px 6px;
  font-weight: 400;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.actions__label {
  flex-basis: 100%;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.device .actions {
  max-width: 300px;
}

.admin-action {
  font: 500 0.8125rem/1 var(--body);
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.admin-action:hover:not(:disabled) {
  border-color: var(--muted);
}

.admin-action--danger {
  color: var(--crit);
  border-color: rgba(224, 85, 79, 0.35);
}

.admin-action--danger:hover:not(:disabled) {
  border-color: var(--crit);
  background: var(--crit-soft);
}

.admin-action:disabled {
  opacity: 0.5;
  cursor: default;
}

.devices {
  border-top: 1px solid var(--line-soft);
  display: grid;
}

.device {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}

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

.device--empty {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
}

.field-l {
  display: block;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 3px;
}

.field-v {
  font-size: 0.875rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.field-s {
  display: block;
  font-size: 0.75rem;
  color: var(--faint);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.field-s--warn {
  color: var(--warn);
}
.field-s--crit {
  color: var(--crit);
}
.field-s--ok {
  color: var(--ok);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.online::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--faint);
}

.online--on {
  color: var(--ok);
}

.online--on::before {
  background: var(--ok);
  border-color: var(--ok);
  animation: live 2s infinite;
}

.status-pill--online {
  color: var(--ok);
}

.status-pill--offline {
  color: var(--muted);
}

.signins {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.signins li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.875rem;
}

.signins li:last-child {
  border-bottom: 0;
}

.signins span:first-child {
  overflow-wrap: anywhere;
  min-width: 0;
}

.signins span:last-child {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.admin-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 1100px) {
  .device {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .device > :first-child {
    grid-column: 1 / -1;
  }
  .device .actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    max-width: none;
  }
  .device .actions__label {
    text-align: left;
  }
  .tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tiles .tile:last-child {
    grid-column: 1 / -1;
  }
  .device {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .user__head {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .user__head .actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .user__head .actions__label {
    text-align: left;
  }
  .admin-lower {
    grid-template-columns: minmax(0, 1fr);
  }
  .toolbar .text-input {
    max-width: none;
  }
}
