@charset "UTF-8";
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--ok);
}

.invalid {
    outline: 1px solid var(--error);
}

.validation-message {
    color: var(--error);
}

.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."
    }

/* ---- planning platform ------------------------------------------------- */

/* The palette, in one place. Teal is the brand: buttons, links, the current section. Every colour a page uses is one of
   these, so dark mode is only a second set of values. */
:root {
    color-scheme: light;
    --ink: #16181d;
    --muted: #667085;
    --line: #e4e7ec;
    --line-strong: #d0d5dd;
    --bg: #f5f6f8;
    --card: #ffffff;
    --surface: #f2f4f7;
    --field: #ffffff;
    --accent: #0f766e;
    --brand: #0f766e;
    --brand-hover: #115e59;
    --brand-soft: #e3f3f1;
    --brand-ink: #0b5650;
    --on-brand: #ffffff;
    --error: #b42318;
    --error-soft: #fef3f2;
    --warning: #b54708;
    --warning-soft: #fffaeb;
    --ok: #067647;
    --ok-soft: #ecfdf3;
    --highlight: #fff6e0;
    --added: #ecfdf3;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16), 0 4px 8px rgba(16, 24, 40, .06);
    --radius: 10px;
    --radius-sm: 6px;
    --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --ink: #e6e8ec;
        --muted: #98a2b3;
        --line: #2a2f38;
        --line-strong: #3a414c;
        --bg: #0f1115;
        --card: #171a20;
        --surface: #1e222a;
        --field: #12151a;
        --accent: #5fd4c4;
        --brand: #0f857b;
        --brand-hover: #12998e;
        --brand-soft: #12302d;
        --brand-ink: #8fe3d7;
        --on-brand: #ffffff;
        --error: #f97066;
        --error-soft: #2d1514;
        --warning: #fdb022;
        --warning-soft: #2b2110;
        --ok: #47cd89;
        --ok-soft: #10261b;
        --highlight: #2b2410;
        --added: #10261b;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow: 0 1px 3px rgba(0, 0, 0, .4);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
    }
}

* { box-sizing: border-box; }

body {
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
    font-size: 15px;
    color: var(--ink);
    background: var(--bg);
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Every page's content, under the bar. */
main.page { padding: 1.75rem 2rem 4rem; max-width: 120rem; margin: 0 auto; }

h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -.015em; margin: .1rem 0 .2rem; }
h2 { font-size: .78rem; font-weight: 650; margin: 1.8rem 0 .5rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
h3 { font-size: 1rem; font-weight: 650; margin: 1rem 0 .4rem; }
aside h2:first-child { margin-top: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ok { color: var(--ok); }
.bad { color: var(--error); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; padding-bottom: 1.1rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.page-head .actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.page-head p { margin: .25rem 0 0; max-width: 60rem; }

.columns { display: flex; gap: 2rem; align-items: flex-start; }
.main { flex: 1 1 auto; min-width: 0; }
aside { flex: 0 0 22rem; position: sticky; top: 4.5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-sm); }

section { margin-bottom: 1.2rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; box-shadow: var(--shadow-sm); }
/* Bled out to the card's edges with negative margins rather than by unpadding .card, which
   the constraint and assignment cards share and do not head. The top corners match the card's
   radius so the bar reads as part of it. */
.card-head { margin: -1rem -1rem 1rem; padding: .5rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; gap: .5rem; align-items: baseline; }
.card-head .muted { text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 650; font-size: .9rem; }
.row { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: .6rem; }
.params { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; }
/* A field's meaning, opened from the ? beside its name (a native popover). Where the browser places a popover by
   its anchor, the bubble sits under the ?, flipping above or leftwards when there is no room; elsewhere it opens in
   the middle of the screen, the popover's own default. */
.param { display: flex; flex-direction: column; }
.help-tip { display: inline-flex; align-items: center; justify-content: center; width: 1.05rem; height: 1.05rem;
    margin-left: .3rem; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--card);
    color: var(--muted); font-size: .7rem; font-weight: 600; line-height: 1; vertical-align: text-bottom; cursor: pointer; box-shadow: none; }
.help-tip:hover, .help-tip:focus-visible { color: var(--accent); border-color: var(--accent); }
.help-bubble { width: max-content; max-width: min(24rem, calc(100vw - 2rem)); padding: .6rem .8rem; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg);
    font-size: .82rem; line-height: 1.45; }
@supports (anchor-name: --a) {
    /* Its own width, not shrunk to the room on its right: shrunk, it never overflows, so it never flips, and beside the
       right edge of a phone it was a column of a few words. */
    .help-bubble { margin: .3rem 0 0; position-area: bottom span-right; position-try-fallbacks: flip-inline, flip-block, bottom; }
}

label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; }
label > span { color: var(--muted); font-weight: 500; }
label.wide { flex: 1 1 18rem; }
label.narrow input { width: 6rem; }

input, select, textarea { font: inherit; font-size: .9rem; padding: .42rem .6rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--field); color: var(--ink); transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--line-strong) 60%, var(--muted)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 1rem; height: 1rem; padding: 0; box-shadow: none; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface); color: var(--muted); }
input.note { width: 14rem; }
/* The model's description: several lines, five to start with, made taller or shorter by its handle (not wider: the column sets that). */
textarea.description, .assistant-instructions textarea { line-height: 1.45; width: 100%; resize: vertical; min-height: 3rem; }

/* Buttons: a quiet one by default, the brand's for the main action, a link-like one for small actions in a row. */
button, .button, .btn { font: inherit; font-size: .875rem; font-weight: 550; line-height: 1.25; padding: .45rem .85rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, color .12s; display: inline-block; text-decoration: none; }
button:hover, .button:hover, .btn:hover { background: var(--surface); text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); text-decoration: none; }
button.link { border: none; background: none; box-shadow: none; color: var(--accent); padding: .1rem .2rem; font-weight: 500; }
button.link:hover:not(:disabled) { background: none; text-decoration: underline; text-underline-offset: 2px; }
button.link.danger { color: var(--error); }
/* A label kept lower case in the sentences it is also used in, shown as a button's. */
.btn.cap::first-letter { text-transform: uppercase; }
button.ghost, a.button.ghost { background: none; border-color: transparent; box-shadow: none; color: var(--muted); }
button.ghost:hover:not(:disabled), a.button.ghost:hover { background: var(--surface); color: var(--ink); }
button.ghost.danger:hover:not(:disabled) { background: var(--error-soft); color: var(--error); }

table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .9rem; }
table.grid th { text-align: left; font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); padding: .5rem .6rem; background: var(--surface); }
table.grid th:first-child { border-top-left-radius: var(--radius-sm); }
table.grid th:last-child { border-top-right-radius: var(--radius-sm); }
table.grid td { border-bottom: 1px solid var(--line); padding: .45rem .6rem; vertical-align: top; }
table.grid tbody tr:hover td { background: color-mix(in srgb, var(--surface) 60%, transparent); }
table.grid th.tight, table.grid td.tight { width: 1%; white-space: nowrap; }
table.grid input, table.grid select { width: 100%; }
table.models td { padding: .5rem .4rem; }
tr.binding td { background: var(--highlight); }

.diagnostics ul, ul.history { list-style: none; margin: .3rem 0 0; padding: 0; }
.diagnostics li { border-left: 3px solid var(--line-strong); background: var(--card); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: .35rem .6rem; margin-bottom: .35rem; font-size: .85rem; }
.diagnostics li.error { border-color: var(--error); background: var(--error-soft); }
.diagnostics li.warning { border-color: var(--warning); background: var(--warning-soft); }
.diagnostics code, .looked-up code { background: var(--surface); padding: .05rem .3rem; border-radius: 4px; margin-right: .35rem; font-size: .8rem; }

ul.history li { display: flex; gap: .4rem; align-items: baseline; flex-wrap: wrap; font-size: .85rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.badge { display: inline-block; background: var(--warning-soft); color: var(--warning); font-size: .7rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px; }

p.status, .status { background: var(--brand-soft); border-left: 3px solid var(--brand); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: .55rem .8rem; font-size: .9rem; }
div.status, section.status { margin: .6rem 0; }

/* Tabs that read as tabs: each a raised folder tab, the open one joined to the page below it (its own background, no
   line under it) and marked along its top; the others on the bar, quieter. */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 1rem 0 1rem; padding: 0 .25rem; border-bottom: 1px solid var(--line-strong); }
button.tab { position: relative; border: 1px solid var(--line-strong); border-bottom: none; border-radius: 8px 8px 0 0; background: var(--card); box-shadow: none; color: var(--muted); padding: .5rem .9rem; margin-bottom: -1px; display: flex; gap: .45rem; align-items: center; font-weight: 550; }
button.tab:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
button.tab.on, button.tab.on:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 45%, var(--line-strong)); font-weight: 650; z-index: 1; }
button.tab.on::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; border-radius: 8px 8px 0 0; background: var(--brand); }
button.tab:disabled { opacity: .55; }
/* What a tab names (a type), and what kind it is, told apart: the kind small, in capitals, on a tint of its own. */
.tab-kind { font-size: .52rem; font-weight: 650; letter-spacing: .05em; line-height: 1.3; text-transform: uppercase; padding: 0 .3rem; border-radius: 3px; background: var(--card); color: var(--muted); border: 1px solid var(--line); }
.tab-kind.resource { color: #1f6fb2; background: color-mix(in srgb, #2e86c1 12%, var(--card)); border-color: color-mix(in srgb, #2e86c1 30%, transparent); }
.tab-kind.activity { color: var(--brand-ink); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.tab-kind.reference { color: #8a5a12; background: color-mix(in srgb, #c9962e 14%, var(--card)); border-color: color-mix(in srgb, #c9962e 35%, transparent); }
button.tab .bad { font-size: .6rem; line-height: 1; }
button.tab .caution { color: var(--warning); font-size: .6rem; line-height: 1; }
button.tab.validation.problems, button.tab.validation.problems:hover:not(:disabled) { color: var(--error); }
button.tab.validation.problems.on { border-color: color-mix(in srgb, var(--error) 45%, var(--line-strong)); }
button.tab.validation.problems.on::before { background: var(--error); }
.validation-notice { margin: .35rem 0 0; }
.validation-notice button.link { color: var(--error); font-weight: 600; padding: 0; text-align: left; }

.row.filter { align-items: flex-end; margin-bottom: .6rem; }
table.data tr.added td { background: var(--added); }
table.data tr.changed td { background: var(--highlight); }
table.data input[type=checkbox] { width: auto; }
.req { color: var(--error); }
.row.filter input.reference { min-width: 13rem; }

/* A multi-valued enum: a dropdown whose panel holds one checkbox per option. */
details.multi { position: relative; display: inline-block; }
details.multi > summary {
    cursor: pointer; list-style: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 11rem; font-size: .9rem; padding: .42rem 1.4rem .42rem .6rem;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--field);
}
details.multi > summary::-webkit-details-marker { display: none; }
details.multi > summary::after { content: "\25BE"; position: absolute; right: .5rem; top: .42rem; color: var(--muted); }
details.multi[open] > summary { border-color: var(--brand); box-shadow: var(--ring); }
details.multi > .choices {
    position: absolute; z-index: 10; top: 100%; left: 0; margin-top: .25rem;
    display: flex; flex-direction: column; gap: .1rem;
    min-width: 11rem; max-height: 14rem; overflow-y: auto;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: .45rem .55rem; box-shadow: var(--shadow-lg);
}
label.choice { flex-direction: row; align-items: center; gap: .4rem; font-size: .85rem; white-space: nowrap; }
label.choice input { width: auto; }

/* A resource's share of a plan, over the page. Plain overlay rather than <dialog>: no JS
   interop needed, and the backdrop closes it. */
.overlay {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(15, 17, 21, .5); backdrop-filter: blur(2px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 3rem 1rem; overflow-y: auto;
}
.overlay > .panel {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 1.2rem 1.4rem 1.5rem; width: min(46rem, 100%);
}
.overlay > .panel h1, .overlay > .panel h2 { text-transform: none; letter-spacing: 0; color: var(--ink); }
.overlay > .panel > header h2 { font-size: 1.2rem; margin: 0; }
.overlay > .panel section h2 { font-size: .95rem; margin: 1.1rem 0 .3rem; display: flex; gap: .6rem; align-items: baseline; }
.overlay td strong + span { margin-left: .45rem; }
.row.geocoding { margin-top: .4rem; align-items: flex-end; }

/* The map behind "Show on map". Wider than the plan popup because a map of a city needs the
   room, and a fixed height because Leaflet sizes itself to its container and a container that
   sizes itself to its content collapses to nothing. */
.overlay > .panel.wide { width: min(64rem, 100%); }
.map { height: min(62vh, 34rem); margin-top: .8rem; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color-scheme: light; }
.map:empty::after { content: "Loading the map\2026"; color: var(--muted); font-size: .85rem; padding: .6rem; display: block; }

/* One entry per kind, with the swatch the markers are drawn in. Kept in step with STYLES in
   wwwroot/js/entity-map.js by hand — two places, but the alternative is styling from C#. */
ul.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: .6rem 0 0; padding: 0; font-size: .85rem; }
ul.legend li { display: flex; align-items: center; gap: .4rem; color: var(--muted); }
ul.legend li::before { content: ""; width: .7rem; height: .7rem; border-radius: 50%; border: 2px solid; }
ul.legend li.resource::before { background: #2e86c1; border-color: #1f5f8b; }
ul.legend li.reference::before { background: #c9962e; border-color: #7d5a1f; }

/* Leaflet's popup is its own stylesheet's; only the muted line needs to match this app. */
.leaflet-popup-content .muted { color: #667085; font-size: .8rem; }

/* A section that folds away. The heading stays inline so the disclosure marker keeps its
   place beside it, and the counts stay readable while it is shut — collapsing a panel
   should hide the detail, never the fact that there is some. */
details.panel > summary { cursor: pointer; padding: .1rem 0; }
details.panel > summary > h2 { display: inline; margin-right: .4rem; }
details.panel > summary::marker { color: var(--muted); }
details.panel > summary:hover > h2 { color: var(--accent); }

/* A run drawn on the map. The number on a stop is the order, which is the whole reason to
   draw a run rather than a set of pins — so it sits on the marker rather than in a popup
   nobody opens. */
.stop-number {
    color: #fff; font-size: .7rem; font-weight: 700; line-height: 22px;
    text-align: center; text-shadow: 0 0 2px rgba(0,0,0,.6); pointer-events: none;
}
.legend.runs { display: flex; flex-wrap: wrap; gap: .1rem 1.2rem; }
.legend.runs li { display: flex; align-items: center; gap: .4rem; border: 0; padding: .15rem 0; }
.legend.runs .swatch { width: .9rem; height: .25rem; border-radius: 2px; display: inline-block; }

/* The plan as a week. Each hour is 54px, which is Scale (0.9 px a minute) in PlanCalendarView —
   the two have to agree, or blocks sit off the hour lines. --hours comes from the component. */
.calendar { display: flex; margin-top: .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow-x: auto; }
.calendar-hours { flex: 0 0 3.2rem; border-right: 1px solid var(--line); }
.calendar-day { flex: 1 1 0; min-width: 8.5rem; border-right: 1px solid var(--line); }
.calendar-day:last-child { border-right: 0; }
.calendar-day-head { height: 2.9rem; padding: .3rem .4rem; border-bottom: 1px solid var(--line); font-size: .85rem; white-space: nowrap; }
.calendar-body { position: relative; height: calc(var(--hours) * 54px); }
.calendar-hour { height: 54px; font-size: .72rem; color: var(--muted); padding: .1rem .3rem; border-top: 1px solid var(--line); }
.calendar-hour:first-child, .calendar-slot:first-child { border-top: 0; }
.calendar-slot { height: 54px; border-top: 1px dashed color-mix(in srgb, var(--line) 60%, transparent); }
.calendar-event {
    position: absolute; margin-left: 1px; display: flex; flex-direction: column;
    cursor: pointer; border-radius: 5px; overflow: hidden; font-size: .72rem; line-height: 1.2;
    border: 1px solid var(--colour);
}
.calendar-event.selected { outline: 2px solid var(--ink); z-index: 2; }
.calendar-work {
    flex: 0 0 auto; padding: .15rem .3rem; overflow: hidden;
    background: color-mix(in srgb, var(--colour) 18%, var(--card)); border-left: 4px solid var(--colour);
    display: flex; flex-direction: column; gap: .05rem;
}
.calendar-work .when { font-variant-numeric: tabular-nums; color: var(--muted); }
/* A journey, not work: hatched in the block's own colour so it reads as belonging to the call. */
.calendar-travel {
    flex: 0 0 auto;
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--colour) 30%, var(--card)) 0 4px, var(--card) 4px 8px);
}
.week-nav { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
/* A week of five busy days needs more room than a map does; four jobs at once in a narrow
   column is a column nobody can read. */
.overlay > .panel.calendar-panel { width: min(90rem, 100%); }
/* Work the plan gave to nobody, counted on its day so a gap in the column reads as a decision. */
.undone-count { font-size: .72rem; color: var(--error); margin-left: .3rem; }
/* The banner saying a solve starts from an earlier plan, and from when. */
.status.replan { margin-top: .6rem; }
.status.replan p { margin: .2rem 0; }
.status.replan input[type=datetime-local] { width: auto; display: inline-block; }

/* An agreed plan: settled for its stretch, and every later solve keeps it. */
.badge.agreed { background: var(--ok-soft); color: var(--ok); }
.status.agreed { margin-top: .4rem; }
.badge.waiting { background: var(--warning-soft); color: var(--warning); }

/* What a person is asked about their own work, and where a plan's round stands. */
.confirmations { display: flex; flex-direction: column; gap: 1rem; }
.confirmation h2, .confirmation-status h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .3rem; font-size: 1.05rem; }
.confirmation-why-said { margin: .5rem 0; }
.confirmation-changes { list-style: none; margin: .6rem 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.confirmation-changes li { border: 1px solid var(--line); border-radius: 8px; padding: .55rem .75rem; }
.confirmation-kind { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); }
.confirmation-kind.gained, .confirmation-kind.moved { color: var(--accent); }
input.confirmation-why { flex: 1 1 18rem; min-width: 14rem; width: 100%; box-sizing: border-box; }
.confirmation-status { margin: 1rem 0; }
.confirmation-actions { flex-wrap: wrap; margin-top: .6rem; }
.confirmation-actions input.wide { flex: 1 1 16rem; width: auto; }
p.error { color: var(--error); }

/* Work that fits no suitable room, and the split that fits it again. */
.status.splits { margin-top: .6rem; border-left: 3px solid var(--warning); background: var(--warning-soft); padding-left: .8rem; }
.status.splits ul { margin: .3rem 0 .5rem 1.2rem; }
/* Time off: grey, hatched, and under the work, so a job that somehow sits in it still shows. */
.calendar-away {
    position: absolute; left: 0; right: 0; z-index: 0;
    background: repeating-linear-gradient(45deg, var(--surface) 0 6px, var(--card) 6px 12px);
    border-top: 2px solid var(--line-strong); border-bottom: 2px solid var(--line-strong);
    font-size: .72rem; color: var(--muted); padding: .2rem .35rem; overflow: hidden;
}
.calendar-event { z-index: 1; }
.away-note { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- the bar at the top ---------------------------------------------------- */

.topbar { position: sticky; top: 0; z-index: 40; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0 2rem; height: 3.5rem; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.4) blur(8px); font-size: .9rem; }
.topbar nav { display: flex; gap: .2rem; align-items: center; height: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
/* Where the window is too narrow for every section, they scroll sideways rather than run under the bell and the account button. */
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a.section { display: flex; align-items: center; height: 100%; padding: 0 .75rem; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; white-space: nowrap; }
.topbar nav a.section:hover { color: var(--ink); }
.topbar nav a.section.active { color: var(--ink); border-bottom-color: var(--brand); }
.topbar form { margin: 0; }
/* On a narrow window the sections go into a drawer from the left (MainLayout), opened by three lines before the brand. */
button.menu-button { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 2.25rem; height: 2.25rem; padding: 0 .5rem; margin-left: -.4rem; border: none; background: none; box-shadow: none; border-radius: var(--radius-sm); flex: 0 0 auto; }
button.menu-button:hover { background: var(--surface); }
button.menu-button span { display: block; height: 2px; border-radius: 1px; background: var(--ink); }
.nav-drawer { position: fixed; inset: 0 auto 0 0; margin: 0; width: min(18rem, 85vw); height: 100vh; max-height: none; padding: 0; border: none; border-right: 1px solid var(--line); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); overflow-y: auto; }
.nav-drawer::backdrop { background: rgb(0 0 0 / .35); }
.nav-drawer .brand { height: 3.5rem; padding: 0 1.25rem; margin: 0; border-bottom: 1px solid var(--line); }
.nav-drawer nav { display: flex; flex-direction: column; padding: .5rem; }
.nav-drawer a.section { display: block; padding: .7rem .9rem; border-radius: var(--radius-sm); color: var(--ink); font-weight: 550; text-decoration: none; }
.nav-drawer a.section:hover { background: var(--surface); }
.nav-drawer a.section.active { background: var(--brand-soft); color: var(--brand-ink); }
.topbar nav .sections { display: flex; align-items: center; gap: .2rem; height: 100%; }
@media (max-width: 64rem) {
    button.menu-button { display: flex; }
    .topbar { padding: 0 1rem; gap: .5rem; }
    .topbar nav .sections { display: none; }
    .topbar .organisation { max-width: 10rem; }
}
/* The brand: a mark and the name, then the organisation, quieter. */
.brand { display: flex; align-items: center; gap: .55rem; margin-right: 1rem; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand svg { flex: 0 0 auto; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.topbar .organisation { color: var(--muted); font-weight: 500; padding-left: .55rem; border-left: 1px solid var(--line-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.topbar .who { display: flex; align-items: center; gap: .6rem; }
/* A superadmin's organisation, as a list to choose another from. */
.topbar .org-switch { display: flex; align-items: center; margin-right: 1rem; }
.topbar .org-switch select.organisation { padding: .25rem 1.6rem .25rem .55rem; border: 1px solid var(--line-strong); border-radius: 6px; background-color: var(--card); color: var(--ink); font: inherit; font-weight: 550; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
.role-badge { font-size: .72rem; font-weight: 600; border-radius: 999px; padding: .1rem .55rem; color: var(--brand-ink); background: var(--brand-soft); }

/* The account menu: who is signed in, the language and signing out, behind the initial. A native popover, so it closes
   on a click elsewhere or Escape without a script. */
button.account-button { display: flex; align-items: center; gap: .5rem; padding: .25rem .35rem .25rem .25rem; border-radius: 999px; background: none; border: 1px solid transparent; box-shadow: none; }
button.account-button:hover { background: var(--surface); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 650; font-size: .85rem; text-transform: uppercase; }
.account-menu { position: fixed; inset: 3.4rem 1.25rem auto auto; margin: 0; min-width: 16rem; padding: .4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
.account-menu .who-line { padding: .6rem .7rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.account-menu .who-line strong { display: block; font-weight: 600; word-break: break-all; }
.account-menu .menu-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .45rem .7rem; font-size: .875rem; }
.account-menu a.menu-row { color: var(--ink); border-radius: var(--radius-sm); }
.account-menu a.menu-row:hover { background: var(--surface); text-decoration: none; }
.account-menu form button { width: 100%; text-align: left; border: none; background: none; box-shadow: none; padding: .45rem .7rem; color: var(--ink); font-weight: 500; }
.account-menu form button:hover { background: var(--surface); }
/* Installing the app (js/pwa.js shows it where the browser offers it). */
.account-menu button.install-row { width: 100%; text-align: left; border: none; background: none; box-shadow: none; color: var(--brand); font-weight: 600; }
.account-menu button.install-row:hover { background: var(--brand-soft); }
[data-install][hidden], [data-pwa-show][hidden] { display: none !important; }
.web-app .web-push { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.web-app .web-push h3 { font-size: 1rem; margin: 0; }
.web-app [data-push-status]:empty { display: none; }
.account-menu .languages button.link { width: auto; padding: .1rem .3rem; color: var(--accent); }

.account { max-width: 26rem; margin: 4rem auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; box-shadow: var(--shadow); }
.account form { display: flex; flex-direction: column; gap: .8rem; margin: 1rem 0; }
.account label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; }
.account input, .account select { width: 100%; padding: .55rem .7rem; }
.account button.primary { align-self: stretch; padding: .6rem; }

.status.failed { border-left-color: var(--error); color: var(--error); background: var(--error-soft); }
.status.bad { border-left-color: var(--error); background: var(--error-soft); }
.status.done { border-left: 3px solid var(--ok); background: var(--ok-soft); padding: .55rem .8rem; font-size: .9rem; margin: .6rem 0; }
.members .actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
/* Wide enough for a name, an address and a mobile number side by side, without cutting the name. */
.members table.grid { max-width: 84rem; }
.members input.person-name { min-width: 19rem; }
.members input.person-phone { min-width: 9.5rem; }
code.invite-link { display: inline-block; margin-top: .3rem; word-break: break-all; user-select: all; background: var(--surface); padding: .2rem .4rem; border-radius: 4px; }
/* A member's realms, one a line, with its remove beside it and any problem under it. */
.member-realm { display: flex; flex-wrap: wrap; gap: 0 .5rem; align-items: baseline; }
.member-realm .status { flex-basis: 100%; margin: .2rem 0; }
td.row-actions > * + * { margin-left: .5rem; }
.members table.grid select { min-width: 7rem; }

/* The organisation's WhatsApp account (WhatsAppCard). */
.whatsapp-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .6rem 1rem; max-width: 60rem; margin: .75rem 0; }
.whatsapp-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; }
.whatsapp-form input.short { max-width: 6rem; }
.whatsapp-form .actions { grid-column: 1 / -1; }
.whatsapp-webhook { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: .5rem 0 1rem; }
.whatsapp-webhook dt { color: var(--muted); }
.whatsapp-webhook dd { margin: 0; overflow-wrap: anywhere; }
.whatsapp-templates { max-width: 48rem; margin: .5rem 0; }
.whatsapp-warning { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .75rem 1rem; max-width: 60rem; margin: .75rem 0; background: var(--warning-soft); }
.whatsapp-warning ul { margin: .5rem 0; padding-left: 1.2rem; }
.whatsapp-warning li { margin: .3rem 0; }

/* ---- read only, for viewers ----------------------------------------------- */

/* Always present, so an editor's layout is the same with or without it. */
fieldset.view-only { border: 0; margin: 0; padding: 0; min-width: 0; }

/* Disabled, the controls are for reading: in the text colour, and the buttons that only change
   things (add, remove, delete) are not shown at all. */
fieldset.view-only:disabled button { display: none; }
fieldset.view-only:disabled input,
fieldset.view-only:disabled select,
fieldset.view-only:disabled textarea { color: var(--ink); background: var(--surface); opacity: 1; cursor: default; }

.read-only-note { font-size: .8rem; border: 1px solid var(--line); border-radius: 999px; padding: .15rem .6rem; color: var(--muted); }

/* ---- languages ------------------------------------------------------------ */

.languages { display: inline-flex; gap: .5rem; align-items: center; font-size: .85rem; }
.languages form { margin: 0; }
.languages .current { font-weight: 650; }
.languages .current, .languages button.link { display: inline-flex; align-items: center; gap: .35rem; }
.languages .flag { width: 18px; height: 12px; flex: 0 0 auto; border-radius: 2px; box-shadow: 0 0 0 1px var(--line-strong); }
.topbar.signed-out { justify-content: space-between; border-bottom: none; background: none; backdrop-filter: none; position: static; }

/* A plan's printable sheets: one per resource, each starting a page. Printed, only the sheets show. */
.actions.export { margin: .25rem 0 1rem; }
.sheets-bar { display: flex; gap: .5rem; align-items: center; margin: 0 0 1rem; }
.sheet { margin: 0 0 2rem; }
.sheet h2 { margin-bottom: .1rem; }

@media print {
    :root { color-scheme: light; --ink: #000; --muted: #555; --line: #ccc; --bg: #fff; --card: #fff; --surface: #f2f2f2; }
    .topbar, .no-print, #blazor-error-ui { display: none !important; }
    body { background: white; }
    main.page { padding: 0; }
    .sheet { break-after: page; margin: 0; }
    .sheet:last-of-type { break-after: auto; }
    .sheet table { font-size: 10pt; }
    .sheet tr { break-inside: avoid; }
}

/* ---- the models ------------------------------------------------------------ */

/* One card per model: its name and what it is, then where to go with it. */
.model-list { display: grid; gap: .75rem; max-width: 72rem; }
.model-card { display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; }
.model-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.model-card .model-main { min-width: 0; flex: 1 1 auto; }
.model-card a.model-name { font-size: 1.05rem; font-weight: 650; color: var(--ink); }
.model-card a.model-name:hover { color: var(--accent); text-decoration: none; }
/* Two lines of what it is; the whole description in the tooltip. */
.model-card .model-description { margin: .25rem 0 .45rem; color: var(--muted); font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.model-card .model-meta { display: flex; gap: .4rem .9rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.model-card .model-meta .latest-plan { color: var(--accent); }
.model-card .model-meta .version { font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); border-radius: 999px; padding: 0 .5rem; }
.model-card .model-actions { display: flex; gap: .4rem; align-items: center; flex: 0 0 auto; }
.new-model { display: flex; gap: .5rem; }
.new-model input { width: 16rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* ---- the assistant --------------------------------------------------------- */

/* The person's kept conversations beside the one open; above it on a narrow screen. */
.assistant-layout { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
/* Folded: the conversations hidden, a strip with the button that opens them in their place. */
.assistant-layout.folded { grid-template-columns: 2.5rem minmax(0, 1fr); gap: 1rem; }
.assistant-layout.folded > aside.conversations { display: none; }
.conversations-rail { display: none; }
.assistant-layout.folded > .conversations-rail { display: flex; position: sticky; top: 4.5rem; justify-content: center; }
.conversations-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 .1rem; }
.assistant-layout .conversations-head h3 { margin: 0 .4rem; }
button.rail-toggle { padding: .4rem; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); }
.assistant-layout.folded .rail-toggle { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--muted); }
.assistant-layout.folded .rail-toggle:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); background: var(--card); }
.assistant-layout.folded .talk { max-width: 64rem; }
.conversations { position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow-y: auto; padding: .9rem .6rem; }
.assistant-layout .conversations h3 { margin: 0 .4rem .1rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.conversations > p { margin: 0 .4rem .6rem; }
.conversations ul { list-style: none; padding: 0; margin: 0; }
.conversations li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .3rem; padding: .45rem .5rem; border-radius: var(--radius-sm); }
.conversations li:hover { background: var(--surface); }
.conversations li.current { background: var(--brand-soft); }
.conversations li.current a { color: var(--brand-ink); font-weight: 600; }
.conversations li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: .875rem; }
.conversations li a:hover { text-decoration: none; }
.conversations li .muted { grid-column: 1; font-size: .75rem; }
.conversations li button { grid-column: 2; grid-row: 1 / span 2; align-self: center; opacity: 0; color: var(--muted); font-size: 1rem; }
.conversations li:hover button, .conversations li button:focus-visible { opacity: 1; }
.conversations li button:hover:not(:disabled) { color: var(--error); text-decoration: none; }
.conversations > button.link { margin: .5rem .4rem 0; }

/* The conversation, then the question box held at the bottom of the window while it scrolls. */
.talk { display: flex; flex-direction: column; min-height: calc(100vh - 12rem); max-width: 60rem; }
.conversation { display: flex; flex-direction: column; gap: 1rem; margin: 0 0 1rem; flex: 1 1 auto; }
.turn.person { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-radius: 16px 16px 4px 16px; padding: .6rem 1rem; max-width: 80%; box-shadow: var(--shadow-sm); }
.turn.person p { margin: 0; white-space: pre-wrap; }
.turn.person .attached { color: inherit; opacity: .85; margin-top: .3rem; }
.turn.assistant { align-self: stretch; background: var(--card); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: .8rem 1.1rem; box-shadow: var(--shadow-sm); }
.turn.assistant .answer > :first-child { margin-top: 0; }
.turn.assistant .answer > :last-child { margin-bottom: 0; }
.turn.assistant .answer h1, .turn.assistant .answer h2, .turn.assistant .answer h3 { font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 1rem 0 .4rem; }
.turn.assistant .answer table { border-collapse: collapse; margin: .6rem 0; font-size: .875rem; }
.turn.assistant .answer th, .turn.assistant .answer td { border: 1px solid var(--line); padding: .3rem .6rem; text-align: left; }
.turn.assistant .answer th { background: var(--surface); font-weight: 600; }
.turn.assistant .answer code { background: var(--surface); padding: .05rem .3rem; border-radius: 4px; }
/* Something that happened while the conversation went on (an answer to a replan sent for confirmation): a quiet line, not a bubble. */
.turn.notice { align-self: center; max-width: 90%; background: var(--brand-soft); color: var(--ink); border-radius: var(--radius); padding: .4rem .9rem; }
.turn.notice p { margin: .15rem 0; }
/* How to reach whoever answered a confirmation, beside a rejection: a line of its own under the reason. */
.contact { display: block; }
.contact a { margin-left: .4rem; }
/* The replans the person sent for confirmation, behind a button above the conversation. */
.followed-confirmations > header { display: flex; justify-content: space-between; align-items: center; }
.followed-round li { margin-bottom: .35rem; }
.followed-round p { margin: .4rem 0 .2rem; }
.followed-round ul { margin: 0; padding-left: 1.1rem; }
.followed-round > button { margin: .2rem 0 .4rem; }
.followed-round .answer-for { display: inline-flex; gap: .3rem; margin-left: .4rem; vertical-align: middle; }
.followed-round .answer-for button { padding: .05rem .5rem; font-size: .8rem; }
.looked-up { margin-top: .5rem; }
.looked-up summary { cursor: pointer; }
.looked-up ul { margin: .3rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.thinking { display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.thinking::before { content: ""; width: .9rem; height: .9rem; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.thinking-note { margin: -.4rem 0 0 1.5rem; color: var(--muted); font-size: .9rem; }
@keyframes spin { to { transform: rotate(360deg); } }
/* A change the assistant proposed: what each row is and would be, and the person's buttons. */
.proposal { margin-top: .8rem; max-width: 60rem; }
.proposal table.grid td { vertical-align: top; }
.proposal del { color: var(--muted); }
/* Every change of a replan, under its card: scrolls within the card, a week of changes being long. */
.plan-changes { max-height: 32rem; overflow: auto; border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .4rem; }
.plan-changes .changes-day { margin: .8rem 0 .3rem; text-transform: capitalize; font-size: .9rem; }
.proposal ins { text-decoration: none; font-weight: 600; }
.proposal .warning { color: var(--warning); }
.proposal details.requirements summary { cursor: pointer; margin: .3rem 0; }
.proposal .requirement-status { white-space: nowrap; font-weight: 600; }
.proposal .requirement-status.covered { color: var(--ok); }
.proposal .requirement-status.partial { color: var(--warning); }
.proposal .requirement-status.notexpressible { color: var(--error); }
.proposal .model-review ul { margin: .2rem 0 .4rem 1.2rem; padding: 0; }
.proposal .model-review p { margin: .3rem 0 0; }
.proposal .actions { display: flex; gap: .5rem; margin-top: .6rem; }
.waiting { background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); border-radius: var(--radius); padding: .8rem 1rem; }
.waiting h3 { margin-top: 0; }
/* The history of a model's data: one card per change, opened to see its rows. */
.changes { max-width: 70rem; }
.change > summary { cursor: pointer; }
.change .badge { margin-left: .4rem; }
.change table.grid { margin-top: .5rem; }
.change table.grid td { vertical-align: top; }
.change del { color: var(--muted); }
.change ins { text-decoration: none; font-weight: 600; }
.filters { margin: .5rem 0 1rem; }
.composer { position: sticky; bottom: 0; padding: .75rem 0 1rem; background: linear-gradient(to bottom, transparent, var(--bg) .75rem); }
.composer-box { background: var(--card); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); padding: .6rem .7rem .55rem; transition: border-color .12s, box-shadow .12s; }
.composer-box:focus-within { border-color: var(--brand); box-shadow: var(--ring), var(--shadow); }
.focus { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; font-size: .85rem; }
.focus select { font-size: .85rem; padding: .25rem .5rem; }
.ask { display: flex; gap: .5rem; align-items: flex-end; }
.ask textarea { flex: 1; border: none; box-shadow: none; background: none; resize: none; padding: .3rem .2rem; font-size: .95rem; }
.ask textarea:focus { box-shadow: none; }
.ask button.primary { border-radius: 10px; padding: .5rem 1.1rem; }
.check-options { margin: .5rem .2rem 0; }
.check-options .solve-time { display: inline-flex; flex-direction: row; align-items: center; font-size: inherit; gap: .35rem; margin-left: .5rem; white-space: nowrap; }
.check-options .solve-time select { width: auto; font-size: inherit; padding: .1rem .3rem; }
.turn .usage { margin: .4rem 0 0; font-size: .75rem; }
@media (max-width: 50rem) {
    .assistant-layout { grid-template-columns: minmax(0, 1fr); }
    .assistant-layout.folded { grid-template-columns: minmax(0, 1fr); }
    .assistant-layout.folded > .conversations-rail { position: static; justify-content: flex-start; }
    .conversations { position: static; max-height: 16rem; }
}
.assistant-switch { display: flex; flex-direction: row; justify-content: flex-start; gap: .4rem; align-items: center; margin-top: .75rem; }
.assistant-use { margin-bottom: 1rem; }
.assistant-use .num { text-align: right; }

/* The question asked before anything is deleted or removed (ConfirmDialog): a dialog over a dimmed page. */
.confirm-backdrop { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(15, 17, 21, .5); backdrop-filter: blur(2px); }
.confirm-dialog { width: 100%; max-width: 30rem; padding: 1.3rem 1.4rem; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); outline: none; }
.confirm-dialog p { margin: 0 0 1.1rem; line-height: 1.5; }
.confirm-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.confirm-actions button.danger { background: var(--error); border-color: var(--error); color: #fff; }
/* A checkbox and its words on one line, inside a row of settings. */
label.inline { display: inline-flex; flex-direction: row; gap: .4rem; align-items: center; }
/* One's own realms on the settings page. */
ul.own-realms { margin: .3rem 0; padding-left: 1.2rem; }
ul.own-realms li { margin: .2rem 0; }
/* Attaching a document to a question. */
.attach { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; margin-top: .35rem; padding: .35rem .2rem 0; border-top: 1px solid var(--line); }
.attach label { cursor: pointer; flex-direction: row; }
input.hidden-file { display: none; }
.attach .plan-links { display: inline-flex; gap: .8rem; margin-left: auto; }
.attach .plan-links button { display: inline-flex; align-items: center; gap: .3rem; font-weight: 500; }
.attached { color: var(--muted); }

@media (max-width: 40rem) {
    main.page { padding: 1.2rem 1rem 3rem; }
    .topbar { padding: 0 1rem; }
    .topbar .brand .organisation, .topbar .brand-name { display: none; }
    .topbar nav a.section { padding: 0 .5rem; }
    .model-card { flex-direction: column; align-items: stretch; gap: .8rem; }
    .model-card .model-actions { flex-wrap: wrap; }
    /* On a phone (the installed app): a row of actions wraps, and a table wider than the screen scrolls inside its own card
       rather than pushing the whole page sideways. Not the data editor's grid, whose box already scrolls with its header held. */
    .actions { flex-wrap: wrap; }
    .actions { max-width: 100%; }
    .actions select { max-width: calc(100vw - 2rem); }
    table.grid:not(.grid-scroll table) { display: block; max-width: 100%; overflow-x: auto; }
}

/* A conversation not yet begun. */
.welcome { display: flex; flex-direction: column; align-items: center; gap: .8rem; padding: 4rem 1rem 2rem; color: var(--muted); }
.welcome p { margin: 0; font-size: 1.25rem; font-weight: 600; color: var(--ink); }
.attach label { color: var(--accent); font-weight: 500; }
.attach label::before { content: "\1F4CE"; margin-right: .3rem; }
.crumbs { display: flex; gap: 1rem; font-size: .875rem; }

/* ---- every page ------------------------------------------------------------- */

/* The links above a page's title (back to the model, its other pages): a row of small ones. */
.page-head > div > a.link { display: inline-block; margin: 0 1rem .35rem 0; font-size: .875rem; }

/* A table sits on a card of its own, header shaded, rows divided, the last row open. */
table.grid { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
table.grid tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }
table.grid td.num, table.grid th.num, .num { text-align: right; font-variant-numeric: tabular-nums; }
/* Inside a card or a panel a table needs no second card. */
.card table.grid, .overlay table.grid, .proposal table.grid, .change table.grid, aside table.grid { box-shadow: none; }

/* What a solve or a plan came to, as a coloured word. */
.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; background: var(--surface); color: var(--muted); white-space: nowrap; }
.pill.good { background: var(--ok-soft); color: var(--ok); }
.pill.fair { background: var(--brand-soft); color: var(--brand-ink); }
.pill.poor { background: var(--error-soft); color: var(--error); }
.pill.busy { background: var(--warning-soft); color: var(--warning); }

/* A row of controls and buttons under a section: spaced, wrapping, lined up on their bottoms. */
section > .actions, div.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; margin: .7rem 0; }
.page-head div.actions { margin: 0; }
/* How a solve is getting on, and what its plan came to. */
p.job-state, p.plan-summary { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .6rem 0; }
.job-state .muted { margin-left: -.25rem; }
.page-head p .pill { margin-right: .35rem; vertical-align: 1px; }
/* Each of one's settings on a card of its own. */
section.settings { max-width: 52rem; margin-bottom: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; box-shadow: var(--shadow-sm); }
section.settings h2 { margin-top: 0; }
@media (max-width: 40rem) {
    /* On a phone the sections scroll sideways rather than run under the account button, and the role is in its menu. */
    .topbar { gap: .5rem; }
    .topbar nav { overflow-x: auto; scrollbar-width: none; }
    .topbar nav::-webkit-scrollbar { display: none; }
    .topbar nav a.section { white-space: nowrap; font-size: .85rem; }
    .topbar .role-badge { display: none; }
    .brand { margin-right: .25rem; }
}

/* ---- the data grid ----------------------------------------------------------- */

/* A spreadsheet: as wide as its columns (each sized to what it holds, by the page), scrolling sideways on its own
   when wider than the page, with cells whose controls show no box until pointed at or edited. */
/* No taller than the window under the bar, so its sideways scrollbar is always in reach rather than under the last row;
   the header row and the id column stay put while it scrolls. */
.grid-scroll { overflow: auto; max-width: 100%; max-height: calc((100vh - 5.5rem) * .8); border-radius: var(--radius); }
table.grid.data thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); }
table.grid.data th:first-child, table.grid.data td:first-child { position: sticky; left: 0; z-index: 2; background: var(--card); box-shadow: 1px 0 0 var(--line); }
table.grid.data thead th:first-child { z-index: 4; background: var(--surface); }
table.grid.data tbody tr:hover td:first-child { background: var(--surface); }
table.grid.data tr.added td:first-child { background: var(--added); }
table.grid.data tr.changed td:first-child { background: var(--highlight); }
table.grid.data { width: max-content; min-width: 0; font-size: .85rem; }
table.grid.data th { padding: .45rem .55rem; white-space: nowrap; border-right: 1px solid var(--line); }
table.grid.data td { padding: 0; border-right: 1px solid var(--line); vertical-align: middle; }
table.grid.data th:last-child, table.grid.data td:last-child { border-right: 0; }
table.grid.data td:first-child { padding: 0 .6rem; white-space: nowrap; }
table.grid.data td:first-child strong { font-weight: 600; font-variant-numeric: tabular-nums; }
table.grid.data td:last-child { padding: 0 .2rem; }
table.grid.data tbody tr:hover td { background: color-mix(in srgb, var(--surface) 70%, transparent); }
table.grid.data td input:not([type=checkbox]), table.grid.data td select, table.grid.data td details.multi > summary {
    /* No width of its own (a control asks for about twenty characters, whatever it holds), so the column's, set from
       what it holds, is the one that counts; then it fills it. */
    width: 0; min-width: 100%; max-width: none; height: 2rem; padding: .25rem .55rem; font-size: .85rem;
    border: 1px solid transparent; border-radius: 0; background: transparent; box-shadow: none;
}
table.grid.data td details.multi { display: block; width: 0; min-width: 100%; }
table.grid.data td details.multi > summary { display: flex; align-items: center; }
table.grid.data td details.multi > summary::after { top: .4rem; }
table.grid.data td input:not([type=checkbox]):hover, table.grid.data td select:hover, table.grid.data td details.multi > summary:hover { border-color: var(--line-strong); background: var(--field); }
table.grid.data td input:focus, table.grid.data td select:focus { border-color: var(--brand); background: var(--field); box-shadow: inset 0 0 0 1px var(--brand); position: relative; z-index: 1; }
table.grid.data td input[type=checkbox] { display: block; margin: 0 auto; }
table.grid.data td fieldset.view-only:disabled input, table.grid.data td fieldset.view-only:disabled select { background: transparent; }
table.grid.data tr.added td, table.grid.data tr.added:hover td { background: var(--added); }
table.grid.data tr.changed td, table.grid.data tr.changed:hover td { background: var(--highlight); }
table.grid.data td button.ghost { padding: .3rem .4rem; }

@media (prefers-color-scheme: dark) {
    .tab-kind.resource { color: #8cc4f0; }
    .tab-kind.reference { color: #e3be6e; }
}
/* A grid's headers are the attributes' own names, as written: no capitals added, which only made them longer. */
table.grid.data th { text-transform: none; letter-spacing: 0; font-size: .78rem; color: var(--muted); }
/* Which page of a long list is shown. */
.pager { display: flex; align-items: center; gap: .4rem 1rem; flex-wrap: wrap; margin: .4rem 0; }
.row.filter .pager { margin: 0 0 0 auto; }
.pager-buttons { display: inline-flex; align-items: center; gap: .15rem; }
.pager-buttons button { padding: .2rem .55rem; font-size: .95rem; line-height: 1.2; }
.pager select { padding: .2rem .4rem; font-size: .8rem; }

/* ---- notifications and scheduled tasks ------------------------------------------------------------------------- */
/* The bell in the bar: the person's notifications, with how many are unread. */
.bell { position: relative; display: inline-flex; align-items: center; color: var(--muted); padding: .3rem; border-radius: 8px; text-decoration: none; }
.bell .count[hidden], .who .link[hidden] { display: none; }
.bell:hover, .bell.active { color: var(--brand); background: var(--brand-soft); }
.bell .count { position: absolute; top: -.2rem; right: -.35rem; min-width: 1.05rem; height: 1.05rem; padding: 0 .25rem; border-radius: 999px; background: var(--error); color: #fff; font-size: .65rem; font-weight: 700; line-height: 1.05rem; text-align: center; }

.notification-head { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; cursor: pointer; }
.notification .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--brand); align-self: center; }
.notification.unread { border-left: 3px solid var(--brand); }
.notification.failed { border-left: 3px solid var(--error); }
.notification .answer { margin-top: .6rem; max-width: 60rem; line-height: 1.55; }
/* A report read as a document: sections ruled off, tables lined and striped, numbers kept in their columns. */
.notification .answer > :first-child { margin-top: 0; }
.notification .answer h1, .notification .answer h2 { font-size: 1.05rem; color: var(--ink); margin: 1.4rem 0 .5rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); text-transform: none; letter-spacing: 0; }
.notification .answer h3 { font-size: .95rem; color: var(--brand); margin: 1.1rem 0 .4rem; text-transform: none; letter-spacing: 0; }
.notification .answer p { margin: 0 0 .6rem; }
.notification .answer ul, .notification .answer ol { margin: 0 0 .8rem; padding-left: 1.3rem; }
.notification .answer li { margin: .15rem 0; }
.notification .answer table { border-collapse: collapse; margin: .5rem 0 1rem; font-size: .875rem; width: 100%; display: block; overflow-x: auto; }
.notification .answer th, .notification .answer td { border: 1px solid var(--line); padding: .35rem .65rem; text-align: left; vertical-align: top; }
.notification .answer th { background: var(--surface); font-weight: 600; white-space: nowrap; }
.notification .answer tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface) 45%, transparent); }
.notification .answer hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.notification .actions { display: flex; gap: .75rem; align-items: center; margin-top: .5rem; }

.task-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.task-top .actions { display: flex; gap: .4rem; align-items: center; }
.task-top .pill { margin-left: .4rem; }
.task-question { margin: .5rem 0; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.task-form { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.task-form .task-when { display: flex; gap: .8rem; flex-wrap: wrap; }
.task-form .weekdays { display: flex; gap: .8rem; flex-wrap: wrap; }
.task-form .actions { display: flex; gap: .5rem; }

/* ---- a plan as one day by resource (PlanTimeline) --------------------------------------------- */
.view-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.view-switch button { border: 0; border-radius: 0; background: var(--card); }
.view-switch button.on { background: var(--brand); color: var(--on-brand); }
.timeline-tools { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem 1.2rem; margin-top: .8rem; }
.timeline-tools label { flex-direction: row; align-items: center; gap: .4rem; }
.timeline-tools select { width: auto; }
.timeline-wrap { display: flex; gap: .8rem; margin-top: .6rem; align-items: flex-start; }
.timeline {
    --lane: 44px; flex: 1 1 auto; min-width: 0; overflow: auto;
    /* No taller than the window, so its sideways scrollbar is always in reach; the hours stay on top as it scrolls. */
    max-height: max(16rem, calc(100vh - 19rem));
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
}
.tl-row { display: flex; min-width: calc(11rem + var(--hours) * 7.5rem); border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-name {
    flex: 0 0 11rem; position: sticky; left: 0; z-index: 3; background: var(--card);
    padding: .3rem .5rem; border-right: 1px solid var(--line); font-size: .85rem;
    display: flex; flex-direction: column; justify-content: center; overflow: hidden;
}
.tl-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.tl-track { position: relative; flex: 1 1 auto; height: calc(var(--lanes, 1) * var(--lane) + 6px); }
/* A resource with a rota is shaded where it does not work that day; its hours are drawn back in white. */
.tl-track.has-hours { background: color-mix(in srgb, var(--line) 55%, var(--card)); }
.tl-on { position: absolute; top: 0; bottom: 0; background: var(--card); }
.tl-line { position: absolute; top: 0; bottom: 0; border-left: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); z-index: 0; }
.tl-head { position: sticky; top: 0; z-index: 5; background: var(--card); }
.tl-head .tl-track { height: 1.8rem; }
.tl-hour { position: absolute; top: .35rem; font-size: .72rem; color: var(--muted); transform: translateX(-50%); }
.tl-hour:first-child { transform: none; padding-left: .2rem; }
.tl-away {
    position: absolute; top: 0; bottom: 0; z-index: 1; overflow: hidden;
    background: repeating-linear-gradient(45deg, var(--surface) 0 6px, var(--card) 6px 12px);
    border-left: 2px solid var(--line-strong); border-right: 2px solid var(--line-strong);
    font-size: .72rem; color: var(--muted); display: flex; align-items: center; justify-content: flex-start; padding-left: .5rem; white-space: nowrap;
}
.tl-work {
    position: absolute; height: calc(var(--lane) - 4px); z-index: 2; cursor: pointer; overflow: hidden;
    border-radius: 4px; border: 1px solid color-mix(in srgb, var(--colour) 55%, var(--card));
    border-left: 4px solid var(--colour); background: color-mix(in srgb, var(--colour) 16%, var(--card));
    padding: .15rem .35rem; font-size: .72rem; line-height: 1.25; display: flex; flex-direction: column;
}
.tl-work strong, .tl-work span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-work span { color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-work:hover { outline: 2px solid var(--colour); z-index: 4; }
.tl-travel {
    position: absolute; height: calc(var(--lane) - 4px); z-index: 2; border-radius: 4px 0 0 4px;
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--colour) 35%, var(--card)) 0 4px, var(--card) 4px 8px);
}
.tl-undone { flex: 0 0 15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: .6rem; max-height: 70vh; overflow-y: auto; }
.tl-undone h3 { margin: 0 0 .5rem; font-size: .95rem; }
.tl-card {
    border-left: 4px solid var(--colour); background: var(--card); border-radius: 4px;
    padding: .35rem .5rem; margin-bottom: .4rem; font-size: .8rem; display: flex; flex-direction: column; gap: .1rem;
}
@media (max-width: 800px) {
    .timeline-wrap { flex-direction: column; }
    .tl-undone { flex-basis: auto; width: 100%; max-height: none; }
    .tl-name { flex-basis: 7.5rem; }
    .tl-row { min-width: calc(7.5rem + var(--hours) * 3.5rem); }
}

/* A password box with its eye (PasswordField): the eye sits inside the box, at its end. */
.password-field { position: relative; display: block; }
.password-field input { padding-right: 2.6rem; }
.password-field button.reveal { position: absolute; top: 50%; right: .35rem; transform: translateY(-50%); padding: .25rem .4rem; border: none; background: none; box-shadow: none; color: var(--muted); line-height: 0; }
.password-field button.reveal:hover { color: var(--ink); }
.password-field button.reveal[aria-pressed="true"] { color: var(--accent); }

/* Charts the assistant asks for (Charts/ChartSvg): the data-viz reference palette, validated for colour blindness in this
   order, light and dark; text in ink, never in a series colour; the surface is the card the chart sits on. */
:root {
    --chart-primary: var(--ink);
    --chart-secondary: #52514e;
    --chart-muted: #898781;
    --chart-grid: #e1e0d9;
    --chart-axis: #c3c2b7;
    --chart-surface: var(--card);
    --chart-s1: #2a78d6; --chart-s2: #eb6834; --chart-s3: #1baf7a; --chart-s4: #eda100;
    --chart-s5: #e87ba4; --chart-s6: #008300; --chart-s7: #6250d6; --chart-s8: #e34948;
}
@media (prefers-color-scheme: dark) {
    :root {
        --chart-secondary: #c3c2b7;
        --chart-grid: #2c2c2a;
        --chart-axis: #383835;
        --chart-s1: #3987e5; --chart-s2: #d95926; --chart-s3: #199e70; --chart-s4: #c98500;
        --chart-s5: #d55181; --chart-s6: #008300; --chart-s7: #9085e9; --chart-s8: #e66767;
    }
}
.chart-figure { margin: .6rem 0 1rem; max-width: 640px; }
svg.chart { display: block; width: 100%; height: auto; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
svg.chart text { font-variant-numeric: tabular-nums; }
.chart-data { margin-top: .2rem; font-size: .8rem; color: var(--muted); }
.chart-data summary { cursor: pointer; width: fit-content; }
.chart-data table { margin-top: .4rem; }
/* The activity page: its filters in one row, each line's time on one. */
.activity-filters { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.activity-filters label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--muted); }
.activity-filters select, .activity-filters input { width: auto; min-width: 10rem; }
table.activity td { vertical-align: top; }
table.activity td.when { white-space: nowrap; color: var(--muted); }
table.activity td.what code { font-size: .8rem; word-break: break-all; }

/* ---- public site ---------------------------------------------------------- */

/* What someone not signed in sees (Components/Public): the same palette, wider type, no circuit. */
.site-bar { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.4) blur(8px); }
.site-bar-inner, .site-wrap, .site-footer-inner { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.site-bar-inner { display: flex; align-items: center; gap: 1.5rem; height: 3.75rem; }
.site-bar .brand { margin-right: 0; }
.site-nav { display: flex; gap: 1.25rem; font-size: .9rem; }
.site-nav a { color: var(--muted); font-weight: 550; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-bar-end { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.site-bar-end .btn { white-space: nowrap; }

main.site { display: block; }
.site h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.12; letter-spacing: -.025em; font-weight: 700; margin: .4rem 0 1rem; }
.site h3 { font-size: 1.02rem; margin: .6rem 0 .35rem; }
.site p { margin: 0 0 .6rem; }
.site-h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 700; color: var(--ink); text-transform: none; margin: .25rem 0 .8rem; }
.site-eyebrow, .site-kicker { font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0; }
.site-lead { font-size: 1.08rem; color: var(--muted); line-height: 1.6; }
.site-lead.narrow { max-width: 44rem; }
.site-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.6rem; }
.btn.site-btn { font-size: .95rem; padding: .65rem 1.15rem; }

.site-section { padding: 4.5rem 0; scroll-margin-top: 3.75rem; }
.site-tinted { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.site-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3.5rem; align-items: center; }

/* The hero, with a made-up conversation beside it. */
.site-hero { padding: 4.5rem 0 3.5rem; background: radial-gradient(60rem 30rem at 85% -10%, var(--brand-soft), transparent 70%); }
.site-hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3.5rem; align-items: center; }
.site-chat, .site-round { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 1.1rem; }
.site-chat-head { display: flex; align-items: center; gap: .5rem; padding-bottom: .8rem; margin-bottom: .9rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.site-msg { max-width: 92%; margin-bottom: .75rem; font-size: .9rem; }
.site-msg p { margin: 0; padding: .6rem .8rem; border-radius: 12px; }
.site-msg-who { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); margin: 0 .2rem .2rem; }
.site-msg-you { margin-left: auto; text-align: right; }
.site-msg-you p { background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 4px; text-align: left; }
.site-msg-ai p { background: var(--surface); border-bottom-left-radius: 4px; }
.site-proposal { margin-top: .6rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); overflow: hidden; }
.site-proposal-head { padding: .45rem .75rem; background: var(--brand-soft); color: var(--brand-ink); font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.site-proposal ul { list-style: none; margin: 0; padding: .5rem .75rem; font-size: .85rem; }
.site-proposal li { display: flex; align-items: center; gap: .5rem; padding: .15rem 0; }
.site-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }
.site-dot.away { background: var(--warning); }
.site-proposal-actions { display: flex; gap: .5rem; padding: 0 .75rem .7rem; }
.site-proposal-actions .btn { cursor: default; font-size: .8rem; padding: .35rem .8rem; }

/* What the assistant does. */
.site-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; margin-top: 2rem; }
.site-feature, .site-example { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; box-shadow: var(--shadow-sm); }
.site-feature p, .site-example p { color: var(--muted); font-size: .92rem; margin: 0; }
.site-feature-icon { display: inline-flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); }

/* The boundary: it proposes, a person applies. */
.site-safety { background: var(--brand-soft); }
.site-safety .site-lead { color: var(--ink); opacity: .85; }
.site-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.site-checks li { display: flex; gap: .75rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; }
.site-checks li .site-icon { flex: 0 0 auto; color: var(--accent); margin-top: .05rem; }
.site-checks.plain { margin-top: 1.2rem; }
.site-checks.plain li { background: none; border: none; padding: .2rem 0; }

/* A replan waiting for the people it changes. */
.site-round-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.site-round-row { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.site-round-note { margin: .8rem 0 0 !important; color: var(--muted); font-size: .85rem; }
.site-avatar { width: 2rem; height: 2rem; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 650; font-size: .85rem; }
.site-pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.site-pill .site-icon { width: 14px; height: 14px; }
.site-pill.done { background: var(--ok-soft); color: var(--ok); }
.site-pill.waiting { background: var(--warning-soft); color: var(--warning); }

/* How it works, as numbered steps. */
.site-steps { list-style: none; counter-reset: step; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.site-steps li { counter-increment: step; border-top: 2px solid var(--brand); padding-top: 1rem; }
.site-steps li::before { content: counter(step, decimal-leading-zero); font-weight: 700; color: var(--accent); font-size: .85rem; letter-spacing: .05em; }
.site-steps p { color: var(--muted); font-size: .92rem; }

.site-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; margin-top: 2rem; }
.site-example { border-top: 3px solid var(--brand); }

/* The app, in a phone drawn with CSS. */
.site-phone { margin: 0 auto; width: 17rem; padding: .7rem; border-radius: 2.2rem; background: #20242b; border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); }
.site-phone-screen { background: var(--bg); border-radius: 1.6rem; padding: 2.2rem .9rem 1.4rem; min-height: 25rem; display: flex; flex-direction: column; justify-content: flex-end; }
.site-phone-notice { display: flex; gap: .55rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .7rem; font-size: .8rem; box-shadow: var(--shadow); margin-bottom: auto; }
.site-phone-notice .site-icon { flex: 0 0 auto; width: 18px; height: 18px; color: var(--accent); }
.site-phone .site-msg { font-size: .85rem; }

.site-cta { text-align: center; }
.site-cta .site-lead { margin: 0 auto 1.4rem; }

.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; }
.site-footer-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-footer-end { margin-left: auto; display: flex; align-items: center; gap: 1rem; font-size: .85rem; }

@media (max-width: 60rem) {
    .site-nav { display: none; }
    .site-hero-grid, .site-split { grid-template-columns: 1fr; gap: 2.5rem; }
    .site-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 40rem) {
    .site-bar-inner, .site-wrap, .site-footer-inner { padding: 0 1rem; }
    .site-bar-inner { gap: .75rem; }
    .site-bar-end { gap: .6rem; }
    .site-bar .brand-name { display: none; }
    .site-hero { padding: 2.5rem 0 2.5rem; }
    .site-section { padding: 3rem 0; }
    .site-steps { grid-template-columns: 1fr; }
    .site-msg { max-width: 100%; }
    .site-footer-end { margin-left: 0; }
}

/* The form that asks for an invitation, on the account pages' card. */
.site-actions.center { justify-content: center; margin-top: 0; }
.site-invite-card { margin: 0 auto; }
.site-invite-card h1 { font-size: 1.6rem; }
.account textarea { width: 100%; padding: .55rem .7rem; font: inherit; }
.site-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.try-phone { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: .5rem; }
.try-phone label { margin: 0; }
.try-phone select { width: 100%; }
@media (max-width: 480px) { .try-phone { grid-template-columns: 1fr; } }

/* Screenshots of the plan's calendar and map. */
.site-shots { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.5rem; margin: 2rem 0 1rem; align-items: start; }
.site-shot { margin: 0; }
.site-shot img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: #fff; }
.site-shot figcaption { margin-top: .75rem; color: var(--muted); font-size: .9rem; }
@media (max-width: 60rem) { .site-shots { grid-template-columns: 1fr; } }
.site-shot a { display: block; }

/* ---- public site: legal pages ------------------------------------------------------------------------------------ */
.site-legal-text { max-width: 46rem; margin: 0 auto; line-height: 1.65; }
.site-legal-text h1 { font-size: 2rem; margin: 0 0 .25rem; }
.site-legal-text h2 { font-size: 1.15rem; font-weight: 650; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 2rem 0 .5rem; }
.site-legal-text ul { padding-left: 1.25rem; }
.site-legal-text li { margin: .3rem 0; }
.site-legal-text table { width: 100%; border-collapse: collapse; margin: .75rem 0 1rem; font-size: .92rem; display: block; overflow-x: auto; }
.site-legal-text th, .site-legal-text td { text-align: left; vertical-align: top; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.site-legal-text th { background: var(--surface); font-weight: 600; }
.site-legal-text code { font-size: .85em; overflow-wrap: anywhere; }
.site-cookie-declaration { margin-top: 1.5rem; overflow-x: auto; }
.site-legal-links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.site-legal-links a { color: var(--muted); }
.site-legal-links a:hover { color: var(--brand); }

/* ---- the public demo (DemoSite) ---- */
/* Under the bar, on every page a guest of the demo sees: what it is, and the way to have it for real. */
.demo-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1rem; padding: .5rem 1rem;
    background: var(--warning-soft); border-bottom: 1px solid var(--line); color: var(--ink); font-size: .9rem; text-align: center; }
.demo-banner .btn { padding: .25rem .75rem; font-size: .85rem; }
/* In the installed app, once: notifications a tap away (js/pwa.js shows it). */
.push-prompt { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1rem; padding: .6rem 1rem; background: var(--brand-soft); color: var(--brand-ink); border-bottom: 1px solid var(--line); font-size: .9rem; }
.push-prompt button { padding: .3rem .85rem; font-size: .85rem; }
.push-prompt[hidden] { display: none; }
.demo-admin .demo-models { list-style: none; padding: 0; margin: .25rem 0; display: grid; gap: .25rem; }
.demo-admin .demo-models li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.demo-admin label.inline { display: flex; align-items: center; gap: .5rem; margin: 0; }
.demo-admin .demo-language { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .75rem; }
.demo-admin .demo-language h3 { margin-top: 0; }
@media (max-width: 40rem) { .site-bar-end .site-bar-try { display: none; } }

/* An example's own page (ExamplePage): the problem, then a screenshot per section beside what it shows. */
a.site-example { display: flex; flex-direction: column; gap: .5rem; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.site-example:hover { text-decoration: none; box-shadow: var(--shadow-md, 0 6px 18px rgba(0,0,0,.08)); transform: translateY(-1px); }
a.site-example h3 { margin: 0; }
.site-example-more { margin-top: auto; color: var(--brand); font-weight: 600; font-size: .9rem; }
.site-example-hero h1 { margin-top: .25rem; }
.site-example-problem { max-width: 46rem; margin: 0 auto; line-height: 1.65; }
.site-example-problem h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 700; color: var(--ink); text-transform: none; margin: .25rem 0 .9rem; }
.site-example-problem ul { padding-left: 1.25rem; }
.site-example-problem li { margin: .35rem 0; }
.site-example-problem h3 { font-size: 1.1rem; font-weight: 650; color: var(--ink); margin: 1.4rem 0 .35rem; }
.site-example-shot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: 2.5rem; align-items: center; }
.site-shot { margin: 0; }
.site-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); background: var(--card); }
.site-example-others { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: center; margin-top: 1.75rem; font-size: .95rem; }
@media (max-width: 900px) {
    .site-example-shot { grid-template-columns: 1fr; gap: 1.25rem; }
}
