@layer base {
/* citations.css — citation chips + region-highlight boxes in the slide-out
 * PDF viewer (owned by js/citations.js — the map-free citation system).
 * Loads after source-citations.css; only adds new rules, no overrides
 * of existing ones unless explicitly noted.
 */

/* Anchor chips — same orange family as [N] chips, but subtly different
 * so a verified anchor citation reads as a more specific reference. */
.gf-citation.gf-citation-anchor {
    background: rgba(250, 82, 15, 0.16);
    border: 1px solid rgba(250, 82, 15, 0.36);
    color: #ff7d3d;
    padding: 0 6px;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.gf-citation.gf-citation-anchor:hover {
    background: rgba(250, 82, 15, 0.28);
}

/* Unverified state: dimmed color, dashed border, "?" badge after the chip. */
.gf-citation.gf-citation-unverified {
    color: #b58970;
    background: rgba(250, 82, 15, 0.08);
    border-style: dashed;
}
.gf-citation.gf-citation-unverified::after {
    content: '?';
    margin-left: 4px;
    font-size: 0.85em;
    font-weight: 800;
    color: #d97f00;
    background: rgba(217, 127, 0, 0.18);
    border-radius: 999px;
    padding: 0 5px;
    line-height: 1.4;
    vertical-align: baseline;
}

/* The text-layer + highlight glyph layer (PDF.js) — sits absolutely over
 * the canvas, transparent, contains positioned <span>s for each text run. */
.gf-source-page-wrap {
    position: relative;
}
.gf-source-text-layer {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    opacity: 0.999;          /* keep elements selectable */
    line-height: 1;
    pointer-events: auto;
}
.gf-source-text-layer > span {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

/* Quote highlight rendered on top of the (transparent) text spans.
 * `mark` keeps native semantics for accessibility. Override the legacy
 * yellow rule from source-citations.css with orange so the highlight
 * matches the orange citation-chip family. */
.gf-source-text-layer mark.gf-source-highlight,
mark.gf-source-highlight {
    background: rgba(250, 82, 15, 0.42);
    color: transparent;       /* text stays invisible — only the box is visible */
    padding: 0;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(214, 88, 25, 0.65);
}

}
.gf-citation.gf-citation-project {
    /* Override the adapter's generic underlined guidance links. The number
       stays compact; the file name and quotation remain in its tooltip. */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 1.8em;
    height: 1.6em;
    padding: 0 .45em !important;
    margin: 0 2px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(128, 128, 128, .13) !important;
    color: var(--muted, #747474) !important;
    font-size: .68em !important;
    font-weight: 600 !important;
    font-variant-numeric: tabular-nums;
    line-height: 1 !important;
    white-space: nowrap;
    vertical-align: .2em;
    user-select: none;
    -webkit-user-select: none;
}
.gf-citation.gf-citation-project::after {
    content: none !important;
    display: none !important;
}
.gf-citation.gf-citation-project:hover,
.gf-citation.gf-citation-project.active {
    background: rgba(128, 128, 128, .24) !important;
    color: var(--ink, currentColor) !important;
    border: 0 !important;
}
.gf-citation.gf-citation-project:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.gx-source-note {
    position: sticky;
    top: 0;
    z-index: 3;
    margin: 0 0 10px;
    padding: 8px 12px;
    background: var(--surface, #fff);
    color: var(--muted, #60646c);
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    font: 12px/1.5 var(--font, sans-serif);
}
mark.gx-reader-source-highlight {
    background: rgba(255, 172, 61, .4);
    color: inherit;
    padding: 0;
    border-radius: 2px;
}
.gx-source-excerpt {
    padding: 14px 16px;
    margin-bottom: 12px;
    color: var(--ink, #222);
    background: var(--surface, #fff);
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    font: 13px/1.65 var(--font, sans-serif);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.gx-source-excerpt h3 { margin: 0 0 6px; font: 600 13px/1.4 var(--font, sans-serif); }
.gx-source-excerpt p { margin: 0 0 8px; color: var(--muted, #60646c); font-size: 12px; }
