:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f0f3f8;
    --text: #18202a;
    --muted: #5e6b7a;
    --line: #d9e1ea;
    --accent: #7d1f2a;
    --accent-dark: #5f1720;
    --link: #163b66;
    --shadow: 0 10px 30px rgba(16, 32, 48, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --max: 1260px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}


main {
    flex: 1 0 auto;
}

a {
    color: var(--link);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(100% - 32px, var(--max));
    margin: 0 auto;
}

.topbar {
    background: #101824;
    color: #eef3f8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: auto;
    padding: 14px 0 12px;
}

.brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.brand-logo {
    width: 42px;
    height: auto;
    flex: 0 0 42px;
    display: block;
    margin-top: 1px;
}

.brand > div {
    line-height: 1.15;
}

.brand small {
    display: block;
    margin-top: 3px;
    color: #b9c3cf;
    font-weight: 500;
    letter-spacing: 0;
    font-size: 0.78rem;
    line-height: 1.25;
    min-width: max-content;
}

.lang-switch {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

    .lang-switch a {
        padding: 8px 12px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.08);
        color: #eef3f8;
        font-size: 0.92rem;
    }

        .lang-switch a.active,
        .lang-switch a:hover {
            background: var(--accent);
            text-decoration: none;
        }

.mainnav {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
}

.mainnav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
}

    .nav-links a {
        color: var(--text);
        font-size: 0.98rem;
        font-weight: 600;
        line-height: 1.25;
    }

        .nav-links a:hover {
            color: var(--accent);
            text-decoration: none;
        }

.nav-cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: 0.18s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--accent-dark);
        text-decoration: none;
    }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
}

    .btn-secondary:hover {
        background: var(--surface-soft);
        text-decoration: none;
    }

.hero {
    padding: 42px 0 24px;
}

.hero-compact {
    padding-top: 30px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 24px;
    align-items: stretch;
}

.hero-card,
.panel,
.card,
.doc-card,
.contact-card,
.audience-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 32px;
}

.page-hero {
    max-width: 940px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #f7eaec;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0 0 14px;
    line-height: 1.2;
    color: #111821;
}

h1 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1.2;
    letter-spacing: normal;
    margin: 0 0 20px;
}

.page-title {
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.02;
}

.hero-subtitle {
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    line-height: 1.22;
    font-weight: 600;
    color: #1e2b38;
    margin: 0 0 22px;
}

h2 {
    font-size: clamp(1.4rem, 2.3vw, 2rem);
}

h3 {
    font-size: 1.05rem;
}

p {
    margin: 0 0 14px;
}

.lead {
    font-size: 1.08rem;
    color: #2a3440;
    max-width: 70ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
	padding: 5px 0;
}

.hero-aside {
    display: grid;
    gap: 16px;
}

.panel {
    padding: 22px;
}

.stat-list {
    display: grid;
    gap: 14px;
}

.stat {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

    .stat strong {
        display: block;
        font-size: 1.05rem;
        margin-bottom: 3px;
    }

    .stat span {
        color: var(--muted);
        font-size: 0.95rem;
    }

.section {
    padding: 22px 0 10px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

    .section-head p {
        max-width: 74ch;
        color: var(--muted);
        margin: 0;
    }

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.card,
.doc-card,
.audience-card,
.contact-card {
    padding: 22px;
}

    .card p,
    .doc-card p,
    .audience-card p,
    .contact-card p {
        color: var(--muted);
    }

.doc-card {
    position: relative;
    overflow: hidden;
}

    .doc-card::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 5px;
        background: var(--accent);
    }

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.doc-meta-page {
    margin-top: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    color: #32404d;
    font-size: 0.82rem;
    font-weight: 700;
}

.doc-link {
    display: inline-block;
    margin-top: 6px;
    font-weight: 700;
}

.audience-card {
    border-top: 4px solid var(--accent);
}

.quote-strip {
    margin: 28px 0 10px;
    padding: 24px 26px;
    border-radius: var(--radius);
    background: #101824;
    color: #eef3f8;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
}

    .quote-strip p {
        margin: 0;
        font-size: 1.08rem;
        color: #eef3f8;
    }

.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 18px;
}

.contact-card strong {
    display: block;
    margin-bottom: 8px;
}

.document-body {
    margin-top: 18px;
    color: #25303a;
    line-height: 1.75;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.preline {
    white-space: pre-line;
}

.empty-link-note {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    color: var(--muted);
    font-weight: 600;
}

.footer {
    margin-top: 0;
    padding: 20px 0 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.95rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 20px;
}

.muted {
    color: var(--muted);
}

.grid-tight {
    gap: 14px;
}

.section-subhead {
    margin: 28px 0 16px;
}

    .section-subhead h3 {
        margin-bottom: 8px;
    }

.card-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: #f7eaec;
    border: 1px solid #edd1d6;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
}

.contradiction-card {
    border-top: 4px solid var(--accent);
}

.resource-card {
    display: flex;
    flex-direction: column;
}

    .resource-card .doc-link {
        margin-top: auto;
    }

/* OriginDossier media */
.media-page {
    gap: 1.25rem;
}

.od-media-shell {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

.od-media-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0f141b;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    overflow: hidden;
}

#od-youtube-player,
#od-youtube-player iframe {
    width: 100%;
    height: 100%;
}

.od-captions-panel {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

.od-captions-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

    .od-captions-header h2 {
        margin: 0;
    }

.od-captions-lang {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.od-caption-track.active {
    outline: 2px solid rgba(255,255,255,0.25);
}

.od-subtitle-strip {
    background: #000;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.od-subtitle-live {
    color: #ffd200;
    font-size: 1.35rem;
    line-height: 1.6;
    min-height: 4.5rem;
    white-space: pre-wrap;
    font-weight: 500;
}

.od-player-controls {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.od-player-controls-left,
.od-player-controls-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.od-player-controls-center {
    display: flex;
    align-items: center;
}

.od-player-seek {
    width: 100%;
}

.od-player-time {
    font-family: monospace;
    font-size: 0.95rem;
    opacity: 0.85;
}

.od-media-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.od-captions-transcript-wrap {
    display: grid;
    gap: 0.75rem;
}

.od-captions-transcript-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.od-captions-transcript-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.od-captions-transcript {
    display: grid;
    gap: 0.5rem;
    max-height: 28rem;
    overflow: auto;
    padding: 0.5rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    overscroll-behavior: contain;
}

.od-cue {
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 0.75rem;
    text-align: left;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    color: inherit;
}

    .od-cue.active {
        background: rgba(255,255,255,0.10);
        border-color: rgba(255,255,255,0.18);
    }

.od-cue-time {
    opacity: 0.8;
    font-family: monospace;
}

.od-captions-note {
    font-size: 0.92rem;
    opacity: 0.82;
}

.od-media-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    padding: 1rem;
    background: #0b0f14;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

    .od-media-shell:fullscreen .od-media-frame {
        height: 100%;
        aspect-ratio: auto;
    }

    .od-media-shell:fullscreen .od-captions-panel {
        max-height: 44vh;
        overflow: auto;
        background: #0b0f14;
        border-color: rgba(255,255,255,0.10);
    }

    .od-media-shell:fullscreen .od-subtitle-strip {
        background: #000;
        border-color: rgba(255,210,0,0.18);
    }

    .od-media-shell:fullscreen .od-subtitle-live {
        color: #ffd200;
        font-size: 1.5rem;
        min-height: 5rem;
    }

    .od-media-shell:fullscreen .od-captions-transcript-wrap {
        gap: 0.5rem;
    }

    .od-media-shell:fullscreen .od-captions-transcript {
        max-height: 18vh;
        background: #111;
        color: #ffd200;
        border-color: rgba(255,210,0,0.14);
    }

    .od-media-shell:fullscreen .od-cue {
        background: rgba(255,210,0,0.04);
        border-color: rgba(255,210,0,0.08);
        color: #ffd200;
    }

    .od-media-shell:fullscreen .od-cue-time {
        color: #ffe377;
        opacity: 1;
    }

    .od-media-shell:fullscreen .od-cue.active {
        background: rgba(255,210,0,0.14);
        border-color: rgba(255,210,0,0.28);
    }

    .od-media-shell:fullscreen .od-captions-note,
    .od-media-shell:fullscreen .od-media-label,
    .od-media-shell:fullscreen .od-player-time,
    .od-media-shell:fullscreen .od-captions-header h2,
    .od-media-shell:fullscreen .od-captions-header .eyebrow,
    .od-media-shell:fullscreen .od-captions-transcript-title {
        color: #f3e29a;
    }


.is-hidden {
    display: none !important;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1080px) {
    .hero-grid,
    .grid-3,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .od-captions-header,
    .od-captions-transcript-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .od-player-controls {
        grid-template-columns: 1fr;
    }

    .od-cue {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .topbar-inner,
    .mainnav-inner,
    .section-head,
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .mainnav-inner {
        padding: 12px 0 14px;
        gap: 14px;
    }

    .nav-links {
        gap: 10px 18px;
    }

        .nav-links a {
            font-size: 1rem;
        }

    .hero {
        padding: 18px 0 16px;
    }

    .hero-grid > * {
        min-width: 0;
    }

    .hero-grid h1 {
        overflow-wrap: anywhere;
    }

    .hero-card,
    .panel,
    .card,
    .doc-card,
    .contact-card,
    .audience-card {
        padding: 18px;
    }

    .eyebrow {
        margin-bottom: 14px;
        font-size: 0.74rem;
        line-height: 1.35;
        padding: 8px 12px;
    }

    h1 {
        font-size: clamp(2rem, 8vw, 3rem);
        line-height: 1.04;
        margin-bottom: 10px;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.24;
        max-width: 18ch;
        margin-bottom: 18px;
    }

    .lead {
        font-size: 1rem;
        line-height: 1.62;
    }

    .nav-cta {
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 20px, var(--max));
    }
}

/* ===== ASSET VIEWER / PDF VIEWER ===== */

.asset-viewer-page .container {
    width: min(100% - 32px, 1400px);
    max-width: 1400px;
    min-width: 0;
}

.asset-viewer-card {
    max-width: none;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.asset-viewer-shell {
    margin-top: 18px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* PDF */

.asset-pdf-wrap {
    width: 100%;
    height: calc(100vh - 260px);
    min-height: 720px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #eef3f8;
    box-shadow: var(--shadow);
}

.asset-pdf-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #eef3f8;
}

/* Image */

.asset-image-wrap {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: auto;
    background: #eef3f8;
    box-shadow: var(--shadow);
}

.asset-image {
    max-width: 100%;
    height: auto;
}

/* Markdown controls */

.asset-markdown-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 12px 0 14px;
}

.asset-markdown-mode {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.asset-markdown-mode:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.asset-markdown-mode.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.asset-markdown-mode:focus-visible {
    outline: 2px solid rgba(153, 27, 27, 0.22);
    outline-offset: 2px;
}

/* Markdown shell */

.asset-markdown-viewer,
.asset-markdown-container,
.asset-markdown-panel,
.asset-markdown-body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.asset-markdown-viewer,
.asset-markdown-container {
    overflow: hidden;
}

.asset-markdown-panel,
.asset-markdown-body {
    overflow-x: hidden;
}

/* Raw markdown mode */

.asset-markdown-raw,
pre.asset-markdown-raw {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-x: auto;
}

.asset-markdown-raw pre,
.asset-markdown-raw code,
pre.asset-markdown-raw code {
    max-width: 100%;
    min-width: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Rendered HTML markdown mode */

.asset-markdown-html,
.asset-markdown-html * {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.asset-markdown-html table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.asset-markdown-html pre,
.asset-markdown-html code {
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Mobile */

@media (max-width: 820px) {
    .asset-viewer-page .container {
        width: min(100% - 20px, 100%);
        max-width: 100%;
    }

    .asset-pdf-wrap {
        height: calc(100vh - 220px);
        min-height: 520px;
    }
}
/* ===== LAW ARTICLE POPUP ===== */

.law-ref,
[data-law-article] {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(125, 31, 42, 0.28);
    border-radius: 999px;
    background: rgba(125, 31, 42, 0.07);
    color: var(--accent);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.law-ref:hover,
[data-law-article]:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

.law-ref-inline {
    min-height: 24px;
    padding: 0 8px;
    vertical-align: baseline;
}

.law-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 22px;
}

.law-popup.is-hidden {
    display: none;
}

.law-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 20, 0.58);
    backdrop-filter: blur(4px);
}

.law-popup-panel {
    position: relative;
    width: min(760px, 100%);
    max-height: min(78vh, 860px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.law-popup-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #101824;
    color: #eef3f8;
}

.law-popup-head h2 {
    margin: 4px 0 0;
    color: #fff;
    font-size: 1.35rem;
}

.law-popup-kicker {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c6d0dc;
}

.law-popup-close {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.law-popup-close:hover {
    background: var(--accent);
}

.law-popup-body {
    min-width: 0;
    overflow: auto;
    padding: 20px;
    color: #243240;
    line-height: 1.7;
}

.law-popup-body h1,
.law-popup-body h2,
.law-popup-body h3 {
    margin-top: 0;
}

.law-popup-body p {
    margin: 0 0 12px;
}

.law-popup-body pre,
.law-popup-body code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.law-popup-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .law-popup {
        padding: 12px;
    }

    .law-popup-panel {
        max-height: 86vh;
    }

    .law-popup-head {
        padding: 16px;
    }

    .law-popup-body {
        padding: 16px;
    }
}

/* ===== ORIGIN DOSSIER ANNOTATED MARKDOWN LAYER ===== */
.asset-markdown-viewer {
    position: relative;
}

.asset-markdown-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.asset-markdown-mode {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
    cursor: pointer;
}

.asset-markdown-mode.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.annotation-hit {
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    cursor: pointer;
    padding: 0 2px;
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: background-color 0.14s ease, outline-color 0.14s ease;
}

.annotation-hit:hover,
.annotation-hit:focus {
    outline: 1px solid rgba(15, 23, 42, 0.28);
    background: rgba(15, 23, 42, 0.07);
}

.annotation-paternal-line {
    background: rgba(37, 99, 235, 0.10);
    text-decoration-color: #2563eb;
}

.annotation-maternal-line {
    background: rgba(124, 58, 237, 0.10);
    text-decoration-color: #7c3aed;
}

.annotation-child-reference,
.annotation-child-original-identity {
    background: rgba(127, 29, 29, 0.10);
    text-decoration-color: #7f1d1d;
}

.annotation-identity-person {
    background: rgba(51, 65, 85, 0.09);
    text-decoration-color: #475569;
}

.annotation-assigned-identity-1,
.annotation-assigned-identity-2,
.annotation-civil-register-rewrite {
    background: rgba(194, 65, 12, 0.10);
    text-decoration-color: #c2410c;
}

.annotation-false-parental-position,
.annotation-contradiction {
    background: rgba(185, 28, 28, 0.11);
    box-shadow: inset 0 -1px 0 #b91c1c;
    text-decoration-color: #b91c1c;
}

.annotation-adoption-node {
    background: rgba(217, 119, 6, 0.12);
    text-decoration-color: #d97706;
}

.annotation-probate-node,
.annotation-inheritance-node {
    background: rgba(21, 128, 61, 0.10);
    text-decoration-color: #15803d;
}

.annotation-legal-article {
    background: rgba(136, 19, 55, 0.10);
    text-decoration-color: #881337;
}

.annotation-case-number {
    background: rgba(146, 64, 14, 0.11);
    text-decoration-color: #92400e;
}

.annotation-secret-hearing {
    background: rgba(15, 23, 42, 0.12);
    text-decoration-color: #111827;
}

.annotation-language-identity {
    background: rgba(15, 118, 110, 0.10);
    text-decoration-color: #0f766e;
}

.annotation-popup {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 80;
}

.annotation-popup-card {
    position: fixed;
    /*top: min(var(--annotation-anchor-top, 120px), calc(100vh - 300px));*/
    bottom: 10px;
    right: 24px;
    width: min(420px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    pointer-events: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
    padding: 18px 18px 16px;
}

.annotation-popup-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.annotation-popup-type {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.annotation-popup h2 {
    margin: 0 28px 8px 0;
    font-size: 1.12rem;
}

.annotation-popup p {
    margin: 0 0 12px;
    color: var(--text);
    line-height: 1.55;
}

.annotation-popup-meta {
    margin: 0;
    display: grid;
    gap: 8px;
}

.annotation-popup-meta div {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 10px;
}

.annotation-popup-meta dt {
    color: var(--muted);
    font-weight: 800;
}

.annotation-popup-meta dd {
    margin: 0;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
}


/* HARD FIX: hidden attribute must always win */
.asset-markdown-body[hidden],
.asset-markdown-raw[hidden],
[data-markdown-annotated][hidden],
[data-markdown-html][hidden],
[data-markdown-raw][hidden] {
    display: none !important;
}

/* Keep the existing brand readable on narrow screens. */
@media (max-width: 720px) {
    .brand, .brand > div, .brand small { min-width: 0; }
    .brand { max-width: 100%; }
}
