:root {
  --font-display: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
  --radius-sm: 2px;
  --radius-md: 4px;
  --surface: #ffffff;
  --subtle: #e8f2ef;
  --line: #d5e3df;
  --line-strong: #b8ccc7;
  --ink: #162b31;
  --ink-soft: #587078;
  --brand: #16803f;
  --brand-hover: #0d6630;
  --brand-bg: #e4f5e8;
  --success: #0d6b54;
  --success-bg: #ddf4e9;
  --warning: #936300;
  --warning-bg: #fff0c9;
  --danger: #b9382e;
  --danger-bg: #fce5e1;
  --focus-ring: 2px solid var(--brand);
  --leaf: #16803f;
  --leaf-hover: #116833;
  --leaf-deep: #0e562a;
  --leaf-faint: #eaf5ed;
  --sprout: #b8e23a;
  --sprout-dark: #5e7a10;
  --rule: #d5e3df;
  --rule-light: #e6eeec;
  --ink-muted: #52666a;
  --ink-faint: #809699;
  --graphite: #162b31;
  --graphite-dark: #0f1e22;
  --paper: #f4f7f6;
  --surface-subtle: #f8faf9;
  font-family: "Manrope", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: #f4f7f6;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

::selection {
  background: rgb(22 128 63 / 20%);
  color: var(--ink);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ink-soft);
}

body {
  margin: 0;
}

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

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

button {
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 7px 11px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

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

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

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

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.sidebar {
  background: var(--ink);
  color: #d4deeb;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  color: #fff;
  font-size: 21px;
  text-decoration: none;
  font-weight: 700;
  padding: 0 10px;
}

nav {
  display: grid;
  gap: 4px;
}

nav a {
  text-decoration: none;
  color: #b6c4d6;
  padding: 9px 10px;
  border-radius: 4px;
}

nav a.active,
nav a:hover {
  background: rgb(255 255 255 / 10%);
  color: white;
}

.sidebar footer {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 10px;
  border-top: 1px solid rgb(255 255 255 / 12%);
  font-size: 12px;
}

.sidebar footer span:first-child {
  color: #8ee1bd;
}

main {
  min-width: 0;
}

.bar {
  min-height: 72px;
  padding: 14px 28px;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bar div {
  display: grid;
  gap: 3px;
}

.bar small {
  color: var(--ink-soft);
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#scope {
  display: flex;
  gap: 8px;
}

#scope select {
  width: auto;
  min-width: 120px;
  padding: 6px 8px;
  font-size: 12px;
}

#mobile-nav {
  display: none;
}

#mobile-nav-toggle {
  display: none;
}

#screen {
  padding: 26px 28px;
  max-width: 1420px;
}

#notice {
  min-height: 0;
  padding: 0 28px;
  color: #b42318;
}

#notice:not(:empty) {
  padding-top: 12px;
}

#notice.notice-success {
  color: #16803f;
}

#notice.notice-error {
  color: #b42318;
}

#notice.notice-info {
  color: #587078;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.grid.two {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
}

.stat {
  display: grid;
  gap: 6px;
}

.stat span,
.muted,
small {
  color: var(--ink-soft);
}

.stat strong {
  font-size: 27px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.data-table-scroll {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}
.data-table-scroll td { overflow-wrap: anywhere; }

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

th {
  color: var(--ink-soft);
  font-weight: 600;
}

.status {
  display: inline-block;
  border-radius: 12px;
  padding: 2px 8px;
  background: var(--subtle);
  color: var(--ink-soft);
  font-size: 12px;
}

.status.active,
.status.running {
  background: #e7f5ec;
  color: #197444;
}

.status.failed,
.status.invalid {
  background: #fdeceb;
  color: #b42318;
}

.status.awaiting_approval {
  background: #fff4d6;
  color: #946600;
}

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

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 5px;
  color: #3e4c60;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #b7c2d0;
  border-radius: 4px;
  padding: 8px;
  background: white;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.event {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--subtle);
  margin: 7px 0;
  font-size: 13px;
}

.event time {
  color: var(--ink-soft);
  font-size: 11px;
  display: block;
  margin-top: 5px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  gap: 4px;
}

.tabs button {
  border: 0;
  border-radius: 0;
}

.tabs button.active {
  border-bottom: 2px solid var(--brand);
  color: var(--brand);
}

.split {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

.list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #e5eaf0;
  padding: 11px;
}

.list button.selected {
  background: var(--brand-bg);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--gold);
}

.risk {
  color: #946600;
  background: #fff4d6;
  padding: 8px;
}

.error {
  color: #b42318;
  background: #fdeceb;
  padding: 8px;
}

.validation {
  margin: 10px 0;
  padding: 10px 10px 10px 28px;
  font-size: 13px;
}

.validation.error {
  color: #b42318;
  background: #fdeceb;
}

.validation.warning {
  color: #946600;
  background: #fff4d6;
}

.slot {
  border: 1px dashed var(--line-strong);
  padding: 16px;
  color: var(--ink-soft);
}

.artifact-preview {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--subtle);
}

.artifact-preview .actions {
  justify-content: space-between;
  align-items: center;
}

.artifact-preview h3 {
  margin: 0;
}

.artifact-preview pre {
  max-height: 360px;
  margin: 10px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #172033;
}

code {
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .bar {
    padding: 10px 18px;
    align-items: flex-start;
  }
  .route-heading {
    min-width: 0;
  }
  .route-heading small {
    line-height: 1.2;
  }
  .bar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
  }
  #scope select {
    min-width: 0;
    max-width: 114px;
  }
  #mobile-nav-toggle {
    display: inline-block;
  }
  #mobile-nav {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px 18px 14px;
    background: var(--ink);
    gap: 4px;
  }
  #mobile-nav.open {
    display: grid;
  }
  #mobile-nav a {
    color: #d4deeb;
    padding: 9px 10px;
  }
  .grid.stats,
  .grid.two,
  .split {
    grid-template-columns: 1fr;
  }
  #screen {
    padding: 18px;
  }
  .workspace-layout {
    min-height: 0;
  }
}
.capability-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.capability-evidence.is-detail {
  padding-block: 12px;
  border-block: 1px solid var(--line);
}
.brand-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
