/* ============================================================================
   AI Construct Lexis: Newsprint / Working Paper theme
   --------------------------------------------------------------------------
   Visual goal: read like an academic journal article.  The chrome is type
   and rules; color is reserved for the actual graph (its nodes and the
   small functional keys that map to those nodes).  Loaded after each page's own
   stylesheet so its rules win the cascade.
   ========================================================================== */

:root {
    /* ----- Palette -------------------------------------------------------- */
    --paper:          #faf7f2;   /* warm cream page background          */
    --paper-shade:    #f3efe6;   /* one shade darker for subtle blocks  */
    --surface:        #ffffff;   /* card / panel surface                */
    --ink:            #1c1917;   /* deep warm near-black                */
    --ink-2:          #292524;   /* secondary ink                       */
    --ink-muted:      #57534e;   /* secondary text                      */
    --ink-faint:      #78716c;   /* tertiary text                       */
    --rule:           #d6d3d1;   /* hairline divider, slightly stronger so
                                    horizontal rules read as journal rules */
    --rule-thin:      #e7e5e4;   /* very thin divider                  */

    /* Cardinal accent, used only as a spot color (links, active-tab
       underline, top stripe, version pill), never for card chrome. */
    --accent:         #9b2c2c;
    --accent-deep:    #7a1f1f;
    --accent-tint:    rgba(155, 44, 44, 0.06);
    --accent-edge:    rgba(155, 44, 44, 0.30);

    /* Category hues: used only in the graph (nodes, legend, swatches),
       never on cards, tabs, pills or backgrounds. */
    --cat-construct:    #166534;
    --cat-measurement:  #1d4ed8;
    --cat-behavior:     #ea580c;

    /* Aliases used by the page stylesheets. */
    --bg0:#faf7f2; --bg1:#f3efe6;
    --card:#ffffff; --card2:#faf7f2;
    --text:#1c1917; --muted:#57534e; --muted2:#78716c;
    --border: var(--rule-thin);
    --shadow: none; --shadow2: none;
    --radius: 6px; --radius-sm: 4px;
    --brand: var(--accent); --brand2: var(--accent-deep);
    --green: var(--cat-construct);
    --pink:  var(--cat-behavior);
    --blue:  var(--cat-measurement);
    --danger:#b91c1c;

    /* ----- Type stack ----------------------------------------------------- */
    --font-serif: 'Newsreader', 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono:  'JetBrains Mono', 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ============================================================================
   Global
   ========================================================================== */
html, body { height: 100%; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-feature-settings: "ss01", "cv11", "ss03";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Two thin rules at the top: the publication "masthead" pattern.
       A 1px ink rule above a 2px cardinal stripe.  Both fixed so they
       stay put on scroll. */
    background-image:
        linear-gradient(var(--ink), var(--ink)),
        linear-gradient(var(--accent), var(--accent));
    background-repeat: no-repeat, no-repeat;
    background-size: 100% 1px, 100% 2px;
    background-position: top left, 0 1px;
    background-attachment: fixed, fixed;
}

.container {
    max-width: 1480px;
    padding: 32px 28px 36px;
}

/* ============================================================================
   Header / branding
   ========================================================================== */
header {
    background: transparent;
    border: 0;
    border-bottom: 2px solid var(--ink);   /* journal masthead bottom rule */
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 22px 0 18px;
}

h1 {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 34px;
    letter-spacing: -0.012em;
    line-height: 1.12;
    color: var(--ink);
    margin-bottom: 12px;
}
h1 > * { vertical-align: middle; }

/* ============================================================================
   Team / byline block
   ========================================================================== */
.team-block {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--rule);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--ink-2);
}
.team-block .team-label {
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-muted);
    padding-top: 2px;
}
.team-block .team-roster { flex: 1 1 auto; min-width: 0; }
.team-block .author { display: inline; }
.team-block .author + .author::before {
    content: " · ";
    margin: 0 6px;
    color: var(--ink-faint);
    font-weight: 400;
}
.team-block .author-name { color: var(--ink); font-weight: 500; white-space: nowrap; }
.team-block .author-affil {
    margin-left: 4px;
    font-style: italic;
    color: var(--ink-muted);
    font-size: 12px;
}
.team-block .author-affil::before { content: "("; font-style: normal; color: var(--ink-faint); }
.team-block .author-affil::after  { content: ")"; font-style: normal; color: var(--ink-faint); }
.team-block--follow { margin-top: 8px; padding-top: 0; border-top: 0; }
.team-block .author-note { font-size: 9px; margin-left: 1px; color: var(--ink-muted); }
.team-note { margin: 6px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-muted); }
.team-note sup { font-size: 8px; margin-right: 2px; }
.team-citation { font-size: 12.5px; color: var(--ink-2); }
.team-citation .citation-title { color: var(--ink); font-weight: 500; }

/* ============================================================================
   Disclaimers & contact
   --------------------------------------------------------------------------
   Rules above and below, the way a paper sets off a sidebar or footnote block.
   ========================================================================== */
.disclaimer-banner {
    border-radius: 0;
    border: 0;
    border-top:    2px solid var(--ink);
    border-bottom: 1px solid var(--rule);
    background: transparent;
    color: var(--ink);
    box-shadow: none;
}
.disclaimer-banner h2 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--ink);
}
.disclaimer-banner strong { color: var(--ink); }
/* Scope text reads at the same size and face as the Welcome text above it. */
.disclaimer-banner p,
.disclaimer-banner li {
    font-family: var(--font-serif);
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-2);
}

.contact-box {
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--rule);
    background: transparent;
    box-shadow: none;
    padding-top: 14px;
}
.contact-box-title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-muted);
}
.contact-link, .substack-link {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent-edge);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.12s ease, color 0.12s ease;
}
.contact-link:hover, .substack-link:hover {
    color: var(--accent-deep);
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
}

/* ============================================================================
   Primary CTA: the Interactive Network link in the header
   ========================================================================== */
.home-graph-button,
.graph-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 0;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.005em;
    text-decoration: none;
    box-shadow: none;
    transition: background 0.12s ease;
}
.home-graph-button:hover,
.graph-btn:hover { background: var(--ink-2); }
.graph-btn:focus { outline: none; }

/* ============================================================================
   Tabs: newspaper section navigation
   --------------------------------------------------------------------------
   No category color, no fills, no rounded chrome.  Inactive = ink-muted
   text.  Active = full ink with a thick cardinal underline.  That's it.
   ========================================================================== */
.filter-buttons {
    gap: 0;
    flex-wrap: wrap;
    align-items: baseline;
}

.filter-btn {
    border: 0;
    background: transparent !important;
    color: var(--ink-muted);
    box-shadow: none;
    border-radius: 0;
    padding: 6px 12px;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 13.5px;
    letter-spacing: 0.005em;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.filter-btn:hover {
    background: transparent !important;
    color: var(--ink);
    border-color: transparent;
    transform: none;
}

/* Strip ALL category color from inactive tabs. */
.filter-btn[data-type="constructs"],
.filter-btn[data-type="construct"],
.filter-btn[data-type="measurements"],
.filter-btn[data-type="measurement"],
.filter-btn[data-type="behaviors"],
.filter-btn[data-type="behavior"] {
    background: transparent !important;
    color: var(--ink-muted) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
.filter-btn[data-type="constructs"]:hover,
.filter-btn[data-type="construct"]:hover,
.filter-btn[data-type="measurements"]:hover,
.filter-btn[data-type="measurement"]:hover,
.filter-btn[data-type="behaviors"]:hover,
.filter-btn[data-type="behavior"]:hover {
    background: transparent !important;
    color: var(--ink) !important;
}

/* Active tab: thick cardinal underline, no fill. */
.filter-btn.active,
.filter-btn.active[data-type="constructs"],
.filter-btn.active[data-type="construct"],
.filter-btn.active[data-type="measurements"],
.filter-btn.active[data-type="measurement"],
.filter-btn.active[data-type="behaviors"],
.filter-btn.active[data-type="behavior"] {
    color: var(--ink) !important;
    background: transparent !important;
    box-shadow: inset 0 -3px 0 var(--accent) !important;
    font-weight: 600;
    border-radius: 0 !important;
}
.filter-btn.active:hover,
.filter-btn.active[data-type="constructs"]:hover,
.filter-btn.active[data-type="construct"]:hover,
.filter-btn.active[data-type="measurements"]:hover,
.filter-btn.active[data-type="measurement"]:hover,
.filter-btn.active[data-type="behaviors"]:hover,
.filter-btn.active[data-type="behavior"]:hover {
    background: transparent !important;
    color: var(--ink) !important;
}

/* ============================================================================
   Form controls
   ========================================================================== */
.filter-controls {
    border-top: 1px solid var(--rule);
    flex-wrap: wrap;
}
.filter-control input,
input[type="number"].filter-input,
input[type="text"]#searchInput {
    border: 0;
    border-bottom: 1.5px solid var(--rule);
    border-radius: 0;
    padding: 8px 4px;
    background: transparent;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14.5px;
    transition: border-color 0.12s ease;
}
.filter-control input:focus,
input[type="text"]#searchInput:focus {
    border-bottom-color: var(--accent);
    box-shadow: none;
    outline: none;
}

/* ============================================================================
   Main panels
   ========================================================================== */
.main-content { height: calc(100vh - 270px); }

.empty-state.home-intro,
.empty-state.home-intro p,
.empty-state.home-intro h3 { color: var(--ink); }
.empty-state.home-intro h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: -0.005em;
}
.empty-state.home-intro p {
    font-family: var(--font-serif);
    font-size: 15.5px;
    line-height: 1.55;
    color: var(--ink-2);
}

/* Home intro cards: top + bottom rules instead of left-color border. */
.home-intro-section {
    box-shadow: none;
    border: 0;
    border-top:    1px solid var(--ink);
    border-bottom: 1px solid var(--rule);
    background: transparent;
    border-radius: 0;
    padding: 18px 0;
    margin-bottom: 0;
}
.home-intro-section + .home-intro-section { border-top: 0; }

/* Three Home cards side by side; each column keeps its own top rule. */
.home-intro-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 28px;
    margin-bottom: 20px;
}
.home-intro-grid .home-intro-section + .home-intro-section { border-top: 1px solid var(--ink); }
.empty-state.home-intro .home-intro-grid p { font-size: 14.5px; }
/* Card titles double as links to each tab, with the count in front. */
.home-intro-link {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}
.home-intro-link::after { content: " \2192"; color: var(--ink-faint); font-weight: 400; }
.home-intro-link:hover { color: var(--accent); }

/* "What can you do" block, between the Welcome paragraph and the three cards. */
.empty-state.home-intro h3.home-intro-uses-title {
    margin-top: 22px !important;
}

/* Page footer: release, repository, licences, contact. */
.site-footer {
    margin: 10px 0 28px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.6;
    color: var(--ink-muted);
}
.site-footer p { margin: 0 0 4px; }
.site-footer a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.site-footer a:hover { color: var(--accent-deep); }
.home-intro-link:focus-visible { outline: 2px solid var(--accent-edge); outline-offset: 2px; }
.home-intro-count { font-variant-numeric: tabular-nums; }
/* Citation links in the Welcome text read as ordinary blue links. */
.home-intro .contact-link { color: #2563eb; text-decoration-color: rgba(37, 99, 235, 0.35); }
.home-intro .contact-link:hover { color: #1d4ed8; text-decoration-color: #1d4ed8; }
.home-intro-section-construct .home-intro-count { color: var(--cat-construct); }
.home-intro-section-behavior .home-intro-count { color: var(--cat-behavior); }
.home-intro-section-measurement .home-intro-count { color: var(--cat-measurement); }

/* Wide graph button with a small network motif on each side. */
.home-graph-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 4px 0 8px;
}
.home-graph-cta .home-graph-btn-wide {
    flex: 0 1 360px;
    justify-content: center;
    text-align: center;
    padding: 12px 24px;
    font-size: 14px;
}
/* Styled as a header tab (.nav-tab); the accent underline on hover is the active-tab mark. */
.home-graph-cta .home-graph-btn-wide:hover { box-shadow: inset 0 -3px 0 var(--accent); }
.home-net-motif { width: 150px; height: 60px; flex: 0 0 auto; color: var(--ink-faint); }
.home-net-motif--flip { transform: scaleX(-1); }
.home-net-motif .c circle { fill: var(--cat-construct); }
.home-net-motif .b circle { fill: var(--cat-behavior); }
.home-net-motif .m circle { fill: var(--cat-measurement); }
@media (max-width: 760px) {
    .home-intro-grid { grid-template-columns: 1fr; }
    .home-net-motif { display: none; }
    .home-graph-cta .home-graph-btn-wide { flex-basis: 100%; }
    .home-intro-grid .home-intro-section + .home-intro-section { border-top: 0; }
}

/* Home cards carry no per-category tints or borders. */
.home-intro-section-construct,
.home-intro-section-measurement,
.home-intro-section-behavior {
    border-color: var(--ink) var(--rule) var(--rule) var(--rule) !important;
    background: transparent !important;
    border-left: 0 !important;
}

/* ============================================================================
   Results panel + list
   --------------------------------------------------------------------------
   Panel = a flat card with a single ink rule under the section header.
   ========================================================================== */
.results-panel {
    border-radius: 0;
    border: 0;
    border-top: 2px solid var(--ink);
    box-shadow: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.results-header {
    background: transparent !important;
    color: var(--ink) !important;
    border-bottom: 1px solid var(--rule);
    box-shadow: none;
    padding: 14px 16px;
}
.results-header h2,
.results-header h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.005em;
}

.results-list { padding: 14px; }

/* Tile grid: only kicks in when the list actually contains result tiles
   (i.e., on Constructs / Measurement / Behaviors / a search result page).
   The renderResults() JS wraps the items in an unnamed wrapper <div>, so the
   grid has to be applied to that wrapper (one level deeper), not the
   .results-list itself. */
.results-list > div:has(.result-item) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    align-items: stretch;
}
/* Pagination row should always span the full width regardless of how many
   tile columns the grid currently has. */
.results-list > div > .pagination-controls {
    grid-column: 1 / -1;
    margin-top: 10px;
}

.result-item {
    border-radius: 0;
    border: 1px solid var(--rule-thin);
    background: var(--surface);
    padding: 14px 14px 16px;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.result-item:hover {
    background: var(--paper-shade);
    border-color: var(--ink-faint);
}
/* Selected: top rule + paper tint, no left color stripe. */
.result-item.selected {
    background: var(--paper-shade);
    border-color: var(--ink-faint);
    box-shadow: inset 0 3px 0 var(--accent);
}
.result-item.selected .result-name { font-weight: 600; }

/* Re-order tile content: small mono category label at the top, then the
   (serif) name, then the definition.  Matches a journal entry header. */
.result-item .result-type   { order: 1; margin-bottom: 2px; }
.result-item .result-name   { order: 2; }
.result-item .result-definition { order: 3; margin-top: auto; }

.result-name {
    display: flex;
    align-items: baseline;
    gap: 8px;
    line-height: 1.25;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.005em;
    color: var(--ink);
}
.result-definition {
    color: var(--ink-muted);
    font-family: var(--font-sans);
    font-size: 12.5px;
    line-height: 1.45;
}

/* Category labels: bracketed italic mono, no color, no fill.
   Wraps the existing JS-emitted text in [ ] via pseudo-elements. */
.result-type {
    border-radius: 0;
    border: 0;
    background: transparent !important;
    padding: 0 !important;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    font-style: normal;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint) !important;
}
.result-type::before { content: "["; }
.result-type::after  { content: "]"; }
.result-type.construct,
.result-type.measurement,
.result-type.behavior {
    color: var(--ink-faint) !important;
    background: transparent !important;
    border-color: transparent !important;
}

/* ============================================================================
   Relationship cards (shown after selecting a node on the home view)
   --------------------------------------------------------------------------
   No colored left borders: journal-row entries separated by a single
   hairline.
   ========================================================================== */
.relationship-item {
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--rule-thin);
    background: transparent;
    box-shadow: none;
    transition: background 0.12s ease;
}
.relationship-item:hover { background: var(--paper-shade); transform: none; }
.relationship-item.construct,
.relationship-item.measurement,
.relationship-item.behavior {
    border-left: 0;
}

/* "Definitions" / dropdown labels in editorial small caps. */
.definitions-dropdown label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

/* ============================================================================
   Tooltips
   ========================================================================== */
.expert-flag-tooltip {
    border: 1px solid var(--ink-2);
    background: var(--ink) !important;
    color: var(--paper) !important;
    box-shadow: 0 6px 20px rgba(28, 25, 23, 0.20);
    border-radius: 0;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--ink-muted);
    font-family: var(--font-serif);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: help;
    position: relative;
    user-select: none;
}
.info-icon .info-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    width: min(360px, 70vw);
    max-width: min(360px, 70vw);
    padding: 10px 12px;
    border-radius: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    border: 1px solid var(--ink-2);
    box-shadow: 0 8px 22px rgba(28, 25, 23, 0.22);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.info-icon .info-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid var(--ink);
}
.info-icon:hover .info-tooltip,
.info-icon:focus-within .info-tooltip { opacity: 1; visibility: visible; }

/* ============================================================================
   Footer
   ========================================================================== */
.site-footer {
    margin-top: 28px;
    border-top: 2px solid var(--ink);
    padding-top: 18px;
}

/* ============================================================================
   Accessibility
   ========================================================================== */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 0;
}

/* ============================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
    .container { padding: 22px 18px 28px; }
    header { padding: 18px; }
    .main-content { height: calc(100vh - 320px); }
    h1 { font-size: 28px; }
}

@media (max-width: 800px) {
    header > div:first-child {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    /* Tabs wrap onto a second line rather than scrolling, so the nav stays part of
       the page and the Analysis Support dropdown is not clipped. */
    .filter-buttons {
        display: flex !important;
        flex-wrap: wrap;
        gap: 0 !important;
        overflow: visible;
        padding-bottom: 6px;
    }
    .filter-btn, .graph-btn, .nav-tab {
        min-width: auto;
        padding: 8px 12px;
        font-size: 14px;
        white-space: nowrap;
    }
    .search-section { flex-direction: column; gap: 8px; }
    .filter-controls { flex-direction: column; gap: 8px; align-items: stretch; }
    .site-footer .contact-box { text-align: center; padding: 12px 10px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ============================================================================
   Header links styled as tabs (Interactive Network, Analysis Support) and the
   Analysis Support dropdown.  Shared by index.html, network_graph.html,
   empirical_evidence.html and the tools pages.
   ========================================================================== */
.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    color: var(--ink-muted);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 13.5px;
    letter-spacing: 0.005em;
    text-decoration: none;
    background: transparent;
    border: 0;
    transition: color 0.12s ease;
}
.nav-tab:hover { color: var(--ink); }
.nav-tab.active { color: var(--ink); font-weight: 600; box-shadow: inset 0 -3px 0 var(--accent); }
.nav-tab .caret {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-left: 1px;
    color: var(--accent);
    transition: transform 0.15s ease;
}
.nav-dropdown:hover .caret,
.nav-dropdown:focus-within .caret { transform: rotate(180deg); }

/* Lift the header above the page body so the dropdown opens over the content below it
   (results panels, controls, and the graph all create their own stacking layers). */
header:has(.nav-dropdown) { position: relative; z-index: 100; overflow: visible !important; }
.nav-dropdown { position: relative; display: inline-block; }
.nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    min-width: 300px;
    padding: 6px 0;
    background: var(--surface);
    border: 1px solid var(--ink);
}
.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu { display: block; }
.nav-menu a {
    display: block;
    padding: 8px 14px;
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 600;
}
.nav-menu a span {
    display: block;
    margin-top: 2px;
    font-weight: 400;
    font-size: 12px;
    color: var(--ink-muted);
}
.nav-menu a:hover, .nav-menu a:focus-visible { background: var(--paper-shade); }
.nav-menu a.current { box-shadow: inset 3px 0 0 var(--accent); }
.nav-menu .nav-menu-all { border-top: 1px solid var(--rule-thin); margin-top: 4px; font-weight: 500; color: var(--accent); }
@media (max-width: 640px) {
    .nav-menu { left: auto; right: 0; min-width: min(300px, calc(100vw - 32px)); }
}

/* ============================================================================
   Entity page panels (State of the Field, Example References): neutral rules
   instead of per-type tints, matching the Home cards.
   ========================================================================== */
.entity-panel {
    margin-top: 6px;
    padding: 12px 0;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--rule);
    background: transparent;
}
.entity-panel-text {
    font-size: 13px;
    line-height: 1.55;
    color: var(--ink-2);
    margin-bottom: 8px;
}
.entity-panel-text.is-empty { color: var(--ink-faint); }
.ref-list {
    margin-top: 6px;
    max-height: 220px;
    overflow-y: auto;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--rule);
    background: transparent;
}
.ref-item { padding: 9px 0; border-bottom: 1px solid var(--rule-thin); }
.ref-item:last-child { border-bottom: 0; }
.ref-item-text { font-size: 13px; line-height: 1.5; color: var(--ink-2); margin-bottom: 6px; }
.paper-chip {
    display: inline-block;
    margin: 0 6px 4px 0;
    padding: 2px 7px;
    font-size: 11px;
    color: var(--ink-2);
    background: var(--paper-shade);
    border: 1px solid var(--rule);
    border-radius: 3px;
    text-decoration: none;
    cursor: pointer;
}
.paper-chip:hover { color: var(--ink); border-color: var(--ink-faint); }
.paper-chip-count { font-size: 10px; color: var(--ink-faint); margin-left: 2px; }

/* Site header used by site_header.js (tools pages, network page). */
.site-header-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.site-header-row h1 { margin-bottom: 0; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.site-header-row h1 a { color: inherit; text-decoration: none; }
.version-pill { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); padding: 3px 8px; border: 1px solid var(--accent-edge); border-radius: 3px; }
.site-header .filter-buttons { display: flex; margin-bottom: 0; }
.site-header .disclaimer-line { margin-top: 8px; font-size: 13px; color: var(--ink-faint); }


/* ---------------------------------------------------------------------------
   State of the Field as labeled sections, and the definition consensus rating
   (constructs). Ink tones only, in keeping with the theme: more consensus is
   darker, and every level also carries its word, never color alone.
   --------------------------------------------------------------------------- */
.sof-section { margin: 0 0 10px; }
.sof-section:last-child { margin-bottom: 0; }
.sof-label { font-weight: 600; color: var(--ink); }

.cm-meter { display: inline-flex; gap: 2px; align-items: center; vertical-align: middle; }
.cm-dot { width: 8px; height: 8px; border: 1px solid var(--ink-muted); border-radius: 1px; background: transparent; }
.cm-dot.on { background: var(--ink-muted); }
.cm-none .cm-dot { border-style: dashed; border-color: var(--ink-faint); }

.cm-inline { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--ink-muted); font-size: 12px; }
.cm-inline.cm-too-little-evidence { color: var(--ink-faint); }

.cm-panel { border: 1px solid var(--rule-thin); background: var(--paper-shade); border-radius: var(--radius-sm); padding: 10px 12px; margin: 6px 0 10px; }
.cm-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.cm-reason { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.cm-explain { margin-top: 6px; font-size: 12.5px; color: var(--ink-muted); }
.cm-explain summary { cursor: pointer; color: var(--accent); }
.cm-explain summary:focus-visible { outline: 2px solid var(--accent-edge); outline-offset: 2px; }
.cm-explain ul { margin: 6px 0 6px 18px; padding: 0; }
.cm-explain p { margin: 6px 0; }
.cm-note { color: var(--ink-faint); }

.cm-summary { grid-column: 1 / -1; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--rule-thin); }
.cm-summary-title { font-size: 12.5px; color: var(--ink-muted); margin-bottom: 6px; }
.cm-bar { display: flex; height: 18px; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.cm-seg { display: flex; align-items: center; justify-content: center; min-width: 3px; font-size: 11px; color: var(--paper); }
.cm-seg.cm-consensus { background: var(--ink-2); }
.cm-seg.cm-complementary { background: var(--ink-faint); }
.cm-seg.cm-conflicting { background: var(--rule); color: var(--ink-2); }
.cm-seg.cm-too-little-evidence { background: repeating-linear-gradient(135deg, var(--rule-thin) 0 4px, var(--paper) 4px 8px); color: var(--ink-muted); }
.cm-seg + .cm-seg { border-left: 1px solid var(--paper); }
.cm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--ink-muted); }
.cm-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.cm-count { color: var(--ink-faint); }

.cm-runs { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-muted); }
.cm-borderline { color: var(--ink-faint); font-style: italic; }
