:root {
  --page-gap: 0.85rem;
  --bg: #f7f9fc;
  --panel: rgba(255, 255, 255, 0.985);
  --panel-strong: #ffffff;
  --ink: #1e2935;
  --muted: #738190;
  --line: #e3eaf1;
  --accent: #5f8fb7;
  --accent-hover: #527ea3;
  --accent-soft: #eef5fb;
  --warm: #b8742c;
  --danger: #b84a4a;
  --danger-hover: #a24444;
  --button-bg: #f6f9fc;
  --switch-knob: #ffffff;
  --hover-soft: #f1f6fb;
  --hover-soft-strong: #ebf2f9;
  --shadow-soft: 0 6px 18px rgba(88, 112, 138, 0.05);
  --shadow-card: 0 6px 20px rgba(88, 112, 138, 0.045);
  --tone-open-bg: #eef5fc;
  --tone-open-border: #d4e2ef;
  --tone-open-ink: #476d8d;
  --tone-neutral-bg: #f5f8fb;
  --tone-neutral-border: #e0e8ef;
  --tone-neutral-ink: #5e6d7b;
  --tone-completed-bg: #eef8f1;
  --tone-completed-border: #d5e8da;
  --tone-completed-ink: #4f7b5d;
  --tone-samples-bg: #eff8f8;
  --tone-samples-border: #d8e8e8;
  --tone-samples-ink: #4d7a79;
  --tone-week-jobs-bg: #f1f4fc;
  --tone-week-jobs-border: #dce1f1;
  --tone-week-jobs-ink: #58699c;
  --tone-week-samples-bg: #f0f7fc;
  --tone-week-samples-border: #d8e6ef;
  --tone-week-samples-ink: #4a738d;
  --tone-month-jobs-bg: #f8f2fc;
  --tone-month-jobs-border: #e6d9f0;
  --tone-month-jobs-ink: #735993;
  --tone-month-samples-bg: #f4f9ef;
  --tone-month-samples-border: #dfebd5;
  --tone-month-samples-ink: #64824d;
  --tone-wait-bg: #fbf5eb;
  --tone-wait-border: #eddcc1;
  --tone-wait-ink: #8a6b3e;
  --tone-active-bg: #edf3ff;
  --tone-active-border: #d6e0f4;
  --tone-active-ink: #506ea5;
  --tone-rejected-bg: #fbf1f1;
  --tone-rejected-border: #efd9d9;
  --tone-rejected-ink: #9a5c5c;

  /* Spacing Scale */
  --spacing-xs: 0.3rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.75rem;
  --spacing-lg: 1rem;
  --spacing-xl: 1.25rem;

  /* Border Radius Scale */
  --radius-full: 999px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  /* Font Size Scale */
  --font-xs: 0.7rem;
  --font-sm: 0.78rem;
  --font-md: 0.88rem;
  --font-lg: 1.1rem;
  --font-xl: 1.48rem;

  /* Operation Status Colors */
  --op-accepting: #5a9b68;
  --op-hold: #d1a64b;
  --op-maintenance: #c06565;

  /* Lifecycle Colors */
  --lifecycle-done: #5d9b6a;
  --lifecycle-current: #3b6fc7;
  --lifecycle-ok: #5a9b68;
  --lifecycle-warn: #d1a64b;
  --lifecycle-danger: #c06565;
}

:root[data-theme="dark"] {
  --bg: #0f1419;
  --panel: rgba(25, 31, 39, 0.96);
  --panel-strong: #161d25;
  --ink: #edf2f7;
  --muted: #b9c6d2;
  --line: #33404f;
  --accent: #7fd1d4;
  --accent-hover: #93dee0;
  --accent-soft: #17383d;
  --warm: #d39a58;
  --danger: #db7474;
  --danger-hover: #e38585;
  --button-bg: #1d2630;
  --switch-knob: #f3f7fb;
  --hover-soft: #202a35;
  --hover-soft-strong: #24313d;
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.22);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.22);
  --tone-open-bg: #18283a;
  --tone-open-border: #304965;
  --tone-open-ink: #c9ddff;
  --tone-neutral-bg: #1a2129;
  --tone-neutral-border: #394554;
  --tone-neutral-ink: #d7e0e8;
  --tone-completed-bg: #183123;
  --tone-completed-border: #315942;
  --tone-completed-ink: #d6f5dd;
  --tone-samples-bg: #173235;
  --tone-samples-border: #2c5f65;
  --tone-samples-ink: #cef1f0;
  --tone-week-jobs-bg: #242841;
  --tone-week-jobs-border: #414873;
  --tone-week-jobs-ink: #d8dcff;
  --tone-week-samples-bg: #17303d;
  --tone-week-samples-border: #31556a;
  --tone-week-samples-ink: #d1eaf9;
  --tone-month-jobs-bg: #30243d;
  --tone-month-jobs-border: #5a4470;
  --tone-month-jobs-ink: #ecd8ff;
  --tone-month-samples-bg: #243320;
  --tone-month-samples-border: #47633d;
  --tone-month-samples-ink: #e0f3d3;
  --tone-wait-bg: #332a1d;
  --tone-wait-border: #6f5b37;
  --tone-wait-ink: #f3dfbb;
  --tone-active-bg: #1d2940;
  --tone-active-border: #3b547d;
  --tone-active-ink: #d7e5ff;
  --tone-rejected-bg: #351d22;
  --tone-rejected-border: #6f3b44;
  --tone-rejected-ink: #ffd8dd;
  --lifecycle-ok: #6bc5a0;
  --lifecycle-warn: #e8b84d;
  --lifecycle-danger: #e87474;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.48;
  background:
    radial-gradient(circle at top left, rgba(120, 164, 204, 0.08), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(127, 209, 212, 0.08), transparent 22%),
    linear-gradient(180deg, #121820 0%, var(--bg) 100%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-soft);
  isolation: isolate;
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .nav {
  background: rgba(17, 23, 30, 0.9);
}

.topbar h1 {
  margin: 0;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}

.brand-link {
  color: var(--ink);
  text-decoration: none;
}

.brand-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.topbar p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.section-kicker {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.8rem;
}
.user-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: right;
  font-size: 0.92rem;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  align-items: flex-end;
}

.theme-toggle {
  --toggle-track-bg: var(--button-bg);
  width: 48px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--toggle-track-bg);
  position: relative;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  --toggle-track-bg: color-mix(in srgb, var(--button-bg) 78%, var(--accent) 22%);
  background: var(--toggle-track-bg);
  border-color: color-mix(in srgb, var(--line) 72%, var(--accent) 28%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent);
}

.theme-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, white);
  outline-offset: 2px;
}

.theme-icon {
  position: absolute;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
}

.theme-icon-light {
  left: 8px;
  background: #ffd27a;
  box-shadow:
    0 0 0 1px rgba(255, 210, 122, 0.55),
    0 0 0 3px rgba(255, 210, 122, 0.25);
}

.theme-icon-dark {
  right: 8px;
  background: #7aa0c2;
}

.theme-icon-dark::after {
  content: "";
  position: absolute;
  top: 0;
  left: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--toggle-track-bg);
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--switch-knob);
  transition: transform 0.2s ease;
  box-shadow: 0 1px 4px rgba(24, 33, 43, 0.12);
}

.theme-toggle:hover .switch-thumb,
.theme-toggle:focus-visible .switch-thumb {
  transform: translateX(2px);
}

:root[data-theme="dark"] .switch-thumb {
  transform: translateX(20px);
}

:root[data-theme="dark"] .theme-toggle:hover .switch-thumb,
:root[data-theme="dark"] .theme-toggle:focus-visible .switch-thumb {
  transform: translateX(18px);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

a:hover {
  text-decoration: underline;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: 0.46rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--panel-strong);
  color: var(--ink);
  text-decoration: none;
  font-size: var(--font-md);
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.link-button:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--line) 74%, var(--accent) 26%);
  background: var(--hover-soft);
  color: var(--accent);
}

.link-button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.link-button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
}

.link-button.subtle {
  padding: 0.42rem 0.72rem;
  background: transparent;
  color: var(--ink);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.text-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-weight: 500;
  padding: 0.08rem 0.22rem;
  border-radius: 8px;
}

.text-link:hover {
  text-decoration: none;
  background: var(--hover-soft);
}

.back-link {
  display: inline-flex;
  margin-bottom: 0.3rem;
  padding-left: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.request-link {
  display: inline-block;
  color: var(--accent);
  font-weight: 500;
  line-height: 1.35;
  padding: 0.08rem 0.22rem;
  border-radius: 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.request-identity-compact {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.2;
}

.request-sample-subline {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
  padding-left: 0.22rem;
}

.sample-count-badge {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0 0.35rem;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--font-xs);
  font-weight: 600;
  vertical-align: middle;
  line-height: 1.5;
}

.request-link:hover {
  text-decoration: none;
  background: var(--hover-soft);
}

.job-meta-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.22rem;
  border-radius: 8px;
}

.job-meta-link:hover {
  color: var(--accent);
  text-decoration: none;
  background: var(--hover-soft);
}

.operation-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f4f6f7;
  color: var(--ink);
  white-space: nowrap;
}

.operation-status strong {
  font-size: 0.96rem;
  font-weight: 600;
}

.operation-status-compact {
  gap: 0.44rem;
  padding: 0.34rem 0.58rem;
  border-radius: var(--radius-full);
}

.operation-status-compact strong {
  font-size: 0.83rem;
}

.operation-status-table {
  gap: 0.42rem;
  padding: 0.3rem 0.54rem;
  border-radius: var(--radius-full);
}

.operation-status-table strong {
  font-size: 0.79rem;
}

.operation-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.small-button.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, #eef5fb 72%, var(--accent-soft) 28%);
}

.nav {
  display: flex;
  gap: 0.7rem;
  padding: 0.7rem 1.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.92);
  flex-wrap: wrap;
  align-items: center;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 67px;
  z-index: 39;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  isolation: isolate;
}

.nav > a,
.nav-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.46rem 0.78rem;
  border-radius: var(--radius-full);
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.9rem;
  cursor: pointer;
  font: inherit;
}

.nav > a:hover,
.nav-trigger:hover,
.nav-dropdown:hover .nav-trigger,
.nav-dropdown:focus-within .nav-trigger {
  background: var(--hover-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--line) 72%, var(--accent) 28%);
  text-decoration: none;
}

.nav > a.nav-active,
.nav > a.nav-active:hover {
  background: var(--tone-open-bg);
  color: var(--tone-open-ink);
  border-color: var(--tone-open-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

:root[data-theme="dark"] .nav > a.nav-active,
:root[data-theme="dark"] .nav > a.nav-active:hover {
  background: var(--tone-active-bg);
  color: var(--tone-active-ink);
  border-color: var(--tone-active-border);
  box-shadow: none;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu {
  display: grid;
}

.nav-menu {
  display: none;
  position: absolute;
  top: 2.5rem;
  left: 0;
  min-width: 200px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.45rem;
  box-shadow: 0 16px 40px rgba(24, 33, 43, 0.12);
  z-index: 60;
}

.topbar::after,
.nav::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-bottom: 1px solid rgba(216, 222, 229, 0.55);
}

:root[data-theme="dark"] .topbar::after,
:root[data-theme="dark"] .nav::after {
  border-bottom-color: rgba(69, 84, 99, 0.55);
}

.nav-menu a {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  color: var(--ink);
}

.nav-menu-footer {
  border-top: 1px solid var(--line);
  margin-top: 0.25rem;
  padding-top: 0.55rem;
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--accent);
}

.nav-menu a:hover {
  background: #eef5fb;
  color: var(--accent);
  text-decoration: none;
}

:root[data-theme="dark"] .nav-menu a:hover {
  background: #202a35;
  color: #9be3e5;
}

/* Instrument nav dropdown items */
.nav-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-inst-code {
  font-weight: 600;
  font-size: 0.72rem;
  min-width: 5rem;
  opacity: 0.7;
}

.nav-inst-name {
  flex: 1;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-inst-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-inst-dot.dot-accepting {
  background: var(--lifecycle-ok);
}

.nav-inst-dot.dot-soft {
  background: var(--lifecycle-warn);
}

.nav-inst-dot.dot-maintenance {
  background: var(--lifecycle-danger);
}

/* ── Settings page (Apple-style sidebar + panel) ── */
/* Apple Settings-style layout */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .settings-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Left sidebar section buttons */
.settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: sticky;
  top: 80px;
}

.settings-section-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.settings-section-btn:hover {
  background: var(--hover-soft);
  color: var(--ink);
}

.settings-section-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.settings-section-btn .icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* Right panel content area */
.settings-content {
  min-height: 400px;
}

.settings-section {
  display: none;
  animation: fadeIn 0.12s ease;
}

.settings-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2rem 0;
}

/* Settings groups */
.settings-group {
  margin-bottom: 2rem;
}

.settings-group:last-child {
  margin-bottom: 0;
}

.group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.75rem 0;
}

/* Individual settings items */
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  gap: 2rem;
}

.settings-item:last-child {
  border-bottom: none;
}

.item-label {
  flex: 1;
  min-width: 0;
}

.item-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink);
}

.item-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
}

.item-value {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.link-item {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: opacity 0.15s;
}

.link-item:hover {
  opacity: 0.7;
}

.text-value {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 28px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-rail {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: var(--line);
  cursor: pointer;
  transition: background 0.25s ease;
}

.toggle-rail::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle input:checked + .toggle-rail {
  background: var(--accent);
}

.toggle input:checked + .toggle-rail::after {
  transform: translateX(20px);
}

/* ── Input dialog (universal message/search widget) ── */
.input-dialog { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: flex-start; }
.input-dialog-type,
.input-dialog-route { flex: 0 0 auto; padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-size: 0.82rem; color: var(--ink); }
.input-dialog-body { flex: 1 1 100%; display: flex; align-items: flex-end; gap: 0.4rem; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem; background: var(--panel); }
.input-dialog-body textarea { flex: 1; border: none; background: transparent; font: inherit; font-size: 0.85rem; color: var(--ink); resize: vertical; min-height: 2.2rem; outline: none; }
.input-dialog-actions { display: flex; align-items: center; gap: 0.3rem; flex-shrink: 0; }
.input-dialog-file { cursor: pointer; font-size: 1.1rem; opacity: 0.6; transition: opacity 0.15s; }
.input-dialog-file:hover { opacity: 1; }
.input-dialog-file input[type="file"] { display: none; }
.input-dialog-send { padding: 0.3rem 0.7rem; border: none; border-radius: var(--radius); background: var(--accent); color: #fff; font-size: 0.82rem; cursor: pointer; white-space: nowrap; }
.input-dialog-send:hover { filter: brightness(1.1); }

/* ── Progress bar (docs page) ── */
.progress-grid { display: flex; flex-direction: column; gap: 0.8rem; }
.progress-phase { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 0.8rem; align-items: center; }
.progress-phase-head { display: flex; align-items: center; gap: 0.5rem; grid-column: 1 / -1; }
.progress-track { height: 0.5rem; border-radius: 0.25rem; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 0.25rem; transition: width 0.4s ease; background: var(--accent); }
.progress-fill.fill-done { background: var(--lifecycle-ok); }
.progress-fill.fill-active { background: var(--accent); }
.progress-pct { font-size: 0.78rem; color: var(--muted); text-align: right; }
.badge-done { background: var(--lifecycle-ok); color: #fff; }
.badge-active { background: var(--accent); color: #fff; }
.badge-planned { background: var(--line); color: var(--muted); }

/* ── Docs page body ── */
.doc-body { padding: var(--spacing-lg); line-height: 1.65; }
.doc-body h1 { font-size: 1.4rem; margin: 1.5rem 0 0.5rem; border-bottom: 1px solid var(--line); padding-bottom: 0.3rem; }
.doc-body h2 { font-size: 1.15rem; margin: 1.3rem 0 0.4rem; }
.doc-body h3 { font-size: 1rem; margin: 1rem 0 0.3rem; }
.doc-body p { margin: 0.4rem 0; }
.doc-body pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem; overflow-x: auto; font-size: 0.82rem; margin: 0.5rem 0; }
.doc-body code { font-size: 0.85em; background: var(--line); padding: 0.1rem 0.3rem; border-radius: 3px; }
.doc-body pre code { background: none; padding: 0; }
.doc-body ul { padding-left: 1.2rem; margin: 0.3rem 0; }
.doc-body li { margin: 0.15rem 0; }
.doc-table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; font-size: 0.85rem; }
.doc-table th, .doc-table td { padding: 0.35rem 0.6rem; border: 1px solid var(--line); text-align: left; }
.doc-table th { background: var(--panel); font-weight: 600; }

/* ── Downtime list items ── */
.downtime-list { display: flex; flex-direction: column; gap: 0.5rem; }
.downtime-item { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.downtime-item:last-child { border-bottom: none; }
.downtime-dates { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; flex-wrap: wrap; }

/* ── View toggle (compact/detailed) ── */
.view-toggle-group { display: flex; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.view-toggle { padding: 0.25rem 0.6rem; font-size: 0.78rem; border: none; background: var(--panel); color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s; }
.view-toggle + .view-toggle { border-left: 1px solid var(--line); }
.view-toggle-active { background: var(--accent); color: #fff; }

/* Compact queue mode: hide File and Requester columns */
.queue-compact .col-files,
.queue-compact th:nth-child(6),
.queue-compact td:nth-child(6),
.queue-compact .col-requester,
.queue-compact th:nth-child(4),
.queue-compact td:nth-child(4) { display: none; }
.queue-compact td { padding-top: 0.2rem; padding-bottom: 0.2rem; font-size: 0.82rem; }

/* ── Dashboard section collapse ── */
.section-collapse-btn { background: none; border: none; font-size: 0.78rem; color: var(--muted); cursor: pointer; padding: 0.2rem 0.4rem; }
.section-collapse-btn:hover { color: var(--ink); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.section-head h2,
.card > h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page {
  max-width: 1420px;
  margin: 0 auto;
  padding: 1.15rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: var(--page-gap);
}

/* ── New Request — tile grid (mirrors .inst-tiles for Jony-Ive
   uniformity with instrument_detail.html — no wasted whitespace,
   form spans the full page width) ── */
.new-request-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  grid-auto-flow: row dense;
}

.new-request-tiles > .tile {
  min-width: 0;
}

.tile-new-request-context,
.tile-new-request-form {
  grid-column: 1 / -1;
}

.new-request-context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem 1.25rem;
  margin: 0;
}

.new-request-context-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.new-request-context-cell dt {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.new-request-context-cell dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  word-break: break-word;
}

@media (max-width: 760px) {
  .new-request-tiles { grid-template-columns: 1fr; }
  .new-request-tiles > .tile { grid-column: 1 / -1; }
}

/* ── Site map — tile grid (graduated 2026-04-11 from the settings-
   layout sidebar+panel pattern onto the canonical .tile architecture
   so philosophy_propagation + ui_uniformity can enforce uniformity) ── */
.sitemap-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  grid-auto-flow: row dense;
}

.sitemap-tiles > .tile {
  min-width: 0;
}

.tile-sitemap-section {
  grid-column: span 3;
}

.sitemap-section-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem 0;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.sitemap-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 1rem;
  color: var(--muted);
}

.sitemap-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 760px) {
  .sitemap-tiles { grid-template-columns: 1fr; }
  .sitemap-tiles > .tile { grid-column: 1 / -1; }
}

.new-request-form {
  gap: 1.25rem;
}

.new-request-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
}

.new-request-submit-row {
  display: flex;
  justify-content: flex-start;
  padding-top: 0.2rem;
}

.is-muted {
  opacity: 0.78;
}

.row-time-hint {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--text-muted, #6b7684);
  font-variant-numeric: tabular-nums;
}

.stat,
.card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg) 1.15rem;
  line-height: 1.5;
  border: 1px solid rgba(227, 234, 241, 0.96);
  box-shadow: var(--shadow-card);
}
.card > * + * {
  margin-top: 0.6rem;
}
.card > h2:first-child,
.card > .section-head:first-child { margin-top: 0; }

/* Sections that are direct children of .page get no extra margin */
.page > section,
.page > div { margin-top: 0; margin-bottom: 0; }

.card.compact {
  padding: var(--spacing-md) 0.9rem;
}

.stat span {
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
  letter-spacing: -0.03em;
}

.stat {
  padding: var(--spacing-md) 0.9rem;
  margin: 0.2rem;
}

.stat small {
  color: var(--muted);
  font-size: 0.8rem;
}

input[type="file"] {
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: var(--panel-strong);
}

.dark-stat {
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
  color: #22303c;
  border: 1px solid #e1e9f0;
}

.dark-stat small,
.dark-stat span {
  color: inherit;
}

:root[data-theme="dark"] .dark-stat {
  background: linear-gradient(180deg, #12202a 0%, #0c161e 100%);
  border-color: #314253;
  color: #eef7f8;
}

.stat-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.stat-link:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line) 72%);
  background: color-mix(in srgb, var(--panel-strong) 86%, var(--accent-soft) 14%);
  box-shadow: 0 10px 22px rgba(24, 33, 43, 0.06);
}

.dark-stat.stat-link:hover {
  background: #ebf3fb;
  box-shadow: 0 12px 26px rgba(24, 33, 43, 0.1);
}

:root[data-theme="dark"] .dark-stat.stat-link:hover {
  background: #1f2730;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.stat-tone-active,
.dark-stat.stat-tone-active {
  background: var(--tone-active-bg);
  border-color: var(--tone-active-border);
  color: var(--tone-active-ink);
}

.stat-tone-wait,
.dark-stat.stat-tone-wait {
  background: var(--tone-wait-bg);
  border-color: var(--tone-wait-border);
  color: var(--tone-wait-ink);
}

.stat-tone-open,
.dark-stat.stat-tone-open {
  background: var(--tone-open-bg);
  border-color: var(--tone-open-border);
  color: var(--tone-open-ink);
}

.stat-tone-neutral,
.dark-stat.stat-tone-neutral {
  background: var(--tone-neutral-bg);
  border-color: var(--tone-neutral-border);
  color: var(--tone-neutral-ink);
}

.stat-tone-completed,
.dark-stat.stat-tone-completed {
  background: var(--tone-completed-bg);
  border-color: var(--tone-completed-border);
  color: var(--tone-completed-ink);
}

.stat-tone-samples,
.dark-stat.stat-tone-samples {
  background: var(--tone-samples-bg);
  border-color: var(--tone-samples-border);
  color: var(--tone-samples-ink);
}

.stat-tone-week-jobs,
.dark-stat.stat-tone-week-jobs {
  background: var(--tone-week-jobs-bg);
  border-color: var(--tone-week-jobs-border);
  color: var(--tone-week-jobs-ink);
}

.stat-tone-week-samples,
.dark-stat.stat-tone-week-samples {
  background: var(--tone-week-samples-bg);
  border-color: var(--tone-week-samples-border);
  color: var(--tone-week-samples-ink);
}

.stat-tone-month-jobs,
.dark-stat.stat-tone-month-jobs {
  background: var(--tone-month-jobs-bg);
  border-color: var(--tone-month-jobs-border);
  color: var(--tone-month-jobs-ink);
}

.stat-tone-month-samples,
.dark-stat.stat-tone-month-samples {
  background: var(--tone-month-samples-bg);
  border-color: var(--tone-month-samples-border);
  color: var(--tone-month-samples-ink);
}

.stat-tone-active small,
.stat-tone-wait small,
.stat-tone-open small,
.stat-tone-neutral small,
.stat-tone-completed small,
.stat-tone-samples small,
.stat-tone-week-jobs small,
.stat-tone-week-samples small,
.stat-tone-month-jobs small,
.stat-tone-month-samples small,
.stat-tone-active span,
.stat-tone-wait span,
.stat-tone-open span,
.stat-tone-neutral span,
.stat-tone-completed span,
.stat-tone-samples span,
.stat-tone-week-jobs span,
.stat-tone-week-samples span,
.stat-tone-month-jobs span,
.stat-tone-month-samples span {
  color: inherit;
}

.narrow {
  max-width: 760px;
  margin: 0 auto;
}

.form-grid,
.action-form {
  display: grid;
  gap: var(--spacing-lg);
}

.filters-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.people-list {
  display: grid;
  gap: 0.22rem;
}

.compact-people-list {
  gap: 0.12rem;
  line-height: 1.28;
}

.queue-table-shell {
  max-height: none;
}

/* ── Uniform compact row height across ALL tables ── */
table {
  font-size: 0.84rem;
}

table th,
table td {
  padding: 0.5rem 0.6rem;
  line-height: 1.4;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 18rem;
}

/* Fixed layout prevents column shifts on pagination */
.paginated-pane table,
.queue-table-shell table {
  table-layout: fixed;
  width: 100%;
}

/* Queue table column widths */
#centralQueueTable col.col-request  { width: 14%; }
#centralQueueTable col.col-instrument { width: 12%; }
#centralQueueTable col.col-requester { width: 11%; }
#centralQueueTable col.col-time     { width: 14%; }
#centralQueueTable col.col-files    { width: 8%; }
#centralQueueTable col.col-action   { width: 19%; }

/* Resizable pane handle */
.pane-resize-handle {
  height: 6px;
  cursor: ns-resize;
  background: transparent;
  border-top: 2px solid var(--line);
  border-radius: 0 0 4px 4px;
  transition: border-color 0.15s;
  user-select: none;
}

.pane-resize-handle:hover,
.pane-resize-handle.dragging {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* Action column: tight inline buttons / table wrapper */
.queue-action-stack {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.queue-action-stack .small-button,
.queue-action-stack .primary-action {
  padding: 0.18rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 5px;
  white-space: nowrap;
}

.queue-action-stack select {
  font-size: 0.75rem;
  padding: 0.15rem 0.3rem;
  border-radius: 5px;
  max-width: 7rem;
}

/* ── Queue search ── */
.queue-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.queue-search input {
  flex: 1;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  background: var(--panel);
  color: var(--text);
  font-size: var(--font-sm, 0.78rem);
}

/* ── Paginated pane ── */
.paginated-pane {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.paginated-pane-scroll {
  overflow: auto;
  max-height: var(--pane-max-height, 28rem);
  border-radius: 10px 10px 0 0;
}

.paginated-pane-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-sm) 0.5rem 0.25rem;
  border-top: 1px solid var(--line);
}

.pane-nav-btn {
  background: var(--button-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.13s;
}

.pane-nav-btn:hover:not(:disabled) {
  background: var(--hover-soft-strong);
}

.pane-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pane-page-label {
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 4rem;
  text-align: center;
}

/* Rows hidden by pagination (not by filter) — use class not style.display */
.pane-page-hidden {
  display: none !important;
}

.queue-row-focus td {
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--panel-strong) 28%);
}

.instruments-table-shell {
  max-height: 34rem;
}

.instruments-table {
  table-layout: fixed;
}

.instruments-table .col-name {
  width: 16%;
}

.instruments-table .col-status {
  width: 10%;
}

.instruments-table .col-links {
  width: 10%;
}

.instruments-table .col-return {
  width: 8%;
}

.instruments-table .col-operators {
  width: 16%;
}

.instruments-table .col-faculty {
  width: 16%;
}

.instruments-table .col-location {
  width: 14%;
}

/* ── Table column widths (generic) ── */
.col-name       { width: 16%; }
.col-status     { width: 10%; }
.col-return     { width: 8%; }
.col-operators  { width: 16%; }
.col-faculty    { width: 16%; }
.col-location   { width: 14%; }
.col-links      { width: 10%; }
.col-request    { width: 14%; }
.col-instrument { width: 14%; }
.col-requester  { width: 14%; }
.col-time       { width: 14%; }
.col-files      { width: 10%; }
.col-action     { width: 10%; }

.instruments-table th,
.instruments-table td {
  padding-top: 0.46rem;
  padding-bottom: 0.46rem;
  vertical-align: top;
}

/* ── Archived instruments table ── */
.archived-instruments-table { opacity: 0.8; }

.inline-form {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0.2rem 0.2rem 0.2rem 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.45rem 0.8rem;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  color: var(--ink);
}

.inline-form input[type="text"] {
  padding: 0.5rem 0.58rem;
  min-width: 170px;
}

label {
  display: grid;
  gap: 0.32rem;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.92rem;
}

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

input,
select,
textarea {
  padding: 0.64rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid #cbd7e3;
  background: #fcfeff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: #111923;
  border-color: #415365;
  color: #edf2f7;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #98a9b8;
}

:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus {
  outline: 2px solid rgba(127, 209, 212, 0.28);
  outline-offset: 1px;
  border-color: #7fd1d4;
}

button {
  border: 0;
  border-radius: var(--radius-md);
  padding: 0.64rem 0.88rem;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm, 8px);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: var(--font-sm, 0.78rem);
  transition: background 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, #000 15%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

button.danger {
  background: var(--danger);
}

button:hover {
  background: var(--accent-hover);
  box-shadow: 0 8px 18px rgba(24, 33, 43, 0.12);
}

button.danger:hover {
  background: var(--danger-hover);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
}

th,
td {
  padding: 0.62rem 0.48rem;
  border-bottom: 1px solid #e1e6eb;
  text-align: left;
  vertical-align: top;
}

:root[data-theme="dark"] th,
:root[data-theme="dark"] td {
  border-bottom-color: #2d3947;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  background: #edf4f9;
  color: #3f5562;
  font-size: 0.76rem;
  font-weight: 700;
}

:root[data-theme="dark"] .badge {
  background: #1a3a40;
  color: #a5ecee;
}

.status-submitted,
.status-under_review,
.status-awaiting_sample_submission,
.status-sample_submitted,
.status-sample_received,
.status-scheduled {
  background: var(--tone-open-bg);
  color: var(--tone-open-ink);
}

.status-in_progress {
  background: var(--tone-active-bg);
  color: var(--tone-active-ink);
}

.status-completed {
  background: var(--tone-completed-bg);
  color: var(--tone-completed-ink);
}

.status-attention {
  background: var(--tone-wait-bg);
  color: var(--tone-wait-ink);
}

:root[data-theme="dark"] .status-submitted,
:root[data-theme="dark"] .status-under_review,
:root[data-theme="dark"] .status-awaiting_sample_submission,
:root[data-theme="dark"] .status-sample_submitted,
:root[data-theme="dark"] .status-sample_received,
:root[data-theme="dark"] .status-scheduled {
  background: var(--tone-open-bg);
  color: var(--tone-open-ink);
}

:root[data-theme="dark"] .status-completed {
  background: var(--tone-completed-bg);
  color: var(--tone-completed-ink);
}

:root[data-theme="dark"] .status-attention {
  background: var(--tone-wait-bg);
  color: var(--tone-wait-ink);
}

.status-rejected,
:root[data-theme="dark"] .status-rejected {
  background: var(--tone-rejected-bg);
  color: var(--tone-rejected-ink);
}

.detail-grid {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.38rem 0.72rem;
}

.detail-grid dt {
  font-weight: 700;
}

.detail-grid dd {
  margin: 0;
}

.meta-stack {
  display: grid;
  gap: 0.9rem;
}

.meta-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: color-mix(in srgb, var(--panel-strong) 94%, var(--accent-soft) 6%);
}

.meta-section h3 {
  margin: 0 0 0.6rem;
  font-size: 0.93rem;
  letter-spacing: -0.01em;
}

/* ── Skip-nav (accessibility) ── */
.skip-nav {
  position: absolute;
  top: -100px;
  left: 0.5rem;
  z-index: 10001;
  padding: 0.6rem 1rem;
  background: #1a2230;
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: top 120ms ease-out;
}

.skip-nav:focus {
  top: 0.5rem;
  outline: 2px solid #3b6d99;
  outline-offset: 2px;
}

/* ── Toast notifications ── */
.toast-stack {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.08);
  font-size: 0.92rem;
  line-height: 1.4;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  animation: toast-enter 220ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.toast-message {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  padding: 0 0.15rem;
}

.toast-close:hover {
  opacity: 1;
}

.toast-error {
  background: #fdeaec;
  border-color: #f3b8bf;
  color: #6c1f28;
}

.toast-leave {
  animation: toast-leave 220ms ease-out forwards;
}

@keyframes toast-enter {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toast-leave {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  .toast-leave { animation: none; opacity: 0; }
}

:root[data-theme="dark"] .toast {
  background: #1a2230;
  border-color: #2c3a4b;
  color: #e6edf3;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25);
}

:root[data-theme="dark"] .toast-error {
  background: #34161c;
  border-color: #6c2e36;
  color: #ffd2d8;
}

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

.small-button {
  width: auto;
  align-self: flex-start;
  padding: 0.34rem 0.66rem;
  font-size: 0.8rem;
}

.lifecycle-strip {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.95rem;
  align-items: flex-start;
  overflow-x: auto;
  padding: 0.2rem 0 0.25rem;
}

.lifecycle-step {
  position: relative;
  padding: 0.1rem 0.1rem 0;
  min-height: 54px;
  flex: 1 1 0;
  min-width: 82px;
  text-align: center;
}

.lifecycle-step::before {
  content: "";
  position: absolute;
  top: 0.56rem;
  left: calc(50% + 10px);
  right: calc(-50% + 10px);
  height: 2px;
  background: var(--line);
  z-index: 0;
}

.lifecycle-step:last-child::before {
  display: none;
}

.lifecycle-dot {
  position: relative;
  z-index: 1;
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0.05rem 0 0.4rem;
  border-radius: 999px;
  background: #c8d2db;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--line);
}

.lifecycle-step strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.2;
}

.lifecycle-step small {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  line-height: 1.2;
  font-size: 0.74rem;
}

.compact-lifecycle {
  gap: 0.25rem;
  margin-top: 0.3rem;
  padding: 0.1rem 0 0.15rem;
}

.compact-lifecycle .lifecycle-step {
  min-height: 42px;
  min-width: 70px;
  padding: 0.05rem 0.05rem 0;
}

.compact-lifecycle .lifecycle-step::before {
  top: 0.38rem;
  left: calc(50% + 8px);
  right: calc(-50% + 8px);
}

.compact-lifecycle .lifecycle-dot {
  width: 9px;
  height: 9px;
  margin: 0.03rem 0 0.22rem;
  box-shadow: 0 0 0 1px var(--line);
}

.compact-lifecycle .lifecycle-step strong {
  font-size: 0.72rem;
}

.compact-lifecycle .lifecycle-step small {
  font-size: 0.66rem;
}

:root[data-theme="dark"] .lifecycle-step {
  color: #edf2f7;
}

:root[data-theme="dark"] .lifecycle-step::before {
  background: #2d3947;
}

:root[data-theme="dark"] .lifecycle-dot {
  background: #516171;
  border-color: #141d27;
  box-shadow: 0 0 0 2px #2d3947;
}

code {
  background: #edf3f4;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

:root[data-theme="dark"] code {
  background: #1b2430;
  color: #e7eef5;
}

.calendar-shell {
  min-height: 760px;
  --fc-border-color: #dce5ec;
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: #f6f9fb;
  --fc-list-event-hover-bg-color: #eef5f9;
  --fc-today-bg-color: rgba(41, 110, 136, 0.08);
}

.calendar-shell .fc {
  font-family: inherit;
  font-size: 0.94rem;
}

.calendar-shell .fc-toolbar {
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.calendar-shell .fc-toolbar-title {
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.calendar-shell .fc-button {
  background: #eef5fb;
  border: 1px solid #d5e2ed;
  color: #355b78;
  border-radius: 999px;
  padding: 0.38rem 0.72rem;
  box-shadow: none;
}

.calendar-shell .fc-button:hover,
.calendar-shell .fc-button:focus {
  background: #ddebf6;
  border-color: #bdd2e1;
}

.calendar-shell .fc-button-primary:not(:disabled).fc-button-active,
.calendar-shell .fc-button-primary:not(:disabled):active {
  background: #4e7ea7;
  border-color: #4e7ea7;
  color: #fff;
}

.calendar-shell .fc-col-header-cell-cushion,
.calendar-shell .fc-daygrid-day-number,
.calendar-shell .fc-timegrid-slot-label-cushion,
.calendar-shell .fc-timegrid-axis-cushion {
  color: inherit;
  text-decoration: none;
}

.calendar-shell .fc-event {
  border-radius: 10px;
  padding: 0.15rem 0.18rem;
  cursor: pointer;
}

.calendar-shell .fc-event-title {
  font-weight: 600;
}

.calendar-shell .fc-event-time {
  font-weight: 700;
}

.calendar-shell .fc-daygrid-event-dot {
  display: none;
}

:root[data-theme="dark"] .calendar-shell {
  --fc-border-color: #2c3948;
  --fc-neutral-bg-color: #161f29;
  --fc-list-event-hover-bg-color: #1b2633;
  --fc-today-bg-color: rgba(92, 148, 189, 0.12);
}

:root[data-theme="dark"] .calendar-shell .fc-button {
  background: #18222c;
  border-color: #314253;
  color: #eef4f8;
}

:root[data-theme="dark"] .calendar-shell .fc-button:hover,
:root[data-theme="dark"] .calendar-shell .fc-button:focus {
  background: #22303d;
  border-color: #3c5368;
}

:root[data-theme="dark"] .calendar-shell .fc-button-primary:not(:disabled).fc-button-active,
:root[data-theme="dark"] .calendar-shell .fc-button-primary:not(:disabled):active {
  background: #edf3f7;
  border-color: #edf3f7;
  color: #12202a;
}

[data-theme="dark"] .calendar_white_main:not(.default) {
  --dp-calendar-border-color: #2a3541;
  --dp-calendar-header-bg-color: #111821;
  --dp-calendar-header-color: #e9f0f6;
  --dp-calendar-cell-border-color: #24303b;
  --dp-calendar-cell-bg-color: #121922;
  --dp-calendar-cell-business-bg-color: #151e28;
  --dp-calendar-cell-color: #d7e0e8;
  --dp-calendar-rowheader-bg-color: #10171f;
  --dp-calendar-rowheader-color: #98a7b6;
  --dp-calendar-alldayheader-bg-color: #10171f;
  --dp-calendar-event-background: #193f43;
  --dp-calendar-event-background-hover: #205257;
  --dp-calendar-event-color: #edf7f7;
  --dp-calendar-event-border: 1px solid #2a6a70;
}

[data-theme="dark"] .month_white_main:not(.default) {
  --dp-month-border-color: #293440;
  --dp-month-cell-border-color: #25303b;
  --dp-month-cell-bg-color: #10161d;
  --dp-month-cell-business-bg-color: #141c25;
  --dp-month-header-bg-color: #111821;
  --dp-month-header-color: #ebf2f8;
  --dp-month-cell-header-color: #c7d1db;
  --dp-month-event-background: #193f43;
  --dp-month-event-border: 1px solid #2a6a70;
  --dp-month-event-color: #edf7f7;
  --dp-month-event-hover-background: #205257;
}

[data-theme="dark"] .calendar_white_corner_inner,
[data-theme="dark"] .calendar_white_cornerright_inner,
[data-theme="dark"] .calendar_white_colheader_inner,
[data-theme="dark"] .calendar_white_alldayheader_inner,
[data-theme="dark"] .calendar_white_rowheader_inner,
[data-theme="dark"] .calendar_white_cell_inner,
[data-theme="dark"] .month_white_header_inner,
[data-theme="dark"] .month_white_cell_inner {
  color: var(--ink);
}

[data-theme="dark"] .calendar_white_event_inner,
[data-theme="dark"] .month_white_event_inner {
  color: #f2fbfc;
}

[data-theme="dark"] .calendar_white_event_hover .calendar_white_event_inner,
[data-theme="dark"] .month_white_event_hover .month_white_event_inner {
  color: #ffffff;
}

[data-theme="dark"] .calendar_white_timeheadergroup,
[data-theme="dark"] .calendar_white_timeheader,
[data-theme="dark"] .calendar_white_timeheader_cell,
[data-theme="dark"] .month_white_header {
  background: #111821;
  color: #ebf2f8;
}

.chart-list {
  display: grid;
  gap: 0.85rem;
}

.muted-note {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

/* Prominent Open Queue button */
.btn-open-queue {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-open-queue:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-open-queue-sm {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-open-queue-sm:hover {
  background: var(--accent-hover);
  color: #fff;
}

.quick-intake-search {
  display: grid;
  gap: 0.35rem;
}

.quick-intake-block {
  border: 1px solid var(--tone-wait-border);
  background: var(--tone-wait-bg);
  color: var(--tone-wait-ink);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-intake-content {
  display: grid;
  gap: 0.15rem;
  text-align: left;
}

.quick-intake-content strong {
  font-weight: 600;
}

.quick-intake-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quick-intake-actions form {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.quick-intake-actions select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 0.8rem;
  flex: 1;
  min-width: 0;
}

.quick-intake-actions .small-button {
  padding: 0.28rem 0.6rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.chart-row {
  display: grid;
  gap: 0.35rem;
}

.chart-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.92rem;
}

.chart-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #eef2f5;
  overflow: hidden;
}

:root[data-theme="dark"] .chart-track {
  background: #202b35;
}

.chart-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6bb5b8 0%, var(--accent) 100%);
}

.chart-fill.warm {
  background: linear-gradient(90deg, #efc58b 0%, var(--warm) 100%);
}

.chart-fill.dark {
  background: linear-gradient(90deg, #8ca5b8 0%, #365d7a 100%);
}

.event-attachment-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  padding: 0.14rem 0.34rem;
  border-radius: 999px;
  background: var(--tone-open-bg);
  color: var(--tone-open-ink);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

@media (max-width: 900px) {

  .new-request-layout {
    grid-template-columns: 1fr;
  }

  .new-request-side {
    position: static;
  }
}

.done-box {
  border-color: #79b58a;
  background: color-mix(in srgb, #e6f5ea 72%, var(--panel-strong) 28%);
}

.compact-box {
  padding: 0.85rem 0.95rem;
}

.fast-finish-form {
  display: grid;
  gap: 0.75rem;
}

.fast-finish-form input[type="file"] {
  font-size: 0.9rem;
}

.primary-action {
  width: 100%;
  justify-content: center;
  font-size: 0.98rem;
  padding: 0.8rem 1rem;
}

.secondary-action-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.top-gap {
  margin-top: 1rem;
}

/* ── Empty state placeholder ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
  gap: 0.5rem;
}

.empty-state-message {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

.empty-state-hint {
  font-size: var(--font-sm);
  color: var(--muted);
  opacity: 0.7;
  margin: 0;
}

.empty-state-action {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.25rem;
}

:root[data-theme="dark"] .done-box {
  border-color: #4e9162;
  background: color-mix(in srgb, #173122 72%, var(--panel-strong) 28%);
}

.compact-admin-tools summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.compact-admin-tools[open] {
  display: grid;
  gap: 0.7rem;
}

.compact-admin-form {
  gap: 0.75rem;
}

.edit-panel.is-hidden {
  display: none;
}

/* ── Utility classes ── */
.is-hidden { display: none !important; }
.overflow-indicator td { text-align: center; }
.overflow-indicator a { color: var(--accent); font-size: var(--font-sm, 0.78rem); }

.compact-detail-grid dt,
.compact-detail-grid dd {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.inline-form-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.mini-icon-button {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.mini-icon-button:hover {
  background: var(--panel-strong);
  border-color: var(--accent);
}

/* ── Form section (generic) ── */
.form-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.calendar-card {
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.65rem;
  background: #edf6f4;
  border-left: 4px solid #1f6f78;
}

:root[data-theme="dark"] .calendar-card {
  background: #173038;
  color: #eef7f8;
}

.calendar-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(24, 33, 43, 0.08);
}

.status-in_progress {
  background: #eef4ff;
  border-left-color: #3465c5;
}

:root[data-theme="dark"] .status-in_progress {
  background: #1a2740;
  color: #eef3ff;
}

.status-completed {
  background: #eef8ea;
  border-left-color: #4b8d3b;
}

:root[data-theme="dark"] .status-completed {
  background: #1d3221;
  color: #edf9ee;
}

@media (max-width: 820px) {
  .topbar,
  .nav {
    position: static;
  }

  .topbar {
    padding-bottom: 0.8rem;
    align-items: flex-start;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-right,
  .userbox,
  .user-controls,
  .user-meta {
    width: 100%;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Approval chain on request detail ── */
.approval-action-block {
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 1rem;
  background: var(--surface-2);
}
.approval-action-heading {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--accent);
}
.approval-chain-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.approval-chain-step:last-child {
  border-bottom: none;
}
.approval-chain-role {
  font-weight: 600;
  min-width: 12ch;
}
.approval-chain-step form {
  width: 100%;
  margin-top: 0.25rem;
}

/* ── Calendar popup overlay ── */
.cal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}
.cal-overlay.is-hidden {
  display: none;
}
.cal-card-panel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  width: min(420px, 95vw);
  height: 100%;
  overflow-y: auto;
  padding: 1.25rem;
  position: relative;
  box-shadow: -4px 0 18px rgba(0,0,0,0.15);
}
.cal-card-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.2rem 0.4rem;
  line-height: 1;
}
.cal-card-close:hover {
  color: var(--text);
}
.cal-card-body {
  padding-top: 2rem;
}
.cal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.cal-card-meta {
  margin-bottom: 1rem;
}
.cal-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cal-action-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cal-inline-label {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  gap: 0.2rem;
}
.cal-card-done {
  margin-top: 0.5rem;
}

/* ── Global: instrument-table category divider rows ── */
.category-header-row td {
  background: var(--panel-strong);
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 2px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ── Global: duration blob for average return time ── */
.duration-blob {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--tone-neutral-bg);
  border: 1px solid var(--tone-neutral-border);
  color: var(--tone-neutral-ink);
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════
   Panel, scroll{
  min-height: 0;
}

/* ── Paginated pane: ensure last page doesn't collapse ── */
.paginated-pane-scroll table {
  min-height: 0;
}
.paginated-pane-scroll tbody tr.pane-page-hidden {
  display: none;
}

/* ── Text overflow: allow wrapping in key columns ── */
#centralQueueTable td:first-child,
#centralQueueTable td:nth-child(2) {
  white-space: normal;
  word-break: break-word;
}

/* ── Consistent scroll-pane sizing ── */
.paginated-pane-scroll {
  min-height: 12rem;
}

/* ── Paginated pane table standardisation (Apple blob philosophy) ── */
.paginated-pane table {
  width: 100%;
  border-collapse: collapse;
}
.paginated-pane thead {
  position: sticky;
  top: 0;
  background: var(--panel-strong);
  z-index: 1;
}
.paginated-pane thead th {
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.paginated-pane tbody td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(227, 234, 241, 0.5);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paginated-pane tbody tr:hover {
  background: var(--hover-soft);
}

/* ── Location stacked: address lines wrap naturally ── */
.location-stacked {
  white-space: normal !important;
  line-height: 1.4;
  max-width: 180px !important;
}

.location-line {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Paginated pane with max_height=none: no scrolling, paginate only ── */
.paginated-pane-scroll[style*="--pane-max-height: none"] {
  overflow: visible;
  min-height: auto;
}

/* ── File link table (no outer borders) ── */
.file-link-table { border-collapse: collapse; width: 100%; }
.file-link-table td { padding: 0.35rem 0; border: none; }

/* ── Quick intake table (no outer borders) ── */
.quick-intake-table { border-collapse: collapse; width: 100%; }
.quick-intake-table td { padding: 0; border: none; }

/* ── Chart containers (used by Chart.js in stats/visualization) ── */
.chart-container {
  position: relative;
  width: 100%;
  height: 260px;
}
.chart-container-doughnut {
  position: relative;
  width: 100%;
  height: 260px;
}
@media (max-width: 700px) {
  .chart-container,
  .chart-container-doughnut {
    height: 200px;
  }
}

/* ── Delta tone indicators ── */
.tone-up { color: #2d8659; }
.tone-down { color: var(--danger, #b84a4a); }
:root[data-theme="dark"] .tone-up { color: #6bc5a0; }
:root[data-theme="dark"] .tone-down { color: #e07070; }

/* ══════════════════════════════════════════
   Stats page — unique components
   ══════════════════════════════════════════ */

.warroom-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2d8659;
  display: inline-block;
  animation: wr-pulse 2s ease-in-out infinite;
}
@keyframes wr-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.warroom-panel-alert {
  border-left: 3px solid #c08b30;
}

/* ── Select dropdown ── */
.warroom-select {
  font-size: 0.78rem;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--button-bg, var(--panel));
  color: var(--ink);
  cursor: pointer;
}
.warroom-select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, white);
  outline-offset: 1px;
}

/* ── Instrument status grid ── */
.warroom-instrument-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}
.warroom-inst-tile {
  border-radius: 12px;
  padding: 0.7rem;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: box-shadow 0.15s, border-color 0.15s, background 0.15s;
  display: block;
  text-decoration: none;
  color: inherit;
}
.warroom-inst-tile:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line) 65%);
  background: color-mix(in srgb, var(--panel-strong) 88%, var(--accent-soft) 12%);
}
.wr-inst-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.wr-inst-head strong { font-size: 0.82rem; }
.wr-inst-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aaa;
}
.wr-inst-active .wr-inst-status-dot { background: #2d8659; }
.wr-inst-queued .wr-inst-status-dot { background: #c08b30; }
.wr-inst-idle .wr-inst-status-dot { background: #bbb; }
.wr-inst-metrics {
  display: flex;
  gap: 0.7rem;
}
.wr-inst-metrics > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3rem;
}
.wr-inst-num {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}
.wr-inst-metrics small {
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Bottleneck alert list ── */
.warroom-alert-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.warroom-alert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.warroom-alert-row:last-child { border-bottom: none; }
.warroom-alert-row strong { font-size: 0.82rem; }
.warroom-alert-metric {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Activity feed ── */
.warroom-feed {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.warroom-feed-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}
.warroom-feed-item:last-child { border-bottom: none; }
.warroom-feed-badge {
  font-size: 0.62rem;
  flex-shrink: 0;
}
.warroom-feed-detail {
  flex: 1;
  min-width: 0;
}
.warroom-feed-detail strong {
  font-size: 0.8rem;
  display: block;
}
.warroom-feed-detail small {
  font-size: 0.7rem;
  color: var(--muted);
}
.warroom-feed-time {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}
:root[data-theme="dark"] .wr-inst-active .wr-inst-status-dot { background: #6bc5a0; }
:root[data-theme="dark"] .wr-inst-queued .wr-inst-status-dot { background: #e0b860; }
:root[data-theme="dark"] .warroom-panel-alert { border-left-color: #e0b860; }

/* stats.html styles */
.stats-export-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.stats-export-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

/* ── Hover Back Button ── */
.hover-back-btn {
  position: fixed;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity 0.2s, background 0.2s, box-shadow 0.2s, color 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
}

.hover-back-btn:hover {
  opacity: 1;
  background: var(--panel-strong);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  color: var(--ink);
}

/* ─────────────────────────────────────────────────────────────
   UNIFIED PILL BASE CLASS
   ───────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border, var(--line));
  background: var(--panel);
  color: var(--text-secondary, var(--muted));
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.pill:hover {
  background: var(--panel-strong);
}
.pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────
   BUTTON HIERARCHY ALIASES & EXTENSIONS
   ───────────────────────────────────────────────────────────── */

/* Base button class for consistency */
.btn {
  border: 0;
  border-radius: 12px;
  padding: 0.64rem 0.88rem;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

/* Small button variant (alias for existing .small-button) */
.btn-small {
  width: auto;
  align-self: flex-start;
  padding: 0.34rem 0.66rem;
  font-size: 0.8rem;
}

/* Danger button variant (extends button.danger) */
.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-hover);
}

/* Link-style button variant (alias for .link-button) */
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.46rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  white-space: nowrap;
  font-weight: 600;
  transition: all 140ms ease;
}

.btn-link:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--line) 74%, var(--accent) 26%);
  background: var(--hover-soft);
  color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────
   INSTRUMENT DETAIL TABLE COLUMN WIDTHS
   ───────────────────────────────────────────────────────────── */

.inst-queue-col-request {
  width: 30%;
}

.inst-queue-col-stage {
  width: 22%;
}

.inst-queue-col-time {
  width: 20%;
}

.inst-queue-col-action {
  width: 28%;
}

/* ─────────────────────────────────────────────────────────────
   NAV BUTTON AND BADGE ENHANCEMENTS
   ───────────────────────────────────────────────────────────── */

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.46rem 0.78rem;
  border-radius: var(--radius-full);
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 140ms ease;
  margin-left: auto;
}

.nav-button:hover {
  background: var(--hover-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--line) 72%, var(--accent) 28%);
  text-decoration: none;
}

.nav-button.subtle {
  opacity: 0.8;
  font-weight: 600;
}

.nav-button.subtle:hover {
  opacity: 1;
}

:root[data-theme="dark"] .nav-button.subtle {
  color: var(--muted);
}

:root[data-theme="dark"] .nav-button.subtle:hover {
  color: var(--accent);
}

.badge-role {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--tone-neutral-bg);
  color: var(--tone-neutral-ink);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

:root[data-theme="dark"] .badge-role {
  background: rgba(95, 143, 183, 0.15);
  color: var(--accent);
}

/* W1.4.1 — topbar count badge.
   Rendered only when nav_pending_counts has a non-zero value for a
   nav item (see base.html). Sits inline inside the nav <a>, no
   layout reflow needed, same height as the link text. */
.topbar-count-badge {
  display: inline-block;
  min-width: 1.4rem;
  margin-left: 0.4rem;
  padding: 0.05rem 0.42rem;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  vertical-align: baseline;
}
:root[data-theme="dark"] .topbar-count-badge {
  background: var(--accent);
  color: #0c1720;
}

/* ─────────────────────────────────────────────────────────────
   BREADCRUMB TRAIL
   ───────────────────────────────────────────────────────────── */

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.88rem;
  color: var(--muted);
  background: transparent;
}

.breadcrumb-link {
  color: var(--accent);
  text-decoration: none;
  transition: all 140ms ease;
}

.breadcrumb-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.breadcrumb-separator {
  opacity: 0.5;
  margin: 0 0.2rem;
}

.breadcrumb-current {
  font-weight: 600;
  color: var(--ink);
}

:root[data-theme="dark"] .breadcrumb-current {
  color: var(--accent);
}

/* ── Error page ── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  padding: 2rem 1rem;
}
.error-glyph {
  opacity: 0.25;
  margin-bottom: 1.5rem;
}
.error-code {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  opacity: 0.12;
  margin: 0;
}
.error-heading {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0.75rem 0 0.5rem;
  letter-spacing: -0.01em;
}
.error-detail {
  font-size: 0.9rem;
  opacity: 0.55;
  max-width: 28rem;
  margin: 0 auto 1.5rem;
}
.error-nav {
  display: flex;
  gap: 1.5rem;
}
.error-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.error-nav a:hover {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────
   INSTRUMENT DROPDOWN MOBILE SUPPORT
   ───────────────────────────────────────────────────────────── */
.nav-dropdown-open .nav-menu {
  display: grid;
}

/* ─────────────────────────────────────────────────────────────
   DOWNTIME / MAINTENANCE STYLING
   ───────────────────────────────────────────────────────────── */
.downtime-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.downtime-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.downtime-form label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text);
}

.downtime-form input,
.downtime-form select {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  font-family: inherit;
  font-size: 0.875rem;
}

.downtime-form input:focus,
.downtime-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(52, 101, 197, 0.1);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.form-actions .btn {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
}

.btn-primary:hover {
  background-color: #2e55c1;
  box-shadow: 0 2px 4px rgba(52, 101, 197, 0.3);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--bg-tertiary);
}

/* ═════════════════════════════════════════════════════════════
   INSTRUMENT DETAIL — TILE ARCHITECTURE
   Each concern is a distinct, self-contained widget tile.
   No nested scrolling; tiles use paginated-pane for long lists.
   ═════════════════════════════════════════════════════════════ */

/* ── Header strip ── */
.inst-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.inst-header-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.inst-header-main .back-link {
  font-size: 0.9rem;
}

.inst-header-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.inst-header-code {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.inst-header-status { margin-left: 0.25rem; }

.inst-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* ── Tile grid — 6-column fluid layout ── */
.inst-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  grid-auto-flow: row dense;
}

.tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.75rem;
}

.tile > .section-head { flex: 0 0 auto; margin-bottom: 0.25rem; }

.tile-lead {
  margin: 0 0 0.25rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.tile-footnote {
  margin: 0.5rem 0 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Tile spans */
.tile-info     { grid-column: span 4; }
.tile-stats    { grid-column: span 2; }
.tile-queue    { grid-column: 1 / -1; }
.tile-control  { grid-column: span 2; }
.tile-team     { grid-column: span 2; }
.tile-approval { grid-column: span 2; }
.tile-downtime { grid-column: span 3; }
.tile-activity { grid-column: span 3; }
.tile-edit     { grid-column: span 4; }
.tile-danger   { grid-column: span 2; }

@media (max-width: 1200px) {
  .inst-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tile-info,
  .tile-edit     { grid-column: span 4; }
  .tile-stats    { grid-column: span 4; }
  .tile-control,
  .tile-team,
  .tile-approval { grid-column: span 2; }
  .tile-downtime,
  .tile-activity { grid-column: span 2; }
  .tile-danger   { grid-column: span 2; }
}

@media (max-width: 760px) {
  .inst-tiles { grid-template-columns: 1fr; }
  .inst-tiles > .tile { grid-column: 1 / -1; }
}

/* ── Tile: Instrument (photo + metadata) ── */
.tile-info-body {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 1.1rem;
  align-items: start;
}

.tile-info-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel-soft);
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
}

.tile-info-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-info-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem 1rem;
  font-size: 0.9rem;
  margin: 0;
}

.tile-info-meta dt {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-self: center;
}

.tile-info-meta dd {
  margin: 0;
  word-break: break-word;
  color: var(--ink);
}

.inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  padding: 0.08rem 0.42rem;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

@media (max-width: 640px) {
  .tile-info-body { grid-template-columns: 1fr; }
  .tile-info-meta { grid-template-columns: 1fr; gap: 0.35rem; }
  .tile-info-meta dt { margin-top: 0.4rem; }
}

/* ── Tile: Stats (vertical stack) ── */
.tile-stat-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tile-stat-stack .stat {
  margin: 0;
  padding: 0.7rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  background: var(--panel-soft);
  border-color: transparent;
  border-radius: var(--radius-md);
  transition: all 140ms ease;
}

.tile-stat-stack .stat span {
  font-size: 1.3rem;
  font-weight: 700;
  display: inline;
  margin: 0;
  min-width: 2.5rem;
  text-align: right;
}

.tile-stat-stack .stat small {
  font-size: 0.82rem;
  display: inline;
  flex: 1;
}

.tile-stat-stack .stat:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
  transform: translateY(-1px);
}

/* ── Tile: Queue (full width, filter pills, paginated) ── */
.inst-tile-head-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.tile-queue-table {
  width: 100%;
}

/* ── Tile: Control Panel (operation mode as inline toggle, W1.4.3 c1) ── */
.control-mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.control-mode {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.85rem 0.65rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  cursor: pointer;
  transition: all 140ms ease;
  text-align: center;
  min-height: 5rem;
}

.control-mode input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.control-mode-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  transition: opacity 140ms ease, transform 140ms ease;
}

.control-mode-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.1;
}

.control-mode-hint {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.1;
}

.control-mode:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.control-mode.is-active {
  background: color-mix(in srgb, currentColor 22%, var(--panel));
  border-color: currentColor;
  border-width: 2.5px;
  box-shadow:
    0 0 0 4px color-mix(in srgb, currentColor 28%, transparent),
    0 8px 22px -14px currentColor;
  transform: translateY(-1px);
}

.control-mode.is-active .control-mode-dot {
  opacity: 1;
  transform: scale(1.45);
  box-shadow: 0 0 10px currentColor;
}
.control-mode.is-active .control-mode-label {
  color: currentColor;
  font-weight: 700;
}

/* W1.4.3 c1 — "armed" intermediate state for the 2-tap confirm.
   First click on a dangerous mode (on_hold / maintenance) arms the
   button; second click within 3s commits. Accepting is always safe
   and skips arming. */
.control-mode.is-arming {
  border-color: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 30%, transparent);
  animation: intake-arm-pulse 0.9s ease-in-out infinite;
}
@keyframes intake-arm-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 30%, transparent); }
  50%      { box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 45%, transparent); }
}
.control-mode-status {
  min-height: 1.2em;
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
}
.control-mode-status[data-tone="ok"]   { color: #2f9e44; }
.control-mode-status[data-tone="warn"] { color: #e8a02b; }
.control-mode-status[data-tone="err"]  { color: #c34a4a; }

.control-mode-accepting    { color: #2f9e44; }
.control-mode-hold         { color: #e8a02b; }
.control-mode-maintenance  { color: #c34a4a; }

.control-mode-accepting .control-mode-label,
.control-mode-hold .control-mode-label,
.control-mode-maintenance .control-mode-label {
  color: var(--ink);
}

@media (max-width: 540px) {
  .control-mode-row { grid-template-columns: 1fr; }
}

/* ── Tile: Team (operators + faculty, split columns) ── */
.team-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.team-col .section-kicker {
  margin: 0 0 0.55rem 0;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 540px) {
  .team-columns { grid-template-columns: 1fr; gap: 0.9rem; }
}

/* ── Tile: Approval Sequence (numbered flow) ── */
.approval-flow {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.approval-flow-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: var(--panel-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.approval-flow-num {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--panel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.approval-flow-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.approval-flow-body strong {
  font-size: 0.9rem;
  color: var(--ink);
}

.approval-flow-body .hint { font-size: 0.75rem; }

.approval-flow-empty {
  padding: 0.6rem 0.75rem;
  background: var(--panel-soft);
  border-radius: var(--radius-sm);
  text-align: center;
}

.approval-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.approval-edit-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.approval-edit-num {
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
}

.approval-edit-row select {
  flex: 1 1 auto;
  min-width: 0;
}

/* ── Tile: Downtime ── */
.tile-downtime .downtime-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.downtime-item {
  padding: 0.55rem 0.75rem;
  background: var(--panel-soft);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.4;
  border-left: 3px solid color-mix(in srgb, var(--muted) 45%, transparent);
}

.downtime-dates {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.downtime-dates span { color: var(--ink); }

.downtime-item .hint {
  color: var(--muted);
  font-size: 0.78rem;
  display: block;
}

.downtime-add-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.downtime-add-form label:nth-of-type(3),
.downtime-add-form button {
  grid-column: 1 / -1;
}

/* ── Tile: Activity (recent events log) ── */
.tile-activity .activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.tile-activity tbody tr {
  border-bottom: 1px solid var(--line);
}

.tile-activity tbody tr:last-child { border-bottom: none; }

.tile-activity td {
  padding: 0.6rem 0;
  line-height: 1.45;
  vertical-align: top;
}

.activity-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.activity-row strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
}

.activity-row .hint { font-size: 0.8rem; color: var(--muted); }

.activity-row .muted {
  color: var(--muted);
  font-size: 0.73rem;
}

/* ── Tile: Metadata Edit (toggleable form) ── */
.meta-edit-form[hidden] { display: none; }

.meta-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.meta-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
}

.meta-edit-grid label,
.meta-edit-notes {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.meta-edit-grid input,
.meta-edit-grid select,
.meta-edit-notes textarea {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.meta-edit-assignments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.meta-edit-assignments fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  margin: 0;
}

.meta-edit-assignments legend {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.35rem;
}

.meta-edit-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .meta-edit-grid,
  .meta-edit-assignments { grid-template-columns: 1fr; }
}

/* ── Per-user role + instrument assignment tiles ── */
.tile-user-role,
.tile-user-extra-roles,
.tile-user-instruments { grid-column: 1 / -1; }

/* W1.3.7 — layered roles chip grid + inline chips */
.extra-role-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.extra-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2, #f5f5f5);
  cursor: pointer;
  font-size: 0.85rem;
}
.extra-role-chip input[type="checkbox"] {
  margin: 0;
}
.extra-role-chip input[disabled] + { opacity: 0.6; }
.role-chip {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  margin: 0 0.2rem;
  border-radius: 999px;
  background: rgba(80, 120, 220, 0.15);
  color: rgba(30, 50, 120, 1);
  font-size: 0.75rem;
  font-weight: 600;
}

/* W1.3.6 — group-quick-grant row above the assignment matrix */
.group-quick-grant {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0.6rem;
  background: color-mix(in srgb, var(--bg-2, #f5f5f5) 60%, transparent);
  border-radius: 6px;
}
.group-quick-grant .hint { margin-right: 0.3rem; }

.assignment-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.assignment-matrix th,
.assignment-matrix td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.assignment-matrix .lane-col {
  width: 80px;
  text-align: center;
}
.assignment-matrix thead th {
  font-weight: 600;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-2, #f5f5f5) 60%, transparent);
}
.assignment-matrix .assignment-category-row td {
  background: color-mix(in srgb, var(--bg-2, #f5f5f5) 90%, transparent);
  font-size: 0.85rem;
  padding-top: 0.6rem;
}
.assignment-matrix .assignment-category-row .category-grant {
  margin-left: 0.6rem;
  font-size: 0.8rem;
}
.assignment-matrix .assignment-name {
  font-weight: 500;
  display: block;
}
.assignment-matrix .hint {
  font-size: 0.75rem;
}

/* ── Tile: Danger Zone ── */
.tile-danger { border-color: color-mix(in srgb, #c34a4a 25%, var(--line)); }

.tile-danger .section-head h2 { color: #c34a4a; }

.danger-toggle-btn { color: #c34a4a; }

.danger-body[hidden] { display: none; }

.danger-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.danger-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.danger-form label { display: block; }
.danger-form input[type="text"] { width: 100%; }

/* ── Inline editor disclosure (used inside approval & downtime tiles) ── */
.tile-inline-editor {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
}

.tile-inline-editor summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  list-style: none;
  padding: 0.25rem 0;
}

.tile-inline-editor summary::-webkit-details-marker { display: none; }

.tile-inline-editor summary::before {
  content: "+ ";
  font-weight: 700;
}

.tile-inline-editor[open] summary::before { content: "− "; }

.tile-inline-editor[open] summary { color: var(--ink); }

/* =========================================================================
   W5.1 — SHARED WIDGET MACROS
   Canonical primitives for the widget macros in _page_macros.html. These
   replace .stream-pill/.role-toggle/.warroom-pill, ad-hoc meta dls, stat
   clusters, and inline approval/queue action forms.
   ========================================================================= */

/* ---------- .filter-pill-row / .filter-pill -------------------------------- */
.filter-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-pill {
  appearance: none;
  border: 1px solid var(--line, #e4e4e9);
  background: var(--surface, #fff);
  color: var(--ink, #1a1a1f);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.filter-pill:hover {
  border-color: var(--ink, #1a1a1f);
  transform: translateY(-1px);
}

.filter-pill.is-active {
  background: var(--ink, #1a1a1f);
  border-color: var(--ink, #1a1a1f);
  color: #fff;
}

.filter-pill-label { line-height: 1; }

.filter-pill-count {
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 1.25rem;
  text-align: center;
}

.filter-pill.is-active .filter-pill-count {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- .person-chip --------------------------------------------------- */
.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  padding: 0.3rem 0.5rem;
  border-radius: 0.6rem;
  transition: background 120ms ease;
}

a.person-chip:hover { background: var(--surface-alt, #f5f5f7); }

.person-chip-avatar {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a4a55 0%, #1a1a1f 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.person-chip-body {
  display: inline-flex;
  flex-direction: column;
  min-width: 0;
}

.person-chip-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink, #1a1a1f);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-chip-sub {
  font-size: 0.72rem;
  color: var(--muted, #6e6e76);
  line-height: 1.2;
}

.person-chip-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.4rem;
}

/* ---------- .meta-grid ----------------------------------------------------- */
.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem 1rem;
  margin: 0;
}

.meta-grid-row {
  display: grid;
  grid-template-columns: minmax(6rem, 38%) 1fr;
  gap: 0.5rem 0.8rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line-soft, #ececf0);
}

.meta-grid-row:last-child { border-bottom: none; }

.meta-grid dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #6e6e76);
  font-weight: 600;
  margin: 0;
}

.meta-grid dd {
  font-size: 0.9rem;
  color: var(--ink, #1a1a1f);
  margin: 0;
  word-break: break-word;
}

.meta-grid-compact .meta-grid-row {
  padding: 0.2rem 0;
  gap: 0.3rem 0.6rem;
}

.meta-grid-compact dt { font-size: 0.68rem; }
.meta-grid-compact dd { font-size: 0.82rem; }

/* ---------- .kpi-grid ------------------------------------------------------ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.75rem;
}

.kpi-grid-dense {
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
}

.kpi-grid-dense .stat {
  padding: 0.55rem 0.65rem;
  border-radius: 0.7rem;
}

/* ---------- .approval-action-block ----------------------------------------- */
.approval-action-block {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  background: var(--surface-alt, #f5f5f7);
  border-radius: 0.9rem;
  border: 1px solid var(--line, #e4e4e9);
}

.approval-action-heading {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #6e6e76);
  font-weight: 600;
}

/* W1.4.6 — the old twin-form layout was replaced by a single
   .approval-toggle-group div. These rules now style the shared
   textarea, the button pair, the arming state, and the committed
   lock state. */
.approval-action-note {
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.55rem;
  padding: 0.5rem 0.65rem;
  font: inherit;
  background: var(--surface, #fff);
  resize: vertical;
  min-height: 2.25rem;
}

.approval-action-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.approval-action-buttons button {
  appearance: none;
  border: 1px solid var(--ink, #1a1a1f);
  background: var(--ink, #1a1a1f);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 0.55rem;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 140ms ease;
}
.approval-action-buttons button:hover:not(:disabled) { transform: translateY(-1px); }
.approval-action-buttons button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.approval-action-approve {
  background: #0a7a3f;
  border-color: #0a7a3f;
}

.approval-action-reject {
  background: #b42318;
  border-color: #b42318;
}

/* Reject's 2-tap arming state mirrors the intake toggle's is-arming
   so the same pulse cue carries across dangerous actions. */
.approval-action-reject.is-arming {
  animation: approval-arm-pulse 0.9s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.4);
}
@keyframes approval-arm-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.35); }
  50%      { box-shadow: 0 0 0 5px rgba(180, 35, 24, 0.55); }
}

/* Committed block: dim + stop-interaction until the soft-reload lands. */
.approval-toggle-group.is-committed {
  opacity: 0.7;
  pointer-events: none;
}

.approval-action-status {
  min-height: 1.15em;
  margin: 0;
  font-size: 0.78rem;
}
.approval-action-status[data-tone="ok"]   { color: #0a7a3f; }
.approval-action-status[data-tone="warn"] { color: #c08a2b; }
.approval-action-status[data-tone="err"]  { color: #b42318; }

.approval-action-file {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted, #6e6e76);
  cursor: pointer;
}

.approval-action-file input[type="file"] { display: none; }

/* ---------- .queue-action-stack -------------------------------------------- */
.queue-action-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 11rem;
}

.queue-action-form {
  display: flex;
  gap: 0.35rem;
  margin: 0;
}

.queue-action-operator {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: var(--surface, #fff);
  font: inherit;
  font-size: 0.8rem;
}

.queue-action-btn {
  appearance: none;
  border: 1px solid var(--line, #e4e4e9);
  background: var(--surface, #fff);
  color: var(--ink, #1a1a1f);
  padding: 0.4rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.queue-action-btn.accept {
  background: var(--ink, #1a1a1f);
  color: #fff;
  border-color: var(--ink, #1a1a1f);
  width: 100%;
}

.queue-action-btn.accept:hover { opacity: 0.9; }

.queue-action-btn.assign:hover {
  background: var(--surface-alt, #f5f5f7);
  border-color: var(--ink, #1a1a1f);
}

/* ---------- .activity-feed ------------------------------------------------- */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-entry {
  display: flex;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.75rem;
}

.activity-entry-icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--surface-alt, #f5f5f7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.activity-entry-body {
  flex: 1;
  min-width: 0;
}

.activity-entry-meta {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.2rem;
}

.activity-entry-meta strong {
  font-size: 0.82rem;
  color: var(--ink, #1a1a1f);
}

.activity-entry-time {
  font-size: 0.7rem;
  color: var(--muted, #6e6e76);
}

.activity-entry-text {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink, #1a1a1f);
  word-break: break-word;
}

/* Threaded mode — left/right chat alignment for request_detail conversation */
.activity-feed-threaded .activity-entry {
  max-width: 82%;
}

/* ---------- .toggleable-form ----------------------------------------------- */
.toggleable-form {
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.75rem;
  background: var(--surface, #fff);
  overflow: hidden;
}

.toggleable-form-trigger {
  padding: 0.7rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink, #1a1a1f);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 120ms ease;
}

.toggleable-form-trigger::-webkit-details-marker { display: none; }

.toggleable-form-trigger::before {
  content: "+";
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted, #6e6e76);
}

.toggleable-form[open] .toggleable-form-trigger::before { content: "−"; }

.toggleable-form-trigger:hover { background: var(--surface-alt, #f5f5f7); }

.toggleable-form-body {
  padding: 0.9rem 0.95rem 1rem;
  border-top: 1px solid var(--line, #e4e4e9);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

/* =========================================================================
   W5.2 — SCHEDULE PAGE TILE ARCHITECTURE
   Tile grid for /schedule. Mirrors .inst-tiles rhythm but every tile is
   full-width (the schedule queue table is the dominant concern, so the
   filter/pills/bulk tiles stack above it rather than fight for column
   space).
   ========================================================================= */

.schedule-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  margin: 0 auto;
  max-width: 1400px;
  padding: 0 0.5rem;
}

.schedule-tiles > .tile {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
}

.schedule-tiles .tile > .section-head {
  margin-bottom: 0.75rem;
}

/* ---------- .tile-filters ------------------------------------------------- */
.tile-filters-body {
  display: grid;
  grid-template-columns: minmax(14rem, 2fr) repeat(4, minmax(8rem, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
}

.tile-filters-body label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--ink, #1a1a1f);
  min-width: 0;
}

.tile-filters-body label .hint {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #6e6e76);
  font-weight: 600;
}

.tile-filters-body input[type="text"],
.tile-filters-body input[type="date"],
.tile-filters-body select {
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.6rem;
  padding: 0.5rem 0.7rem;
  background: var(--surface, #fff);
  font: inherit;
  font-size: 0.85rem;
  min-width: 0;
  transition: border-color 120ms ease;
}

.tile-filters-body input:focus,
.tile-filters-body select:focus {
  outline: none;
  border-color: var(--ink, #1a1a1f);
}

.tile-filters-body .queue-search { grid-column: 1 / 2; }

@media (max-width: 1100px) {
  .tile-filters-body {
    grid-template-columns: 1fr 1fr;
  }
  .tile-filters-body .queue-search { grid-column: 1 / -1; }
}

/* ---------- .tile-pills ---------------------------------------------------- */
.tile-pills {
  /* The filter-pill-row inside breathes naturally; tile just gives padding */
}

/* ---------- .tile-bulk ---------------------------------------------------- */
.tile-bulk {
  border-color: #1a1a1f;
  box-shadow: 0 2px 12px rgba(26, 26, 31, 0.08);
  animation: tile-bulk-in 200ms ease;
}

@keyframes tile-bulk-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tile-bulk-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink, #1a1a1f);
  background: var(--surface-alt, #f5f5f7);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.tile-bulk-body {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem 1rem;
  margin: 0;
}

.tile-bulk-body label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  flex: 1 1 14rem;
  min-width: 0;
}

.tile-bulk-body label .hint {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #6e6e76);
  font-weight: 600;
}

.tile-bulk-body select {
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.6rem;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
  background: var(--surface, #fff);
}

.tile-bulk-body button {
  align-self: end;
  white-space: nowrap;
}

/* ---------- .tile-queue-schedule ------------------------------------------ */
.tile-queue-schedule .view-toggle-group {
  display: inline-flex;
  background: var(--surface-alt, #f5f5f7);
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.15rem;
}

.tile-queue-schedule .view-toggle {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted, #6e6e76);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.tile-queue-schedule .view-toggle:hover { color: var(--ink, #1a1a1f); }

.tile-queue-schedule .view-toggle-active {
  background: var(--surface, #fff);
  color: var(--ink, #1a1a1f);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tile-queue-schedule .col-select-head,
.tile-queue-schedule .col-select-cell {
  width: 2rem;
  text-align: center;
  padding-left: 0.5rem;
  padding-right: 0;
}

.tile-queue-schedule .col-select-cell input[type="checkbox"],
.tile-queue-schedule .col-select-head input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: #1a1a1f;
}

.tile-queue-schedule #centralQueueTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.tile-queue-schedule #centralQueueTable thead th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #6e6e76);
  font-weight: 600;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line, #e4e4e9);
}

.tile-queue-schedule #centralQueueTable tbody td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--line-soft, #ececf0);
  vertical-align: top;
}

.tile-queue-schedule #centralQueueTable tbody tr:hover td {
  background: var(--surface-alt, #f5f5f7);
}

.tile-queue-schedule #centralQueueTable tbody tr.queue-row-focus td {
  background: rgba(10, 122, 63, 0.06);
  border-left: 3px solid #0a7a3f;
}

.tile-queue-schedule .queue-compact tbody td {
  padding: 0.4rem 0.5rem;
  font-size: 0.78rem;
}

@media (max-width: 1200px) {
  .schedule-tiles { grid-template-columns: repeat(4, 1fr); }
  .schedule-tiles > .tile { grid-column: span 4; }
}

@media (max-width: 760px) {
  .schedule-tiles { grid-template-columns: 1fr; padding: 0; }
  .schedule-tiles > .tile { grid-column: span 1; }
  .tile-queue-schedule #centralQueueTable thead { display: none; }
  .tile-queue-schedule #centralQueueTable tbody td { padding: 0.5rem 0.4rem; }
}

/* =========================================================================
   W5.3 — REQUEST DETAIL TILE ARCHITECTURE
   Drops the .request-workspace 2-col sticky layout in favour of a fluid
   6-column grid. Header + activity tiles span the full row; meta / actions /
   approvals / files stack into half-row tiles.
   ========================================================================= */

.request-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  margin: 0 auto;
  max-width: 1400px;
  padding: 0 0.5rem;
  align-items: start;
}

.request-tiles > .tile {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
}

.request-tiles > .tile-request-header,
.request-tiles > .tile-request-events {
  grid-column: span 6;
}

.request-tiles .tile > .section-head {
  margin-bottom: 0.75rem;
}

/* ---------- .tile-request-header ------------------------------------------ */
.tile-request-header-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tile-request-header-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tile-request-header-note {
  margin: 0;
  padding: 0.55rem 0.75rem;
  background: var(--surface-alt, #f5f5f7);
  border-radius: 0.55rem;
  font-size: 0.8rem;
}

/* ---------- .tile-request-meta -------------------------------------------- */
.tile-request-meta .meta-grid {
  margin-bottom: 0.75rem;
}

.tile-request-note-block {
  padding: 0.65rem 0.8rem;
  border-radius: 0.6rem;
  background: var(--surface-alt, #f5f5f7);
  border: 1px solid var(--line, #e4e4e9);
  margin-top: 0.65rem;
}

.tile-request-note-block strong {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink, #1a1a1f);
}

.tile-request-note-block p {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink, #1a1a1f);
  white-space: pre-wrap;
}

.tile-request-note-block.final-remark,
.tile-request-note-block.final-result {
  background: #f1f7f3;
  border-color: #c9e4d4;
}

/* ---------- .tile-request-actions ----------------------------------------- */
.tile-request-actions-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tile-request-actions-body .action-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tile-request-actions-body .action-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted, #6e6e76);
}

.tile-request-actions-body .action-form input[type="text"],
.tile-request-actions-body .action-form input[type="datetime-local"],
.tile-request-actions-body .action-form select,
.tile-request-actions-body .action-form textarea {
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.55rem;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  background: var(--surface, #fff);
}

.tile-request-actions-body .action-form button {
  align-self: flex-start;
}

/* ---------- .tile-request-approvals --------------------------------------- */
.tile-request-approvals-actionable {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.tile-request-approvals-actionable > .hint {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink, #1a1a1f);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- .tile-request-files ------------------------------------------- */
.tile-request-files .file-link-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.tile-request-files .file-link-table tbody td {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--line-soft, #ececf0);
}

/* ---------- .tile-request-events ------------------------------------------ */
.tile-request-events .activity-feed {
  padding: 0.25rem 0;
}

.tile-request-events .activity-entry-files {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.tile-request-events .activity-entry-files a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.tile-request-events .event-attachment-tag {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 0.3rem;
  background: var(--surface-alt, #f5f5f7);
  color: var(--muted, #6e6e76);
  letter-spacing: 0.05em;
}

.tile-request-events .input-dialog {
  margin-top: 0.5rem;
}

@media (max-width: 1200px) {
  .request-tiles { grid-template-columns: repeat(4, 1fr); }
  .request-tiles > .tile { grid-column: span 4; }
  .request-tiles > .tile-request-meta,
  .request-tiles > .tile-request-actions,
  .request-tiles > .tile-request-approvals,
  .request-tiles > .tile-request-files { grid-column: span 2; }
}

@media (max-width: 760px) {
  .request-tiles { grid-template-columns: 1fr; padding: 0; }
  .request-tiles > .tile,
  .request-tiles > .tile-request-meta,
  .request-tiles > .tile-request-actions,
  .request-tiles > .tile-request-approvals,
  .request-tiles > .tile-request-files { grid-column: span 1; }
}

/* =========================================================================
   W5.4 — DASHBOARD TILE ARCHITECTURE
   Drops .grid-two + .instrument-carousel. Dashboard now lives on the same
   6-column fluid grid as every other page. Metrics stack into half-row
   tiles; quick-intake + instrument-queues span full width.
   ========================================================================= */

.dashboard-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  margin: 0 auto;
  max-width: 1400px;
  padding: 0 0.5rem;
  align-items: start;
}

.dashboard-tiles > .tile {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
}

.dashboard-tiles > .tile-dash-quick-intake,
.dashboard-tiles > .tile-dash-instrument-queues {
  grid-column: span 6;
}

.dashboard-tiles .tile > .section-head {
  margin-bottom: 0.75rem;
}

/* ---------- .tile-dash-role-hint / .tile-sitemap-role-hint ---------------- */
.tile-dash-role-hint,
.tile-sitemap-role-hint {
  grid-column: 1 / -1;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg, rgba(80, 120, 220, 0.08), rgba(80, 120, 220, 0.02));
  border-left: 3px solid rgba(80, 120, 220, 0.55);
}

.tile-sitemap-role-hint {
  margin-bottom: 1rem;
}

.role-hint-body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.role-hint-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  background: rgba(80, 120, 220, 0.18);
  color: rgba(30, 50, 120, 1);
  border-radius: 999px;
  white-space: nowrap;
}

.role-hint-text {
  font-size: 0.9rem;
  color: var(--text-muted, #555);
}

/* ---------- .tile-dash-week / .tile-dash-month ---------------------------- */
.tile-dash-week .chart-list,
.tile-dash-month .chart-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.tile-dash-week .kpi-grid,
.tile-dash-month .kpi-grid {
  margin-bottom: 0.5rem;
}

.tile-dash-week .section-collapse-btn,
.tile-dash-month .section-collapse-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.5rem;
  padding: 0.25rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted, #6e6e76);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.tile-dash-week .section-collapse-btn:hover,
.tile-dash-month .section-collapse-btn:hover {
  background: var(--surface-alt, #f5f5f7);
  color: var(--ink, #1a1a1f);
}

/* ---------- .tile-dash-quick-intake --------------------------------------- */
.tile-dash-quick-intake .quick-intake-search {
  display: block;
  margin-bottom: 0.6rem;
}

.tile-dash-quick-intake .quick-intake-search input {
  width: 100%;
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.6rem;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  background: var(--surface, #fff);
  transition: border-color 120ms ease;
}

.tile-dash-quick-intake .quick-intake-search input:focus {
  outline: none;
  border-color: var(--ink, #1a1a1f);
}

.tile-dash-quick-intake .quick-intake-table {
  width: 100%;
  border-collapse: collapse;
}

.tile-dash-quick-intake .quick-intake-table tbody td {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line-soft, #ececf0);
}

.tile-dash-quick-intake .quick-intake-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.tile-dash-quick-intake .quick-intake-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 14rem;
}

.tile-dash-quick-intake .quick-intake-content strong {
  font-size: 0.88rem;
  color: var(--ink, #1a1a1f);
}

.tile-dash-quick-intake .quick-intake-content span {
  font-size: 0.8rem;
  color: var(--muted, #6e6e76);
}

.tile-dash-quick-intake .quick-intake-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ---------- .tile-dash-instrument-queues ---------------------------------- */
.tile-dash-instrument-queues .dash-instrument-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.tile-dash-instrument-queues .dash-instrument-card {
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: var(--surface, #fff);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.tile-dash-instrument-queues .dash-instrument-card-head strong {
  font-size: 0.88rem;
  color: var(--ink, #1a1a1f);
}

.tile-dash-instrument-queues .dash-instrument-queue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.tile-dash-instrument-queues .dash-instrument-queue-table thead th {
  text-align: left;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #6e6e76);
  font-weight: 600;
  padding: 0.35rem 0.35rem 0.3rem 0;
  border-bottom: 1px solid var(--line, #e4e4e9);
}

.tile-dash-instrument-queues .dash-instrument-queue-table tbody td {
  padding: 0.4rem 0.35rem 0.4rem 0;
  border-bottom: 1px solid var(--line-soft, #ececf0);
  vertical-align: top;
}

.tile-dash-instrument-queues .dash-instrument-queue-table tbody tr:last-child td {
  border-bottom: none;
}

.tile-dash-instrument-queues .dash-instrument-queue-table tr.overflow-indicator td {
  padding-top: 0.45rem;
  text-align: right;
  font-size: 0.72rem;
}

.tile-dash-instrument-queues .dash-instrument-overflow {
  margin-top: 0.85rem;
  text-align: right;
  font-size: 0.78rem;
}

/* ---------- .tile-dash-downtime ------------------------------------------- */
.tile-dash-downtime .downtime-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tile-dash-downtime .downtime-item {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.55rem;
  background: var(--surface-alt, #f5f5f7);
}

.tile-dash-downtime .downtime-dates {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.82rem;
  color: var(--ink, #1a1a1f);
  flex-wrap: wrap;
}

.tile-dash-downtime .downtime-dates strong {
  color: var(--ink, #1a1a1f);
}

/* ---------- .tile-dash-your-jobs ------------------------------------------ */
.tile-dash-your-jobs .link-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 1200px) {
  .dashboard-tiles { grid-template-columns: repeat(4, 1fr); }
  .dashboard-tiles > .tile { grid-column: span 2; }
  .dashboard-tiles > .tile-dash-quick-intake,
  .dashboard-tiles > .tile-dash-instrument-queues { grid-column: span 4; }
  .tile-dash-instrument-queues .dash-instrument-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .dashboard-tiles { grid-template-columns: 1fr; padding: 0; }
  .dashboard-tiles > .tile,
  .dashboard-tiles > .tile-dash-quick-intake,
  .dashboard-tiles > .tile-dash-instrument-queues { grid-column: span 1; }
  .tile-dash-instrument-queues .dash-instrument-grid { grid-template-columns: 1fr; }
  .tile-dash-quick-intake .quick-intake-block { flex-direction: column; align-items: flex-start; }
}

/* =========================================================================
   W5.5 — STATS PAGE TILE ARCHITECTURE
   Drops .grid-two + bespoke stats-left-column / stats-right-column split.
   Every concern on /stats is now a tile on the same 6-col fluid grid as
   every other page. Charts size themselves inside chart-container boxes.
   ========================================================================= */

.stats-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  margin: 0 auto;
  max-width: 1400px;
  padding: 0 0.5rem;
  align-items: start;
}

.stats-tiles > .tile {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
}

/* Full-width tiles */
.stats-tiles > .tile-stats-header,
.stats-tiles > .tile-stats-counters,
.stats-tiles > .tile-stats-inst-board,
.stats-tiles > .tile-stats-export {
  grid-column: span 6;
}

/* Trend chart gets the extra width to breathe */
.stats-tiles > .tile-stats-trend { grid-column: span 4; }
.stats-tiles > .tile-stats-status { grid-column: span 2; }

.stats-tiles .tile > .section-head {
  margin-bottom: 0.75rem;
}

/* ---------- .tile-stats-header -------------------------------------------- */
.tile-stats-header-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tile-stats-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tile-stats-title h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink, #1a1a1f);
}

.tile-stats-subtitle {
  color: var(--muted, #6e6e76);
  font-size: 0.82rem;
}

.tile-stats-filters {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tile-stats-header .warroom-pulse {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #0a7a3f;
  box-shadow: 0 0 0 0 rgba(10, 122, 63, 0.5);
  animation: stats-pulse 2s infinite;
}

@keyframes stats-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(10, 122, 63, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(10, 122, 63, 0); }
  100% { box-shadow: 0 0 0 0 rgba(10, 122, 63, 0); }
}

/* ---------- .tile-stats-counters ------------------------------------------ */
.tile-stats-counters .kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.6rem;
}

/* ---------- chart containers ---------------------------------------------- */
.stats-tiles .chart-container {
  position: relative;
  min-height: 15rem;
  height: 18rem;
}

.stats-tiles .tile-stats-trend .chart-container {
  height: 22rem;
}

.stats-tiles .chart-container-doughnut {
  position: relative;
  min-height: 16rem;
  height: 20rem;
}

.stats-tiles .warroom-select {
  appearance: none;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.55rem;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  color: var(--ink, #1a1a1f);
  cursor: pointer;
}

/* ---------- .tile-stats-bottlenecks / .tile-stats-activity ---------------- */
.tile-stats-bottlenecks .warroom-alert-list,
.tile-stats-activity .warroom-feed {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tile-stats-bottlenecks .warroom-alert-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0.7rem;
  border: 1px solid #f0c3be;
  border-left-width: 3px;
  border-radius: 0.55rem;
  background: #fdf2f0;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tile-stats-bottlenecks .warroom-alert-metric {
  font-size: 0.78rem;
  color: var(--muted, #6e6e76);
}

.tile-stats-activity .warroom-feed-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line, #e4e4e9);
  border-radius: 0.55rem;
  background: var(--surface, #fff);
}

.tile-stats-activity .warroom-feed-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  padding: 0.15rem 0.45rem;
}

.tile-stats-activity .warroom-feed-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tile-stats-activity .warroom-feed-detail strong {
  font-size: 0.82rem;
  color: var(--ink, #1a1a1f);
}

.tile-stats-activity .warroom-feed-detail small {
  font-size: 0.72rem;
  color: var(--muted, #6e6e76);
}

.tile-stats-activity .warroom-feed-time {
  font-size: 0.7rem;
  color: var(--muted, #6e6e76);
  flex-shrink: 0;
}

/* ---------- .tile-stats-inst-board ---------------------------------------- */
.tile-stats-inst-board .warroom-instrument-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem;
}

/* ---------- .tile-stats-export -------------------------------------------- */
.tile-stats-export .stats-export-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tile-stats-export .stats-export-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.7rem;
  font-size: 0.78rem;
}

@media (max-width: 1200px) {
  .stats-tiles { grid-template-columns: repeat(4, 1fr); }
  .stats-tiles > .tile { grid-column: span 2; }
  .stats-tiles > .tile-stats-header,
  .stats-tiles > .tile-stats-counters,
  .stats-tiles > .tile-stats-inst-board,
  .stats-tiles > .tile-stats-export { grid-column: span 4; }
  .stats-tiles > .tile-stats-trend { grid-column: span 4; }
  .stats-tiles > .tile-stats-status { grid-column: span 2; }
}

@media (max-width: 760px) {
  .stats-tiles { grid-template-columns: 1fr; padding: 0; }
  .stats-tiles > .tile,
  .stats-tiles > .tile-stats-header,
  .stats-tiles > .tile-stats-counters,
  .stats-tiles > .tile-stats-inst-board,
  .stats-tiles > .tile-stats-export,
  .stats-tiles > .tile-stats-trend,
  .stats-tiles > .tile-stats-status { grid-column: span 1; }
  .stats-tiles .chart-container { height: 14rem; }
  .stats-tiles .tile-stats-trend .chart-container { height: 16rem; }
}

/* ────────────────────────────────────────────────────────────────────
   W5.6 — secondary pages tile grids (pending, users, finance,
   instruments, calendar). Each page gets its own `.{name}-tiles`
   container following the same 6-col → 4-col → 1-col reflow rhythm.
   ──────────────────────────────────────────────────────────────────── */

/* pending.html — 3 tiles: viewer (6) / approval (3) / own (3) */
.pending-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  padding: 0 0.5rem;
}

@media (max-width: 1200px) {
  .pending-tiles { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 760px) {
  .pending-tiles { grid-template-columns: 1fr; padding: 0; }
}

/* users.html — 4 tiles: create (2) / members (4) / admins (3) / owners (3) */
.users-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  padding: 0 0.5rem;
}
.users-tiles > .tile-users-create { grid-column: span 2; }
.users-tiles > .tile-users-members { grid-column: span 4; }
.users-tiles > .tile-users-admins { grid-column: span 3; }
.users-tiles > .tile-users-owners { grid-column: span 3; }

@media (max-width: 1200px) {
  .users-tiles { grid-template-columns: repeat(4, 1fr); }
  .users-tiles > .tile-users-create { grid-column: span 4; }
  .users-tiles > .tile-users-members { grid-column: span 4; }
  .users-tiles > .tile-users-admins,
  .users-tiles > .tile-users-owners { grid-column: span 2; }
}
@media (max-width: 760px) {
  .users-tiles { grid-template-columns: 1fr; padding: 0; }
  .users-tiles > .tile { grid-column: span 1; }
  .users-tiles > .tile-users-create,
  .users-tiles > .tile-users-members,
  .users-tiles > .tile-users-admins,
  .users-tiles > .tile-users-owners { grid-column: span 1; }
}

/* finance.html — 6 tiles: header (6) / budgets (6) / by-instrument (6) /
   monthly (3) / recent (3) / activity (6) */
.finance-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  padding: 0 0.5rem;
}
.finance-tiles .chart-container { height: 18rem; position: relative; }

@media (max-width: 1200px) {
  .finance-tiles { grid-template-columns: repeat(4, 1fr); }
  .finance-tiles > .tile { grid-column: span 4; }
}
@media (max-width: 760px) {
  .finance-tiles { grid-template-columns: 1fr; padding: 0; }
  .finance-tiles > .tile { grid-column: span 1; }
  .finance-tiles .chart-container { height: 14rem; }
}

/* instruments.html — 3 tiles: header (6) / active (6) / archived (6) */
.instruments-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  padding: 0 0.5rem;
}
.instruments-tiles > .tile-inst-header { grid-column: span 6; }
.instruments-tiles > .tile-inst-active { grid-column: span 6; }
.instruments-tiles > .tile-inst-archived { grid-column: span 6; }

@media (max-width: 1200px) {
  .instruments-tiles { grid-template-columns: repeat(4, 1fr); }
  .instruments-tiles > .tile { grid-column: span 4; }
}
@media (max-width: 760px) {
  .instruments-tiles { grid-template-columns: 1fr; padding: 0; }
  .instruments-tiles > .tile { grid-column: span 1; }
}

/* calendar.html — 2 tiles: filters (6) / grid (6) */
.calendar-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  padding: 0 0.5rem;
}
.calendar-tiles > .tile-cal-filters { grid-column: span 6; }
.calendar-tiles > .tile-cal-grid { grid-column: span 6; }
.calendar-tiles .filter-pill-row + .filter-pill-row { margin-top: 0.5rem; }
.calendar-tiles .calendar-operator-form {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.calendar-tiles .calendar-operator-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

@media (max-width: 1200px) {
  .calendar-tiles { grid-template-columns: repeat(4, 1fr); }
  .calendar-tiles > .tile { grid-column: span 4; }
}
@media (max-width: 760px) {
  .calendar-tiles { grid-template-columns: 1fr; padding: 0; }
  .calendar-tiles > .tile { grid-column: span 1; }
}

/* ────────────────────────────────────────────────────────────────────
   W5.7 — straggler page tile grids (visualization, user_detail).
   These pages aren't in the 12-page audit but they still need to
   share the same fluid rhythm so the retiring .grid-two / .stats-kpi-row
   blocks can be fully purged below.
   ──────────────────────────────────────────────────────────────────── */

/* visualization.html — 8 possible tiles (scope_kind conditional) */
.viz-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  padding: 0 0.5rem;
}
.viz-tiles > .tile-viz-filters { grid-column: span 3; }
.viz-tiles > .tile-viz-export { grid-column: span 3; }
.viz-tiles > .tile-viz-kpis { grid-column: span 6; }
.viz-tiles > .tile-viz-daily { grid-column: span 3; }
.viz-tiles > .tile-viz-monthly { grid-column: span 3; }
.viz-tiles > .tile-viz-by-instrument { grid-column: span 3; }
.viz-tiles > .tile-viz-by-group { grid-column: span 3; }
.viz-tiles > .tile-viz-weekly-table { grid-column: span 3; }
.viz-tiles > .tile-viz-instrument-table { grid-column: span 3; }

@media (max-width: 1200px) {
  .viz-tiles { grid-template-columns: repeat(4, 1fr); }
  .viz-tiles > .tile { grid-column: span 2; }
  .viz-tiles > .tile-viz-kpis { grid-column: span 4; }
}
@media (max-width: 760px) {
  .viz-tiles { grid-template-columns: 1fr; padding: 0; }
  .viz-tiles > .tile { grid-column: span 1; }
  .viz-tiles > .tile-viz-kpis { grid-column: span 1; }
}

/* user_detail.html — 2 tiles: meta (3) / work (3) */
.user-detail-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
  padding: 0 0.5rem;
}
.user-detail-tiles > .tile-user-meta { grid-column: span 3; }
.user-detail-tiles > .tile-user-work { grid-column: span 3; }

@media (max-width: 1200px) {
  .user-detail-tiles { grid-template-columns: repeat(4, 1fr); }
  .user-detail-tiles > .tile-user-meta,
  .user-detail-tiles > .tile-user-work { grid-column: span 2; }
}
@media (max-width: 760px) {
  .user-detail-tiles { grid-template-columns: 1fr; padding: 0; }
  .user-detail-tiles > .tile-user-meta,
  .user-detail-tiles > .tile-user-work { grid-column: span 1; }
}

/* ── REQUEST DETAIL — sample-approval explainer tile (v1.3.0) ── */
.tile-request-explainer { grid-column: span 6; }
@media (max-width: 960px) {
  .tile-request-explainer { grid-column: 1 / -1; }
}
.explainer-details { margin: 0.3rem 0 0; }
.explainer-details > summary { cursor: pointer; font-weight: 600; padding: 0.3rem 0; list-style: none; }
.explainer-details > summary::-webkit-details-marker { display: none; }
.explainer-details > summary::before { content: "▸ "; display: inline-block; transition: transform 0.15s ease; }
.explainer-details[open] > summary::before { content: "▾ "; }
.explainer-steps { margin: 0.5rem 0 0.3rem 1.2rem; padding: 0; }
.explainer-steps > li { font-size: 0.88rem; line-height: 1.5; padding: 0.2rem 0; }
.explainer-steps strong { color: var(--accent, #4c6ef5); }

/* ── DEV CONSOLE (owner-only /admin/dev_panel) ── */
.dp-todo-list { list-style: none; padding: 0; margin: 0.25rem 0 0.75rem; }
.dp-todo-item { display: flex; gap: 0.4rem; padding: 0.15rem 0; font-size: 0.85rem; }
.dp-todo-done { opacity: 0.55; text-decoration: line-through; }
.dp-todo-mark { display: inline-block; width: 1.1rem; text-align: center; opacity: 0.7; }
.dp-doc-wrap { max-height: 22rem; border: 1px solid var(--border, #d0d4dc); border-radius: 8px; background: var(--surface-2, #f6f7fa); }
.dp-doc { margin: 0; padding: 0.7rem 0.9rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; max-height: 22rem; overflow-y: auto; }
.dp-doc-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.dp-doc-tab { padding: 0.25rem 0.6rem; border: 1px solid var(--border, #d0d4dc); background: transparent; border-radius: 6px; cursor: pointer; font-size: 0.78rem; }
.dp-doc-tab-active { background: var(--accent, #4c6ef5); color: #fff; border-color: var(--accent, #4c6ef5); }
.dp-commit-list { list-style: none; padding: 0; margin: 0; }
.dp-commit-row { display: flex; gap: 0.5rem; padding: 0.2rem 0; font-size: 0.82rem; align-items: baseline; }
.dp-metadata-row { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.2rem 0; font-size: 0.85rem; }
.dp-bridge-detail { margin: 0.1rem 0 0.5rem; font-size: 0.75rem; }
.dp-wave-list { list-style: none; padding: 0; margin: 0.25rem 0 0.25rem; }
.dp-wave-row { display: grid; grid-template-columns: 1rem 4.5rem 1.2rem 5rem 1fr; align-items: baseline; gap: 0.45rem; padding: 0.18rem 0; font-size: 0.8rem; border-bottom: 1px dashed var(--border, #e4e6ec); }
.dp-wave-row:last-child { border-bottom: 0; }
.dp-wave-mark { text-align: center; opacity: 0.75; font-weight: 600; }
.dp-wave-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; }
.dp-wave-track { display: inline-block; text-align: center; border-radius: 999px; background: var(--surface-2, #f0f2f7); font-size: 0.7rem; padding: 0 0.35rem; opacity: 0.85; }
.dp-wave-est { opacity: 0.7; font-size: 0.75rem; }
.dp-wave-tag { justify-self: end; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; opacity: 0.65; }
.dp-wave-shipped { opacity: 0.55; }
.dp-wave-shipped .dp-wave-id { text-decoration: line-through; }
.dp-wave-hot { background: linear-gradient(90deg, rgba(76,110,245,0.14), transparent); border-left: 3px solid var(--accent, #4c6ef5); padding-left: 0.35rem; }
.dp-wave-hot .dp-wave-mark { color: var(--accent, #4c6ef5); }
.dp-wave-hot .dp-wave-id { color: var(--accent, #4c6ef5); }
.dp-wave-hot-pill {
  justify-self: end;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--accent, #4c6ef5);
  color: #fff;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  animation: dp-wave-hot-pulse 1.8s ease-in-out infinite;
}
@keyframes dp-wave-hot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent, #4c6ef5) 45%, transparent); }
  50%      { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #4c6ef5) 0%, transparent); }
}
.dp-commit-when { margin-left: auto; font-size: 0.72rem; opacity: 0.7; }

/* W1.4.3 c2 — Dev panel "Now Shipping" hero tile. */
.tile-dev-now-shipping {
  grid-column: 1 / -1;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent, #4c6ef5) 6%, var(--panel)),
    var(--panel));
  border-left: 3px solid var(--accent, #4c6ef5);
}
.dev-now-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-top: 0.35rem;
}
.dev-now-cell {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-md, 8px);
  background: var(--panel);
  border: 1px solid var(--line, rgba(0,0,0,0.08));
}
.dev-now-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.dev-now-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}
.dev-now-hot-value { color: var(--accent, #4c6ef5); }
.dev-now-reports-fresh { color: #2f9e44; }
.dev-now-reports-ok    { color: var(--ink); }
.dev-now-reports-stale { color: #c34a4a; }
.dev-now-pipeline { margin-top: 0.65rem; }
.dp-crawler-list { list-style: none; padding: 0; margin: 0; }

/* 2026-04-11 — Dev panel Stable Release + Latest Shipped tiles.
   Two side-by-side sibling tiles (spans 3 each) that sit above the
   "Now Shipping" hero. Answer the three-panel question per the
   operator spec: current stable tag / git pane / latest shipped. */
.tile-dev-stable-release,
.tile-dev-latest-shipped,
.tile-dev-future-fixes {
  grid-column: span 3;
}
@media (max-width: 1200px) {
  .tile-dev-stable-release,
  .tile-dev-latest-shipped,
  .tile-dev-future-fixes { grid-column: span 4; }
}
@media (max-width: 760px) {
  .tile-dev-stable-release,
  .tile-dev-latest-shipped,
  .tile-dev-future-fixes { grid-column: 1 / -1; }
}

/* 2026-04-11 — v1.5.0 pre-seed future-fixes counter tile.
   Same recipe as the stable-release / latest-shipped pair:
   accent left border, subtle gradient, big headline total. */
.tile-dev-future-fixes {
  background: linear-gradient(135deg,
    color-mix(in srgb, #e8590c 6%, var(--panel)),
    var(--panel));
  border-left: 3px solid #e8590c;
}
.dev-future-fixes-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.dev-future-fixes-total {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.1;
  color: #e8590c;
  font-variant-numeric: tabular-nums;
}
.dev-future-fixes-label {
  font-size: 0.85rem;
}
.dev-future-fixes-depth {
  margin: 0.15rem 0 0 0;
}

/* v1.5.0 — PROJECT TIMELINE tile (Mission Control feel).
   Full-width tile spanning the inst-tiles grid, with per-line
   groupings of every shipped tag and a "LATEST" chip on the tip
   of the chain. */
.tile-dev-timeline {
  grid-column: 1 / -1;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent, #4c6ef5) 4%, var(--panel)),
    var(--panel));
  border-left: 3px solid var(--accent, #4c6ef5);
}
.dev-timeline-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 0.5rem;
}
.dev-timeline-line-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.08));
}
.dev-timeline-line-head strong {
  font-size: 0.9rem;
  color: var(--accent, #4c6ef5);
  letter-spacing: 0.02em;
}
.dev-timeline-line-head .hint {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dev-timeline-list {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}
.dev-timeline-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: var(--panel-soft, rgba(0,0,0,0.02));
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-radius: var(--radius-md, 8px);
  font-size: 0.82rem;
}
.dev-timeline-item-latest {
  background: color-mix(in srgb, var(--accent, #4c6ef5) 10%, var(--panel));
  border-color: var(--accent, #4c6ef5);
  box-shadow: 0 0 0 1px var(--accent, #4c6ef5) inset;
}
.dev-timeline-tag {
  font-weight: 600;
}
.dev-timeline-date {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.dev-timeline-latest-chip {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm, 6px);
  background: var(--accent, #4c6ef5);
  color: #fff;
}

.tile-dev-stable-release {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent, #4c6ef5) 8%, var(--panel)),
    var(--panel));
  border-left: 3px solid var(--accent, #4c6ef5);
}
.dev-stable-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.dev-stable-tag {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent, #4c6ef5);
  font-variant-numeric: tabular-nums;
}
.dev-stable-meta {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: baseline;
}
.dev-stable-subject {
  margin: 0.15rem 0 0 0;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.35;
}
.dev-stable-depth {
  margin: 0.15rem 0 0 0;
}

.tile-dev-latest-shipped {
  background: linear-gradient(135deg,
    color-mix(in srgb, #2f9e44 5%, var(--panel)),
    var(--panel));
  border-left: 3px solid #2f9e44;
}
.dev-shipped-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.dev-shipped-subject {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
.dev-shipped-meta {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: baseline;
  font-size: 0.82rem;
}
.dev-shipped-depth {
  margin: 0.15rem 0 0 0;
}

/* ──────────────────────────────────────────────────────────────────── */
/* UNIVERSAL TILE GRIDS — v1.3.1                                        */
/* Every page-level layout shares the same 6-column fluid grid as       */
/* .inst-tiles. The philosophy crawler enforces that every template     */
/* uses one of these; we alias the common "small page" cases onto it    */
/* so we never ship a second grid engine.                               */
/* ──────────────────────────────────────────────────────────────────── */
.activate-tiles,
.docs-tiles,
.portfolio-tiles,
.stats-tiles,
.schedule-tiles,
.calendar-tiles,
.admin-tiles,
.profile-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  grid-auto-flow: row dense;
}

/* Small form / info pages: the single centred card spans 4 columns */
/* on wide screens and fills the grid on narrow ones. */
.tile-activate,
.tile-form {
  grid-column: 2 / span 4;
  max-width: 640px;
  justify-self: center;
  width: 100%;
}
@media (max-width: 960px) {
  .tile-activate,
  .tile-form { grid-column: 1 / -1; }
}

/* Docs page: header tile is full-width, progress + body split 2/4. */
.tile-docs-header { grid-column: 1 / -1; }
.tile-docs-progress { grid-column: span 2; }
.tile-docs-body { grid-column: span 4; }
@media (max-width: 960px) {
  .tile-docs-progress,
  .tile-docs-body { grid-column: 1 / -1; }
}

/* Portfolio forecast chip — dynamic --chip-bg comes from the template. */
.portfolio-forecast-chip {
  background: var(--chip-bg, var(--accent, #4c6ef5));
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  display: inline-block;
  white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────────────── */
/* Portfolio ACTIONS card — three-column PENDING/SELL/BUY hero.         */
/* Extracted from inline styles in portfolio.html to satisfy the        */
/* philosophy "no raw color literals in templates" rule (W1.4.5).       */
/* Semantic colour vars live here so the template never mentions hex.   */
/* ──────────────────────────────────────────────────────────────────── */
:root {
  --pf-buy: #3aa86b;
  --pf-buy-soft: rgba(58, 168, 107, 0.05);
  --pf-sell: #a37b00;
  --pf-sell-soft: rgba(163, 123, 0, 0.04);
  --pf-sell-banner: rgba(163, 123, 0, 0.08);
  --pf-pending: #3a76a8;
  --pf-col-line: #e6e8ec;
  --pf-footer-bg: #f6f7f9;
  --pf-dim-1: #666;
  --pf-dim-2: #888;
  --pf-body: #444;
}
:root[data-theme="dark"] {
  --pf-col-line: #2c3340;
  --pf-footer-bg: #1d242d;
  --pf-dim-1: #a4b0bc;
  --pf-dim-2: #8692a0;
  --pf-body: #cfd6e1;
}

.pf-weekend-banner {
  border-left: 4px solid var(--pf-sell);
  background: var(--pf-sell-banner);
}
.pf-weekend-banner p { margin: 6px 0; }

.pf-actions-card {
  border: 2px solid var(--pf-buy);
  padding: 0;
  overflow: hidden;
}
.pf-actions-header {
  background: var(--pf-buy);
  color: #fff;
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.pf-actions-title {
  font-size: 15px;
  letter-spacing: 0.04em;
}
.pf-actions-cutoff {
  font-size: 12px;
  opacity: 0.92;
}
.pf-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
}
.pf-actions-col {
  padding: 16px 18px;
}
.pf-actions-col-pending {
  border-right: 1px solid var(--pf-col-line);
}
.pf-actions-col-sell {
  border-right: 1px solid var(--pf-col-line);
  background: var(--pf-sell-soft);
}
.pf-actions-col-buy {
  background: var(--pf-buy-soft);
}
.pf-actions-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--pf-dim-2);
  margin-bottom: 6px;
}
.pf-actions-amt {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.pf-actions-amt-pending {
  font-size: 22px;
  color: var(--pf-pending);
}
.pf-actions-amt-sell   { color: var(--pf-sell); }
.pf-actions-amt-buy    { color: var(--pf-buy); }
.pf-actions-amt-paused {
  font-size: 22px;
  color: var(--pf-pending);
}
.pf-actions-sub {
  font-size: 13px;
  color: var(--pf-body);
  margin: 6px 0;
}
.pf-actions-note {
  font-size: 12px;
  color: var(--pf-dim-1);
}
.pf-actions-hint {
  font-size: 11px;
  color: var(--pf-dim-2);
  margin-top: 6px;
}
.pf-actions-footer {
  background: var(--pf-footer-bg);
  border-top: 1px solid var(--pf-col-line);
  padding: 8px 18px;
  font-size: 11px;
  color: var(--pf-dim-1);
}
.pf-pending-row { margin-bottom: 10px; }
.pf-leg-table {
  width: 100%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.pf-leg-table td {
  padding: 1px 0;
  border: 0;
}
.pf-leg-table td.amt { text-align: right; }

/* Calendar explainer inline tokens — keep the SELL/BUY colour pairing
   consistent with the ACTIONS card above. */
.pf-side-sell { color: var(--pf-sell); }
.pf-side-buy  { color: var(--pf-buy); }

/* LLM commentary stale state — dimmed card. */
.pf-commentary-stale { opacity: 0.65; }

/* W1.4.1 c3 — keyboard-shortcut help overlay (triggered by "?"). */
.keybind-help {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.keybind-help[hidden] { display: none; }
.keybind-help-card {
  background: var(--bg-card, #fff);
  color: var(--text);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 1.5rem 1.75rem;
  min-width: 320px;
  max-width: 440px;
}
.keybind-help-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}
.keybind-help-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  margin: 0 0 1rem;
}
.keybind-help-card dt { font-weight: 600; }
.keybind-help-card kbd {
  font-family: var(--font-mono, ui-monospace, monospace);
  background: var(--chip-bg, rgba(0, 0, 0, 0.06));
  border: 1px solid var(--border, rgba(0, 0, 0, 0.15));
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  font-size: 0.85rem;
}

/* Requester pulse tile */
.tile-req-pulse .req-pulse-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.req-pulse-cell { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.5rem 0.65rem; border-radius: 0.55rem; background: var(--surface-2, #f5f5f7); }
.req-pulse-label { font-size: 0.72rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; }
.req-pulse-value { font-size: 1.4rem; font-weight: 600; }
.req-pulse-cell-ready-active { background: rgba(10, 122, 63, 0.1); }
.req-pulse-cell-ready-active .req-pulse-value { color: #0a7a3f; }
@media (max-width: 680px) {
  .tile-req-pulse .req-pulse-grid { grid-template-columns: 1fr 1fr; }
}

/* W1.4.12 — Role toggle (third inline-toggle consumer after intake
   and approval). 2-tap arming reuses approval-arm-pulse keyframes. */
.role-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.role-toggle-btn {
  appearance: none;
  border: 1px solid var(--line, #e4e4e9);
  background: var(--surface, #fff);
  color: var(--ink, #1a1a1f);
  padding: 0.45rem 0.85rem;
  border-radius: 0.55rem;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 140ms ease, background 120ms ease;
}
.role-toggle-btn:hover:not(:disabled):not(.is-active) { transform: translateY(-1px); }
.role-toggle-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.role-toggle-btn.is-active {
  background: var(--ink, #1a1a1f);
  color: #fff;
  border-color: var(--ink, #1a1a1f);
  cursor: default;
}
.role-toggle-btn.is-arming {
  animation: approval-arm-pulse 0.9s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.4);
}
.role-toggle-group.is-committed { opacity: 0.7; pointer-events: none; }
.role-toggle-status { min-height: 1.15em; margin: 0.5rem 0 0; font-size: 0.78rem; }
.role-toggle-status[data-tone="ok"]   { color: #0a7a3f; }
.role-toggle-status[data-tone="warn"] { color: #c08a2b; }
.role-toggle-status[data-tone="err"]  { color: #b42318; }

/* v1.5.2 — Mission Control banner pinned above /admin/dev_panel
   tile grid. NASA-console aesthetic: dark gradient, monospaced
   version readout, 4 status lights with green/amber/info dots. */
.mc-banner {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 1.25rem 2rem;
  align-items: center;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-lg, 14px);
  background: linear-gradient(135deg,
    color-mix(in srgb, #0b1220 88%, var(--accent, #4c6ef5)),
    color-mix(in srgb, #0b1220 94%, var(--accent, #4c6ef5)));
  color: #e6ecf5;
  border: 1px solid color-mix(in srgb, var(--accent, #4c6ef5) 30%, #0b1220);
  box-shadow: 0 8px 28px -18px color-mix(in srgb, var(--accent, #4c6ef5) 40%, transparent);
}
.mc-banner-title {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}
.mc-banner-brand {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fff;
}
.mc-banner-sep {
  color: color-mix(in srgb, #e6ecf5 40%, transparent);
  font-size: 1.1rem;
}
.mc-banner-role {
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent, #4c6ef5) 75%, #ffffff);
  font-weight: 600;
}
.mc-banner-tag {
  display: flex;
  align-items: center;
}
.mc-banner-version {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-md, 10px);
  background: color-mix(in srgb, #0b1220 50%, #000);
  color: #7cffd4;
  border: 1px solid color-mix(in srgb, #7cffd4 28%, #0b1220);
  letter-spacing: 0.04em;
}
.mc-banner-status {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-self: end;
}
.mc-light {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md, 8px);
  background: color-mix(in srgb, #0b1220 60%, transparent);
  border: 1px solid color-mix(in srgb, #e6ecf5 10%, transparent);
  font-size: 0.72rem;
  line-height: 1;
}
.mc-light-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5a6475;
  box-shadow: 0 0 0 0 transparent;
}
.mc-light-ok   .mc-light-dot { background: #3ee07b; box-shadow: 0 0 10px color-mix(in srgb, #3ee07b 70%, transparent); }
.mc-light-warn .mc-light-dot { background: #f2b44a; box-shadow: 0 0 10px color-mix(in srgb, #f2b44a 70%, transparent); }
.mc-light-info .mc-light-dot { background: #4c9bff; box-shadow: 0 0 10px color-mix(in srgb, #4c9bff 70%, transparent); animation: mc-pulse 2.2s ease-in-out infinite; }
@keyframes mc-pulse {
  0%, 100% { box-shadow: 0 0 6px color-mix(in srgb, #4c9bff 60%, transparent); }
  50%      { box-shadow: 0 0 14px color-mix(in srgb, #4c9bff 90%, transparent); }
}
.mc-light-label {
  color: color-mix(in srgb, #e6ecf5 55%, transparent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.mc-light-value {
  color: #e6ecf5;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
}

@media (max-width: 900px) {
  .mc-banner {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }
  .mc-banner-status { justify-self: start; }
}

/* Clickable HISTORY tile commit sha → drill-down page */
.dp-commit-link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
}
.dp-commit-link:hover code.inline-code {
  background: color-mix(in srgb, var(--accent, #4c6ef5) 14%, var(--panel));
  border-color: var(--accent, #4c6ef5);
}

/* v1.5.2 — Mission Control drill-down pages shared layout
   (templates/dev_panel_commit.html + dev_panel_tag.html). Uses
   the same 6-column tile grid as .inst-tiles so header/hover_back
   integration stays uniform with the rest of PRISM. */
.mc-drill-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  grid-auto-flow: row dense;
}
.mc-drill-tiles > .tile { min-width: 0; }
.tile-mc-header  { grid-column: span 3; }
.tile-mc-body    { grid-column: span 3; }
.tile-mc-commits { grid-column: 1 / -1; }
.tile-mc-stat    { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .mc-drill-tiles { grid-template-columns: 1fr; }
  .mc-drill-tiles > .tile { grid-column: 1 / -1; }
}

.mc-header-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.35rem;
}
.mc-subject {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.mc-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem 1rem;
  margin: 0;
}
.mc-meta-cell dt {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.15rem;
  font-weight: 600;
}
.mc-meta-cell dd {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink);
  word-break: break-word;
}
.mc-commit-body {
  margin: 0.35rem 0 0 0;
  padding: 0.9rem 1rem;
  background: var(--panel-soft, rgba(0,0,0,0.03));
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-radius: var(--radius-md, 8px);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 520px;
  overflow-y: auto;
}
.mc-stat-list, .mc-commit-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mc-stat-line code {
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  display: block;
}
.mc-commit-row {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.06));
  font-size: 0.88rem;
}
.mc-commit-row:last-child { border-bottom: none; }
.mc-commit-subject { flex: 1; color: var(--ink); }
.mc-commit-meta { font-size: 0.75rem; white-space: nowrap; }

/* Clickable PROJECT TIMELINE entries (anchor wrapping the pill) */
.dev-timeline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
}
.dev-timeline-link:hover .dev-timeline-tag {
  background: color-mix(in srgb, var(--accent, #4c6ef5) 20%, var(--panel));
  border-color: var(--accent, #4c6ef5);
}

/* v1.6.0 — NOTICEBOARD + QUICK ACTIONS home tiles (Ferrari aesthetic).
   Earthy-red severity accents on critical, amber on warning, ink on
   info. Terminal-style monospaced eyebrows. Every element earned. */
.tile-dash-noticeboard {
  grid-column: 1 / -1;
  border-left: 3px solid color-mix(in srgb, #c0392b 80%, var(--accent, #4c6ef5));
  background: linear-gradient(135deg,
    color-mix(in srgb, #c0392b 4%, var(--panel)),
    var(--panel));
}
.notice-list {
  list-style: none;
  padding: 0;
  margin: 0.45rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.notice {
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-left-width: 3px;
  border-radius: var(--radius-md, 8px);
  background: var(--panel);
}
.notice-critical { border-left-color: #c0392b; background: color-mix(in srgb, #c0392b 5%, var(--panel)); }
.notice-warning  { border-left-color: #d98b1c; background: color-mix(in srgb, #d98b1c 5%, var(--panel)); }
.notice-info     { border-left-color: var(--accent, #4c6ef5); }
.notice-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}
.notice-eyebrow {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}
.notice-severity {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.58rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm, 4px);
  font-weight: 700;
  letter-spacing: 0.1em;
}
.notice-severity-critical { background: #c0392b; color: #fff; }
.notice-severity-warning  { background: #d98b1c; color: #fff; }
.notice-severity-info     { background: color-mix(in srgb, var(--accent, #4c6ef5) 14%, var(--panel)); color: var(--accent, #4c6ef5); border: 1px solid color-mix(in srgb, var(--accent, #4c6ef5) 30%, transparent); }
.notice-date {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
}
.notice-subject {
  display: block;
  font-size: 0.96rem;
  color: var(--ink);
  line-height: 1.4;
  margin: 0.15rem 0;
}
.notice-body {
  margin: 0.25rem 0 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* QUICK ACTIONS tile — the Ferrari dashboard buttons. Primary gets
   the filled ink accent, ghost is an outlined card. Monospaced
   eyebrow. Grid of up to 4 cells, collapses to 2 columns at tablet. */
.tile-dash-quick-actions {
  grid-column: 1 / -1;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--ink, #1e2430) 2%, var(--panel)),
    var(--panel));
  border-left: 3px solid var(--ink, #1e2430);
}
.qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.4rem;
}
.qa-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-md, 10px);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  min-height: 76px;
  justify-content: center;
}
.qa-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--ink, #1e2430) 30%, transparent);
}
.qa-card-primary {
  background: var(--ink, #1e2430);
  color: #f5f6fa;
  border: 1px solid var(--ink, #1e2430);
}
.qa-card-primary:hover { background: color-mix(in srgb, var(--ink, #1e2430) 88%, #c0392b); }
.qa-card-ghost {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line, rgba(0,0,0,0.12));
}
.qa-card-ghost:hover {
  border-color: var(--ink, #1e2430);
  background: color-mix(in srgb, var(--ink, #1e2430) 4%, var(--panel));
}
.qa-eyebrow {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  opacity: 0.72;
  text-transform: uppercase;
}
.qa-label {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
}

/* v1.6.1 — Admin Notices compose + list page (/admin/notices).
   Reuses .notice-severity-* + .notice-eyebrow from v1.6.0 so the
   visual language stays consistent between the home-page tile
   and this write surface. */
.admin-notices-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  grid-auto-flow: row dense;
}
.admin-notices-tiles > .tile { min-width: 0; }
.tile-admin-notices-compose { grid-column: 1 / -1; }
.tile-admin-notices-list    { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .admin-notices-tiles { grid-template-columns: 1fr; }
  .admin-notices-tiles > .tile { grid-column: 1 / -1; }
}

.admin-notice-form {
  gap: 0.85rem;
  margin-top: 0.45rem;
}
.admin-notice-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}
.admin-notice-submit-row {
  display: flex;
  justify-content: flex-start;
  padding-top: 0.3rem;
}
.admin-notice-target { /* hidden until scope matches */ }

/* Active list */
.admin-notice-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.admin-notice-row-item {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-left-width: 3px;
  border-radius: var(--radius-md, 8px);
  background: var(--panel);
}
.admin-notice-row-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}
.admin-notice-delete-form {
  margin: 0 0 0 auto;
}
.admin-notice-delete-btn {
  all: unset;
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border: 1px solid var(--line, rgba(0,0,0,0.15));
  font-size: 0.95rem;
  line-height: 1;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.admin-notice-delete-btn:hover {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}
.admin-notice-meta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* v1.6.2 — User-to-user messaging (inbox, detail, compose).
   Same tile architecture as the rest of PRISM. Ferrari-ish
   earthy accent on unread rows, monospaced sent-at timestamps. */
.inbox-tiles, .message-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  grid-auto-flow: row dense;
}
.inbox-tiles > .tile, .message-tiles > .tile { min-width: 0; }
.tile-inbox-list     { grid-column: 1 / -1; }
.tile-message-body   { grid-column: 1 / -1; }
.tile-message-compose{ grid-column: 1 / -1; }

@media (max-width: 760px) {
  .inbox-tiles, .message-tiles { grid-template-columns: 1fr; }
}

.inbox-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.inbox-row {
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-radius: var(--radius-md, 8px);
  background: var(--panel);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.inbox-row-unread {
  border-left: 3px solid #c0392b;
  background: color-mix(in srgb, #c0392b 4%, var(--panel));
}
.inbox-row:hover { background: color-mix(in srgb, var(--accent, #4c6ef5) 5%, var(--panel)); }
.inbox-row-link {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
}
.inbox-row-head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.inbox-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c0392b;
  flex: 0 0 auto;
}
.inbox-subject {
  flex: 1;
  font-size: 0.95rem;
  color: var(--ink);
}
.inbox-sent {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
}
.inbox-row-meta {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.message-head {
  margin-top: 0.4rem;
}
.message-subject-headline {
  margin: 0.8rem 0 0.55rem 0;
  font-size: 1.2rem;
  color: var(--ink);
  line-height: 1.3;
}
.message-body-text {
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--panel-soft, rgba(0,0,0,0.03));
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-radius: var(--radius-md, 8px);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.message-compose-form {
  gap: 0.85rem;
  margin-top: 0.4rem;
}
.message-compose-submit-row {
  display: flex;
  justify-content: flex-start;
  padding-top: 0.3rem;
}

/* v1.7.0 — Finance Portal (/finance). Ferrari-dashboard aesthetic:
   earthy outstanding accent, mint collected accent, monospaced
   amount columns, dense tight rows. */
.finance-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  grid-auto-flow: row dense;
}
.finance-tiles > .tile { min-width: 0; }
.tile-finance-kpi           { grid-column: 1 / -1; }
.tile-finance-by-instrument { grid-column: 1 / -1; }
.tile-finance-outstanding   { grid-column: span 3; }
.tile-finance-paid          { grid-column: span 3; }

@media (max-width: 1200px) {
  .tile-finance-outstanding,
  .tile-finance-paid { grid-column: 1 / -1; }
}

.finance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin-top: 0.4rem;
}
.finance-kpi-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-radius: var(--radius-md, 10px);
  background: var(--panel);
}
.finance-kpi-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.finance-kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.finance-kpi-outstanding { color: #c0392b; }
.finance-kpi-collected   { color: #2f9e44; }

.finance-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.4rem;
  font-size: 0.88rem;
}
.finance-table th, .finance-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.06));
  text-align: left;
}
.finance-table th {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.finance-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.finance-outstanding-pos {
  color: #c0392b;
  font-weight: 600;
}

.finance-invoice-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.finance-invoice-row {
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-left-width: 3px;
  border-radius: var(--radius-md, 8px);
  background: var(--panel);
}
.finance-invoice-pending { border-left-color: #d98b1c; background: color-mix(in srgb, #d98b1c 3%, var(--panel)); }
.finance-invoice-partial { border-left-color: #c0392b; background: color-mix(in srgb, #c0392b 3%, var(--panel)); }
.finance-invoice-paid-row{ border-left-color: #2f9e44; background: color-mix(in srgb, #2f9e44 2%, var(--panel)); }
.finance-invoice-link {
  display: block;
  padding: 0.7rem 0.95rem;
  text-decoration: none;
  color: inherit;
}
.finance-invoice-head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.finance-invoice-status {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.58rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm, 4px);
  font-weight: 700;
  letter-spacing: 0.1em;
}
.finance-invoice-title {
  flex: 1;
  font-size: 0.92rem;
  color: var(--ink);
}
.finance-invoice-amount {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.finance-invoice-paid-row .finance-invoice-amount { color: #2f9e44; }
.finance-invoice-meta {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* v1.7.0 — Grants list + detail pages. Progress bars for budget
   burn, monospaced amounts, same Ferrari aesthetic as /finance. */
.finance-grant-list {
  list-style: none;
  padding: 0;
  margin: 0.45rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.finance-grant-row {
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-left: 3px solid var(--accent, #4c6ef5);
  border-radius: var(--radius-md, 8px);
  background: var(--panel);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.finance-grant-row:hover {
  background: color-mix(in srgb, var(--accent, #4c6ef5) 4%, var(--panel));
}
.finance-grant-link {
  display: block;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
}
.finance-grant-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.finance-grant-title {
  font-size: 0.96rem;
  color: var(--ink);
}
.finance-grant-meta {
  font-size: 0.78rem;
  margin-bottom: 0.45rem;
}
.finance-grant-bar-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.finance-grant-bar {
  flex: 1;
  height: 8px;
  background: var(--panel-soft, rgba(0,0,0,0.06));
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line, rgba(0,0,0,0.08));
}
.finance-grant-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2f9e44, #d98b1c 80%, #c0392b);
  transition: width 0.3s ease;
}
.finance-grant-bar-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
