/* Clinical guideline pages. Uses the colour and font variables from site.css. */
.gl-page { padding: 8px 0 24px; }
/* Long society lists such as "AHA/ACC/AANP/…" have no spaces; let them wrap on phones. */
.gl-page h1, .gl-page h2, .gl-page h3, .gl-page h4, .gl-page p, .gl-page li, .gl-page dd, .gl-page a, .gl-page span { overflow-wrap: anywhere; }
/* site.css gives every section large padding and a narrow h2; undo that here. */
.gl-page section:not(.gl-card):not(.gl-batch):not(.gl-notes) { padding: 0; }
.gl-page section h2 { max-width: none; letter-spacing: -.01em; }
.gl-page [hidden] { display: none !important; }
.gl-wrap { max-width: 960px; }
.gl-wrap.gl-wide { max-width: var(--wrap); }
.gl-head { padding: 40px 0 20px; }
.gl-head h1 { margin: 0; font-family: var(--serif); font-size: clamp(28px, 4.2vw, 42px); line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.gl-head .lead { max-width: 46rem; font-size: 17px; }
.gl-crumb { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.gl-crumb a { color: var(--muted); }
.gl-meta { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.gl-meta a { color: var(--accent); text-underline-offset: 3px; }
.gl-faint { color: var(--faint); }
.gl-label { margin-right: 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.gl-dot { margin: 0 8px; color: var(--faint); }
.gl-small { margin: 28px 0 0; font-size: 13.5px; color: var(--muted); }
.gl-small a { color: var(--accent); }

/* Sidebar + content */
.gl-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 8px; }
.gl-main { min-width: 0; }
.gl-nav { position: sticky; top: calc(var(--nav) + 16px); max-height: calc(100vh - var(--nav) - 32px); overflow: auto; padding-right: 4px; font-size: 14px; }
.gl-nav-title { margin: 0 0 6px; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.gl-nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.gl-nav-list a { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 5px 10px; border-radius: 8px; color: var(--text); text-decoration: none; line-height: 1.35; }
.gl-nav-list a:hover { background: var(--surface-2); }
.gl-nav-list a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.gl-nav-list a.gl-nav-empty { color: var(--faint); }
.gl-nav-count { flex: none; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.gl-nav-count b { font-weight: inherit; }
/* A specialty page opens its sidebar with its own topics; narrow screens get a sticky row of the same links instead. */
.gl-nav-own { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.gl-nav-topics a.is-current { background: var(--surface-2); color: var(--accent); font-weight: 600; }
.gl-jump { display: none; }
.gl-nav-links { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.9; color: var(--muted); }
.gl-nav-links a { color: var(--accent); text-decoration: none; }
.gl-nav-links a:hover { text-decoration: underline; }

/* Filter (shown by guidelines.js) */
.gl-filter { display: grid; gap: 10px; margin: 0 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.gl-filter label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.gl-filter input, .gl-filter select { width: 100%; min-width: 0; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.gl-filter input:focus, .gl-filter select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.gl-search-go { justify-self: start; padding: 5px 14px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.gl-search { margin-top: 18px; }
.gl-filter-clear { justify-self: start; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.gl-filter-clear:hover { color: var(--text); border-color: var(--text); }
.gl-result { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.gl-empty { margin: 0 0 24px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 14.5px; }

/* Overview: one line per guideline, grouped by specialty and topic */
.gl-group { margin: 0 0 36px; scroll-margin-top: calc(var(--nav) + 12px); }
.gl-group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.gl-group-head h2 { margin: 0; font-size: 22px; }
.gl-group-meta { margin: 0; font-size: 13.5px; color: var(--muted); }
.gl-group-meta a { color: var(--accent); text-decoration: none; font-weight: 600; }
.gl-group-meta a:hover { text-decoration: underline; }
.gl-cols, .gl-r { display: grid; grid-template-columns: 56px 150px minmax(0, 1fr) 118px 150px; gap: 0 14px; align-items: baseline; }
.gl-cols { grid-template-columns: 180px 56px 150px minmax(0, 1fr) 118px 150px; padding: 6px 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.gl-topic-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 0 14px; align-items: start; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--nav) + 12px); }
.gl-topic-row:last-child { border-bottom: 1px solid var(--line); }
.gl-topic-name { margin: 0; padding: 10px 10px 10px 10px; font-size: 14.5px; font-weight: 650; line-height: 1.4; }
.gl-topic-name a { color: var(--text); text-decoration: none; }
.gl-topic-name a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.gl-rows { display: grid; }
.gl-r { padding: 9px 10px; color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.4; border-radius: 8px; scroll-margin-top: calc(var(--nav) + 12px); }
.gl-r + .gl-r { border-top: 1px dashed var(--line); border-radius: 0; }
.gl-r:hover { background: var(--surface-2); }
.gl-r:target { background: var(--accent-soft); }
.gl-r-region { font-size: 12.5px; font-weight: 650; color: var(--brand); letter-spacing: .02em; }
.gl-r-org { font-weight: 600; }
.gl-r-ver b { font-weight: 700; font-variant-numeric: tabular-nums; }
.gl-r-ver small { margin-left: 6px; font-size: 12.5px; color: var(--muted); }
.gl-r-checked { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.gl-due { margin-left: 6px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--warning); }
.gl-r .status-chip { white-space: normal; font-weight: 500; font-size: 12px; padding: 1px 7px; }

/* Specialty page: topic sections of cards */
.gl-topic { margin: 0 0 30px; scroll-margin-top: calc(var(--nav) + 12px); }
.gl-topic > h2 { margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-strong); font-size: 20px; }
.gl-topic-page { margin: -2px 0 12px; font-size: 14px; }
.gl-topic-page a { color: var(--accent); text-decoration: none; }
.gl-topic-page a:hover { text-decoration: underline; }
.gl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; align-items: stretch; }
.gl-item { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; scroll-margin-top: calc(var(--nav) + 12px); }
.gl-item:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Card */
.gl-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 6px; font-size: 12.5px; }
.gl-region { font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.gl-org-short { font-weight: 600; color: var(--muted); }
.gl-item h3 { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 650; }
.gl-title { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.45; font-weight: 600; }
.gl-orig { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
details.gl-orig summary { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; list-style: none; font-size: 12.5px; color: var(--faint); }
details.gl-orig summary::-webkit-details-marker { display: none; }
details.gl-orig summary::before { content: ""; border-left: 4px solid currentColor; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; transition: transform .15s; }
details.gl-orig[open] summary::before { transform: rotate(90deg); }
details.gl-orig summary:hover { color: var(--muted); }
details.gl-orig > span { display: block; margin-top: 2px; }
.gl-org { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.gl-version { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: center; margin: 12px 0 0; padding: 8px 12px 10px; border-radius: 10px; background: var(--surface-2); }
.gl-version-label { grid-column: 1 / -1; margin: 0; }
.gl-year { font-family: var(--serif); font-size: 28px; font-weight: 650; line-height: 1; letter-spacing: -.02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.gl-version-meta { margin: 0; font-size: 13.5px; line-height: 1.5; }
.gl-version-meta .gl-dot { margin: 0 6px; }
.gl-ver-text { font-weight: 600; }
.gl-check { margin: 10px 0 0; font-size: 13.5px; }
.gl-check .status-chip { white-space: normal; }
.gl-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 12px 0 0; font-size: 14px; }
.gl-links-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.gl-links a { color: var(--accent); text-underline-offset: 3px; }
.gl-links a.gl-pri { padding: 5px 12px; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; }
.gl-links a.gl-pri:hover { background: var(--accent-hover); }
.gl-links .gl-more { margin-left: auto; font-weight: 600; text-decoration: none; }
.gl-history { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.gl-item .gl-history { margin-top: auto; padding-top: 10px; }
.gl-item .gl-links + .gl-history { margin-top: 12px; }
.gl-history summary { cursor: pointer; font-weight: 600; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
.gl-history summary::-webkit-details-marker { display: none; }
.gl-history summary::before { content: ""; width: 0; height: 0; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s; }
.gl-history[open] summary::before { transform: rotate(90deg); }
.gl-history summary:hover { color: var(--text); }
.gl-history p { margin: 8px 0 0; color: var(--text); }
.gl-together { color: var(--muted) !important; font-size: 13px; }

/* Notes and the agents section (overview page) */
.gl-notes { margin: 8px 0 0; padding: 22px 24px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: calc(var(--nav) + 12px); }
.gl-notes h2 { font-size: 22px; margin: 0 0 10px; }
.gl-notes h3 { margin: 18px 0 8px; font-size: 16px; }
.gl-notes ul { margin: 0; padding-left: 20px; color: var(--muted); }
.gl-notes li + li { margin-top: 6px; }
.gl-notes p { margin: 16px 0 0; font-size: 14px; }
.gl-notes a { color: var(--accent); }
.gl-access { display: grid; gap: 8px; margin: 0; }
.gl-access div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.gl-access dd { margin: 0; color: var(--muted); font-size: 14.5px; }
.gl-access .status-chip { white-space: normal; }
.gl-agents { margin-top: 20px; }
.gl-agents-lead { margin: 0 0 10px !important; font-size: 15px !important; color: var(--muted); }
.gl-agents code { font-family: var(--mono); font-size: 13.5px; }

/* Entry pages */
.gl-entry .gl-head { padding-bottom: 12px; }
.gl-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; box-shadow: 0 2px 16px rgba(27, 42, 65, .06); }
.gl-card > h2 { font-size: 13px; font-family: var(--sans); font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin: 0 0 8px; }
.gl-card-actions { margin: 18px 0 0; }
.gl-section { margin: 32px 0 0; }
.gl-section h2 { font-size: 22px; margin: 0 0 10px; }
.gl-section ul { margin: 0; padding-left: 20px; }
.gl-section li + li { margin-top: 8px; }
.gl-sources { list-style: none; padding: 0 !important; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.gl-sources li { margin: 0 !important; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.gl-sources li + li { border-top: 1px solid var(--line); }
.gl-sources a { color: var(--accent); text-underline-offset: 3px; }
.gl-host { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.gl-ai { margin: 32px 0 0; padding: 18px 22px; border-left: 4px solid var(--warning); background: var(--warning-soft); border-radius: 0 12px 12px 0; }
.gl-ai h2 { margin: 0 0 6px; font-family: var(--sans); font-size: 17px; font-weight: 650; }
.gl-ai p { margin: 0; color: var(--text); }
.gl-related a { color: var(--accent); }

/* Updates page */
.gl-count { font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--faint); margin-left: 4px; }
.gl-month { margin: 12px 0 40px; }
.gl-month > h2 { font-size: 28px; margin: 0 0 6px; }
.gl-batch { margin: 22px 0 0; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: calc(var(--nav) + 12px); }
.gl-batch h3 { margin: 0 0 8px; font-size: 19px; font-family: var(--serif); }
.gl-batch h4 { margin: 16px 0 6px; font-size: 14px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.gl-batch > p { margin: 8px 0 0; font-size: 14.5px; }
.gl-updates { margin: 0; padding-left: 20px; font-size: 15px; }
.gl-updates li + li { margin-top: 6px; }
.gl-updates a { color: var(--text); text-underline-offset: 3px; }
.gl-updates .gl-faint { font-size: 13.5px; }
.gl-replaces { display: block; font-size: 13.5px; color: var(--muted); }

.gl-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; margin: 44px 0 64px; padding: 24px 28px; border-radius: 14px; background: var(--accent); color: #fff; }
.gl-cta strong { display: block; font-family: var(--serif); font-size: 21px; }
.gl-cta p { margin: 6px 0 0; color: #d6dee8; font-size: 14.5px; max-width: 40rem; }
.gl-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.gl-cta .btn:not(.pri) { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.gl-cta .btn:not(.pri):hover { background: rgba(255, 255, 255, .12); }

/* Narrow layouts: sidebar on top, specialty list scrolls sideways, rows wrap into two lines. */
@media (max-width: 900px) {
  .gl-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .gl-nav { position: static; max-height: none; overflow: visible; padding-right: 0; }
  .gl-nav-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .gl-nav-list a { flex: none; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); white-space: nowrap; }
  .gl-nav-list a span { overflow-wrap: normal; }
  .gl-nav-links { margin-top: 10px; padding-top: 10px; }
  .gl-nav-own { display: none; }
  /* Specialty pages: cards first; other specialties and search come after them. */
  .gl-nav-specialty { order: 2; }
  .gl-nav-unit { display: none; }
  .gl-jump { display: block; position: sticky; top: var(--gl-sticky, var(--nav)); z-index: 5; margin: 0 -14px 14px; padding: 8px 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .gl-jump ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .gl-jump ul::-webkit-scrollbar { display: none; }
  .gl-jump a { flex: none; display: flex; gap: 6px; align-items: baseline; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13.5px; text-decoration: none; white-space: nowrap; }
  .gl-jump a span { overflow-wrap: normal; }
  .gl-jump a.is-current { border-color: var(--accent); color: var(--accent); font-weight: 600; }
  .gl-jump a.gl-nav-empty { color: var(--faint); }
  .gl-topic { scroll-margin-top: calc(var(--gl-sticky, var(--nav)) + 60px); }
  .gl-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gl-filter-clear { grid-column: 1 / -1; }
  .gl-cols { display: none; }
  .gl-topic-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .gl-topic-name { padding: 10px 10px 2px; }
  .gl-r { display: flex; flex-wrap: wrap; gap: 2px 12px; }
  .gl-r-checked { width: 100%; font-size: 13px; }
  .gl-r-checked::before { content: attr(data-label); }
}

@media (max-width: 640px) {
  .gl-head { padding-top: 28px; }
  .gl-item, .gl-card, .gl-batch, .gl-notes { padding: 14px 16px; }
  .gl-filter { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .gl-access div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .gl-links .gl-more { margin-left: 0; }
  .gl-host { margin-left: 0; width: 100%; }
  .gl-year { font-size: 24px; }
  .gl-cta { padding: 20px; }
  .gl-cta-actions, .gl-cta-actions .btn { width: 100%; }
}
.gl-prev-orig { display: block; margin-top: 2px; font-size: 12px; color: var(--faint); }
