/* ==========================================================================
   Lektor.ca – design system on top of Bootstrap 5.3
   Concept: the manuscript and its margin. Serif (Literata) for language and
   reading, sans (Instrument Sans) for the interface. Red strikethrough and green
   insertions are the only accents – the visual language of tracked changes.
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin + latin-ext for č, š, ž) ---------- */
@font-face {
    font-family: "Literata";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/literata-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Literata";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/literata-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Literata";
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/literata-italic-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Literata";
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/literata-italic-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Instrument Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/instrument-sans-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Instrument Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens (theme 1 "Rokopis" – default) ----------
   Every theme in css/themes/*.css overrides these tokens on html[data-theme="…"];
   components below only use tokens, so markup and behaviour stay the same. */
:root {
    /* Surfaces and text */
    --paper: #F7F9F7;
    --sheet: #FFFFFF;
    --ink: #13261C;
    --ink-soft: #46594E;
    --ink-faint: #587363;
    --rule: #D6DFD8;
    --input-border: #C6D2C9;

    /* Brand */
    --primary: #114A29;
    --primary-rgb: 17, 74, 41;
    --primary-deep: #0C351D;
    --primary-deep-rgb: 12, 53, 29;
    --primary-active: #082A16;
    --primary-disabled: #6F8C79;
    --primary-tint: #E6F0E9;
    --on-primary: #FFFFFF;

    /* Tracked changes */
    --del: #B3261E;
    --del-tint: #FCECEA;
    --ins: #1C7A43;
    --ins-tint: #E2F2E8;

    /* Status */
    --warn: #D99A00;
    --warn-tint: #FFF4D6;
    --warn-ink: #7A5300;

    /* Components */
    --header-bg: rgba(255, 255, 255, .92);
    --margin-note: #F0F6F2;
    --note-border: #CFE0D4;
    --dropzone-border: #A9C0B0;
    --dropzone-bg: #FBFCFB;
    --window-bar: #EEF2EF;
    --band-bg: #0C351D;
    --band-ink: #E9F1EB;
    --band-soft: #C9DACE;
    --band-strong: #FFFFFF;
    --band-accent: #9FD3AE;
    --footer-bg: #0C351D;
    --footer-ink: #C9DACE;
    --footer-link: #E9F1EB;
    --footer-strong: #FFFFFF;
    --admin-bg: #F2F5F3;
    --admin-nav-bg: #0C351D;
    --admin-nav-soft: #9FB8A7;
    --admin-nav-strong: #FFFFFF;
    --admin-nav-hover: rgba(255, 255, 255, .08);
    --admin-nav-active: rgba(159, 211, 174, .18);
    --shadow-sheet: 0 1px 2px rgba(19, 38, 28, .06), 0 12px 32px -12px rgba(19, 38, 28, .18);
    --radius-card: .9rem;

    /* Type */
    --font-serif: "Literata", Georgia, "Times New Roman", serif;
    --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-doc: var(--font-serif);

    /* Bootstrap overrides */
    --bs-body-bg: var(--paper);
    --bs-body-color: var(--ink);
    --bs-body-font-family: var(--font-sans);
    --bs-body-font-size: 1.0625rem;
    --bs-body-line-height: 1.6;
    --bs-primary: var(--primary);
    --bs-primary-rgb: var(--primary-rgb);
    --bs-link-color: var(--primary);
    --bs-link-color-rgb: var(--primary-rgb);
    --bs-link-hover-color: var(--primary-deep);
    --bs-link-hover-color-rgb: var(--primary-deep-rgb);
    --bs-border-color: var(--rule);
    --bs-secondary-color: var(--ink-soft);
    --bs-emphasis-color: var(--ink);
    --bs-heading-color: var(--ink);
    --bs-border-radius: .5rem;
    --bs-border-radius-lg: .75rem;
    --bs-focus-ring-color: rgba(var(--primary-rgb), .35);
}

/* Logo mark follows the theme */
.brand-mark .bm-bg { fill: var(--primary); }
.brand-mark .bm-caret { stroke: var(--on-primary); }
.brand-mark .bm-dot { fill: var(--band-accent); }

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-feature-settings: "kern", "liga";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }

h1, h2, h3, h4, .serif {
    font-family: var(--font-serif);
    font-optical-sizing: auto;
    letter-spacing: -.01em;
}
h1, .h1 { font-size: clamp(2.05rem, 1.55rem + 2.2vw, 3.3rem); font-weight: 600; line-height: 1.1; }
h2, .h2 { font-size: clamp(1.55rem, 1.3rem + 1.1vw, 2.15rem); font-weight: 600; line-height: 1.2; }
h3, .h3 { font-size: 1.3rem; font-weight: 600; line-height: 1.3; }
h4, .h4 { font-size: 1.1rem; font-weight: 600; }
.lead { font-family: var(--font-serif); font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.55; color: var(--ink-soft); font-weight: 400; }
.text-soft { color: var(--ink-soft) !important; }
.small, small { font-size: .875rem; }

a { text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible, .form-check-input:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    box-shadow: none;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 2000;
    background: var(--primary-deep);
    color: var(--on-primary);
    padding: .6rem 1rem;
    border-radius: .4rem;
    text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--on-primary); }

.container { max-width: 1180px; }
.section { padding-block: clamp(3rem, 2rem + 4vw, 6rem); }
.section-tight { padding-block: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.prose { font-family: var(--font-serif); font-size: 1.08rem; line-height: 1.72; max-width: 70ch; }
.prose h2 { margin-top: 2.6rem; margin-bottom: .9rem; font-size: 1.45rem; }
.prose h3 { margin-top: 1.8rem; font-size: 1.15rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .35rem; }
.prose .article-number { font-family: var(--font-sans); font-size: .9rem; font-weight: 600; color: var(--ink-soft); display: block; margin-bottom: .1rem; letter-spacing: .01em; }

/* ---------- Buttons and forms ---------- */
.btn { font-weight: 600; border-radius: .5rem; padding: .62rem 1.15rem; }
.btn-lg { padding: .8rem 1.45rem; font-size: 1.05rem; }
.btn-sm { padding: .35rem .75rem; }
.btn-primary {
    --bs-btn-color: var(--on-primary);
    --bs-btn-hover-color: var(--on-primary);
    --bs-btn-active-color: var(--on-primary);
    --bs-btn-disabled-color: var(--on-primary);
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-deep);
    --bs-btn-hover-border-color: var(--primary-deep);
    --bs-btn-active-bg: var(--primary-active);
    --bs-btn-active-border-color: var(--primary-active);
    --bs-btn-disabled-bg: var(--primary-disabled);
    --bs-btn-disabled-border-color: var(--primary-disabled);
    --bs-btn-focus-shadow-rgb: var(--primary-rgb);
}
.btn-outline-primary {
    --bs-btn-color: var(--primary);
    --bs-btn-hover-color: var(--on-primary);
    --bs-btn-active-color: var(--on-primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-active-bg: var(--primary-deep);
    --bs-btn-active-border-color: var(--primary-deep);
    --bs-btn-focus-shadow-rgb: var(--primary-rgb);
}
.btn-light-outline {
    --bs-btn-color: var(--ink);
    --bs-btn-bg: var(--sheet);
    --bs-btn-border-color: var(--rule);
    --bs-btn-hover-bg: var(--primary-tint);
    --bs-btn-hover-border-color: var(--input-border);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-active-bg: var(--primary-tint);
}
.form-label { font-weight: 600; margin-bottom: .35rem; }
.form-text { color: var(--ink-soft); }
.form-control, .form-select { border-color: var(--input-border); padding: .62rem .8rem; background-color: var(--sheet); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(var(--primary-rgb), .15); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(var(--primary-rgb), .15); }
.progress { --bs-progress-bar-bg: var(--primary); --bs-progress-bg: var(--primary-tint); height: .7rem; border-radius: 99px; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Header ---------- */
.site-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--rule);
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: saturate(140%) blur(6px);
}
.site-header .navbar { padding-block: .7rem; }
.brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.45rem;
    letter-spacing: -.015em;
    color: var(--ink);
    text-decoration: none;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { width: 2rem; height: 2rem; flex: 0 0 auto; }
.brand-tld { color: var(--primary); }
.site-header .nav-link { color: var(--ink); font-weight: 500; padding-inline: .9rem !important; }
.site-header .nav-link:hover { color: var(--primary); }
.site-header .nav-link.active { color: var(--primary); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .45em; }
.navbar-toggler { border-color: var(--rule); }
.avatar { width: 1.9rem; height: 1.9rem; border-radius: 50%; object-fit: cover; background: var(--primary-tint); }
.avatar-initial { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--primary); font-size: .9rem; }

/* ---------- Flash messages ---------- */
.flash-area { padding-top: 1.25rem; }
.alert { border-radius: .6rem; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 1.8rem + 3.5vw, 5rem) clamp(3rem, 2rem + 3vw, 5rem); }
.hero h1 { max-width: 15ch; margin-bottom: 1.1rem; }
.hero .lead { max-width: 34rem; margin-bottom: 1.8rem; }

/* Upload */
.upload-card {
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sheet);
    padding: 1.1rem;
}
.dropzone {
    border: 2px dashed var(--dropzone-border);
    border-radius: .7rem;
    padding: 2rem 1.25rem;
    text-align: center;
    transition: background-color .15s ease, border-color .15s ease;
    cursor: pointer;
    background: var(--dropzone-bg);
}
.dropzone:hover { border-color: var(--primary); }
.dropzone.is-dragover { border-style: solid; border-color: var(--primary); background: var(--primary-tint); }
.dropzone-icon { font-size: 2.4rem; color: var(--primary); line-height: 1; }
.dropzone-title { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; margin: .7rem 0 .2rem; }
.dropzone-or { color: var(--ink-soft); font-size: .9rem; margin-bottom: .7rem; }
.upload-hint { color: var(--ink-soft); font-size: .85rem; margin-top: .9rem; margin-bottom: 0; }
.upload-file { display: flex; align-items: center; gap: .75rem; }
.upload-file .bi { font-size: 1.8rem; color: var(--primary); }
.upload-file-name { font-weight: 600; word-break: break-all; }
.facts { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: .9rem 0 1rem; padding: 0; list-style: none; }
.facts li { font-size: .95rem; color: var(--ink-soft); }
.facts strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.price-line {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
    padding: .7rem 0; margin-bottom: 1rem;
}
.price-line .price { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; }
.price-note { font-size: .85rem; color: var(--ink-soft); }

/* ---------- Manuscript demo (hero) ---------- */
.manuscript { margin: 0; }
.manuscript-sheet {
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-radius: .35rem;
    box-shadow: var(--shadow-sheet);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 15.5rem;
    overflow: hidden;
}
.manuscript-text {
    font-family: var(--font-doc);
    font-size: 1.12rem;
    line-height: 2.05;
    padding: 2.2rem 1.9rem 2.2rem 2.2rem;
    margin: 0;
    color: var(--ink);
}
.manuscript-text .doc-title {
    display: block;
    font-family: var(--font-sans);
    font-size: .78rem;
    color: var(--ink-soft);
    margin-bottom: .8rem;
    letter-spacing: .01em;
}
.manuscript-notes {
    list-style: none;
    margin: 0;
    padding: 1.6rem 1rem;
    background: var(--margin-note);
    border-left: 1px solid var(--rule);
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.manuscript-notes li {
    background: var(--sheet);
    border: 1px solid var(--note-border);
    border-left: 3px solid var(--primary);
    border-radius: .35rem;
    padding: .45rem .6rem;
    font-size: .8rem;
    line-height: 1.35;
}
.manuscript-notes .note-cat { font-weight: 600; display: block; margin-bottom: .1rem; }
.manuscript-notes .note-num { color: var(--primary); font-variant-numeric: tabular-nums; margin-right: .3rem; }
.manuscript figcaption, .manuscript-caption { font-size: .85rem; color: var(--ink-soft); margin-top: .8rem; }
.tc-ref { font-family: var(--font-sans); font-size: .58em; font-weight: 600; color: var(--ink-faint); vertical-align: super; line-height: 0; margin-left: .05em; }

/* Tracked-change marks (shared by the demo and the report) */
del.tc, .tc-del {
    color: var(--del);
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--del);
}
ins.tc, .tc-ins {
    color: var(--ins);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: .2em;
    text-decoration-color: var(--ins);
}
.tc-space { font-family: var(--font-sans); font-size: .85em; opacity: .85; }

/* The one orchestrated moment: corrections appear in sequence on load. */
@media (prefers-reduced-motion: no-preference) {
    .manuscript.is-animated del.tc { animation: tc-strike .55s ease-out both; }
    .manuscript.is-animated ins.tc { animation: tc-insert .45s ease-out both; }
    .manuscript.is-animated .tc-ref, .manuscript.is-animated .manuscript-notes li { animation: tc-note .45s ease-out both; }
    .manuscript.is-animated [data-step="1"] { animation-delay: .5s !important; }
    .manuscript.is-animated [data-step="2"] { animation-delay: 1.1s !important; }
    .manuscript.is-animated [data-step="3"] { animation-delay: 1.7s !important; }
    .manuscript.is-animated [data-step="4"] { animation-delay: 2.3s !important; }
    .manuscript.is-animated [data-step="5"] { animation-delay: 2.9s !important; }
}
@keyframes tc-strike {
    from { color: var(--ink); text-decoration-color: transparent; }
    to { color: var(--del); text-decoration-color: var(--del); }
}
@keyframes tc-insert {
    from { opacity: 0; transform: translateY(-.25em); }
    to { opacity: 1; transform: none; }
}
@keyframes tc-note {
    from { opacity: 0; transform: translateX(.4rem); }
    to { opacity: 1; transform: none; }
}
ins.tc { display: inline-block; }

/* ---------- Steps ("Kako uporabljati?") ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem 2.2rem; grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 3.6rem; }
.steps li::before {
    content: counter(step);
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 500;
    line-height: 1;
    color: var(--primary);
    font-variant-numeric: lining-nums;
}
.steps li::after {
    content: "";
    position: absolute;
    top: 1.55rem;
    left: 2.8rem;
    right: -1.4rem;
    border-top: 1px solid var(--rule);
}
.steps li:last-child::after { display: none; }
.steps h3 { font-size: 1.15rem; margin-bottom: .45rem; }
.steps p { color: var(--ink-soft); margin: 0; font-size: 1rem; }

/* ---------- Deliverables ---------- */
.window {
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-radius: .6rem;
    box-shadow: var(--shadow-sheet);
    overflow: hidden;
}
.window-body { min-height: 10.5rem; }
.window-bar {
    display: flex; align-items: center; gap: .5rem;
    padding: .55rem .9rem;
    background: var(--window-bar);
    border-bottom: 1px solid var(--rule);
    font-size: .82rem;
    color: var(--ink-soft);
}
.window-bar .bi { color: #2B579A; }
.window-body { padding: 1.3rem 1.4rem; }
.window-body p { font-family: var(--font-doc); line-height: 1.9; margin: 0; }
.balloon {
    margin-top: 1rem;
    border-left: 3px solid var(--del);
    background: var(--del-tint);
    padding: .5rem .75rem;
    font-size: .85rem;
    border-radius: .3rem;
}
.mini-bars { list-style: none; padding: 0; margin: .5rem 0 0; }
.mini-bars li { display: grid; grid-template-columns: 7.5rem 1fr 2rem; align-items: center; gap: .6rem; font-size: .88rem; margin-bottom: .45rem; }
.mini-bars .bar { height: .55rem; background: var(--primary-tint); border-radius: 99px; overflow: hidden; }
.mini-bars .bar span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.mini-bars .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.deliverable h3 { margin-top: 1.4rem; }

/* ---------- Checks list ---------- */
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; margin: 0; }
.checks > div { padding: 1.05rem 0; border-top: 1px solid var(--rule); }
.checks dt { font-weight: 600; margin-bottom: .2rem; }
.checks dd { margin: 0; color: var(--ink-soft); }
.checks .example { font-family: var(--font-doc); color: var(--ink); display: block; margin-top: .2rem; }

/* ---------- Privacy band ---------- */
.band-dark { background: var(--band-bg); color: var(--band-ink); }
.band-dark h2, .band-dark h3 { color: var(--band-strong); }
.band-dark a { color: var(--band-strong); }
.band-dark .lead { color: var(--band-soft); }
.privacy-points { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 2.5rem; }
.privacy-points li { display: grid; grid-template-columns: 1.8rem 1fr; gap: .7rem; }
.privacy-points .bi { font-size: 1.3rem; color: var(--band-accent); }
.privacy-points strong { display: block; color: var(--band-strong); margin-bottom: .15rem; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding-block: clamp(2.2rem, 1.5rem + 2.5vw, 4rem) 1.2rem; }
.page-head h1 { margin-bottom: .7rem; }
.page-head .lead { max-width: 44rem; }
.legal-meta { font-size: .9rem; color: var(--ink-soft); }
.toc-side { position: sticky; top: 6rem; font-size: .92rem; }
.toc-side ol, .toc-side ul { list-style: none; padding: 0; margin: 0; }
.toc-side a { display: block; padding: .3rem 0 .3rem .8rem; border-left: 2px solid var(--rule); color: var(--ink-soft); text-decoration: none; }
.toc-side a:hover { color: var(--primary); border-left-color: var(--primary); }
.toc-title { font-weight: 600; font-size: .95rem; margin-bottom: .5rem; }

/* FAQ */
.faq .accordion-button { font-weight: 600; font-family: var(--font-sans); }
.faq .accordion-button:not(.collapsed) { background: var(--primary-tint); color: var(--ink); box-shadow: none; }
.faq .accordion-button:focus { box-shadow: none; }
.faq .accordion-item { border-color: var(--rule); }
.faq .accordion-body { font-family: var(--font-serif); line-height: 1.7; }

/* Contact */
.contact-card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-card); padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); box-shadow: var(--shadow-sheet); }
.captcha-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.captcha-img { border: 1px solid var(--rule); border-radius: .4rem; background: var(--paper); width: 190px; height: 64px; }

/* ---------- Document page and report ---------- */
.doc-head { padding-block: 2rem 1.2rem; }
.doc-title { word-break: break-word; }
.status-pill {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .85rem; font-weight: 600;
    padding: .25rem .7rem; border-radius: 99px;
    background: var(--primary-tint); color: var(--primary);
}
.status-pill.is-failed { background: var(--del-tint); color: var(--del); }
.status-pill.is-waiting { background: var(--warn-tint); color: var(--warn-ink); }
.doc-facts { display: flex; flex-wrap: wrap; gap: .3rem 1.6rem; margin: .8rem 0 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: .95rem; }
.doc-facts strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-card); padding: clamp(1.1rem, 1rem + 1vw, 1.75rem); }
.panel + .panel { margin-top: 1.25rem; }
.progress-steps { list-style: none; padding: 0; margin: 1.2rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; font-size: .92rem; color: var(--ink-soft); }
.progress-steps li { display: inline-flex; align-items: center; gap: .4rem; }
.progress-steps li.is-done { color: var(--primary); }
.progress-steps li.is-current { color: var(--ink); font-weight: 600; }
.link-box { display: flex; gap: .5rem; }
.link-box input { font-size: .85rem; }

.downloads { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.report { margin-top: 1rem; }
.report-section { padding-top: 2.2rem; scroll-margin-top: 5.5rem; }
.report-section > h2 { font-size: 1.5rem; margin-bottom: .9rem; }
.report-section .prose { max-width: none; }
.key-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1rem; margin: 1rem 0 0; }
.key-figures div { border-top: 3px solid var(--primary); padding-top: .55rem; }
.key-figures dt { font-size: .85rem; color: var(--ink-soft); font-weight: 500; }
.key-figures dd { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 600; margin: 0; font-variant-numeric: lining-nums tabular-nums; }
.category-bars { list-style: none; padding: 0; margin: 0; max-width: 46rem; }
.category-bars li { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr 3rem; align-items: center; gap: .8rem; padding: .35rem 0; }
.category-bars .bar { height: .7rem; background: var(--primary-tint); border-radius: 99px; overflow: hidden; }
.category-bars .bar span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.category-bars .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.pattern { border-left: 3px solid var(--primary); padding: .2rem 0 .2rem 1.1rem; margin-bottom: 1.6rem; }
.pattern h3 { font-size: 1.12rem; margin-bottom: .35rem; }
.pattern p { margin-bottom: .45rem; font-family: var(--font-serif); }
.pattern ul { margin: 0; padding-left: 1.1rem; font-family: var(--font-serif); color: var(--ink-soft); }
.note-table td:first-child { font-family: var(--font-serif); }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .65rem .6rem; border-bottom-color: var(--rule); }
.table thead th { font-size: .85rem; color: var(--ink-soft); font-weight: 600; border-bottom-width: 2px; }
.corrections-table { font-size: .95rem; }
.corrections-table td { vertical-align: top; }
.corrections-table th:nth-child(3), .corrections-table th:nth-child(4) { width: 27%; }
.corrections-table th:nth-child(6) { width: 26%; }
.corrections-table .ctx { font-family: var(--font-doc); line-height: 1.6; }
.corrections-table .num { color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge-cat { background: var(--primary-tint); color: var(--primary); font-weight: 600; font-size: .78rem; border-radius: 99px; padding: .25rem .6rem; white-space: nowrap; }
.badge-skip { background: var(--warn-tint); color: var(--warn-ink); font-weight: 600; font-size: .75rem; border-radius: 99px; padding: .2rem .55rem; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.filter-chip {
    border: 1px solid var(--rule); background: var(--sheet); color: var(--ink);
    border-radius: 99px; padding: .3rem .8rem; font-size: .88rem; font-weight: 500;
}
.filter-chip:hover { border-color: var(--primary); }
.filter-chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.filter-chip .count { font-variant-numeric: tabular-nums; opacity: .8; margin-left: .25rem; }
.report-toc { position: sticky; top: 6rem; }
.report-toc a.is-active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

/* Empty states */
.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); }
.empty .bi { font-size: 2.2rem; color: var(--primary); display: block; margin-bottom: .6rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); padding-block: 3.2rem 1.6rem; margin-top: 4rem; font-size: .95rem; }
.site-footer a { color: var(--footer-link); text-decoration: none; }
.site-footer a:hover { color: var(--footer-strong); text-decoration: underline; }
.site-footer .brand { color: var(--footer-strong); }
.site-footer .brand-tld { color: var(--band-accent); }
.footer-title { font-family: var(--font-sans); font-size: .95rem; font-weight: 600; color: var(--footer-strong); margin-bottom: .8rem; letter-spacing: .01em; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .45rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 2.4rem; padding-top: 1.2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; font-size: .85rem; }

/* ---------- Error page ---------- */
.error-code { font-family: var(--font-serif); font-size: clamp(4rem, 3rem + 5vw, 7rem); line-height: 1; color: var(--primary); font-weight: 600; }

/* ---------- Administration ---------- */
.admin-body { background: var(--admin-bg); }
.admin-shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; }
.admin-nav { background: var(--admin-nav-bg); color: var(--footer-ink); padding: 1.4rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-nav .brand { color: var(--admin-nav-strong); font-size: 1.3rem; margin-bottom: .2rem; }
.admin-nav .brand-tld { color: var(--band-accent); }
.admin-nav .admin-label { font-size: .8rem; color: var(--admin-nav-soft); margin: 0 0 1.4rem 2.55rem; }
.admin-nav a.nav-link { color: var(--footer-link); border-radius: .45rem; padding: .5rem .75rem; display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.admin-nav a.nav-link:hover { background: var(--admin-nav-hover); color: var(--admin-nav-strong); }
.admin-nav a.nav-link.active { background: var(--admin-nav-active); color: var(--admin-nav-strong); }
.admin-nav .nav-sep { border-top: 1px solid rgba(255, 255, 255, .12); margin: 1rem 0; }
.admin-main { padding: 1.6rem clamp(1rem, .6rem + 2vw, 2.4rem) 3rem; }
.admin-main h1 { font-size: 1.75rem; margin-bottom: 1.2rem; }
.admin-card { background: var(--sheet); border: 1px solid var(--rule); border-radius: .7rem; padding: 1.15rem 1.25rem; }
.admin-card h2 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; margin-bottom: .9rem; }
.kpi-table td, .kpi-table th { font-variant-numeric: tabular-nums; }
.kpi-table th[scope="row"] { font-weight: 500; color: var(--ink-soft); }
.kpi-table .is-key { font-weight: 700; color: var(--ink); }
/* Column chart: one series, bars <= 24px with 4px rounded data-ends, 2px gaps, hairline baseline. */
.chart { display: flex; align-items: flex-end; gap: 2px; height: 9.5rem; padding-top: 1.6rem; border-bottom: 1px solid var(--rule); }
.chart .col { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; outline: none; }
.chart .col span { display: block; width: 100%; max-width: 24px; background: var(--primary); border-radius: 4px 4px 0 0; }
.chart .col span.is-zero { height: 1px !important; background: var(--rule); border-radius: 0; }
.chart .col:hover span:not(.is-zero), .chart .col:focus-visible span:not(.is-zero) { background: var(--ins); }
.chart .col::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + .2rem);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: var(--ink);
    color: var(--on-primary);
    font-size: .75rem;
    padding: .2rem .45rem;
    border-radius: .3rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .1s;
    z-index: 2;
}
.chart .col:hover::after, .chart .col:focus-visible::after { opacity: 1; }
.chart .col:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.chart-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-soft); margin-top: .35rem; }
.chart-peak { font-size: .8rem; color: var(--ink-soft); }
.stat-tile { background: var(--sheet); border: 1px solid var(--rule); border-radius: .7rem; padding: 1rem 1.15rem; height: 100%; }
.stat-tile .label { font-size: .85rem; color: var(--ink-soft); display: flex; align-items: center; gap: .4rem; }
.stat-tile .value { font-family: var(--font-serif); font-size: 2rem; font-weight: 600; line-height: 1.1; margin-top: .25rem; font-variant-numeric: lining-nums tabular-nums; }
.status-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; background: var(--ink-faint); }
.status-dot.done { background: var(--ins); }
.status-dot.failed, .status-dot.rejected { background: var(--del); }
.status-dot.processing, .status-dot.queued { background: var(--warn); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .45rem 0 .45rem 1.2rem; border-left: 2px solid var(--rule); position: relative; font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; left: -.4rem; top: .85rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--sheet); border: 2px solid var(--primary); }
.mono-ish { font-variant-numeric: tabular-nums; }
.log-tail { background: #0F1F16; color: #CFE3D5; font-size: .78rem; border-radius: .5rem; padding: .9rem; max-height: 22rem; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.admin-login { max-width: 25rem; margin: 10vh auto; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps li:nth-child(2)::after { display: none; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-nav { position: static; height: auto; padding: .8rem 1rem; }
    .admin-nav .admin-label { display: none; }
    .admin-nav .nav { flex-direction: row !important; flex-wrap: wrap; gap: .2rem; }
    .admin-nav .nav-sep { display: none; }
    .report-toc { position: static; }
}
@media (max-width: 767.98px) {
    .manuscript-sheet { grid-template-columns: 1fr; }
    .manuscript-notes { border-left: 0; border-top: 1px solid var(--rule); }
    .manuscript-text { padding: 1.5rem 1.3rem; font-size: 1.05rem; }
    .checks, .privacy-points { grid-template-columns: 1fr; }
    .category-bars li { grid-template-columns: minmax(6.5rem, 9rem) 1fr 2.5rem; }
}
@media (max-width: 575.98px) {
    .steps { grid-template-columns: 1fr; }
    .steps li::after { display: none; }
    .dropzone { padding: 1.5rem 1rem; }
    .corrections-table thead { display: none; }
    .corrections-table tr { display: block; border-bottom: 1px solid var(--rule); padding: .6rem 0; }
    .corrections-table td { display: block; border: 0 !important; padding: .15rem 0 !important; }
}

/* ---------- Print (report) ---------- */
@media print {
    .site-header, .site-footer, .no-print, .flash-area, .report-toc, .filters, .downloads { display: none !important; }
    body { background: #fff; font-size: 11pt; }
    .panel { border: 0; padding: 0; }
    .report-section { break-inside: avoid-page; }
    a { color: inherit; text-decoration: none; }
}

/* Pagination in the brand colour */
.pagination {
    --bs-pagination-color: var(--primary);
    --bs-pagination-hover-color: var(--primary-deep);
    --bs-pagination-active-bg: var(--primary);
    --bs-pagination-active-border-color: var(--primary);
    --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(var(--primary-rgb), .2);
}

/* ---------- Theme switcher ---------- */
.theme-menu { min-width: 16.5rem; padding-block: .4rem; }
.theme-option { display: flex; align-items: center; gap: .75rem; padding-block: .5rem; white-space: normal; }
.theme-swatch {
    width: 1.6rem; height: 1.6rem; border-radius: 50%; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--sw-a) 0 50%, var(--sw-b) 50% 100%);
    border: 1px solid rgba(0, 0, 0, .18);
}
.theme-check { visibility: hidden; color: var(--primary); }
.theme-option[aria-checked="true"] .theme-check { visibility: visible; }
.theme-option[aria-checked="true"] { background: var(--primary-tint); color: var(--ink); }
.theme-switcher-admin .nav-link { color: var(--footer-link); }
.site-header .header-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
