/* Flashlights portal styling.
   Every colour is a variable: the design system's tokens (css/flashlights.css)
   and the instance's accent (served at /theme.css from the environment, see
   portal/branding.py). Nothing here is a brand decision.

   The first section maps Bootstrap onto the tokens (Bootstrap
   stays for grid, collapse, dropdown, modal and forms, re-themed through its
   own variables). What follows is the portal's own components. */

/* ---- Bootstrap on the tokens ------------------------------------------- */

:root,
[data-bs-theme="light"] {
    --bs-font-sans-serif: var(--font-body);
    --bs-font-monospace: var(--font-mono);
    --bs-body-font-family: var(--font-body);
    --bs-body-font-size: var(--text-md);
    --bs-body-line-height: var(--leading-body);
    --bs-body-color: var(--text-body);
    --bs-body-color-rgb: 23, 23, 20;
    --bs-body-bg: var(--surface-page);
    --bs-emphasis-color: var(--text-strong);
    --bs-secondary-color: var(--text-muted);
    --bs-secondary-bg: var(--surface-sunken);
    --bs-tertiary-bg: var(--surface-sunken);
    --bs-heading-color: var(--text-strong);
    --bs-border-color: var(--border-subtle);
    --bs-border-width: var(--border-1);
    --bs-border-radius: var(--radius-md);
    --bs-border-radius-sm: var(--radius-sm);
    --bs-border-radius-lg: var(--radius-lg);
    --bs-border-radius-xl: var(--radius-lg);
    --bs-link-decoration: underline;
    /* Two-tone focus: accent halo inside a Night ring, visible on light and dark. */
    --bs-focus-ring-width: 2px;
    --bs-focus-ring-color: var(--focus-halo);
    /* Status colours carry the design system's ok, warn and stop. */
    --bs-success: var(--status-ok);
    --bs-success-rgb: 31, 138, 76;
    --bs-success-text-emphasis: var(--status-ok-ink);
    --bs-success-bg-subtle: var(--status-ok-bg);
    --bs-success-border-subtle: var(--status-ok);
    --bs-danger: var(--status-stop);
    --bs-danger-rgb: 208, 58, 34;
    --bs-danger-text-emphasis: var(--status-stop-ink);
    --bs-danger-bg-subtle: var(--status-stop-bg);
    --bs-danger-border-subtle: var(--status-stop);
    --bs-warning: var(--status-warn);
    --bs-warning-rgb: 224, 122, 16;
    --bs-warning-text-emphasis: var(--status-warn-ink);
    --bs-warning-bg-subtle: var(--status-warn-bg);
    --bs-warning-border-subtle: var(--status-warn);
    --bs-info: var(--night-600);
    --bs-info-rgb: 82, 79, 71;
    --bs-info-text-emphasis: var(--night-700);
    --bs-info-bg-subtle: var(--status-info-bg);
    --bs-info-border-subtle: var(--night-300);
    --bs-light: var(--surface-sunken);
    --bs-light-rgb: 238, 235, 227;
    --bs-secondary: var(--night-600);
    --bs-secondary-rgb: 82, 79, 71;
    --bs-secondary-text-emphasis: var(--night-700);
    --bs-secondary-bg-subtle: var(--night-100);
    --bs-secondary-border-subtle: var(--night-300);
}

body {
    font: var(--type-body);
    color: var(--text-body);
    background: var(--surface-page);
}

h1, h2, h3, .h1, .h2, .h3, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-display);
}

h1, .h1, .display-4 {
    font-weight: var(--weight-black);
}

h4, h5, h6, .h4, .h5, .h6 {
    font-family: var(--font-body);
    font-weight: var(--weight-bold);
}

code, kbd, pre, samp, .font-monospace {
    font-family: var(--font-mono);
}

/* Every focused control gets the same two-tone ring. */
.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
.page-link:focus-visible {
    outline: none;
    box-shadow: var(--ring-focus);
}

/* Buttons: radius 8, 2px borders, 44px tall; one important element per view
   gets the accent with a Night border. */
.btn {
    --bs-btn-border-width: var(--border-2);
    --bs-btn-border-radius: var(--radius-md);
    --bs-btn-font-weight: var(--weight-bold);
    --bs-btn-padding-y: 0.5rem;
    --bs-btn-padding-x: 1rem;
    min-height: var(--control-h-md);
    transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.btn-sm {
    min-height: var(--control-h-sm);
}

.btn-lg {
    min-height: var(--control-h-lg);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary,
.btn-dark {
    --bs-btn-bg: var(--night-950);
    --bs-btn-border-color: var(--night-950);
    --bs-btn-color: var(--paper);
    --bs-btn-hover-bg: var(--night-800);
    --bs-btn-hover-border-color: var(--night-800);
    --bs-btn-hover-color: var(--paper);
    --bs-btn-active-bg: var(--night-700);
    --bs-btn-active-border-color: var(--night-700);
    --bs-btn-active-color: var(--paper);
}

.btn-outline-secondary,
.btn-outline-dark {
    --bs-btn-color: var(--text-strong);
    --bs-btn-border-color: var(--night-950);
    --bs-btn-hover-bg: var(--night-950);
    --bs-btn-hover-border-color: var(--night-950);
    --bs-btn-hover-color: var(--paper);
    --bs-btn-active-bg: var(--night-950);
    --bs-btn-active-color: var(--paper);
}

.btn-light,
.btn-outline-light {
    --bs-btn-color: var(--paper);
    --bs-btn-border-color: var(--paper);
    --bs-btn-bg: transparent;
    --bs-btn-hover-bg: var(--paper);
    --bs-btn-hover-color: var(--night-950);
    --bs-btn-hover-border-color: var(--paper);
}

.btn-link {
    --bs-btn-color: var(--text-link);
    --bs-btn-hover-color: var(--text-link);
    --bs-btn-border-width: 0;
}

/* Controls: 2px borders, radius 8, 44px tall; focus is a Night border inside
   the accent halo. */
.form-control,
.form-select {
    --bs-border-width: var(--border-2);
    --bs-border-color: var(--border-default);
    --bs-border-radius: var(--radius-md);
    color: var(--text-body);
    background-color: var(--surface-card);
}

/* The addon beside a control (the @ before a handle, hours/week) takes the
   control's border, so the two sit flush. */
.input-group-text {
    --bs-border-width: var(--border-2);
    --bs-border-color: var(--border-default);
    --bs-border-radius: var(--radius-md);
}

/* The small variants (the schedule editor's switcher, the upload panel) and
   the controls in a small input group (the share page, the media files)
   keep Bootstrap's height and padding. */
.form-control:not(.form-control-sm):not(.input-group-sm > *),
.form-select:not(.form-select-sm):not(.input-group-sm > *) {
    min-height: var(--control-h-md);
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--night-950);
    background-color: var(--surface-card);
    color: var(--text-body);
}

.form-control.is-invalid,
.was-validated .form-control:invalid {
    border-color: var(--status-stop);
}

/* Forms (Input, Select, Checkbox, Switch specs). Labels bold and small,
   help text extra small and muted, an error bold in Stop 700 with its icon.
   The select draws its own Night chevron. */
.form-label {
    font: var(--weight-bold) var(--text-sm) / 1.3 var(--font-body);
    color: var(--text-strong);
    margin-bottom: 6px;
}

.form-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 0;
    resize: vertical;
}

.form-control::placeholder {
    color: var(--night-400);
}

.form-select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f0f0d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m6 9 6 6 6-6'/%3e%3c/svg%3e");
    background-size: 18px;
    background-position: right 12px center;
}

.invalid-feedback {
    font: var(--weight-bold) var(--text-xs) / 1.4 var(--font-body);
    color: var(--status-stop-ink);
    display: flex;
    align-items: center;
    gap: 5px;
}

.invalid-feedback::before {
    font-family: "lucide";
    font-weight: 400;
    content: "\e07b";
}

/* Checkbox: 22px, 2px Night border, radius 4; ticked is a Night box with an
   accent check. Radio: chosen is a Night disc with a Beam dot, the same fill
   as a ticked box, so the chosen answer reads at a glance. */
.form-check {
    padding-left: 2rem;
}

.form-check .form-check-input {
    width: 22px;
    height: 22px;
    margin-top: 1px;
    margin-left: -2rem;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background-color: var(--surface-card);
}

.form-check-label {
    color: var(--text-strong);
}

.form-check-input:checked[type="checkbox"] {
    background-color: var(--night-950);
    border-color: var(--night-950);
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd43b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M20 6 9 17l-5-5'/%3e%3c/svg%3e");
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:checked[type="radio"] {
    background-color: var(--night-950);
    border-color: var(--night-950);
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23ffd43b'/%3e%3c/svg%3e");
}

/* A checkbox or radio rendered without Bootstrap's classes (allauth's
   templates) draws the same box. */
input[type="checkbox"]:not(.form-check-input),
input[type="radio"]:not(.form-check-input) {
    appearance: none;
    width: 22px;
    height: 22px;
    vertical-align: -5px;
    margin-right: 6px;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-card) center / 100% no-repeat;
}

input[type="radio"]:not(.form-check-input) {
    border-radius: 50%;
}

input[type="checkbox"]:not(.form-check-input):checked {
    background-color: var(--night-950);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd43b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M20 6 9 17l-5-5'/%3e%3c/svg%3e");
}

input[type="radio"]:not(.form-check-input):checked {
    background-color: var(--night-950);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23ffd43b'/%3e%3c/svg%3e");
}

/* Switch: a 44 by 26 pill with a 2px Night border; the knob is Night, and
   on, the pill fills Night and the knob is a lit accent dot. */
.form-switch {
    padding-left: 3.25rem;
}

.form-switch .form-check-input {
    width: 44px;
    height: 26px;
    margin-left: -3.25rem;
    border-radius: 99px;
    background-position: left 3px center;
    background-size: 16px;
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='4' fill='%230f0f0d'/%3e%3c/svg%3e");
    transition: background-position var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}

.form-switch .form-check-input:checked {
    background-color: var(--night-950);
    border-color: var(--night-950);
    background-position: right 3px center;
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='4' fill='%23ffd43b'/%3e%3c/svg%3e");
    box-shadow: inset 0 0 0 0 transparent;
}

.form-switch .form-check-input:checked:not(:focus) {
    box-shadow: none;
}

/* Cards: white, 1px Night 200, radius 14. Borders over shadows. */
.card {
    --bs-card-bg: var(--surface-card);
    --bs-card-border-color: var(--border-subtle);
    --bs-card-border-radius: var(--radius-lg);
    --bs-card-inner-border-radius: calc(var(--radius-lg) - 1px);
    --bs-card-cap-bg: var(--surface-card);
    --bs-card-cap-color: var(--text-strong);
}

.card-header {
    font-weight: var(--weight-bold);
}

/* An interactive card lifts with the hard Night shadow. */
a.card {
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

a.card:hover {
    transform: translateY(-2px);
    border-color: var(--night-950);
    box-shadow: 0 3px 0 var(--night-950);
}

/* Badges and alerts: status always pairs colour with a word. */
.badge {
    --bs-badge-border-radius: var(--radius-sm);
    --bs-badge-font-weight: var(--weight-bold);
    font-family: var(--font-body);
}

.badge.text-bg-light,
.badge.bg-light {
    color: var(--text-strong) !important;
    border: 1px solid var(--border-subtle);
}

.badge.bg-secondary,
.badge.text-bg-secondary {
    background-color: var(--night-700) !important;
    color: var(--paper) !important;
}

/* Bootstrap picks each tone's text colour for its own palette (black on
   info, warning and light, white on the rest) and the tokens change the
   backgrounds under it. The text-bg-* utilities get a text colour that
   reads on the token background, on a badge, a card or a list item
   alike; a plain bg-* badge sets the badge's own text colour, so a text-*
   utility on the same badge still wins. WCAG AA (4.5:1) on every accent
   preset; a custom BRAND_PRIMARY's text-on-accent is only promised at
   3:1, so its primary tone can fall just short. */
.text-bg-primary {
    color: var(--text-on-accent) !important;
}

.badge.bg-primary {
    --bs-badge-color: var(--text-on-accent);
}

/* White reads on OK 700, not OK 500. Changing the tone's RGB rather than
   the background keeps the bg-opacity-* utilities working. */
.text-bg-success,
.badge.bg-success {
    --bs-success-rgb: 20, 92, 52;
}

.text-bg-info {
    color: var(--paper) !important;
}

/* An info badge (a volunteer application, a language, a sponsor's
   status, shared media) is outlined: Paper, a Night 600 edge and Night
   700 text, so it stands apart from the solid greys. The fill
   keeps --bs-bg-opacity, so bg-opacity-* still tints it. */
.badge.text-bg-info,
.badge.bg-info {
    background-color: rgba(247, 245, 239, var(--bs-bg-opacity, 1)) !important;
    border: 1px solid var(--night-600);
}

.badge.text-bg-info {
    color: var(--night-700) !important;
}

.badge.bg-info {
    --bs-badge-color: var(--night-700);
}

.text-bg-warning {
    color: var(--night-950) !important;
}

.badge.bg-warning {
    --bs-badge-color: var(--night-950);
}

/* Alerts (Alert spec): a tinted block with a 2px edge in the status colour
   and the status icon, so colour never stands alone. The beam tone is the
   event-wide announcement. */
.alert {
    --bs-alert-border-radius: var(--radius-md);
    --bs-alert-color: var(--night-950);
    border-width: 2px;
    padding-left: 3rem;
    position: relative;
}

.alert::before {
    font-family: "lucide";
    font-size: 20px;
    line-height: 24px;
    position: absolute;
    left: 1rem;
    top: 0.85rem;
}

.alert-info,
.alert-light,
.alert-secondary {
    --bs-alert-bg: var(--status-info-bg);
    --bs-alert-border-color: var(--night-950);
}

.alert-info::before,
.alert-light::before,
.alert-secondary::before {
    content: "\e0fe";
}

.alert-success {
    --bs-alert-bg: var(--status-ok-bg);
    --bs-alert-border-color: var(--status-ok);
}

.alert-success::before {
    content: "\e226";
}

.alert-warning {
    --bs-alert-bg: var(--status-warn-bg);
    --bs-alert-border-color: var(--status-warn);
}

.alert-warning::before {
    content: "\e193";
}

.alert-danger {
    --bs-alert-bg: var(--status-stop-bg);
    --bs-alert-border-color: var(--status-stop);
}

.alert-danger::before {
    content: "\e12b";
}

.alert-beam {
    --bs-alert-bg: var(--beam-300);
    --bs-alert-border-color: var(--night-950);
}

.alert-beam::before {
    content: "\e235";
}

.alert-dismissible .btn-close {
    filter: none;
}

/* Progress (Progress spec): an 8px Night 100 track with a Night fill; the
   Bootstrap tone classes keep their status colours. */
.progress {
    --bs-progress-height: 8px;
    --bs-progress-bg: var(--night-100);
    --bs-progress-border-radius: 99px;
    --bs-progress-bar-bg: var(--night-950);
    --bs-progress-bar-transition: width var(--dur-slow) var(--ease-out);
}

.progress-bar {
    border-radius: 99px;
}

/* Tables, list groups, dropdowns, pagination and pills on the neutrals. */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-body);
    --bs-table-border-color: var(--border-subtle);
    --bs-table-striped-bg: var(--surface-sunken);
    --bs-table-hover-bg: var(--night-100);
}

.list-group {
    --bs-list-group-border-color: var(--border-subtle);
    --bs-list-group-border-radius: var(--radius-lg);
    --bs-list-group-action-hover-bg: var(--surface-sunken);
}

.dropdown-menu {
    --bs-dropdown-border-color: var(--border-subtle);
    --bs-dropdown-border-radius: var(--radius-md);
    --bs-dropdown-link-hover-bg: var(--surface-sunken);
    --bs-dropdown-link-active-bg: var(--night-950);
    --bs-dropdown-link-active-color: var(--paper);
    box-shadow: var(--shadow-lg);
}

.pagination {
    --bs-pagination-color: var(--text-strong);
    --bs-pagination-border-color: var(--border-subtle);
    --bs-pagination-active-bg: var(--night-950);
    --bs-pagination-active-border-color: var(--night-950);
    --bs-pagination-hover-bg: var(--surface-sunken);
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--night-950);
    --bs-nav-pills-link-active-color: var(--paper);
    --bs-nav-pills-border-radius: var(--radius-md);
}

.nav-link {
    color: var(--text-strong);
}

/* Night surfaces: the navbar and footer carry the beam glow (effects.css),
   tinted by the accent. Text on Night is Paper. */
.navbar.bg-dark,
.footer.bg-dark {
    background-color: var(--surface-night) !important;
    background-image: var(--beam-glow);
    color: var(--text-on-night);
}

/* Navbar spec: 64px bar, hub tabs 64px tall with the glowing 4px accent
   underline on the current one, an edition chip in mono, the account as an
   avatar initial. The underline is only drawn at desktop width, where the
   tabs sit on the bar. */
.navbar.bg-dark {
    --bs-navbar-padding-y: 0;
    min-height: 64px;
}

.navbar-dark .navbar-nav .nav-link {
    color: var(--text-on-night-muted);
    font-weight: var(--weight-semibold);
    position: relative;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: var(--text-on-night);
}

.navbar-dark .navbar-nav .nav-link.active {
    font-weight: var(--weight-bold);
}

@media (min-width: 768px) {
    .navbar-dark .navbar-nav .nav-link {
        height: 64px;
        display: inline-flex;
        align-items: center;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .navbar-dark .navbar-nav .nav-link.active::after {
        content: "";
        position: absolute;
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0;
        height: 4px;
        border-radius: 4px 4px 0 0;
        background: var(--accent);
        box-shadow: 0 -4px 14px 2px rgba(var(--accent-rgb), 0.45);
    }
}

.edition-chip {
    font: var(--weight-semibold) 12px/1 var(--font-mono);
    padding: 4px 7px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--night-600);
    color: var(--night-200);
}

.avatar-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--night-800);
    border: 2px solid var(--accent);
    color: var(--paper);
    font: var(--weight-bold) 13px/1 var(--font-body);
    flex-shrink: 0;
}

/* A long username stays on one line inside the 64px bar, cut with an
   ellipsis. Inline-block so the cut also applies below desktop width,
   where the toggle is a plain block rather than a flex box. */
.navbar-username {
    display: inline-block;
    max-width: 12rem;
    vertical-align: middle;
}

.navbar-dark .navbar-brand {
    font-family: var(--font-display);
    font-weight: var(--weight-black);
    letter-spacing: -0.04em;
    color: var(--text-on-night);
}

.footer a {
    color: var(--text-link-on-night);
}

.footer .link-light {
    color: var(--text-on-night) !important;
}

.text-body-secondary,
.text-secondary,
.text-muted {
    color: var(--text-muted) !important;
}

/* Icons: Lucide as a font (tokens/lucide.css), outline, 1.1em next to text,
   inheriting colour. These replace Font Awesome's sizing utilities. */
[class^="icon-"],
[class*=" icon-"] {
    font-size: 1.1em;
    line-height: 1;
    vertical-align: -0.15em;
}

.icon-fw {
    display: inline-block;
    width: 1.25em;
    text-align: center;
}

.icon-xs {
    font-size: 0.8em;
}

.icon-sm {
    font-size: 0.9em;
}

.icon-lg {
    font-size: 1.35em;
}

.icon-2x {
    font-size: 2em;
}

/* ---- The portal's own components ---------------------------------------- */

/* Flashlights' own short lockup (Wordmark spec): the torch mark with the
   name in the display face; on Night the handle is Paper. */
.flashlights-lockup {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--paper);
    text-decoration: none;
    white-space: nowrap;
}

.flashlights-lockup:hover {
    color: var(--paper);
    text-decoration: none;
}

.flashlights-lockup:hover .flashlights-name {
    text-decoration: underline;
    text-decoration-color: var(--accent);
}

.flashlights-mark {
    width: 30px;
    height: 30px;
    flex: none;
}

.flashlights-name {
    font: var(--weight-black) 18px / 1 var(--font-display);
    letter-spacing: -0.04em;
}

/* People in lists (PersonRow spec): a 40px Night avatar with the initials
   in the accent, the name in bold, a muted meta line, and a status chip. */
.person-cell {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.person-avatar {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--night-950);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: var(--weight-bold) 15px / 1 var(--font-body);
}

.person-name {
    font: var(--weight-bold) var(--text-md) / 1.3 var(--font-body);
    color: var(--text-strong);
}

.person-name a {
    color: inherit;
    text-decoration: none;
}

.person-name a:hover {
    text-decoration: underline;
}

.person-meta {
    font: var(--type-small);
    color: var(--text-muted);
}

.status-chip {
    display: inline-block;
    font: var(--weight-bold) 13px / 1.3 var(--font-body);
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    background: var(--night-100);
    color: var(--night-950);
    white-space: nowrap;
}

.status-chip-ok {
    background: var(--status-ok-bg);
    color: var(--status-ok-ink);
}

.status-chip-warn {
    background: var(--status-warn-bg);
    color: var(--status-warn-ink);
}

.status-chip-stop {
    background: var(--status-stop-bg);
    color: var(--status-stop-ink);
}

/* Table rows that carry people get the row spacing of the spec. Compact
   tables (table-sm: the checklist and post-production boards, the room and
   gate lists, the exports) keep Bootstrap's density. */
.table:not(.table-sm) td {
    vertical-align: middle;
    padding: 12px 16px;
}

.table thead th {
    font: var(--type-eyebrow);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--surface-card);
    padding: 10px 16px;
}

/* Session cards on the schedule (SessionCard spec): a mono time column,
   the track and tags, the title; the session on stage now inverts to
   Night with the accent live tag. */
.session-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
    background: var(--surface-card);
    color: var(--text-body);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}
.session-card-mine {
    border-color: var(--night-950);
}
.session-card-time {
    font: var(--weight-semibold) var(--text-md) / 1 var(--font-mono);
    color: var(--text-strong);
    white-space: nowrap;
}
.session-card-duration {
    font: var(--weight-regular) 12px / 1.4 var(--font-mono);
    margin-top: 4px;
    color: var(--text-muted);
}
.session-card-track {
    font: var(--weight-semibold) 12px / 1.3 var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.session-card-title {
    font: var(--weight-bold) var(--text-lg) / 1.25 var(--font-display);
    color: var(--text-strong);
}
.session-card-title a {
    color: inherit;
}
.session-card-tag {
    background: var(--accent) !important;
    color: var(--text-on-accent) !important;
}
.session-card-livetag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: var(--weight-bold) 12px / 1.3 var(--font-body);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--text-on-accent);
}
.session-card-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-on-accent);
}
.session-card-live {
    background: var(--surface-night);
    color: var(--paper);
    border-color: var(--night-950);
}
.session-card-live .session-card-time {
    color: var(--accent);
}
.session-card-live .session-card-duration,
.session-card-live .session-card-track {
    color: var(--night-300);
}
.session-card-live .session-card-title,
.session-card-live .session-card-title a,
.session-card-live .btn-link {
    color: var(--paper);
}
@media (max-width: 575.98px) {
    .session-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Stat cards (StatCard spec): an eyebrow label with its icon, the number in
   the display face with tabular figures, a small detail, and a 6px goal bar. */
.stat-card .stat-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font: var(--type-eyebrow);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font: var(--weight-black) var(--text-2xl) / 1.1 var(--font-display);
    letter-spacing: var(--tracking-display);
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
}

.stat-card .stat-detail {
    font: var(--type-small);
    color: var(--text-muted);
}

.stat-card .progress {
    --bs-progress-height: 6px;
}

/* Needs attention (AttentionItem spec): rows in one bordered container,
   a tinted icon tile with a status edge, the sentence, a chevron that
   nudges on hover; the row outlines in Night. */
.attention-list {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-card);
}

.attention-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: var(--night-950);
    text-decoration: none;
    border-bottom: 1px solid var(--border-subtle);
    font: var(--type-body);
}

.attention-item:last-child {
    border-bottom: 0;
}

a.attention-item:hover {
    color: var(--night-950);
    outline: 2px solid var(--night-950);
    outline-offset: -2px;
}

.attention-item > span:not(.attention-tile) {
    flex: 1;
}

.attention-tile {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--status-warn-bg);
    border: 2px solid var(--status-warn);
}

.attention-stop .attention-tile {
    background: var(--status-stop-bg);
    border-color: var(--status-stop);
}

.attention-chevron {
    font-size: 18px;
    transition: transform var(--dur-fast) var(--ease-out);
}

a.attention-item:hover .attention-chevron {
    transform: translateX(3px);
}

/* Eyebrow: the mono, uppercase, letter-spaced label above a title. */
.eyebrow {
    font: var(--type-eyebrow);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
}

/* The one important card on a page (Card spec, strong). */
.card.card-strong {
    --bs-card-border-width: 2px;
    --bs-card-border-color: var(--border-strong);
}

.card-step .card-title i {
    color: var(--accent-ink);
}

/* Landing page (Landing screen spec). The hero is a full-bleed Night
   section with the beam glow and the tiny lights; base.html's container
   gives it its margins, so the hero pulls itself out of them. */
.landing-hero {
    background: var(--beam-glow), var(--surface-night);
    color: var(--paper);
    margin: -3rem calc(50% - 50vw) 0;
    width: 100vw;
}

/* With no section under it, the hero is the container's last child: it
   cancels the container's bottom margin and grows to the footer, so Night
   fills the viewport instead of a Paper band (the body is a min-height
   column with the footer pushed to the bottom). */
body > .container:has(> .landing-hero:last-child) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.landing-hero:last-child {
    margin-top: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
}

.landing-hero:last-child .landing-hero-inner {
    width: 100%;
}

.landing-hero-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 64px 24px 72px;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}

.landing-hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
}

.landing-title {
    font: var(--type-display);
    letter-spacing: var(--tracking-display);
    text-wrap: balance;
    color: var(--paper);
    margin: 0;
}

.landing-lead {
    font: var(--weight-regular) var(--text-lg) / 1.5 var(--font-body);
    color: var(--night-200);
    max-width: 540px;
    margin: 0;
}

.landing-where {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin: 16px 0 0;
    font: var(--weight-medium) var(--text-base) / 1.4 var(--font-body);
    color: var(--night-100);
}

.landing-where a {
    color: inherit;
    text-decoration-color: var(--accent);
}

.landing-where .icon-calendar,
.landing-where .icon-map-pin,
.landing-where .icon-globe {
    color: var(--accent);
    margin-right: 4px;
}

.landing-lights {
    position: relative;
    height: 320px;
}

.landing-lights span {
    position: absolute;
    width: var(--s);
    height: var(--s);
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 calc(var(--s) * 2) calc(var(--s) / 2) rgba(var(--accent-rgb), 0.45);
    opacity: 0.8;
}

.landing-lights span:nth-child(3n + 1) {
    opacity: 1;
}

/* Where the ten lights sit, and how big each is. */
.landing-lights span:nth-child(1) {
    left: 18%;
    top: 30%;
    --s: 14px;
}

.landing-lights span:nth-child(2) {
    left: 62%;
    top: 12%;
    --s: 8px;
}

.landing-lights span:nth-child(3) {
    left: 80%;
    top: 44%;
    --s: 18px;
}

.landing-lights span:nth-child(4) {
    left: 40%;
    top: 58%;
    --s: 10px;
}

.landing-lights span:nth-child(5) {
    left: 12%;
    top: 76%;
    --s: 7px;
}

.landing-lights span:nth-child(6) {
    left: 70%;
    top: 82%;
    --s: 12px;
}

.landing-lights span:nth-child(7) {
    left: 50%;
    top: 30%;
    --s: 6px;
}

.landing-lights span:nth-child(8) {
    left: 88%;
    top: 18%;
    --s: 5px;
}

.landing-lights span:nth-child(9) {
    left: 28%;
    top: 46%;
    --s: 5px;
}

.landing-lights span:nth-child(10) {
    left: 58%;
    top: 64%;
    --s: 22px;
}

@media (max-width: 767.98px) {
    .landing-hero-inner {
        grid-template-columns: 1fr;
        padding: 40px 16px 48px;
    }

    .landing-lights {
        height: 120px;
    }
}

.btn-primary {
    /* The ink on a filled accent is chosen by contrast (Night on Beam,
       white on teal), never assumed white. */
    --bs-btn-color: var(--text-on-accent);
    --bs-btn-hover-color: var(--text-on-accent);
    --bs-btn-active-color: var(--text-on-accent);
    --bs-btn-disabled-color: var(--text-on-accent);
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-bg: var(--brand-primary-hover);
    --bs-btn-hover-border-color: var(--brand-primary-hover);
    --bs-btn-active-bg: var(--brand-primary-active);
    --bs-btn-active-border-color: var(--brand-primary-active);
    --bs-btn-disabled-bg: var(--brand-primary);
    --bs-btn-disabled-border-color: var(--brand-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--accent-ink);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-color: var(--text-on-accent);
    --bs-btn-active-color: var(--text-on-accent);
    --bs-btn-hover-bg: var(--brand-primary);
    --bs-btn-hover-border-color: var(--brand-primary);
    --bs-btn-active-bg: var(--brand-primary);
    --bs-btn-active-border-color: var(--brand-primary);
}

.text-primary {
    /* Accent-coloured text must read on Paper: Beam 700, not Beam. */
    color: var(--accent-ink) !important;
}

.bg-primary {
    background-color: var(--brand-primary) !important;
}

/* A community's logo sits on the Night bar as it is; a rounded corner only. */
.navbar-logo {
    border-radius: var(--radius-sm);
}

/* django-bootstrap5 tags required fields with the configured
   `required_css_class` ("required") on the field wrapper. Surface that as a
   visible asterisk on the label so it is clear which fields are mandatory. */
.required > .form-label::after {
    content: " *";
    color: var(--bs-danger);
}

/* Contextual left rail (portal/base_sidebar.html): pinned alongside content on
   desktop, an off-canvas drawer on mobile (handled by Bootstrap offcanvas-md).
   A rail taller than the window scrolls on its own, otherwise its lower items
   would sit below the fold until the page itself reached its end. The cap is
   the dynamic viewport where the browser has it, so a tablet toolbar that
   slides away on scroll does not hide the rail's last items while shown. The
   4px inset keeps the focus ring of the first and last items inside the
   scroll box, where the overflow would otherwise clip it, and the matching
   scroll padding keeps the ring of an item that focus scrolls into view off
   the edge it lands on. */
@media (min-width: 768px) {
    .app-sidebar {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        max-height: calc(100dvh - 2rem);
        overflow-y: auto;
        scrollbar-width: thin;
        scroll-padding: 4px;
        padding: 4px;
        margin: -4px;
    }
}

/* Side rail (SideRail spec): items 9px by 12px with radius 8, hover on
   Night 100, the active one a Night pill with the accent on its icon; the
   section headings and the title are mono eyebrows; counts are mono pills,
   accent on the active item. */
.app-sidebar .nav-pills {
    --bs-nav-pills-link-active-bg: var(--night-950);
    --bs-nav-pills-link-active-color: var(--paper);
    --bs-nav-link-color: var(--text-strong);
    --bs-nav-link-hover-color: var(--text-strong);
    --bs-nav-link-padding-y: 9px;
    --bs-nav-link-padding-x: 12px;
    gap: 2px;
}

.app-sidebar .nav-pills .nav-link:hover:not(.active) {
    background: var(--night-100);
}

.app-sidebar .nav-pills .nav-link.active {
    font-weight: var(--weight-bold);
}

.app-sidebar .nav-pills .nav-link i {
    width: 20px;
    font-size: 18px;
    text-align: center;
}

.app-sidebar .nav-pills .nav-link.active i {
    color: var(--accent);
}

.app-sidebar .nav-pills .nav-link .badge {
    font: var(--weight-semibold) 12px/1 var(--font-mono);
    padding: 4px 7px;
    background: var(--night-100) !important;
    color: var(--night-950) !important;
    border: 1px solid var(--night-200);
}

.app-sidebar .nav-pills .nav-link.active .badge {
    background: var(--accent) !important;
    color: var(--text-on-accent) !important;
    border-color: transparent;
}

.app-sidebar .text-uppercase,
.app-sidebar hr + .text-uppercase {
    font: var(--type-eyebrow);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted) !important;
}

.app-sidebar hr {
    border-color: var(--border-subtle);
    opacity: 1;
}

/* Breadcrumbs (Breadcrumbs spec): small, muted, chevron dividers, the
   current page strong. */
.breadcrumb {
    --bs-breadcrumb-divider: "\203A";
    --bs-breadcrumb-divider-color: var(--text-muted);
    --bs-breadcrumb-item-active-color: var(--text-strong);
    font: var(--type-small);
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--text-strong);
    text-decoration: underline;
}

.breadcrumb-item.active {
    font-weight: var(--weight-bold);
}

/* Tabs inside a page (Tabs spec): underline tabs on a 2px subtle rule, the
   selected one on a 3px Night rule; counts are mono pills. */
.nav-tabs {
    --bs-nav-tabs-border-width: 0;
    --bs-nav-link-color: var(--text-muted);
    --bs-nav-link-hover-color: var(--text-strong);
    --bs-nav-tabs-link-active-color: var(--text-strong);
    --bs-nav-tabs-link-active-bg: transparent;
    --bs-nav-link-font-weight: var(--weight-semibold);
    --bs-nav-link-padding-y: 10px;
    --bs-nav-link-padding-x: 14px;
    gap: 4px;
    border-bottom: 2px solid var(--border-subtle);
}

.nav-tabs .nav-link {
    margin-bottom: -2px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    white-space: nowrap;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus-visible {
    border-color: transparent;
    isolation: auto;
}

.nav-tabs .nav-link.active {
    font-weight: var(--weight-bold);
    border-bottom-color: var(--night-950);
}

.nav-tabs .nav-link .badge {
    font: var(--weight-semibold) 12px/1 var(--font-mono);
    padding: 3px 6px;
    margin-left: 6px;
    background: var(--night-100) !important;
    color: var(--night-950) !important;
}

.nav-tabs .nav-link.active .badge {
    background: var(--accent) !important;
    color: var(--text-on-accent) !important;
}

/* Flex items default to min-width:auto, so a wide table would stretch the
   content column past its grid share and make pages with wide vs narrow
   content render at different widths. Let the column shrink to its share; wide
   tables scroll inside it (wrap them in .table-responsive). */
.app-content {
    min-width: 0;
}

/* Footer resource group headings (portal/_footer_resources.html). */
.footer-heading {
    letter-spacing: 0.04em;
}

/* Speaker checklists (templates/speakers/_checklist_item.html): items the
   portal ticks by itself are dashed so a speaker knows not to tick them. */
/* Checklist items (ChecklistItem spec). Five states, each a glyph and a
   word: open, done, blocked, skipped, waiting; an automatic item ticks
   itself. The left edge says manual (solid Night), automatic (dashed) or
   done (ok). */
.checklist-item-auto {
    border-left: 3px dashed var(--night-400);
}
.checklist-item-manual {
    border-left: 3px solid var(--night-950);
}
.checklist-item-done {
    border-left-color: var(--status-ok);
    border-left-style: solid;
}
/* Ticking an item redirects back to #item-<pk>; keep it clear of the top. */
.checklist-row {
    scroll-margin-top: 1rem;
    padding: 14px 16px;
    background: var(--surface-card);
}
/* One box size for every row, whether it is a button, a static status, or
   an automatic item: empty while open, ticked once done. */
.checklist-box {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    margin-top: 1px;
    padding: 0;
    border: 2px solid var(--night-500);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    color: var(--surface-card);
    font-size: 15px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
button.checklist-box:hover,
button.checklist-box:focus-visible {
    border-color: var(--night-950);
    background: var(--beam-200);
    color: var(--night-950);
}
.checklist-box-static {
    border-style: dashed;
    border-color: var(--night-400);
    color: var(--night-500);
}
.checklist-box-done,
button.checklist-box-done:hover {
    border-color: var(--status-ok);
    border-style: solid;
    background: var(--status-ok);
    color: var(--white);
}
.checklist-box-blocked {
    border-color: var(--status-stop);
    border-style: solid;
    color: var(--status-stop);
}
.checklist-box-skipped {
    border-color: var(--night-400);
    border-style: solid;
    color: var(--night-500);
}
/* Waiting: nothing to click yet, and the row says why. */
.checklist-box-waiting {
    border-style: dotted;
    border-color: var(--night-400);
    color: var(--night-500);
}
.checklist-row .link-body-emphasis {
    font-weight: var(--weight-bold);
    color: var(--text-strong) !important;
}
.checklist-row-waiting .checklist-title-waiting {
    color: var(--text-muted) !important;
}
.checklist-title-done {
    text-decoration: line-through !important;
    color: var(--text-muted) !important;
}
/* Due chips: mono, day-first, louder the closer they are. */
.checklist-due {
    font: var(--weight-semibold) var(--text-sm) / 1 var(--font-mono);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    white-space: nowrap;
}
.checklist-due-overdue {
    background: var(--status-stop);
    border-color: var(--status-stop);
    color: var(--white);
}
.checklist-due-soon {
    background: var(--status-warn-bg);
    border-color: var(--status-warn);
    color: var(--status-warn-ink);
}
.checklist-due-later {
    background: var(--night-100);
    border-color: var(--night-200);
    color: var(--night-950);
}
.checklist-due-quiet {
    background: transparent;
    border-color: var(--border-default);
    color: var(--text-muted);
    font-weight: var(--weight-regular);
}

/* Flash messages as toasts (templates/portal/_toast_messages.html): shown for
   a few seconds, then fade out without JavaScript. */
/* Toasts (Toast spec): Night, Paper text, a tone-coloured icon, the large
   shadow, and a fade after seven seconds. */
.portal-toast {
    min-width: 280px;
    max-width: 420px;
    background: var(--night-950);
    color: var(--paper);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font: var(--type-body);
    animation: portal-toast-fade 7s ease-in forwards;
}

.portal-toast-icon {
    font-size: 20px;
    color: var(--accent);
}

.portal-toast-ok .portal-toast-icon {
    color: var(--status-ok);
}

.portal-toast-warn .portal-toast-icon {
    color: var(--status-warn);
}

.portal-toast-stop .portal-toast-icon {
    color: var(--status-stop);
}

.portal-toast-close {
    --bs-btn-color: var(--paper);
    --bs-btn-hover-color: var(--accent);
    min-height: 0;
    padding: 0.25rem;
    font-size: 18px;
}
@keyframes portal-toast-fade {
    0%, 80% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

/* With "Reduce motion" on, base.css cuts every animation to 0.01ms, which
   would end the fade at once and hide the toast before anyone reads it. The
   toast then stays until it is closed. */
@media (prefers-reduced-motion: reduce) {
    .portal-toast {
        animation: none;
    }
}

/* Checklist board cells (templates/speakers/checklist_board.html). */
.checklist-board td.cell-done { background: var(--bs-success-bg-subtle); }
.checklist-board td.cell-todo { background: var(--bs-light); }
.checklist-board td.cell-overdue { background: var(--bs-warning-bg-subtle); }
.checklist-board td.cell-blocked { background: var(--bs-danger-bg-subtle); }
.checklist-board td.cell-skipped { background: var(--bs-secondary-bg-subtle); }
.checklist-board td.cell-none { color: var(--bs-secondary); }
.checklist-board th.board-col {
    min-width: 6rem;
    max-width: 8rem;
    white-space: normal;
    vertical-align: bottom;
    line-height: 1.15;
}

/* Template editor (templates/speakers/template_detail.html): the reorder column. */
.col-order {
    width: 5rem;
}

/* Invitation email preview: the sender's own words, set apart from the template. */
.invitation-preview-note {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    padding: 0.25rem 0.75rem;
}
.invitation-preview-note > :last-child {
    margin-bottom: 0;
}
/* Task stats legend (templates/speakers/_task_stats_cards.html): the "open"
   swatch matches the empty part of the stacked bar. */
.task-legend-open {
    color: var(--bs-secondary-bg);
}

/* Login page (templates/account/login.html): the "or" between the password
   form and the sign-in code. A rule with the word in the middle on narrow
   screens; a vertical rule between the two columns from md up. */
/* Entrance pages (SignIn screen spec): the ways in sit in one card; the
   "or" between them is a mono eyebrow on a rule. */
.entrance-card {
    max-width: 880px;
}

.entrance-card .card-body {
    padding: 28px;
}

.errorlist {
    list-style: none;
    padding: 0;
    margin: 0 0 6px;
    font: var(--weight-bold) var(--text-xs) / 1.4 var(--font-body);
    color: var(--status-stop-ink);
}

.errorlist li::before {
    font-family: "lucide";
    font-weight: 400;
    content: "\e07b";
    margin-right: 5px;
}

.login-or {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    font: var(--type-eyebrow);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
}
.login-or::before,
.login-or::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--bs-border-color);
}
@media (min-width: 768px) {
    /* The column stretches to the row (align-items-stretch on the parent),
       so the rule is as tall as the taller of the two forms rather than a
       fixed height that could overhang a short one. */
    .login-or {
        flex-direction: column;
        width: auto;
        height: 100%;
        padding: 0 0.5rem;
    }
    .login-or::before,
    .login-or::after {
        border-top: 0;
        border-left: 1px solid var(--bs-border-color);
        width: 0;
    }
}

/* Accordion headers (the propose form's two sections). Bootstrap tints an
   open header and leaves a collapsed one plain white, which stops it
   reading as a header at all: the closed section looked like a stray line
   of text. A collapsed header keeps a tinted background, a border and its
   chevron, so it still looks like something to open. */
.accordion-button {
    font-weight: 600;
}
.accordion-button.collapsed {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}
.accordion-button.collapsed:hover {
    background-color: var(--bs-secondary-bg);
}
.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}


/* Upload panel (templates/speakers/_upload_panel.html) and the video
   length bar on the performer's session page: tall enough to read the
   percentage inside. */
.upload-progress {
    height: 1.25rem;
}

/* At-a-glance strip on the session pages (templates/speakers/session_detail.html,
   speaker_session_detail.html): one tile per thing that needs a person,
   each a link to its section. The left edge carries the state. */
/* Glance tiles on a session page (GlanceTile spec): a 5px state edge, an
   eyebrow label, the value with the state's icon, a small detail. */
.glance-tile {
    color: inherit;
    text-decoration: none;
    border-left: 5px solid var(--night-300);
    border-radius: var(--radius-md);
}
.glance-tile:hover {
    border-left-color: var(--night-950);
    color: inherit;
}
.glance-tile.glance-ok {
    border-left-color: var(--status-ok);
}
.glance-tile.glance-warn {
    border-left-color: var(--status-warn);
}
.glance-tile.glance-bad {
    border-left-color: var(--status-stop);
}
.glance-label {
    font: var(--type-eyebrow);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
}
.glance-value {
    font: var(--weight-bold) var(--text-md) / 1.3 var(--font-body);
    color: var(--text-strong);
    margin-top: 4px;
}
.glance-value::before {
    font-family: "lucide";
    font-weight: 400;
    content: "\e4b5";
    color: var(--night-300);
    margin-right: 6px;
}
.glance-ok .glance-value::before {
    content: "\e226";
    color: var(--status-ok);
}
.glance-warn .glance-value::before {
    content: "\e08b";
    color: var(--status-warn);
}
.glance-bad .glance-value::before {
    content: "\e12b";
    color: var(--status-stop);
}
.glance-detail {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
/* A folded card (Activity): the header is the summary. */
details.card > summary.card-header {
    cursor: pointer;
    list-style: none;
}
details.card > summary.card-header::before {
    content: "\25B8";
    display: inline-block;
    width: 1em;
}
details.card[open] > summary.card-header::before {
    content: "\25BE";
}

/* Preview fold on file rows (templates/speakers/_media_preview.html): the
   file at a readable size, never wider than the row. The width and height
   attributes on the image are hints for layout; the real size is the file's. */
.media-preview-image,
.media-preview-video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 24rem;
}

/* The files table (templates/speakers/_media_files.html): the "More" row
   under a file carries its forms and preview on a quiet background. While
   it is open, it and the file row above it read as one block: the same
   background on both, an accent down their left edge, and a firmer rule
   under the pair, so the panel is not mistaken for another file. */
.media-table .media-group-more > td {
    border-top: 0;
    padding: 1rem 1.25rem 1.25rem;
}
.media-table .media-group:has(> .media-group-more.show) > tr > td {
    --bs-table-bg: var(--bs-tertiary-bg);
}
.media-table .media-group:has(> .media-group-more.show) > tr > td:first-child {
    border-left: 3px solid var(--bs-primary);
}
.media-table .media-group:has(> .media-group-more.show) > .media-group-more > td {
    border-bottom: 2px solid var(--bs-secondary-border-subtle);
}

/* The session picker on the export page (templates/speakers/media_export.html):
   a scrollable list with the type headings inside it. */
.session-picker-list {
    max-height: 18rem;
    overflow-y: auto;
}
.session-picker:disabled {
    opacity: 0.5;
}

/* Thumbnails on file rows, the speaker's files and the board
   (templates/speakers/_media_thumb.html). */
.media-thumb {
    object-fit: cover;
    flex: none;
}
.media-thumb-icon {
    display: inline-flex;
    width: 64px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: var(--bs-tertiary-bg);
    border-radius: 0.25rem;
    flex: none;
}

/* A transcript or another text file shown in its preview fold. */
.media-preview-text {
    height: 20rem;
}

/* The schedule editor's grid (speakers, task 4.2): the hour gutter, the
   all-channels lane, one column per channel, 15-minute rows. Cards carry
   their grid position inline, computed in speakers/schedule.py. */
.schedule-scroll {
    /* Full height on purpose: the page scrolls a long day, not a box
       within it (the rooms still scroll horizontally when they must,
       and Compact or Fit put the whole day on one screen). */
    overflow-x: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
}
.schedule-grid {
    display: grid;
    grid-template-columns: 4.5rem 7rem repeat(var(--schedule-columns, 0), minmax(12rem, 1fr));
    /* Row 1 is the room headers: content-sized whatever the density,
       so Compact and Fit shrink the quarter-hours, never the heading. */
    grid-template-rows: auto;
    grid-auto-rows: var(--schedule-row-height, 1.5rem);
    position: relative;
}
.schedule-head {
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}
.schedule-hour {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    border-top: 1px solid var(--bs-border-color-translucent);
    padding: 0 0.25rem;
}
.schedule-cell {
    border-left: 1px solid var(--bs-border-color-translucent);
}
.schedule-cell-hour {
    border-top: 1px solid var(--bs-border-color-translucent);
}
.schedule-cell.schedule-drop {
    background: var(--bs-primary-bg-subtle);
}
.schedule-card {
    position: relative;
    z-index: 2;
    margin: 1px;
    padding: 0.1rem 0.4rem;
    overflow: hidden;
    font-size: 0.8rem;
    line-height: 1.25;
    /* ScheduleCard spec: a placed session is white with a 2px Night border
       and the hard shadow; a band is flat neutral. */
    background: var(--surface-card);
    border: 2px solid var(--night-950);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 0 var(--night-950);
    cursor: grab;
}
.schedule-card-pencilled {
    border-style: dashed;
}
.schedule-card .schedule-card-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--night-600);
}
/* A card is as tall as its slot, so the title may wrap and use that
   height; the card's own overflow clips whatever still does not fit.
   Only the quarter-hour card keeps the single clipped line. */
.schedule-card-title {
    display: block;
    overflow-wrap: anywhere;
}
.schedule-card-tight .schedule-card-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.schedule-card-edit,
.schedule-card .text-warning-emphasis[role="img"] {
    padding: 0 0.3rem;
    font-size: 0.7rem;
    line-height: 1.3;
}
/* The pencil lives inside a card as short as a quarter hour: no button
   minimum height, a 1px border and a little air from the card's edge. */
.schedule-card-menu > summary.schedule-card-edit {
    --bs-btn-border-width: 1px;
    --bs-btn-border-radius: var(--radius-sm);
    min-height: 0;
    margin: 0.1rem 0;
}
/* A quarter-hour card has one row of pixels: title only, on one line,
   with the full text and times in the tooltip. */
.schedule-card-tight {
    padding-top: 0;
    padding-bottom: 0;
}
.schedule-card-tight .schedule-card-meta,
.schedule-card-tight .schedule-card-warnings {
    display: none;
}
.schedule-band {
    /* A band (the opening, a break) is the program's furniture: flat
       neutral, no shadow. */
    background: var(--night-100);
    border-color: var(--night-300);
    box-shadow: none;
}
.schedule-warned {
    border-color: var(--bs-warning-border-subtle, #ffe69c);
}
.schedule-card-title {
    color: inherit;
    text-decoration: none;
}
.schedule-card-title:hover {
    text-decoration: underline;
}
/* The popover hangs off the pencil itself, so it opens where the
   organizer clicked; anchored to the card, a band's popover sat at the
   card's far right edge, off screen once the grid scrolls. */
.schedule-card-menu {
    position: relative;
}
.schedule-card-menu > summary {
    list-style: none;
}
.schedule-card-menu > summary::-webkit-details-marker {
    display: none;
}
/* A link or a summary is not a button, so the label of one styled as a
   button sat at the top of the button's minimum height; centre it and
   keep it on one line, as a real button does. */
.schedule-toolbar a.btn,
.schedule-card-menu > summary.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
}
.schedule-card-popover {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    z-index: 5;
    width: 14rem;
}
/* A band's pencil sits at the grid's left edge, where a right-aligned
   popover would poke into space the scroller cannot reach; it opens
   rightward instead. */
.schedule-band .schedule-card-popover {
    right: auto;
    left: 0;
}
.schedule-resize {
    position: absolute;
    inset: auto 0 0 0;
    height: 0.45rem;
    cursor: ns-resize;
}
.schedule-pending {
    cursor: grab;
}
.schedule-pending .schedule-card-popover {
    width: 13rem;
}
/* The unscheduled list grows with the page on purpose: its own
   scrollbar would clip the place flyouts, which cannot escape an
   overflow container. */
/* text-warning-emphasis is a Bootstrap 5.3 utility; this portal runs
   5.2, so the warning colour is set here with the same 5.3 value. */
.schedule-card-warnings,
.schedule-card .text-warning-emphasis {
    color: var(--bs-warning-text-emphasis, #997404);
}
.schedule-card-warnings {
    line-height: 1.2;
}

/* A grid item's minimum size is its content unless told otherwise, so a
   long title would push a card past its column; the meta line clips the
   same way the title does. */
.schedule-card {
    min-width: 0;
}
.schedule-card-body {
    flex: 1 1 auto;
    min-width: 0;
}
.schedule-card-meta {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* The click-to-add panel, floated at the clicked cell. */
.schedule-cell-panel {
    position: fixed;
    z-index: 40;
    width: 17.5rem;
}
.schedule-cell-options {
    max-height: 14rem;
    overflow: auto;
}
.schedule-cell {
    cursor: pointer;
}

/* While a card's popover is open, the card stops clipping (the popover
   would otherwise be cut to the card's height) and rises above its
   neighbours; schedule-editor.js toggles the class with the menu. */
.schedule-card.schedule-card-open {
    overflow: visible;
    z-index: 20;
}
.schedule-pending.schedule-card-open {
    position: relative;
    z-index: 20;
}

/* On a full-width band the title block does not grow, so the pencil and
   the warning sit beside the title in the all-rooms lane instead of
   drifting over the last room's column. */
.schedule-band .schedule-card-body {
    flex: 0 1 auto;
}

/* Draggables never join a text selection: a drag that starts inside a
   selection would carry the whole selection as its ghost, sidebar
   panels included. */
.schedule-card,
.schedule-pending {
    user-select: none;
}

/* Where the drop would land: the dragged session's footprint, dashed,
   in the hovered room (full width over the all-rooms lane). It takes
   no pointer events, or hovering it would cancel the drop. */
.schedule-drop-preview {
    display: none;
    z-index: 3;
    justify-content: flex-end;
    align-items: flex-end;
    margin: 1px;
    pointer-events: none;
    background: rgba(207, 226, 255, 0.55);
    border: 2px dashed #6ea8fe;
    border-radius: 0.35rem;
}
/* The minute count rides the edge being dragged, on its own chip, so
   it never sits over the card's title. */
.schedule-drop-label {
    margin: 0.15rem;
    padding: 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: #084298;
    border-radius: 0.25rem;
}
.schedule-drop-label:empty {
    display: none;
}
/* A band spans the whole grid, so a right-hand chip can sit off
   screen; its chip joins the band's own controls at the left edge. */
.schedule-drop-preview.schedule-drop-band {
    justify-content: flex-start;
}

/* The off-screen clone a drag's image is painted from: rendered (so
   Chrome can rasterize it) but far outside the viewport. Snapshotting
   the live list item dragged its neighbours into the picture. */
.schedule-drag-image {
    position: fixed;
    top: -200vh;
    left: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--bs-body-bg, #fff);
}

/* The presenter's own rows on their schedule page. */
.schedule-mine {
    background: #f6faff;
    border-left: 0.25rem solid #6ea8fe;
}

/* A card whose working position differs from what the speakers see:
   dashed until the next Publish schedule. */
.schedule-card-dirty {
    border-style: dashed;
}

.schedule-card-pencilled {
    border-style: dotted;
    opacity: 0.75;
}

/* Compact and Fit densities (design §10.2): one-line cards, the detail
   stays in the tooltip and the pencil. */
.schedule-density-compact .schedule-card {
    padding-top: 0;
    padding-bottom: 0;
    font-size: 0.7rem;
}
.schedule-density-compact .schedule-card-meta,
.schedule-density-compact .schedule-card-warnings {
    display: none;
}
.schedule-density-compact .schedule-card-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.schedule-density-compact .schedule-hour {
    font-size: 0.65rem;
}

/* The subscribe popover holds a whole URL. */
.schedule-feed-popover {
    width: 22rem;
    max-width: 90vw;
}

/* Fit shrinks the lettering with the rows: the text follows the
   computed row height, floored where it stops being readable. */
.schedule-density-fit .schedule-card {
    padding: 0 0.2rem;
    font-size: clamp(7px, calc(var(--schedule-row-height, 1.5rem) * 0.72), 0.7rem);
    line-height: 1.15;
    border-radius: 0.2rem;
}
.schedule-density-fit .schedule-hour {
    font-size: clamp(7px, calc(var(--schedule-row-height, 1.5rem) * 0.72), 0.65rem);
}
.schedule-density-fit .schedule-card-edit,
.schedule-density-fit .schedule-card .text-warning-emphasis[role="img"] {
    padding: 0 0.15rem;
    font-size: clamp(7px, calc(var(--schedule-row-height, 1.5rem) * 0.7), 0.7rem);
    line-height: 1.1;
}

/* The wide (spreadsheet) view breaks out of the page container: full
   viewport width, so every room column gets its share of the screen. */
.schedule-wide,
.page-wide {
    position: relative;
    left: 50%;
    width: 100vw;
    margin-left: -50vw;
    padding: 0 1.5rem;
}

/* The presenters' data view: a spreadsheet, headers that stay put. */
.presenter-data {
    font-size: 0.85rem;
    white-space: nowrap;
}

.presenter-data thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* A sponsor's logo beside its name: boxed, never stretched. */
.sponsor-logo {
    object-fit: contain;
    background: var(--surface-card);
}

/* A Chart.js canvas sizes itself to its box: the stats and maintenance
   charts get a fixed height to fill. */
.chart-container {
    position: relative;
    height: 300px;
}
