/* FinalScore - app styles on top of dbnetsoft.admin.css ------------------------------- */

/* Brand: the arch emblem is wider than the shell's text logo, give it more height */
.fs-brand-mark { height: 42px; margin: -6px 0; }

/* Icons (Font Awesome 7 Pro regular, loaded by icons.base.css from dbnetsoft.Web) */
.fa-fs-events:before { content: '\f073'; }
.fa-fs-setup:before { content: '\f1de'; }
.fa-fs-settings:before { content: '\f013'; }
.fa-fs-competition:before { content: '\f11e'; }
.fa-fs-classes:before { content: '\f5fd'; }
.fa-fs-course:before { content: '\f4d7'; }
.fa-fs-athlete:before { content: '\f70c'; }
.fa-fs-timing:before { content: '\f2f2'; }
.fa-fs-passings:before { content: '\f00b'; }
.fa-fs-lists:before { content: '\f022'; }
.fa-fs-system:before { content: '\f2db'; }
.fa-fs-other:before { content: '\f141'; }
.fa-fs-analysis:before { content: '\e0e4'; }
.fa-fs-plus:before { content: '\f067'; }
.fa-fs-import:before { content: '\f56f'; }
.fa-fs-print:before { content: '\f02f'; }
.fa-fs-csv:before { content: '\f6dd'; }
.fa-fs-pdf:before { content: '\f1c1'; }
.fa-fs-open:before { content: '\f08e'; }
.fa-fs-refresh:before { content: '\f2f1'; }
.fa-fs-start:before { content: '\f04b'; }
.fa-fs-flag:before { content: '\f024'; }
.fa-fs-hide:before { content: '\f070'; }
.fa-fs-show:before { content: '\f06e'; }
.fa-fs-x:before { content: '\f00d'; }
.fa-fs-check:before { content: '\f00c'; }
.fa-fs-warn:before { content: '\f071'; }
.fa-fs-bolt:before { content: '\f0e7'; }
.fa-fs-up:before { content: '\f062'; }
.fa-fs-down:before { content: '\f063'; }

.fs-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* The server clock, large in the top right corner; the bar's gaps narrower so the menu still fits beside it */
.dbn-topbar { column-gap: 14px; }

.fs-clock {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.dbn-mono,
.fs-num {
    font-variant-numeric: tabular-nums;
}

.fs-muted {
    color: var(--dbn-text-muted);
}

.fs-hint {
    color: var(--dbn-text-muted);
    font-size: 0.8rem;
}

/* Grid ------------------------------------------------------------------------------ */

.fs-grid-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.fs-grid-toolbar .form-control,
.fs-grid-toolbar .form-select {
    width: auto;
    min-width: 200px;
}

.fs-grid-count {
    margin-left: auto;
    color: var(--dbn-text-muted);
    font-size: 0.8rem;
}

.fs-grid-wrap {
    overflow: auto;
    max-height: calc(100vh - 260px);
    border-radius: var(--dbn-radius-sm);
}

.fs-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.fs-grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--dbn-surface-strong);
    backdrop-filter: var(--dbn-blur);
    font-weight: 600;
    color: var(--dbn-text-muted);
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--dbn-border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.fs-grid thead th.fs-sorted-asc:after { content: ' \25B2'; font-size: 0.65em; }
.fs-grid thead th.fs-sorted-desc:after { content: ' \25BC'; font-size: 0.65em; }

.fs-grid td {
    padding: 0;
    border-bottom: 1px solid var(--dbn-border-soft);
    height: 32px;
    vertical-align: middle;
}

.fs-grid td > .fs-cell {
    display: block;
    padding: 6px 10px;
    min-height: 32px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}

.fs-grid td.fs-editable > .fs-cell {
    cursor: text;
}

.fs-grid td.fs-editable:hover > .fs-cell {
    background: color-mix(in srgb, var(--dbn-accent) 7%, transparent);
}

.fs-grid td.fs-readonly > .fs-cell {
    color: var(--dbn-text-muted);
}

.fs-grid td.fs-right > .fs-cell { text-align: right; }
.fs-grid td.fs-center > .fs-cell { text-align: center; }

.fs-grid td input.fs-editor,
.fs-grid td select.fs-editor {
    width: 100%;
    min-width: 60px;
    height: 32px;
    border: 2px solid var(--dbn-accent);
    border-radius: 6px;
    padding: 2px 8px;
    font: inherit;
    background: #fff;
    outline: none;
}

.fs-grid tbody tr:hover td {
    background: rgba(255, 255, 255, 0.45);
}

.fs-grid tr.fs-new-row td > .fs-cell {
    color: var(--dbn-text-dim);
    font-style: italic;
}

/* A new row still missing required fields: its values look like data, the gaps say "required". */
.fs-grid tr.fs-draft td > .fs-cell {
    color: inherit;
    font-style: normal;
}
.fs-grid tr.fs-draft td { background: color-mix(in srgb, var(--dbn-accent) 5%, transparent); }

.fs-grid tr.fs-flash td {
    animation: fs-flash 1.4s ease-out;
}

@keyframes fs-flash {
    from { background: color-mix(in srgb, var(--dbn-accent) 22%, transparent); }
    to { background: transparent; }
}

/* Row selection (selectable grids) */
.fs-grid .fs-select { width: 1%; padding: 0 4px 0 10px; text-align: center; cursor: default; }
.fs-grid .fs-select .form-check-input { margin: 0; vertical-align: middle; cursor: pointer; }
.fs-grid tbody tr.fs-selected td { background: color-mix(in srgb, var(--dbn-accent) 10%, transparent); }
.fs-grid tbody tr.fs-selected td.fs-frozen, .fs-grid tbody tr.fs-selected td.fs-frozen-end { background: color-mix(in srgb, var(--dbn-accent) 10%, var(--fs-frozen-bg)); }

.fs-grid .fs-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
    padding: 0 6px;
}

.fs-grid .fs-actions button {
    border: 0;
    background: transparent;
    color: var(--dbn-text-dim);
    padding: 4px 6px;
    border-radius: 6px;
}

.fs-grid .fs-actions button:hover {
    color: var(--dbn-err);
    background: color-mix(in srgb, var(--dbn-err) 10%, transparent);
}

/* Frozen columns (FS.freeze): leading .fs-frozen stick left at their column's offset, .fs-frozen-end sticks right.
   Opaque, close to the panel, so scrolled cells do not show through. */
:root { --fs-frozen-bg: color-mix(in srgb, #fff 62%, var(--dbn-bg)); }
.fs-frozen, .fs-frozen-end { position: sticky; z-index: 1; background: var(--fs-frozen-bg); }
.fs-frozen:nth-child(1) { left: var(--fs-left-0, 0); }
.fs-frozen:nth-child(2) { left: var(--fs-left-1, 0); }
.fs-frozen:nth-child(3) { left: var(--fs-left-2, 0); }
.fs-frozen:nth-child(4) { left: var(--fs-left-3, 0); }
.fs-frozen:not(:has(+ .fs-frozen)) { box-shadow: inset -1px 0 var(--dbn-border); }
.fs-frozen-end { right: 0; box-shadow: inset 1px 0 var(--dbn-border); }
.fs-grid thead th.fs-frozen, .fs-grid thead th.fs-frozen-end,
.fs-feed thead th.fs-frozen, .fs-feed thead th.fs-frozen-end { z-index: 3; background: var(--fs-frozen-bg); }
.fs-grid tbody tr:hover td.fs-frozen, .fs-grid tbody tr:hover td.fs-frozen-end,
.fs-feed tbody tr:hover td.fs-frozen, .fs-feed tbody tr:hover td.fs-frozen-end { background: color-mix(in srgb, #fff 45%, var(--fs-frozen-bg)); }

.fs-grid tr.fs-row-invalid td > .fs-cell { text-decoration: line-through; color: var(--dbn-text-dim); }

/* Status chips */
.fs-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--dbn-sunken);
    color: var(--dbn-text-muted);
    white-space: nowrap;
}

.fs-chip[data-tone="ok"] { background: color-mix(in srgb, var(--dbn-ok) 15%, transparent); color: var(--dbn-ok); }
.fs-chip[data-tone="warn"] { background: color-mix(in srgb, var(--dbn-warn) 16%, transparent); color: var(--dbn-warn); }
.fs-chip[data-tone="bad"] { background: color-mix(in srgb, var(--dbn-err) 14%, transparent); color: var(--dbn-err); }
.fs-chip[data-tone="live"] { background: color-mix(in srgb, var(--dbn-accent) 16%, transparent); color: var(--dbn-accent-hover); }

.fs-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: baseline;
}

/* Timing view ------------------------------------------------------------------------- */

.fs-timing {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
}

@media (max-width: 1100px) {
    .fs-timing { grid-template-columns: 1fr; }
}

.fs-bigclock {
    font-family: var(--dbn-mono);
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.fs-sync {
    font-size: 0.75rem;
    color: var(--dbn-text-muted);
}

.fs-points {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fs-points .btn {
    border-radius: 999px;
}

.fs-entry {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.fs-entry input {
    font-family: var(--dbn-mono);
    font-size: 2rem;
    font-weight: 600;
    height: 64px;
    text-align: center;
    border-radius: 16px;
    border: 2px solid var(--dbn-border);
    background: #fff;
    min-width: 0;
    flex: 1;
}

.fs-entry input:focus {
    border-color: var(--dbn-accent);
    box-shadow: 0 0 0 4px var(--bs-focus-ring-color);
    outline: none;
}

.fs-entry .btn {
    min-width: 120px;
    border-radius: 16px;
    font-weight: 600;
}

.fs-feed {
    width: 100%;
    font-size: 0.9rem;
}

.fs-feed td, .fs-feed th {
    padding: 6px 8px;
    border-bottom: 1px solid var(--dbn-border-soft);
    white-space: nowrap;
}

.fs-feed th {
    color: var(--dbn-text-muted);
    font-weight: 600;
    font-size: 0.78rem;
}

.fs-feed .fs-bib {
    font-weight: 700;
}

/* The key information of a passing (Timing, Raw): time of day, timing point, bib - bold */
.fs-feed .fs-key, .fs-grid td.fs-key { font-weight: 700; }
/* Passing status chips in capitals */
.fs-status .fs-chip { text-transform: uppercase; letter-spacing: 0.04em; }

.fs-feed tr.fs-feed-new td {
    animation: fs-flash 2s ease-out;
}

.fs-feed tr[data-status="invalid"] td { color: var(--dbn-text-dim); text-decoration: line-through; }

.fs-starts .fs-start-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--dbn-border-soft);
}

.fs-starts .fs-start-row:last-child { border-bottom: 0; }

.fs-starts .fs-start-name { flex: 1; font-weight: 600; }
.fs-starts .fs-start-time { font-family: var(--dbn-mono); min-width: 110px; text-align: right; }

.fs-leader td { padding: 4px 6px; }

/* Lists --------------------------------------------------------------------------------- */

.fs-list-folder {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dbn-text-dim);
    margin: 14px 0 6px;
}

.fs-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--dbn-text);
}

.fs-list-item:hover { background: rgba(255, 255, 255, 0.55); }
.fs-list-item.active { background: var(--dbn-ink); color: #fff; }
.fs-list-item[draggable="true"] { cursor: grab; }
.fs-list-item.fs-dragging { opacity: 0.4; }

.fs-list-view {
    background: #fff;
    border-radius: var(--dbn-radius-sm);
    padding: 22px 26px;
    min-height: 300px;
    overflow-x: auto;
}

.fs-list .fs-list-head h1 { font-size: 1.35rem; font-weight: 700; margin: 0 0 2px; }
.fs-list .fs-list-head h2 { font-size: 0.9rem; font-weight: 400; color: #5b6275; margin: 0 0 14px; }
.fs-list-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.fs-list-table th { text-align: left; font-weight: 600; color: #5b6275; border-bottom: 1.5px solid #14161f; padding: 4px 6px; font-size: 0.78rem; }
.fs-list-table td { padding: 3px 6px; border-bottom: 1px solid #eef0f4; }
.fs-list-table tr.fs-even td { background: #f7f8fb; }
.fs-list-table tr.fs-group th { border: 0; padding: 14px 6px 4px; color: #14161f; font-size: 0.95rem; text-align: left; }
.fs-list-table tr.fs-group-1 th { font-size: 0.85rem; padding-top: 10px; color: #3b4152; }
.fs-list-table .fs-right { text-align: right; }
.fs-list-table .fs-center { text-align: center; }
.fs-list-table .fs-bold { font-weight: 700; }
.fs-list-empty { color: #8a90a2; padding: 20px 0; }

@media (max-width: 700px) {
    .fs-list-table .fs-hide-mobile { display: none; }
}

/* List editor */
.fs-editor-table td { padding: 3px 4px; vertical-align: middle; }
.fs-editor-table input.form-control, .fs-editor-table select.form-select { font-size: 0.82rem; padding: 3px 8px; }
.fs-editor-table .fs-expr { font-family: var(--dbn-mono); font-size: 0.8rem; }
.fs-code { font-family: var(--dbn-mono); font-size: 0.8rem; }
.fs-fields { max-height: 420px; overflow: auto; font-size: 0.8rem; }
.fs-fields code { cursor: pointer; }
.fs-deps { display: flex; flex-wrap: wrap; gap: 4px; }

/* Print view ------------------------------------------------------------------------------ */
body.fs-print {
    background: #fff;
    color: #14161f;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    margin: 0;
    padding: 18px 22px;
}

body.fs-print .fs-print-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    font-size: 0.8rem;
    color: #5b6275;
}

body.fs-print.fs-screen {
    font-size: 1.15rem;
}

body.fs-print.fs-screen .fs-list-table { font-size: 1.05rem; }

@media print {
    body.fs-print { padding: 0; }
    .fs-print-bar { display: none !important; }
    .fs-list-table tr.fs-page-break { break-before: page; }
    .fs-list-table thead { display: table-header-group; }
    .fs-list-table tr { break-inside: avoid; }
}

.fa-fs-device:before { content: '\f1e6'; }
.fa-fs-results:before { content: '\f681'; }
.fa-fs-pin:before { content: '\f08d'; }
.fa-fs-ranking:before { content: '\f091'; }
.fa-fs-more:before { content: '\f141'; }
.fa-fs-fields:before { content: '\f1c0'; }
.fa-fs-chip:before { content: '\f02b'; }
.fa-fs-edit:before { content: '\f303'; }
.fa-fs-cloud:before { content: '\f0c2'; }

/* Passings: a status is a button that explains why the passing is (not) used. */
.fs-chip-button { border: 0; background: none; padding: 0; cursor: help; }
.fs-explain { border: 0; border-radius: 14px; padding: 1.25rem; width: min(720px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.fs-explain::backdrop { background: rgba(20, 24, 33, .35); }
.fs-explain td { font-size: .85rem; }
.fs-explain tr.fs-explain-nearest td { background: rgba(255, 193, 7, .12); }

/* Athletes: the details panel to the right of the list. */
.fs-athlete-detail { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.fs-athlete-detail td, .fs-athlete-detail dd { font-size: .85rem; }
.fs-detail-place { font-size: 1.6rem; font-weight: 700; }
.fs-detail-time { font-size: 1.3rem; font-weight: 600; }

/* The page body up to 1800px wide (the shell's 1440px is narrow for timing and grids); the drawer makes it narrower. */
body.dbn-admin .dbn-main, body.dbn-admin .dbn-footer { max-width: 1800px; }

/* Athlete details as a slide-in panel (Raw, Timing), under the top bar - the bar stays on top. */
.fs-drawer { --fs-drawer-width: min(560px, 100vw); position: fixed; top: var(--fs-topbar-height, 0px); right: 0; bottom: 0; width: var(--fs-drawer-width); padding: 12px; z-index: 1040; transform: translateX(105%); pointer-events: none; }
.fs-drawer.open { transform: none; pointer-events: auto; }
.fs-drawer .fs-athlete-detail { height: 100%; max-height: none; overflow-y: auto; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }

/* Wide screens: the page body (not the top bar) makes room for the drawer instead of lying under it; on narrow screens there is no room, the drawer covers the page. */
@media (min-width: 1200px) {
    body.dbn-admin.fs-drawer-open .dbn-main, body.dbn-admin.fs-drawer-open .dbn-footer { margin-right: 560px; max-width: min(1800px, calc(100% - 560px)); }
    body.dbn-admin.fs-drawer-open #fs-toasts { right: 560px !important; }
    .fs-drawer .fs-athlete-detail { box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
}

/* Links to an athlete (bib, name) and the "..." row menu. */
[data-athlete] { cursor: pointer; }
[data-athlete]:hover { text-decoration: underline; }
.fs-menu { position: absolute; z-index: 1060; min-width: 190px; padding: 4px; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.fs-menu button { display: block; width: 100%; padding: 6px 10px; border: 0; border-radius: 6px; background: none; text-align: left; font-size: .85rem; }
.fs-menu button:hover:not(:disabled) { background: rgba(0, 0, 0, .06); }
.fs-menu button:disabled { opacity: .4; }

/* Scriban editor (fs-script.js): completion, checks, expand button, large editor */
.fs-expr { font-family: var(--dbn-mono); }
.fs-expr.fs-script-error, [data-script].fs-script-error { border-color: #dc3545; box-shadow: 0 0 0 .15rem rgba(220, 53, 69, .15); }
.fs-expr.fs-script-warn, [data-script].fs-script-warn { border-color: #e0a100; box-shadow: 0 0 0 .15rem rgba(224, 161, 0, .15); }
.fs-complete { position: fixed; z-index: 2000; min-width: 220px; max-width: 520px; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; padding: 3px; border-radius: 8px; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); font-size: .82rem; }
.fs-complete-item { display: flex; align-items: baseline; gap: 6px; padding: 3px 8px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.fs-complete-item.active, .fs-complete-item:hover { background: color-mix(in srgb, var(--dbn-accent) 14%, transparent); }
.fs-complete-name { font-family: var(--dbn-mono); }
.fs-complete-doc { overflow: hidden; text-overflow: ellipsis; color: var(--dbn-text-muted); font-size: .75rem; }
.fs-complete-kind { display: inline-block; width: 1.1em; flex: none; text-align: center; font-weight: 600; color: #6c757d; }
.fs-k-function { color: #7b3fbf; }
.fs-k-field, .fs-k-key { color: #0b6bcb; }
.fs-k-object { color: #b35c00; }
.fs-k-local { color: #198754; }
.fs-script-msg { position: fixed; z-index: 1990; padding: 3px 8px; border-radius: 6px; background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .16); font-size: .78rem; pointer-events: none; }
.fs-msg-error { color: #b02a37; }
.fs-msg-warn { color: #8a6100; }
.fs-msg-ok { color: #198754; }
.fs-script-expand { position: fixed; z-index: 1980; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: rgba(0, 0, 0, .06); color: #555; font-size: .8rem; line-height: 20px; cursor: pointer; }
.fs-script-expand:hover { background: var(--dbn-accent); color: #fff; }
.fs-script-dialog { width: min(1200px, 96vw); max-height: 92vh; padding: 18px 20px; border: 0; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.fs-script-dialog::backdrop { background: rgba(15, 20, 30, .45); }
.fs-codebox { position: relative; height: 46vh; min-height: 220px; border: 1px solid var(--dbn-border); border-radius: 8px; background: #fbfbfd; }
.fs-codebox-hl, .fs-codebox-input { position: absolute; inset: 0; margin: 0; padding: 10px 12px; border: 0; overflow: auto; font: .88rem/1.5 var(--dbn-mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.fs-codebox-hl { pointer-events: none; color: #222; }
.fs-codebox-input { resize: none; background: transparent; color: transparent; caret-color: #111; outline: none; }
.fs-codebox-input::selection { background: rgba(11, 107, 203, .25); }
.fs-codebox-problems { min-height: 1.4rem; font-size: .82rem; }
.fs-codebox-reference { height: calc(46vh + 4.5rem); min-height: 280px; overflow-y: auto; font-size: .8rem; }
.fs-ref-item { padding: 2px 6px; border-radius: 4px; font-family: var(--dbn-mono); cursor: pointer; }
.fs-ref-item:hover { background: color-mix(in srgb, var(--dbn-accent) 12%, transparent); }
.fs-ref-item .fs-hint { font-family: var(--bs-body-font-family); }
.fs-ref-sub { padding-left: 1.6rem; }
.fs-hl-string { color: #a31515; }
.fs-hl-number { color: #098658; }
.fs-hl-keyword { color: #0000c8; font-weight: 600; }
.fs-hl-delim { color: #b35c00; font-weight: 600; }
.fs-hl-text { color: #6c757d; }
.fs-hl-function { color: #7b3fbf; }
.fs-hl-field, .fs-hl-object { color: #0b6bcb; }
.fs-hl-member { color: #0a5a8a; }
.fs-hl-unknown { color: #222; }
.fs-hl-error { text-decoration: underline wavy #dc3545; text-decoration-skip-ink: none; }
.fs-hl-warn { text-decoration: underline wavy #e0a100; text-decoration-skip-ink: none; }

/* Athlete import: the preview with a field per column */
.fs-import-preview { overflow: auto; max-height: 60vh; border: 1px solid var(--dbn-border, #e3e6ee); border-radius: 8px; }
.fs-import-preview table { font-size: 0.82rem; white-space: nowrap; }
.fs-import-preview thead th { position: sticky; top: 0; background: #fff; z-index: 1; min-width: 150px; vertical-align: bottom; }
.fs-import-preview thead tr + tr th { top: 38px; }
.fs-import-preview .fs-import-name { font-weight: 600; color: #5b6275; }
.fs-import-preview .fs-import-ignored { opacity: 0.4; }

/* Event page: PDF preview, stays in view while the layout is edited */
@media (min-width: 1400px) { .fs-pdf-preview-card { position: sticky; top: 84px; } }
.fs-pdf-preview { width: 100%; height: calc(100vh - 220px); min-height: 480px; border: 1px solid #dfe2e8; border-radius: 6px; background: #f7f8fb; }

/* "Add template" dialogs: the templates on the left, the chosen one's options on the right */
.fs-template-list .list-group-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; }
.fs-template-title { font-weight: 600; }
.fs-template-text { font-size: 0.8rem; color: #5b6275; }
.fs-template-list .list-group-item.active .fs-template-text { color: inherit; opacity: 0.85; }

/* Heats: the round tree (rounds hold heats and rounds) */
.fa-fs-heats:before { content: '\f0e8'; }

/* Time fields: how the text reads, under the field while typing */
.fs-time-preview { position: fixed; z-index: 2000; pointer-events: none; padding: 2px 7px; border-radius: 6px; background: var(--dbn-ink, #1d2230); color: #fff; font-family: var(--dbn-mono, monospace); font-size: 0.78rem; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.fs-time-preview[data-tone="bad"] { background: #dc3545; }
.fs-time-preview[hidden] { display: none; }
.fa-fs-round:before { content: '\f07c'; }
.fs-tree { display: flex; flex-direction: column; gap: 2px; }
.fs-tree-node { padding-left: calc(var(--fs-depth, 0) * 18px); }
.fs-tree-node .fs-list-item { justify-content: flex-start; }
.fs-tree-node .fs-tree-icon { width: 16px; text-align: center; opacity: 0.6; }
.fs-tree-node .fs-tree-meta { margin-left: auto; font-size: 0.75rem; opacity: 0.7; white-space: nowrap; }
.fs-tree-node.fs-tree-round > .fs-list-item { font-weight: 600; }

/* Timing: mass start / single start switch */
.fs-timing-modes { display: inline-flex; gap: 4px; }
.fs-timing-modes .btn { border-radius: 999px; }

/* Single timing desk ----------------------------------------------------------------------- */
.fs-desk-heat { min-width: 260px; }
.fs-desk-point { border-left: 4px solid transparent; }
.fs-desk-point[data-blocked="true"] { border-left-color: #dc3545; }
.fs-desk-list { display: flex; flex-direction: column; gap: 4px; min-height: 52px; border-radius: 12px; padding: 2px; }
.fs-desk-list.fs-drop { outline: 2px dashed var(--dbn-accent); outline-offset: 2px; }
.fs-desk-row { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .6); border: 1px solid var(--dbn-border-soft); }
/* Everything on the timing desk that can be dragged (athletes, impulses, the not-taken chip) shows the hand; buttons,
   fields and names inside keep their own pointer */
.fs-desk [draggable="true"], .fs-desk [draggable="true"] * { cursor: grab; }
.fs-desk [draggable="true"]:active, .fs-desk [draggable="true"]:active * { cursor: grabbing; }
.fs-desk [draggable="true"] :where(button, a, input, select, [data-athlete]) { cursor: pointer; }
.fs-desk-row.fs-desk-next { padding: 10px 12px; background: #fff; border-color: var(--dbn-accent); box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.fs-desk-bib { font-family: var(--dbn-mono); font-weight: 700; min-width: 3.2ch; text-align: right; }
.fs-desk-next .fs-desk-bib { font-size: 1.5rem; }
.fs-desk-name { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.fs-desk-name > span:first-child { font-weight: 600; }
.fs-desk-next .fs-desk-name > span:first-child { font-size: 1.15rem; }
.fs-desk-split { white-space: nowrap; }
.fs-desk-time { font-variant-numeric: tabular-nums; min-width: 7ch; text-align: right; white-space: nowrap; }
.fs-desk-next .fs-desk-time[data-running] { font-size: 1.3rem; font-weight: 700; }
.fs-desk-actions { display: flex; gap: 4px; }
.fs-desk-take { min-width: 130px; font-weight: 600; border-radius: 12px; padding: 10px 18px; }
.fs-desk tr.fs-desk-last td { background: rgba(25, 135, 84, .08); }
.fs-desk tr.fs-desk-loaded td { background: rgba(255, 193, 7, .12); }
.fs-desk-impulses tr.fs-desk-free td { background: rgba(255, 193, 7, .10); }
.fs-desk-startlist { max-height: 60vh; overflow-y: auto; }
.fs-flash-chip .fs-chip { font-size: .72rem; vertical-align: middle; }
.fs-desk-dead { display: inline-flex; align-items: center; gap: 4px; margin: 0; white-space: nowrap; }
.fs-desk-dead input { width: 64px; }
/* Next bib at the start / finish (S / F): the athlete with this bib is next there */
.fs-desk-nextbib { display: inline-flex; align-items: center; gap: 4px; margin: 0; white-space: nowrap; }
.fs-desk-nextbib input { width: 72px; }
.fs-desk-split-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1300px) { .fs-desk-split-grid { grid-template-columns: 1fr; } }
/* Narrow screens: the desk's headers wrap, its tables scroll inside their card instead of the page */
.fs-desk > div { min-width: 0; }
.fs-desk .dbn-panel-head { flex-wrap: wrap; gap: 8px; }
.fs-desk .card { overflow-x: auto; }
.fs-desk-heat { min-width: min(260px, 100%); flex: 1 1 260px; max-width: 420px; }
@media (max-width: 575.98px) {
    .fs-desk-row { flex-wrap: wrap; gap: 6px 10px; }
    .fs-desk-name { flex: 1 1 150px; }
    .fs-desk-actions { margin-left: auto; }
}
/* Single timing: the start list on the left, the points in the middle, impulses and finish order on the right;
   narrower the start list stays left beside the points with the right column below them; on small screens one column. */
.fs-timing.fs-desk {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr) minmax(320px, 440px);
    grid-template-areas: "list main side";
    align-items: start;
}
.fs-desk-col-list { grid-area: list; }
.fs-desk-col-main { grid-area: main; }
.fs-desk-col-side { grid-area: side; }
.fs-desk-col-list .fs-desk-startlist { max-height: calc(100vh - 230px); }
/* The start list in its narrow column: tighter cells, the name wraps with its state chip */
.fs-desk-col-list .fs-feed td, .fs-desk-col-list .fs-feed th { padding: 5px 5px; }
.fs-desk-col-list .fs-feed td.fs-desk-sl-name { white-space: normal; }
.fs-desk-col-list .fs-desk-sl-name .fs-chip { font-size: .7rem; }
/* Impulses and finish order in the right column: names and reasons wrap, times stay on one line */
.fs-desk-col-side .fs-feed td, .fs-desk-col-side .fs-feed th { padding: 5px 5px; }
.fs-desk-col-side .fs-feed td { white-space: normal; }
.fs-desk-col-side .fs-feed td.dbn-mono { white-space: nowrap; }
.fs-desk-col-side .fs-feed td:last-child .fs-chip { white-space: normal; }
@media (max-width: 1500px) {
    .fs-timing.fs-desk { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); grid-template-areas: "list main" "list side"; }
}
@media (max-width: 1100px) {
    .fs-timing.fs-desk { grid-template-columns: 1fr; grid-template-areas: "main" "side" "list"; }
    .fs-desk-col-list .fs-desk-startlist { max-height: 60vh; }
}

/* Tabs (Bootstrap nav-tabs) look like the theme's pill navigation in the top bar: a sunken track, the active tab a
   white pill. */
.nav-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px;
    border: 1px solid var(--dbn-surface-edge);
    border-radius: 999px;
    background: var(--dbn-sunken);
}
.nav-tabs .nav-link {
    margin: 0;
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--dbn-text-muted);
    font-weight: 500;
}
.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus-visible {
    border: 0;
    color: var(--dbn-text);
    background: rgba(255, 255, 255, 0.55);
}
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    border: 0;
    background: #fff;
    color: var(--dbn-text);
    box-shadow: var(--dbn-shadow-soft);
}

/* No animations: dialogs, tabs and the athlete panel appear at once (the theme's own transitions too). */
.modal, .modal-backdrop, .tab-pane, .fs-drawer, .dbn-nav-link, .nav-tabs .nav-link, .btn, .form-control, .form-select { transition: none !important; }

/* Check-out / check-in: the bar above every event page. */
.fs-cloudbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 14px; margin-bottom: 16px; border-radius: 8px;
    font-size: .875rem; border: 1px solid transparent; }
.fs-cloudbar[data-tone="live"] { background: color-mix(in srgb, var(--dbn-accent) 9%, transparent); border-color: color-mix(in srgb, var(--dbn-accent) 25%, transparent); }
.fs-cloudbar[data-tone="warn"] { background: color-mix(in srgb, var(--dbn-warn) 10%, transparent); border-color: color-mix(in srgb, var(--dbn-warn) 30%, transparent); }
.fs-cloudbar[data-tone="bad"] { background: color-mix(in srgb, var(--dbn-err) 9%, transparent); border-color: color-mix(in srgb, var(--dbn-err) 28%, transparent); }
.fs-cloudbar-text { flex: 1 1 320px; }
.fs-cloudbar-actions { display: flex; gap: 6px; }

/* Public live results (/live): its own light page, without the admin theme. */
body.fs-live {
    --live-bg: #eef1f7; --live-surface: #fff; --live-text: #14161f; --live-muted: #5b6275; --live-dim: #8a90a2;
    --live-accent: #5570ea; --live-border: rgba(24, 33, 58, 0.1); --live-ok: #17a364; --live-warn: #c98a0b;
    font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    background: var(--live-bg); color: var(--live-text); min-height: 100vh; display: flex; flex-direction: column;
}
.fs-live-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #111318; color: #fff; }
.fs-live-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; letter-spacing: .01em; }
.fs-live-brand:hover { color: #fff; }
.fs-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #6b7080; }
.fs-live-dot[data-tone="live"] { background: #2fd182; box-shadow: 0 0 0 4px rgba(47, 209, 130, .2); }
.fs-live-dot[data-tone="warn"] { background: #f0b429; }
.fs-live-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px 32px; }
.fs-live-foot { text-align: center; color: var(--live-dim); font-size: .75rem; padding: 12px; }
.fs-live-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 2px; }
.fs-live-subtitle { color: var(--live-muted); margin-bottom: 16px; }
.fs-live-empty { color: var(--live-dim); padding: 24px 0; list-style: none; }

.fs-live-events { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.fs-live-events a { display: flex; flex-direction: column; padding: 14px 16px; background: var(--live-surface); border: 1px solid var(--live-border);
    border-radius: 12px; color: inherit; text-decoration: none; }
.fs-live-events a:hover { border-color: var(--live-accent); }
.fs-live-event-name { font-weight: 600; font-size: 1.05rem; }
.fs-live-event-sub { color: var(--live-muted); font-size: .875rem; }

.fs-live-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fs-live-controls .form-select { flex: 0 1 260px; }
.fs-live-controls .form-control { flex: 1 1 200px; }
.fs-live-lists { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.fs-live-folder { width: 100%; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--live-dim); margin-top: 4px; }
.fs-live-pill { border: 1px solid var(--live-border); background: var(--live-surface); color: var(--live-text); border-radius: 999px; padding: 5px 14px; font-size: .875rem; }
.fs-live-pill:hover { border-color: var(--live-accent); }
.fs-live-pill[aria-pressed="true"] { background: #111318; border-color: #111318; color: #fff; }
.fs-live-state { color: var(--live-dim); font-size: .75rem; margin-bottom: 6px; min-height: 1.1em; }
.fs-live-state a { color: var(--live-muted); }
.fs-live-content { background: var(--live-surface); border: 1px solid var(--live-border); border-radius: 12px; padding: 14px 16px; }
.fs-live-scroll { overflow-x: auto; }
.fs-live-content.fs-live-clickable tr[data-id] { cursor: pointer; }
.fs-live-content.fs-live-clickable tr[data-id]:hover td { background: #eef1fd; }

.fs-live-found { list-style: none; padding: 0; margin: 0; }
.fs-live-found li + li { border-top: 1px solid var(--live-border); }
.fs-live-found button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 2px; border: 0; background: none; text-align: left; color: inherit; }
.fs-live-found button:hover { background: #f5f7fc; }
.fs-live-who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fs-live-who small, .fs-live-res small { color: var(--live-muted); }
.fs-live-res { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.fs-live-bib { display: inline-block; min-width: 2.6em; padding: 2px 6px; border-radius: 6px; background: #111318; color: #fff; font-weight: 700;
    font-size: .8rem; text-align: center; font-variant-numeric: tabular-nums; }

.fs-live-result { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.fs-live-place { font-size: 1.6rem; font-weight: 700; }
.fs-live-time { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fs-live-gap { color: var(--live-muted); font-variant-numeric: tabular-nums; }
.fs-live-ranks { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--live-muted); margin-bottom: 12px; }
.fs-live-ranks b { color: var(--live-text); }
.fs-live-facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 0 0 14px; font-size: .9rem; }
.fs-live-facts dt { color: var(--live-muted); font-weight: 400; }
.fs-live-facts dd { margin: 0; }
.fs-live-splits { margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.fs-live-splits tr.fs-live-open td { color: var(--live-dim); }
@media (max-width: 576px) {
    .fs-live-main { padding: 14px 12px 24px; }
    .fs-live-content { padding: 10px; border-radius: 10px; }
    .fs-live-title { font-size: 1.25rem; }
}

/* Accounts: the signed-in user in the top bar. */
.fs-user-link { color: var(--dbn-text-muted); text-decoration: none; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.fs-user-link:hover { color: var(--dbn-text); }
