/* Flight Board styles, shared by the local dashboard and Liftoff Cloud.
   Look: soft glass on calm neutral greys, solid ink for anything primary,
   colour kept for status and each app's own tile, spring motion. Everything moves on transform/opacity,
   and prefers-reduced-motion turns the motion off. */

@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  color-scheme: light;
  --font: "Inter", "InterVariable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* motion */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --spring-soft: cubic-bezier(.22, 1.12, .4, 1);
  --fast: 140ms;
  --mid: 260ms;
  --slow: 520ms;

  --radius-sm: 9px;
  --radius: 16px;
  --radius-lg: 22px;

  /* light theme */
  --bg: #f3f3f2;
  --surface: rgba(255, 255, 255, .8);
  --surface-solid: #ffffff;
  --surface-2: rgba(250, 250, 249, .85);
  --field: rgba(255, 255, 255, .88);
  --btn: rgba(255, 255, 255, .9);
  --btn-hover: #ffffff;
  --ink: #111111; --ink-2: #3d3d3b; --muted: #6f6f6b; --faint: #a3a3a0;
  --line: rgba(0, 0, 0, .085); --line-2: rgba(0, 0, 0, .055); --line-strong: rgba(0, 0, 0, .15);
  --hover: rgba(0, 0, 0, .04);
  --hi: rgba(255, 255, 255, .95);

  /* One ink colour does the work an accent usually does. */
  --accent: #1a1a19; --accent-soft: rgba(0, 0, 0, .06);
  --primary: #1a1a19; --primary-ink: #fafaf9;
  --good: #0c9466; --good-dot: #1fc48a; --good-soft: rgba(31, 196, 138, .12);
  --warn: #b25e08; --warn-dot: #f5a524; --warn-soft: rgba(245, 165, 36, .14);
  --bad: #d4283a; --bad-dot: #f43f5e; --bad-soft: rgba(244, 63, 94, .1);
  --run: #2d6bff; --run-soft: rgba(45, 107, 255, .1);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px -16px rgba(0, 0, 0, .18);
  --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .05);
  --glow: 0 6px 16px -8px rgba(0, 0, 0, .35);

  /* the background light: soft and colourless */
  --aurora-1: rgba(255, 255, 255, .9);
  --aurora-2: rgba(0, 0, 0, .03);
  --aurora-3: rgba(255, 255, 255, .55);
  --noise-opacity: .05;
}

/* dark theme: theme.js sets data-theme from your choice, or from the device setting */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0b;
  --surface: rgba(255, 255, 255, .035);
  --surface-solid: #151515;
  --surface-2: rgba(255, 255, 255, .028);
  --field: rgba(255, 255, 255, .04);
  --btn: rgba(255, 255, 255, .055);
  --btn-hover: rgba(255, 255, 255, .09);
  --ink: #f2f2f0; --ink-2: #cfcfcc; --muted: #8e8e8a; --faint: #5c5c59;
  --line: rgba(255, 255, 255, .085); --line-2: rgba(255, 255, 255, .055); --line-strong: rgba(255, 255, 255, .16);
  --hover: rgba(255, 255, 255, .05);
  --hi: rgba(255, 255, 255, .07);

  --accent: #ededeb; --accent-soft: rgba(255, 255, 255, .08);
  --primary: #ededeb; --primary-ink: #111111;
  --good: #4fe0a6; --good-dot: #22c58b; --good-soft: rgba(34, 197, 139, .14);
  --warn: #ffc65c; --warn-dot: #f5a524; --warn-soft: rgba(255, 190, 70, .12);
  --bad: #ff7486; --bad-dot: #f43f5e; --bad-soft: rgba(255, 90, 110, .13);
  --run: #82acff; --run-soft: rgba(110, 160, 255, .13);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -18px rgba(0, 0, 0, .9);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .06);
  --glow: 0 10px 26px -12px rgba(0, 0, 0, .9);

  --aurora-1: rgba(255, 255, 255, .055);
  --aurora-2: rgba(255, 255, 255, .03);
  --aurora-3: rgba(255, 255, 255, .025);
  --noise-opacity: .035;
}

/* Switching light and dark cross-fades the page (theme.js, where the browser supports it). */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 380ms; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; interpolate-size: allow-keywords; }
html, body { height: 100%; }
body {
  margin: 0; font: 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01", "ss03";
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* The aurora and grain sit behind everything and only ever move on the compositor. */
body::before {
  content: ""; position: fixed; inset: -10vmax; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38vmax 30vmax at 20% 14%, var(--aurora-1), transparent 70%),
    radial-gradient(34vmax 26vmax at 86% 8%, var(--aurora-2), transparent 70%),
    radial-gradient(40vmax 28vmax at 64% 92%, var(--aurora-3), transparent 70%);
  animation: aurora 38s var(--ease-in-out) infinite alternate;
  will-change: transform;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(-4vmax, 3vmax, 0) rotate(8deg) scale(1.06); }
  100% { transform: translate3d(3vmax, -2vmax, 0) rotate(-6deg) scale(1.02); }
}

::selection { background: color-mix(in srgb, var(--run) 24%, transparent); }
button { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); transition: color var(--fast), text-decoration-color var(--fast); }
a:hover { text-decoration-color: currentColor; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 16px 12px;
  border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; z-index: 6;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 650; font-size: 15px; letter-spacing: -.015em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--primary-ink); background: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), var(--glow);
}
.brand .mark svg { width: 16px; height: 16px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 18px 10px 6px; display: flex; justify-content: space-between; }
.nav {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; border: 0; border-radius: 10px;
  background: none; text-align: left; cursor: pointer; color: var(--ink-2); min-height: 36px;
  transition: color var(--fast), background-color var(--mid) var(--ease), transform var(--mid) var(--spring);
}
.nav > span:not(.end):not(.avatar) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav:hover { background: var(--hover); color: var(--ink); }
.nav:active { transform: scale(.98); }
.nav.on { color: var(--ink); font-weight: 550; }
.nav .i { color: var(--muted); transition: color var(--fast); }
.nav.on .i, .nav:hover .i { color: var(--ink); }
.nav .end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
/* Where an app came from, when two share a name. */
.nav .nav-src { margin-left: 6px; font-size: 11px; font-weight: 400; color: var(--faint); }
/* The selected-item pill glides between nav items instead of jumping. */
.nav-ind {
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; border-radius: 10px; opacity: 0;
  background: var(--surface-solid); box-shadow: inset 0 1px 0 var(--hi), 0 0 0 1px var(--line), var(--shadow-sm);
  transition: transform var(--slow) var(--spring-soft), width var(--slow) var(--spring-soft), height var(--slow) var(--spring-soft), opacity var(--mid);
}
.nav-ind::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav-ind.on { opacity: 1; }
#nav-extra { display: contents; }
.side .foot { margin-top: auto; padding: 14px 10px 2px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.side .foot code { font-size: 11px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 32px;
  border-bottom: 1px solid var(--line-2); font-size: 13px; color: var(--muted);
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
}
.topbar b { color: var(--ink); font-weight: 550; }
.topbar .crumb { background: none; border: 0; padding: 4px 6px; margin: 0 -6px; border-radius: 7px; cursor: pointer; color: var(--muted); transition: color var(--fast), background-color var(--fast); }
.topbar .crumb:hover { color: var(--ink); background: var(--hover); }
.topbar .sep { color: var(--faint); }
.topbar .sync { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--hover); }
.topbar .sync.off { color: var(--bad); background: var(--bad-soft); }
.status-dot.down { background: var(--bad-dot, var(--bad)); }
/* Read out, not shown. */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.task-left { flex-basis: 100%; color: var(--muted); }
.task-left:empty { display: none; }
.topbar .theme-btn { width: 30px; height: 30px; margin-right: -6px; border-radius: 9px; }
.theme-btn .i { transition: transform var(--slow) var(--spring); }
.theme-btn:hover .i { transform: rotate(-18deg) scale(1.06); }
.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; gap: 20px; }

/* A view slides in once when you open it; polling updates patch in place and never replay this. */
.content.entering > * { animation: rise var(--slow) var(--ease) backwards; }
.content.entering > :nth-child(2) { animation-delay: 45ms; }
.content.entering > :nth-child(3) { animation-delay: 90ms; }
.content.entering > :nth-child(4) { animation-delay: 135ms; }
.content.entering > :nth-child(5) { animation-delay: 180ms; }
.content.entering > :nth-child(n+6) { animation-delay: 225ms; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.992); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }

/* ---------- primitives ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 {
  margin: 0; font-size: 28px; line-height: 1.15; font-weight: 680; letter-spacing: -.028em;
  background: linear-gradient(180deg, var(--ink) 30%, color-mix(in srgb, var(--ink) 62%, transparent)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.grad-text { color: var(--muted); }

.card {
  position: relative; min-width: 0; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); box-shadow: inset 0 1px 0 var(--hi), var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 620; letter-spacing: -.01em; }
.card-head > .i { color: var(--muted); }
.card-head .sub { color: var(--muted); font-size: 12px; }
.card-head .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 4px 18px 14px; }
.count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
  background: var(--hover); color: var(--muted); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--line-2);
}

/* Cursor spotlight: a soft glow that follows the pointer across a card and lights its border. */
.spot { isolation: isolate; }
.spot::before, .spot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--slow) var(--ease); }
.spot::before { z-index: -1; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--ink) 5%, transparent), transparent 45%); }
.spot::after {
  inset: -1px; padding: 1px;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--ink) 28%, transparent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.spot:hover::before, .spot:hover::after { opacity: 1; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 550;
  white-space: nowrap; background: var(--hover); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background-color var(--mid), color var(--mid);
}
.pill .i { width: 13px; height: 13px; }
.pill .d { position: relative; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.run .d::after, .status-dot.run::after, .status-dot.live::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 1.8s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(3.2); opacity: 0; } }
.pill.good { background: var(--good-soft); color: var(--good); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 18%, transparent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 22%, transparent); }
.pill.bad { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 20%, transparent); }
.pill.run { background: var(--run-soft); color: var(--run); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--run) 20%, transparent); }
.pill.accent { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent); }
.pill.sm { height: 19px; font-size: 11px; padding: 0 7px; gap: 4px; }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--btn); color: var(--ink); font-size: 13px; font-weight: 550;
  cursor: pointer; white-space: nowrap; text-decoration: none; overflow: hidden; isolation: isolate;
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-sm);
  transition: transform var(--mid) var(--spring), background-color var(--fast), border-color var(--fast), box-shadow var(--mid) var(--ease), color var(--fast), opacity var(--fast);
}
.btn:hover { background: var(--btn-hover); border-color: var(--line-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.96); transition-duration: 90ms; }
.btn .i { transition: transform var(--mid) var(--spring); }
.btn:hover .i:last-child:not(:first-child) { transform: translateX(2px); }
.btn.primary {
  background: var(--primary); border-color: transparent; color: var(--primary-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 0 0 1px rgba(0, 0, 0, .06), var(--glow);
}
.btn.primary:hover { background: var(--primary); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 0 0 1px rgba(0, 0, 0, .06), 0 12px 26px -12px rgba(0, 0, 0, .45); filter: brightness(1.12); }
/* A light sweep crosses primary buttons on hover. */
.btn.primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .18) 50%, transparent 70%);
  transform: translateX(-110%); transition: transform .9s var(--ease);
}
.btn.primary:hover::after { transform: translateX(110%); }
.btn.quiet { border-color: transparent; background: none; box-shadow: none; color: var(--muted); }
.btn.quiet:hover { background: var(--hover); color: var(--ink); transform: none; }
.btn.icon-only { width: 34px; padding: 0; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: default; transform: none; filter: grayscale(.3); }

.avatar {
  --c: #57534e; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 650; color: #fff; flex: none;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 72%, #fff) 0%, var(--c) 52%, color-mix(in srgb, var(--c) 78%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 3px rgba(0, 0, 0, .2); text-shadow: 0 1px 1px rgba(0, 0, 0, .15);
}
.avatar.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 21px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 16px -8px rgba(0, 0, 0, .45); }
.avatar.xs { width: 14px; height: 14px; border-radius: 4px; font-size: 9px; box-shadow: none; }
/* An app's own logo from its code, shown whole on a plain tile like an app icon. */
.avatar.own { background: #fff; overflow: hidden; text-shadow: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .14); }
.avatar.own.lg { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), 0 6px 16px -8px rgba(0, 0, 0, .45); }
.avatar.own.xs { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.avatar.own img { width: 100%; height: 100%; object-fit: contain; display: block; -webkit-user-drag: none; user-select: none; }
.status-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.status-dot.live { background: var(--good-dot); box-shadow: 0 0 10px color-mix(in srgb, var(--good-dot) 70%, transparent); }
.status-dot.warn { background: var(--warn-dot); }
.status-dot.run { background: var(--run); box-shadow: 0 0 10px color-mix(in srgb, var(--run) 70%, transparent); }
.muted { color: var(--muted); }
.small { font-size: 12px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
code { font-family: var(--mono); font-size: 12px; background: var(--hover); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }

.meter { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; display: flex; box-shadow: inset 0 0 0 1px var(--line-2); }
.meter > span { display: block; height: 100%; border-radius: inherit; transition: width .9s var(--spring-soft); animation: meter-in 1.1s var(--ease) backwards; }
@keyframes meter-in { from { width: 0; } }
.meter .ok { background: var(--primary); }
.meter .blk { background: var(--bad-dot); }
.ring {
  position: relative; width: 60px; height: 60px; border-radius: 50%; flex: none; display: grid; place-items: center;
  transition: --p 1s var(--ease); animation: ring-in 1.3s var(--ease) backwards;
}
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--line) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
}
.ring b { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
@keyframes ring-in { from { --p: 0; } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  position: relative; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow); overflow: hidden;
}
.stat .label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.stat .value { margin-top: 8px; font-size: 32px; line-height: 1; font-weight: 680; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 15px; color: var(--faint); font-weight: 550; letter-spacing: -.01em; }
.stat .hint { margin-top: 8px; font-size: 12px; color: var(--muted); }
.stat.alert .value { color: var(--bad); text-shadow: 0 0 24px color-mix(in srgb, var(--bad) 45%, transparent); }
.stat.alert { background: linear-gradient(160deg, var(--bad-soft), transparent 60%), var(--surface); }

/* ---------- lists ---------- */
.rows > * + * { border-top: 1px solid var(--line-2); }
.task { display: flex; align-items: center; gap: 12px; padding: 11px 0; min-height: 50px; transition: opacity var(--mid); }
.task .tick {
  position: relative; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--faint); background: none; padding: 0; cursor: pointer;
  display: grid; place-items: center; flex: none; color: transparent;
  transition: transform var(--mid) var(--spring), border-color var(--fast), background-color var(--mid), box-shadow var(--mid);
}
.task .tick:hover { border-color: var(--good-dot); color: var(--good-dot); transform: scale(1.08); }
.task .tick:active { transform: scale(.88); }
.task .tick svg { width: 11px; height: 11px; stroke-width: 3; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset var(--slow) var(--ease) 60ms; }
.task .tick:hover svg { stroke-dashoffset: 0; }
.task.done .tick { background: var(--good-dot); border-color: var(--good-dot); color: #fff; box-shadow: 0 0 0 4px var(--good-soft); animation: tick-pop var(--slow) var(--spring); }
.task.done .tick svg { stroke-dashoffset: 0; }
@keyframes tick-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.task .t { flex: 1; min-width: 0; }
.task .t .title { color: var(--ink); transition: color var(--mid); }
.task.done .t .title { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
.task .t .meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.task .t .meta a { color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.task .t .meta a:hover { color: var(--accent); }
.task .t .meta a svg { width: 12px; height: 12px; }
.task .acts { display: flex; gap: 4px; opacity: 0; transform: translateX(6px); transition: opacity var(--mid), transform var(--mid) var(--ease); }
.task:hover .acts, .task:focus-within .acts { opacity: 1; transform: none; }
.add { display: flex; gap: 8px; align-items: center; padding: 12px 0 4px; flex-wrap: wrap; }
.add input[type=text] {
  flex: 1; min-width: 180px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); font: inherit; font-size: 13px;
  transition: border-color var(--fast), box-shadow var(--mid) var(--ease);
}
.add input[type=text]::placeholder { color: var(--faint); }
.add input[type=text]:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 4px var(--accent-soft); }
.add label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.add input[type=checkbox] { accent-color: var(--bad-dot); }
.empty-row { padding: 20px 0; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.empty-row .i { color: var(--good-dot); }

.line { display: flex; align-items: center; gap: 12px; padding: 11px 0; min-height: 50px; }
.line .grow { flex: 1; min-width: 0; }
.line.has-more { flex-wrap: wrap; row-gap: 6px; }
.line-more { flex-basis: 100%; padding-left: 44px; display: grid; gap: 4px; }
.line .name { font-weight: 550; }
/* Accounts: services grouped by what they're for, and a key's mode under its name. */
.rows > .group-head { padding: 16px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.rows > .group-head:first-child { padding-top: 4px; }
.rows > .group-head + .line { border-top: 0; }
.acct-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tile {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center;
  font-size: 11px; font-weight: 650; color: var(--ink-2); flex: none; box-shadow: inset 0 1px 0 var(--hi); letter-spacing: .02em;
}
/* A service's own logo (dashboard/logos.js). Black marks are drawn in currentColor,
   so they follow the ink and turn light in dark mode; coloured ones keep their colours. */
.tile.brand { color: var(--ink); }
.logo { display: block; width: 18px; height: 18px; flex: none; }
.logo.wide { width: 22px; }
.logo-sentry { color: #362d59; }
:root[data-theme="dark"] .logo-sentry { color: var(--ink); }

/* ---------- app cards (overview) ---------- */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.app-card {
  text-align: left; padding: 0; cursor: pointer; display: flex; flex-direction: column; font: inherit; color: inherit;
  transition: transform var(--slow) var(--spring-soft), box-shadow var(--slow) var(--ease), border-color var(--mid);
}
.app-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: inset 0 1px 0 var(--hi), var(--shadow-lg); }
.app-card:active { transform: translateY(-1px) scale(.99); transition-duration: 120ms; }
.app-card .top { display: flex; align-items: center; gap: 12px; padding: 18px 18px 12px; }
.app-card .top .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
.app-card .top .nm { font-weight: 620; font-size: 15px; letter-spacing: -.01em; }
.app-card .top .sub { font-size: 12px; color: var(--muted); }
.app-card .top .pill { margin-left: auto; }
.app-card .mid { padding: 0 18px 16px; }
.segs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; margin: 8px 0 10px; }
.segs span { height: 6px; border-radius: 3px; background: var(--line); transition: background-color var(--slow); }
.segs .done, .segs .skipped { background: var(--primary); }
.segs .running { background: var(--run); animation: breathe 1.6s var(--ease-in-out) infinite; }
.segs .blocked { background: var(--bad-dot); }
@keyframes breathe { 50% { opacity: .35; } }
.app-card .bottom { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); margin-top: auto; }
.app-card .bottom .go { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 550; }
.app-card .bottom .go .i { transition: transform var(--mid) var(--spring); }
.app-card:hover .bottom .go { color: var(--accent); }
.app-card:hover .bottom .go .i { transform: translateX(3px); }
.flag { display: inline-flex; align-items: center; gap: 4px; color: var(--bad); font-weight: 550; }

/* ---------- app page ---------- */
.hero {
  padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; overflow: hidden;
  background: radial-gradient(700px 220px at 0% 0%, color-mix(in srgb, var(--c, var(--ink)) 9%, transparent), transparent 70%), var(--surface);
}
.hero .id { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.hero h1 { margin: 0; font-size: 26px; font-weight: 680; letter-spacing: -.028em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; line-height: 1.2; }
.hero .meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.hero .meta .path { font-family: var(--mono); font-size: 12px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.hero .cta { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.facts { grid-column: 1 / -1; display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line-2); margin: 0 -24px -24px; background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.fact { padding: 16px 24px; border-left: 1px solid var(--line-2); }
.fact:first-child { border-left: 0; display: flex; align-items: center; gap: 14px; }
.fact .label { font-size: 12px; color: var(--muted); }
.fact .value { font-size: 22px; font-weight: 680; font-variant-numeric: tabular-nums; margin-top: 2px; letter-spacing: -.03em; }
.fact .value small { font-size: 13px; color: var(--faint); font-weight: 550; letter-spacing: 0; }
.fact .value.bad { color: var(--bad); }

/* A number in the header opens the tab it counts. */
.fact-link { appearance: none; border: 0; border-left: 1px solid var(--line-2); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background-color var(--fast); }
.fact-link:hover { background: var(--hover); }
.fact-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* The app's tabs: plain words on a hairline, the open one underlined in ink.
   On a phone the row scrolls sideways instead of wrapping. */
.tabs {
  display: flex; gap: 2px; margin: 0 0 -4px; padding: 0 2px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 7px; flex: none; height: 42px; padding: 0 12px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 560; color: var(--muted); white-space: nowrap; transition: color var(--fast);
}
.tab::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); transform: scaleX(0); transition: transform var(--mid) var(--ease); }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); }
.tab.on::after { transform: scaleX(1); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 10px; }
.tab .count { height: 18px; min-width: 20px; padding: 0 6px; font-size: 10.5px; }
.tab .count.bad { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.tab .count.warn { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.tab .count.good { background: var(--good-soft); color: var(--good); box-shadow: none; }
.tab .status-dot { width: 7px; height: 7px; }
@media (max-width: 820px) {
  .tabs { margin: 0 -16px -4px; padding: 0 16px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .tabs::after { content: ""; flex: none; width: 20px; }
}
/* Each tab's page fades up when it opens; refreshes patch it in place. */
.tab-panel { animation: rise var(--mid) var(--ease) backwards; }

.roadmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding: 16px 18px 18px; }
.step {
  position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; background: var(--surface-2); min-width: 0;
  box-shadow: inset 0 1px 0 var(--hi); transition: border-color var(--mid), background-color var(--mid), transform var(--mid) var(--spring);
}
.step:hover { transform: translateY(-1px); border-color: var(--line-strong); }
/* The icon sits on the label's first line and the note lines up under the
   words, wrapping to a second line before it's cut (the whole note is on hover). */
.step .lbl { display: flex; align-items: flex-start; gap: 8px; font-weight: 550; font-size: 13px; line-height: 1.35; }
.step .lbl .i { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.step .note { font-size: 12px; line-height: 1.4; color: var(--muted); margin-top: 3px; padding-left: 23px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.step.done .lbl .i, .step.skipped .lbl .i { color: var(--good-dot); }
.step.done { background: linear-gradient(160deg, var(--good-soft), transparent 70%), var(--surface-2); }
.step.running { border-color: transparent; background: linear-gradient(160deg, var(--run-soft), transparent 80%), var(--surface-2); }
.step.running .lbl .i { color: var(--run); animation: spin 1.2s linear infinite; }
/* Running steps get a light that travels around their border. */
.step.running::after, .glow-border::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--angle), color-mix(in srgb, var(--run) 25%, transparent) 0 55%, var(--run) 80%, color-mix(in srgb, var(--run) 25%, transparent) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: orbit 2.6s linear infinite;
}
@keyframes orbit { to { --angle: 360deg; } }
.step.blocked { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: linear-gradient(160deg, var(--bad-soft), transparent 75%), var(--surface-2); }
.step.blocked .lbl .i { color: var(--bad); }
.step.todo .lbl { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
/* Cards beside a side column (ending level), then a list across the full width. */
.top-full { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); grid-template-areas: "top side" "full full"; gap: 20px; }
.top-full > .tf-top { grid-area: top; }
.top-full > .tf-side { grid-area: side; }
.top-full > .tf-full { grid-area: full; }
.top-full:not(.one) > .tf-top > :last-child, .top-full:not(.one) > .tf-side > :last-child { flex: 1; }
.top-full.one { display: flex; flex-direction: column; }

.cat { border-top: 1px solid var(--line-2); }
.cat:first-child { border-top: 0; }
.cat summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 13px 18px; cursor: pointer; user-select: none; transition: background-color var(--fast); }
.cat summary::-webkit-details-marker { display: none; }
.cat summary:hover { background: var(--hover); }
.cat summary .chev { color: var(--faint); transition: transform var(--mid) var(--spring); }
.cat[open] summary .chev { transform: rotate(90deg); }
.cat summary .nm { font-weight: 550; flex: 1; min-width: 0; }
.cat summary .meter { width: 80px; }
.cat summary .frac { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; width: 64px; text-align: right; }
.cat summary .frac.full { color: var(--good); }
.cat .items { padding: 0 18px 12px 46px; }
/* Smooth open and close where the browser can animate to auto heights. */
details::details-content { block-size: 0; overflow: clip; transition: block-size var(--mid) var(--ease), content-visibility var(--mid) allow-discrete; }
details[open]::details-content { block-size: auto; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.check input {
  appearance: none; margin: 2px 0 0; width: 17px; height: 17px; border: 1.5px solid var(--faint); border-radius: 5px; display: grid; place-items: center;
  cursor: pointer; flex: none; background: var(--field); transition: background-color var(--mid), border-color var(--fast), transform var(--mid) var(--spring);
}
.check input:hover { border-color: var(--accent); }
.check input:active { transform: scale(.85); }
.check input:checked { background: var(--primary); border-color: transparent; box-shadow: none; animation: tick-pop var(--slow) var(--spring); }
.check input:checked::after { content: ""; width: 8px; height: 4px; border: 2px solid var(--primary-ink); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.check .tx { flex: 1; transition: color var(--mid); }
.check input:checked + .tx { color: var(--muted); }
.check .by { font-size: 11px; color: var(--faint); }
.check .why { display: block; font-size: 12px; color: var(--bad); margin-top: 2px; }
.btn .i.spin { animation: spin 1s linear infinite; }
/* Checks Liftoff proves itself: a shield instead of a box to tick. */
.check.proved { cursor: default; }
.check .state { flex: none; width: 17px; height: 17px; margin-top: 2px; display: grid; place-items: center; color: var(--faint); }
.check .state .i { width: 17px; height: 17px; }
.check .state.ok { color: var(--good); }
.check .state.no { color: var(--bad); }
.check .state.found { color: var(--muted); }
.check.proved.ok .tx, .check.proved.found .tx { color: var(--muted); }
.check .wait-note { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.cat summary .cat-bad { color: var(--bad); display: inline-flex; }
.cat summary .cat-bad .i { width: 14px; height: 14px; }
/* One line under a checks card's head: what the list is and whether it counts. */
.list-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); line-height: 1.45; }
.list-note .i { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--muted); }
.list-note .box { flex: none; width: 12px; height: 12px; margin-top: 3px; border: 1.5px solid var(--faint); border-radius: 4px; }
.verify-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.verify-sum .vs-counts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--muted); flex: 1 1 100%; min-width: 0; }
.verify-sum .vs-when { color: var(--ink-2); font-weight: 550; }
.verify-sum .vs-counts span { display: inline-flex; align-items: center; gap: 5px; }
.verify-sum .vs-counts .i { width: 14px; height: 14px; }
.verify-sum .vs-counts .ok { color: var(--good); }
.verify-sum .vs-counts .no { color: var(--bad); }
.verify-sum .vs-fixes { display: flex; flex-wrap: wrap; gap: 6px; }
.vs-fix { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink); font: inherit; font-size: 12.5px; white-space: nowrap; }
button.vs-fix { cursor: pointer; transition: background-color var(--fast), border-color var(--fast); }
button.vs-fix:hover { background: var(--hover); border-color: var(--line-strong); }
button.vs-fix:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vs-fix .n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 11px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.vs-fix .i { width: 13px; height: 13px; color: var(--muted); }
.next { display: flex; gap: 16px; align-items: flex-start; padding: 18px; overflow: hidden; }
.next::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(500px 160px at 0% 0%, var(--accent-soft), transparent 70%); }
.next > * { position: relative; }
.next .tile { flex: none; width: 38px; height: 38px; border-radius: 12px; color: var(--primary-ink); background: var(--primary); border: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), var(--glow); }
.next h2 { margin: 0 0 4px; font-size: 16px; font-weight: 640; letter-spacing: -.015em; }
.next p { margin: 2px 0 0; max-width: 75ch; color: var(--ink-2); overflow-wrap: anywhere; }
.next .grow { flex: 1; min-width: 0; }
.next .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .next { flex-wrap: wrap; } .next .acts { justify-content: flex-start; width: 100%; } }
.next code { font-size: 12px; background: var(--hover); padding: 2px 6px; border-radius: 5px; }
.pulse-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 14px 0 4px; }
.pulse-grid .label { font-size: 12px; color: var(--muted); }
.pulse-grid .value { font-size: 22px; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.pulse-grid .delta { font-size: 12px; color: var(--muted); }
.pulse-grid .delta.up { color: var(--good); }
.pulse-grid .delta.down { color: var(--bad); }

.deploy { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.deploy .grow { flex: 1; min-width: 0; }
.deploy .v { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.live-link {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 14px 0 4px; border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(120deg, var(--good-soft), transparent 70%), var(--surface-2); text-decoration: none;
  transition: border-color var(--fast), transform var(--mid) var(--spring);
}
.live-link:hover { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); transform: translateY(-1px); }
.live-link .host { font-weight: 550; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.timeline { position: relative; padding: 12px 0 4px; }
.ev { position: relative; display: flex; gap: 12px; padding: 6px 0; font-size: 13px; }
.ev::before { content: ""; position: absolute; left: 3px; top: 20px; bottom: -6px; width: 1px; background: linear-gradient(var(--line), var(--line-2)); }
.ev:last-child::before { display: none; }
.ev .bul { width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--faint); flex: none; position: relative; z-index: 1; box-shadow: 0 0 0 3px var(--bg); }
.ev .bul.good { background: var(--good-dot); box-shadow: 0 0 0 3px var(--bg), 0 0 8px var(--good-dot); }
.ev .bul.run { background: var(--run); box-shadow: 0 0 0 3px var(--bg), 0 0 8px var(--run); }
.ev .bul.bad { background: var(--bad-dot); }
.ev .msg { flex: 1; min-width: 0; color: var(--ink-2); }
.ev .msg b { font-weight: 550; color: var(--ink); }
.ev time { font-size: 12px; color: var(--faint); white-space: nowrap; }

.empty { padding: 60px 24px; text-align: center; color: var(--muted); }
.empty .tile { width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 16px; color: var(--primary-ink); background: var(--primary); border: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), var(--glow); }
.empty .tile svg { width: 22px; height: 22px; }
.empty h2 { margin: 0 0 6px; font-size: 17px; color: var(--ink); letter-spacing: -.015em; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 32px));
  padding: 11px 16px; border-radius: 14px; font-size: 13px; font-weight: 500; color: var(--ink);
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-lg);
  transform: translateX(-50%); animation: toast-in var(--slow) var(--spring-soft);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good-dot); flex: none; }
.toast.bad::before { background: var(--bad-dot); }
.toast.out { opacity: 0; transform: translate(-50%, 8px) scale(.97); transition: opacity var(--mid), transform var(--mid) var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 18px) scale(.94); } }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .top-full { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "full" "side"; }
  .top-full.one > .tf-side { order: 1; }
}
/* Phones: the top bar (where you are, Offline, the theme switch, your
   account) stays at the top, and the pages and apps sit in a strip under it
   that scrolls sideways and fades at the edge where there's more. */
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; align-content: start; }
  .main { display: contents; }
  .topbar { order: -1; height: 52px; padding: 0 12px 0 16px; gap: 6px; min-width: 0; }
  .topbar > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .sync:not(.off) { display: none; }
  .topbar .sync.off { margin-left: auto; }
  .topbar .theme-btn { margin-left: auto; margin-right: 0; }
  .topbar .sync.off + .theme-btn { margin-left: 0; }
  .side { position: relative; top: auto; height: auto; flex-direction: row; align-items: center; gap: 4px; padding: 6px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .side::-webkit-scrollbar { display: none; }
  .side .brand, .nav-label, .side .foot { display: none; }
  .nav-ind::before { display: none; }
  .side #applist { display: flex; gap: 4px; padding-right: 24px; }
  .nav { width: auto; white-space: nowrap; flex: none; }
  .content { padding: 18px 16px 32px; gap: 16px; }
  .page-head h1 { font-size: 24px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat .value { font-size: 26px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 -18px -18px; }
  .fact { padding: 12px 18px; }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .task .acts { opacity: 1; transform: none; }
  .roadmap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Two tiles to a row: the note takes the tile's full width. */
  .step .note { padding-left: 0; }
  .cat summary .meter, .card-head .end.sub { display: none; }
}

/* ---------- what the app does ---------- */
.does .lead { margin: 10px 0 12px; max-width: 72ch; }
.does.ask { border-color: var(--line-strong); box-shadow: inset 0 1px 0 var(--hi), var(--shadow-lg); }
.feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.feat {
  display: flex; align-items: flex-start; gap: 12px; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0;
  padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); box-shadow: inset 0 1px 0 var(--hi);
  transition: border-color var(--mid), background-color var(--mid), transform var(--mid) var(--spring);
}
.feat:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.feat:active { transform: scale(.985); }
.feat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.feat:disabled { opacity: .6; cursor: progress; transform: none; }
.feat .ft { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feat .ft b { font-weight: 560; }
.feat .ft .small { overflow-wrap: anywhere; }
.feat:not(.on) .ft b { color: var(--ink-2); }
/* The switch: ink track and a light knob when on. */
.feat .sw {
  position: relative; flex: none; width: 32px; height: 19px; margin-top: 1px; border-radius: 999px; background: var(--line-strong);
  transition: background-color var(--mid) var(--ease);
}
.feat .sw::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--surface-solid);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform var(--mid) var(--spring);
}
.feat.on .sw { background: var(--primary); }
.feat.on .sw::after { transform: translateX(13px); background: var(--primary-ink); }
.does-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; }
.does-foot .grow { flex: 1; min-width: 160px; }
.does.slim { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px 10px 16px; }
.does.slim > .i { color: var(--muted); }
.does.slim .k { font-size: 12px; color: var(--muted); }
.does.slim .tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.does .tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.does.slim .btn { height: 28px; padding: 0 10px; font-size: 12px; }
.left-out { border-top: 1px solid var(--line-2); padding: 16px 18px 18px; }
.lo-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.lo-head b { font-size: 13px; font-weight: 600; }
.lo-head .small { flex-basis: 100%; }
/* A dashed row per step: minus, name over when it's needed, Add at the end. */
.lo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; margin-top: 12px; }
.lo-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "icon name add" ". note note"; align-items: center; gap: 2px 8px;
  min-width: 0; padding: 9px 9px 11px 13px; border: 1px dashed var(--line-strong); border-radius: 12px;
}
.lo-item > .i { grid-area: icon; width: 15px; height: 15px; color: var(--faint); }
.lo-item > b { grid-area: name; min-width: 0; font-size: 13px; font-weight: 550; line-height: 1.35; color: var(--ink-2); }
.lo-item > .note { grid-area: note; font-size: 12px; line-height: 1.45; color: var(--muted); }
.lo-item .btn { grid-area: add; height: 26px; padding: 0 9px; font-size: 12px; gap: 4px; }
.lo-item .btn .i { width: 13px; height: 13px; }
.lo-checks { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 12px 18px 16px; border-top: 1px solid var(--line-2); }
.linkish { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkish:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
@media (max-width: 640px) {
  .feats { grid-template-columns: minmax(0, 1fr); }
  .left-out { padding-left: 16px; padding-right: 16px; }
  .does.slim .tags { flex-basis: 100%; order: 3; }
  /* Readiness gets the whole first row, so its line doesn't wrap word by word. */
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fact:first-child { grid-column: 1 / -1; }
  .fact:nth-child(n+2) { border-top: 1px solid var(--line-2); }
  .fact:nth-child(2) { border-left: 0; }
  .fact:nth-child(3) { border-left: 1px solid var(--line-2); }
}

/* ---------- small motion ---------- */
/* An app that's new in the sidebar slides in (the list is keyed, so the
   others stay put). */
#applist > .nav { animation: nav-in var(--slow) var(--spring-soft) backwards; }
@keyframes nav-in { from { opacity: 0; transform: translate3d(-8px, 0, 0); } }
/* A status that turns good says so with a small pop. */
.card-head .pill.good, .hero h1 .pill.good, .app-card .pill.good { animation: pill-in .5s var(--spring) backwards; }
@keyframes pill-in { from { opacity: .35; transform: scale(.82); } }
/* Icons in buttons move the way they point. */
.btn .i-flag { transform-origin: 22% 92%; }
.btn:hover .i-rocket { transform: translate(1.5px, -1.5px) rotate(-6deg); }
.btn:hover .i-plus { transform: rotate(90deg); }
.btn:hover .i-external { transform: translate(1.5px, -1.5px); }
.btn:hover .i-play { transform: scale(1.14); }
.btn:hover .i-copy { transform: translate(-1px, -1px); }
.btn:hover .i-flag { transform: rotate(-8deg); }
.btn:hover .i-upload { transform: translateY(-2px); }
.btn:hover .i-undo { transform: rotate(-24deg); }
.btn:hover .i-refresh { transform: rotate(60deg); }
.btn:hover .i-trash { transform: rotate(-8deg); }
/* A button working on something shows a moving line along its foot. */
.btn[data-busy] { cursor: progress; }
.btn[data-busy]:disabled { opacity: .7; }
.btn[data-busy]::before {
  content: ""; position: absolute; left: 14%; right: 14%; bottom: 4px; height: 2px; border-radius: 2px; background: currentColor; opacity: .5;
  transform-origin: 0 50%; animation: busy-line 1.15s var(--ease-in-out) infinite;
}
@keyframes busy-line {
  0% { transform: scaleX(0); transform-origin: 0 50%; }
  50% { transform: scaleX(1); transform-origin: 0 50%; }
  50.01% { transform: scaleX(1); transform-origin: 100% 50%; }
  100% { transform: scaleX(0); transform-origin: 100% 50%; }
}
/* The toast's dot lands a beat after the toast. */
.toast::before { animation: pop .45s var(--spring) .12s backwards; }
/* The app's tile tips its hat. */
.hero .avatar.lg { transition: transform var(--slow) var(--spring); }
.hero .avatar.lg:hover { transform: rotate(-5deg) scale(1.05); }
/* The proof behind a check: a toggle on the row, and what Liftoff asked,
   what came back and the code it read, under it. */
.proof-btn { flex: none; display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 6px 0 8px; margin-top: -1px; border: 1px solid transparent; border-radius: 999px; background: none; color: var(--faint); font: inherit; font-size: 11.5px; cursor: pointer; transition: color var(--fast), background-color var(--fast), border-color var(--fast); }
.proof-btn .i { width: 13px; height: 13px; transition: transform var(--mid) var(--ease); }
.proof-btn:hover, .proof-btn:focus-visible { color: var(--ink); background: var(--hover); border-color: var(--line); }
.proof-btn[aria-expanded="true"] { color: var(--ink); }
.proof-btn[aria-expanded="true"] .i { transform: rotate(90deg); }
.proof { margin: 2px 0 10px 27px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-solid); font-size: 12.5px; animation: proof-in var(--mid) var(--ease); }
@keyframes proof-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.proof-head { display: flex; gap: 8px; align-items: baseline; font-weight: 600; font-size: 12px; margin-bottom: 6px; }
.proof-head .when { font-weight: 400; color: var(--faint); }
.proof-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.proof-line { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: baseline; }
.proof-line .src { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proof-line .body { min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.proof-line .where { font-family: var(--mono); font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.proof-line code { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.proof-line .ans { color: var(--muted); overflow-wrap: anywhere; }
.proof-wait { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.proof-wait.bad { color: var(--bad); }
.proof-limits { margin: 8px 0 0; color: var(--muted); }
.proof-limits b { font-weight: 600; color: var(--ink); }
.cat-note { color: var(--muted); padding: 2px 0 6px; }
@media (max-width: 560px) {
  .proof { margin-left: 0; }
  .proof-line { grid-template-columns: 1fr; gap: 2px; }
}


/* ---------- motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important;
  }
  body::before { animation: none !important; }
  .step.running::after, .glow-border::after { animation: none !important; }
}

