@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --graphite: #1f242a;
  --warm-white: #f6f4ef;
  --teal: #2f6b73;
  --silver: #a6b6c3;
  --stone: #d8d1c6;
  --admiral: #27395a;
  --panel: rgba(252, 250, 245, 0.92);
  --panel-strong: rgba(255, 254, 250, 0.98);
  --panel-dark: rgba(39, 57, 90, 0.96);
  --line: rgba(31, 36, 42, 0.1);
  --line-strong: rgba(166, 182, 195, 0.32);
  --ink: var(--graphite);
  --ink-soft: #596571;
  --ink-inverse: #f7f4ee;
  --success: #2f7a58;
  --success-soft: rgba(47, 122, 88, 0.12);
  --warning: #b1711a;
  --warning-soft: rgba(177, 113, 26, 0.14);
  --danger: #9a454d;
  --danger-soft: rgba(154, 69, 77, 0.14);
  --shadow-lg: 0 28px 60px rgba(31, 36, 42, 0.12);
  --shadow-md: 0 18px 38px rgba(31, 36, 42, 0.08);
  --shadow-sm: 0 10px 20px rgba(31, 36, 42, 0.06);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(216, 209, 198, 0.52) 0, rgba(216, 209, 198, 0) 34%),
    radial-gradient(circle at 84% 14%, rgba(47, 107, 115, 0.1) 0, rgba(47, 107, 115, 0) 30%),
    linear-gradient(180deg, #fbf9f4 0%, #f2efe8 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)),
    repeating-linear-gradient(
      90deg,
      rgba(31, 36, 42, 0.018) 0,
      rgba(31, 36, 42, 0.018) 1px,
      transparent 1px,
      transparent 120px
    );
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.46), transparent 72%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(180deg, #3d7f88 0%, var(--teal) 100%);
  color: var(--ink-inverse);
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
  box-shadow: var(--shadow-sm);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(47, 107, 115, 0.18);
}

button.secondary {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  border-color: rgba(31, 36, 42, 0.08);
  box-shadow: none;
}

button.ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: rgba(31, 36, 42, 0.08);
  box-shadow: none;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(31, 36, 42, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  padding: 0.9rem 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(89, 101, 113, 0.84);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(47, 107, 115, 0.22);
  outline-offset: 2px;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.42) 0, rgba(255, 255, 255, 0) 28%),
    radial-gradient(circle at 92% 0%, rgba(39, 57, 90, 0.06) 0, rgba(39, 57, 90, 0) 34%);
}

.shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 26px 22px 64px;
}

.app {
  display: grid;
  gap: 18px;
}

.command-bar,
.monitor,
.panel,
.detail-card,
.flash,
.banner,
.empty-state,
.boot-panel {
  animation: rise 420ms ease both;
}

.command-bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  padding: 28px 30px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(39, 57, 90, 0.98) 0%, rgba(31, 36, 42, 0.98) 82%);
  border: 1px solid rgba(166, 182, 195, 0.28);
  box-shadow: 0 32px 64px rgba(27, 37, 48, 0.2);
  color: var(--ink-inverse);
}

.command-bar::before,
.boot-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.12) 0, rgba(255, 255, 255, 0) 26%),
    repeating-linear-gradient(
      90deg,
      rgba(166, 182, 195, 0.08) 0,
      rgba(166, 182, 195, 0.08) 1px,
      transparent 1px,
      transparent 96px
    );
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.16));
  pointer-events: none;
}

.brand-lockup,
.command-actions,
.command-meta,
.controls,
.decision-row,
.inline-actions,
.queue-meta,
.detail-head,
.audit-row,
.card-head,
.attention-top,
.activity-top {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  align-items: flex-start;
  gap: 18px;
}

.brand-lockup-logo {
  width: 132px;
  height: auto;
  flex: 0 0 auto;
  margin-top: 6px;
}

.command-bar h1,
.boot-panel h1 {
  margin: 6px 0 10px;
  max-width: 15ch;
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  font-size: clamp(2.45rem, 4vw, 4rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
}

.command-bar p,
.boot-panel p,
.lede,
.muted {
  color: var(--ink-soft);
}

.command-bar .lede {
  max-width: 54ch;
  color: rgba(246, 244, 239, 0.82);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--silver);
}

.section-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
}

.lede {
  margin: 0;
  line-height: 1.58;
}

.command-actions {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: end;
  align-content: space-between;
  gap: 18px;
}

.command-meta {
  justify-content: flex-end;
}

.command-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(166, 182, 195, 0.22);
  background: rgba(246, 244, 239, 0.08);
  color: rgba(246, 244, 239, 0.88);
  font-size: 0.84rem;
  font-weight: 700;
}

.flash,
.banner {
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(31, 36, 42, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
}

.flash {
  display: grid;
  gap: 4px;
}

.flash-success {
  background: rgba(47, 122, 88, 0.08);
  border-color: rgba(47, 122, 88, 0.18);
}

.flash-warning {
  background: rgba(154, 69, 77, 0.08);
  border-color: rgba(154, 69, 77, 0.18);
}

.flash-info {
  background: rgba(47, 107, 115, 0.08);
  border-color: rgba(47, 107, 115, 0.18);
}

.banner {
  display: grid;
  gap: 2px;
  color: var(--ink-soft);
}

.banner-strong {
  background: rgba(47, 107, 115, 0.08);
  border-color: rgba(47, 107, 115, 0.18);
  color: var(--graphite);
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.monitor {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 22px 24px 24px;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(252, 250, 245, 0.97) 0%, rgba(245, 241, 234, 0.93) 100%);
  border: 1px solid rgba(31, 36, 42, 0.08);
  box-shadow: var(--shadow-md);
}

.monitor::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), rgba(166, 182, 195, 0.8));
}

.monitor-head,
.panel-head,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
}

.monitor-head h2,
.panel-head h2,
.boot-panel h2,
.section-card h3 {
  margin: 4px 0 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.monitor-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(39, 57, 90, 0.08);
  border: 1px solid rgba(39, 57, 90, 0.1);
  color: var(--admiral);
  font-size: 0.82rem;
  font-weight: 800;
}

.monitor-pulse {
  grid-column: span 4;
}

.monitor-stage {
  grid-column: span 8;
}

.monitor-channel {
  grid-column: span 4;
}

.monitor-attention {
  grid-column: span 8;
}

.pulse-body {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 184px;
}

.pulse-ring {
  width: 174px;
  height: 174px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 50%;
  background:
    conic-gradient(var(--teal) 0deg var(--ring), rgba(166, 182, 195, 0.22) var(--ring) 360deg);
  box-shadow:
    inset 0 0 0 1px rgba(31, 36, 42, 0.04),
    0 18px 36px rgba(31, 36, 42, 0.08);
}

.pulse-ring-core {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 50%;
  border: 1px solid rgba(166, 182, 195, 0.18);
  background:
    linear-gradient(180deg, rgba(39, 57, 90, 0.98) 0%, rgba(31, 36, 42, 0.98) 100%);
  color: var(--ink-inverse);
}

.pulse-ring-core strong {
  display: block;
  font-size: 2.3rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.pulse-ring-core span {
  font-size: 0.84rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(246, 244, 239, 0.74);
}

.pulse-copy {
  flex: 1 1 auto;
  display: grid;
  gap: 12px;
}

.pulse-metric {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(31, 36, 42, 0.08);
}

.pulse-metric strong {
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.pulse-label,
.monitor-note,
.activity-meta,
.audit-time,
.trace-fields,
.queue-card-subtitle,
.helper,
.decision-note,
.kv-label,
.field,
.diff-change,
.command-bar .muted,
.banner,
.empty-state,
.source-trace,
.detail-card .muted {
  color: var(--ink-soft);
}

.monitor-note,
.decision-note,
.helper {
  line-height: 1.55;
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.stage-cell {
  text-align: left;
  display: grid;
  gap: 12px;
  min-height: 156px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(31, 36, 42, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.stage-cell:hover:not(:disabled) {
  box-shadow: var(--shadow-sm);
}

.stage-cell[data-active="true"] {
  background: linear-gradient(180deg, rgba(39, 57, 90, 0.98) 0%, rgba(31, 36, 42, 0.98) 100%);
  border-color: rgba(166, 182, 195, 0.2);
  color: var(--ink-inverse);
  box-shadow: 0 16px 34px rgba(39, 57, 90, 0.18);
}

.stage-cell[data-active="true"] .stage-note,
.stage-cell[data-active="true"] .stage-top span {
  color: rgba(246, 244, 239, 0.72);
}

.stage-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.stage-top strong {
  font-size: 1rem;
}

.stage-top span {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stage-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 36, 42, 0.08);
}

.stage-bar span,
.channel-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--silver));
}

.stage-note {
  font-size: 0.86rem;
  line-height: 1.45;
}

.channel-list,
.queue-list,
.audit-list,
.source-trace,
.activity-list {
  display: grid;
  gap: 12px;
}

.channel-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: center;
}

.channel-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: capitalize;
}

.channel-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 36, 42, 0.08);
}

.channel-value {
  text-align: right;
  font-weight: 800;
  color: var(--admiral);
}

.attention-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.attention-item,
.activity-item {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  text-align: left;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(31, 36, 42, 0.08);
  color: var(--ink);
  box-shadow: none;
}

.attention-item:hover:not(:disabled),
.activity-item:hover:not(:disabled) {
  border-color: rgba(47, 107, 115, 0.22);
}

.attention-top,
.activity-top,
.queue-card-top,
.detail-head,
.audit-top,
.card-head {
  justify-content: space-between;
  align-items: baseline;
}

.attention-meta,
.activity-meta,
.queue-card-subtitle {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.attention-note,
.activity-copy,
.queue-card-copy,
.section-text,
.trace-fragment {
  line-height: 1.55;
}

.panel,
.detail-card,
.boot-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(31, 36, 42, 0.08);
  background: linear-gradient(180deg, rgba(252, 250, 245, 0.96) 0%, rgba(246, 243, 236, 0.92) 100%);
  box-shadow: var(--shadow-md);
}

.panel,
.boot-panel {
  display: grid;
  gap: 16px;
  padding: 22px 22px 24px;
}

.panel::before,
.detail-card::before,
.boot-panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(47, 107, 115, 0.8), rgba(166, 182, 195, 0.72));
}

.panel-activity {
  background: linear-gradient(145deg, rgba(39, 57, 90, 0.98) 0%, rgba(31, 36, 42, 0.98) 100%);
  border-color: rgba(166, 182, 195, 0.18);
  color: var(--ink-inverse);
}

.panel-activity .section-kicker,
.panel-activity h2,
.panel-activity strong,
.panel-activity .activity-copy {
  color: var(--ink-inverse);
}

.panel-activity .section-kicker {
  color: var(--silver);
}

.panel-activity .activity-item {
  background: rgba(246, 244, 239, 0.08);
  border-color: rgba(166, 182, 195, 0.16);
  color: var(--ink-inverse);
}

.panel-activity .activity-meta,
.panel-activity .activity-top span {
  color: rgba(246, 244, 239, 0.7);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.auth-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(31, 36, 42, 0.1);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(252, 250, 245, 0.97) 0%, rgba(245, 241, 234, 0.93) 100%);
  box-shadow: var(--shadow-md);
}

.auth-form {
  margin: 0;
  display: grid;
  gap: 12px;
}

.auth-form .field {
  display: grid;
  gap: 8px;
}

.auth-error {
  color: var(--danger);
  margin: 2px 0 0;
  font-weight: 700;
}

.assistant-panel {
  display: grid;
  gap: 12px;
}

.assistant-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.assistant-meta {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.assistant-open {
  border-color: rgba(47, 107, 115, 0.2);
  background: linear-gradient(180deg, rgba(252, 250, 245, 0.98) 0%, rgba(248, 245, 239, 0.98) 100%);
}

.assistant-collapsed {
  border-style: dashed;
}

.assistant-form {
  display: grid;
  gap: 12px;
}

.assistant-starters {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.assistant-starter {
  min-width: 0;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  border-color: rgba(31, 36, 42, 0.12);
  box-shadow: none;
}

.assistant-controls {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.assistant-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(47, 107, 115, 0.22);
  background: rgba(47, 107, 115, 0.08);
}

.assistant-state-error {
  border-color: rgba(154, 69, 77, 0.25);
  background: var(--danger-soft);
  color: #7e3740;
}

.assistant-result {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(31, 36, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
}

.assistant-result-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.assistant-result-tag {
  display: inline-flex;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(47, 107, 115, 0.1);
  color: var(--teal);
  border: 1px solid rgba(47, 107, 115, 0.18);
}

.assistant-answer {
  margin: 0;
  line-height: 1.55;
}

.assistant-warnings,
.assistant-blocked {
  display: grid;
  gap: 6px;
}

.assistant-warnings {
  color: #91561a;
}

.assistant-blocked span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(154, 69, 77, 0.2);
  background: var(--danger-soft);
  color: #7e3740;
  padding: 0.3rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.assistant-trace {
  color: var(--ink-soft);
  font-size: 0.84rem;
  word-break: break-word;
}

.assistant-collapsed-note {
  margin: 0;
  color: var(--ink-soft);
}

.field-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.field-check input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.assistant-meta + .field-check {
  margin-top: 0;
}

.board-shell {
  display: grid;
  grid-template-columns: minmax(286px, 0.92fr) minmax(0, 1.6fr) minmax(258px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.queue-rail,
.focus-pane,
.ops-rail {
  display: grid;
  gap: 18px;
}

.queue-rail > .panel {
  position: sticky;
  top: 18px;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.queue-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(31, 36, 42, 0.08);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-soft);
  box-shadow: none;
}

.queue-tab[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(39, 57, 90, 0.96) 0%, rgba(31, 36, 42, 0.96) 100%);
  border-color: rgba(166, 182, 195, 0.2);
  color: var(--ink-inverse);
}

.queue-tab[aria-pressed="true"] .queue-count {
  color: var(--silver);
}

.queue-count {
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
}

.queue-card {
  position: relative;
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 16px 16px 18px 18px;
  text-align: left;
  border-radius: 22px;
  border: 1px solid rgba(31, 36, 42, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 245, 239, 0.94) 100%);
  color: var(--ink);
  box-shadow: none;
}

.queue-card::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 8px;
  width: 3px;
  border-radius: 999px;
  background: rgba(166, 182, 195, 0.44);
}

.queue-card:hover:not(:disabled) {
  border-color: rgba(47, 107, 115, 0.2);
}

.queue-card[data-active="true"] {
  border-color: rgba(47, 107, 115, 0.24);
  box-shadow: 0 20px 36px rgba(47, 107, 115, 0.12);
  transform: translateY(-1px);
}

.queue-card[data-active="true"]::before {
  background: linear-gradient(180deg, var(--teal), var(--silver));
}

.queue-card-title {
  font-size: 1rem;
  font-weight: 800;
}

.queue-card-copy {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.tag,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.chip {
  background: rgba(216, 209, 198, 0.36);
  color: var(--graphite);
  border: 1px solid rgba(31, 36, 42, 0.05);
}

.tag {
  background: rgba(47, 107, 115, 0.1);
  color: var(--teal);
  border: 1px solid rgba(47, 107, 115, 0.12);
}

.badge {
  background: rgba(39, 57, 90, 0.08);
  color: var(--graphite);
  border: 1px solid rgba(39, 57, 90, 0.08);
}

.badge-warning {
  background: var(--warning-soft);
  color: #825115;
  border-color: rgba(177, 113, 26, 0.14);
}

.badge-danger {
  background: var(--danger-soft);
  color: #7e3740;
  border-color: rgba(154, 69, 77, 0.14);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(47, 122, 88, 0.14);
}

.badge-muted {
  background: rgba(166, 182, 195, 0.16);
  color: #50606d;
  border-color: rgba(166, 182, 195, 0.18);
}

.detail-card {
  padding: 0;
}

.detail-head {
  padding: 24px 24px 18px;
  border-bottom: 1px solid rgba(31, 36, 42, 0.08);
}

.detail-title {
  margin: 6px 0 12px;
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.detail-body {
  padding: 22px 24px 24px;
}

.detail-grid,
.field-grid,
.decision-inputs,
.diff-grid {
  display: grid;
  gap: 14px;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid,
.decision-inputs,
.diff-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-card {
  display: grid;
  gap: 12px;
  padding: 18px 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(31, 36, 42, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 244, 238, 0.82) 100%);
}

.section-card h3 {
  margin: 0;
}

.section-span-2,
.field-full,
.decision-inputs .field-full,
.diff-change {
  grid-column: 1 / -1;
}

.snapshot-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  background: linear-gradient(90deg, rgba(166, 182, 195, 0.28), rgba(47, 107, 115, 0.3));
}

.snapshot-tile {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(39, 57, 90, 0.98) 0%, rgba(31, 36, 42, 0.98) 100%);
}

.snapshot-tile span {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(166, 182, 195, 0.82);
}

.snapshot-tile strong {
  font-size: 1.05rem;
  color: var(--ink-inverse);
}

.lifecycle-stepper {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.lifecycle-step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(31, 36, 42, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.lifecycle-step-completed {
  border-color: rgba(47, 107, 115, 0.34);
  background: rgba(47, 107, 115, 0.12);
}

.lifecycle-step-active {
  border-color: rgba(39, 57, 90, 0.32);
  background: rgba(39, 57, 90, 0.12);
}

.lifecycle-step-pending {
  opacity: 0.8;
}

.lifecycle-dot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-inverse);
  background: linear-gradient(180deg, rgba(39, 57, 90, 0.98) 0%, rgba(31, 36, 42, 0.98) 100%);
}

.lifecycle-copy {
  font-size: 0.84rem;
  font-weight: 700;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kv {
  display: grid;
  gap: 6px;
  min-height: 76px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(246, 244, 239, 0.9);
  border: 1px solid rgba(31, 36, 42, 0.06);
}

.kv-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kv-value {
  font-weight: 700;
  line-height: 1.4;
}

.trace-item,
.audit-item,
.diff-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 36, 42, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.trace-item strong,
.audit-top strong {
  display: block;
}

.trace-fields,
.audit-time {
  font-size: 0.84rem;
}

.diff-box {
  display: grid;
  gap: 4px;
}

.diff-box .label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.diff-box .value {
  font-weight: 700;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

.field > span {
  font-weight: 700;
  color: var(--ink);
}

.control-shell {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(31, 36, 42, 0.08);
  background: linear-gradient(180deg, rgba(216, 209, 198, 0.22) 0%, rgba(255, 255, 255, 0.78) 100%);
}

.decision-row {
  align-items: center;
}

.decision-row button {
  min-width: 152px;
}

.empty-state {
  padding: 18px;
  border-style: dashed;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.62);
}

.loading-shell {
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
}

.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(47, 107, 115, 0.15);
  border-top-color: var(--teal);
  animation: spin 1s linear infinite;
}

.boot-panel {
  position: relative;
  min-height: 240px;
  align-content: center;
  color: var(--ink-inverse);
  background: linear-gradient(140deg, rgba(39, 57, 90, 0.98) 0%, rgba(31, 36, 42, 0.98) 100%);
  border-color: rgba(166, 182, 195, 0.24);
}

.boot-panel .eyebrow,
.boot-panel p {
  color: rgba(246, 244, 239, 0.74);
}

.boot-panel h1 {
  max-width: 14ch;
  color: var(--ink-inverse);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-thumb {
  border: 3px solid rgba(0, 0, 0, 0);
  border-radius: 999px;
  background: rgba(89, 101, 113, 0.3);
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.24);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1420px) {
  .board-shell {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .ops-rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1220px) {
  .monitor-pulse,
  .monitor-stage,
  .monitor-channel,
  .monitor-attention {
    grid-column: span 6;
  }

  .board-shell {
    grid-template-columns: 1fr;
  }

  .queue-rail > .panel {
    position: static;
  }

  .ops-rail {
    grid-template-columns: 1fr;
  }

  .snapshot-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .command-bar {
    grid-template-columns: 1fr;
  }

  .command-actions {
    justify-items: start;
  }

  .command-meta {
    justify-content: flex-start;
  }

  .pulse-body {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-grid,
  .kv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assistant-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attention-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 16px 12px 44px;
  }

  .command-bar,
  .panel,
  .detail-head,
  .detail-body,
  .boot-panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  .monitor {
    padding: 18px;
  }

  .monitor-pulse,
  .monitor-stage,
  .monitor-channel,
  .monitor-attention {
    grid-column: 1 / -1;
  }

  .stage-strip,
  .field-grid,
  .decision-inputs,
  .diff-grid,
  .detail-grid,
  .kv-grid,
  .snapshot-strip {
    grid-template-columns: 1fr;
  }

  .decision-row {
    flex-direction: column;
    align-items: stretch;
  }

  .decision-row button {
    width: 100%;
  }

  .brand-lockup {
    flex-direction: column;
  }

  .command-bar h1,
  .boot-panel h1 {
    max-width: none;
  }

  .assistant-controls {
    grid-template-columns: 1fr;
  }
}
