:root {
  color-scheme: dark;
  --bg: #0d1517;
  --panel: #131e21;
  --border: #29383b;
  --teal: #83dbc5;
  --amber: #e8ab7b;
  --muted: #8a9ea1;
  --ink: #e5eeeb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.55 ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
}
header {
  height: 76px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
a {
  color: inherit;
  text-decoration: none;
}
.brand {
  font-size: 13px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.brand-mark {
  font-size: 33px;
  color: var(--teal);
  margin-right: 8px;
}
.header-note {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}
.badge {
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 1px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge i,
.tiny-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  margin-right: 7px;
}
.workspace {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}
.sidebar {
  padding: 38px 22px;
  border-right: 1px solid var(--border);
  background: #10191b;
  display: flex;
  flex-direction: column;
  width: auto;
}
.eyebrow {
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 1.6px;
  color: var(--muted);
}
h1 {
  font-size: 35px;
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -1.5px;
  margin: 18px 0;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.sidebar nav {
  margin-top: 32px;
  display: grid;
  gap: 10px;
}
.view-tab {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: transparent;
  padding: 13px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
  width: 100%;
  color: #b9c8c8;
}
.view-tab > span:last-child {
  margin-left: auto;
  color: #637c80;
  font:
    10px ui-monospace,
    monospace;
}
.view-tab small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
  white-space: normal;
}
.view-tab.active {
  background: #1b302e;
  border-color: #34564e;
  color: #d5f7ed;
}
.nav-symbol {
  font-size: 21px;
  color: var(--teal);
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 80px;
  font-size: 11px;
  color: var(--muted);
}
.sidebar-bottom a {
  display: block;
  margin-top: 25px;
  color: var(--teal);
}
main {
  padding: 35px 34px 16px;
  min-width: 0;
  max-width: 1700px;
  width: 100%;
  margin: auto;
}
h2 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -1px;
  margin: 8px 0;
}
h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 5px 0;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  margin-bottom: 18px;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.status {
  min-height: 24px;
  font-size: 12px;
  color: var(--teal);
  margin-bottom: 14px;
}
.status.error {
  color: var(--amber);
}
button,
select,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}
.primary,
.outline,
.quiet {
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
}
.primary {
  background: var(--teal);
  color: #102623;
  border: 1px solid var(--teal);
  font-weight: 600;
}
.primary:hover {
  background: #a2e8d7;
}
.outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid #3a4d50;
}
.outline:hover {
  background: #203134;
  border-color: #648781;
}
.quiet {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}
.control-strip {
  display: flex;
  gap: 20px;
  align-items: end;
  border: 1px solid var(--border);
  padding: 17px 20px;
  background: #131e20;
  border-radius: 8px;
}
.control-buttons {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
label {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
select,
input:not([type="range"]):not([type="file"]),
textarea {
  display: block;
  background: #0e191c;
  color: var(--ink);
  border: 1px solid #33474a;
  border-radius: 5px;
  padding: 9px 11px;
  margin-top: 6px;
  max-width: 100%;
  width: 100%;
  min-height: 38px;
}
select {
  min-width: 70px;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
  margin: 12px 0 20px;
  height: 4px;
}
textarea {
  resize: vertical;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 21px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101b1e;
}
.metrics > div {
  padding: 17px 22px;
  border-right: 1px solid var(--border);
}
.metrics > div:last-child {
  border: 0;
}
.metrics span {
  display: block;
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1px;
  color: var(--muted);
}
.metrics strong {
  display: block;
  font:
    26px ui-monospace,
    monospace;
  letter-spacing: -1px;
  margin-top: 10px;
}
.metrics small {
  font:
    10px ui-sans-serif,
    system-ui;
  letter-spacing: 0;
  color: var(--muted);
}
.network-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 235px;
  gap: 18px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  min-width: 0;
  margin-bottom: 18px;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.pill {
  display: inline-block;
  border: 1px solid #35484b;
  border-radius: 5px;
  padding: 4px 8px;
  font:
    10px ui-monospace,
    monospace;
  color: var(--muted);
  white-space: nowrap;
}
.network-panel {
  padding-bottom: 14px;
  background: radial-gradient(ellipse at center, #1a2b2d 0%, #121d20 75%);
}
canvas {
  display: block;
  width: 100%;
  height: 250px;
  border: 0;
  border-radius: 0;
  background: transparent;
  touch-action: manipulation;
}
#network-canvas {
  height: 320px;
  cursor: crosshair;
}
.canvas-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  color: var(--muted);
}
.key {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin: 0 5px 0 9px;
}
.teal {
  background: var(--teal);
}
.amber {
  background: var(--amber);
}
.inspector h3 {
  margin-top: 13px;
}
.activation-number {
  font:
    42px ui-monospace,
    monospace;
  color: var(--teal);
  letter-spacing: -2px;
  margin: 15px 0 10px;
}
.inspector p {
  font-size: 11px;
  color: var(--muted);
}
.divider {
  height: 1px;
  background: var(--border);
  margin: 21px 0;
}
output {
  float: right;
  color: var(--ink);
  font-family: ui-monospace, monospace;
}
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.fine {
  font-size: 10px;
  color: var(--muted);
  margin: 12px 0 0;
  line-height: 1.7;
}
.teal-text {
  color: var(--teal);
  font-size: 11px;
}
.footnote {
  color: var(--muted);
  font-size: 11px;
  margin: 0 0 20px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.file-label {
  color: var(--teal);
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}
.file-label input {
  display: none;
}
footer {
  display: flex;
  align-items: center;
  font:
    9px ui-monospace,
    monospace;
  letter-spacing: 1px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 12px;
}
footer > span:last-child {
  margin-left: auto;
  letter-spacing: 0;
}
.view[hidden],
[hidden] {
  display: none !important;
}
.notice {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0;
  padding: 13px 17px;
  border: 1px solid #4e4b3b;
  border-radius: 6px;
  background: #24251f;
  font-size: 11px;
  color: #c6bda4;
}
.notice b {
  color: #e3c596;
  white-space: nowrap;
}
.decoder-input > label:first-child {
  flex: 1;
}
.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 22px;
}
.stage {
  border: 1px solid #35484b;
  border-radius: 5px;
  background: #101b1e;
  color: var(--muted);
  font-size: 11px;
  padding: 14px 8px;
}
.stage.active {
  color: var(--teal);
  border-color: #6cae9c;
  background: #1d3431;
}
.stage small {
  display: block;
  font:
    9px ui-monospace,
    monospace;
  margin-bottom: 6px;
  color: var(--muted);
}
.stage-detail {
  padding: 17px 0;
  font-size: 12px;
  color: #b2c8c8;
  min-height: 58px;
}
.tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.token {
  padding: 6px 10px;
  background: #233a38;
  border: 1px solid #3e5e57;
  color: #bde9dc;
  border-radius: 4px;
  font:
    12px ui-monospace,
    monospace;
}
.token small {
  font-size: 9px;
  color: #90aaa4;
  margin-left: 7px;
}
.token.unknown {
  border-color: #a77651;
  color: var(--amber);
}
#decoder-attention,
#local-attention,
#local-activations {
  height: 350px;
}
.probabilities {
  min-height: 280px;
  padding-top: 10px;
}
.probability {
  display: grid;
  grid-template-columns: 75px 1fr 48px;
  gap: 12px;
  align-items: center;
  margin-bottom: 17px;
  font:
    11px ui-monospace,
    monospace;
}
.bar-track {
  height: 7px;
  background: #243638;
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 3px;
}
.full {
  width: 100%;
}
.grow {
  flex: 1;
}
.inference-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 14px;
}
.inline-controls {
  display: flex;
  gap: 10px;
}
#local-output {
  margin-top: 20px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.embedding-preview {
  font:
    12px/2 ui-monospace,
    monospace;
  color: var(--teal);
}
summary {
  cursor: pointer;
  color: #c9ded8;
  font-size: 13px;
}
.table-scroll {
  max-height: 320px;
  overflow: auto;
  margin-top: 15px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font:
    11px ui-monospace,
    monospace;
}
th,
td {
  padding: 9px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 400;
}
#local-provenance {
  overflow-wrap: anywhere;
}
@media (min-width: 1600px) {
  main {
    padding: 40px 50px;
  }
  .workspace {
    grid-template-columns: 255px 1fr;
  }
  .sidebar {
    padding: 40px 28px;
  }
  #network-canvas {
    height: 350px;
  }
}
@media (max-width: 1150px) {
  .workspace {
    grid-template-columns: 195px minmax(0, 1fr);
  }
  .sidebar {
    padding: 30px 14px;
  }
  main {
    padding: 26px 22px;
  }
  .control-strip {
    gap: 12px;
    flex-wrap: wrap;
  }
  .control-buttons {
    margin-left: 0;
  }
  .network-grid {
    grid-template-columns: minmax(0, 1fr) 200px;
  }
  .metrics > div {
    padding: 15px 12px;
  }
  .metrics strong {
    font-size: 22px;
  }
  .panel {
    padding: 16px;
  }
  .panel-heading {
    flex-wrap: wrap;
  }
  .view-tab {
    padding: 12px 6px;
    gap: 7px;
  }
  .view-tab > span:last-child {
    display: none;
  }
  .pill {
    font-size: 9px;
  }
}
@media (max-width: 800px) {
  header {
    padding: 0 18px;
    height: 64px;
  }
  .header-note {
    display: none;
  }
  .badge {
    margin-left: auto;
    font-size: 9px;
  }
  .workspace {
    display: block;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 15px 18px;
  }
  .sidebar > h1,
  .sidebar > .muted,
  .sidebar-bottom,
  .sidebar > .eyebrow {
    display: none;
  }
  .sidebar nav {
    margin: 0;
    display: flex;
    gap: 7px;
  }
  .view-tab {
    justify-content: center;
    font-size: 11px;
    padding: 9px;
  }
  .view-tab small,
  .nav-symbol {
    display: none;
  }
  main {
    padding: 25px 18px;
  }
  .network-grid {
    grid-template-columns: minmax(0, 1fr) 190px;
  }
  h2 {
    font-size: 27px;
  }
  .page-heading .outline {
    padding: 9px;
  }
  .metrics strong {
    font-size: 21px;
  }
  .metrics span {
    font-size: 8px;
  }
  .notice {
    align-items: start;
    flex-direction: column;
    gap: 7px;
  }
  .pipeline {
    gap: 5px;
  }
  .stage {
    font-size: 10px;
    padding: 12px 3px;
  }
  .footnote {
    flex-wrap: wrap;
  }
}
@media (max-width: 580px) {
  .brand {
    font-size: 10px;
    gap: 4px;
    letter-spacing: 0.5px;
  }
  .brand-mark {
    font-size: 27px;
  }
  .badge {
    padding: 6px;
    font-size: 8px;
  }
  .page-heading {
    align-items: start;
  }
  .page-heading .outline {
    font-size: 10px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .page-heading p {
    font-size: 12px;
  }
  .control-strip {
    padding: 14px;
    gap: 12px;
  }
  .control-strip > label {
    width: 100%;
  }
  .control-buttons {
    width: 100%;
    flex-wrap: wrap;
    gap: 5px;
  }
  .primary,
  .outline,
  .quiet {
    padding: 9px 11px;
    font-size: 11px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
    margin: 16px 0;
  }
  .metrics > div:nth-child(2) {
    border-right: 0;
  }
  .metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
  .network-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  #network-canvas {
    height: 280px;
  }
  .inspector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .inspector > .eyebrow,
  .inspector > h3,
  .inspector > p {
    grid-column: 1/-1;
  }
  .inspector > h3 {
    margin: 0;
  }
  .inspector .activation-number {
    font-size: 32px;
    margin: 0;
  }
  .inspector #neuron-detail {
    grid-column: 2;
    font-size: 10px;
    margin: 0;
  }
  .inspector .divider {
    display: none;
  }
  .inspector input {
    margin-bottom: 4px;
  }
  .canvas-footer {
    font-size: 8px;
  }
  .panel-heading h3 {
    font-size: 14px;
  }
  .pipeline {
    grid-template-columns: repeat(3, 1fr);
  }
  .stage-detail {
    font-size: 11px;
  }
  .inference-actions {
    align-items: start;
    flex-direction: column;
  }
  .inline-controls select {
    min-width: 55px;
  }
  .footnote {
    font-size: 10px;
  }
  footer > span:last-child {
    display: none;
  }
  #decoder-attention,
  #local-attention,
  #local-activations {
    height: 300px;
  }
}

@media (max-width: 580px) {
  .control-strip > .grow {
    flex-basis: 100%;
  }
}

.generated-answer {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 15px/1.7 inherit;
  margin: 16px 0;
  color: var(--text, #e6efed);
}
#agent-flow {
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
}
#agent-flow .pill {
  white-space: normal;
}
#agent-step {
  max-width: 160px;
}
#agent-task-controls .control-strip {
  padding: 0 0 10px;
}
#agent-live-status {
  color: #83dbc5;
}
#agent-decoder {
  height: 220px;
}
#agent-encoder {
  height: 370px;
}

.generation-tokens {
  max-height: 150px;
  overflow-y: auto;
  padding: 3px;
}
.generation-tokens .token {
  cursor: pointer;
  font: inherit;
  padding: 5px 9px;
}
.generation-tokens .token[aria-pressed="true"] {
  outline: 1px solid #83dbc5;
  background: #25483f;
}

/* Atlas workbench extends the same model-lab panels and numerical state. */
.mechanism-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.mechanism-panels .panel {
  min-width: 0;
}
.mechanism-panels h3 {
  min-height: 48px;
  margin-top: 8px;
}
.mechanism-equation {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--teal);
  margin-bottom: 18px;
}
#mechanism-controls {
  padding: 14px 0;
  flex-wrap: wrap;
}
#mechanism-controls input[type="number"] {
  width: 120px;
}
#mechanism-metrics strong {
  font-size: 22px;
  overflow-wrap: anywhere;
}
#mechanism-trace-control {
  max-width: 520px;
}
#mechanism-trace-detail {
  overflow-wrap: anywhere;
}
.atlas-matches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 2px;
}
.atlas-match {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  white-space: normal;
}
.atlas-match small {
  color: var(--muted);
  font-weight: normal;
}
.atlas-detail {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.atlas-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.atlas-link {
  text-align: left;
  white-space: normal;
  font-size: 12px;
  font-weight: normal;
}
.atlas-references {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}
.atlas-reference {
  color: var(--teal);
  text-decoration: underline;
  font-size: 12px;
}
#atlas-editorial {
  overflow-wrap: anywhere;
}
@media (max-width: 1150px) {
  .mechanism-panels {
    grid-template-columns: 1fr;
  }
  .mechanism-panels h3 {
    min-height: 0;
  }
}
@media (max-width: 580px) {
  .sidebar nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .atlas-matches {
    grid-template-columns: 1fr 1fr;
  }
  .atlas-panel .panel-heading {
    flex-wrap: wrap;
    gap: 10px;
  }
  #mechanism-controls input[type="number"] {
    width: 100%;
  }
}

.atlas-match,
.atlas-link {
  background: #0d191c;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px 12px;
  line-height: 1.5;
}
.atlas-match:hover,
.atlas-link:hover {
  border-color: var(--teal);
  background: #19312c;
}
.atlas-match[aria-pressed="true"] {
  border-color: var(--teal);
  background: #19312c;
}
/* Connected model experiments use the existing workbench palette. */
#experiments-view .panel {
  margin-bottom: 20px;
  min-width: 0;
}
#experiments-view .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
#experiments-view .control-strip {
  flex-wrap: wrap;
}
#experiments-view .control-strip label {
  min-width: 120px;
}
#experiments-view input[type="number"] {
  max-width: 150px;
}
#experiments-view textarea {
  width: 100%;
  margin: 8px 0 14px;
}
.experiment-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.experiment-charts canvas {
  width: 100%;
  height: 160px;
}
.gradient-row {
  display: flex;
  justify-content: space-between;
  font: 11px monospace;
  border-bottom: 1px solid var(--border);
  padding: 3px;
}
.experiment-output {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 230px;
  overflow: auto;
  line-height: 1.65;
  font:
    12px/1.65 ui-monospace,
    monospace;
  background: #0d191c;
  padding: 14px;
  border-radius: 6px;
}
.experiment-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.experiment-metrics small,
.experiment-metrics strong {
  display: block;
}
.experiment-metrics small {
  color: var(--muted);
}
.experiment-metrics strong {
  margin: 6px 0;
  font:
    18px ui-monospace,
    monospace;
}
.graph-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
}
.model-graph {
  position: relative;
  height: 480px;
  overflow: auto;
  min-width: 0;
}
.model-graph svg {
  width: 100%;
  display: block;
  pointer-events: none;
}
.graph-node {
  position: absolute;
  height: 70px;
  overflow: hidden;
  padding: 9px;
  color: var(--ink);
  background: #132523;
  border: 1px solid #3c655b;
  border-radius: 6px;
  text-align: left;
}
.graph-node strong {
  display: block;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.graph-node small {
  display: block;
  color: var(--muted);
  font: 10px monospace;
  margin-top: 5px;
}
.graph-node[aria-pressed="true"] {
  border-color: var(--teal);
  background: #24443b;
}
.graph-inspector {
  min-width: 0;
}
.graph-inspector h3 {
  overflow-wrap: anywhere;
}
.evaluation-row {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
.file-button {
  cursor: pointer;
}
@media (max-width: 1000px) {
  .graph-workspace {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 580px) {
  .experiment-charts {
    grid-template-columns: 1fr;
  }
  .experiment-metrics {
    grid-template-columns: 1fr 1fr;
  }
  #experiments-view .control-strip label {
    width: 100%;
  }
  #experiments-view input[type="number"] {
    max-width: 100%;
  }
  .sidebar nav [data-view="experiments"] {
    grid-column: 1/-1;
  }
}
