:root {
  --ink: var(--color-ink);
  --muted: var(--color-muted);
  --green: var(--color-accent);
  --soft: var(--color-accent-soft);
  --line: var(--color-line);
  --bg: var(--color-bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.65 var(--font-sans);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a {
  color: var(--green);
}
button,
input,
select {
  font: inherit;
}
button {
  background: var(--green);
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  color: white;
  cursor: pointer;
}
button.secondary {
  background: #e5eee7;
  color: var(--green);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #81bda3;
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  top: -70px;
  left: 20px;
  background: #fff;
  padding: 12px;
  z-index: 100;
}
.skip-link:focus {
  top: 8px;
}
main {
  max-width: 1800px;
  margin: auto;
  padding: 28px 32px 60px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 20px;
}
.overline {
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--green);
  margin: 0 0 7px;
}
h1 {
  font-size: 29px;
  letter-spacing: -0.04em;
  line-height: 1.4;
  margin: 0 0 8px;
}
h2 {
  font-size: 14px;
  margin: 0;
}
h3 {
  font-size: 13px;
  margin: 16px 0 6px;
}
p {
  margin: 6px 0;
}
.intro {
  color: var(--muted);
  font-size: 13px;
}
.muted {
  color: var(--muted);
  font-size: 11px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 15px 0;
}
.summary-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 19px;
}
.summary-item strong {
  font-size: 25px;
  display: block;
  line-height: 1.4;
}
.summary-item span {
  color: var(--muted);
  font-size: 11px;
}
.scope-note {
  border-left: 3px solid #91b5a2;
  background: #edf3ed;
  padding: 12px 16px;
  font-size: 12px;
  margin: 20px 0;
}
.scope-note strong {
  font-size: 12px;
}
.scope-note p {
  color: #546b5c;
  margin-bottom: 0;
}
.search-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 22px 0 10px;
}
.search-bar label {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.search-bar label:first-child {
  flex: 1;
}
.search-bar input,
.search-bar select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cad8ce;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  margin-top: 5px;
  height: 43px;
}
.search-bar select {
  min-width: 150px;
}
.search-bar button {
  height: 43px;
  white-space: nowrap;
}
#load-status {
  font-size: 12px;
  min-height: 22px;
  color: var(--muted);
  margin: 12px 0;
}
.evidence-workspace {
  display: grid;
  grid-template-columns: 230px minmax(360px, 1fr) 310px;
  gap: 14px;
  align-items: start;
}
.node-sidebar,
.graph-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  min-width: 0;
}
.node-sidebar {
  padding: 15px 11px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.node-sidebar .section-heading {
  padding: 0 7px 10px;
}
.node-list {
  max-height: 630px;
  overflow: auto;
}
.node-button {
  display: block;
  text-align: left;
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  padding: 10px 8px;
  border-radius: 7px;
  margin: 4px 0;
  font-size: 11px;
  line-height: 1.6;
}
.node-button > span {
  display: block;
}
.node-button .node-type {
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 2px;
}
.node-button[aria-pressed="true"] {
  background: #e9f2eb;
  border-color: #bad2c0;
  color: var(--green);
}
.graph-panel {
  padding: 17px;
  min-height: 540px;
}
.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin: 16px 0;
  font-size: 9px;
  color: var(--muted);
}
.legend {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend:before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ba9a1;
}
.legend.verified:before {
  background: #377b50;
}
.legend.partial:before {
  background: #c6953e;
}
.legend.review:before {
  background: #b66d5b;
}
.graph-canvas {
  overflow: auto;
  border: 1px solid #edf1ec;
  border-radius: 8px;
  background: #fcfdfb;
  min-height: 380px;
  max-height: 630px;
}
.graph-canvas svg {
  display: block;
  min-width: 100%;
}
.graph-hint {
  font-size: 10px;
  color: var(--muted);
  margin-top: 12px;
}
.kg-edge {
  fill: none;
  stroke: #c9d8cd;
  stroke-width: 1.4;
}
.kg-edge-secondary {
  opacity: 0.28;
}
svg.kg-hovering .kg-edge {
  opacity: 0.12;
}
svg.kg-hovering .kg-edge.kg-edge-hot {
  opacity: 1;
  stroke: var(--color-accent);
  stroke-width: 2;
}
.kg-edge-label {
  font-size: 9px;
  fill: #7b9081;
  paint-order: stroke;
  stroke: #fcfdfb;
  stroke-width: 3px;
  stroke-linejoin: round;
}
.kg-node {
  cursor: pointer;
}
.kg-node rect {
  fill: white;
  stroke: #d0ddd3;
  stroke-width: 1.2;
}
.kg-node:hover rect,
.kg-node:focus rect {
  stroke: #4b8d66;
  stroke-width: 2;
}
.kg-node.selected rect {
  fill: #eaf4ed;
  stroke: #317b51;
  stroke-width: 2;
}
.kg-node text {
  font-size: 10px;
  fill: #284834;
  font-family: var(--font-sans);
}
.kg-node .kg-type {
  font-size: 9px;
  fill: #788d7d;
}
.kg-status {
  fill: #9eaaa2;
}
.kg-status.verified {
  fill: #377b50;
}
.kg-status.partial {
  fill: #c6953e;
}
.kg-status.review {
  fill: #b66d5b;
}
.kg-column {
  font-size: 10px;
  fill: #8c9c90;
  font-family: var(--font-sans);
}
.detail-panel {
  padding: 18px;
  min-height: 540px;
  max-height: 760px;
  overflow: auto;
}
.detail-panel h2 {
  font-size: 16px;
  line-height: 1.6;
  margin: 8px 0 12px;
}
.detail-type {
  font-size: 10px;
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.detail-section {
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.detail-section p,
.detail-section li {
  font-size: 11px;
  line-height: 1.8;
  color: #52685b;
}
.detail-section ul {
  padding-left: 17px;
}
.detail-section dl {
  margin: 0;
  font-size: 11px;
}
.detail-section dt {
  color: var(--muted);
  margin-top: 9px;
}
.detail-section dd {
  margin: 2px 0;
  color: var(--ink);
}
.related-link {
  display: block;
  color: var(--green);
  background: #eef4ee;
  border: 1px solid #dce6dd;
  padding: 8px 10px;
  width: 100%;
  text-align: left;
  font-size: 11px;
  margin: 7px 0;
}
.detail-reference {
  display: block;
  margin: 14px 0;
  font-size: 12px;
}
.coverage-details {
  margin-top: 22px;
  padding: 15px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
}
.coverage-details summary {
  cursor: pointer;
  color: var(--green);
}
.coverage-details li {
  margin: 8px 0;
}
.empty-state {
  padding: 30px 15px;
  color: var(--muted);
  font-size: 12px;
}
.error-state {
  color: #a34d3c !important;
}
.detail-warning {
  padding: 10px;
  background: #fff4df;
  border-radius: 7px;
  font-size: 11px;
  color: #795e2c;
  margin-top: 13px;
}
@media (max-width: 1200px) {
  .evidence-workspace {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .detail-panel {
    grid-column: 2;
    min-height: 0;
    max-height: none;
  }
  .node-sidebar {
    grid-row: 1/3;
  }
  .summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 760px) {
  main {
    padding: 20px 15px 40px;
  }
  .page-heading {
    display: block;
  }
  h1 {
    font-size: 25px;
  }
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .summary-item {
    padding: 12px;
  }
  .search-bar {
    flex-wrap: wrap;
  }
  .search-bar label:first-child {
    flex-basis: 100%;
  }
  .search-bar label:nth-child(2) {
    flex: 1;
  }
  .evidence-workspace {
    display: block;
  }
  .node-sidebar,
  .graph-panel,
  .detail-panel {
    margin-top: 12px;
  }
  .node-list {
    max-height: 190px;
  }
  .graph-panel,
  .detail-panel {
    min-height: 0;
  }
  .graph-canvas {
    min-height: 300px;
  }
  .node-button {
    padding: 7px 8px;
  }
  .node-sidebar .section-heading {
    padding-bottom: 4px;
  }
  .graph-panel {
    padding: 13px;
  }
}
.node-group > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 4px;
}

/* Antibiotic list and detail (default view). */
.abx-view {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.abx-sidebar,
.abx-detail {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
}
.abx-sidebar {
  padding: 14px;
  position: sticky;
  top: 12px;
}
.abx-search {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.abx-search input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
#abx-count {
  margin: 10px 0 6px;
  font-size: 12px;
}
.abx-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: calc(100vh - 260px);
  overflow: auto;
}
.abx-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text, #1f2f29);
  cursor: pointer;
}
.abx-item:hover {
  background: #f3f7f4;
}
.abx-item[aria-pressed="true"] {
  background: #e6f1ed;
  box-shadow: inset 3px 0 0 #17635a;
}
.abx-item-title {
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.abx-item-title strong {
  font-size: 14px;
}
.abx-route {
  font-size: 11px;
  color: var(--muted);
}
.abx-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}
.abx-guideline-count {
  color: #17635a;
  font-weight: 700;
}
.aware {
  padding: 0 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}
.aware-access {
  background: #e5f3ea;
  color: #2f7d4f;
}
.aware-watch {
  background: #fdf1dc;
  color: #8f5a10;
}
.aware-reserve {
  background: #fbe7e3;
  color: #b23a2b;
}
.aware-none {
  background: #eef1ef;
  color: #66706b;
}
.abx-empty {
  padding: 12px 6px;
  font-size: 13px;
}
.abx-detail {
  padding: 22px 26px;
}
.abx-detail-head h2 {
  margin: 0;
  font-size: 24px;
}
.abx-en {
  margin: 2px 0 0;
  color: var(--muted);
}
.abx-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin: 10px 0 0;
  font-size: 13px;
}
.abx-section {
  margin-top: 24px;
}
.abx-section h3 {
  font-size: 16px;
  margin: 0 0 10px;
}
.abx-guideline {
  border: 1px solid var(--line);
  border-left: 4px solid #17635a;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
}
.abx-guideline-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.abx-guideline-head h4 {
  margin: 0;
  font-size: 15px;
}
.abx-verified {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.abx-guideline-summary {
  margin: 6px 0;
  font-size: 13px;
}
.abx-dose {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 8px 0;
  padding: 10px 12px;
  background: #f6f9f7;
  border-radius: 6px;
  font-size: 13px;
}
.abx-dose dt,
.abx-basics dt {
  color: var(--muted);
}
.abx-dose dd,
.abx-basics dd {
  margin: 0;
}
.abx-source {
  margin: 6px 0;
  font-size: 12px;
  color: var(--muted);
}
.abx-review-points {
  list-style: none;
  margin: 0;
  padding: 0;
}
.abx-review-points li {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.abx-review-points .asp-area {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  border-radius: 5px;
  background: #fdf1dc;
  color: #8f5a10;
  font-size: 11px;
  font-weight: 700;
}
.link-button {
  background: none;
  border: 0;
  padding: 0;
  color: #17635a;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.abx-basics {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 13px;
  margin: 0 0 8px;
}
.abx-products,
.abx-note {
  font-size: 12px;
}
.graph-view .evidence-workspace {
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
}
.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: #17635a;
}
@media (max-width: 900px) {
  .abx-view,
  .graph-view .evidence-workspace {
    grid-template-columns: 1fr;
  }
  .abx-sidebar {
    position: static;
  }
  .abx-list {
    max-height: 45vh;
  }
  .abx-detail {
    padding: 16px;
  }
}
.abx-view[hidden],
.graph-view[hidden],
.graph-panel[hidden] {
  display: none;
}

.abx-filters {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.abx-filters button {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.abx-filters button[aria-pressed="true"] {
  background: #17635a;
  border-color: #17635a;
  color: white;
}
.kr-managed {
  padding: 0 6px;
  border-radius: 5px;
  background: #e3eef7;
  color: #2e6f9e;
  font-weight: 700;
}
.kr-unlisted {
  color: #9aa5a0;
}
/* Weight calculator: label mg/kg times the entered body weight. */
.weight-calc {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-surface-muted);
}
.weight-calc label {
  font-weight: 600;
}
.weight-calc input {
  width: 7em;
  min-height: 36px;
  margin-left: 6px;
  font-size: 16px;
}
.weight-result {
  margin: 2px 0;
  font-weight: 600;
}

.weight-calc label { display: inline-flex; align-items: center; gap: .5rem; margin: .4rem .8rem .4rem 0; }
.weight-calc label[hidden] { display: none; }
.weight-calc select { padding: .5rem; max-width: 100%; }
