/* Listing subtitle: smaller, muted, spaced under the name */
.listing-subtitle {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--muted-text-color, #666666);
}

.listing-subtitle--media {
  font-size: 1rem;
}

.listing-subtitle--media .listing-image-preview-group {
  display: inline-flex;
}

/* Subtle pill for derived menu items */
.viewer-derived {
  margin: 0.35rem 0 0.5rem;
}

.viewer-derived-pill {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #d8d8d8;
  background: #f2f2f2;
  color: #666666;
}

/* Pill style for names in list first column */
.name-pill {
  display: inline-block;
  max-width: 100%;
  padding: 0.2rem 0.6rem;
  border-radius: 0.8rem;
  background: var(--content-background-color);
  border: 1px solid var(--table-border-color);
  color: inherit;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

a.name-pill {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

a.name-pill:hover,
a.name-pill:focus,
a.name-pill:focus-visible {
  background-color: var(--sar-med-red);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 0 0 0.2rem var(--sar-med-red);
}

.name-pill--drug {
  border-left: 0.42rem solid var(--drug-pill-color, var(--table-border-color));
}

.name-pill--drug {
  padding-left: 0.45rem;
}

.name-pill--notice {
  border-left: 0.42rem solid var(--notice-pill-color, var(--table-border-color));
  padding-left: 0.45rem;
}

.name-pill--notice-system {
  --notice-pill-color: var(--notice-system-pill-color);
}

.name-pill--notice-alert {
  --notice-pill-color: var(--notice-alert-pill-color);
}

.listing-image-preview-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.listing-image-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  min-width: 4rem;
  height: 3rem;
  overflow: hidden;
  padding: 0.18rem;
  border: 1px solid var(--table-border-color);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.listing-image-preview:hover,
.listing-image-preview:focus,
.listing-image-preview:focus-visible {
  background: #ffffff;
  box-shadow: 0 0 0 0.2rem rgba(210, 35, 43, 0.18);
  text-decoration: none;
}

.listing-image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.listing-image-preview-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: var(--content-background-color);
  border: 1px solid var(--table-border-color);
  color: #555555;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
}

:root {
  --sar-med-red: #D2232B; /* was #e43128; */
  --drug-group-1: #4CB847;
  --drug-group-2: #F7941D;
  --drug-group-3: #D2232B;
  --notice-system-pill-color: #3d3469;
  --notice-alert-pill-color: var(--sar-med-red);

  --content-background-color:  #eee;
  --admin-background-color: #ddd;
  
  --edit_area_background-color: #eee;
  --rich-text_background-color: rgb(242, 243, 197);
  --box-shadow-color: #aaaaaa;
  --required-color: red;
  --version-color: #000;

  --table-header-background-color: #555;
  --table-header-color: #fff;
  --table-cell-background-color: #fff;
  --table-border-color: #ccc;
  --table-row-unpublished-color: #eee;
  --table-row-unapproved-color: #fdff80;

  --api-key-active-background-color: #d4edda;
  --api-key-revoked-background-color: #f8d7da;

  --message-color: #fff;
  --message-success-background-color: #5ab54a;
  --message-warn-background-color: #cf8a23;
  --message-fail-background-color: #d7332b;
  --message-debug-background-color: var(--sar-med-red);

  --menu-background-color: var(--sar-med-red);
  --menu-foreground-color: #fff;
  --menu-hover-color: #3d3469;
  --menu-loggedin-color: #fff;
  --menu-separator-color:  var(--sar-med-red);

   --listing-table-radius: 5px;
}

html {
  font-size: 16px;
  min-width: 320px;
}

body {
  min-width: 320px;
  overflow-x: auto;
}

main {
  padding: 0;
  overflow-x: auto;
}

a {
  text-decoration: none;
  color:var(--sar-med-red);
}

/* Default link hover: reverse pill highlight (exclude nav and button-styled links) */
main a:not(.button) {
  border-radius: 0.25rem;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

main a:not(.button):hover,
main a:not(.button):focus {
  background-color: var(--sar-med-red);
  color: #ffffff;
  box-shadow: 0 0 0 0.2rem var(--sar-med-red);
  text-decoration: none;
}
/* Utility: reverse pill highlight for links
   Usage: add class "reverse-pill" to an <a> to get a pill-shaped
   hover state that inverts the colours. */
.reverse-pill,
a.reverse-pill {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 0.25rem;
  border: 1px solid transparent;
  color: var(--sar-med-red);
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

a.reverse-pill:hover,
a.reverse-pill:focus {
  background-color: var(--sar-med-red);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

span.required {
  color: var(--required-color);
  margin-left: 5px;
}

.message_success,
.message_fail,
.message_warn,
.message_debug {
  border-radius: 5px;
  margin-top: 10px;
  padding: 10px;
  color: var(--message-color);
}

#content div.message_success p,
#content div.message_fail p,
#content div.message_warn p,
#content div.message_debug p {
  margin-bottom: 10px;
}

.message_success {
  background-color: var(--message-success-background-color);
}

.message_warn {
  background-color: var(--message-warn-background-color);
}

.message_fail {
  background-color: var(--message-fail-background-color);
}

.message_debug {
  background-color: var(--message-debug-background-color);
}

textarea,
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="password"],
input[type="search"],
select {
  font-family:'Courier New', Courier, monospace;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 16px;
  border-radius: 5px;
}

input[type="date"],
input[type="text"].small_input {
  width:auto;
  max-width:auto;
}

input[type="submit"],
input[type="button"],
a.button,
button {
  font-family: Calibri, DroidSansRegular, HattoriHanzoLight, verdana, sans-serif;
  font-size: 1rem;
  border-radius: 5px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  color: var(--menu-foreground-color);
  background-color: var(--menu-hover-color);
  border: none;
  cursor: pointer;
}

input[type="submit"]:hover,
input[type="button"]:hover,
a.button:hover,
button:hover {
  background-color: var(--sar-med-red);
}

input[type="submit"].button_subtle,
input[type="button"].button_subtle,
a.button.button_subtle,
button.button_subtle {
  color: var(--menu-hover-color);
  background-color: #f5f5f5;
  border: 1px solid var(--table-border-color);
}

input[type="submit"].button_subtle:hover,
input[type="submit"].button_subtle:focus,
input[type="button"].button_subtle:hover,
input[type="button"].button_subtle:focus,
a.button.button_subtle:hover,
a.button.button_subtle:focus,
button.button_subtle:hover,
button.button_subtle:focus {
  color: var(--sar-med-red);
  background-color: #f5f5f5;
}

p#tagline {
  text-align: right;
}

img#logo {
  float: right;
}

h1#heading {
  float: left;
}

p#version {
  color: var(--version-color);
  font-size: .7rem;
  margin-bottom: 0px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* View-only login popup */
.viewonly-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
}

.viewonly-modal.is-open {
  display: block;
}

.viewonly-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 20, 0.55);
}

.viewonly-modal__panel {
  position: relative;
  max-width: 740px;
  margin: 6vh auto 0;
  background: #f8f6d2;
  border: 2px solid #2f2a59;
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  padding: 0;
  overflow: hidden;
}

/* API availability indicator (compact footer element) */
.api-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.4rem;
  font-size: 0.7rem;
  color: var(--version-color);
}
.api-status__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.12);
}
.api-status__text {
  font-size: 0.7rem;
}
.version-text {
  white-space: nowrap;
}
.api-status--online .api-status__dot {
  background: #28a745; /* green */
  box-shadow: 0 0 0 3px rgba(40,167,69,0.08);
}
.api-status--offline .api-status__dot {
  background: #ff9f1a; /* amber */
  box-shadow: 0 0 0 3px rgba(255,159,26,0.08);
}

/* Ensure contrast and readability in high-contrast / forced-colors modes */
@media (forced-colors: active) {
  .api-status__dot { border: 1px solid WindowText; }
}

.viewonly-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2f2a59;
  color: #fff;
  padding: 14px 18px;
}

.viewonly-modal__header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.viewonly-modal__close {
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  margin: 0;
  padding: 0 4px;
}

.viewonly-modal__body {
  padding: 18px;
  color: #1b1b1b;
}

.viewonly-modal__body p {
  margin: 0 0 12px 0;
}

.viewonly-modal__footer {
  padding: 0 18px 18px 18px;
  text-align: right;
}

.viewonly-modal__button {
  background: #2f2a59;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 8px 16px;
  margin: 0;
  cursor: pointer;
}

.viewonly-modal__button:hover {
  background: #D2232B;
}

/* Quick ref editor preview modal */
.quickref-preview-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2100;
}

.quickref-preview-modal.is-open {
  display: block;
}

.quickref-preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 20, 0.55);
}

.quickref-preview-modal__panel {
  position: relative;
  width: min(1200px, 96vw);
  height: min(86vh, 900px);
  margin: 4vh auto 0;
  background: #f8f8f8;
  border: 2px solid #2f2a59;
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.quickref-preview-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2f2a59;
  color: #fff;
  padding: 12px 16px;
}

.quickref-preview-modal__header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.quickref-preview-modal__close {
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  margin: 0;
  padding: 0 4px;
}

.quickref-preview-modal__body {
  flex: 1;
  min-height: 0;
  background: #fff;
}

.quickref-preview-modal__body iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .quickref-preview-modal__panel {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    border: 0;
  }
}

@media (max-width: 720px) {
  .viewonly-modal__panel {
    margin: 10vh 12px 0;
  }
}


/* admin section */
div#admin_content,
div#content {
  border-radius: 14px;
  padding: 1rem;
  margin: 1rem auto;
  border: 1px solid var(--table-border-color);
  max-width: 100%;
}

div#admin_content {
  font-family: Calibri, DroidSansRegular, HattoriHanzoLight, verdana, sans-serif;
  background-color: var(--admin-background-color);
  font-size: 1rem;
  font-weight: normal;
}

div#content {
  background-color: var(--content-background-color);
}

/* Viewer pages: give the bottom Back-to-list button more breathing room */
.viewer-back {
  margin-top: 2rem;
}

div#admin_content.content_wide {
  max-width: 98%;
}

div#admin_content h1 {
  font-size: 1.5rem;
}

div#admin_content h2 {
  font-size: 1.3rem;
}

div#admin_content h3 {
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  body {
    margin: 0;
  }

  main {
    padding: 0.45rem;
  }

  div#admin_content {
    padding: 0;
    margin: 0;
    border-radius: 0;
    border: 0;
    padding-bottom: 0.6rem;
  }

  div#content {
    padding: 0.5rem;
    margin: 0;
    border-radius: 0;
  }

  div#admin_content h1 {
    margin: 0.3rem 0 0.55rem;
  }
}

div#edit_buttons {
  clear: both;
  background-color: var(--edit_area_background-color);
  border-radius: 10px;
  box-shadow: 2px 2px 3px var(--box-shadow-color);
  padding: 1rem;
  margin-top: 1.4rem;
}

.field_area {
  margin-top: 0.7rem;
}

form.filter-form {
  margin-bottom: 1em;
}

form.filter-form > div + div {
  margin-top: 0.35rem;
}

form.filter-form label {
  display: inline-block;
  margin-bottom: 0.2rem;
}

.filter-inline-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-inline-input-wrap {
  position: relative;
  flex: 1 1 auto;
  max-width: 100%;
}

.filter-inline-input-wrap input[type="text"] {
  margin: 0;
  padding-right: 2rem;
}

.filter-inline-submit {
  margin: 0;
  padding: 0.38rem 0.75rem;
  font-size: 0.88rem;
  line-height: 1.2;
  color: #444444;
  background: #f3f3f3;
  border: 1px solid var(--table-border-color);
  border-radius: 5px;
  white-space: nowrap;
}

.filter-inline-submit:hover,
.filter-inline-submit:focus {
  color: #ffffff;
  background-color: var(--sar-med-red);
  border-color: var(--sar-med-red);
}

.filter-inline-clear {
  right: 0.35rem;
}

@media (max-width: 640px) {
  form.filter-form label {
    display: block;
    margin-bottom: 0.35rem;
  }

  form.filter-form > div + div {
    margin-top: 0.5rem;
  }

  .filter-inline-row {
    flex-wrap: wrap;
  }

  .filter-inline-input-wrap {
    width: 100%;
  }

  .filter-inline-submit {
    align-self: flex-start;
  }
}

p.fieldcaption {
  font-weight: bold;
  margin: 2px 0px 2px 0px;
}

.radio_button_label {
  margin-left: 1rem;
}

/* listing table */
.list-search-form {
  margin-bottom: 1em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.5rem;
}

.list-search-input {
  width: 100%;
  max-width: 100%;
  padding-right: 2rem;
}

.list-search-input-wrap {
  position: relative;
  flex: 1 1 320px;
  min-width: 320px;
}

.list-search-input-wrap .list-search-input {
  width: 100%;
  max-width: 100%;
}

.list-search-clear {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  width: 1.2rem;
  height: 1.2rem;
  line-height: 1.1rem;
  border-radius: 50%;
  border: 0;
  font-size: 1rem;
  font-weight: bold;
  background: transparent;
  color: var(--version-color);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

.list-search-clear.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.list-search-clear:hover,
.list-search-clear:focus {
  color: var(--sar-med-red);
}

@media (max-width: 640px) {
  .list-search-form {
    display: block;
  }

  .list-search-label {
    display: block;
    margin-bottom: 0.35rem;
  }

  .list-search-input {
    width: 100%;
    max-width: 100%;
  }

  .list-search-input-wrap {
    width: 100%;
    max-width: 100%;
  }
}

table.listing_table {
  table-layout: fixed;
  margin-bottom: 10px;
  min-width: 100%;
  max-width: 100%;
  border-radius: 5px;
  box-shadow: 2px 2px 3px var(--box-shadow-color);
  word-wrap: break-word;
}
table.listing_table tr {
  vertical-align: top;
}
table.listing_table td {
  padding: 5px 8px;
  line-height: 1.3em;
  overflow: hidden;
  background-color: var(--table-cell-background-color);
}

/* API key status colouring in users listing */
table.listing_table td.api-key-status--active {
  background-color: var(--api-key-active-background-color);
}

table.listing_table td.api-key-status--revoked {
  background-color: var(--api-key-revoked-background-color);
}

/* Also allow API status badges outside tables (e.g. user edit screen)
   (Exclude <td> so table cells keep full-cell background colouring.) */
.api-key-status--active:not(td) {
  background-color: var(--api-key-active-background-color);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

.api-key-status--revoked:not(td) {
  background-color: var(--api-key-revoked-background-color);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

/* API authorisation icon styling */
.api-auth-icon {
  vertical-align: middle;
  margin-right: .4rem;
  display: inline-block;
  position: relative;
  top: 2px; /* nudge down to align with version text */
  color: var(--version-color); /* default (black) when disabled */
}
.api-auth-icon.api-auth-enabled {
  color: #2e7d32; /* darker green for locked state */
}
.api-auth-icon.api-auth-disabled {
  color: var(--version-color);
}
/* Ensure SVG fill follows enabled/disabled state (fallback if currentColor not applied) */
.api-auth-icon.api-auth-enabled svg {
  fill: #2e7d32 !important; /* ensure dark green fill */
}
.api-auth-icon.api-auth-disabled svg {
  fill: var(--version-color) !important;
}

table.listing_table th {
  padding: 5px 8px 2px;
  line-height: 1.2em;
  color: var(--table-header-color);
  background-color: var(--table-header-background-color);
}

table.listing_table th.edit_column {
  width: 50px;
}

/* Keep the name column usable in fixed-layout listing tables with name pills */
table.listing_table[name="drugs"] th:first-child,
table.listing_table[name="quick_refs"] th:first-child,
table.listing_table[name="observations"] th:first-child {
  width: 190px;
}

table.listing_table.listing_table--affiliations {
  table-layout: auto;
}

table.listing_table.listing_table--affiliations th:nth-child(2),
table.listing_table.listing_table--affiliations th:nth-child(3),
table.listing_table.listing_table--affiliations td:nth-child(2),
table.listing_table.listing_table--affiliations td:nth-child(3) {
  width: 120px;
  white-space: nowrap;
}

table.listing_table.listing_table--diagnostic > tbody > tr > th:first-child,
table.listing_table.listing_table--diagnostic > tbody > tr > td:first-child,
table.listing_table.listing_table--diagnostic > thead > tr > th:first-child,
table.listing_table.listing_table--diagnostic > thead > tr > td:first-child {
  text-align: left !important;
}

/* Rounded corners for first/last th and td */
table.listing_table th:first-child {
  border-top-left-radius: var(--listing-table-radius);
}
table.listing_table th:last-child {
  border-top-right-radius: var(--listing-table-radius);
}
table.listing_table tr:last-child td:first-child {
  border-bottom-left-radius: var(--listing-table-radius);
}
table.listing_table tr:last-child td:last-child {
  border-bottom-right-radius: var(--listing-table-radius);
}


div.table_holder {
  overflow: auto;
}

/* Inline quick ref item editor: prioritize description width and keep utility columns compact. */
table.listing_table.quick-ref-inline-table td {
  background-color: #d6d6d6;
}

table.listing_table.quick-ref-inline-table th:nth-child(1),
table.listing_table.quick-ref-inline-table td:nth-child(1) {
  width: 4%;
}

table.listing_table.quick-ref-inline-table th:nth-child(2),
table.listing_table.quick-ref-inline-table td:nth-child(2) {
  width: 18%;
}

table.listing_table.quick-ref-inline-table th:nth-child(3),
table.listing_table.quick-ref-inline-table td:nth-child(3) {
  width: 14%;
}

table.listing_table.quick-ref-inline-table th:nth-child(4),
table.listing_table.quick-ref-inline-table td:nth-child(4) {
  width: 8%;
}

table.listing_table.quick-ref-inline-table th:nth-child(5),
table.listing_table.quick-ref-inline-table td:nth-child(5) {
  width: 34%;
}

table.listing_table.quick-ref-inline-table th:nth-child(6),
table.listing_table.quick-ref-inline-table td:nth-child(6) {
  width: 4%;
  text-align: center;
}

table.listing_table.quick-ref-inline-table th:nth-child(7),
table.listing_table.quick-ref-inline-table td:nth-child(7) {
  width: 6%;
  text-align: center;
}

table.listing_table.quick-ref-inline-table th:nth-child(8),
table.listing_table.quick-ref-inline-table td:nth-child(8) {
  width: 5%;
  text-align: center;
  white-space: nowrap;
}

table.listing_table.quick-ref-inline-table th.quick-ref-drag-col,
table.listing_table.quick-ref-inline-table td.quick-ref-drag-cell {
  text-align: center;
}

table.listing_table.quick-ref-inline-table.managed-image-inline-table {
  table-layout: fixed;
}

table.listing_table.quick-ref-inline-table.managed-image-inline-table th:nth-child(1),
table.listing_table.quick-ref-inline-table.managed-image-inline-table td:nth-child(1) {
  width: 4%;
}

table.listing_table.quick-ref-inline-table.managed-image-inline-table th:nth-child(2),
table.listing_table.quick-ref-inline-table.managed-image-inline-table td:nth-child(2) {
  width: 22%;
}

table.listing_table.quick-ref-inline-table.managed-image-inline-table th:nth-child(3),
table.listing_table.quick-ref-inline-table.managed-image-inline-table td:nth-child(3) {
  width: 18%;
}

table.listing_table.quick-ref-inline-table.managed-image-inline-table th:nth-child(4),
table.listing_table.quick-ref-inline-table.managed-image-inline-table td:nth-child(4) {
  width: 40%;
}

table.listing_table.quick-ref-inline-table.managed-image-inline-table th:nth-child(5),
table.listing_table.quick-ref-inline-table.managed-image-inline-table td:nth-child(5) {
  width: 8%;
  text-align: center;
  white-space: nowrap;
}

table.listing_table.quick-ref-inline-table.managed-image-inline-table th:nth-child(6),
table.listing_table.quick-ref-inline-table.managed-image-inline-table td:nth-child(6) {
  width: 6%;
  text-align: center;
  white-space: nowrap;
}

.quick-ref-drag-handle {
  display: inline-block;
  cursor: move;
  cursor: grab;
  font-weight: 700;
  letter-spacing: -0.08em;
  color: #333;
  -webkit-user-select: none;
  user-select: none;
}

tr.quick-ref-sortable-row.ui-sortable-helper {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

tr.quick-ref-sort-placeholder td {
  background: #ece7b2;
  border: 2px dashed #a39a4f;
  height: 2.6rem;
}

table.listing_table.quick-ref-inline-table td textarea,
table.listing_table.quick-ref-inline-table td input[type="text"],
table.listing_table.quick-ref-inline-table td input[type="number"] {
  margin: 0;
}

table.listing_table.quick-ref-inline-table td input[type="file"] {
  max-width: 100%;
}

table.listing_table.quick-ref-inline-table td form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

table.listing_table.quick-ref-inline-table td button,
table.listing_table.quick-ref-inline-table td a.nav_link {
  margin: 0;
}

table.listing_table.quick-ref-inline-table td button {
  font-size: 0.85rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  margin-top: 0;
  margin-bottom: 0;
}

table.listing_table.quick-ref-inline-table td .button_danger {
  background-color: #8a1f24;
}

table.listing_table.quick-ref-inline-table td .button_danger:hover {
  background-color: #D2232B;
}

table.listing_table.quick-ref-inline-table td a.nav_link {
  margin-left: 0.35rem;
}

table.listing_table.quick-ref-inline-table td input[type="number"] {
  max-width: 50px;
}

.quick-ref-row-dirty-indicator {
  display: none;
  margin-left: 0.35rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #5a3a00;
  background: #f2dfa8;
  border: 1px solid #b99b42;
  vertical-align: middle;
}

tr.quick-ref-sortable-row.quick-ref-row-dirty td {
  background-color: #ddd6bf;
}

tr.quick-ref-sortable-row.quick-ref-row-dirty .quick-ref-row-dirty-indicator {
  display: inline-block;
}

table.listing_table.quick-ref-inline-table tr.quick-ref-inline-new-item-label-row td {
  font-size: 0.9rem;
  background-color: #c8c8c8;
  border-top: 1px solid var(--table-border-color);
}

button.quick-ref-add-item-button {
  background-color: #d9d9d9;
  color: #303030;
  border: 1px solid #a4a4a4;
}

button.quick-ref-add-item-button:hover,
button.quick-ref-add-item-button:focus {
  background-color: #cbcbcb;
}

@media (max-width: 900px) {
  table.listing_table.quick-ref-inline-table {
    min-width: 980px;
  }
}

.table-scroll {
    overflow-x: auto;
    overflow-y: hidden;   /* optional */
    width: 100%;
    max-width: 100%;
    display: block;
    white-space: nowrap;  /* prevents cell wrapping if needed */
}

.wide-table {
    width: max-content;   /* ensures table expands inside scroll */
}

table.tablesorter thead tr .header {
  background-image: url(../images/tablesorter/white/bg.gif);
}

table.tablesorter thead tr .headerSortUp {
  background-image: url(../images/tablesorter/white/asc.gif);
}

table.tablesorter thead tr .headerSortDown {
  background-image: url(../images/tablesorter/white/desc.gif);
}

div.pagination {
  margin-top: 10px;
  overflow: auto; 
  max-width:100%;
  padding: 1rem;
  line-height: 2.5; 
  border-radius: 5px;
  background-color: var(--edit_area_background-color);
}

#panels {
  display: flex;
}

#panel_left {
  margin-right: 20px;
}
#panel_right {
  flex-grow: 1;
}

input[type='text']:read-only {
  background-color: var(--edit_area_background-color);
}

.richTextDisplay{
  background-color: var(--rich-text_background-color);
  margin-top: 2px;
  margin-left: 5px;
  padding: 0.5em;
  border-radius: 5px;
}

.richTextDisplay td{
  padding: 0.3em;
}

#show_special_characters {
  cursor:pointer;
}

img.rounded_image {
  border-radius:15px;
}

/* drug group colors */
.drug-group-1 {
  color: var(--drug-group-1);
  color: #fff;
}

.drug-group-2 {
  background-color: var(--drug-group-2);
  color: #fff;
}

.drug-group-3 {
  background-color: var(--drug-group-3);
  color: #fff;
} 

/* Highlight for inline search matches */
mark.search-highlight,
.search-highlight {
  background-color: #fff176; /* pale yellow */
  color: #000;
  padding: 0 2px;
  border-radius: 2px;
}

pre#raw_json {
  width: 100%;
  box-sizing: border-box;
  height: 320px;
  overflow: auto;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 5px;
  background-color: var(--table-cell-background-color);
  white-space: pre;
}

.api-path-label {
  font-family: 'Source Code Pro', Consolas, 'Courier New', monospace;
  font-weight: bold;
  margin-top: 1rem;
  
}

.managed-image-preview {
  margin: 0.5rem 0 1rem;
  max-width: 100%;
}

.managed-image-preview a {
  display: inline-block;
  width: 100%;
}

main .managed-image-preview a:hover,
main .managed-image-preview a:focus,
main .managed-image-preview a:focus-visible {
  background-color: transparent;
  color: inherit;
  box-shadow: none;
}

.managed-image-preview__img {
  width: 100%;
  height: auto;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.managed-image-autocomplete,
.managed-image-autocomplete .ui-menu-item,
.managed-image-autocomplete .ui-menu-item-wrapper,
.managed-image-autocomplete .ui-menu-item a {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.2;
}

.quick-ref-image-entry + .quick-ref-image-entry {
  margin-top: 1rem;
}

.viewer-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 0.75rem 1.25rem 1rem;
  margin: 0 0 1rem;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.viewer-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.12);
}

.viewer-card__header {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: #111;
}

/* Quick-ref specific spacing: give breathing room between description and inline image */
.viewer-card--quickref .viewer-card__image {
  margin-top: 1rem;
}

.viewer-card--quickref .quick-ref-image-notes {
  margin-top: 0.75rem;
}

/* Quick-ref list item card appearance (rounded pale boxes with left bullet) */
.quick-ref-list-section__header {
  font-weight: 700;
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
}
.quick-ref-card-row {
  margin-bottom: 0.75rem;
}
.quick-ref-card-content {
    background: #ffffff; /* paler than page background */
  border-radius: 10px;
  padding: 0.9rem 1rem;
  overflow: hidden;
  position: relative;
     border: 1px solid rgba(0,0,0,0.04);
}
.quick-ref-card-badge {
  float: left;
  background: #fff;
  border-radius: 999px;
  border: 2px solid var(--sar-med-red);
  font-weight: 800;
  color: var(--sar-med-red);
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2ch;
  text-align: center;
  margin-right: 0.85rem;
  margin-top: 2px;
  font-size: 0.8rem;
  /* Ensure visible text for multi-letter bullets */
  text-indent: 0;
  width: auto;
}
.quick-ref-card-text {
  display: block;
  line-height: 1.4;
}
.quick-ref-card-bottom {
  margin-top: 0.6rem;
}
.quick-ref-separator {
  border-bottom: 1px solid #e6e6e6;
  margin: 0.9rem 0;
}

.viewer-card__content {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  line-height: 1.4;
}

.viewer-card__richtext p {
  margin-top: 0;
}

.viewer-card__image {
  text-align: center;
}

main .viewer-card__image > a {
  display: inline-block;
  border-radius: 0;
}

main .viewer-card__image > a:hover,
main .viewer-card__image > a:focus,
main .viewer-card__image > a:active,
main .viewer-card__image > a:focus-visible {
  background: transparent;
  color: inherit;
  box-shadow: none;
  text-decoration: none;
}

.viewer-card__image img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.viewer-card__notice {
  background: #fff6d8;
  border-left: 4px solid #f0b429;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: #5f4b00;
}

/* App-style drug viewer (view_drug.php) */
.app-drug {
  /* Keep consistent width with other viewer pages (no custom max-width) */
  max-width: none;
  margin: 0;
}

.app-drug__top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}


.app-drug__title {
  margin: 0;
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: var(--app-drug-title-bg, transparent);
  color: var(--app-drug-title-fg, inherit);
}

.app-drug__aka {
  margin: 0.25rem 0 0.75rem;
}

.app-drug__banner {
  background: var(--table-row-unpublished-color);
  border: 1px solid var(--table-border-color);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0 1rem;
  font-weight: 600;
}

details.app-accordion {
  /* Use a slightly lighter parent panel so headers contrast more clearly */
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 14px;
  margin: 0 0 1rem;
  overflow: hidden;
}

details.app-accordion summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 1rem 4.4rem 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  /* Darken header more for stronger contrast */
  background: rgba(0, 0, 0, 0.16);
}

details.app-accordion summary::-webkit-details-marker {
  display: none;
}

details.app-accordion summary::after {
  content: '\203A';
  font-size: 1.5rem;
  line-height: 1;
  /* stronger arrow color to match darker header */
  color: rgba(0, 0, 0, 0.85);
  position: absolute;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.2s ease;
}

details.app-accordion[open] summary::after {
  transform: translateY(-50%) rotate(90deg);
}

details.app-accordion.protocol-accordion-wrap > summary {
  background: var(--app-drug-title-bg);
  color: var(--app-drug-title-fg);
}

details.app-accordion.protocol-accordion-wrap > summary::after {
  color: var(--app-drug-title-fg);
}

.app-accordion__title.protocol-accordion-title {
  color: inherit;
}

.app-accordion__content {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.viewer-accordion-inline-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.85);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.1rem 0.2rem;
  margin: 0;
  cursor: pointer;
  position: absolute;
  right: 2.9rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}

.viewer-accordion-inline-toggle:hover,
.viewer-accordion-inline-toggle:focus,
.viewer-accordion-inline-toggle:focus-visible {
  color: var(--sar-med-red);
  background: transparent;
  box-shadow: none;
  outline: none;
}

.viewer-accordion-inline-toggle:active {
  background: transparent;
  color: var(--sar-med-red);
  box-shadow: none;
}

/* Last-updated line under accordions in drug view */
.app-drug__last-updated {
  text-align: right;
  font-size: 0.9rem;
  color: #444;
  margin: 0.25rem 0 1rem;
}

.quick-ref-layout-mode {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.85em;
  opacity: 0.75;
}

/* Chart.js card (API activity) */
.chart-card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(255, 255, 255, 0.9);
}

.chart-card__title {
  margin-top: 0;
}

.chart-card__canvasWrap {
  width: 100%;
}

.chart-card__canvasWrap canvas {
  display: block;
  width: 100%;
}

.chart-card__debug {
  margin-top: 0.75rem;
}

.chart-card__debugTarget {
  margin: 0.5rem 0 0;
}

.chart-card__debugPayload {
  white-space: pre-wrap;
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: #fff;
}

.geo-bar-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.geo-bar-list__row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(180px, 1fr) max-content;
  gap: 0.85rem;
  align-items: center;
}

.geo-bar-list__label {
  font-weight: 600;
}

.geo-bar-list__track {
  position: relative;
  width: 100%;
  min-height: 1.1rem;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.geo-bar-list__bar {
  min-height: 1.1rem;
  background: linear-gradient(90deg, rgba(165, 0, 52, 0.7) 0%, rgba(221, 74, 72, 0.9) 100%);
  border-radius: 999px;
}

.geo-bar-list__stats {
  font-size: 0.95rem;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .geo-bar-list__row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .geo-bar-list__stats {
    white-space: normal;
  }
}

.app-drug__protocolTitle {
  margin: 1.25rem 0 0.5rem;
  color: var(--sar-med-red);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.app-drug__protocolImage .viewer-card__image {
  margin: 0.5rem 0 0;
}

.app-drug__protocolNotes {
  margin-top: 0.75rem;
}

/* Mobile-style helpers: drug checks */
.drug-checks {
  display: block;
  padding: 0.5rem;
  gap: 0.5rem;
}
/* ensure internal elements size correctly within padded container */
.drug-checks,
.drug-checks .dc-list,
.drug-checks .dc-pill,
.drug-checks .dc-badge {
  box-sizing: border-box;
}
.dc-banner {
  background: #ffe600; /* bright yellow for prominence */
  color: #000;
  border-radius: 8px;
  /* Match the sizing of .dc-pill so all pills are consistent */
  padding: 0.8rem 0.9rem;
  font-weight: 800;
  font-size: 1rem;
  margin: 0.5rem 0 0.75rem 0;
}
.dc-banner--spaced {
  margin-top: 1rem;
}
.dc-list {
  display: block;
  margin: 0.25rem 0 0.75rem 0;
  padding-right: 0; /* keep banners and pills aligned full-width */
}
.dc-pill {
  display: flex;
  align-items: center;
  background: #f2f2f2;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  margin: 0.45rem 0;
  width: 100%;
  box-shadow: none;
  box-sizing: border-box;
  word-break: break-word;
}
.dc-pill p {
  margin: 0 0 0 0.75rem;
  font-size: 16px !important;
  line-height: 1.3 !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dc-pill p span {
  font-size: 16px !important;
  line-height: inherit !important;
}
.dc-badge {
  background: #fff; /* white round bullet */
  color: var(--sar-med-red);
  font-weight: 800;
  border-radius: 999px;
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.4rem;
  box-sizing: border-box;
  border: 2px solid var(--sar-med-red);
}

/* Force badge styling when other rules might override (higher specificity) */
.drug-checks .dc-badge {
  background: #fff !important;
  color: var(--sar-med-red) !important;
  border-color: var(--sar-med-red) !important;
}
/* Drug Checks: make the *entire* accordion header yellow (not a pill) */
details.app-accordion.dc-accordion-title-wrap > summary {
  background: #ffe600;
}

details.app-accordion.dc-accordion-title-wrap > summary::after {
  color: rgba(0, 0, 0, 0.85);
}

.app-accordion__title.dc-accordion-title {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  color: #000;
  font-weight: 900;
  border-radius: 0;
}

/* Keep the yellow title from extending too far under the native marker.
   Reserve a modest right inset and constrain the title width so it truncates
   if necessary rather than overflowing the control area. */
.app-accordion__title.dc-accordion-title {
  position: relative;
  padding-right: 1rem; /* small visual gap from the right edge */
  max-width: calc(100% - 20px); /* leave space for browser marker or controls */
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Match the banner width/padding with the title so both yellow pills appear consistent */
.drug-checks .dc-banner {
  display: block;
  box-sizing: border-box;
  /* Unlike the accordion title, the subtitle banner should be full-width like .dc-pill */
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  details.app-accordion.dc-accordion-title-wrap .app-accordion__content {
    padding: 0.75rem 0.5rem;
  }

  .drug-checks {
    padding-left: 0;
    padding-right: 0;
  }
  /* Allow the yellow subtitle/banner in drug checks to wrap on small screens
     so important guidance is not truncated with an ellipsis. */
  .drug-checks .dc-banner {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
}

/* Quick reference specific styles */
.quick-ref-list {
  padding-left: 0;
  margin: 0;
}

/* Simple-mode item styling (mobile-like: title + grey rounded bullet box) */
.quick-ref-simple {
  margin: 0;
  padding: 0;
}

.quick-ref-simple-item {
  margin: 0;
}

.quick-ref-simple-title {
  font-weight: 900;
  font-size: 1.05rem;
  margin: 0.5rem 0 0.5rem;
}

.quick-ref-simple-box {
    background: #ffffff; /* paler than surrounding area */
  border-radius: 12px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(0,0,0,0.04);
     box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.quick-ref-simple-separator {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  margin: 1.1rem 0;
}
.quick-ref-item-bullet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.2ch;
  border-radius: 999px;
  border: 2px solid var(--sar-med-red);
  font-weight: 800;
  color: var(--sar-med-red);
  font-size: 0.8rem;
}
.quick-ref-item-name {
  font-weight: 700;
}
.quick-ref-item-desc {
  margin-top: 0.4rem;
}
.quick-ref-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.quick-ref-card__header {
  font-size: 1rem;
  font-weight: 800;
}
.quick-ref-card__meta {
  color: rgba(0,0,0,0.6);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}
.quick-ref-card__body {
  margin-top: 0.5rem;
}

/* Casecard item bodies: use paler background like simple/list items */
.quick-ref-card {
  background: #ffffff; /* paler outer wrapper for casecard */
  border-radius: 12px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.quick-ref-card__body {
  background: #f0f0f0; /* inner item returns to grey */
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  border: none;
  box-shadow: none;
}
.quick-ref-item-compact {
  margin-bottom: 0.5rem;
}

/* Section header for grouped list layout */
.quick-ref-list-section__header {
  font-weight: 800;
  margin: 0.5rem 0 0.5rem 0;
  color: #222;
  padding: 0.25rem 0;
}
.quick-ref-list-section {
  margin-bottom: 0.75rem;
}

/* Card rows inside grouped list layout */
.quick-ref-card-row {
  margin-bottom: 0.6rem;
}
.quick-ref-card-content {
  display: block;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.quick-ref-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.quick-ref-card-text {
  font-weight: 700;
  color: rgba(0,0,0,0.9);
}
.quick-ref-card-badge {
  background: #fff;
  border-radius: 999px;
  border: 2px solid var(--sar-med-red);
  font-weight: 800;
  color: var(--sar-med-red);
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2ch;
  text-align: center;
  /* Reset the earlier badge rule that hides text for dot-only bullets */
  text-indent: 0;
  width: auto;
  font-size: 0.8rem;
}
.quick-ref-card-bottom,
.quick-ref-card-desc {
  margin-top: 0.5rem;
  color: rgba(0,0,0,0.75);
  text-align: left;
  padding-left: 0;
}

/* Quick Ref single-container styling (match app screenshot) */
.viewer-card--quickref {
  padding: 0.5rem; /* outer card padding reduced to let inner sections breathe */
  background: transparent; /* keep page background, inner sections will be boxed */
  box-shadow: none;
  border: none;
}

.quick-ref-section {
  margin-bottom: 1rem;
}

.quick-ref-section__title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0.75rem 0 0.5rem 0;
  color: #333;
}

.quick-ref-section__body {
  margin: 0;
}

/* Light grey rounded boxes used for grouped content (bulleted lists, item groups) */
.quick-ref-section__body > .viewer-card,
.quick-ref-section__body > .richTextDisplay,
.quick-ref-section__body > ul,
.quick-ref-section__body > .quick-ref-list,
.quick-ref-section__body > .quick-ref-simple,
.quick-ref-section__body > .quick-ref-item-compact,
.quick-ref-section__body > .quick-ref-cards {
  background: #f0f0f0;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: none;
}

/* Allow rich-text lists to show bullets (simple/default/list modes rely on this) */
.viewer-card--quickref .viewer-card__richtext ul,
.viewer-card--quickref .viewer-card__richtext ol,
.viewer-card--quickref .quick-ref-simple-box ul,
.viewer-card--quickref .quick-ref-simple-box ol,
.viewer-card--quickref .quick-ref-box ul,
.viewer-card--quickref .quick-ref-box ol,
.viewer-card--quickref .quick-ref-card-bottom ul,
.viewer-card--quickref .quick-ref-card-bottom ol,
.viewer-card--quickref .quick-ref-card-desc ul,
.viewer-card--quickref .quick-ref-card-desc ol,
.viewer-card--quickref .quick-ref-card__body ul,
.viewer-card--quickref .quick-ref-card__body ol {
  margin: 0;
  padding-left: 1.25rem;
}

.viewer-card--quickref .viewer-card__richtext ul,
.viewer-card--quickref .quick-ref-simple-box ul,
.viewer-card--quickref .quick-ref-box ul,
.viewer-card--quickref .quick-ref-card-bottom ul,
.viewer-card--quickref .quick-ref-card-desc ul,
.viewer-card--quickref .quick-ref-card__body ul {
  list-style: disc;
}

.viewer-card--quickref .viewer-card__richtext ol,
.viewer-card--quickref .quick-ref-simple-box ol,
.viewer-card--quickref .quick-ref-box ol,
.viewer-card--quickref .quick-ref-card-bottom ol,
.viewer-card--quickref .quick-ref-card-desc ol,
.viewer-card--quickref .quick-ref-card__body ol {
  list-style: decimal;
}

/* Ensure no list marker appears before section titles inside quickref */
.viewer-card--quickref .quick-ref-section {
  display: block !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* Some browsers render markers for elements nested in list items; hide any markers explicitly */
.viewer-card--quickref .quick-ref-section::marker,
.viewer-card--quickref .quick-ref-section__title::marker,
.viewer-card--quickref .quick-ref-section *::marker {
  display: none !important;
  font-size: 0 !important;
}

.quick-ref-item {
  padding: 0.5rem 0;
}

.quick-ref-item + .quick-ref-item {
  border-top: 1px solid rgba(0,0,0,0.04);
}

.quick-ref-item-bullet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.2ch;
  border-radius: 999px;
  border: 2px solid var(--sar-med-red);
  margin-right: 0.6rem;
  font-weight: 800;
  color: var(--sar-med-red);
  font-size: 0.8rem;
}

.quick-ref-item-desc {
  margin-top: 0.5rem;
  color: rgba(0,0,0,0.85);
}

/* Default quick-ref layout styles (lead letter, title, grey box, red separator) */
.quick-ref-default {
  margin: 0 0 1rem 0;
}
.quick-ref-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.25rem 0;
}
.quick-ref-lead {
  width: 36px;
  min-width: 36px;
  font-weight: 900;
  font-size: 1.05rem;
  color: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-ref-main {
  flex: 1 1 auto;
}
.quick-ref-title {
  font-weight: 900;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.quick-ref-box {
  background: #fff; /* make content box whiter for contrast */
  border-radius: 12px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* Hide the trailing separator after the final quick-ref item */
.quick-ref-default .quick-ref-separator:last-of-type {
  display: none;
}
.quick-ref-separator {
  height: 1px; /* slightly thinner */
  background: var(--sar-med-red);
  margin: 0.8rem 0 0.8rem 0;
  border-radius: 1px;
}

@media (max-width: 640px) {
  .quick-ref-lead { width: 32px; min-width: 32px; font-size: 1rem; }
  .quick-ref-title { font-size: 1rem; }
}

@media (max-width: 640px) {
  .quick-ref-card__header { font-size: 0.98rem; }
  .quick-ref-section__title { font-size: 1rem; }
}

/* Remove faint top border inside the quickref single-container */
.viewer-card--quickref .viewer-card__content {
  border-top: none;
  padding-top: 0; /* use section spacing instead */
  margin-top: 0;
}

/* Stronger overrides to ensure no residual thin lines appear */
.viewer-card--quickref {
  border: none !important;
  box-shadow: none !important;
}
.viewer-card--quickref > .viewer-card__content,
.viewer-card--quickref .viewer-card__content {
  border-top: none !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}
.viewer-card--quickref hr {
  display: none !important;
}
.viewer-card--quickref .quick-ref-section:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Clinical notice single-accordion styling */
.notice-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}
.notice-desc {
  flex: 1 1 auto;
  font-weight: 800;
}
.notice-date {
  flex: 0 0 auto;
  color: rgba(0,0,0,0.6);
  font-size: 0.95rem;
  white-space: nowrap;
  margin-left: 0.5rem;
  font-weight: 700;
}

/* Date shown after the body, right-aligned */
.notice-date-block {
  margin-top: 1rem;
  text-align: right;
  color: rgba(0,0,0,0.6);
  font-size: 0.95rem;
}

