.atb {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 1380px;
  margin: auto;
}
.atb-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.atb h1 {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  margin: 0.3rem 0;
}
.atb h2 {
  font-size: 1.3rem;
}
.atb h3 {
  font-size: 1.05rem;
}
.atb-meta {
  font-size: 0.8rem;
  color: #607180;
}
.atb-context {
  font-size: 0.875rem;
  max-width: 960px;
}
.atb-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 22px 0;
}
.atb-tools > div {
  display: flex;
  gap: 6px;
  margin-right: auto;
}
.atb .chip,
.atb-dialog .chip {
  font-size: 0.875rem;
  min-height: 40px;
}
.atb .chip[aria-pressed='true'],
.atb-dialog .chip[aria-pressed='true'] {
  background: #176e68;
  color: white;
  border-color: #176e68;
}
.atb .chip:hover,
.atb-dialog .chip:hover {
  border-color: #176e68;
  background: #e8f4f2;
  color: #125b56;
}
.atb .chip[aria-pressed='true']:hover {
  background: #125b56;
  color: white;
}
.atb button:focus-visible,
.atb a:focus-visible,
.atb-dialog button:focus-visible {
  outline: 3px solid #38a59c;
  outline-offset: 3px;
}
.atb button:active {
  transform: translateY(1px);
}
.atb button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.atb-urgent {
  background: #a93838;
  white-space: nowrap;
}
.atb-search-row {
  display: flex;
  gap: 16px;
  align-items: end;
}
.atb-search-row .field {
  flex: 1;
}
.atb-system-select {
  max-width: 360px;
  margin-top: 16px;
}
.atb-system {
  margin: 24px 0;
}
.atb-system h2 {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: #596f7c;
  border-bottom: 1px solid #dbe6eb;
  padding-bottom: 9px;
}
.atb-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.atb-card {
  position: relative;
  background: white;
  border: 1px solid #dce7eb;
  border-radius: 14px;
  padding: 18px 38px 18px 18px;
  color: #1d3647;
  text-decoration: none;
  transition:
    transform 0.18s,
    box-shadow 0.18s,
    border-color 0.18s;
}
.atb-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px #1b536313;
  border-color: #79b9b0;
}
.atb-card-code {
  font-size: 0.75rem;
  color: #65828e;
}
.atb-card h3 {
  margin: 6px 0;
  font-weight: 600;
}
.atb-card-summary {
  margin: 0 0 8px;
  color: #5d7480;
  font-size: 0.8rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.atb-card-arrow {
  position: absolute;
  right: 16px;
  top: 42%;
  color: #168078;
}
.atb-card small {
  font-size: 0.75rem;
}
.atb-detail-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
.atb-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.5fr);
  gap: 22px;
  align-items: start;
}
.atb-inputs {
  padding: 22px;
}
.atb-inputs .field {
  margin: 12px 0;
}
.atb-question {
  border: 0;
  padding: 0;
  margin: 18px 0;
}
.atb-question legend {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.atb-question button {
  margin: 0 5px 5px 0;
}
.atb-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.atb-notice {
  padding: 18px;
  border-radius: 12px;
  background: #eef3f7;
  border: 1px solid #d6e2ea;
  margin: 12px 0;
}
.atb-notice p {
  margin: 8px 0 0;
}
.atb-notice.green {
  background: #eaf6f0;
  border-color: #bfdccb;
  color: #205f46;
}
.atb-notice.red,
.atb-referral {
  background: #fff0ee;
  border-color: #e6b6ad;
  color: #873e34;
}
.atb-regimens {
  border-radius: 14px;
  overflow: hidden;
  margin: 18px 0;
  border: 1px solid #c9dced;
  background: #f3f8fd;
}
.atb-regimens > h3 {
  padding: 12px 18px;
  margin: 0;
  background: #e2effa;
  color: #24597a;
}
.atb-regimens.alternative {
  background: #fffcf3;
  border-color: #eadbae;
}
.atb-regimens.alternative > h3 {
  background: #faf0d5;
  color: #775c20;
}
.atb-regimen {
  padding: 18px;
  border-top: 1px solid #dbe5ec;
}
.atb-regimen p {
  margin: 6px 0 12px;
}
.atb-regimen-text {
  white-space: pre-line;
}
.atb-drug {
  display: inline;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px dotted currentColor;
  border-radius: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.atb-drug:hover {
  color: #087970;
  background: #dcefeb;
}
.atb-output details summary,
.atb-inputs details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}
.atb-output details p {
  font-size: 0.875rem;
}
.atb-details {
  padding: 18px;
  margin: 12px 0;
}
.atb-indication,
.atb-referral {
  padding: 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  margin: 16px 0;
}
.atb-indication {
  background: #f1f7f6;
}
.atb-source-warning {
  border-left: 3px solid #c49539;
  background: #fffaee;
  padding: 14px;
  margin: 16px 0;
}
.atb-dose {
  background: white;
  border: 1px solid #d2e5e7;
  border-radius: 10px;
  padding: 12px;
  margin-top: 12px;
}
.atb-dose p {
  font-size: 0.875rem;
  margin: 4px 0;
}
.atb-footer {
  border-top: 1px solid #dce5ea;
  padding-top: 22px;
  margin-top: 35px;
  font-size: 0.8rem;
  color: #647780;
}
.atb-dialog {
  padding: 0;
  border: 1px solid #d6e3e8;
  border-radius: 18px;
  width: min(760px, calc(100vw - 24px));
  max-height: 90dvh;
  color: #263e4c;
  box-shadow: 0 25px 80px #153c4340;
}
.atb-dialog::backdrop {
  background: #142e426b;
}
.atb-dialog-head {
  position: sticky;
  top: 0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #dce5ea;
  z-index: 1;
}
.atb-dialog-head h2 {
  font-size: 1.2rem;
  margin: 0;
}
.atb-dialog-body {
  padding: 22px 24px;
  font-size: 1rem;
  line-height: 1.65;
}
.atb-dialog-body .field {
  margin: 12px 0;
}
.atb-dialog-body .checkrow {
  padding: 12px 0;
}
.atb-dialog-body input[type='checkbox'] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.atb-dialog-body h3 {
  font-size: 1.05rem;
}
.atb input,
.atb select {
  font-size: 1rem;
  max-width: 100%;
}
.atb-output {
  min-width: 0;
}
.atb-branch-label {
  font-size: 0.875rem;
  color: #567382;
}
@media (max-width: 1050px) {
  .atb-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .atb-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .atb-title {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }
  .atb-search-row {
    flex-direction: column;
    align-items: stretch;
  }
  .atb-cards {
    grid-template-columns: 1fr;
  }
  .atb-tools > div {
    width: 100%;
  }
  .atb-tools .chip {
    padding: 8px 10px;
  }
  .atb-inputs {
    padding: 16px;
  }
  .atb-dialog-body {
    padding: 16px;
  }
  .atb-dialog-head {
    padding: 14px 16px;
  }
  .atb-urgent {
    position: fixed;
    bottom: 14px;
    right: 14px;
    z-index: 20;
    box-shadow: 0 5px 16px #451f2933;
  }
  .atb-footer {
    padding-bottom: 65px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .atb * {
    transition: none !important;
    animation: none !important;
  }
}
.atb-system-picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 18px;
}
.atb-system-picks .chip {
  text-align: left;
  white-space: normal;
}
.atb .atb-question .chip[aria-pressed='true'],
.atb .atb-question .chip[aria-pressed='true']:hover,
.atb .atb-question .chip[aria-pressed='true']:focus {
  background: #176e68;
  color: #fff;
  border-color: #176e68;
}
@media (min-width: 1051px) {
  .atb-output {
    position: sticky;
    top: 20px;
    max-height: calc(100dvh - 40px);
    overflow: auto;
    padding-right: 3px;
  }
}

.atb-reassess {
  border-left: 3px solid #ce7722;
}
.atb-reassess summary {
  color: #8a4d13;
}

.atb-calculator-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  clear: both;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #dbe5ea;
}
.atb-calculator-links .btn {
  display: inline-flex;
  align-items: center;
  white-space: normal;
  line-height: 1.4;
  max-width: 100%;
  height: auto;
  min-height: 44px;
  text-align: left;
}
.atb-regimen > details {
  margin-bottom: 12px;
}
