/* Review: calm, compact consultation workspace. */
:root {
  --line: #dbe5ea;
  --muted: #5d7280;
}
.sidebar {
  z-index: 20;
}
.sidebar-controls {
  margin-top: 28px;
}
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid #39515f;
  border-radius: 9px;
  background: #1c3543;
  color: #dce8ec;
  padding: 9px 11px;
  text-align: left;
  font-size: 14px;
}
.sidebar-search:hover {
  background: #294754;
  border-color: #60818d;
}
.sidebar-search svg,
.mobile-menu svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  flex: none;
}
.sidebar-search kbd {
  font: 11px inherit;
  margin-left: auto;
  opacity: 0.7;
  border: 1px solid #526774;
  padding: 1px 4px;
  border-radius: 3px;
}
.sidebar > nav {
  margin-top: 20px;
}
.sidebar nav a {
  min-height: 46px;
  transition:
    background 0.15s,
    color 0.15s;
}
.sidebar nav a.active {
  background: #28515a;
}
.mobile-menu {
  display: none;
}
.page-heading .eyebrow {
  display: none;
}
.page-heading {
  margin-bottom: 20px;
}
.page-heading h1 {
  font-size: 30px;
}
.overview-section {
  margin-top: 28px;
}
.cards .card {
  border-color: #dce5e9;
  box-shadow: 0 2px 3px #14293803;
}
.tool-card:focus-within .card {
  border-color: #169b79;
  box-shadow: 0 0 0 3px #169b791a;
}
.card-end b {
  font-weight: 600;
}
.cards .card:hover {
  box-shadow: 0 6px 18px #1429380b;
}
.search {
  border-radius: 12px;
  box-shadow: none;
}
.search:focus-within {
  border-color: #169b79;
  box-shadow: 0 0 0 3px #169b7914;
}
.area-filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.area-picker {
  font-size: 13px;
  gap: 8px;
}
.area-picker select {
  min-width: 190px;
  padding: 9px 30px 9px 12px;
  border-radius: 8px;
}
.favorite-refresh .tool-card {
  animation: none !important;
}
.atb-question {
  padding: 13px 0;
}
.atb-question legend {
  font-size: 14px;
}
.atb-inputs {
  padding: 22px;
}
.atb-output {
  scrollbar-width: thin;
}
.ref-criteria {
  max-width: 980px;
}
.ref-item {
  line-height: 1.75;
}
.ref-badge {
  letter-spacing: 0.01em;
}
.ref-criteria h2 {
  font-size: 22px;
}
.command-dialog {
  width: min(700px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 40px));
  padding: 0;
  border: 1px solid #d6e3e6;
  border-radius: 17px;
  color: #1a2b3b;
  box-shadow: 0 24px 90px #0e253d40;
  overflow: hidden;
}
.command-dialog[open] {
  display: flex;
  flex-direction: column;
}
.command-dialog::backdrop {
  background: #0b24366b;
  backdrop-filter: blur(3px);
}
.command-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px 10px;
  font-size: 14px;
  font-weight: 600;
}
.command-head button {
  font-size: 12px;
}
.command-dialog > input {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 22px 20px;
  margin: 0;
  font-size: 21px;
  color: inherit;
  outline: none;
  background: white;
  width: 100%;
}
.command-dialog > input:focus-visible {
  outline: none;
  box-shadow: inset 0 -2px #169b79;
}
#global-search-results {
  overflow-y: auto;
  min-height: 100px;
  padding: 8px;
  overscroll-behavior: contain;
}
.search-result {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 9px;
  text-decoration: none;
  color: inherit;
}
.search-result strong {
  font-size: 16px;
  line-height: 1.4;
}
.search-result > span:last-child {
  font-size: 13px;
  color: var(--muted);
}
.search-result-type {
  font-size: 11px;
  font-weight: 650;
  color: #087e80;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.search-result:hover,
.search-result[aria-selected='true'] {
  background: #eaf6f2;
}
.search-empty {
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
}
.command-foot {
  padding: 11px 22px;
  background: #f5f8f9;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 700px) {
  .sidebar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0;
    padding: 14px 18px;
    overflow: visible;
    box-shadow: 0 2px 10px #10233112;
  }
  .sidebar > .brand {
    grid-column: 1;
    grid-row: 1;
  }
  .sidebar-controls {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
  }
  .sidebar-search,
  .mobile-menu {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 9px;
    border-radius: 8px;
    border: 1px solid #39515f;
    background: #1c3543;
    color: #dce8ec;
  }
  .sidebar-search span,
  .sidebar-search kbd {
    display: none;
  }
  .sidebar > nav {
    display: none;
    grid-column: 1/-1;
    margin-top: 14px;
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
  }
  .sidebar.menu-open > nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .sidebar nav > a {
    padding: 11px 12px;
    min-height: 44px;
  }
  .sidebar nav a > span {
    white-space: normal;
  }
  main {
    padding: 24px 18px 40px;
  }
  .page-heading h1 {
    font-size: 27px;
  }
  .area-picker {
    flex: 1;
    min-width: 140px;
  }
  .area-picker select {
    min-width: 0;
    width: 100%;
  }
  .ref-grid {
    grid-template-columns: 1fr;
  }
  .command-dialog {
    margin: 12px auto auto;
    max-height: calc(100dvh - 24px);
  }
  .command-head {
    padding: 14px 16px 8px;
  }
  .command-dialog > input {
    font-size: 18px;
    padding: 14px 16px;
  }
  .command-foot {
    display: none;
  }
  .atb-title h1 {
    font-size: 26px;
  }
  .atb-output {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.search-launch {
  width: 100%;
  justify-content: space-between;
  cursor: text;
  padding: 17px 20px;
  color: var(--muted);
  text-align: left;
  font-size: 16px;
}
.search-launch kbd {
  font-size: 12px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
}
.page-heading .lead:empty {
  display: none;
}
@media (max-width: 700px) {
  .search-launch kbd {
    display: none;
  }
  .search-launch {
    font-size: 15px;
  }
}

/* A shared icon box keeps every navigation label on the same baseline. */
.sidebar nav > a {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar nav > a > .nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  line-height: 0;
}
.sidebar nav > a > .nav-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Compact scores and pediatric doses retain readable descriptions and separate favourite targets. */
#cards.scores-compact .catalog-area {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
#cards.scores-compact .catalog-area-heading {
  margin-bottom: 8px;
}
#cards.scores-compact .catalog-area-heading h2 {
  font-size: 15px;
}
#cards.scores-compact .catalog-area-heading > span {
  display: none;
}
#cards.scores-compact .cards {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
#cards.scores-compact .card {
  padding: 12px 48px 12px 12px;
  min-height: 100px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-content: center;
  column-gap: 9px;
}
#cards.scores-compact .card-top {
  display: contents;
}
#cards.scores-compact .icon {
  width: 26px;
  height: 26px;
  grid-column: 1;
  grid-row: 1/4;
}
#cards.scores-compact .icon svg {
  width: 19px;
  height: 19px;
}
#cards.scores-compact .pill {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  padding: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
}
#cards.scores-compact .card h3 {
  grid-column: 2;
  grid-row: 2;
  margin: 3px 0;
  font-size: 14px;
  line-height: 1.3;
}
#cards.scores-compact .card p {
  grid-column: 2;
  grid-row: 3;
  font-size: 14px;
  line-height: 1.35;
  margin: 0;
}
#cards.scores-compact .card-end {
  display: none;
}
#cards.scores-compact .favorite-toggle {
  right: 6px;
  top: 8px;
  width: 36px;
  height: 36px;
}
#cards.grouped-catalog.scores-compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 1150px) {
  #cards.grouped-catalog.scores-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}
@media (max-width: 700px) {
  #cards.scores-compact .cards {
    grid-template-columns: 1fr;
  }
  #cards.scores-compact .card {
    min-height: 82px;
  }
}
@media (min-width: 1150px) {
  #cards.grouped-catalog.scores-compact {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #cards.scores-compact .catalog-area {
    display: grid;
    grid-template-columns: 125px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }
  #cards.scores-compact .catalog-area-heading {
    padding-top: 12px;
    margin: 0;
  }
  #cards.scores-compact .catalog-area-heading h2 {
    font-size: 13px;
    line-height: 1.4;
  }
  #cards.scores-compact .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #cards.scores-compact .card {
    min-height: 82px;
    padding-top: 9px;
    padding-bottom: 9px;
  }
}
@media (min-width: 1150px) {
  #cards.grouped-catalog.scores-compact {
    display: block;
    columns: 3;
    column-gap: 14px;
  }
  #cards.scores-compact .catalog-area {
    display: inline-block;
    width: 100%;
    margin: 0 0 14px;
    break-inside: avoid;
  }
  #cards.scores-compact .catalog-area-heading {
    padding: 0;
    margin-bottom: 7px;
  }
  #cards.scores-compact .cards {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  #cards.scores-compact .card {
    min-height: 72px;
    padding: 8px 46px 8px 10px;
  }
}

/* One page-history action, distinct from previous steps inside a flowchart. */
#main .back,
#main .pv-back-home {
  display: none;
}
.history-navigation {
  margin: 0 0 18px;
}
.history-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #cbdce0;
  border-radius: 9px;
  background: #fff;
  color: #24605f;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.history-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.history-back:hover:not(:disabled) {
  background: #eaf6f3;
  border-color: #78b6ac;
}
.history-back:active:not(:disabled) {
  background: #d8eee8;
}
.history-back:focus-visible {
  outline: 3px solid #169b7970;
  outline-offset: 3px;
}
.history-back:disabled {
  opacity: 0.45;
  cursor: default;
}
/* Match the centred prevention content width without changing other areas. */
#main:has(> .pv-shell) > .history-navigation {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}
.sortable-favorites .card {
  padding-bottom: 43px;
}
.favorite-drag {
  position: absolute;
  bottom: 5px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #5d7280;
  cursor: grab;
  touch-action: none;
}
.favorite-drag svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
  stroke-linecap: round;
}
.favorite-drag:hover,
.favorite-drag:focus-visible {
  background: #e5f2ef;
  border-color: #83b9ae;
}
.favorite-drag:focus-visible {
  outline: 2px solid #169b79;
  outline-offset: 2px;
}
.favorite-dragging {
  opacity: 0.75;
  z-index: 2;
}
.favorite-dragging .favorite-drag {
  cursor: grabbing;
}
.sortable-favorites .favorite-dragging .card {
  border-color: #169b79;
  box-shadow: 0 0 0 2px #169b7940;
}
/* Pathology-led pediatric antibiotic calculators */
.dose-pathology-trigger {
  width: 100%;
  white-space: normal;
  text-align: left;
  margin-bottom: 16px;
  min-height: 48px;
}
#dose-pathology-picker {
  margin-bottom: 16px;
}
.dose-locked {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.dose-locked .field:first-child {
  grid-column: 1/-1;
}
.dose-locked input {
  background: #eef5f4;
  color: #234e4b;
  cursor: default;
  width: 100%;
  min-width: 0;
}
.dose-source {
  margin: 16px 0;
  font-size: 14px;
}
.dose-source summary {
  cursor: pointer;
  font-weight: 600;
}
.dose-source p {
  overflow-wrap: anywhere;
}
#antibiotic-dose-form select {
  max-width: 100%;
  min-width: 0;
}
#antibiotic-result .result-number {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  overflow-wrap: anywhere;
}
#antibiotic-result .result-row {
  gap: 12px;
  flex-wrap: wrap;
}
@media (max-width: 480px) {
  .dose-locked {
    grid-template-columns: 1fr;
  }
  .dose-locked .field:first-child {
    grid-column: auto;
  }
}
/* Complete posology: one primary amount, three supporting details. */
.dose-posology {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}
.dose-posology-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid #ffffff24;
  border-radius: 12px;
  background: #ffffff08;
}
.dose-posology-item > span {
  font-size: 12px;
  line-height: 1.4;
  color: #b9d5da;
  font-weight: 500;
}
.dose-posology-item > strong {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 650;
  color: #fff;
  overflow-wrap: anywhere;
}
.dose-posology-item small {
  font-size: 13px;
  font-weight: 500;
  color: #cfe3e6;
}
.dose-posology-volume {
  grid-column: 1/-1;
  padding: 18px 20px;
  background: #ffffff0d;
  border-color: #ffffff30;
}
.dose-posology-volume > span {
  font-size: 13px;
}
.dose-posology-volume > strong {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.dose-posology-volume small {
  font-size: 18px;
  letter-spacing: 0;
}
@media (max-width: 480px) {
  .dose-posology {
    gap: 8px;
  }
  .dose-posology-item {
    padding: 12px 9px;
  }
  .dose-posology-item > strong {
    font-size: 16px;
  }
  .dose-posology-volume {
    padding: 16px;
  }
  .dose-posology-volume > strong {
    font-size: 32px;
  }
  .dose-posology-item small {
    display: block;
  }
  .dose-posology-volume small {
    display: inline;
  }
}
.dose-duration-note {
  font-size: 14px;
  line-height: 1.6;
  margin: 12px 0 18px;
}

/* Compact, whole-card favourite ordering. */
.sortable-favorites {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.sortable-favorites .tool-card {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.sortable-favorites .card {
  min-height: 72px;
  padding: 15px 52px 15px 50px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 0;
}
.sortable-favorites .card-top {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}
.sortable-favorites .icon {
  width: 28px;
  height: 28px;
}
.sortable-favorites .icon svg {
  width: 19px;
  height: 19px;
}
.sortable-favorites .pill,
.sortable-favorites .card p,
.sortable-favorites .card-end {
  display: none;
}
.sortable-favorites .card h3 {
  font-size: 15px;
  line-height: 1.35;
  margin: 0;
}
.sortable-favorites .favorite-toggle {
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
}
.sortable-favorites .favorite-dragging {
  cursor: grabbing;
  touch-action: none;
}
@media (max-width: 600px) {
  .sortable-favorites {
    grid-template-columns: 1fr;
  }
  .sortable-favorites .card {
    min-height: 62px;
  }
}
