/*
 * Upper OS platform design system (docs/platform/designsystem.md).
 *
 * Tokens are those of the approved design foundations of the public website
 * (src/styles/global.css): warm porcelain surfaces, ink, the indigo signal,
 * the action lifecycle vocabulary, Plus Jakarta Sans for display and Inter
 * for text, radii, shadows and motion. The website itself is a separate
 * product and stays unchanged; nothing here is shared at runtime.
 *
 * Layers: tokens · base · shell · typography · components · pages · utilities.
 * No inline styles anywhere (strict CSP): widths of meters are classes.
 */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Plus Jakarta Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/assets/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2-variations');
}

/* ================================================================= tokens */
:root {
  --font-sans: 'Inter Variable', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans Variable', ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;

  --color-canvas: #f7f7f4;
  --color-sunken: #efefea;
  --color-surface: #ffffff;
  --color-tint: #fbfbf9;
  --color-ink: #0d1424;
  --color-ink-body: #353c4c;
  --color-ink-muted: #5a6272;
  --color-ink-faint: #69707e;
  --color-line: #e4e4de;
  --color-line-strong: #cfcfc7;

  --color-stage: #0a0f1c;
  --color-stage-raised: #141b2c;
  --color-stage-line: #232b3f;
  --color-stage-ink: #e9ebf1;
  --color-stage-muted: #9aa1b2;

  --color-brand: #4338ca;
  --color-brand-hover: #3730a3;
  --color-brand-active: #312e81;
  --color-brand-wash: #eef0ff;
  --color-brand-line: #c7cbfa;
  --color-brand-soft: #a5b4fc;

  --color-proposed-bg: #f4f4f1;
  --color-proposed-fg: #4b5262;
  --color-proposed-line: #dcdcd5;
  --color-approved-bg: #eef0ff;
  --color-approved-fg: #3730a3;
  --color-approved-line: #c7cbfa;
  --color-executing-bg: #effaf3;
  --color-executing-fg: #166534;
  --color-executing-line: #bbf7d0;
  --color-verified-bg: #047857;
  --color-verified-fg: #ffffff;
  --color-attention-bg: #fff8eb;
  --color-attention-fg: #8a3c0a;
  --color-attention-line: #f8d99a;
  --color-positive: #047857;
  --color-danger: #b42318;
  --color-danger-fg: #8a1c12;
  --color-danger-bg: #fdf2f1;
  --color-danger-line: #f4c7c3;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-2xl: 28px;

  --ease-out-soft: cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration-fast: 160ms;
  --duration-base: 240ms;

  --shadow-float:
    0 1px 0 rgb(13 20 36 / 0.03), 0 24px 60px -24px rgb(13 20 36 / 0.18),
    0 8px 20px -12px rgb(13 20 36 / 0.08);
  --shadow-soft: 0 1px 0 rgb(13 20 36 / 0.03), 0 10px 30px -18px rgb(13 20 36 / 0.16);
  --shadow-pop: 0 18px 40px -16px rgb(13 20 36 / 0.22), 0 0 0 1px rgb(13 20 36 / 0.06);

  --sidebar-width: 17rem;
  --topbar-height: 4rem;
  --gutter: clamp(1rem, 0.4rem + 2.2vw, 2.5rem);
}

/* ================================================================= base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--color-canvas);
  color: var(--color-ink-body);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,
h2,
h3,
h4 {
  color: var(--color-ink);
  font-family: var(--font-display);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
h1 {
  font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 650;
  margin: 0;
}
h2 {
  font-size: 1.1875rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 620;
  margin: 2rem 0 0.85rem;
}
h3 {
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 620;
  margin: 1.25rem 0 0.5rem;
}
p {
  text-wrap: pretty;
  margin: 0 0 0.75rem;
}
a {
  color: var(--color-brand);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--color-brand-hover);
}
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}
::selection {
  background: var(--color-brand-wash);
  color: var(--color-brand-active);
}
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--color-ink);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  z-index: 100;
}
.skip:focus {
  top: 1rem;
  color: #fff;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.icon {
  flex-shrink: 0;
  vertical-align: middle;
}

/* ================================================================= shell */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
.sidebar {
  display: none;
}
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--topbar-height);
  padding: 0.5rem var(--gutter);
  background: rgb(247 247 244 / 0.88);
  backdrop-filter: blur(12px) saturate(1.5);
  border-bottom: 1px solid var(--color-line);
}
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}
.topbar-brand:hover {
  color: var(--color-ink);
}
.topbar-spacer {
  flex: 1;
}
.content {
  flex: 1;
  width: 100%;
  max-width: 92rem;
  padding: 1.75rem var(--gutter) 3rem;
}
.content-narrow {
  max-width: 52rem;
}
.footer {
  padding: 1.5rem var(--gutter) 2rem;
  color: var(--color-ink-faint);
  font-size: 0.8125rem;
  border-top: 1px solid var(--color-line);
}
.footer p {
  margin: 0;
}

/* Sidebar navigation (desktop) and drawer (tablet, mobile) */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 1.25rem 1rem;
  color: var(--color-ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}
.nav-brand:hover {
  color: var(--color-ink);
}
.nav-workspace {
  margin: 0 0.85rem 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.nav-workspace-label {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-ink-muted);
}
.nav-workspace-name {
  display: block;
  font-weight: 600;
  color: var(--color-ink);
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.nav-workspace-sub {
  display: block;
  color: var(--color-ink-muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
.nav-group {
  margin: 0.25rem 0 0.75rem;
}
.nav-group-label {
  margin: 0 0 0.25rem;
  padding: 0 1.5rem;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-ink-muted);
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0 0.75rem;
  display: grid;
  gap: 2px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--color-ink-body);
  text-decoration: none;
  font-weight: 500;
  transition:
    background-color var(--duration-fast) var(--ease-out-soft),
    color var(--duration-fast) var(--ease-out-soft);
}
.nav-link .icon {
  color: var(--color-ink-muted);
}
.nav-link:hover {
  background: var(--color-sunken);
  color: var(--color-ink);
}
.nav-link[aria-current='page'] {
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: var(--shadow-soft);
  font-weight: 600;
}
.nav-link[aria-current='page'] .icon {
  color: var(--color-brand);
}
.nav-count {
  margin-left: auto;
  min-width: 1.4rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--color-ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.nav-count-danger {
  background: var(--color-danger);
}
.nav-later {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--color-ink-faint);
  font-weight: 500;
}

.nav-drawer {
  position: relative;
}
.nav-drawer > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-ink);
  font-weight: 600;
  cursor: pointer;
}
.nav-drawer > summary::-webkit-details-marker {
  display: none;
}
.nav-drawer[open] > summary {
  position: relative;
  z-index: 61;
}
.nav-drawer-panel {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: min(21rem, 88vw);
  overflow-y: auto;
  padding: 4.25rem 0 1.5rem;
  background: var(--color-canvas);
  border-right: 1px solid var(--color-line);
  box-shadow: 30px 0 60px -30px rgb(13 20 36 / 0.35);
}
.nav-drawer[open]::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 59;
  background: rgb(10 15 28 / 0.35);
}

@media (min-width: 70rem) {
  .shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }
  .sidebar {
    display: block;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--color-line);
    background: var(--color-tint);
    padding-bottom: 1.5rem;
  }
  .nav-drawer,
  .topbar-brand {
    display: none;
  }
}

/* Top bar controls: workspace switcher, language, user menu */
.menu {
  position: relative;
}
.menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  max-width: 22rem;
  padding: 0 0.75rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-ink);
  font-weight: 500;
  cursor: pointer;
}
.menu > summary::-webkit-details-marker {
  display: none;
}
.menu > summary:hover {
  border-color: var(--color-line-strong);
}
.menu-summary-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
}
@media (max-width: 64rem) {
  .hide-medium {
    display: none !important;
  }
  .menu-summary-text {
    max-width: 11rem;
  }
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 50;
  min-width: 16rem;
  max-width: min(24rem, 92vw);
  padding: 0.4rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-pop);
}
.menu-panel-left {
  left: 0;
  right: auto;
}
.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.menu-item,
.menu-panel form button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-ink-body);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-item:hover,
.menu-panel form button:hover {
  background: var(--color-sunken);
  color: var(--color-ink);
}
.menu-item[aria-current='true'] {
  font-weight: 600;
  color: var(--color-ink);
}
.menu-item-sub {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-ink-muted);
}
.menu-heading {
  margin: 0.3rem 0.65rem 0.2rem;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-ink-muted);
}
.menu-separator {
  height: 1px;
  margin: 0.35rem 0.25rem;
  background: var(--color-line);
}
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.lang-switch a,
.lang-switch span {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0 0.55rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-ink-muted);
}
.lang-switch span {
  background: var(--color-ink);
  color: #fff;
}
.lang-switch a:hover {
  color: var(--color-ink);
  background: var(--color-sunken);
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--color-brand-wash);
  color: var(--color-brand-active);
  font-size: 0.75rem;
  font-weight: 700;
}
@media (max-width: 40rem) {
  .hide-small {
    display: none !important;
  }
  .topbar {
    gap: 0.4rem;
    padding-inline: 0.75rem;
  }
  .menu > summary,
  .nav-drawer > summary {
    padding: 0 0.55rem;
    gap: 0.3rem;
  }
}
@media (min-width: 40.0625rem) {
  .show-small.sr-only {
    display: none;
  }
}

/* ================================================================= typography helpers */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-size: 0.6875rem;
  line-height: 1rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}
.eyebrow-index {
  font-family: var(--font-mono);
  letter-spacing: 0;
  color: var(--color-ink-faint);
}
.lead {
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.55;
  color: var(--color-ink-body);
  max-width: 48rem;
}
.muted,
.hint {
  color: var(--color-ink-muted);
}
.hint {
  font-size: 0.8125rem;
  margin: 0.15rem 0 0.4rem;
}
.amount,
.tabular {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ================================================================= page head */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.75rem;
}
.page-head-text {
  min-width: 0;
  flex: 1 1 28rem;
}
.page-head .lead {
  margin: 0.65rem 0 0;
}
.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.85rem;
  color: var(--color-ink-muted);
  font-size: 0.875rem;
}
.page-meta .icon {
  color: var(--color-ink-faint);
}
.page-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}
.back-link .icon {
  transform: rotate(180deg);
}

/* ================================================================= buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-md);
  background: var(--color-ink);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.08) inset;
  transition:
    background-color var(--duration-fast) var(--ease-out-soft),
    border-color var(--duration-fast) var(--ease-out-soft),
    color var(--duration-fast) var(--ease-out-soft);
}
.button:hover {
  background: var(--color-brand-hover);
  border-color: var(--color-brand-hover);
  color: #fff;
}
.button:active {
  background: var(--color-brand-active);
}
.button .icon {
  transition: transform var(--duration-base) var(--ease-out-soft);
}
.button:hover .icon {
  transform: translateX(2px);
}
.button-secondary {
  background: var(--color-surface);
  color: var(--color-ink);
  border-color: var(--color-line-strong);
  box-shadow: none;
}
.button-secondary:hover {
  background: var(--color-tint);
  border-color: rgb(13 20 36 / 0.4);
  color: var(--color-ink);
}
.button-quiet {
  background: transparent;
  color: var(--color-ink);
  border-color: transparent;
  box-shadow: none;
  padding: 0 0.7rem;
}
.button-quiet:hover {
  background: var(--color-sunken);
  border-color: transparent;
  color: var(--color-ink);
}
.button-danger {
  background: var(--color-surface);
  color: var(--color-danger-fg);
  border-color: var(--color-danger-line);
  box-shadow: none;
}
.button-danger:hover {
  background: var(--color-danger-bg);
  color: var(--color-danger-fg);
  border-color: var(--color-danger);
}
.button-stop {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}
.button-stop:hover {
  background: var(--color-danger-fg);
  border-color: var(--color-danger-fg);
}
.button-small {
  min-height: 2rem;
  padding: 0 0.7rem;
  font-size: 0.8125rem;
}
.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ================================================================= chips (lifecycle vocabulary) */
.chip,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 22px;
  padding: 0 0.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-ink-muted);
  font-size: 0.6875rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}
.chip-proposed {
  background: var(--color-proposed-bg);
  color: var(--color-proposed-fg);
  border-color: var(--color-proposed-line);
}
.chip-approved {
  background: var(--color-approved-bg);
  color: var(--color-approved-fg);
  border-color: var(--color-approved-line);
}
.chip-executing,
.badge-active {
  background: var(--color-executing-bg);
  color: var(--color-executing-fg);
  border-color: var(--color-executing-line);
}
.chip-verified {
  background: var(--color-verified-bg);
  color: var(--color-verified-fg);
  border-color: transparent;
}
.chip-attention,
.badge-pending {
  background: var(--color-attention-bg);
  color: var(--color-attention-fg);
  border-color: var(--color-attention-line);
}
.chip-danger,
.badge-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger-fg);
  border-color: var(--color-danger-line);
}
.chip-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}
@media (prefers-reduced-motion: no-preference) {
  .chip-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: currentColor;
    animation: ping 2.4s var(--ease-out-soft) infinite;
  }
}
@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  80%,
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* ================================================================= panels */
.card,
.panel {
  position: relative;
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-soft);
}
.card {
  margin-bottom: 1rem;
}
/* Post go-live: the package chosen on the website, preselected in billing */
.card-highlight {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 1px var(--color-brand);
}
.card > h2:first-child,
.card > h3:first-child,
.panel > h2:first-child,
.panel > h3:first-child {
  margin-top: 0;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 620;
  letter-spacing: -0.01em;
  color: var(--color-ink);
}
.panel-title .icon {
  color: var(--color-ink-muted);
}
.panel > .panel-title,
.card > .panel-title {
  margin-bottom: 0.85rem;
}
.panel > .form:last-child,
.card > .form:last-child,
.panel form > .actions:last-child {
  margin-bottom: 0;
}
.panel > .hint:first-of-type {
  margin-top: -0.4rem;
}
.panel-link {
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.panel-attention {
  border-color: var(--color-attention-line);
  box-shadow:
    0 0 0 3px rgb(248 217 154 / 0.25),
    var(--shadow-soft);
}
.panel-danger {
  border-color: var(--color-danger-line);
  background: var(--color-danger-bg);
}
.panel-stage {
  background:
    radial-gradient(120% 90% at 100% 0%, rgb(67 56 202 / 0.38), transparent 55%), var(--color-stage);
  border-color: var(--color-stage-line);
  color: var(--color-stage-ink);
  box-shadow: var(--shadow-float);
}
.panel-stage .panel-title,
.panel-stage h2,
.panel-stage h3,
.panel-stage strong {
  color: #fff;
}
.panel-stage .panel-title .icon,
.panel-stage .muted,
.panel-stage .hint,
.panel-stage .eyebrow {
  color: var(--color-stage-muted);
}
.panel-stage a {
  color: var(--color-brand-soft);
}
.panel-stage .kv dt {
  color: var(--color-stage-muted);
}
.panel-stage .kv dd {
  color: #fff;
}
.panel-stage .kv div {
  border-color: var(--color-stage-line);
}
.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

/* grids */
.grid {
  display: grid;
  gap: 1rem;
}
.grid-2 {
  /* At most two columns, one below 46rem. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(22rem, calc(50% - 0.5rem))), 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.stack {
  display: grid;
  gap: 1rem;
  align-content: start;
}
.section {
  margin-top: 1.75rem;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.85rem;
}
.section-head h2 {
  margin: 0;
}

/* key figures */
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}
.stat-link:hover {
  border-color: var(--color-line-strong);
  color: inherit;
}
.stat-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-ink-muted);
}
.stat-value {
  overflow-wrap: normal;
  word-break: keep-all;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 0.9vw, 2rem);
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}
.stat-sub {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-ink-muted);
}
.stat-attention {
  border-color: var(--color-attention-line);
  background: var(--color-attention-bg);
}
.stat-attention .stat-value,
.stat-attention .stat-label {
  color: var(--color-attention-fg);
}
.stat-danger {
  border-color: var(--color-danger-line);
  background: var(--color-danger-bg);
}
.stat-danger .stat-value,
.stat-danger .stat-label {
  color: var(--color-danger-fg);
}

/* meters */
.meter {
  height: 6px;
  margin: 0.55rem 0 0.35rem;
  border-radius: 999px;
  background: var(--color-sunken);
  overflow: hidden;
}
.panel-stage .meter {
  background: var(--color-stage-line);
}
.meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--color-brand);
}
.meter-attention {
  background: #d97706;
}
.meter-danger {
  background: var(--color-danger);
}

/* key/value rows */
.kv,
.meta {
  display: grid;
  gap: 0;
  margin: 0;
}
.kv div,
.meta div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-line);
}
.kv div:last-child,
.meta div:last-child {
  border-bottom: 0;
}
.kv dt,
.meta dt {
  color: var(--color-ink-muted);
}
.kv dd,
.meta dd {
  margin: 0;
  color: var(--color-ink);
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
  min-width: 0;
  max-width: 70%;
}
.kv-stacked div {
  flex-direction: column;
  align-items: flex-start;
}
.kv-stacked dd {
  text-align: left;
  max-width: none;
}

/* item lists */
.items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--color-line);
}
.item:first-child {
  padding-top: 0.2rem;
}
.item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.item-body {
  flex: 1;
  min-width: 0;
}
.item-title {
  display: block;
  margin: 0;
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
a.item-title:hover {
  color: var(--color-brand);
}
.item-sub {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-ink-muted);
  overflow-wrap: anywhere;
}
.item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  text-align: right;
  flex-shrink: 0;
}
.item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  background: var(--color-sunken);
  color: var(--color-ink-muted);
  flex-shrink: 0;
}
.item-icon-attention {
  background: var(--color-attention-bg);
  color: var(--color-attention-fg);
}
.item-icon-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger-fg);
}
.item-icon-brand {
  background: var(--color-brand-wash);
  color: var(--color-brand);
}
@media (max-width: 30rem) {
  .item {
    flex-wrap: wrap;
  }
  .item-side {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: flex-start;
    padding-left: 2.85rem;
  }
}

/* lifecycle stepper */
.lifecycle {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  font-size: 0.8125rem;
}
.lifecycle-step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.lifecycle-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid var(--color-line-strong);
  flex-shrink: 0;
}
.lifecycle-done .lifecycle-marker {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: #fff;
}
.lifecycle-current .lifecycle-marker {
  border: 2px solid var(--color-executing-fg);
}
.lifecycle-current .lifecycle-marker::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-executing-fg);
}
.lifecycle-current .lifecycle-label {
  font-weight: 600;
  color: var(--color-executing-fg);
}
.lifecycle-failed .lifecycle-marker {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}
.lifecycle-next .lifecycle-label {
  color: var(--color-ink-muted);
}
.lifecycle-note {
  color: var(--color-ink-muted);
  font-weight: 400;
}

/* flow (goal → priority → action → result) */
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 48rem) {
  .flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 88rem) {
  .flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.flow-step {
  display: flex;
  flex-direction: column;
  min-height: 15rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  min-width: 0;
}
.flow-step.panel-stage {
  border-color: var(--color-stage-line);
  background:
    radial-gradient(120% 90% at 100% 0%, rgb(67 56 202 / 0.38), transparent 55%), var(--color-stage);
  color: var(--color-stage-ink);
}
.flow-step.panel-stage .eyebrow,
.flow-step.panel-stage .eyebrow-index {
  color: var(--color-stage-muted);
}
.flow-title {
  margin: 0.6rem 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.3;
  font-weight: 620;
  letter-spacing: -0.015em;
  color: var(--color-ink);
  overflow-wrap: anywhere;
}
.panel-stage .flow-title {
  color: #fff;
}
.flow-foot {
  margin-top: auto;
  padding-top: 1rem;
}

/* empty and "not yet available" states */
.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1.25rem;
  border: 1px dashed var(--color-line-strong);
  border-radius: var(--radius-lg);
  background: var(--color-tint);
}
.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  color: var(--color-ink-muted);
}
.empty-title {
  margin: 0;
  font-weight: 600;
  color: var(--color-ink);
}
.empty-text {
  margin: 0 0 0.35rem;
  color: var(--color-ink-muted);
  font-size: 0.875rem;
}
.unavailable {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--color-line-strong);
  border-radius: var(--radius-lg);
  background: repeating-linear-gradient(
    -45deg,
    var(--color-tint),
    var(--color-tint) 8px,
    #f4f4f0 8px,
    #f4f4f0 16px
  );
}
.panel-stage .unavailable {
  border-color: var(--color-stage-line);
  background: rgb(255 255 255 / 0.03);
}
.unavailable-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-ink-muted);
}
.panel-stage .unavailable-head,
.panel-stage .unavailable-text {
  color: var(--color-stage-muted);
}
.unavailable-module {
  padding: 0.05rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  color: var(--color-ink-body);
}
.panel-stage .unavailable-module {
  background: var(--color-stage-raised);
  border-color: var(--color-stage-line);
  color: var(--color-stage-ink);
}
.unavailable-title {
  margin: 0;
  font-weight: 600;
  color: var(--color-ink);
}
.panel-stage .unavailable-title {
  color: #fff;
}
.unavailable-text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-ink-muted);
}

/* notices, alerts, stop banner */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  margin: 0 0 1rem;
  border: 1px solid var(--color-attention-line);
  border-radius: var(--radius-md);
  background: var(--color-attention-bg);
  color: var(--color-attention-fg);
}
.notice-success {
  border-color: var(--color-executing-line);
  background: var(--color-executing-bg);
  color: var(--color-executing-fg);
}
.notice-info {
  border-color: var(--color-brand-line);
  background: var(--color-brand-wash);
  color: var(--color-brand-active);
}
.error-summary {
  padding: 1rem 1.25rem;
  border: 2px solid var(--color-danger);
  border-radius: var(--radius-md);
  background: var(--color-danger-bg);
  color: var(--color-danger-fg);
  margin-bottom: 1.5rem;
}
.error-summary ul {
  margin: 0.25rem 0 0;
}
.stop-banner {
  display: block;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-lg);
  background: var(--color-danger-bg);
  color: var(--color-danger-fg);
}
.stop-banner h2 {
  margin-top: 0;
  color: var(--color-danger-fg);
}
.stop-banner a {
  color: var(--color-danger-fg);
  font-weight: 600;
}

/* ================================================================= forms */
.form {
  display: grid;
  gap: 1rem;
  max-width: 38rem;
  margin: 0.75rem 0 1.5rem;
}
.form > .button,
.form > button {
  justify-self: start;
}
@media (max-width: 40rem) {
  .form > .button,
  .form > button {
    justify-self: stretch;
  }
}
.form-inline {
  max-width: none;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  align-items: end;
}
fieldset {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem 1.25rem;
  margin: 0;
  display: grid;
  gap: 1rem;
  background: var(--color-surface);
  min-width: 0;
}
legend {
  font-weight: 600;
  color: var(--color-ink);
  padding: 0 0.35rem;
}
.field {
  min-width: 0;
}
.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-ink);
}
.req {
  color: var(--color-danger);
}
input[type='text'],
input[type='email'],
input[type='number'],
input[type='password'],
input[type='url'],
input[type='date'],
input[type='month'],
textarea,
select {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
  transition:
    border-color var(--duration-fast) var(--ease-out-soft),
    box-shadow var(--duration-fast) var(--ease-out-soft);
}
input:hover,
textarea:hover,
select:hover {
  border-color: rgb(13 20 36 / 0.35);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgb(67 56 202 / 0.18);
}
textarea {
  min-height: 6rem;
  resize: vertical;
}
.field-invalid input,
.field-invalid textarea,
.field-invalid select {
  border-color: var(--color-danger);
}
.field-error {
  margin: 0.2rem 0;
  color: var(--color-danger-fg);
  font-size: 0.875rem;
}
.plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 400 !important;
}
.check input {
  /* WCAG 2.2 target size: 24 px (Kapitel 5 E2E, Fair Start decision form) */
  margin-top: 0.1rem;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  accent-color: var(--color-brand);
}
.checks {
  gap: 0.5rem;
}
.inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0.15rem 0.35rem 0.15rem 0;
}
.inline input[type='text'] {
  width: auto;
  min-width: 10rem;
}
.inline select {
  width: auto;
  max-width: 100%;
}
.section-head {
  flex-wrap: wrap;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.5rem 0;
}
details > summary {
  cursor: pointer;
}
.disclosure {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-line);
}
.disclosure > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--color-ink);
  list-style: none;
}
.disclosure > summary::-webkit-details-marker {
  display: none;
}
.disclosure > summary .icon {
  transition: transform var(--duration-base) var(--ease-out-soft);
}
.disclosure[open] > summary .icon {
  transform: rotate(180deg);
}

/* ================================================================= tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
}
.table-wrap .table {
  border: 0;
}
.table th,
.table td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--color-line);
  overflow-wrap: anywhere;
}
/* Tables of words (M11 disciplines): break at syllables, never inside a word. */
.table-words th,
.table-words td {
  overflow-wrap: normal;
  hyphens: auto;
}
.table-words tbody th {
  min-width: 10rem;
}
.table-words .cell-nowrap {
  white-space: nowrap;
}
.table tbody tr:last-child th,
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table thead th {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-ink-muted);
  background: var(--color-tint);
  white-space: nowrap;
}
.table tbody th {
  font-weight: 600;
  color: var(--color-ink);
}
.table a {
  font-weight: 600;
  text-decoration: none;
}
.table a:hover {
  text-decoration: underline;
}
@media (max-width: 40rem) {
  .table-wrap {
    border: 0;
    background: none;
    overflow: visible;
  }
  .table,
  .table tbody {
    display: block;
    background: none;
  }
  .table thead {
    display: none;
  }
  .table tr {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0.4rem 0;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
  }
  .table th,
  .table td {
    display: block;
    border: 0;
    padding: 0.35rem 1rem;
  }
  .table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--color-ink-muted);
  }
}

/* ================================================================= misc components */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rows li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-line);
  overflow-wrap: anywhere;
}
.rows li:last-child {
  border-bottom: 0;
}
.permissions {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}
.permissions li::before {
  display: inline-block;
  width: 1.4rem;
  font-weight: 700;
}
.permissions .allowed::before {
  content: '✓';
  color: var(--color-positive);
}
.permissions .denied {
  color: var(--color-ink-muted);
}
.permissions .denied::before {
  content: '–';
}
.notes {
  list-style: none;
  margin: 0;
  padding: 0;
}
.notes li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-line);
}
.notes time {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-ink-muted);
}
.audit td:first-child,
.audit td:nth-child(2),
.audit td:nth-child(4),
.audit td:nth-child(5) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.audit code.changes {
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
  color: var(--color-ink-muted);
}
.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.check-list > li {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.check-list .check-failed {
  border-color: var(--color-danger-line);
  background: var(--color-danger-bg);
}
.check-list ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}
.content-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-tint);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--color-line);
}
.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.85rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--color-ink-muted);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
}
.tabs a:hover {
  color: var(--color-ink);
}
.tabs a[aria-current='page'] {
  color: var(--color-ink);
  border-bottom-color: var(--color-ink);
}
.state,
.hero {
  max-width: 44rem;
  padding: 2rem 0;
}
.live-region {
  min-height: 1px;
}
.updated {
  font-size: 0.75rem;
  color: var(--color-ink-faint);
}
.panel-stage .updated {
  color: var(--color-stage-muted);
}

/* confirmation dialog (progressive enhancement, assets/app.js) */
dialog.confirm {
  max-width: min(28rem, 92vw);
  padding: 1.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  color: var(--color-ink-body);
  box-shadow: var(--shadow-pop);
}
dialog.confirm::backdrop {
  background: rgb(10 15 28 / 0.45);
}
dialog.confirm h2 {
  margin: 0 0 0.5rem;
}

/* sign-in, landing and state pages without a workspace */
.public {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.public .content {
  margin: 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================================================================= command center */
.cc-stats {
  margin-bottom: 1rem;
}
@media (max-width: 40rem) {
  .cc-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .cc-stats .stat {
    padding: 0.8rem 0.85rem;
  }
  .cc-stats .stat-sub {
    font-size: 0.75rem;
  }
  .cc-stats .stat-value {
    font-size: 1.3rem;
  }
}
.cc-main {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
/* One column: decisions, then execution and stop, notices, then activities. */
@media (max-width: 74.99rem) {
  .cc-main > .stack {
    display: contents;
  }
  .cc-decisions {
    order: 1;
  }
  .cc-execution {
    order: 2;
  }
  .cc-attention {
    order: 3;
  }
  .cc-activities {
    order: 4;
  }
}
@media (min-width: 40.0625rem) and (max-width: 74.99rem) {
  .cc-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 75rem) {
  .cc-main {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  }
}
.activity-groups {
  display: grid;
  gap: 1.25rem;
}
.activity-group .eyebrow {
  margin-bottom: 0.35rem;
}
.budget-rows {
  display: grid;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.budget-name {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  color: var(--color-ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.budget-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
}
.cc-data {
  margin-top: 0.85rem;
}
.flow-step .kv {
  margin-top: 0.6rem;
  font-size: 0.875rem;
}
a.flow-title {
  display: block;
  text-decoration: none;
}
a.flow-title:hover {
  color: var(--color-brand);
}

/* ================================================================= workspace cards */
.ws-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  height: 100%;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  color: var(--color-ink-body);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition:
    border-color var(--duration-fast) var(--ease-out-soft),
    box-shadow var(--duration-fast) var(--ease-out-soft);
}
.ws-card:hover {
  border-color: var(--color-line-strong);
  box-shadow: var(--shadow-float);
  color: var(--color-ink-body);
}
.ws-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.ws-card-name {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 620;
  letter-spacing: -0.015em;
  color: var(--color-ink);
  overflow-wrap: anywhere;
}
.ws-card-arrow {
  color: var(--color-ink-muted);
  transition: transform var(--duration-base) var(--ease-out-soft);
}
.ws-card:hover .ws-card-arrow {
  transform: translateX(3px);
  color: var(--color-ink);
}
.ws-card-sub {
  font-size: 0.875rem;
  color: var(--color-ink-muted);
  overflow-wrap: anywhere;
}
.ws-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--color-line);
  font-size: 0.8125rem;
}

/* ================================================================= detail pages */
.detail-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 75rem) {
  .detail-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
}
.check-list > li {
  position: relative;
  padding-left: 2.4rem;
}
.check-mark {
  position: absolute;
  left: 0.75rem;
  top: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--color-executing-bg);
  color: var(--color-executing-fg);
}
.check-list .check-open {
  border-color: var(--color-attention-line);
  background: var(--color-attention-bg);
}
.check-open .check-mark {
  background: var(--color-attention-fg);
  color: #fff;
}
.check-failed .check-mark {
  background: var(--color-danger);
  color: #fff;
}

/* ================================================================= meter widths (2 % steps; no inline styles) */
.w-0 {
  width: 0%;
}
.w-2 {
  width: 2%;
}
.w-4 {
  width: 4%;
}
.w-6 {
  width: 6%;
}
.w-8 {
  width: 8%;
}
.w-10 {
  width: 10%;
}
.w-12 {
  width: 12%;
}
.w-14 {
  width: 14%;
}
.w-16 {
  width: 16%;
}
.w-18 {
  width: 18%;
}
.w-20 {
  width: 20%;
}
.w-22 {
  width: 22%;
}
.w-24 {
  width: 24%;
}
.w-26 {
  width: 26%;
}
.w-28 {
  width: 28%;
}
.w-30 {
  width: 30%;
}
.w-32 {
  width: 32%;
}
.w-34 {
  width: 34%;
}
.w-36 {
  width: 36%;
}
.w-38 {
  width: 38%;
}
.w-40 {
  width: 40%;
}
.w-42 {
  width: 42%;
}
.w-44 {
  width: 44%;
}
.w-46 {
  width: 46%;
}
.w-48 {
  width: 48%;
}
.w-50 {
  width: 50%;
}
.w-52 {
  width: 52%;
}
.w-54 {
  width: 54%;
}
.w-56 {
  width: 56%;
}
.w-58 {
  width: 58%;
}
.w-60 {
  width: 60%;
}
.w-62 {
  width: 62%;
}
.w-64 {
  width: 64%;
}
.w-66 {
  width: 66%;
}
.w-68 {
  width: 68%;
}
.w-70 {
  width: 70%;
}
.w-72 {
  width: 72%;
}
.w-74 {
  width: 74%;
}
.w-76 {
  width: 76%;
}
.w-78 {
  width: 78%;
}
.w-80 {
  width: 80%;
}
.w-82 {
  width: 82%;
}
.w-84 {
  width: 84%;
}
.w-86 {
  width: 86%;
}
.w-88 {
  width: 88%;
}
.w-90 {
  width: 90%;
}
.w-92 {
  width: 92%;
}
.w-94 {
  width: 94%;
}
.w-96 {
  width: 96%;
}
.w-98 {
  width: 98%;
}
.w-100 {
  width: 100%;
}

/* Onboarding (M5): the form comes first on small screens; the steps beside it on large ones. */
.onboarding-grid > .onboarding-steps {
  order: 2;
}
@media (min-width: 75rem) {
  .onboarding-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  }
  .onboarding-grid > .onboarding-steps {
    order: 0;
  }
}

/* Integrations (M6): provider cards with what they read and their evidence. */
.connector-grid {
  list-style: none;
  margin: 0;
  padding: 0;
}
.connector-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0;
}
.connector-card > h3,
.connector-card > p {
  margin: 0;
}
.connector-card > .button,
.connector-card > .hint {
  margin-top: auto;
}
.connector-card > .button {
  align-self: flex-start;
}
.catalog-table th,
.catalog-table td {
  vertical-align: top;
}
.connector-card code,
.catalog-table code {
  overflow-wrap: anywhere;
}
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.link-list a {
  display: inline-block;
  min-height: 1.5rem;
  padding-block: 0.125rem;
}
.catalog > summary {
  cursor: pointer;
  display: inline-block;
  min-height: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--color-brand);
}

/* Marketing operators (M7): operator cards, proposals with evidence, the measure on adoption. */
.operator-grid,
.proposal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.operator-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0;
}
.operator-card > h3,
.operator-card > p {
  margin: 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
}
.proposal-list {
  display: grid;
  gap: 0.75rem;
}
.proposal {
  margin-bottom: 0;
}
.proposal > h3 {
  margin: 0.5rem 0 0.25rem;
}
.proposal details {
  margin: 0.5rem 0;
}
.proposal details > summary {
  cursor: pointer;
  display: inline-block;
  min-height: 1.5rem;
  font-weight: 600;
  color: var(--color-brand);
}
.measure-box {
  border-left: 3px solid var(--color-brand);
  padding: 0.25rem 0 0.25rem 0.75rem;
  margin: 0.5rem 0;
}
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.proposal code,
.operator-card code {
  overflow-wrap: anywhere;
}

/* Operator administration (M13): the badge stays visible on small screens,
   where the brand of the top bar is hidden. */
.admin-badge-small {
  display: none;
}
@media (max-width: 40rem) {
  .admin-badge-small {
    display: inline-flex;
  }
}
