:root {
  color-scheme: dark;
  --bg: #070a0f;
  --panel: #101722;
  --panel-2: #151e2b;
  --panel-3: #0d131c;
  --text: #edf4ff;
  --muted: #94a3b8;
  --faint: #64748b;
  --line: rgba(148, 163, 184, 0.18);
  --green: #4ade80;
  --yellow: #facc15;
  --orange: #fb923c;
  --red: #f87171;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(56, 189, 248, 0.12), transparent 34%),
    linear-gradient(135deg, #070a0f 0%, #0a1018 48%, #080b10 100%);
  color: var(--text);
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

#app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.88);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(74, 222, 128, 0.12));
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sidebar-foot,
.sidebar-foot small,
.eyebrow,
.page-header p,
.card small,
.system-card p,
.system-card small,
.runtime-list span,
.memory-stats span,
.risk-line span,
.breakdown-heading span,
.summary-stats span,
.brain-panel span,
.routing-meta span {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
}

.nav-item span {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
}

.nav-item.selected {
  background: rgba(56, 189, 248, 0.12);
  color: white;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.72);
}

.sidebar-foot strong,
.sidebar-foot small {
  display: block;
}

.sidebar-foot strong {
  color: var(--text);
  font-size: 13px;
}

.sidebar-foot small {
  margin-top: 2px;
  font-size: 12px;
}

.dot,
.system-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.main {
  padding: 34px;
}

.page-header,
.card-title,
.summary-banner,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.page-title,
.summary-banner h2,
.card h2,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.page-title {
  font-size: clamp(29px, 3.6vw, 47px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.page-header p {
  margin: 10px 0 0;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.button,
.icon-button,
.tabs button,
.filter-chips button {
  border-radius: 8px;
  border: 1px solid var(--line);
  min-height: 40px;
  padding: 0 14px;
  background: rgba(15, 23, 42, 0.82);
}

.button.primary {
  background: linear-gradient(135deg, #0ea5e9, #16a34a);
  border-color: transparent;
  color: white;
  font-weight: 800;
}

.button.secondary:hover,
.icon-button:hover,
.tabs button:hover,
.filter-chips button:hover {
  border-color: rgba(148, 163, 184, 0.38);
}

.button.small {
  min-height: 34px;
}

.summary-banner {
  margin-top: 28px;
  padding: 22px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(74, 222, 128, 0.08)),
    rgba(16, 23, 34, 0.88);
  box-shadow: var(--shadow);
}

.summary-banner h2 {
  margin-top: 14px;
  max-width: 760px;
  font-size: 24px;
  line-height: 1.24;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 12px;
  min-width: 360px;
}

.summary-stats div,
.memory-stats div,
.runtime-list div,
.routing-meta {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.46);
}

.summary-stats strong,
.memory-stats strong,
.runtime-list strong {
  display: block;
  margin-top: 4px;
}

.hero-grid,
.lower-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
}

.lower-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.62fr);
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.86);
  box-shadow: var(--shadow);
  padding: 20px;
}

.hero-card {
  min-height: 560px;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.green,
.connected {
  color: var(--green);
}

.yellow {
  color: var(--yellow);
}

.orange,
.degraded {
  color: var(--orange);
}

.red {
  color: var(--red);
}

.badge.green,
.badge.yellow,
.badge.orange,
.badge.red {
  background: color-mix(in srgb, currentColor 16%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 34%, transparent);
}

.memory-meter {
  margin-top: 24px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 10px;
}

.progress {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.14);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

.memory-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.trend {
  height: 96px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
  margin-top: 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.35);
}

.trend span {
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #38bdf8, #4ade80);
}

.risk-line {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.risk-line div {
  padding: 14px;
  border: 1px solid rgba(251, 146, 60, 0.26);
  border-radius: 8px;
  background: rgba(251, 146, 60, 0.11);
}

.risk-line strong {
  display: block;
  margin-top: 4px;
  color: #fed7aa;
}

.card-actions,
.mini-actions,
.modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.card-actions {
  margin-top: 18px;
}

.memory-breakdown {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.35);
}

.breakdown-heading,
.breakdown-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.breakdown-heading {
  margin-bottom: 12px;
}

.breakdown-row + .breakdown-row {
  margin-top: 10px;
}

.breakdown-label {
  color: #dbeafe;
  font-size: 13px;
}

.mini-progress {
  height: 7px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #4ade80);
}

.routing-visual {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 20px;
}

.donut {
  width: 170px;
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
}

.donut span {
  position: relative;
  z-index: 1;
  font-weight: 900;
}

.brain-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.38);
  padding: 16px;
}

.brain-panel strong,
.brain-panel small {
  display: block;
}

.brain-panel strong {
  margin: 8px 0 4px;
  font-size: 24px;
}

.brain-panel p {
  margin: 0 0 12px;
  color: #dbeafe;
}

.routing-health {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.64);
}

.routing-health strong {
  color: var(--green);
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.tabs button.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.4);
}

.routing-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
}

.model-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.model-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto minmax(82px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.35);
}

.model-row strong,
.model-row small {
  display: block;
}

.model-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.status-pill.active {
  color: var(--green);
  background: rgba(74, 222, 128, 0.1);
}

.status-pill.standby {
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
}

.status-pill.disabled {
  color: var(--faint);
  background: rgba(100, 116, 139, 0.12);
}

.status-pill.ready {
  color: var(--green);
  background: rgba(74, 222, 128, 0.1);
}

.status-pill.needs-review {
  color: var(--orange);
  background: rgba(251, 146, 60, 0.1);
}

.status-pill.missing {
  color: var(--red);
  background: rgba(248, 113, 113, 0.1);
}

.status-pill.placeholder {
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
}

.vault-header {
  align-items: center;
}

.vault-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-field,
.form-grid label,
.note-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-grid label {
  align-content: start;
  gap: 9px;
}

.form-grid label span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.search-field input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.note-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.58);
  color: var(--text);
  font: inherit;
  outline: 0;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  font-size: 14px;
}

.form-grid select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #94a3b8 50%),
    linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 13px) 18px;
  background-repeat: no-repeat;
  background-size:
    5px 5px,
    5px 5px;
}

.search-field input {
  min-width: 320px;
  min-height: 42px;
  padding: 0 12px;
}

.search-field input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.note-field textarea:focus {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.08);
}

.vault-mode-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.78);
}

.vault-mode-banner strong,
.vault-mode-banner small {
  display: block;
}

.vault-mode-banner small,
.safety-note,
.vault-card p,
.vault-card small,
.vault-count,
.drawer-meta span,
.reference-phrase span,
.note-field small,
.empty-state,
.placeholder-card p {
  color: var(--muted);
}

.vault-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vault-count {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
}

.filter-chips button {
  min-height: 34px;
}

.filter-chips button.active {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(56, 189, 248, 0.14);
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.vault-card {
  display: grid;
  gap: 16px;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.82);
  box-shadow: var(--shadow);
  text-align: left;
}

.vault-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 18px 46px rgba(14, 165, 233, 0.12);
  transform: translateY(-1px);
}

.vault-card.selected {
  border-color: rgba(56, 189, 248, 0.72);
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(74, 222, 128, 0.06)),
    rgba(16, 23, 34, 0.94);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.12),
    0 18px 54px rgba(14, 165, 233, 0.18);
}

.vault-card-top,
.vault-card-tags,
.vault-card-meta,
.drawer-header,
.drawer-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.vault-card h2 {
  margin: 0;
  font-size: 22px;
}

.vault-card p {
  margin: 0;
  line-height: 1.5;
}

.vault-card-meta {
  align-items: center;
  margin-top: auto;
}

.vault-card-meta strong {
  color: #bae6fd;
  font-size: 12px;
  font-weight: 900;
}

.vault-card-tags {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.category-badge,
.sensitivity-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  color: #bae6fd;
  font-size: 12px;
  font-weight: 800;
}

.sensitivity-badge.high {
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
}

.sensitivity-badge.medium {
  border-color: rgba(251, 146, 60, 0.34);
  background: rgba(251, 146, 60, 0.1);
  color: #fed7aa;
}

.sensitivity-badge.low {
  border-color: rgba(74, 222, 128, 0.34);
  background: rgba(74, 222, 128, 0.1);
  color: #bbf7d0;
}

.safety-note {
  margin: 18px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.35);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.72);
  text-align: center;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(2, 6, 12, 0.58);
  z-index: 9;
}

.vault-drawer {
  width: min(48vw, 760px);
  min-width: 640px;
  height: 100vh;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: #101722;
  box-shadow: var(--shadow);
  padding: 24px;
}

.drawer-header h2 {
  margin: 0;
  font-size: 30px;
}

.drawer-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.drawer-meta div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.42);
}

.drawer-meta strong {
  display: block;
  margin-top: 5px;
}

.reference-phrase {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.09);
}

.reference-phrase span,
.reference-phrase strong {
  display: block;
}

.reference-phrase strong {
  margin-top: 5px;
  color: #dbeafe;
}

.note-field {
  margin-top: 18px;
}

.note-field > span {
  color: var(--text);
  font-size: 15px;
}

.note-field small {
  font-weight: 500;
}

.note-field textarea {
  min-height: 520px;
  resize: vertical;
  padding: 14px;
  line-height: 1.55;
}

.drawer-actions {
  justify-content: flex-end;
  align-items: center;
  margin-top: 16px;
}

.save-feedback {
  margin-right: auto;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.credential-modal {
  width: min(760px, 100%);
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 18px;
  margin-top: 24px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select {
  height: 44px;
  min-height: 44px;
  padding: 0 13px;
  line-height: 44px;
}

.form-grid select {
  padding-right: 34px;
}

.form-grid textarea {
  min-height: 180px;
  padding: 13px;
  line-height: 1.5;
  resize: vertical;
}

.credential-modal .modal-actions {
  margin-top: 24px;
}

.credential-modal .modal-actions .button {
  min-height: 42px;
}

.placeholder-card {
  margin-top: 24px;
}

.kanban-header {
  align-items: center;
}

.kanban-mode-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.78);
}

.kanban-mode-banner strong,
.kanban-mode-banner small {
  display: block;
}

.kanban-mode-banner small,
.kanban-board-header span,
.kanban-board-header p,
.kanban-board-meta,
.kanban-column-header p,
.kanban-card small,
.kanban-empty {
  color: var(--muted);
}

.kanban-board-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 20px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(74, 222, 128, 0.06)),
    rgba(16, 23, 34, 0.82);
  box-shadow: var(--shadow);
}

.kanban-board-header h2 {
  margin: 5px 0 8px;
  font-size: 24px;
}

.kanban-board-header p {
  margin: 0;
  max-width: 720px;
  line-height: 1.5;
}

.kanban-board-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 800;
}

.kanban-columns {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kanban-column {
  min-height: 560px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.74);
  box-shadow: var(--shadow);
}

.kanban-column-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.kanban-column-header h2 {
  margin: 0;
  font-size: 18px;
}

.kanban-column-header p {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

.kanban-column-header > span {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 10, 15, 0.42);
  color: #dbeafe;
  font-weight: 900;
}

.kanban-add-card {
  width: 100%;
  margin-top: 12px;
}

.kanban-card-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.kanban-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.38);
  text-align: left;
}

.kanban-card:hover,
.kanban-card.selected {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 165, 233, 0.1);
  box-shadow: 0 16px 36px rgba(14, 165, 233, 0.12);
}

.kanban-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.kanban-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.owner-badge,
.section-badge,
.priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.1);
  font-size: 11px;
  font-weight: 900;
}

.owner-badge.wade {
  color: #bae6fd;
  border-color: rgba(56, 189, 248, 0.32);
  background: rgba(56, 189, 248, 0.1);
}

.owner-badge.london {
  color: #d8b4fe;
  border-color: rgba(167, 139, 250, 0.32);
  background: rgba(167, 139, 250, 0.1);
}

.owner-badge.gemini {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.32);
  background: rgba(74, 222, 128, 0.1);
}

.owner-badge.codex {
  color: #fed7aa;
  border-color: rgba(251, 146, 60, 0.32);
  background: rgba(251, 146, 60, 0.1);
}

.priority-badge.high {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(248, 113, 113, 0.1);
}

.priority-badge.medium {
  color: #fed7aa;
  border-color: rgba(251, 146, 60, 0.32);
  background: rgba(251, 146, 60, 0.1);
}

.priority-badge.low {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.32);
  background: rgba(74, 222, 128, 0.1);
}

.section-badge {
  color: #dbeafe;
}

.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.kanban-card-meta strong {
  color: #bae6fd;
  font-size: 12px;
}

.kanban-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.kanban-drawer .note-field textarea,
.kanban-form-grid textarea {
  min-height: 150px;
}

.kanban-drawer .kanban-form-grid textarea[name="notes"] {
  min-height: 260px;
}

.kanban-card-modal {
  width: min(820px, 100%);
}

.kanban-modal {
  display: flex;
  flex-direction: column;
  max-height: min(820px, calc(100vh - 40px));
  padding: 0;
}

.kanban-modal .modal-title-row {
  position: sticky;
  top: 0;
  z-index: 1;
  align-items: flex-start;
  padding: 24px 24px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: #101722;
}

.modal-close-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-weight: 900;
}

.kanban-modal-body {
  overflow: auto;
  padding: 0 24px;
}

.kanban-modal .kanban-form-grid {
  margin-top: 18px;
}

.kanban-modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: 22px;
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: #101722;
}

.kanban-modal-footer .button {
  min-height: 42px;
}

.runtime-list,
.alerts {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.alert {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 15, 0.35);
}

.alert p {
  margin: 0;
}

.alert strong {
  justify-self: end;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 9px;
  color: #e2e8f0;
  font-size: 12px;
  white-space: nowrap;
}

.alert span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
}

.alert.warning {
  color: var(--orange);
}

.alert.notice {
  color: var(--cyan);
}

.alert.success {
  color: var(--green);
}

.systems-section {
  margin-top: 22px;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.system-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 23, 34, 0.72);
}

.system-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(56, 189, 248, 0.1);
  color: #bae6fd;
  font-size: 13px;
  font-weight: 900;
}

.system-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.system-card p {
  margin: 6px 0;
}

.system-dot.connected {
  background: var(--green);
}

.system-dot.degraded {
  background: var(--orange);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  border: 1px solid rgba(74, 222, 128, 0.34);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.94);
  color: white;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 12, 0.72);
  z-index: 10;
}

.modal {
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101722;
  box-shadow: var(--shadow);
  padding: 22px;
}

.modal-copy {
  color: #dbeafe;
  line-height: 1.6;
}

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

.preview-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(7, 10, 15, 0.35);
}

.preview-grid h3 {
  margin: 0 0 10px;
}

.preview-grid ul {
  margin: 0;
  padding-left: 18px;
  color: #cbd5e1;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

@media (max-width: 1180px) {
  #app {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .hero-grid,
  .lower-grid,
  .summary-banner {
    grid-template-columns: 1fr;
  }

  .summary-banner {
    display: grid;
  }

  .summary-stats {
    min-width: 0;
  }

  .systems-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vault-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vault-drawer {
    width: min(72vw, 760px);
    min-width: 0;
  }
}

@media (max-width: 760px) {
  #app {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main {
    padding: 22px 16px;
  }

  .page-header,
  .card-title,
  .header-actions,
  .summary-stats,
  .memory-stats,
  .risk-line,
  .routing-visual,
  .systems-grid,
  .vault-grid,
  .drawer-meta,
  .form-grid,
  .preview-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search-field input {
    min-width: 0;
  }

  .vault-card {
    min-height: auto;
  }

  .vault-filter-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .vault-drawer {
    width: 100vw;
    min-width: 0;
    padding: 20px 16px;
  }

  .note-field textarea {
    min-height: 420px;
  }

  .hero-card {
    min-height: auto;
  }

  .model-row {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .model-row > strong,
  .status-pill,
  .alert strong {
    justify-self: start;
    margin-left: 22px;
  }

  .alert {
    grid-template-columns: 10px 1fr;
  }
}
