:root {
  --green: #304bb7;
  --green-dark: #233b94;
  --accent: #304bb7;
}
.lab-form-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:18px 0;}
.lab-form-grid label {display:flex;flex-direction:column;gap:8px;font-size:13px;color:#59655e;min-width:0;}
.lab-form-grid input,.lab-form-grid select,.lab-form-grid textarea {width:100%;box-sizing:border-box;}
.lab-form-grid textarea {min-height:78px;resize:vertical;}
.lab-form-grid input:disabled,.lab-form-grid textarea:disabled {color:#59655e;background:#f1f2ef;opacity:1;}
.lab-form-grid .lab-checkbox {flex-direction:row;align-items:center;}
.lab-checkbox input {width:auto;}
.lab-actor {border:1px solid #e0e4df;border-radius:10px;padding:15px 18px;margin-top:10px;background:#fdfdfa;}
.lab-actor summary {cursor:pointer;display:flex;gap:14px;align-items:baseline;}
.lab-actor summary span {font-size:12px;color:#7b817c;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.lab-submit {margin-top:20px;}
.lab-pair-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;}
.lab-pair {display:flex;flex-direction:column;gap:8px;align-items:flex-start;text-align:left;border:1px solid #e0e4df;border-radius:8px;padding:12px;background:#fafbf8;font-size:12px;}
.lab-pair span {color:#6c776e;}
.lab-direction {border-top:1px solid #e2e5df;margin-top:20px;padding-top:12px;}
.lab-rationale {background:#eef1fb;border-radius:8px;padding:18px;line-height:1.9;}
#dialog-body pre {white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;}
@media(max-width:900px){.lab-form-grid{grid-template-columns:1fr;}.lab-pair-grid{grid-template-columns:1fr;}}
body {
  background: #f5f5f1;
}
.brand-mark {
  background: #304bb7;
  color: #fff;
}
.sidebar {
  background: #fdfdf9;
}
.sidebar nav button.active {
  background: #e9ecfa;
  color: #293f9a;
}
.sidebar nav small {
  float: right;
  font-size: 10px;
  color: #7c807f;
}
.workspace {
  max-width: 1680px;
}
.coffee-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 22px;
}
.coffee-tabs button {
  border: 1px solid #dfe3df;
  background: #fff;
  padding: 8px 14px;
  border-radius: 8px;
}
.coffee-tabs button.active {
  background: #304bb7;
  border-color: #304bb7;
  color: white;
}
.ops-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.ops-filters label {
  min-width: 125px;
  flex: 1;
  font-size: 12px;
}
.ops-filters input,
.ops-filters select {
  width: 100%;
  margin-top: 7px;
}
.ops-filters .search-field {
  flex: 2;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.metric {
  padding: 20px;
  text-align: left;
  border: 1px solid #e1e4de;
  border-radius: 12px;
  background: #fff;
  color: #26322f;
}
.metric strong {
  font-size: 32px;
  display: block;
  margin: 10px 0 2px;
  font-weight: 650;
  letter-spacing: -1px;
}
.metric small {
  color: #78817c;
}
.metric.clickable:hover {
  border-color: #304bb7;
}
.metric-label {
  font-size: 13px;
  color: #65736c;
}
.section-title {
  margin: 0 0 14px;
  font-size: 18px;
}
.ops-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
  color: #6d786f;
  font-size: 13px;
}
.ops-pager div {
  display: flex;
  gap: 8px;
}
.ops-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ops-actions button {
  white-space: nowrap;
  font-size: 12px;
}
.short-id {
  font-family: monospace;
  font-size: 11px;
  color: #89908a;
}
.record-title {
  max-width: 320px;
  white-space: normal;
  line-height: 1.6;
}
.engine-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.logic-card {
  border: 1px solid #dfe4de;
  border-radius: 12px;
  padding: 22px;
  background: white;
}
.logic-card.selected {
  border: 2px solid #304bb7;
  background: #f8f9ff;
}
.logic-card p {
  font-size: 13px;
  color: #68736d;
  line-height: 1.8;
}
.logic-card h3 {
  margin: 0 0 12px;
}
.logic-card .primary {
  margin-top: 12px;
}
.policy-note {
  padding: 14px 18px;
  background: #edf0fb;
  border-radius: 9px;
  line-height: 1.8;
  font-size: 13px;
  margin-bottom: 20px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  font-size: 14px;
}
.detail-grid dt {
  color: #7b837b;
}
.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.technical {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e6e9e3;
}
.technical pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  background: #f5f6f2;
  padding: 14px;
  border-radius: 8px;
  max-height: 400px;
  overflow: auto;
}
.technical summary {
  cursor: pointer;
  color: #7a837b;
  font-size: 12px;
}
dialog {
  border: 1px solid #dce2d8;
  border-radius: 16px;
  width: min(960px, 92vw);
  max-height: 90vh;
  padding: 26px;
  color: #29352f;
  box-shadow: 0 24px 90px #1b292340;
}
dialog::backdrop {
  background: #14221e66;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}
.dialog-head h2 {
  margin: 0;
  font-size: 20px;
}
#dialog-body {
  max-height: 72vh;
  overflow: auto;
}
.muted-note {
  font-size: 12px;
  color: #7c867d;
  line-height: 1.8;
}
.heat-scroll {
  overflow-x: auto;
}
.heat-grid {
  display: grid;
  grid-template-columns: 40px repeat(48, minmax(12px, 1fr));
  gap: 3px;
  min-width: 850px;
  align-items: center;
}
.heat-grid .heat-label {
  font-size: 10px;
  color: #7c867d;
}
.heat-cell {
  border: 0;
  border-radius: 3px;
  height: 24px;
  min-width: 0;
  padding: 0;
  background: #eff1ed;
}
.heat-cell:disabled {
  opacity: 1;
  cursor: default;
}
.heat-cell:hover:not(:disabled) {
  outline: 2px solid #233b94;
}
.chart-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.trend-row {
  display: grid;
  grid-template-columns: 86px 1fr 46px;
  gap: 12px;
  align-items: center;
  margin: 8px 0;
  font-size: 12px;
}
.trend-row button {
  border: 0;
  border-radius: 4px;
  height: 17px;
  background: #304bb7;
  min-width: 3px;
  padding: 0;
}
.trend-row .bar-track {
  background: #f0f2ee;
  border-radius: 4px;
}
.link-count {
  color: #304bb7;
  border: 0;
  background: none;
  padding: 5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.identity {
  display: flex;
  gap: 10px;
  align-items: center;
}
.identity img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}
.empty-appeal {
  min-height: 350px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}
.empty-appeal .placeholder-mark {
  font-size: 38px;
  color: #b5bfdb;
  margin-bottom: 12px;
}
.empty-appeal p {
  max-width: 450px;
  line-height: 1.9;
}
.badge.pending,
.badge.running {
  background: #edf0fb;
  color: #304bb7;
}
.badge.failed,
.badge.rejected {
  background: #fbeee9;
  color: #a25038;
}
.mini-history {
  font-size: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf0e9;
}
.loading {
  padding: 32px;
  color: #798178;
}
.form-error:empty {
  display: none;
}
@media (max-width: 1000px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .engine-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .ops-filters label {
    min-width: 40%;
  }
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .detail-grid dd {
    margin-bottom: 12px;
  }
  .metric {
    padding: 14px;
  }
  .metric strong {
    font-size: 27px;
  }
  dialog {
    padding: 16px;
  }
  .ops-pager {
    flex-wrap: wrap;
  }
}
:root {
  --green-soft: #edf0fb;
}
.sidebar {
  color: #29352f;
  border-right: 1px solid #e3e7df;
}
.sidebar-brand small {
  color: #748078;
}
.sidebar #nav button {
  color: #5a665f;
}
.sidebar #nav button:hover {
  color: #293f9a;
  background: #f0f2fb;
}
.sidebar #nav button.active {
  color: #293f9a;
  background: #e9ecfa;
  font-weight: 650;
}
.sidebar-footer {
  border-top: 1px solid #e3e7df;
}
.sidebar-footer .muted {
  color: #7a857e;
}
.sidebar-footer .text-button {
  color: #46594d;
}
.primary:hover {
  background: #233b94;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #304bb7;
  box-shadow: 0 0 0 3px #304bb718;
}
.chart-legend select {
  width: 170px;
}
.eyebrow {
  color: #77836f;
}
