/* FDA guidance documents page (issue #167). Uses the tokens in styles.css. */
/* `hidden` must win over any component's own display rule (flex / grid boxes). */
[hidden] { display: none !important; }

/* Column layout so the footer sits at the bottom of short pages. */
.guidance-page { background: var(--bg); color: var(--text); font-family: var(--font-body); min-height: 100vh; display: flex; flex-direction: column; }

/* Same width as the device search (styles.css #dataTableTab > #queryRoot):
   92% of the window up to 1900px, 10px margins at or below 1200px, edge to
   edge on phones. Keep the two in step. */
.gd-main { flex: 1 0 auto; box-sizing: border-box; width: min(100%, 92vw, 1900px); margin: 0 auto; padding: 24px 0 40px; }
@media (max-width: 1200px) { .gd-main { width: calc(100% - 20px); } }
@media (max-width: 768px) { .gd-main { width: 100%; } }
.gd-title { font-family: var(--font-display); color: var(--text-bright); font-size: 28px; margin: 0 0 6px; line-height: 1.25; }
.gd-main h2 { font-family: var(--font-display); color: var(--text-bright); font-size: 18px; margin: 26px 0 10px; }
.gd-dim { color: var(--text-dim); font-size: 13px; font-weight: 400; }
.gd-note { margin: -4px 0 12px; }



/* Search card: the device explorer's .filter-panel look (styles.css), sized
   for this page. */
.gd-search-panel { margin: 0 0 12px; }
.gd-more-row { margin-top: 12px; }
.gd-search-panel .search-everything { width: 100%; }
/* Topic · Document type · Center · Issued (the date control needs the most room). */
.gd-filter-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(300px, 1.6fr); }
.gd-filter-grid select { width: 100%; min-width: 0; }
@media (max-width: 1100px) {
  .gd-filter-grid { grid-template-columns: 1fr 1fr; }
  .gd-filter-grid .gd-issued { grid-column: 1 / -1; }
}
@media (max-width: 560px) { .gd-filter-grid { grid-template-columns: 1fr; } }
.gd-issued .date-filter { margin-top: 4px; }
/* The action bar keeps styles.css .filter-actions' own card padding. */
/* Matches the device search: the Clear All / Search row under the query card
   (styles.css .group-actions / .last-group-extras), then the results card
   (#globalActions). 10px between them, as #dataTableTab's gap. */
.gd-query-actions { margin: 10px 0; }
.gd-clear-all.btn-danger { background: #fff; border-color: rgba(232,80,54,0.28); color: var(--red); }
.gd-clear-all.btn-danger:hover { background: var(--red-bg); border-color: var(--red); color: #B8321D; }
.gd-sorted-by { font-size: 18px; line-height: 1.5; }
.gd-actions { align-items: center; margin-bottom: 12px; }
.gd-actions .btn:not(.actions-cluster-btn), .gd-actions .alert-create-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; box-sizing: border-box; }
.gd-actions .sort-dir-btn:disabled { opacity: 0.4; cursor: default; }
.gd-actions .sort-dir-btn:disabled:hover { background: transparent; color: var(--text-dim); }

/* Guidance page header: one card (title, actions, one meta line, tabs),
   styled like the search card on the list page. */
.gd-head { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035); padding: 18px 20px 0; margin-bottom: 12px; }
.gd-head:not(:has(.gd-tabs)) { padding-bottom: 16px; }
.gd-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.gd-head .gd-title { font-size: 22px; margin: 0; }
.gd-head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.gd-head-actions .btn, .gd-watch-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; box-sizing: border-box; text-decoration: none; white-space: nowrap; }
.gd-watch-btn.gd-watching { background: var(--bg-raised); color: var(--accent); border: 1px solid var(--accent); }
.gd-head-meta { margin-top: 8px; }
.gd-head-topics { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
@media (max-width: 640px) {
  .gd-title-row { flex-direction: column; }
  .gd-head .gd-title { font-size: 19px; }
  /* Three nowrap buttons are wider than a phone: let them wrap. */
  .gd-head-actions { flex-wrap: wrap; flex-shrink: 1; max-width: 100%; }
  /* Five tabs do not fit either: scroll the strip sideways, not the page. */
  .gd-tabs { overflow-x: auto; scrollbar-width: none; }
  .gd-tabs button { flex: 0 0 auto; white-space: nowrap; padding: 10px 11px; }
}

/* Alert dialog (alerts.js) */
.gd-alert-modal { max-width: 520px; }
.gd-alert-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.gd-alert-actions .auth-btn { width: auto; padding-left: 18px; padding-right: 18px; text-decoration: none; }
.gd-alert-caption { font-size: 13px; color: var(--text); margin: 14px 0 6px; }
.gd-alert-preview { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); max-height: 240px; overflow: auto; }
.gd-alert-preview li { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.4; }
.gd-alert-preview li:last-child { border-bottom: none; }
.gd-alert-preview a { color: var(--text-bright); text-decoration: none; font-weight: 500; }
.gd-alert-preview a:hover { text-decoration: underline; }
.gd-alert-preview span { display: block; color: var(--text-dim); font-size: 12px; margin-top: 2px; }

.gd-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 500; color: var(--accent); background: var(--bg-card); border: 1px solid var(--blue-border); border-radius: var(--radius); cursor: pointer; text-decoration: none; }
.gd-btn:hover { background: var(--accent-glow); }
.gd-btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.gd-btn-primary:hover { background: #24336c; }
.gd-block { display: flex; justify-content: center; margin-top: 14px; }

.gd-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gd-result { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
.gd-result:hover { border-color: var(--blue-border); }
.gd-result-title { font-weight: 600; color: var(--text-bright); text-decoration: none; font-size: 15px; line-height: 1.35; }
.gd-result-title:hover { text-decoration: underline; }
.gd-snippet { margin: 8px 0 0; font-size: 13px; line-height: 1.55; }
.gd-snippet mark { background: rgba(249,115,22,0.22); color: inherit; padding: 0 1px; border-radius: 2px; }


.gd-pager { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 22px 0 8px; }
.gd-pager:empty { display: none; }
.gd-pager-range { margin: 0; font-size: 13px; }
.gd-pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; }
.gd-page { font: inherit; font-size: 13px; min-width: 34px; height: 34px; padding: 0 10px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); color: var(--text); cursor: pointer; }
button.gd-page:hover { border-color: var(--accent); color: var(--accent); }
.gd-page-on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; cursor: default; }
.gd-page-off { color: var(--text-dim); opacity: .5; cursor: default; }
.gd-page-gap { color: var(--text-dim); padding: 0 2px; }
@media (max-width: 640px) {
  /* Phones: keep Previous / Next and the current page; drop far-off numbers. */
  .gd-pages .gd-page[aria-label] { display: none; }
  .gd-pages .gd-page-gap { display: none; }
}

/* Skeleton placeholders (G.skeleton in app.js); bars are styles.css .rt-skeleton-bar. */
.gd-skel { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.gd-skel .rt-skeleton-bar, .gd-skel-card .rt-skeleton-bar { max-width: 100%; }
.gd-skel-card { display: flex; flex-direction: column; gap: 10px; }
.gd-skel-title { height: 16px; }
.gd-skel-h1 { height: 22px; }
.gd-skel-chip { height: 18px; border-radius: 999px; }
.gd-skel-meta { height: 10px; }
.gd-skel-line { height: 11px; }
.gd-skel-row { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.gd-skel-head, .gd-skel-block { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.gd-skel-page { display: flex; flex-direction: column; gap: 14px; width: min(100%, 760px); margin: 0 auto; aspect-ratio: 8.5 / 11; box-sizing: border-box; padding: 9% 10%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.12), 0 0 0 1px rgba(15,23,42,.05); }
.gd-skel-page .gd-skel-title { margin: 0 auto 10px; }
.gd-skel-caption { margin: 0; color: var(--text-dim); font-size: 13px; text-align: center; }
.gd-loading, .gd-empty { color: var(--text-dim); padding: 20px 0; list-style: none; }
.gd-error { color: var(--red); background: var(--red-bg); border: 1px solid var(--amber-border); border-radius: var(--radius); padding: 10px 14px; list-style: none; }

.gd-back { display: inline-block; margin-bottom: 10px; font-size: 13px; color: var(--accent); text-decoration: none; }
.gd-facts { font-size: 13px; color: var(--text-dim); margin: 4px 0 14px; }
.gd-facts a { color: var(--accent); }
.gd-note { margin: 0 0 12px; }
.gd-note-box { background: var(--blue-bg); border: 1px solid var(--blue-border); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin: 0 0 12px; }

/* tabs + per-tab toolbar */
.gd-tabs { display: flex; gap: 2px; margin: 14px -20px 0; padding: 0 12px; border-top: 1px solid var(--border); }
.gd-tabs button { font: inherit; font-size: 14px; font-weight: 500; color: var(--text-dim); background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; }
.gd-tabs button:hover { color: var(--accent); }
.gd-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.gd-tabs button span { font-size: 11px; font-weight: 600; background: var(--bg); color: var(--text-dim); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.gd-tab-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 0 12px; font-size: 13px; }
.gd-tab-toolbar .gd-viewtoggle { margin: 0 0 0 auto; }
.gd-tab-toolbar:empty { display: none; }
.gd-tab-toolbar select, .gd-cmp-bar select { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text); max-width: 100%; }
.gd-tab-toolbar label, .gd-cmp-bar label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); }

/* reader: outline + document */
.gd-reader { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.gd-reader-solo { grid-template-columns: minmax(0, 1fr); }
.gd-outline { position: sticky; top: calc(var(--app-header-h) + 12px); max-height: calc(100vh - var(--app-header-h) - 24px); overflow: auto; font-size: 13px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 10px 12px 14px; }
.gd-outline-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin-bottom: 8px; }
.gd-outline ol { list-style: none; margin: 0; padding: 0; }
.gd-outline li { margin: 0 0 6px; line-height: 1.35; }
.gd-outline .gd-ol-h3 { padding-left: 14px; font-size: 12.5px; }
.gd-outline a { color: var(--text); text-decoration: none; }
.gd-outline a:hover { color: var(--accent); }
.gd-doc-col { min-width: 0; }
.gd-viewtoggle, .gd-seg { display: inline-flex; border: 1px solid var(--blue-border); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.gd-viewtoggle button, .gd-seg button { font: inherit; font-size: 13px; padding: 6px 14px; border: 0; background: var(--bg-card); color: var(--accent); cursor: pointer; }
.gd-viewtoggle button + button, .gd-seg button + button { border-left: 1px solid var(--blue-border); }
.gd-viewtoggle button.on, .gd-seg button.on { background: var(--accent); color: #fff; }
.gd-seg { margin-bottom: 0; }

.gd-doc { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gd-pdf-page { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.12), 0 0 0 1px rgba(15,23,42,.05); max-width: 100%; }
.gd-pdf-page canvas { display: block; width: 100%; height: 100%; }
.gd-text-layer { position: absolute; inset: 0; overflow: hidden; line-height: 1; opacity: .25; }
.gd-text-layer span, .gd-text-layer br { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0 0; }
.gd-text-layer ::selection { background: rgba(45,63,134,.35); }

.gd-text { width: 100%; max-width: 820px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px 40px; color: #374151; font-size: 15px; line-height: 1.7; }
.gd-text p { margin: 0 0 12px; }
.gd-text, .gd-b, .gd-lineage, .gd-pdiff-list { overflow-wrap: anywhere; } /* long URLs in FDA text */
.gd-text .gd-doc-h2 { font-family: var(--font-display); font-size: 20px; color: var(--text-bright); margin: 28px 0 10px; line-height: 1.3; }
.gd-text .gd-doc-h3 { font-size: 16.5px; color: var(--text-bright); margin: 22px 0 8px; }
.gd-text .gd-doc-h4 { font-size: 15px; color: var(--text-bright); margin: 18px 0 6px; }
.gd-text .gd-list { margin: 0 0 12px; padding-left: 22px; }
.gd-text .gd-list li { margin-bottom: 6px; }
.gd-text .gd-fn { font-size: 12.5px; color: var(--text-dim); border-left: 2px solid var(--border); padding-left: 10px; line-height: 1.5; }
.gd-text .gd-toc { margin: 0 0 16px; font-size: 13px; }
.gd-text .gd-toc summary { cursor: pointer; color: var(--accent); }
.gd-text .gd-toc ol { list-style: none; padding-left: 8px; color: var(--text-dim); }
.gd-pagemark { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--slate); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.gd-pagemark::before, .gd-pagemark::after { content: ""; flex: 1; border-top: 1px dashed var(--border); }
.gd-text [id]:target { background: rgba(249,115,22,.12); }

/* compare */
.gd-cmp-bar { position: sticky; top: var(--app-header-h); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 0; background: var(--bg); border-bottom: 1px solid var(--border); font-size: 13px; }
.gd-cmp-bar select { max-width: 320px; }
.gd-icon { padding: 5px 9px; }
.gd-nav-chg { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.gd-nav-chg span { color: var(--text-dim); min-width: 110px; text-align: center; }
.gd-cmp-body { display: flex; flex-direction: column; gap: 6px; }
.gd-chg-type { font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.gd-chg-type.gd-chg-mod { color: #a16207; }
.gd-chg-type.gd-chg-add { color: var(--green); }
.gd-chg-type.gd-chg-del { color: var(--red); }
.gd-b { font-size: 14px; line-height: 1.65; color: #374151; margin-bottom: 6px; }
.gd-b:last-child { margin-bottom: 0; }
.gd-b-h2, .gd-b-h3, .gd-b-h4 { font-weight: 600; color: var(--text-bright); }
.gd-b-li { padding-left: 14px; position: relative; }
.gd-b-li::before { content: "•"; position: absolute; left: 2px; color: var(--slate); }
.gd-b-fn { font-size: 12.5px; color: var(--text-dim); }
.gd-b del { background: rgba(232,80,54,.18); color: #9f1d0b; text-decoration: line-through; text-decoration-color: rgba(159,29,11,.5); border-radius: 2px; padding: 0 1px; }
.gd-b ins { background: rgba(22,163,74,.18); color: #14532d; text-decoration: none; border-radius: 2px; padding: 0 1px; }

/* inline compare on the rendered PDF (pdfdiff.js) */
.gd-cmp-body { position: relative; }
.gd-pdiff-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 0; font-size: 13px; }
.gd-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); }
.gd-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-left: 6px; }
.gd-legend .lg-mod { background: rgba(250,204,21,.6); }
.gd-legend .lg-add { background: rgba(34,197,94,.42); }
.gd-legend .lg-del { background: #dc2626; width: 4px; height: 12px; }
.gd-pdiff { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.gd-pdiff-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.gd-hl-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.gd-hl { position: absolute; padding: 0; border: 0; border-radius: 2px; cursor: pointer; pointer-events: auto; mix-blend-mode: multiply; }
.gd-hl-mod { background: rgba(250,204,21,.45); }
.gd-hl-add { background: rgba(34,197,94,.34); }
.gd-hl-del { background: rgba(239,68,68,.32); }
.gd-hl-del-mark, .gd-hl-add-mark { width: 4px; mix-blend-mode: normal; }
.gd-hl-del-mark { background: #dc2626; }
.gd-hl-add-mark { background: #16a34a; }
.gd-hl-del-mark::before, .gd-hl-add-mark::before { position: absolute; top: -9px; left: -5px; width: 14px; height: 14px; border-radius: 50%; color: #fff; font: 700 11px/14px system-ui, sans-serif; text-align: center; }
.gd-hl-del-mark::before { content: "\2212"; background: #dc2626; }
.gd-hl-add-mark::before { content: "+"; background: #16a34a; }
.gd-hl.focus { outline: 2px solid var(--applied); outline-offset: 1px; mix-blend-mode: normal; }
.gd-hl-mod.focus { background: rgba(250,204,21,.6); }
.gd-hl-add.focus { background: rgba(34,197,94,.45); }
.gd-hl-del.focus { background: rgba(239,68,68,.42); }
.gd-pdiff-list { position: sticky; top: calc(var(--app-header-h) + 70px); max-height: calc(100vh - var(--app-header-h) - 90px); overflow: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: 12.5px; }
.gd-pdiff-list ol { list-style: none; margin: 0; padding: 4px 0; }
.gd-pdiff-list del { background: rgba(239,68,68,.15); color: #9f1d0b; }
.gd-pdiff-list ins { background: rgba(34,197,94,.18); color: #14532d; text-decoration: none; }
.gd-pop { position: absolute; z-index: 20; width: 340px; max-width: calc(100% - 8px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(15,23,42,.16); padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.gd-pop p { margin: 4px 0 0; color: #374151; white-space: pre-wrap; }

/* version history: one simple list, newest first */
.gd-versions { list-style: none; padding: 0; margin: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.gd-version { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.gd-version:last-child { border-bottom: 0; }
.gd-version-main { min-width: 0; flex: 1; }
.gd-version-head { font-weight: 600; color: var(--text-bright); font-size: 14px; }
.gd-version-current .gd-version-head { color: var(--accent); }
.gd-version-facts { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.gd-version-facts a { color: var(--accent); }
.gd-version-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.gd-lineage { list-style: none; padding: 0; margin: 8px 0 0; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; color: #374151; }
.gd-lineage-kind { display: inline-block; min-width: 150px; font-weight: 600; color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.gd-main h2.gd-sub { font-size: 15px; margin: 20px 0 8px; }
@media (max-width: 640px) { .gd-version { flex-direction: column; } }
.gd-events { font-size: 13px; }

@media (max-width: 980px) {
  .gd-pdiff { grid-template-columns: 1fr; }
  .gd-pdiff-list { position: static; max-height: none; order: -1; overflow: visible; }
  .gd-pdl ol { max-height: 50vh; overflow: auto; }
  .gd-reader { grid-template-columns: 1fr; }
  /* Narrow screens: the document's own table of contents does the job. */
  .gd-outline { display: none; }
  .gd-tab-toolbar label { flex: 1 1 220px; min-width: 0; }
  .gd-tab-toolbar label select { flex: 1; min-width: 0; }
  .gd-nav-chg { margin-left: 0; }
  .gd-text { padding: 20px 18px; }
}
@media (max-width: 640px) {
  .gd-lineage-kind { display: block; min-width: 0; }
  .gd-cmp-bar { position: static; }
}

/* fuzzy tier (fuzzy.js): same cards as the exact results, plus the passage that matched */
.gd-fuzzy { margin-top: 22px; }
.gd-tier-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 2px 10px; }
.gd-tier-head h3 { margin: 0; font-family: var(--font-display); font-size: 16px; color: var(--text-bright); }
.gd-result-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gd-relevance { flex-shrink: 0; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent); background: var(--blue-bg); border: 1px solid var(--blue-border); border-radius: 999px; padding: 1px 8px; }
.gd-passage { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--blue-border); background: var(--bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; line-height: 1.55; color: #374151; overflow-wrap: anywhere; }
.gd-passage-page { display: inline-block; margin-right: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.gd-fuzzy-note { margin: 14px 2px 0; }
.gd-fuzzy-jump { color: inherit; }
.gd-actions .credit-cost { margin-left: 2px; }

/* Topic menu hierarchy (facets.js): "All …" group rows, then their tags. */
.pill-input-option.pill-input-option-group { background: var(--bg); border-top: 1px solid var(--border); }
.pill-input-option.pill-input-option-group .pill-input-option-value { font-weight: 700; color: var(--accent); }
.pill-input-option.pill-input-option-subgroup { padding-left: 22px; }
.pill-input-option.pill-input-option-tag { padding-left: 26px; }
.pill-input-option.pill-input-option-group.active,
.pill-input-option.pill-input-option-group:hover { background: var(--accent-glow); }


/* Cheat sheet tab (cheatsheet.js) */
.gd-cs-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 12px; }
.gd-cs-card h3 { font-family: var(--font-display); font-size: 16px; color: var(--text-bright); margin: 0 0 12px; }
.gd-cs-card h4 { font-size: 14px; color: var(--text-bright); margin: 0 0 8px; }
.gd-cs-overview p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.6; color: #374151; }
.gd-cs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.gd-cs-actions .btn { text-decoration: none; }
.gd-cs-scope { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gd-cs-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gd-cs-col li { font-size: 13.5px; line-height: 1.5; }
.gd-cs-out { background: var(--red-bg); border: 1px solid var(--amber-border); border-radius: var(--radius); padding: 12px 14px; }
.gd-cs-out h4 { color: var(--red); }
.gd-cs-in { background: var(--green-bg); border: 1px solid var(--green-border); border-radius: var(--radius); padding: 12px 14px; }
.gd-cs-in h4 { color: var(--green); }
.gd-cs-quote { margin: 4px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--border); font-size: 12.5px; line-height: 1.5; color: var(--text-dim); font-style: italic; overflow-wrap: anywhere; }
.gd-cs-page { font-style: normal; font-weight: 600; font-size: 11.5px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.gd-cs-page:hover { text-decoration: underline; }
mark.gd-term { background: rgba(249,115,22,.18); color: inherit; padding: 0 2px; border-radius: 2px; font-style: normal; }
.gd-cs-fw + .gd-cs-fw { margin-top: 14px; }
.gd-cs-fw ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; }
.gd-cs-terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.gd-cs-term { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.gd-cs-term-name { font-weight: 700; color: var(--accent); font-size: 14px; }
.gd-cs-term p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
.gd-cs-ex-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gd-cs-ex-head h3 { margin: 0; }
.gd-cs-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.gd-cs-filter button { font: inherit; font-size: 12.5px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-card); color: var(--text); cursor: pointer; }
.gd-cs-filter button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.gd-cs-score { margin: 12px 0; }
.gd-cs-examples { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.gd-cs-ex { font-size: 14px; line-height: 1.5; }
.gd-cs-ex-text { margin: 0 0 4px; color: var(--text-bright); }
.gd-cs-side { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid; }
.gd-side-yes { background: var(--red-bg); color: var(--red); border-color: var(--amber-border); }
.gd-side-no { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.gd-side-maybe { background: var(--amber-bg); color: #b45309; border-color: var(--amber-border); }
.gd-cs-reason { font-size: 13px; color: #374151; }
.gd-cs-ex details summary { cursor: pointer; font-size: 12px; color: var(--accent); margin-top: 4px; }
.gd-cs-guess { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.gd-btn-wrong { background: var(--red-bg); color: var(--red); border-color: var(--amber-border); }
.gd-cs-right .gd-cs-ex-text::before { content: "✓ "; color: var(--green); font-weight: 700; }
.gd-cs-wrong .gd-cs-ex-text::before { content: "✗ "; color: var(--red); font-weight: 700; }
@media (max-width: 720px) { .gd-cs-scope { grid-template-columns: 1fr; } }
/* Devices tab (devices.js) */
/* Devices tab (devices.js): one row per filing, like the search results. */
.gd-devs-head { margin: 4px 0 12px; }
.gd-devs-head h3 { font-family: var(--font-display); font-size: 17px; color: var(--text-bright); margin: 0 0 2px; }
.gd-devs-head p { margin: 0; font-size: 13px; }
.gd-dev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gd-dev { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; }
.gd-dev-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.gd-dev-name { font-weight: 600; font-size: 15px; color: var(--accent); text-decoration: none; }
.gd-dev-name:hover { text-decoration: underline; }
.gd-dev-tag { font-size: 11.5px; font-weight: 600; color: var(--green); background: var(--green-bg); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.gd-dev-meta { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.gd-dev-meta a { color: inherit; text-decoration: underline; text-decoration-color: var(--border); }
.gd-dev-snip { font-size: 13px; color: var(--text); line-height: 1.55; margin: 6px 0 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.gd-dev-snip mark { background: rgba(250, 204, 21, .35); color: inherit; border-radius: 2px; padding: 0 1px; }
.gd-devs-more { display: inline-block; margin-top: 14px; font-weight: 600; font-size: 14px; color: var(--accent); }
/* "Does a guidance apply?" dialog (applies.js) */
.gd-applies-modal { max-width: 720px; width: calc(100% - 32px); max-height: 88vh; overflow: auto; }
.gd-applies-modal textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); resize: vertical; }
.gd-applies-list { margin: 16px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.gd-applies-list p { margin: 4px 0; font-size: 13.5px; line-height: 1.5; }
.gd-applies-head a { font-weight: 600; color: var(--text-bright); text-decoration: none; font-size: 14px; }
.gd-applies-head a:hover { text-decoration: underline; }
.gd-tone-green { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.gd-tone-red { background: var(--red-bg); color: var(--red); border-color: var(--amber-border); }
.gd-tone-amber { background: var(--amber-bg); color: #b45309; border-color: var(--amber-border); }
/* Read marks and team notes (mine.js) */
.gd-read-done { color: var(--green); border-color: var(--green-border); }
.gd-changed { background: var(--amber-bg); border-color: var(--amber-border); }
.gd-linkbtn { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.gd-notes { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 16px; margin-bottom: 12px; }
.gd-notes summary { cursor: pointer; font-weight: 600; color: var(--text-bright); font-size: 14px; }
.gd-notes-list { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.5; }
.gd-notes-list li { border-left: 3px solid var(--blue-border); padding-left: 10px; }
.gd-notes textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13.5px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); margin: 6px 0; }

/* Web compare (compare.js webDiffHtml): the rendered page with edits in place. */
.gd-wdiff { margin-top: 12px; }
.gd-wdiff [data-chg] { border-left: 3px solid transparent; padding-left: 10px; margin-left: -13px; border-radius: 2px; scroll-margin-top: calc(var(--app-header-h, 64px) + 120px); }
.gd-wdiff [data-chg="mod"] { border-left-color: #eab308; }
.gd-wdiff [data-chg="add"] { border-left-color: var(--green); }
.gd-wdiff [data-chg="del"] { border-left-color: var(--red); }
.gd-wdiff .gd-focus { background: rgba(249, 115, 22, .08); box-shadow: 0 0 0 2px rgba(249, 115, 22, .35); }
.gd-wdiff del { background: rgba(232,80,54,.16); color: #9f1d0b; text-decoration: line-through; text-decoration-color: rgba(159,29,11,.5); border-radius: 2px; padding: 0 1px; }
.gd-wdiff ins { background: rgba(22,163,74,.16); color: #14532d; text-decoration: none; border-radius: 2px; padding: 0 1px; }
.gd-cmp-read { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* Strict colours (2026-10-01): green = only added, red = only removed,
   yellow = replaced. The hover card shows the content itself. */
.gd-pop-text { margin: 6px 0 0; line-height: 1.5; }
.gd-pop del { background: rgba(232,80,54,.16); color: #9f1d0b; text-decoration: line-through; text-decoration-color: rgba(159,29,11,.5); }
.gd-pop ins { background: rgba(22,163,74,.16); color: #14532d; text-decoration: none; }
.gd-pop-moved { margin: 6px 0 0; font-size: 12px; }
.gd-wdiff mark.gd-rep { position: relative; background: rgba(250,204,21,.45); color: inherit; border-radius: 2px; padding: 0 1px; cursor: help; }
.gd-wdiff del.gd-rep-old { background: rgba(250,204,21,.3); color: #713f12; text-decoration-color: rgba(113,63,18,.6); }
.gd-wdiff mark.gd-rep[data-old]:hover::after { content: attr(data-old); position: absolute; left: 0; top: calc(100% + 6px); z-index: 5; min-width: 160px; max-width: 360px; width: max-content; white-space: normal; padding: 8px 10px; background: var(--bg-raised); color: #374151; text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(15,23,42,.14); font-size: 13px; font-weight: 400; line-height: 1.45; }
/* On-PDF compare toolbar + change sidebar (pdfdiff.js). */
.gd-pdiff-on { display: inline-flex; align-items: center; gap: 8px; }
.gd-pdiff-solo { grid-template-columns: minmax(0, 1fr); }
.gd-pdl > summary { position: sticky; top: 0; z-index: 1; background: var(--bg-card); padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text-bright); cursor: pointer; list-style: none; }
.gd-pdl > summary::-webkit-details-marker { display: none; }
.gd-pdl > summary::after { content: "▾"; float: right; color: var(--text-dim); }
.gd-pdl:not([open]) > summary { border-bottom: 0; }
.gd-pdl:not([open]) > summary::after { content: "▸"; }
.gd-pdl-page { padding: 10px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); cursor: default; }
.gd-pdl-item { margin: 0 8px 4px; padding: 6px 8px 6px 10px; border-left: 3px solid transparent; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; line-height: 1.45; color: #374151; }
.gd-pdl-item:hover { background: var(--bg); }
.gd-pdl-mod { border-left-color: #eab308; }
.gd-pdl-add { border-left-color: #16a34a; }
.gd-pdl-del { border-left-color: #dc2626; }
.gd-pdl-item.on { background: rgba(249, 115, 22, .08); box-shadow: inset 0 0 0 1px rgba(249, 115, 22, .35); }
.gd-pdl-moved { display: block; margin-top: 2px; font-size: 11px; }
/* Inside a replacement the old wording is plain readable text (sidebar: "old →
   new", new in yellow; hover card: only the wording not on screen). Red / green
   mean only-removed / only-added. */
.gd-pdl-mod del, .gd-pop-mod del { background: none; color: var(--text-dim); text-decoration: none; }
.gd-pdl-mod del::after { content: " →"; color: var(--text-dim); }
.gd-pdl-mod ins, .gd-pop-mod ins { background: rgba(250,204,21,.45); color: inherit; text-decoration: none; }

/* Result cards and the guidance header (G.cardFacts / G.classifierChips):
   one quiet facts line, then the classifiers as the only chips. Colour only
   for Draft and an open comment period; chips in the theme accent. */
.gd-facts-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; margin-top: 4px; font-size: 12.5px; color: var(--text-dim); }
.gd-facts-line a { color: var(--accent); }
.gd-dot { margin: 0 7px; opacity: .6; }
.gd-fact-final { color: var(--text); font-weight: 500; }
.gd-fact-draft { color: #b45309; font-weight: 600; }
.gd-fact-comment { color: var(--accent); font-weight: 600; }
.gd-fact-gone { color: var(--red); font-weight: 600; }
.gd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gd-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--blue-bg); border-radius: 999px; padding: 2px 9px 2px 8px; cursor: help; }
.gd-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .7; }
.gd-tag:hover, .gd-tag:focus-visible { background: var(--accent-dim, #e0e7ff); outline: none; }

/* Hover card (tip.js), after the device search's SaMD tooltip: selectable. */
.gd-tip { position: fixed; z-index: 10000; width: min(320px, calc(100vw - 32px)); padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(15,23,42,.12); background: #fff; box-shadow: 0 10px 30px rgba(15,23,42,.18); font-size: 13px; line-height: 1.45; color: #0f172a; user-select: text; cursor: auto; }
.gd-tip-head { font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.gd-tip-because { color: #334155; margin-bottom: 8px; }
.gd-tip-row { display: grid; grid-template-columns: 1fr 38px; align-items: center; gap: 8px; }
.gd-tip-bar { position: relative; height: 8px; border-radius: 4px; background: #f1f5f9; }
.gd-tip-fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); }
.gd-tip-line { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #94a3b8; border-radius: 1px; }
.gd-tip-pct { font-size: 12px; font-weight: 600; color: var(--accent); text-align: right; }
.gd-tip-meta { margin-top: 8px; font-size: 11.5px; color: #64748b; }
