/* entrycode.uk's type (docs/design/calmer-layout-brief-2026-10-24.md): Archivo for
   body text, Fraunces for headings, both self-hosted in wwwroot/fonts. Body text 16px,
   line height 1.5, nothing smaller than 13px anywhere. */
html, body {
    font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
}

small, .small, .form-text, .badge, .btn-sm, .table-sm, .dropdown-item {
    font-size: max(0.8125rem, 0.875em);
}

code, kbd {
    font-size: max(0.8125rem, 0.875em);
}

.badge {
    font-size: 0.8125rem;
    font-weight: 600;
}

/* Status colours, the same in every Skeillebank app: green = done/paid/confirmed,
   amber = waiting or needs attention, red = overdue/failed, blue = information, grey =
   neutral. For status only, never decoration. Use <StatusBadge>. Each pair keeps text
   contrast at 4.5:1 or better, in light and dark mode. */
:root, [data-bs-theme=light] {
    --status-success-bg: #d6f0dd; --status-success-fg: #11592b;
    --status-attention-bg: #fdecc8; --status-attention-fg: #6b4300;
    --status-problem-bg: #f9d7d9; --status-problem-fg: #8a1622;
    --status-info-bg: #d8e8fb; --status-info-fg: #123f7a;
    --status-neutral-bg: #e6e6e9; --status-neutral-fg: #3a3a42;
}

[data-bs-theme=dark] {
    --status-success-bg: #163d24; --status-success-fg: #8fe0a8;
    --status-attention-bg: #45330f; --status-attention-fg: #fcd27c;
    --status-problem-bg: #4a1a1f; --status-problem-fg: #ffadb4;
    --status-info-bg: #16304f; --status-info-fg: #a9cdf7;
    --status-neutral-bg: #2f3036; --status-neutral-fg: #d4d4da;
}

.status { white-space: normal; text-align: left; }
.status-success { background-color: var(--status-success-bg); color: var(--status-success-fg); }
.status-attention { background-color: var(--status-attention-bg); color: var(--status-attention-fg); }
.status-problem { background-color: var(--status-problem-bg); color: var(--status-problem-fg); }
.status-info { background-color: var(--status-info-bg); color: var(--status-info-fg); }
.status-neutral { background-color: var(--status-neutral-bg); color: var(--status-neutral-fg); }

/* Money, times and counts that line up in tables. */
.table td, .table th, .tabular { font-variant-numeric: tabular-nums; }

/* Tap targets at least 44px tall on phones and touch screens. */
@media (max-width: 640.98px), (pointer: coarse) {
    .btn, .btn-sm, .form-control, .form-select, .nav-link, .page-link, .list-group-item-action {
        min-height: 44px;
    }

    .btn, .btn-sm {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .form-check-input {
        width: 1.5em;
        height: 1.5em;
    }

    .form-check {
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .form-check .form-check-input {
        float: none;
        margin-left: 0;
        margin-top: 0;
        flex-shrink: 0;
    }
}

/* Ink, paper and brass, as on entrycode.uk (docs/design/calmer-layout-brief-2026-10-24.md):
   ink text on a paper page, white cards, brass buttons with ink text. The gold pop
   (.pop) marks counts, "New" badges, new dots and, since 4 Nov 2026 (voice.md, "Colour
   follows the moment"), the good moments: .moment below. Never a button, and never a status.
   Bootstrap 5.3 bakes each component's colours into its own local custom properties, so
   the buttons below set those tokens rather than a plain background-color, or the
   hover/active states fall back to Bootstrap's stock blue. */
:root, [data-bs-theme=light] {
    --ec-ink: #12141C;
    --ec-muted: #5B6270;
    --ec-paper: #F5F3EC;
    --ec-surface: #FFFFFF;
    --ec-line: #D9D7D0;
    --ec-brass: #B08D3E;
    --ec-pop: #F2B84B;
    --bs-body-color: var(--ec-ink);
    --bs-body-color-rgb: 18, 20, 28;
    --bs-body-bg: var(--ec-paper);
    --bs-body-bg-rgb: 245, 243, 236;
    --bs-secondary-color: var(--ec-muted);
    --bs-tertiary-bg: var(--ec-surface);
    --bs-border-color: var(--ec-line);
    --bs-heading-color: var(--ec-ink);
    /* Brass itself is too light for text on paper (2.9:1): links use a deeper brass. */
    --bs-link-color: #7A5F22;
    --bs-link-color-rgb: 122, 95, 34;
    --bs-link-hover-color: #5F4A1A;
    --bs-link-hover-color-rgb: 95, 74, 26;
}

[data-bs-theme=dark] {
    --ec-ink: #F5F3EC;
    --ec-muted: #C7C2B4;
    --ec-paper: #12141C;
    --ec-surface: #1C1F2A;
    --ec-line: #3A3D47;
    --bs-body-color: var(--ec-ink);
    --bs-body-color-rgb: 245, 243, 236;
    --bs-body-bg: var(--ec-paper);
    --bs-body-bg-rgb: 18, 20, 28;
    --bs-secondary-color: var(--ec-muted);
    --bs-tertiary-bg: var(--ec-surface);
    --bs-border-color: var(--ec-line);
    --bs-heading-color: var(--ec-ink);
    --bs-link-color: #D9B865;
    --bs-link-color-rgb: 217, 184, 101;
    --bs-link-hover-color: #E8CF8E;
    --bs-link-hover-color-rgb: 232, 207, 142;
}

a, .btn-link {
    color: var(--bs-link-color);
}

.card, .list-group-item, .modal-content, .dropdown-menu {
    --bs-card-bg: var(--ec-surface);
    --bs-list-group-bg: var(--ec-surface);
    --bs-modal-bg: var(--ec-surface);
    --bs-dropdown-bg: var(--ec-surface);
}

.btn-primary {
    --bs-btn-color: #12141C;
    --bs-btn-bg: #B08D3E;
    --bs-btn-border-color: #B08D3E;
    --bs-btn-hover-color: #12141C;
    --bs-btn-hover-bg: #C29E4E;
    --bs-btn-hover-border-color: #C29E4E;
    --bs-btn-focus-shadow-rgb: 176, 141, 62;
    --bs-btn-active-color: #12141C;
    --bs-btn-active-bg: #CFAE62;
    --bs-btn-active-border-color: #CFAE62;
    --bs-btn-disabled-color: #12141C;
    --bs-btn-disabled-bg: #B08D3E;
    --bs-btn-disabled-border-color: #B08D3E;
}

.btn-outline-primary {
    --bs-btn-color: var(--bs-link-color);
    --bs-btn-border-color: var(--ec-brass-line);
    --bs-btn-hover-color: #12141C;
    --bs-btn-hover-bg: #B08D3E;
    --bs-btn-hover-border-color: #B08D3E;
    --bs-btn-active-color: #12141C;
    --bs-btn-active-bg: #CFAE62;
    --bs-btn-active-border-color: #CFAE62;
    --bs-btn-disabled-color: var(--bs-link-color);
    --bs-btn-disabled-border-color: var(--ec-brass-line);
}

.border-primary {
    border-color: #B08D3E !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--bs-body-bg), 0 0 0 0.25rem #B08D3E;
}

.form-check-input:checked {
    background-color: #B08D3E;
    border-color: #B08D3E;
}

/* The gold pop: a count, a "New" badge, a dot, or a good moment (.moment). Always gold with ink text. */
.pop {
    background-color: var(--ec-pop);
    color: #12141C;
    font-weight: 600;
}

.pop-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--ec-pop);
}

/* A row's More: a small list that opens below it, no script needed. */
.more-menu {
    display: inline-block;
    position: relative;
}

.more-menu > summary {
    list-style: none;
}

.more-menu > summary::-webkit-details-marker {
    display: none;
}

.more-menu-items {
    position: absolute;
    right: 0;
    z-index: 10;
    min-width: 10rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--ec-surface);
    border: 1px solid var(--ec-line);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(18, 20, 28, 0.12);
}

/* .alert-info/.alert-warning default to Bootstrap's stock pale blue/yellow; warmed to
   sit on paper. Same local-custom-property pattern as the buttons above. */
[data-bs-theme=light] .alert-info {
    --bs-alert-color: #3A3420;
    --bs-alert-bg: #EFEADB;
    --bs-alert-border-color: #D9D0B4;
}

[data-bs-theme=light] .alert-warning {
    --bs-alert-color: #5C4813;
    --bs-alert-bg: #FBEACB;
    --bs-alert-border-color: #F0D189;
}

.content {
    padding-top: 1.1rem;
}

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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE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kgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Something went wrong on this page. Reload it to try again."
    }

.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;
}
/* Tick lists (voice.md, "Choosing several things", 31 Oct 2026), copied from iKveld's
   .kv-tick rules. On paper the circle uses a deeper brass (as entrycode.uk's --brass-dark),
   since --ec-brass is under 3:1 there; the tick is paper on it. The empty circle's
   outline is darker than --ec-line so it reads as something to tap. */
:root, [data-bs-theme=light] { --ec-tick-fill: #8F7130; --ec-tick-text: #F5F3EC; --ec-tick-line: #8C8A82; }
[data-bs-theme=dark] { --ec-tick-fill: #B08D3E; --ec-tick-text: #12141C; --ec-tick-line: #7A7D88; }
.ec-ticks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.ec-ticks.ec-ticks-one { grid-template-columns: minmax(0, 1fr); }
.ec-tick { display: flex; width: 100%; justify-content: flex-start; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; border: 0; background: none;
    color: var(--ec-ink); font: inherit; font-size: 0.9375rem; text-align: left; cursor: pointer; min-width: 0; }
.ec-tick-mark { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    border: 1.5px solid var(--ec-tick-line); border-radius: 50%; color: var(--ec-tick-text); }
.ec-tick-on .ec-tick-mark { border-color: var(--ec-tick-fill); background: var(--ec-tick-fill); }
.ec-tick-label { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.ec-tick-note { color: var(--ec-muted); font-size: 0.8em; }
.ec-tick:focus-visible { outline: 2px solid var(--ec-tick-fill); outline-offset: 2px; border-radius: 4px; }
.ec-tick:disabled { opacity: 0.4; cursor: default; }
.ec-tick-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; color: var(--ec-muted); }
.ec-tick-links button { padding: 4px 0; border: 0; background: none; color: var(--bs-link-color); font: inherit;
    font-size: 0.875rem; font-weight: 500; cursor: pointer; }
.ec-tick-links button:disabled { opacity: 0.4; cursor: default; }

/* Colour follows the moment (voice.md, 4 Nov 2026): the base stays calm, and the gold pop
   marks the highlights people remember: the ticket, "You're on the list", paid, sold out,
   everyone in, all done. Ration it to one .moment per screen. Ink text on the gold
   (about 10:1) in both themes; buttons inside it turn ink so they don't vanish into it. */
.moment { background-color: var(--ec-pop); color: #12141C; border-radius: 12px; padding: 1rem 1.25rem; }
.moment h1, .moment h2, .moment h3, .moment .h1, .moment .h2, .moment .h3 { color: inherit; margin-bottom: 0.25rem; }
.moment a:not(.btn) { color: inherit; text-decoration: underline; }
.moment .text-muted, .moment .moment-meta { color: #3B3220 !important; }
.moment .moment-meta { font-weight: 600; }
.moment .btn-primary { --bs-btn-color: #F5F3EC; --bs-btn-bg: #12141C; --bs-btn-border-color: #12141C;
    --bs-btn-hover-color: #F5F3EC; --bs-btn-hover-bg: #2A2D38; --bs-btn-hover-border-color: #2A2D38;
    --bs-btn-active-color: #F5F3EC; --bs-btn-active-bg: #2A2D38; --bs-btn-active-border-color: #2A2D38; }
.moment .btn-outline-primary { --bs-btn-color: #12141C; --bs-btn-border-color: #12141C;
    --bs-btn-hover-color: #F5F3EC; --bs-btn-hover-bg: #12141C; --bs-btn-hover-border-color: #12141C; }
/* The one dry line a good moment may carry: quieter than the fact before it. */
.moment-line { color: var(--ec-muted); font-style: italic; }
.moment .moment-line { color: #3B3220; }

/* Brass lines, frames and outline buttons (voice.md, 5 Nov 2026): on paper plain brass is
   only 2.8:1, so they use brass-dark (#8F7130, as entrycode.uk); on the dark page brass is fine. */
:root, [data-bs-theme=light] { --ec-brass-line: #8F7130; }
[data-bs-theme=dark] { --ec-brass-line: #B08D3E; }
.border-brass { border: 2px solid var(--ec-brass-line) !important; border-radius: 12px; }

/* A good moment never relies on colour alone (voice.md, 5 Nov 2026): it carries the tick.
   An ink circle with a gold tick, the same shape as the tick lists. Put it first in a .moment:
   <span class="moment-tick" aria-hidden="true"></span>. */
.moment-tick { display: inline-flex; flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 50%;
    background: #12141C; align-items: center; justify-content: center; vertical-align: middle; }
.moment-tick::after { content: ""; width: 1.25rem; height: 1.25rem; background: var(--ec-pop);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center / contain no-repeat; }
/* A small pop badge for a good moment in a list ("Full", "Everyone's in"): the tick comes with it. */
.pop-tick::before { content: "✓ "; font-weight: 700; }
