* {
  box-sizing: border-box;
}
:root {
  color-scheme: light;
  --ink: #20332f;
  --deep: #153e35;
  --green: #17684f;
  --mint: #e7f2ed;
  --line: #dce6e1;
  --muted: #71827b;
  --paper: #fff;
  --wash: #f3f6f4;
  --shadow: 0 10px 30px rgba(28, 64, 51, 0.06);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--wash);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
html {
  min-width: 320px;
  min-height: 100%;
  background: var(--wash);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--wash);
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.topbar {
  height: 70px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 5vw, 72px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--deep);
  text-decoration: none;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.4px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  background: var(--deep);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}
.brand small {
  display: block;
  margin-top: 3px;
  color: #769087;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.15px;
}
.session-area {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 32px clamp(14px, 4vw, 58px) 70px;
}
h1,
h2,
h3 {
  margin: 0;
  color: var(--deep);
  letter-spacing: -0.55px;
}
h1 {
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.18;
  font-weight: 750;
}
h2 {
  font-size: 19px;
  line-height: 1.35;
}
h3 {
  font-size: 15px;
  line-height: 1.4;
}
p {
  line-height: 1.55;
}
.eyebrow {
  margin-bottom: 7px;
  color: #7d958a;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 10px;
  font-weight: 750;
}
.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 20px;
  margin: 3px 0 25px;
}
.page-heading > div:first-child p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.scale-guide {
  grid-column: 1;
  grid-row: 2;
  background: #edf5f0;
  border: 1px solid #d8e9df;
  border-radius: 9px;
  padding: 10px 13px;
  color: #4c695b;
  font-size: 11px;
  line-height: 1.55;
}
.page-heading > .button {
  grid-column: 2;
  grid-row: 1 / span 2;
  white-space: nowrap;
}
.tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 21px;
}
.tab {
  padding: 13px 17px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #6c8178;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.tab:hover {
  color: var(--green);
}
.tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}
.panel {
  display: none;
}
.panel.active {
  display: block;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.case-list-card {
  overflow: hidden;
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.case-list-card > .card-heading {
  padding: 19px 20px 15px;
}
.count-pill {
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--mint);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}
.case-list {
  max-height: calc(100vh - 250px);
  min-height: 210px;
  overflow: auto;
  border-top: 1px solid #edf1ef;
}
.case-item {
  display: block;
  width: 100%;
  padding: 14px 17px;
  border: 0;
  border-bottom: 1px solid #edf1ef;
  background: #fff;
  text-align: left;
  color: #30443d;
}
.case-item:hover,
.case-item.selected {
  background: #f4faf7;
}
.case-item.selected {
  box-shadow: inset 3px 0 var(--green);
}
.case-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.4;
}
.case-item span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #bac8c1;
}
.status-dot.done {
  background: #40a078;
}
.detail-card {
  min-width: 0;
  min-height: 500px;
  padding: clamp(18px, 3vw, 32px);
}
.empty {
  padding: 22px;
  color: #809087;
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}
.large-empty {
  display: flex;
  min-height: 420px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.large-empty p {
  max-width: 430px;
  color: var(--muted);
}
.empty-icon {
  margin-bottom: 12px;
  color: #69a98b;
  font-size: 31px;
}
.button {
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  transition:
    background 0.15s,
    transform 0.15s,
    border-color 0.15s;
}
.button:hover {
  transform: translateY(-1px);
}
.button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}
.primary {
  background: var(--green);
  color: #fff;
}
.primary:hover {
  background: #0e5941;
}
.secondary {
  border-color: var(--line);
  background: #f4f7f5;
  color: #3c5d50;
}
.secondary:hover,
.ghost:hover {
  background: #e9f2ed;
}
.ghost {
  padding: 7px 12px;
  border-color: var(--line);
  background: #fff;
  color: #526a60;
}
.icon-button {
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 8px;
  background: #f1f5f3;
  color: #60766b;
  font-size: 22px;
}
.case-question {
  margin: 17px 0;
  padding: 14px 16px;
  border: 1px solid #e6eeea;
  border-radius: 11px;
  background: #f5f8f6;
}
.case-question p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  font-size: 14px;
}
.detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 13px 0 20px;
}
.coverage-note {
  color: #74857c;
  font-size: 11px;
}
.reference-details {
  margin: 12px 0;
}
.reference-details summary {
  color: #637b70;
  font-size: 12px;
  cursor: pointer;
}
.reference-details .reference-box {
  margin-top: 8px;
}
.reference-box {
  padding: 12px;
  border: 1px solid #f1e5c7;
  border-radius: 8px;
  background: #fffaf0;
  font-size: 12px;
  white-space: pre-wrap;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 11px;
}
.section-heading h3 {
  margin: 0;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.small {
  font-size: 11px !important;
}
.chip {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 20px;
  background: #eff5f1;
  color: #507364;
  font-size: 10px;
}
.evidence-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.answer-box {
  padding: 13px 15px;
  border-left: 3px solid #53a17c;
  border-radius: 4px 9px 9px 4px;
  background: #f6faf7;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.metadata-detail {
  display: grid;
  grid-template-columns: minmax(90px, 140px) minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid #edf1ef;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.metadata-detail b {
  color: #688075;
  font-weight: 650;
}
.run-result {
  margin: 13px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.rating-overall {
  background: #fbfcfb;
}
.dimension {
  display: grid;
  grid-template-columns: minmax(125px, 180px) 1fr;
  align-items: center;
  gap: 9px;
  margin: 10px 0;
  color: #60736b;
  font-size: 12px;
}
.dimension-rating,
.rating-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.rating-label {
  color: #708078;
  font-size: 11px;
  margin-right: 4px;
}
.star {
  min-width: 29px;
  height: 29px;
  padding: 0 6px;
  border: 0;
  border-radius: 7px;
  background: #f0f4f2;
  color: #80938a;
  font-size: 13px;
}
.star:hover {
  background: #e4eee8;
}
.star.active {
  background: #fff3d8;
  color: #9b6910;
}
.star.na {
  font-size: 10px;
  font-weight: 700;
}
.star:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.evidence-card {
  margin: 10px 0;
  padding: 14px;
  border: 1px solid #e3ebe6;
  border-radius: 11px;
  background: #fff;
}
.evidence-text {
  margin: 7px 0;
  white-space: pre-wrap;
  color: #374b43;
  font-size: 13px;
  line-height: 1.6;
}
.asset {
  margin-top: 9px;
  padding: 10px;
  border: 1px solid #e5ece8;
  border-radius: 8px;
  background: #fafcfb;
  font-size: 12px;
  overflow: auto;
}
.asset pre,
.section-excerpt pre {
  margin: 7px 0;
  color: #374b43;
  font: 12px/1.55 inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.field-note {
  width: 100%;
  margin-top: 8px;
}
input,
textarea,
select {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #d5e0da;
  border-radius: 8px;
  background: #fff;
  color: #273c34;
  font-size: 13px;
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #72a990;
  box-shadow: 0 0 0 3px rgba(62, 143, 106, 0.1);
}
textarea {
  resize: vertical;
}
label {
  display: block;
  margin: 12px 0;
  color: #52675d;
  font-size: 12px;
  font-weight: 650;
}
label input,
label textarea,
label select {
  display: block;
  width: 100%;
  margin-top: 6px;
}
.claim-evidence-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.claim-evidence-choices label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 3px 0;
  font-weight: 500;
}
.claim-evidence-check {
  width: auto;
  margin: 0;
  accent-color: var(--green);
}
.remove-claim {
  margin-top: 4px;
}
.catalog-layout {
  display: grid;
  grid-template-columns: minmax(260px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.catalog-card,
.node-detail,
.stats-card {
  min-width: 0;
  padding: 20px;
}
.catalog-search {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}
.catalog-search input {
  flex: 1;
}
.tree {
  max-height: 68vh;
  margin-top: 15px;
  overflow: auto;
}
.tree-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-top: 4px;
  padding-bottom: 4px;
  border-radius: 6px;
}
.tree-row:hover {
  background: #f3f8f5;
}
.tree-toggle {
  width: 23px;
  height: 25px;
  flex: 0 0 23px;
  border: 0;
  background: transparent;
  color: #658073;
}
.tree-node {
  flex: 1;
  min-width: 0;
  padding: 5px 4px;
  border: 0;
  background: transparent;
  color: #3a5046;
  text-align: left;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.tree-node:hover,
.tree-node.selected {
  color: var(--green);
  font-weight: 700;
}
.tree-kind {
  flex: 0 0 auto;
  padding: 3px 5px;
  border-radius: 5px;
  background: #f0f4f2;
  color: #809188;
  font-size: 9px;
}
.node-path {
  padding: 10px;
  border-radius: 8px;
  background: #f5f8f6;
  color: #668076;
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.node-fields {
  margin-top: 11px;
}
.node-field {
  margin: 9px 0;
  padding: 9px 12px;
  border: 1px solid #edf1ef;
  border-radius: 9px;
}
.node-field .metadata-detail {
  padding: 4px 0;
  border: 0;
}
.node-field .dimension {
  margin: 5px 0;
}
.node-field .dimension-rating {
  gap: 3px;
}
.node-field .star {
  min-width: 25px;
  height: 25px;
}
.node-field .correction {
  width: 100%;
  font-size: 11px;
}
.source-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 15px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.source-status legend {
  padding: 0 5px;
  color: #678075;
  font-size: 11px;
  font-weight: 700;
}
.source-status label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 11px;
  font-weight: 500;
}
.source-status input {
  width: auto;
  margin: 0;
  accent-color: var(--green);
}
.section-content {
  margin: 10px 0;
}
.section-excerpt {
  margin: 8px 0;
  padding: 10px;
  border: 1px solid #e3ebe6;
  border-radius: 8px;
  background: #fafcfb;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.stat-tile {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.stat-tile > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.stat-tile strong {
  display: block;
  margin: 7px 0;
  color: var(--deep);
  font-size: 25px;
  letter-spacing: -0.5px;
}
.distribution {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 48px;
  margin-top: 12px;
}
.dist-col {
  flex: 1;
  color: #809087;
  text-align: center;
  font-size: 9px;
}
.dist-bar {
  min-height: 2px;
  margin-bottom: 4px;
  border-radius: 4px 4px 0 0;
  background: #78b393;
}
.stat-wide {
  grid-column: 1/-1;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfb;
}
.stat-wide h3 {
  margin-bottom: 10px;
}
.stat-wide .metadata-detail {
  padding: 7px 0;
}
.modal {
  width: min(560px, calc(100% - 28px));
  max-height: 90vh;
  padding: 0;
  border: 0;
  border-radius: 15px;
  box-shadow: 0 24px 80px #102b2360;
  overflow: auto;
}
.modal::backdrop {
  background: #142a236b;
  backdrop-filter: blur(2px);
}
.modal form {
  padding: 24px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 17px;
}
.privacy-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
  line-height: 1.5;
}
.privacy-check input {
  width: auto;
  flex: 0 0 auto;
  margin: 2px 0;
  accent-color: var(--green);
}
.error {
  min-height: 15px;
  color: #a73838;
  font-size: 12px;
}
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  padding: 12px 17px;
  border-radius: 9px;
  background: #193f34;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.login-card {
  width: min(470px, calc(100% - 20px));
  margin: 8vh auto;
  padding: clamp(22px, 5vw, 38px);
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow);
}
.login-card > p {
  color: var(--muted);
  font-size: 13px;
}
.stack {
  display: grid;
  gap: 6px;
}
.stack label {
  margin: 7px 0;
}
.stack .button {
  margin-top: 6px;
}
.scale-guide b {
  color: #365f4d;
}
@media (max-width: 900px) {
  .workspace,
  .catalog-layout {
    grid-template-columns: 1fr;
  }
  .case-list {
    max-height: 270px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
  .tree {
    max-height: 50vh;
  }
  .node-detail {
    min-height: 220px;
  }
}
@media (max-width: 560px) {
  .topbar {
    height: 62px;
    padding: 0 14px;
  }
  .session-area {
    font-size: 11px;
  }
  main {
    padding: 22px 12px 52px;
  }
  .page-heading {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .page-heading > div:first-child {
    grid-column: 1;
  }
  .scale-guide {
    grid-column: 1;
    grid-row: auto;
  }
  .page-heading > .button {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }
  .tabs {
    margin-left: -12px;
    margin-right: -12px;
    padding: 0 7px;
  }
  .tab {
    padding: 12px 11px;
    font-size: 12px;
  }
  .detail-card {
    padding: 17px 13px;
  }
  .catalog-card,
  .node-detail,
  .stats-card {
    padding: 16px 12px;
  }
  .dimension {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .metadata-detail {
    grid-template-columns: 95px minmax(0, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .stat-tile {
    padding: 11px;
  }
  .stat-tile strong {
    font-size: 21px;
  }
  .stat-wide {
    grid-column: 1/-1;
  }
  .modal form {
    padding: 18px;
  }
  .case-question {
    padding: 12px;
  }
  .large-empty {
    min-height: 330px;
  }
}
