/* ═══════════════════════════════════════════════════════════════════════════
   ConsultAlpha — theme shared with AssureAlpha
   Chrome (header, sidebar, sign-in) follows AssureAlpha's product shell; the
   workspace uses one slate neutral family, one coral
   accent, hairline-ring cards with slate-tinted shadows, and custom ease-out
   motion that falls back to opacity-only under prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Slate neutrals */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Gray neutrals (sign-in screen, as in AssureAlpha) */
  --gray-50: #f9fafb;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Brand accent — AssureAlpha's `primary` / `primary-dark` coral */
  --accent-soft: #fca5a5;
  --accent: #f87171;
  --accent-ink: #b91c1c;

  /* Product chrome */
  --purple-50: #faf5ff;
  --purple-200: #e9d5ff;
  --purple-300: #d8b4fe;
  --purple-600: #9333ea;
  --purple-800: #6b21a8;
  --pink-300: #f9a8d4;
  --blue-50: #eff6ff;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;

  /* Wordmark */
  --brand-navy: #0a5190;
  --brand-orange: #f04124;

  /* Lifecycle states */
  --state-busy-bg: #fffbeb;
  --state-busy: #b45309;
  --state-review-bg: #eff6ff;
  --state-review: #1d4ed8;
  --state-approved-bg: #ecfdf5;
  --state-approved: #047857;
  --state-failed-bg: rgba(252, 165, 165, 0.25);
  --state-failed: #b91c1c;

  --canvas: #f6f7f9;
  --font-body: 'Inter', system-ui, Avenir, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --ring: 0 0 0 1px rgba(15, 23, 42, 0.05);
  --shadow-card: var(--ring), 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -18px rgba(15, 23, 42, 0.22);
  --shadow-lift: var(--ring), 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 36px -20px rgba(15, 23, 42, 0.28);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --sidebar-width: 320px;
  --header-height: 80px;

  color-scheme: light;
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--gray-800);
  background: var(--gray-50);
  min-width: 320px;
  overflow: hidden;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

svg {
  flex: none;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Keyboard focus is an accessibility requirement, not a style choice. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ── Motion primitives ─────────────────────────────────────────────────────── */

/* Press feedback. 120ms: a click should feel mechanical, not animated. */
.dash-press {
  transition: transform 120ms var(--ease-out), background-color 150ms var(--ease-out),
    box-shadow 150ms var(--ease-out), color 150ms var(--ease-out), opacity 150ms var(--ease-out);
}

.dash-press:active:not(:disabled) {
  transform: scale(0.97);
}

/* Entrance: items rise into place in a short cascade. --i is set per item. */
.rise {
  animation: dash-rise 260ms var(--ease-out) both;
  animation-delay: calc(30ms + var(--i, 0) * 55ms);
}

@keyframes dash-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-enter {
  animation: dash-fade 160ms var(--ease-out) both;
}

@keyframes dash-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Skeletons match the shape of what they replace so nothing jumps on arrival. */
.skeleton {
  border-radius: var(--radius-sm);
  background-image: linear-gradient(90deg, #eef1f5 0%, var(--slate-200) 40%, #eef1f5 80%);
  background-size: 200% 100%;
  animation: dash-shimmer 1.1s linear infinite;
}

@keyframes dash-shimmer {
  to { background-position: -200% 0; }
}

.inline-spinner {
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 650ms linear infinite;
  flex: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Buttons & controls ────────────────────────────────────────────────────── */
.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  padding: 0.5rem 0.9rem;
  background: var(--slate-900);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--slate-800);
}

.btn-secondary {
  padding: 0.5rem 0.9rem;
  background: #fff;
  color: var(--slate-700);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
}

.btn-secondary:hover:not(:disabled) {
  color: var(--slate-900);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2);
}

.btn-ghost {
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: var(--slate-500);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--slate-800);
  background: rgba(15, 23, 42, 0.04);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.text-input,
.feedback-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 0.875rem;
  color: var(--slate-700);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
  transition: box-shadow 150ms var(--ease-out);
}

.text-input:hover,
.feedback-input:hover {
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2);
}

.text-input:focus,
.feedback-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.text-input::placeholder,
.feedback-input::placeholder {
  color: var(--slate-400);
}

.text-input[aria-invalid="true"] {
  box-shadow: 0 0 0 2px var(--state-failed);
}

.field-error {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--state-failed);
}

.feedback-input {
  resize: vertical;
  min-height: 6rem;
  line-height: 1.55;
}

.label-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.field-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-400);
}

.field-optional {
  margin-left: 0.35rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--slate-400);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Brand header — AssureAlpha's gradient bar with centred wordmark
   ═══════════════════════════════════════════════════════════════════════════ */
.brand-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-height);
  padding: 0 0.75rem;
  background: linear-gradient(to right, var(--purple-300), var(--purple-200), var(--pink-300));
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  flex: none;
  z-index: 5;
}

.brand-wordmark {
  display: block;
  height: 44px;
  width: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Boot & sign-in
   ═══════════════════════════════════════════════════════════════════════════ */
.boot-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 100vh;
  background: #f3f4f6;
  color: var(--gray-500);
}

.boot-spinner {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border-bottom: 2px solid var(--accent-soft);
  animation: spin 1s linear infinite;
}

.login-screen {
  height: 100vh;
  overflow-y: auto;
  background: #fff;
}

.login-wrap {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-panel {
  width: 100%;
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem;
}

.login-sso {
  text-align: center;
}

.login-title {
  margin-bottom: 2rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-900);
}

.btn-sso {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--blue-200);
  color: var(--blue-800);
  font-weight: 500;
  cursor: pointer;
}

.btn-sso:hover:not(:disabled) {
  background: var(--blue-300);
}

.btn-sso:disabled,
.btn-signin:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-divider {
  position: relative;
  display: flex;
  justify-content: center;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.login-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid var(--gray-300);
}

.login-divider span {
  position: relative;
  padding: 0 0.5rem;
  background: #fff;
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
}

.login-field label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.login-input-wrap {
  position: relative;
}

.login-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--gray-900);
  transition: box-shadow 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.login-input.has-toggle {
  padding-right: 2.5rem;
}

.login-input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--blue-500);
}

.login-input.invalid {
  border-color: var(--blue-500);
}

.password-toggle {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  border: none;
  background: none;
  color: var(--gray-400);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--gray-500);
}

.login-field-error {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--blue-600);
}

.login-error {
  padding: 0.75rem;
  border-radius: 6px;
  background: var(--blue-50);
  font-size: 0.875rem;
  color: var(--blue-800);
}

.login-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-signin,
.btn-reset {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
}

.btn-signin {
  background: var(--gray-800);
  color: #fff;
}

.btn-signin:hover:not(:disabled) {
  background: var(--gray-900);
}

.btn-reset {
  background: var(--gray-200);
  color: var(--gray-800);
}

.btn-reset:hover {
  background: var(--gray-300);
}

/* ═══════════════════════════════════════════════════════════════════════════
   App shell — fixed sidebar + scrolling main column
   ═══════════════════════════════════════════════════════════════════════════ */
.app-shell {
  height: 100vh;
  background: var(--gray-50);
}

.project-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--gray-200);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 4.25rem 1rem 1rem;
}

.sidebar-footer {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid var(--gray-200);
  background: #fff;
}

.sidebar-rule {
  border: none;
  border-top: 1px solid var(--gray-200);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--gray-700);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.nav-item:hover,
.nav-item.active {
  background: var(--purple-50);
  color: var(--purple-600);
  border-color: var(--purple-300);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-head-icon {
  color: var(--accent-soft);
}

.sidebar-title {
  flex: 1;
  font-weight: 600;
  color: var(--gray-800);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--slate-500);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
}

.icon-btn:hover {
  color: var(--purple-600);
  box-shadow: 0 0 0 1px var(--purple-300);
}

.sidebar-empty {
  padding: 0.25rem 0.5rem;
  font-size: 0.83rem;
  color: var(--slate-400);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-200), var(--pink-300));
  color: var(--purple-800);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  font-size: 0.75rem;
  color: var(--slate-500);
  text-transform: capitalize;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--blue-200);
  color: var(--blue-800);
  font-weight: 500;
  cursor: pointer;
}

.btn-logout:hover {
  background: var(--blue-300);
}

/* Round toggle that rides the sidebar's edge, as in AssureAlpha. */
.sidebar-toggle {
  position: fixed;
  top: 12px;
  left: calc(var(--sidebar-width) - 12px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--gray-300);
  border-radius: 50%;
  background: #fff;
  color: var(--purple-600);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: left 300ms cubic-bezier(0.4, 0, 0.2, 1), background-color 150ms, border-color 150ms;
}

.sidebar-toggle:hover {
  background: var(--purple-50);
  border-color: #c084fc;
}

.sidebar-toggle svg {
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.app-shell.sidebar-collapsed .project-sidebar {
  transform: translateX(-100%);
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  left: 8px;
}

.app-shell.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.main-column {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin-left: var(--sidebar-width);
  overflow-y: auto;
}

.app-shell.sidebar-collapsed .main-column {
  margin-left: 0;
}

/* ── Canvas: ambient wash plus fine grain ──────────────────────────────────── */
.main-content {
  position: relative;
  flex: 1;
  background-color: var(--canvas);
  background-image:
    radial-gradient(60rem 32rem at 12% -8%, rgba(248, 113, 113, 0.07), transparent 62%),
    radial-gradient(48rem 30rem at 96% 4%, rgba(100, 116, 139, 0.08), transparent 60%);
  padding-bottom: 4rem;
}

.main-content::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

.view {
  position: relative;
}

.page-body {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Sticky page bar: breadcrumbs, title, actions. */
.page-bar {
  position: sticky;
  top: 0;
  z-index: 15;
  margin-bottom: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(246, 247, 249, 0.9);
  backdrop-filter: blur(12px) saturate(1.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
}

.page-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-heading {
  min-width: 0;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  color: var(--slate-400);
}

.crumb {
  color: var(--slate-500);
  text-decoration: none;
}

a.crumb:hover {
  color: var(--slate-900);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.crumb.current {
  color: var(--slate-700);
  font-weight: 500;
}

.crumb-sep {
  color: var(--slate-300);
}

.page-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--slate-900);
}

.page-subtitle {
  max-width: 70ch;
  margin-top: 0.15rem;
  font-size: 0.875rem;
  color: var(--slate-500);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
}

.card-interactive {
  transition: transform 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

/* Hover lift gated to fine pointers: a tap would leave the card stuck raised. */
@media (hover: hover) and (pointer: fine) {
  .card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-800);
}

.card-hint {
  margin-top: 0.1rem;
  font-size: 0.75rem;
  color: var(--slate-400);
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--slate-400);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: -0.5rem;
}

.section-hint {
  font-size: 0.75rem;
  color: var(--slate-400);
}

.figure {
  color: var(--slate-900);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.muted-note {
  font-size: 0.8rem;
  color: var(--slate-400);
}

/* ── KPI tiles ─────────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

.stat-tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--slate-50), var(--slate-100));
  color: var(--slate-500);
  box-shadow: var(--ring);
}

.stat-tile.tone-accent .stat-icon {
  background: rgba(252, 165, 165, 0.25);
  color: var(--accent-ink);
}

.stat-value {
  margin-top: 0.75rem;
  font-size: 2rem;
  line-height: 1;
}

.stat-caption {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--slate-400);
}

/* Composed empty state: a panel with nothing in it still explains itself. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 180px;
  padding: 2rem 1rem;
  text-align: center;
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--slate-100);
  color: var(--slate-400);
}

.empty-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-600);
}

.empty-body {
  max-width: 36ch;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--slate-400);
}

/* ── Project cards ─────────────────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
}

.project-card-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--slate-900);
}

.project-card-desc {
  font-size: 0.8rem;
  color: var(--slate-500);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--slate-100);
  border-bottom: 1px solid var(--slate-100);
}

.mini-stat {
  display: flex;
  flex-direction: column;
}

.mini-stat-value {
  font-size: 1.25rem;
  line-height: 1.2;
}

.mini-stat-label {
  font-size: 0.7rem;
  color: var(--slate-400);
}

.project-card-foot {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--slate-400);
}

.project-card-foot.busy {
  color: var(--state-busy);
}

.project-card-new {
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border: 1.5px dashed var(--slate-300);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.5);
  color: var(--slate-500);
  font-size: 0.875rem;
  font-weight: 500;
}

.project-card-new:hover {
  border-color: var(--accent);
  color: var(--slate-900);
}

/* ── Segmented control with one sliding indicator ──────────────────────────── */
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.toolbar-hint {
  font-size: 0.78rem;
  color: var(--slate-400);
}

.segmented {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.045);
  box-shadow: var(--ring);
  max-width: 100%;
  overflow-x: auto;
}

/* The indicator spans the whole track; a clip-path inset reveals the pill
   under the active tab, so moving it never triggers layout. drop-shadow is
   applied after the clip, so the shadow follows the visible pill. */
.segmented-indicator {
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.25rem;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.07)) drop-shadow(0 4px 5px rgba(15, 23, 42, 0.1));
}

.segmented-indicator::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  clip-path: var(--clip, inset(0 100% 0 0 round 8px));
  transition: clip-path 280ms var(--ease-out);
}

.segmented-indicator.no-anim::before {
  transition: none;
}

.segmented-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-500);
  white-space: nowrap;
  cursor: pointer;
}

.segmented-tab:hover {
  color: var(--slate-700);
}

.segmented-tab.active {
  color: var(--slate-900);
}

.tab-count {
  min-width: 1.3rem;
  padding: 0 0.35rem;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.07);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--slate-500);
}

.segmented-tab.active .tab-count {
  background: var(--slate-900);
  color: #fff;
}

/* ── Sidebar project tree ──────────────────────────────────────────────────── */
.project-tree {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 34px;
  padding: 0.3rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  color: var(--gray-700);
  text-decoration: none;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.tree-row:hover {
  background: var(--purple-50);
  color: var(--purple-600);
}

.tree-row.selected {
  background: var(--purple-50);
  color: var(--purple-600);
  border-color: var(--purple-300);
  font-weight: 600;
}

.tree-label {
  font-weight: 600;
}

.tree-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-count {
  flex: none;
  min-width: 1.35rem;
  padding: 0 0.35rem;
  border-radius: var(--radius-full);
  background: var(--slate-100);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.35rem;
  text-align: center;
  color: var(--slate-500);
}

.tree-spinner {
  color: var(--state-busy);
}

/* ── Project tabs ──────────────────────────────────────────────────────────── */
.project-tabs {
  display: flex;
  gap: 0.25rem;
  /* The base line is an inset shadow, so the active tab's border can sit on it without overflowing. */
  box-shadow: inset 0 -1px 0 var(--gray-200);
  overflow-x: auto;
  overflow-y: hidden;
}

.project-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 2px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-500);
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.project-tab:hover {
  color: var(--slate-800);
}

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

.project-tab.active {
  color: var(--slate-900);
  font-weight: 600;
  border-bottom-color: var(--purple-600);
}

.project-tab.active .tab-count {
  background: var(--slate-900);
  color: #fff;
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem 1.5rem;
}

.detail-list dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate-400);
}

.detail-list dd {
  margin: 0.2rem 0 0;
  font-size: 0.875rem;
  color: var(--slate-800);
  overflow-wrap: anywhere;
}

/* ── Output files ──────────────────────────────────────────────────────────── */
.file-group + .file-group {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
}

.file-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.file-group-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-800);
}

.link-button {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: inherit;
  cursor: pointer;
}

/* ── Lifecycle state: dot + badge (no side-stripe accents) ─────────────────── */
.state-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--slate-300);
}

/* Keys come from displayState(): job status, with completed split by review state. */
.state-dot.state-not_started { background: var(--slate-300); }
.state-dot.state-in_progress { background: #f59e0b; }
.state-dot.state-needs_review { background: var(--blue-500); }
.state-dot.state-approved { background: #10b981; }
.state-dot.state-error { background: var(--accent); }

.state-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.state-badge.state-not_started { background: var(--slate-100); color: var(--slate-600); }
.state-badge.state-in_progress { background: var(--state-busy-bg); color: var(--state-busy); }
.state-badge.state-completed { background: var(--slate-100); color: var(--slate-800); }
.state-badge.state-needs_review { background: var(--state-review-bg); color: var(--state-review); }
.state-badge.state-approved { background: var(--state-approved-bg); color: var(--state-approved); }
.state-badge.state-error { background: var(--state-failed-bg); color: var(--state-failed); }

.assessment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

/* ── Assessment cards ──────────────────────────────────────────────────────── */
.assessment-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.assessment-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.assessment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.assessment-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.assessment-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--slate-900);
}

.assessment-title-link {
  color: inherit;
  text-decoration: none;
}

.assessment-title-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.assessment-meta {
  font-size: 0.78rem;
  color: var(--slate-400);
}

.assessment-error {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--state-failed-bg);
  color: var(--accent-ink);
  font-size: 0.82rem;
}

.pdf-version-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pdf-row-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-400);
}

.pdf-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  box-shadow: var(--ring);
  font-size: 0.78rem;
}

.pdf-chip.latest {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.14);
}

.pdf-chip-name {
  font-weight: 600;
  color: var(--slate-700);
}

.pdf-chip-link {
  color: var(--slate-500);
  text-decoration: none;
  font-weight: 500;
}

.pdf-chip-link:hover {
  color: var(--slate-900);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pdf-chip-link.primary {
  color: var(--slate-900);
}

.assessment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.approved-stamp {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--state-approved);
}

.assessment-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--slate-100);
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--slate-400);
}

/* ── Report detail: dimensions, recommendations, revisions ─────────────────── */
.dim-title-group {
  display: flex;
  flex-direction: column;
}

.dim-agent {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
}

.dim-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--slate-800);
}

.dim-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.metric-chip {
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--ring);
}

.metric-chip-name {
  display: block;
  font-size: 0.7rem;
  color: var(--slate-500);
}

.metric-chip-val {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-900);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Text values (framework names, category mixes) read as labels, not figures. */
.metric-chip-val.is-text {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--slate-700);
  overflow-wrap: break-word;
}

.maturity-level-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-l1 { background: rgba(252, 165, 165, 0.25); color: var(--accent-ink); }
.badge-l2 { background: var(--state-busy-bg); color: var(--state-busy); }
.badge-l3 { background: var(--state-approved-bg); color: var(--state-approved); }
.badge-l4 { background: var(--slate-900); color: #fff; }

.badge-sm {
  font-size: 0.72rem;
}

.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rec-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--ring);
}

.rec-badge {
  flex: none;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill-high { background: rgba(252, 165, 165, 0.3); color: var(--accent-ink); }
.pill-med { background: var(--state-busy-bg); color: var(--state-busy); }
.pill-low { background: var(--slate-100); color: var(--slate-600); }

.rec-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--slate-800);
}

.rec-dim {
  font-size: 0.72rem;
  color: var(--slate-400);
  text-align: right;
}

.revision-changes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.revision-changes li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.change-applied { color: var(--slate-600); }
.change-rejected { color: var(--accent-ink); }

.change-applied::before {
  content: "\2713";
  position: absolute;
  left: 0.1rem;
  font-weight: 700;
  color: var(--state-approved);
}

.change-rejected::before {
  content: "!";
  position: absolute;
  left: 0.35rem;
  font-weight: 700;
  color: var(--accent);
}

.feedback-block {
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 252, 0.7);
  box-shadow: var(--ring);
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

/* The rework action at the end of the report, shown while comments are open. */
.report-rework {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--state-busy-bg);
  box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.15);
}

.report-rework-text {
  flex: 1 1 18rem;
  font-size: 0.85rem;
  color: var(--slate-700);
}

/* Download of the newest report, the last thing in the report. */
.report-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 252, 0.7);
  box-shadow: var(--ring);
}

.report-download-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.report-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
}

/* ── Forms (new project, new assessment) ───────────────────────────────────── */
.form-card {
  max-width: 640px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.dropzone {
  position: relative;
  padding: 1.75rem 1.25rem;
  border: 1.5px dashed var(--slate-300);
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 252, 0.7);
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out), transform 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .dropzone:hover {
    border-color: var(--slate-400);
    background: #fff;
  }
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(252, 165, 165, 0.08);
  transform: translateY(-2px);
}

.dropzone.has-file {
  border-style: solid;
  border-color: #10b981;
  background: var(--state-approved-bg);
}

.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--slate-500);
  box-shadow: var(--ring);
}

.dropzone-icon svg {
  width: 26px;
  height: 26px;
}

.dropzone.has-file .dropzone-icon {
  color: var(--state-approved);
}

.dropzone-title {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-800);
}

.dropzone-desc {
  margin-bottom: 0.85rem;
  font-size: 0.78rem;
  color: var(--slate-500);
}

.dropzone-desc code {
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.06);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--slate-700);
}

.file-info-badge {
  display: inline-block;
  max-width: 100%;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.05);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--slate-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone.has-file .file-info-badge {
  background: #d1fae5;
  color: var(--state-approved);
  font-weight: 600;
}

/* ── Artifact modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  animation: dash-fade 160ms var(--ease-out) both;
}

.modal-dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 820px;
  max-height: 80vh;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--ring), 0 30px 60px -20px rgba(15, 23, 42, 0.35);
  animation: modal-in 220ms var(--ease-out) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--slate-100);
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--slate-900);
}

.modal-badge {
  font-size: 0.72rem;
  color: var(--slate-400);
}

.modal-close {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--slate-400);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--slate-900);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

.modal-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--slate-700);
}

/* ── Toasts ────────────────────────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(26rem, calc(100vw - 2.5rem));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-lift);
  font-size: 0.85rem;
  color: var(--slate-800);
  animation: toast-in 220ms var(--ease-out) both;
}

.toast::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: var(--blue-500);
}

.toast-success::before { background: #10b981; }
.toast-error::before { background: var(--accent); }

.toast-out {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Project datasets ──────────────────────────────────────────────────────── */
.dropzone-wide {
  margin-bottom: 1.1rem;
  padding: 2rem 1.25rem;
}

.upload-results {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1rem;
}

.upload-result {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--slate-700);
  background: var(--slate-50);
  box-shadow: var(--ring);
}

.upload-result::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 0.4rem;
  border-radius: 50%;
}

.upload-result.added::before { background: #10b981; }
.upload-result.reused::before { background: var(--blue-500); }
.upload-result.rejected { color: var(--accent-ink); background: var(--state-failed-bg); }
.upload-result.rejected::before { background: var(--accent); }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--slate-500);
  white-space: nowrap;
  cursor: pointer;
}

.toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--slate-900);
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -1.25rem -1.25rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.data-table th {
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--slate-100);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-400);
  white-space: nowrap;
}

.data-table td {
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
  color: var(--slate-700);
}

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

.data-table tbody tr {
  transition: background-color 150ms var(--ease-out);
}

.data-table tbody tr:hover {
  background: var(--slate-50);
}

.data-table tr.is-inactive td {
  color: var(--slate-400);
}

.cell-primary {
  display: block;
  font-weight: 500;
  color: var(--slate-800);
}

.is-inactive .cell-primary {
  color: var(--slate-500);
}

.cell-secondary {
  display: block;
  font-size: 0.74rem;
  color: var(--slate-400);
  font-variant-numeric: tabular-nums;
}

.cell-file .cell-secondary {
  font-family: var(--font-mono);
}

.cell-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-actions {
  text-align: right;
  white-space: nowrap;
}

.cell-actions > * + * {
  margin-left: 0.5rem;
}

.btn-compact {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.kind-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--slate-100);
  color: var(--slate-700);
}

.kind-badge.kind-unknown {
  background: var(--state-busy-bg);
  color: var(--state-busy);
  cursor: help;
}

/* ── Schedule job ──────────────────────────────────────────────────────────── */
.form-card-wide {
  max-width: 860px;
}

.schedule-dataset-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.schedule-dataset {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-md);
  background: var(--slate-50);
  box-shadow: var(--ring);
  font-size: 0.83rem;
}

.kind-reason {
  display: block;
  max-width: 24rem;
  margin-top: 0.3rem;
  white-space: normal;
}

.kind-picker {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.4rem;
}

.kind-select {
  max-width: 16rem;
  padding: 0.25rem 0.4rem;
  font: inherit;
  font-size: 0.8rem;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--slate-800);
}

.kind-select:focus-visible {
  outline: 2px solid var(--blue-300);
  outline-offset: 1px;
}

.schedule-dataset .kind-badge {
  justify-self: start;
}

.schedule-dataset.is-unrecognised .cell-primary {
  color: var(--slate-500);
}

/* ── Job status table ──────────────────────────────────────────────────────── */
.job-table-card {
  padding-bottom: 1.25rem;
}

.job-row {
  cursor: pointer;
}

.job-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.job-link {
  text-decoration: none;
}

.job-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cell-step {
  max-width: 18rem;
}

.cell-error {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--accent-ink);
}

/* ── Agent progress: stages run top to bottom, parallel agents side by side ── */
.step-flow {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.step-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.step-group + .step-group {
  margin-top: 0.4rem;
}

.step-group-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-500);
}

.step-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
}

.step-stage.is-parallel {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--ring);
  transition: background-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}

.step-marker {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 0.05rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--slate-300);
  color: var(--state-busy);
}

.step-completed .step-marker {
  background: var(--slate-900);
  box-shadow: none;
}

/* Check mark drawn with two borders, no glyph. */
.step-completed .step-marker::after {
  content: '';
  width: 6px;
  height: 10px;
  margin-top: -2px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.step-skipped .step-marker {
  box-shadow: inset 0 0 0 2px var(--slate-200);
  background: repeating-linear-gradient(135deg, var(--slate-100) 0 3px, #fff 3px 6px);
}

.step-error .step-marker {
  background: var(--accent);
  box-shadow: none;
}

.step-error .step-marker::after {
  content: '';
  width: 2px;
  height: 10px;
  background: #fff;
  box-shadow: 0 7px 0 -0.2px #fff;
  transform: translateY(-3px);
}

.step-in_progress {
  background: var(--state-busy-bg);
  box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.18);
}

.step-in_progress .step-marker {
  box-shadow: none;
}

.step-error {
  background: var(--state-failed-bg);
}

.step-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-800);
}

.step-pending .step-label,
.step-skipped .step-label {
  color: var(--slate-500);
}

.step-state {
  flex: none;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-400);
}

.step-in_progress .step-state { color: var(--state-busy); }
.step-error .step-state { color: var(--accent-ink); }

.step-message {
  font-size: 0.8rem;
  color: var(--slate-600);
  overflow-wrap: anywhere;
}

.step-error .step-message {
  color: var(--accent-ink);
}

.step-duration {
  font-size: 0.72rem;
  color: var(--slate-400);
  font-variant-numeric: tabular-nums;
}

/* ── Report: iterations, sections, items ───────────────────────────────────── */
.iteration-table tr.is-current td {
  background: var(--slate-50);
}

.cell-changes {
  max-width: 34rem;
}

.cell-changes > * + * {
  margin-top: 0.35rem;
}

.iteration-feedback {
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  box-shadow: var(--ring);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--slate-600);
}

.cell-error-block {
  font-size: 0.78rem;
  color: var(--accent-ink);
}

.iteration-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--state-review-bg);
  font-size: 0.84rem;
  color: var(--state-review);
}

.report-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 252, 0.7);
  box-shadow: var(--ring);
}

.report-summary-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.report-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--ring);
  scroll-margin-top: 7rem;
}

.report-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.report-section-head .dim-title-group {
  flex: 1;
}

/* The section's assessed maturity, read before anything else in it. */
.maturity-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.7);
  box-shadow: var(--ring);
}

.maturity-panel-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.maturity-panel-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: 0;
}

.maturity-panel-level {
  padding: 0.35rem 0.8rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.maturity-challenge {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.maturity-challenge[hidden] {
  display: none;
}

.maturity-challenge-level {
  max-width: 20rem;
}

/* ── Maturity plots: the overview ladder and each section's level scale ── */
.maturity-overview {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.maturity-ladder {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
}

.maturity-ladder th,
.maturity-ladder td {
  padding: 0.45rem 0.35rem;
  text-align: left;
  vertical-align: middle;
}

.maturity-ladder thead th {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate-500);
  border-bottom: 1px solid var(--slate-200);
}

.ladder-level-head {
  width: 11%;
  text-align: center !important;
}

.ladder-overall-tag {
  display: block;
  font-size: 0.625rem;
  color: var(--brand-navy);
  letter-spacing: 0;
  text-transform: none;
}

.maturity-ladder .is-overall {
  background: var(--blue-50);
}

.ladder-row + .ladder-row > * {
  border-top: 1px solid var(--slate-100);
}

.ladder-area {
  font-weight: 400;
  min-width: 9rem;
}

.ladder-area-link {
  display: block;
  font: inherit;
  font-weight: 600;
  color: var(--slate-800);
  text-align: left;
}

.ladder-area-link {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.ladder-area-link:hover,
.ladder-area-link:focus-visible {
  color: var(--brand-navy);
  text-decoration: underline;
}

.ladder-agent {
  display: block;
  font-size: 0.7rem;
  color: var(--slate-500);
}

.ladder-cell {
  text-align: center;
}

.ladder-step {
  display: inline-block;
  width: 100%;
  max-width: 4.5rem;
  height: 0.75rem;
  border-radius: 4px;
  background: var(--slate-100);
  vertical-align: middle;
}

.ladder-step.is-filled {
  background: var(--brand-navy);
}

.ladder-step.is-target {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--brand-navy);
  opacity: 0.55;
}

.ladder-value {
  white-space: nowrap;
}

.ladder-note {
  margin-left: 0.35rem;
  font-size: 0.7rem;
  color: var(--slate-500);
}

.ladder-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.7rem;
  color: var(--slate-600);
}

.ladder-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ladder-legend-item .ladder-step {
  width: 1.4rem;
}

.ladder-legend-overall {
  display: inline-block;
  width: 1.4rem;
  height: 0.75rem;
  border-radius: 4px;
  background: var(--blue-50);
  box-shadow: inset 0 0 0 1px var(--blue-200);
}

.level-scale-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.level-scale-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 4px;
  background: var(--slate-100);
  color: var(--slate-600);
  font: inherit;
  text-align: left;
}

.level-scale-step.is-filled {
  background: rgba(10, 81, 144, 0.12);
  color: var(--slate-800);
}

.level-scale-step.is-current {
  background: var(--brand-navy);
  color: #fff;
}

.level-scale-step.is-target {
  box-shadow: inset 0 0 0 2px rgba(10, 81, 144, 0.45);
}

button.level-scale-step {
  cursor: pointer;
  transition: box-shadow 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

button.level-scale-step:hover,
button.level-scale-step:focus-visible {
  box-shadow: inset 0 0 0 2px var(--brand-navy);
  outline: none;
}

.level-scale-head {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
}

.level-scale-num {
  font-weight: 700;
  font-size: 0.8125rem;
}

.level-scale-title {
  overflow: hidden;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-scale-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 8px;
}

.level-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-navy);
}

.level-scale-step.is-current .level-dot {
  background: #fff;
}

.level-scale-tag {
  min-height: 1em;
  font-size: 0.6875rem;
}

.level-scale-hint {
  margin: 0;
}

.maturity-thread {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--slate-200);
}

@media (max-width: 640px) {
  .level-scale {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ladder-agent {
    display: none;
  }
}

.report-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.report-narrative {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--slate-700);
  white-space: pre-line;
}

.report-metrics {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.report-table-wrap {
  margin: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--ring);
}

.report-table td {
  font-size: 0.82rem;
}

.report-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  background: var(--slate-50);
  box-shadow: var(--ring);
}

.report-item .rec-badge {
  margin-top: 0.1rem;
}

.report-item-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
  font-size: 0.86rem;
  color: var(--slate-800);
}

.report-item-detail {
  font-size: 0.8rem;
  color: var(--slate-600);
}

.severity-high,
.severity-critical { background: rgba(252, 165, 165, 0.3); color: var(--accent-ink); }
.severity-medium { background: var(--state-busy-bg); color: var(--state-busy); }
.severity-low,
.severity-info { background: var(--slate-100); color: var(--slate-600); }

/* ── Review comments ───────────────────────────────────────────────────────── */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.filter-chip {
  padding: 0.35rem 0.8rem;
  border: none;
  border-radius: var(--radius-full);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--slate-500);
  cursor: pointer;
  transition: color 150ms var(--ease-out), box-shadow 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.filter-chip:hover {
  color: var(--slate-800);
}

.filter-chip.active {
  background: var(--slate-900);
  box-shadow: none;
  color: #fff;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.comment-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--slate-50);
  box-shadow: var(--ring);
}

.comment-where {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
}

.comment-quote {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--slate-500);
}

.comment-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: 0;
}

.selection-popover .comment-item {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--slate-50);
  box-shadow: var(--ring);
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.comment-head .cell-primary,
.comment-head .cell-secondary {
  display: inline;
}

.comment-body {
  font-size: 0.85rem;
  color: var(--slate-800);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.comment-withdrawn .comment-body {
  color: var(--slate-400);
  text-decoration: line-through;
}

.comment-note {
  font-size: 0.78rem;
  color: var(--state-busy);
}

.comment-note.is-addressed {
  color: var(--state-approved);
}

.comment-note.is-declined {
  color: var(--slate-600);
}

/* Select text in the report to comment on it; commented text stays highlighted. */
.selection-popover {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 150;
  animation: dash-rise 160ms var(--ease-out) both;
}

.selection-popover.is-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.selection-popover.is-composer,
.selection-popover.is-thread {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(22rem, calc(100vw - 1.5rem));
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--ring), 0 20px 44px -18px rgba(15, 23, 42, 0.4);
}

.selection-popover.is-thread {
  max-height: min(26rem, 60vh);
  overflow-y: auto;
}

.selection-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 30px;
  padding: 0 0.8rem;
  border: none;
  border-radius: var(--radius-full);
  background: var(--slate-900);
  box-shadow: 0 10px 22px -10px rgba(15, 23, 42, 0.6);
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out);
}

.selection-comment-btn:hover:not(:disabled) {
  background: var(--slate-700);
}

.selection-comment-btn:disabled {
  background: var(--slate-400);
  cursor: not-allowed;
}

.selection-hint {
  max-width: 16rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--ring), 0 8px 20px -12px rgba(15, 23, 42, 0.35);
  font-size: 0.75rem;
  text-align: center;
  color: var(--slate-600);
}

.selection-quote {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--state-busy-bg);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--slate-600);
  overflow-wrap: anywhere;
}

.selection-scope {
  font-size: 0.75rem;
  color: var(--slate-500);
}

.selection-input {
  min-height: 4.5rem;
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.selection-keys {
  margin-right: auto;
  font-size: 0.7rem;
  color: var(--slate-400);
}

.selection-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

::highlight(comment-draft) {
  background-color: rgba(251, 191, 36, 0.4);
}

mark.comment-mark {
  padding: 0 1px;
  border-radius: 3px;
  background: rgba(251, 191, 36, 0.26);
  box-shadow: inset 0 -2px 0 rgba(217, 119, 6, 0.55);
  color: inherit;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out);
}

mark.comment-mark.is-addressed {
  background: rgba(16, 185, 129, 0.12);
  box-shadow: inset 0 -2px 0 rgba(4, 120, 87, 0.35);
}

mark.comment-mark.is-declined {
  background: rgba(148, 163, 184, 0.16);
  box-shadow: inset 0 -2px 0 rgba(100, 116, 139, 0.35);
}

mark.comment-mark:hover {
  background: rgba(251, 191, 36, 0.42);
}

mark.comment-mark.is-addressed:hover {
  background: rgba(16, 185, 129, 0.22);
}

mark.comment-mark:focus-visible,
.comment-block:focus-visible {
  outline: 2px solid var(--state-busy);
  outline-offset: 2px;
}

/* A comment on a whole item (its selection spanned several fields) tints the item. */
.comment-block {
  cursor: pointer;
}

.comment-block.is-open {
  background-color: var(--state-busy-bg);
}

.comment-block.is-addressed {
  background-color: var(--state-approved-bg);
}

.comment-block.is-declined {
  background-color: var(--slate-100);
}

@keyframes anchor-flash {
  from { box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.45); }
  to { box-shadow: var(--ring); }
}

.anchor-flash {
  animation: anchor-flash 1.4s var(--ease-out);
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .project-sidebar {
    width: min(var(--sidebar-width), 86vw);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  }

  .main-column { margin-left: 0; }

  .app-shell:not(.sidebar-collapsed) .sidebar-toggle {
    left: calc(min(var(--sidebar-width), 86vw) - 12px);
  }

}

@media (max-width: 640px) {
  .comment-row { grid-template-columns: minmax(0, 1fr); }
  .schedule-dataset { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-body, .page-bar-inner { padding: 0 1rem; }
  .assessment-header { flex-direction: column; }
  .brand-wordmark { height: 34px; }
  .login-panel { padding: 1rem; }
  .login-actions { flex-direction: column; }
}

/* Reduced motion keeps the changes that explain a state and drops the travel. */
@media (prefers-reduced-motion: reduce) {
  .rise {
    animation: dash-fade 160ms var(--ease-out) both;
    animation-delay: 0ms;
  }

  .modal-dialog, .toast { animation: dash-fade 160ms var(--ease-out) both; }
  .skeleton { animation-duration: 3s; }
  .dash-press:active:not(:disabled) { transform: none; }
  .step-item { transition: none; }
  .selection-popover { animation: dash-fade 120ms var(--ease-out) both; }
  mark.comment-mark { transition: none; }
  .anchor-flash { animation-duration: 0.01s; }
  .card-interactive:hover { transform: none; }
  .dropzone.dragover { transform: none; }
  .segmented-indicator::before { transition: none; }
  .project-sidebar,
  .sidebar-toggle,
  .sidebar-toggle svg,
  .project-tab { transition: none; }
}
