/* Light only. Geist type, a neutral gray scale, black primary actions, one blue for
   links, focus and selection. Cards lift on a hairline shadow instead of a border.
   The tokens are shared with the Task Authority approval page so both read as one product. */
:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --surface: #f5f5f5;
  --ink: #171717;
  --muted: #666666;
  --faint: #8f8f8f;
  --line: #ebebeb;
  --line-strong: #d4d4d4;
  --primary: #171717;
  --primary-hover: #383838;
  --primary-ink: #ffffff;
  --accent: #0070f3;
  --accent-tint: #ebf5ff;
  --ok-bg: #ebfaef;
  --ok-fg: #107d32;
  --warn-bg: #fff4d5;
  --warn-fg: #aa4d00;
  --bad-bg: #ffebeb;
  --bad-fg: #cb2a2f;
  --info-bg: #ebf5ff;
  --info-fg: #0068d6;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --shadow-card: 0 0 0 1px rgb(0 0 0 / 0.08), 0 2px 2px rgb(0 0 0 / 0.04);
  --shadow-pop:
    0 0 0 1px rgb(0 0 0 / 0.08), 0 4px 8px -4px rgb(0 0 0 / 0.04),
    0 16px 24px -8px rgb(0 0 0 / 0.06);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --sans:
    "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --small: 0.8125rem;
  --body: 0.875rem;
  --lead: 1.125rem;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --head-h: 56px;
  color-scheme: light;
}

/* ------- base ------- */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--body) / 1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}
h2 {
  font-size: 1.125rem;
}
h3 {
  font-size: 0.875rem;
  letter-spacing: -0.01em;
}
p {
  margin: 0 0 10px;
}
a {
  color: var(--accent);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
code,
pre,
.mono {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-feature-settings: "liga" 0;
}
::selection {
  background: #cce4ff;
}
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}
[hidden] {
  display: none !important;
}
.dim {
  color: var(--muted);
  font-size: var(--small);
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Loading: the mark over a thin indeterminate bar, faded in late so fast loads never flash it. */
.boot {
  min-height: 70svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: fade-in 300ms ease 200ms both;
}
.boot-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 28px 28px no-repeat;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.12),
    inset 0 1px 0 rgb(255 255 255 / 0.12);
}
.boot-bar {
  position: relative;
  width: 120px;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.boot-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: inherit;
  background: var(--ink);
  animation: slide 1.1s var(--ease) infinite;
}
@keyframes slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(250%);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
/* Skeleton panels while a section loads. */
.sk > * + * {
  margin-top: 24px;
}
.sk-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.sk-panel {
  display: grid;
  gap: 12px;
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.sk-line {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(
      90deg,
      transparent,
      rgb(255 255 255 / 0.7),
      transparent
    )
    var(--surface);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.sk-line:first-child {
  height: 14px;
  margin-bottom: 6px;
  background-color: var(--line);
}
@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}
@media (max-width: 1000px) {
  .sk-split {
    grid-template-columns: 1fr;
  }
}
.spacer {
  flex: 1;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.stack > * + * {
  margin-top: 12px;
}
.stack-lg > * + * {
  margin-top: 20px;
}

/* ------- disclosure (always visible, never loud) ------- */
.disclose {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 24px;
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
}
.disclose b {
  color: var(--ink);
  font-weight: 500;
}
.mockflag {
  display: inline-block;
  background: var(--bad-bg);
  color: var(--bad-fg);
  padding: 0 8px;
  border-radius: 9999px;
  font-weight: 500;
  margin-right: 8px;
}

/* ------- wordmark ------- */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.wordmark::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--primary)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 20px 20px no-repeat;
}

/* ------- buttons ------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  font-weight: 500;
  font-size: var(--body);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background-color 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease,
    transform 100ms ease-out;
}
.btn:hover:not(:disabled) {
  background: var(--surface);
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn:focus-visible {
  box-shadow: var(--ring);
}
.btn.primary {
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: none;
}
.btn.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}
.btn.primary:focus-visible {
  box-shadow: var(--ring);
}
.btn.danger {
  color: var(--bad-fg);
}
.btn.danger:hover:not(:disabled) {
  background: var(--bad-bg);
}
.btn.danger-fill {
  background: var(--bad-fg);
  color: #fff;
  box-shadow: none;
}
.btn.danger-fill:hover:not(:disabled) {
  background: #a8191d;
}
.btn.small {
  height: 32px;
  padding: 0 12px;
  font-size: var(--small);
}
.btn.ghost {
  background: none;
  box-shadow: none;
  color: var(--muted);
}
.btn.ghost:hover:not(:disabled) {
  background: var(--surface);
  color: var(--ink);
}
.btn.lg {
  height: 44px;
  padding: 0 20px;
  font-size: 0.9375rem;
  border-radius: var(--r-md);
}
.btn.block {
  display: flex;
  width: 100%;
}
.btn:disabled,
.pick:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.link,
.textlink {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}
.link:hover,
.textlink:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.why {
  color: var(--bad-fg);
  font-size: var(--small);
  margin: 6px 0 0;
}
.why:empty {
  display: none;
}

/* ------- landing ------- */
.landing {
  --gx: max(24px, calc((100vw - 1120px) / 2));
}
.l-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--head-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--gx);
  background: rgb(255 255 255 / 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.l-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.navlink {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--small);
  font-weight: 500;
  transition: color 150ms ease;
}
.navlink:hover {
  color: var(--ink);
}
.l-hero {
  position: relative;
  padding: 96px var(--gx) 88px;
  text-align: center;
  isolation: isolate;
}
/* A faint grid that fades out from the top centre. */
.l-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgb(0 0 0 / 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(0 0 0 / 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(
    ellipse 70% 60% at 50% 0%,
    #000 30%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 70% 60% at 50% 0%,
    #000 30%,
    transparent 100%
  );
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  padding: 4px 12px 4px 10px;
  border-radius: 9999px;
  background: var(--bg);
  box-shadow: var(--shadow-card);
  font-size: var(--small);
  font-weight: 500;
  color: var(--muted);
}
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok-fg);
  box-shadow: 0 0 0 3px var(--ok-bg);
}
.eyebrow.plain {
  padding: 0;
  margin: 0 0 12px;
  background: none;
  box-shadow: none;
  color: var(--accent);
  font-size: var(--small);
}
.l-hero h1 {
  font-weight: 700;
  font-size: clamp(2.75rem, 7.5vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.05em;
}
/* The gradient sits on the animated line, so the clip follows its transform. */
.l-hero h1 .ln > span {
  background: linear-gradient(180deg, #171717 35%, #555555);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ln {
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.08em;
}
.ln > span {
  display: block;
}
.l-lead {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: 34rem;
  margin: 24px auto 0;
  line-height: 1.55;
  letter-spacing: -0.01em;
}
.l-error {
  margin: 20px auto 0;
  max-width: 36rem;
  background: var(--bg);
  color: var(--muted);
  box-shadow: var(--shadow-card);
  padding: 12px 16px 12px 40px;
  border-radius: var(--r-md);
  text-align: left;
  position: relative;
}
.l-error::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bad-fg);
  box-shadow: 0 0 0 4px var(--bad-bg);
}
.l-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 36px;
}
.l-note {
  color: var(--faint);
  font-size: var(--small);
  margin: 16px 0 0;
}
.l-example {
  margin: 64px auto 0;
  max-width: 880px;
  text-align: left;
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow:
    var(--shadow-pop),
    0 40px 80px -24px rgb(0 0 0 / 0.12);
  overflow: hidden;
}
.win-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--muted);
}
.win-bar .mono {
  flex: 1;
  font-size: 0.75rem;
}
.win-dots {
  display: inline-flex;
  gap: 6px;
}
.win-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}
.ex-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.ex-grid > div {
  padding: 24px;
  min-width: 0;
}
.ex-grid > div + div {
  border-left: 1px solid var(--line);
}
.ex-grid h3 {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ex-grid .dim {
  margin: 0;
  font-size: 0.75rem;
}
.l-example figcaption {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.75rem;
}
.big {
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 8px 0 8px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.l-how,
.l-real {
  padding: 112px var(--gx);
  border-top: 1px solid var(--line);
}
.l-real {
  background: var(--bg-subtle);
}
.l-head {
  max-width: 40rem;
  margin-bottom: 48px;
}
.l-how h2,
.l-real h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.l-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.l-cards li {
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.l-cards .num {
  color: var(--faint);
  font-size: 0.75rem;
  margin-bottom: 24px;
}
.l-cards strong {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.l-cards li > span:last-child {
  color: var(--muted);
}
.cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}
.cols > div {
  background: var(--bg);
  padding: 28px;
}
.cols h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.cols p {
  color: var(--muted);
  margin: 0;
}
.l-cta {
  position: relative;
  padding: 128px var(--gx);
  border-top: 1px solid var(--line);
  text-align: center;
  isolation: isolate;
}
.l-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    ellipse 50% 60% at 50% 100%,
    rgb(0 112 243 / 0.08),
    transparent 70%
  );
}
.l-cta h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.05em;
}
.l-cta p {
  font-size: var(--lead);
  color: var(--muted);
  max-width: 32rem;
  margin: 16px auto 32px;
}
.l-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 32px var(--gx);
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: var(--small);
}
.l-foot > span:nth-child(2) {
  flex: 1;
}
.foot-link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.foot-link:hover {
  color: var(--ink);
}
@media (max-width: 960px) {
  .l-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .l-links .navlink {
    display: none;
  }
  .l-hero {
    padding: 64px 20px 56px;
  }
  .ex-grid,
  .cols,
  .l-cards {
    grid-template-columns: 1fr;
  }
  .ex-grid > div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .l-how,
  .l-real,
  .l-cta {
    padding: 72px 20px;
  }
  .l-foot {
    padding: 24px 20px;
  }
  .l-foot > span:nth-child(2) {
    flex-basis: 100%;
    order: 3;
  }
  .disclose {
    padding: 6px 16px;
    text-align: left;
  }
}

/* ------- console ------- */
.console {
  min-height: 100svh;
  background: var(--bg-subtle);
}
.c-head {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--head-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: rgb(255 255 255 / 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
/* Sandbox time left: a quiet pill that turns amber, then red. */
.ttl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px 0 8px;
  border-radius: 9999px;
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  font-size: var(--small);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ttl::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--clock) center / contain no-repeat;
  mask: var(--clock) center / contain no-repeat;
  --clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}
.ttl.warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
  box-shadow: inset 0 0 0 1px rgb(170 77 0 / 0.15);
}
.ttl.bad {
  background: var(--bad-bg);
  color: var(--bad-fg);
  box-shadow: inset 0 0 0 1px rgb(203 42 47 / 0.15);
}
.who {
  color: var(--muted);
  font-size: var(--small);
  padding-right: 4px;
}
.c-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
}

.reviewer-reason {
  font-family: var(--sans);
  color: var(--ink);
  margin-top: 4px;
  white-space: normal;
}
.field.check label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 500;
}
.onboard-option label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  font-size: var(--small);
  color: var(--muted);
  padding: 12px;
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--line);
  margin: 4px 0 12px;
  cursor: pointer;
}
.onboard-option input {
  margin-top: 2px;
  flex: none;
}
.onboard-option b {
  color: var(--ink);
  font-weight: 500;
}
.sheet textarea {
  width: 100%;
  font: inherit;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  resize: vertical;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  position: relative;
}
.step-head {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  padding: 8px;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 150ms ease;
}
.step-head:hover {
  background: var(--surface);
}
/* The state word stays for screen readers; sighted users get a status dot. */
.step-state {
  position: relative;
  width: 18px;
  height: 18px;
  font-size: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.step.done .step-state {
  background: var(--ink)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.5 2.5 5.5-6' stroke='white' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 18px no-repeat;
  box-shadow: none;
}
.step.cur .step-state {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.step.cur .step-state::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.step-title {
  font-size: var(--body);
}
.step.done .step-title {
  color: var(--ink);
}
.step.cur .step-title {
  color: var(--ink);
  font-weight: 600;
}
.step-body {
  padding: 2px 8px 12px 36px;
  font-size: var(--small);
  color: var(--muted);
}
.step-body b,
.step-body strong {
  color: var(--ink);
  font-weight: 500;
}
.step-body .row {
  margin-top: 8px;
}

.c-main {
  min-width: 0;
}
.tabs {
  position: relative;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.tabs button {
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  margin-bottom: 6px;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 150ms ease,
    background-color 150ms ease;
}
.tabs button:hover {
  color: var(--ink);
  background: var(--surface);
}
.tabs button[aria-selected="true"] {
  color: var(--ink);
}
.tabs .ind {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--ink);
  will-change: transform, width;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}
.split.even {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.split > div > * + * {
  margin-top: 24px;
}
.split > * {
  scroll-margin-top: calc(var(--head-h) + 72px);
}
/* ------- onboarding: the create step and pre-console errors ------- */
.onboard {
  min-height: calc(100svh - var(--head-h) - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 48px 16px 15vh;
}
.onboard > .alert {
  width: 100%;
  max-width: 480px;
}
.onboard-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  padding: 32px;
}
.onboard-mark {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 28px 28px no-repeat;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.12),
    inset 0 1px 0 rgb(255 255 255 / 0.12);
}
.onboard-card h1 {
  margin-top: 20px;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}
.onboard-lead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.onboard-facts {
  list-style: none;
  margin: 24px 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}
.onboard-facts li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
  color: var(--muted);
  font-size: var(--small);
  line-height: 1.45;
}
.onboard-facts b {
  display: block;
  color: var(--ink);
  font-size: var(--body);
  font-weight: 500;
}
.onboard-facts .ico {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background-color: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
}
.onboard-err:not(:empty) {
  margin-bottom: 16px;
}
.onboard-foot {
  margin: 0;
  color: var(--muted);
  font-size: var(--small);
  text-align: center;
}
.onboard-foot b {
  color: var(--ink);
  font-weight: 500;
}
.btn[aria-busy="true"]::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
.btn[aria-busy="true"]:disabled {
  opacity: 0.85;
  cursor: progress;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 520px) {
  .onboard {
    justify-content: flex-start;
    padding-top: 24px;
  }
  .onboard-card {
    padding: 24px 20px;
  }
}

/* ------- icons: masks, so they take currentColor ------- */
.ico {
  display: inline-block;
  flex: none;
  position: relative;
}
.ico::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}
.ico-lock {
  --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E");
}
.ico-bolt {
  --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E");
}
.ico-clock {
  --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}
.ico-alert {
  --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5M12 16.5h.01'/%3E%3C/svg%3E");
}
@media (max-width: 1000px) {
  .c-body {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 16px 80px;
  }

  .split,
  .split.even {
    grid-template-columns: 1fr;
  }
  .c-head {
    padding: 0 16px;
  }
}
@media (max-width: 520px) {
  .who {
    display: none;
  }
}
@media (max-width: 700px) {
  .tabs button {
    padding: 8px 8px;
    font-size: var(--small);
  }
}

/* ------- interface fragments ([data-ui]) ------- */
.panel {
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.panel > * + * {
  margin-top: 16px;
}
.panel > h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.panel > h2 + .list,
.panel > h2 + .tablewrap {
  margin-top: 20px;
}
.purpose {
  color: var(--muted);
  max-width: 70ch;
  margin: 6px 0 0;
}
.actors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.actors > * {
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 16px;
}
.actors h3 {
  margin-bottom: 4px;
}
.actors p {
  color: var(--muted);
  font-size: var(--small);
}
@media (max-width: 700px) {
  .actors {
    grid-template-columns: 1fr;
  }
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.pick {
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 0;
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 12px 14px;
  color: var(--ink);
  display: grid;
  gap: 2px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    box-shadow 150ms ease,
    background-color 150ms ease,
    transform 100ms ease-out;
}
.pick:hover:not(:disabled) {
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.pick:active:not(:disabled) {
  transform: scale(0.99);
}
.pick:focus-visible {
  box-shadow: var(--ring);
}
.pick[aria-current="true"] {
  background: var(--bg);
  box-shadow:
    inset 0 0 0 1px var(--ink),
    0 0 0 3px rgb(0 0 0 / 0.06);
}
.pick strong {
  font-weight: 500;
}
.pick span {
  color: var(--muted);
  font-size: var(--small);
}
.qrow {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: center;
}
.qrow input {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
}
.guide-hl {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--accent),
    0 0 0 8px rgb(0 112 243 / 0.15) !important;
}
.badge,
.chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0 8px;
  border-radius: 9999px;
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0;
  vertical-align: middle;
}
.chip {
  font-family: var(--mono);
  font-weight: 400;
  border-radius: var(--r-sm);
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
}
.badge.allow,
.badge.ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
}
.badge.approve,
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
}
.badge.step_up {
  background: var(--info-bg);
  color: var(--info-fg);
}
.badge.deny,
.badge.bad {
  background: var(--bad-bg);
  color: var(--bad-fg);
}
.term {
  position: relative;
  cursor: help;
  text-decoration: underline dotted var(--faint);
  text-underline-offset: 3px;
}
.badge.term {
  text-decoration: none;
}
.tip {
  display: block;
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 60;
  width: min(280px, 80vw);
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 10px 12px;
  box-shadow: var(--shadow-pop);
  font-size: var(--small);
  font-weight: 400;
  font-family: var(--sans);
  white-space: normal;
  line-height: 1.45;
  text-align: left;
  transform: translateY(-2px);
  transition:
    opacity 140ms ease-out,
    transform 140ms var(--ease),
    visibility 0s 140ms;
}
.tip b {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}
.term:hover .tip,
.term:focus .tip,
.term:focus-within .tip {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}
@media (max-width: 700px) {
  .term .tip {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    top: auto;
    width: auto;
  }
}
.notice {
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 12px 14px;
}
.notice.ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
  box-shadow: inset 0 0 0 1px rgb(16 125 50 / 0.15);
}
.notice.warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
  box-shadow: inset 0 0 0 1px rgb(170 77 0 / 0.15);
}
.notice.bad {
  background: var(--bad-bg);
  color: var(--bad-fg);
  box-shadow: inset 0 0 0 1px rgb(203 42 47 / 0.15);
}
.notice > * {
  margin: 6px 0 0;
}
.notice > b:first-child {
  margin: 0;
  font-weight: 600;
}
.notice details {
  margin-top: 8px;
}
.notice details summary {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.notice details p {
  margin: 6px 0 0;
}
/* Errors: a card with a red mark, never a red wall of text. Title and body stay ink and muted. */
.alert {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 16px;
}
.panel .alert,
.onboard-card .alert {
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--r-md);
}
.alert-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bad-bg);
  color: var(--bad-fg);
}
.alert-main {
  min-width: 0;
  padding-top: 3px;
}
.alert-title {
  display: block;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.alert-main p {
  margin: 4px 0 0;
  color: var(--muted);
}
.alert-main .row {
  margin-top: 12px;
}
.alert-code {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.75rem;
}
.alert-detail {
  margin-top: 12px;
  font-size: var(--small);
}
.alert-detail summary {
  width: fit-content;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.alert-detail summary::-webkit-details-marker {
  display: none;
}
.alert-detail summary::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 2px 1px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 150ms ease;
}
.alert-detail[open] summary::before {
  transform: rotate(45deg);
}
.alert-detail summary:hover {
  color: var(--ink);
}
.alert-detail pre {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.empty {
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}
.empty strong {
  display: block;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 2px;
}
.tablewrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--line);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--small);
  font-variant-numeric: tabular-nums;
}
th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
th {
  background: var(--bg-subtle);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  white-space: nowrap;
}
tbody tr {
  transition: background-color 120ms ease;
}
tbody tr:hover {
  background: var(--bg-subtle);
}
.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 24px;
  margin: 0;
  font-size: var(--small);
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.kv dd.mono {
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.amount {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.assure,
.batch-item,
.rule {
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 14px 16px;
}
.assure h3 {
  margin-bottom: 4px;
}
.assure .notice {
  margin-top: 10px;
}
.batch-item + .batch-item {
  margin-top: 12px;
}
.batch-item > * + * {
  margin-top: 10px;
}
.batch-item label {
  align-items: flex-start;
}
.rule .when {
  display: block;
  background: var(--bg);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 8px 10px;
  margin: 8px 0;
  overflow-x: auto;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}
.field input {
  width: 180px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-variant-numeric: tabular-nums;
  transition: box-shadow 150ms ease;
}
.field input:hover {
  box-shadow: inset 0 0 0 1px var(--faint);
}
.field input:focus-visible {
  box-shadow:
    inset 0 0 0 1px var(--ink),
    0 0 0 3px rgb(0 0 0 / 0.08);
}
.field p {
  margin: 6px 0 0;
}
.diff {
  margin: 0;
  padding-left: 18px;
}
.diff s {
  color: var(--faint);
}
details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
}
details pre {
  margin-top: 8px;
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 12px;
  border-radius: var(--r-md);
  overflow-x: auto;
}
.glossary {
  display: grid;
  grid-template-columns: minmax(130px, 220px) 1fr;
  gap: 0;
  margin: 0;
}
.glossary dt,
.glossary dd {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.glossary dt {
  font-weight: 500;
  padding-right: 20px;
}
.glossary dd {
  margin: 0;
  color: var(--muted);
}
@media (max-width: 700px) {
  .glossary {
    grid-template-columns: 1fr;
  }
  .glossary dt {
    border-bottom: 0;
    padding-bottom: 2px;
  }
  .glossary dd {
    padding-top: 0;
  }
}
.life,
.checks {
  margin: 8px 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 6px;
}
.checks {
  margin: 4px 0 12px;
}

/* the signature: one decision, three transports */
.receipts {
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.receipt-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.receipt-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.receipt-cols article {
  padding: 20px;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
  gap: 4px;
}
.receipt-cols article + article {
  border-left: 1px solid var(--line);
}
.receipt-cols h3 {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.receipt-cols pre {
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--r-sm);
  padding: 10px;
  margin-top: 8px;
  overflow-x: auto;
  white-space: pre;
  word-break: normal;
  font-size: 0.75rem;
}
.receipt-cols .big {
  font-size: 2rem;
}
@media (max-width: 860px) {
  .receipt-cols {
    grid-template-columns: 1fr;
  }
  .receipt-cols article + article {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

/* ------- floating surfaces: toast, dialog ------- */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  max-width: min(420px, calc(100vw - 32px));
}
.toast .notice {
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
  padding: 14px 16px;
}
.toast .notice.ok {
  box-shadow:
    inset 3px 0 0 var(--ok-fg),
    var(--shadow-pop);
}
.toast .notice.warn {
  box-shadow:
    inset 3px 0 0 var(--warn-fg),
    var(--shadow-pop);
}
.toast .notice.bad {
  box-shadow:
    inset 3px 0 0 var(--bad-fg),
    var(--shadow-pop);
}
.scrim {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.2);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}
.sheet {
  position: relative;
  width: min(28rem, 100%);
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow:
    var(--shadow-pop),
    0 24px 48px -12px rgb(0 0 0 / 0.18);
  display: grid;
  gap: 16px;
  will-change: transform, opacity;
}
.sheet h2 {
  font-size: 1.125rem;
}
.sheet-body {
  color: var(--muted);
}
.sheet-body p {
  margin: 0 0 8px;
}

/* ------- motion: transform and opacity only ------- */
@media (prefers-reduced-motion: no-preference) {
  .ln > span {
    animation: rise 900ms var(--ease) both;
  }
  .ln:nth-child(2) > span {
    animation-delay: 100ms;
  }
  .eyebrow,
  .l-lead,
  .l-actions,
  .l-note,
  .l-example {
    animation: fade 700ms var(--ease) 350ms both;
  }
  .eyebrow {
    animation-delay: 0ms;
  }
  .l-example {
    animation-delay: 550ms;
  }
  .js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition:
      opacity 600ms var(--ease),
      transform 600ms var(--ease);
  }
  .js .reveal.in {
    opacity: 1;
    transform: none;
  }
  .badge.fresh {
    animation: thunk 280ms var(--ease);
  }
  @keyframes rise {
    from {
      transform: translateY(105%);
    }
    to {
      transform: none;
    }
  }
  @keyframes fade {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes thunk {
    from {
      transform: scale(1.2);
      opacity: 0;
    }
    to {
      transform: none;
      opacity: 1;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .tip,
  .btn,
  .pick {
    transition: opacity 120ms linear;
    transform: none !important;
  }
  .btn[aria-busy="true"]::before {
    animation-duration: 2s;
  }
  .boot-bar::after,
  .sk-line {
    animation: none;
  }
  .boot-bar::after {
    width: 100%;
    opacity: 0.25;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .l-nav,
  .c-head {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (prefers-contrast: more) {
  .panel,
  .pick,
  .btn,
  .tip,
  .sheet,
  .notice,
  .alert,
  .onboard-card,
  .tour {
    box-shadow: 0 0 0 1px var(--ink);
  }
  .dim,
  .purpose,
  .l-lead {
    color: var(--ink);
  }
  .badge,
  .chip {
    box-shadow: inset 0 0 0 1px currentColor;
  }
}

/* ------- agent chat ------- */
.agent-split {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  margin-top: 0;
}
.panel.chat {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.panel.chat > * + * {
  margin-top: 0;
}
.chat-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.chat-head p {
  margin: 4px 0 0;
}
.chat-head .chip,
.chat-head .btn {
  flex: none;
}
.chip.acc {
  color: var(--info-fg);
  background: var(--info-bg);
  box-shadow: none;
}
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  min-height: 320px;
  max-height: min(62vh, 640px);
  overflow-y: auto;
  background: var(--bg-subtle);
}
.chat-log > .empty {
  margin: auto 0;
  background: transparent;
}
.msg {
  display: flex;
  gap: 10px;
  max-width: 100%;
}
/* Only messages that just arrived animate; a redraw never replays the whole log. */
.msg.fresh {
  animation: msg-in 220ms var(--ease) both;
}
.msg p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.user {
  align-self: flex-end;
  max-width: 82%;
}
.msg.user p {
  background: var(--primary);
  color: var(--primary-ink);
  padding: 9px 14px;
  border-radius: 16px 16px 4px 16px;
}
.msg.agent {
  align-self: stretch;
}
.msg.agent .msg-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
}
.msg.agent.failed .msg-body > p {
  color: var(--bad-fg);
}
.avatar {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background:
    radial-gradient(circle at 30% 30%, #fff 0 18%, transparent 19%),
    conic-gradient(from 200deg, #0070f3, #7928ca, #ff0080, #0070f3);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06);
}
@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
.typing {
  display: inline-flex;
  gap: 4px;
  padding: 10px 0;
}
.typing i {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--faint);
  animation: typing 1s infinite ease-in-out;
}
.typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typing {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
details.tool {
  background: var(--bg);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}
details.tool > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  font-size: var(--small);
  min-width: 0;
}
details.tool > summary::-webkit-details-marker {
  display: none;
}
details.tool > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(-45deg);
  transition: transform 160ms var(--ease);
  flex: none;
}
details.tool[open] > summary::after {
  transform: rotate(45deg);
}
.tool-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--line-strong);
}
.tool.allow .tool-dot {
  background: var(--ok-fg);
}
.tool.approve .tool-dot {
  background: #f5a623;
}
.tool.deny .tool-dot {
  background: var(--bad-fg);
}
.tool-name {
  font-weight: 500;
  color: var(--ink);
}
.tool-args {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.tool-detail,
.tool-cta {
  padding: 0 12px 8px 28px;
  margin: 0;
  color: var(--muted);
  font-size: var(--small);
}
.tool-cta {
  align-items: center;
}
.wire {
  border-top: 1px solid var(--line);
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wire-x {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wire-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--small);
}
.wire pre {
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  max-height: 260px;
  overflow: auto;
  font-size: 0.75rem;
  line-height: 1.55;
}
.wire pre.res {
  background: #fcfcfc;
}
.suggest {
  display: flex;
  gap: 8px;
  padding: 12px 24px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.suggest:empty {
  display: none;
}
.suggestion {
  flex: none;
  max-width: 280px;
  text-align: left;
  font: inherit;
  font-size: var(--small);
  color: var(--ink);
  background: var(--bg);
  border: 0;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 8px 12px;
  line-height: 1.4;
  transition:
    box-shadow 160ms var(--ease),
    transform 160ms var(--ease);
}
.suggestion:hover {
  box-shadow: var(--shadow-pop);
  transform: translateY(-1px);
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 12px 24px 20px;
  padding: 6px 6px 6px 14px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  background: var(--bg);
  transition: box-shadow 160ms var(--ease);
}
.composer:focus-within {
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 0 4px rgb(0 112 243 / 0.12);
}
.chat-input {
  flex: 1;
  border: 0;
  outline: 0;
  resize: none;
  font: inherit;
  color: var(--ink);
  background: transparent;
  padding: 7px 0;
  min-height: 22px;
  max-height: 160px;
}
.chat-input:focus-visible {
  box-shadow: none;
}
.path {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}
.path b {
  color: var(--ink);
  font-weight: 500;
}
@media (max-width: 1000px) {
  .agent-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .chat-head,
  .chat-log {
    padding-left: 16px;
    padding-right: 16px;
  }
  .suggest {
    padding: 12px 16px 0;
  }
  .composer {
    margin: 12px 16px 16px;
  }
  .msg.user {
    max-width: 92%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .msg,
  .typing i {
    animation: none;
  }
}

/* ------- live work: agent timeline, boot caption, request dock ------- */
.boot-caption {
  color: var(--muted);
  font-size: var(--small);
}
.working {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: var(--small);
}
.working .typing {
  padding: 0;
}
.working .beat-ms {
  margin-left: auto;
}
.beats {
  list-style: none;
  margin: 0;
  padding: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--small);
}
.beat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 10px 5px 22px;
  border-radius: var(--r-sm);
}
.beats.live .beat.running {
  animation: msg-in 200ms var(--ease) both;
}
.beat::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.beat:first-child::before {
  top: 50%;
}
.beat:last-child::before {
  bottom: 50%;
}
.beat-dot {
  position: absolute;
  left: 4px;
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: var(--line-strong);
  box-shadow: 0 0 0 2px var(--bg);
}
.beat.model .beat-dot {
  background: #7928ca;
}
.beat.tool .beat-dot {
  background: var(--accent);
}
.beat.tool.allow .beat-dot {
  background: var(--ok-fg);
}
.beat.tool.approve .beat-dot {
  background: #f5a623;
}
.beat.tool.deny .beat-dot {
  background: var(--bad-fg);
}
.beat.running {
  background: var(--bg-subtle);
}
.beat.running .beat-dot {
  animation: beat-pulse 1s ease-in-out infinite;
}
@keyframes beat-pulse {
  50% {
    box-shadow:
      0 0 0 2px var(--bg),
      0 0 0 5px rgb(0 112 243 / 0.18);
  }
}
.beat-label {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.beat-detail {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.beat-ms {
  color: var(--faint);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  flex: none;
}
details.under > summary {
  cursor: pointer;
  color: var(--faint);
  font-size: 0.75rem;
  list-style: none;
  width: fit-content;
}
details.under > summary::-webkit-details-marker {
  display: none;
}
details.under > summary:hover {
  color: var(--muted);
}
details.under[open] > summary {
  color: var(--muted);
}

/* The request log lives in the header: a quiet toggle with its panel dropping below it. */
.act {
  position: relative;
}
.act-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
}
.act-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--muted);
  font: 500 var(--small) / 1 var(--sans);
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}
.act-toggle:hover,
.act-toggle[aria-expanded="true"] {
  background: var(--surface);
  color: var(--ink);
}
.act-toggle:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.act-pulse {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: var(--line-strong);
}
.act.busy .act-pulse {
  background: var(--accent);
  animation: beat-pulse 1s ease-in-out infinite;
}
.act-count {
  color: var(--muted);
  font-size: 0.75rem;
}
.act-count:empty {
  display: none;
}
.act-panel {
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: min(60vh, 520px);
  overflow: auto;
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
}
.act-head {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-size: var(--small);
}
.act-head .dim {
  font-size: 0.75rem;
}
.act-list {
  list-style: none;
  margin: 0;
  padding: 6px;
}
.act-row {
  padding: 7px 8px;
  border-radius: var(--r-sm);
}
.act-row + .act-row {
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.act-row.running {
  background: var(--bg-subtle);
}
.act-main {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--small);
}
.act-label {
  font-weight: 500;
}
.act-row.bad .act-label {
  color: var(--bad-fg);
}
.act-ms {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.act-sub {
  margin-top: 2px;
  color: var(--faint);
  font-size: 0.6875rem;
  overflow-wrap: anywhere;
}
.act-empty {
  padding: 10px 8px;
  font-size: var(--small);
}
@media (prefers-reduced-motion: reduce) {
  .beat {
    animation: none;
  }
  .beat.running .beat-dot,
  .act.busy .act-pulse {
    animation: none;
  }
}
.tool-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-wrap > .tool-cta {
  display: flex;
  flex-wrap: wrap;
  padding: 0 0 0 2px;
}
@media (max-width: 720px) {
  /* Each agent turn carries its own timeline; the header has no room for the request log. */
  .act {
    display: none;
  }
}
/* Connect your agent: copyable snippets that read as one quiet block each. */
.connect-snippet {
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 8px 10px 10px;
}
.connect-snippet > .row {
  margin-bottom: 6px;
  font-size: var(--small);
}
.connect-snippet pre {
  margin: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  max-height: 140px;
  overflow: auto;
  word-break: break-all;
  user-select: all;
}

/* ------- calm layout: one column of content, folded secondary detail ------- */

/* The guided tour: a pill in the header and a popover below it. It takes no height. */
.tour-wrap {
  position: relative;
  min-width: 0;
}
.tour-wrap[hidden] {
  display: none;
}
.tour-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  max-width: 280px;
  padding: 0 12px 0 10px;
  border: 0;
  border-radius: 9999px;
  background: var(--accent-tint);
  color: var(--info-fg);
  font: 500 var(--small) / 1 var(--sans);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 150ms ease;
}
.tour-pill:hover,
.tour-pill[aria-expanded="true"] {
  background: #dcecff;
}
.tour-pill:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.pill-meter {
  flex: none;
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: rgb(0 112 243 / 0.2);
  overflow: hidden;
}
.pill-meter i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tour {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100svh - var(--head-h) - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
}
.tour[hidden] {
  display: none;
}
.tour-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "text close" "cta cta";
  align-items: start;
  gap: 10px 8px;
  padding: 14px 12px 14px 16px;
}
.tour-meter,
.tour-all {
  display: none;
}
.tour-text {
  grid-area: text;
  margin: 0;
  display: grid;
  gap: 2px;
  font-size: var(--body);
}
.tour-count {
  color: var(--muted);
  font-size: var(--small);
  font-variant-numeric: tabular-nums;
}
.tour-text b {
  font-weight: 600;
}
.tour-do {
  color: var(--muted);
}
.tour-close {
  grid-area: close;
}
.tour-line > .btn.primary {
  grid-area: cta;
  justify-self: start;
}
.tour .steps {
  border-top: 1px solid var(--line);
  padding: 8px;
}
.tour .steps[hidden] {
  display: none;
}
.tour .step-body {
  padding: 0 8px 10px 36px;
}
.tour .step-body p {
  margin: 0;
}

/* The demo disclosure: an info mark beside the wordmark, its text on hover, focus or tap. */
.about {
  position: relative;
  display: inline-flex;
}
.about-btn {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  font:
    italic 600 0.75rem / 1 Georgia,
    serif;
  cursor: help;
}
.about-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.about-tip {
  position: absolute;
  top: calc(100% + 10px);
  left: -8px;
  z-index: 60;
  width: min(320px, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
  box-shadow: var(--shadow-pop);
  color: var(--muted);
  font-size: var(--small);
  font-weight: 400;
  line-height: 1.45;
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 120ms ease-out,
    visibility 0s linear 120ms;
}
.about-tip b {
  color: var(--ink);
  font-weight: 500;
}
.about:hover .about-tip,
.about:focus-within .about-tip,
.about.open .about-tip {
  visibility: visible;
  opacity: 1;
  transition: opacity 120ms ease-out;
}

/* Tabs sit in the header, so they take no height of their own. */
.c-head .tabs {
  align-self: stretch;
  align-items: center;
  margin: 0 0 0 12px;
  border-bottom: 0;
  min-width: 0;
}
.c-head .tabs button {
  margin: 0;
  padding: 6px 10px;
}
.c-head .tabs .ind {
  bottom: 0;
}

/* A tab's title row: noun, one sentence, actions. No card around it. */
.page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 32px;
  margin: 0 0 16px;
}
.page-head-text {
  flex: 1;
  min-width: 0;
}
.page-head h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-head p {
  margin: 0;
  color: var(--muted);
  max-width: 72ch;
}
.page-head + .split {
  margin-top: 0;
}
.stack-lg > .page-head + * {
  margin-top: 0;
}

/* Folded panels: one line until opened. */
details.fold {
  padding: 0;
}
details.fold > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  list-style: none;
  cursor: pointer;
  color: var(--ink);
  border-radius: var(--r-lg);
}
details.fold > summary::-webkit-details-marker {
  display: none;
}
details.fold > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  flex: none;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(-45deg);
  transition: transform 160ms var(--ease);
}
details.fold[open] > summary::after {
  transform: rotate(45deg);
}
details.fold > summary:hover {
  background: var(--bg-subtle);
}
.fold-title {
  font-weight: 600;
  white-space: nowrap;
}
.fold-hint {
  color: var(--muted);
  font-size: var(--small);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fold-body {
  padding: 0 20px 20px;
}
.fold-body > * + * {
  margin-top: 12px;
}
.panel > details.fold,
.split > div > details.fold + * {
  margin-top: 16px;
}

/* Inline folds inside a panel: a quiet text toggle, then the detail. */
details.inline-fold > summary {
  list-style: none;
  font-size: var(--small);
  color: var(--muted);
  font-weight: 500;
  padding: 4px 0;
}
details.inline-fold > summary::-webkit-details-marker {
  display: none;
}
details.inline-fold > summary::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 10px 2px 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 160ms var(--ease);
}
details.inline-fold[open] > summary::before {
  transform: rotate(45deg);
}
details.inline-fold > summary:hover {
  color: var(--ink);
}
details.inline-fold > :not(summary) {
  margin-top: 10px;
}
.folds {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  display: grid;
  gap: 4px;
}
.folds .assure {
  background: none;
  box-shadow: none;
  padding: 0;
}
.folds .assure > h3 {
  display: none;
}

/* Small shared pieces */
.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 9999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.panel-title {
  align-items: center;
  flex-wrap: nowrap;
}
.panel-title h2 {
  margin: 0;
}
.num {
  font-variant-numeric: tabular-nums;
}
.nowrap {
  white-space: nowrap;
}
.aside {
  margin: 16px 4px 0;
  font-size: var(--small);
}
.field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  box-shadow: none;
  accent-color: var(--ink);
  flex: none;
}

/* While a view or a pane loads its next state, the old one stays, dimmed and inert. */
.view[aria-busy="true"] > :not(.sk),
.review-split > [aria-busy="true"] {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 160ms ease 120ms;
}
/* Anchoring stays on the content, never on the bits that change under it. */
.chat-log,
.tour,
.toast {
  overflow-anchor: none;
}

/* Agent: the chat keeps one height whatever it holds, so the page never grows under you. */
.agent-split {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 20px;
}
.agent-split > :last-child > * + * {
  margin-top: 16px;
}
.chat-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title reset" "sub reset";
  align-items: center;
  gap: 2px 12px;
  padding: 16px 20px 14px;
}
.chat-title {
  grid-area: title;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.chat-title h2 {
  margin: 0;
}
.chat-head > p {
  grid-area: sub;
  margin: 0;
}
.chat-head > .btn {
  grid-area: reset;
}
/* Wide screens: the split is sized to the window (agent.ts), the conversation is the one
   scroller, and wheel or touch scrolling inside it never chains to the page. */
.agent-split {
  align-items: stretch;
}
.agent-split > .panel.chat {
  min-height: 0;
}
.chat-log {
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 20px;
  overscroll-behavior: contain;
}
.agent-split > .side {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 1px;
  margin: -1px;
}
.suggest {
  flex-wrap: wrap;
  overflow: visible;
  padding: 12px 20px 0;
}
.suggestion {
  max-width: none;
  border-radius: 9999px;
  padding: 5px 12px;
  white-space: nowrap;
}
.suggestion:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
  box-shadow: var(--shadow-card);
}
.composer {
  margin: 12px 20px 16px;
}
/* `.panel.chat > * + *` zeroes margin-top and outranks `.composer`, which left the
   suggestion chips (and their focus ring) touching the box. Keep the gap. */
.panel.chat > .composer {
  margin-top: 12px;
}
.refunds .meter-row {
  display: grid;
  gap: 6px;
}
.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--small);
  color: var(--muted);
}
.meter-label .num {
  color: var(--ink);
}
.meter {
  height: 6px;
  border-radius: 3px;
  background: var(--surface);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: 3px;
}
.meter-row .dim {
  margin: 0;
  font-size: var(--small);
}
.oplist {
  list-style: none;
  margin: 12px -8px 0;
  padding: 0;
}
.oprow {
  width: 100%;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto 52px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  text-align: left;
  color: var(--ink);
  font-size: var(--small);
}
.oprow:hover {
  background: var(--bg-subtle);
}
.oprow + * {
  border-top: 0;
}
.oplist li + li {
  border-top: 1px solid var(--line);
}
.oprow > .num {
  font-weight: 500;
  text-align: right;
}
.op-who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.op-age {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Reviews and Audit: a narrow list beside the open item. */
.review-split {
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 20px;
}
.op-head {
  align-items: center;
}
.op-head .amount {
  margin: 0;
}
.decide .btn {
  min-width: 120px;
}

/* Policy: plain-language rules first; the CEL behind one toggle. */
.rules {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rules > li {
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 12px 0;
  margin: 0;
}
.rules > li + li {
  border-top: 1px solid var(--line);
}
.rules p {
  margin: 0;
}
.rule-meta {
  margin-top: 4px;
  font-size: var(--small);
  color: var(--muted);
}
.rules .when {
  display: none;
  margin-top: 8px;
}
.show-cel .rules .when {
  display: block;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.field-grid .field input {
  width: 100%;
}

@media (max-width: 1000px) {
  .agent-split,
  .review-split {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Narrow screens: the page is the one scroller; the composer stays on screen. */
  .panel.chat {
    overflow: visible;
  }
  .chat-log {
    flex: none;
    overflow: visible;
    min-height: 240px;
  }
  .composer {
    position: sticky;
    bottom: 0;
    margin: 12px 0 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    box-shadow: 0 -1px 0 var(--line);
    z-index: 5;
  }
}
@media (max-width: 720px) {
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .chat-head {
    padding: 14px 16px 12px;
  }
  .chat-head > p {
    display: none;
  }
  .suggest {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 16px 0;
  }
  .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .c-head {
    gap: 8px;
  }
  .c-head .btn.small {
    padding: 0 10px;
  }
}
@media (max-width: 520px) {
  .wordmark {
    font-size: 0;
  }
  .wide-only {
    display: none;
  }
  .c-head .narrow-only {
    display: inline;
  }
}
/* Badges that sit at a panel's right edge open their tip leftwards, inside the page. */
.op-head .tip,
.panel-title .spacer ~ * .tip,
.panel-title .spacer ~ .term .tip {
  left: auto;
  right: 0;
}
.op-head + .kv {
  margin-top: 12px;
}
@media (max-width: 720px) {
  .chat-title .chip {
    display: none;
  }
  .chat-title h2 {
    white-space: nowrap;
  }
  details.tool > summary .badge {
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
/* Header at narrower widths: drop what repeats elsewhere, then wrap the tabs to a second row. */
.pill-short,
.narrow-only {
  display: none;
}
@media (max-width: 1439px) {
  .c-head .who {
    display: none;
  }
}
@media (max-width: 1100px) {
  .c-head .act {
    display: none;
  }
}
@media (max-width: 1000px) {
  .c-head {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--head-h);
    padding: 8px 16px 0;
    row-gap: 2px;
  }
  .c-head .tabs {
    order: 10;
    /* Too wide to share the first row, so the tabs and the timer wrap to a second one. */
    flex: 1 1 62%;
    height: 40px;
    margin: 0 0 0 -8px;
    overflow-x: auto;
  }
  .c-head .ttl-slot {
    order: 11;
    align-self: center;
  }
  .pill-text {
    display: none;
  }
  .pill-short {
    display: inline;
  }
}
@media (max-width: 1000px) {
  /* The pill sits mid-header here, so the popover spans the screen below the header. */
  .tour {
    position: fixed;
    top: 96px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100svh - 108px);
  }
}
.l-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
