/* ---------- Fonts (self-hosted, SIL OFL 1.1, see fonts/OFL.txt) ---------- */
/* Barlow 400, latin-ext */
@font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/barlow-400-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Barlow 400, latin */
@font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/barlow-400-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;
}

/* Barlow 500, latin-ext */
@font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/barlow-500-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Barlow 500, latin */
@font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/barlow-500-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;
}

/* Barlow 600, latin-ext */
@font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/barlow-600-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Barlow 600, latin */
@font-face {
    font-family: "Barlow";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/barlow-600-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;
}

/* Barlow Condensed 600, latin-ext */
@font-face {
    font-family: "Barlow Condensed";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/barlow-condensed-600-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Barlow Condensed 600, latin */
@font-face {
    font-family: "Barlow Condensed";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/barlow-condensed-600-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;
}

/* Barlow Condensed 700, latin-ext */
@font-face {
    font-family: "Barlow Condensed";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/barlow-condensed-700-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Barlow Condensed 700, latin */
@font-face {
    font-family: "Barlow Condensed";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/barlow-condensed-700-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;
}

/* ---------- Design tokens ----------
   Dark is the story world (.claude/docs/story/DESIGN.md section 3). Light mode (issue: light pages) redefines the
   same tokens, so components only ever use var(--...). The theme comes from the "baler-theme" cookie, which App.razor
   writes to <html data-theme>; without a cookie the browser's prefers-color-scheme decides.
   .force-dark keeps the story scene and the entry artwork dark in both modes. */
:root,
.force-dark {
    color-scheme: dark;
    --ink: #0c1420;
    --navy: #152238;
    --panel: rgba(12, 20, 32, .88);
    --line: rgba(255, 255, 255, .16);
    --line-soft: rgba(255, 255, 255, .08);
    --paper: #eef2f5;
    --muted: #a9b6c4;
    --blue: #2563b0;
    --blue-hi: #4d8fe0;
    --orange: #e0482b;
    --amber: #f2c230;
    --alarm: #ff3b30;
    --ok: #3ecf8e;
    /* Surfaces and tints on top of --ink */
    --surface: rgba(255, 255, 255, .02);
    --surface-2: rgba(255, 255, 255, .04);
    --track: rgba(255, 255, 255, .14);
    --accent-edge: rgba(77, 143, 224, .4);
    --tint-blue: rgba(37, 99, 176, .25);
    --tint-amber: rgba(242, 194, 48, .1);
    --amber-edge: rgba(242, 194, 48, .55);
    --tag-fg: #ffb3a4;
    --band: #0f1a2a;
    --grid-line: rgba(127, 178, 240, .06);
    /* Illustration surfaces (proposal stage, network, hero floor) */
    --art-bg: #0f1b2c;
    --art-bg-2: #0e1828;
    --art-floor: #132033;
    --hero-floor: #132033;
    --art-stripe: rgba(255, 255, 255, .03);
    --art-card: #152238;
    --art-card-line: rgba(255, 255, 255, .18);
    --art-disc: #0c1420;
    --art-ink: #eef2f5;
    --art-muted: #a9b6c4;
    --art-wire: rgba(255, 255, 255, .16);
    --art-link: rgba(255, 255, 255, .12);
    --art-dot: rgba(255, 255, 255, .07);
    --art-label: #ffd2cc;
    --font-body: "Barlow", system-ui, "Segoe UI", sans-serif;
    --font-sign: "Barlow Condensed", "Arial Narrow", system-ui, "Segoe UI", sans-serif;
    /* Light "paper" surfaces (entry page classic half); the same in both modes. */
    --paper-bg: #eef2f5;
    --paper-bg-2: #dfe6ea;
    --paper-line: rgba(12, 20, 32, .12);
    --paper-muted: #5b6774;
}

/* Light mode: chosen explicitly ... */
:root[data-theme="light"] {
    color-scheme: light;
    --ink: #eef2f5;
    --navy: #ffffff;
    --panel: rgba(255, 255, 255, .92);
    --line: rgba(12, 20, 32, .16);
    --line-soft: rgba(12, 20, 32, .1);
    --paper: #0c1420;
    --muted: #4f5d6b;
    --blue: #2563b0;
    --blue-hi: #1f5aa6;
    --orange: #c93d22;
    --amber: #9a6700;
    --alarm: #d0281c;
    --ok: #127a43;
    --surface: #ffffff;
    --surface-2: rgba(12, 20, 32, .04);
    --track: rgba(12, 20, 32, .14);
    --accent-edge: rgba(37, 99, 176, .35);
    --tint-blue: rgba(37, 99, 176, .12);
    --tint-amber: rgba(242, 194, 48, .2);
    --amber-edge: #d9a400;
    --tag-fg: #9c2a14;
    --band: #e2e9ef;
    --grid-line: rgba(37, 99, 176, .08);
    --art-bg: #dbe4ec;
    --art-bg-2: #e3eaf0;
    --art-floor: #c5d0da;
    --hero-floor: rgba(12, 20, 32, .05);
    --art-stripe: rgba(12, 20, 32, .05);
    --art-card: #ffffff;
    --art-card-line: rgba(12, 20, 32, .16);
    --art-disc: #f7f9fb;
    --art-ink: #152238;
    --art-muted: #4f5d6b;
    --art-wire: rgba(12, 20, 32, .22);
    --art-link: rgba(12, 20, 32, .16);
    --art-dot: rgba(12, 20, 32, .1);
    --art-label: #a3160c;
}

/* ... or, without a choice, when the browser prefers light (same values as above). */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;
        --ink: #eef2f5;
        --navy: #ffffff;
        --panel: rgba(255, 255, 255, .92);
        --line: rgba(12, 20, 32, .16);
        --line-soft: rgba(12, 20, 32, .1);
        --paper: #0c1420;
        --muted: #4f5d6b;
        --blue: #2563b0;
        --blue-hi: #1f5aa6;
        --orange: #c93d22;
        --amber: #9a6700;
        --alarm: #d0281c;
        --ok: #127a43;
        --surface: #ffffff;
        --surface-2: rgba(12, 20, 32, .04);
        --track: rgba(12, 20, 32, .14);
        --accent-edge: rgba(37, 99, 176, .35);
        --tint-blue: rgba(37, 99, 176, .12);
        --tint-amber: rgba(242, 194, 48, .2);
        --amber-edge: #d9a400;
        --tag-fg: #9c2a14;
        --band: #e2e9ef;
        --grid-line: rgba(37, 99, 176, .08);
        --art-bg: #dbe4ec;
        --art-bg-2: #e3eaf0;
        --art-floor: #c5d0da;
    --hero-floor: rgba(12, 20, 32, .05);
        --art-stripe: rgba(12, 20, 32, .05);
        --art-card: #ffffff;
        --art-card-line: rgba(12, 20, 32, .16);
        --art-disc: #f7f9fb;
        --art-ink: #152238;
        --art-muted: #4f5d6b;
        --art-wire: rgba(12, 20, 32, .22);
        --art-link: rgba(12, 20, 32, .16);
        --art-dot: rgba(12, 20, 32, .1);
        --art-label: #a3160c;
    }
}

/* Parts shown only in the effective dark or light mode (theme switch in SiteBar and on the entry page). */
:root[data-theme="light"] .only-dark,
:root[data-theme="dark"] .only-light {
    display: none !important;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .only-dark {
        display: none !important;
    }
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .only-light {
        display: none !important;
    }
}

/* The story scene stays dark: its page background too. */
body:has(.force-dark.story) {
    background: #0c1420;
}

html, body {
    font-family: var(--font-body);
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
}

:focus-visible {
    outline: 3px solid var(--amber);
    outline-offset: 3px;
}

a, .btn-link {
    color: var(--blue-hi);
}

/* ---------- Site pages (shared shell below SiteBar: Contacts, Overview, status pages) ---------- */
.site-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
}

.site-page-head {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 12px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}

.back-link:hover {
    color: var(--paper);
}

/* ---------- Story buttons (dialogue, skip dialog, error pages; DESIGN.md section 6) ---------- */
/* Own class name so Bootstrap's .btn rules never mix in. */
.story-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    min-height: 44px;
    padding: 11px 18px;
    font: inherit;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    text-align: center;
    text-decoration: none;
    background: var(--blue);
    border: 1px solid var(--blue-hi);
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.story-btn:hover {
    color: #fff;
    background: var(--blue-hi);
    transform: translateY(-2px);
}

.story-btn.ghost {
    color: var(--paper);
    background: transparent;
    border-color: var(--line);
}

.story-btn.ghost:hover {
    color: var(--paper);
    background: var(--navy);
}

.story-btn:disabled {
    cursor: default;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .story-btn {
        transition-duration: 10ms;
    }
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}