:root {
  --bg: #f4f6f8;
  --paper: #fff;
  --ink: #26313d;
  --muted: #65717e;
  --line: #dce2e7;
  --forest: #2c506d;
  --green: #346957;
  --soft: #f1f4f6;
  --orange: #965d33;
  --red: #a5483d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 13px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid #4c7f9f;
  outline-offset: 3px;
}
a {
  color: var(--forest);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.55px;
  line-height: 1.2;
  margin-bottom: 9px;
}
h2 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
h3 {
  font-size: 13px;
  font-weight: 600;
}
p {
  line-height: 1.6;
}
small,
.muted {
  color: var(--muted);
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 196px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 28px 15px 20px;
  display: flex;
  flex-direction: column;
  z-index: 4;
}
.brand {
  display: block;
  text-decoration: none;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.4px;
  margin: 0 14px 36px;
  color: var(--ink);
}
.brand span {
  font-weight: 400;
  color: var(--muted);
}
.nav-label,
.tiny-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.nav-label {
  margin: 0 14px 10px;
}
.nav-button {
  display: block;
  width: 100%;
  padding: 11px 13px;
  margin-bottom: 3px;
  text-align: left;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  color: #4c5863;
  font-size: 12px;
}
.nav-button.active {
  background: #edf2f6;
  border-left-color: var(--forest);
  color: #234965;
  font-weight: 600;
}
.nav-button:not(.active):hover {
  background: #f5f6f7;
}
.sidebar-note {
  margin: 32px 14px 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.sidebar-note dl {
  margin: 15px 0 0;
  font-size: 11px;
}
.sidebar-note dt {
  color: var(--muted);
  margin-top: 14px;
}
.sidebar-note dd {
  margin: 4px 0 0;
  line-height: 1.5;
}
.sidebar-footer {
  margin-top: auto;
  padding: 35px 14px 0;
  font-size: 11px;
  line-height: 1.7;
  color: #52616e;
}
.sidebar-footer small {
  font-size: 10px;
}
.shell {
  margin-left: 196px;
}
.topbar {
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  color: var(--muted);
  font-size: 11px;
}
.topbar strong {
  color: var(--ink);
  font-weight: 500;
}
.slash {
  margin: 0 10px;
  color: #a0a8af;
}
.snapshot-pill {
  color: #546371;
  font-size: 11px;
}
main {
  max-width: 1640px;
  margin: 0 auto;
  padding: 28px 30px 32px;
  min-height: calc(100vh - 112px);
}
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 23px;
}
.hero p {
  color: var(--muted);
  font-size: 12px;
  max-width: 730px;
  margin-bottom: 0;
}
.hero-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.primary,
.secondary,
.quiet {
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
.primary {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}
.primary:hover {
  background: #213e57;
}
.secondary {
  background: white;
  border-color: #cbd3da;
  color: #354655;
}
.secondary:hover {
  background: #f4f6f8;
}
.quiet {
  background: transparent;
  color: var(--forest);
  padding: 4px 0;
  font-size: 11px;
}
.quiet:hover {
  text-decoration: underline;
}
.banner {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-left: 3px solid #8a9dab;
  background: #edf1f4;
  padding: 11px 14px;
  margin-bottom: 20px;
  color: #53616c;
  font-size: 11px;
  line-height: 1.6;
}
.banner strong {
  color: #394b58;
  white-space: nowrap;
  font-weight: 600;
}
.badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.2;
  padding: 4px 6px;
  border: 1px solid #dce4e8;
  border-radius: 3px;
  color: #516570;
  background: #f4f7f9;
  font-weight: 500;
}
.badge.high {
  background: #fbf2e9;
  color: #875432;
  border-color: #eedccc;
}
.badge.medium {
  background: #faf7e9;
  color: #816d31;
  border-color: #e9e0bd;
}
.badge.low {
  background: #eff5ef;
  color: #536f55;
  border-color: #dbe6da;
}
.badge.pending {
  background: #faf5e7;
  color: #826927;
  border-color: #eadfbf;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: #fff;
  margin-bottom: 22px;
}
.metric {
  padding: 17px 19px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.metric:last-child {
  border-right: 0;
}
.metric .label {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}
.metric .value {
  font-size: 25px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.55px;
}
.metric .detail {
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 8px;
}
.operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 274px;
  gap: 18px;
  align-items: start;
}
.operations-aside {
  display: grid;
  gap: 18px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
  min-width: 0;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.panel-heading h2 {
  margin: 0;
}
.panel-heading p {
  font-size: 11px;
  color: var(--muted);
  margin: 5px 0 0;
  line-height: 1.5;
}
.panel-heading small {
  font-size: 10px;
}
.queue-panel {
  padding: 0;
}
.queue-panel > .panel-heading {
  padding: 18px 18px 0;
}
.queue-panel > .table-note {
  padding: 12px 18px 16px;
}
.queue-panel th:nth-child(4),
.queue-panel td:nth-child(4) {
  display: none;
}
.allocation-total {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.allocation-total strong {
  font-size: 20px;
  font-weight: 600;
}
.allocation-total span {
  color: var(--muted);
  font-size: 11px;
}
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e8ecef;
  padding: 10px 0;
  font-size: 11px;
}
.action-count {
  font-weight: 600;
}
.callout {
  border-left: 2px solid #c7d2dc;
  background: #f5f7f8;
  padding: 10px 12px;
  font-size: 11px;
  color: #5d6c77;
  line-height: 1.6;
  margin-top: 15px;
}
.distribution-row {
  display: grid;
  grid-template-columns: 52px 1fr 24px;
  align-items: center;
  gap: 10px;
  margin: 13px 0;
  font-size: 11px;
}
.distribution-row > span:first-child {
  color: var(--muted);
}
.distribution-row strong {
  text-align: right;
  font-weight: 500;
}
.distribution-track {
  height: 6px;
  background: #eef1f3;
}
.distribution-track i {
  height: 100%;
  display: block;
  background: #758fa2;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  text-align: left;
}
th {
  font-size: 10px;
  font-weight: 600;
  color: #586774;
  padding: 11px 10px;
  background: #f6f8f9;
  border-block: 1px solid var(--line);
}
td {
  padding: 12px 10px;
  border-bottom: 1px solid #e8ecef;
  font-size: 11px;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #f8fafb;
}
.customer-button {
  border: 0;
  background: none;
  color: var(--forest);
  font-weight: 600;
  padding: 0;
  font-size: inherit;
}
.customer-button:hover {
  text-decoration: underline;
}
.risk-meter {
  display: inline-block;
  width: 30px;
  height: 4px;
  background: #e9edf0;
  margin-right: 6px;
  vertical-align: middle;
  overflow: hidden;
}
.risk-meter i {
  display: block;
  height: 100%;
  background: #788fa0;
}
.table-note {
  font-size: 10px;
  color: var(--muted);
  padding-top: 14px;
  line-height: 1.6;
  margin-bottom: 0;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 30px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  font-size: 9px;
  color: #7c8790;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.toolbar input {
  flex: 1;
  min-width: 180px;
}
.input,
input[type="search"],
select,
textarea {
  border: 1px solid #cbd4dc;
  background: #fff;
  border-radius: 3px;
  padding: 9px 11px;
  color: var(--ink);
  font-size: 12px;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  font-size: 11px;
  color: var(--muted);
}
.pagination button {
  padding: 6px 11px;
}
.planner-grid {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.controls label {
  display: block;
  font-size: 11px;
  margin-bottom: 8px;
  color: #596874;
}
.control-block {
  margin-bottom: 20px;
}
.control-value {
  font-size: 20px;
  font-weight: 550;
  margin: 7px 0 10px;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--forest);
  cursor: pointer;
}
.range-ends {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #73808b;
  margin-top: 5px;
}
.check-label {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.6;
  color: var(--ink) !important;
}
input[type="checkbox"] {
  accent-color: var(--forest);
  margin-top: 3px;
}
.controls details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.controls summary {
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 15px;
}
.controls .input {
  width: 100%;
}
.controls .primary {
  width: 100%;
}
.agent-intro {
  margin-bottom: 18px;
}
.agent-intro h2 {
  margin: 0 0 6px;
}
.agent-intro p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
.prompt-box {
  width: 100%;
  resize: vertical;
  min-height: 105px;
  line-height: 1.7;
  font-size: 12px;
}
.prompt-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 12px;
}
.prompt-bottom small {
  font-size: 10px;
  line-height: 1.6;
}
.suggestion {
  border: 1px solid #d7dfe5;
  background: #f7f9fa;
  padding: 6px 9px;
  border-radius: 3px;
  color: #526b7e;
  font-size: 11px;
  margin: 0 5px 6px 0;
}
.suggestions {
  margin-top: 12px;
}
.plan-space {
  margin-top: 20px;
}
.plan-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  margin: 17px 0;
}
.plan-summary > div {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}
.plan-summary > div:last-child {
  border-right: 0;
}
.plan-summary small {
  font-size: 10px;
  display: block;
  margin-bottom: 6px;
}
.plan-summary strong {
  font-size: 19px;
  font-weight: 550;
}
.rationale {
  font-size: 12px;
  color: #4e5d68;
  white-space: pre-wrap;
  line-height: 1.8;
  padding: 12px 14px;
  border-left: 2px solid #a7b9c8;
  background: #f6f8fa;
  margin: 15px 0;
}
.review-box {
  padding: 16px;
  background: #fcfaf4;
  border: 1px solid #e7e0cb;
  border-radius: 3px;
  margin-top: 18px;
  font-size: 12px;
}
.review-box p {
  margin: 8px 0 12px;
  color: #6c685b;
  font-size: 11px;
}
.review-box .check-label {
  font-size: 11px;
}
.review-buttons {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.trace {
  margin-top: 18px;
}
.trace summary {
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
}
.trace-step {
  border-left: 2px solid #d9e1e7;
  padding: 10px 0 10px 13px;
  margin-left: 5px;
  font-size: 11px;
}
.trace-step code {
  font-size: 11px;
}
.trace-step details {
  margin-top: 8px;
}
.trace-step pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f4f6f8;
  padding: 12px;
  font-size: 10px;
  max-height: 240px;
  overflow: auto;
}
.empty-state {
  padding: 29px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.error {
  background: #fdf3ee;
  border: 1px solid #ebcdbd;
  border-radius: 3px;
  color: #8d5035;
  padding: 13px;
  font-size: 12px;
  margin-top: 14px;
}
.history-row {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}
.history-row small {
  line-height: 1.8;
  font-size: 10px;
}
.evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.evidence-grid img {
  width: 100%;
  height: auto;
}
.evidence-grid p,
.evidence-grid li {
  font-size: 12px;
  color: #596874;
  line-height: 1.8;
}
.evidence-grid ul {
  padding-left: 18px;
}
.number-list {
  list-style: none;
  padding: 0 !important;
  counter-reset: item;
}
.number-list li {
  counter-increment: item;
  margin: 14px 0;
  display: flex;
  gap: 12px;
}
.number-list li:before {
  content: counter(item) ".";
  font-size: 12px;
  font-weight: 600;
  color: var(--forest);
}
.key-value {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.signal {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.signal code {
  overflow-wrap: anywhere;
  white-space: normal;
}
.mini-title,
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.4px;
  margin: 23px 0 9px;
}
dialog {
  border: 1px solid #ccd5dc;
  border-radius: 5px;
  width: min(800px, 94vw);
  max-height: 88vh;
  padding: 28px;
  color: var(--ink);
}
dialog::backdrop {
  background: #26384770;
}
.dialog-close {
  position: absolute;
  right: 13px;
  top: 10px;
  background: none;
  border: 0;
  font-size: 24px;
  color: var(--muted);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
dialog h2 {
  font-size: 24px;
  margin: 8px 0;
}
dialog p {
  font-size: 12px;
}
.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  background: #334a5c;
  color: #fff;
  border-radius: 4px;
  padding: 12px 18px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}
#toast.show {
  opacity: 1;
}
.running {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 17px;
  font-size: 12px;
  color: var(--forest);
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #d5e0e7;
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.download-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.download-links a {
  text-decoration: none;
}
@media (max-width: 1280px) {
  .sidebar {
    width: 180px;
    padding-inline: 12px;
  }
  .shell {
    margin-left: 180px;
  }
  main {
    padding: 24px;
  }
  .topbar {
    padding-inline: 24px;
  }
  .operations-grid {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 16px;
  }
  .operations-aside .panel {
    padding: 16px;
  }
  .queue-panel th:nth-child(2),
  .queue-panel td:nth-child(2) {
    display: none;
  }
  .hero {
    align-items: flex-start;
  }
  .hero-actions {
    flex-direction: column;
  }
  .metric {
    padding: 15px;
  }
  .metric .value {
    font-size: 22px;
  }
}
@media (max-width: 1020px) {
  .operations-grid {
    grid-template-columns: 1fr;
  }
  .operations-aside {
    grid-template-columns: 1fr 1fr;
  }
  .queue-panel th:nth-child(2),
  .queue-panel td:nth-child(2) {
    display: table-cell;
  }
  .planner-grid {
    grid-template-columns: 235px minmax(0, 1fr);
    gap: 16px;
  }
  .panel {
    padding: 17px;
  }
  .queue-panel {
    padding: 0;
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .metric:nth-child(2) {
    border-right: 0;
  }
  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .banner {
    display: block;
  }
  .banner strong {
    display: block;
    margin-bottom: 3px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 16px 18px 0;
    border-right: 0;
  }
  .brand {
    font-size: 18px;
    margin: 0;
  }
  .brand br {
    display: none;
  }
  .brand span {
    margin-left: 4px;
  }
  .sidebar nav {
    display: flex;
    gap: 4px;
    margin-top: 16px;
    overflow-x: auto;
  }
  .nav-button {
    white-space: nowrap;
    width: auto;
    flex-shrink: 0;
    font-size: 11px;
    padding: 10px 11px;
    margin: 0;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }
  .nav-button.active {
    border-bottom-color: var(--forest);
  }
  .nav-label,
  .sidebar-note,
  .sidebar-footer {
    display: none;
  }
  .shell {
    margin-left: 0;
  }
  .topbar {
    height: 45px;
    padding-inline: 18px;
    font-size: 10px;
  }
  .snapshot-pill {
    font-size: 10px;
  }
  .slash {
    margin-inline: 5px;
  }
  main {
    padding: 22px 18px;
  }
  h1 {
    font-size: 24px;
  }
  .hero {
    display: block;
  }
  .hero-actions {
    flex-direction: row;
    margin-top: 16px;
  }
  .hero p {
    font-size: 12px;
  }
  .metric .value {
    font-size: 21px;
  }
  .metric .label {
    font-size: 10px;
  }
  .metric .detail {
    font-size: 10px;
  }
  .operations-aside,
  .planner-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }
  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
  }
  .controls h2,
  .controls details,
  .controls > .primary,
  .controls > .callout {
    grid-column: 1/-1;
  }
  .control-block {
    margin-bottom: 7px;
  }
  .controls .control-value {
    font-size: 19px;
  }
  .page-footer {
    margin-inline: 18px;
    font-size: 8px;
    line-height: 1.7;
  }
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .banner {
    font-size: 10px;
  }
  .plan-summary > div {
    padding: 10px;
  }
  .plan-summary strong {
    font-size: 16px;
  }
  .plan-summary small {
    font-size: 9px;
  }
  .prompt-bottom {
    align-items: flex-start;
  }
  .prompt-bottom .primary {
    flex-shrink: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}

.plot {
  width: 100%;
  height: auto;
  display: block;
  margin: 6px 0 0;
}

.plot text {
  font-size: 11px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}

.plot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 6px 0 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.plot-legend .key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.plot-legend i {
  width: 15px;
  height: 2px;
  border-radius: 1px;
  display: inline-block;
}

.plot-legend i.dash {
  height: 0;
  background: none !important;
  border-top: 2px dashed #aab6c0;
}

.panel figure {
  margin: 0;
}

.plot .axis-title {
  font-size: 10.5px;
  fill: var(--muted);
  letter-spacing: 0.02em;
}

.plot .direct {
  font-size: 10.5px;
  font-weight: 600;
}

.plot .value {
  font-size: 10.5px;
  fill: var(--ink);
}

.plot .guide {
  font-size: 10px;
}
