/* fs-shell: see CLAUDE.md conventions - theme tokens (--dbn-*), --fs-live only for live / action-needed things. */

/* --- Help: the "i" after an element with data-help, and its popover (fs.js help) --------------------------------- */
.fs-help-btn {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 1.15rem; height: 1.15rem; margin-left: .35rem; padding: 0; vertical-align: .05em;
    border: 1px solid var(--dbn-border-strong, var(--dbn-border)); border-radius: var(--dbn-radius-sm);
    background: transparent; color: var(--dbn-text-muted);
    font: 700 .68rem/1 var(--dbn-font, inherit); letter-spacing: 0; text-transform: none; cursor: help;
}
.fs-help-btn::before { content: "i"; font: inherit; }
.fs-help-glue { white-space: nowrap; }
.fs-help-btn:hover, .fs-help-btn[aria-expanded="true"] { background: var(--dbn-hover); color: var(--dbn-text); border-color: var(--dbn-text-muted); }
.fs-help-btn:focus-visible { outline: 2px solid var(--dbn-accent); outline-offset: 2px; }
.fs-help-pop {
    position: fixed; z-index: 2100; max-width: min(340px, calc(100vw - 16px)); max-height: 50vh; overflow-y: auto;
    padding: 10px 12px; border: 1px solid var(--dbn-border); border-radius: var(--dbn-radius);
    background: var(--dbn-popup); color: var(--dbn-text); box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    font-size: .82rem; font-weight: 400; line-height: 1.45; text-align: left; white-space: pre-line;
}
@media (prefers-reduced-motion: no-preference) {
    .fs-help-pop { animation: fs-shell-pop .12s ease-out; }
    .fs-help-pop[data-side="above"] { animation-name: fs-shell-pop-up; }
}
@keyframes fs-shell-pop { from { opacity: 0; transform: translateY(-3px); } }
@keyframes fs-shell-pop-up { from { opacity: 0; transform: translateY(3px); } }

/* --- Jump box (Ctrl+K): a dialog near the top with a field and the matches --------------------------------------- */
.fs-search .fs-kbd-hint {
    position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
    padding: 0; border: 0; background: none; line-height: 1; cursor: pointer;
}
.fs-search:focus-within .fs-kbd-hint { display: none; }
.fs-search:has(.fs-kbd-hint) > .form-control { padding-right: 4.2rem; }
.fs-kbd-hint kbd, .fs-jump-keys kbd {
    display: inline-block; padding: 2px 5px; border: 1px solid var(--dbn-border); border-radius: var(--dbn-radius-sm, 4px);
    background: var(--dbn-sunken, transparent); color: var(--dbn-text-dim); box-shadow: none;
    font: 600 .68rem/1.2 var(--dbn-font, inherit);
}
.fs-jump {
    width: min(620px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 80px)); margin: 10vh auto auto; padding: 0;
    border: 1px solid var(--dbn-border); border-radius: var(--dbn-radius); background: var(--dbn-popup); color: var(--dbn-text);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
.fs-jump[open] { display: flex; flex-direction: column; }
.fs-jump::backdrop { background: var(--dbn-backdrop, rgba(0, 0, 0, .35)); }
.fs-jump-field { position: relative; display: flex; align-items: center; padding: 10px; border-bottom: 1px solid var(--dbn-border-soft, var(--dbn-border)); }
.fs-jump-field > .fa { position: absolute; left: 22px; color: var(--dbn-text-dim); pointer-events: none; }
.fs-jump-field > .form-control { padding-left: 2.1rem; font-size: 1rem; }
.fs-jump-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 6px 6px; }
.fs-jump-group { padding: 8px 8px 3px; color: var(--dbn-text-dim); font-size: .72rem; font-weight: 600; }
.fs-jump-item { display: flex; align-items: baseline; gap: 9px; padding: 7px 8px; border-radius: var(--dbn-radius); cursor: pointer; font-size: .88rem; }
.fs-jump-item > .fa { flex: none; width: 1.1em; color: var(--dbn-text-muted); text-align: center; }
.fs-jump-item.active { background: color-mix(in srgb, var(--dbn-accent) 14%, transparent); }
.fs-jump-bib { flex: none; min-width: 2.5em; font-family: var(--dbn-mono); font-variant-numeric: tabular-nums; color: var(--dbn-text-dim); }
.fs-jump-label { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fs-jump-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dbn-text-muted); font-size: .78rem; }
.fs-jump-here { margin-left: auto; flex: none; color: var(--dbn-text-dim); font-size: .72rem; }
.fs-jump-empty { padding: 14px 10px; color: var(--dbn-text-dim); font-size: .85rem; }
.fs-jump-keys { display: flex; gap: 14px; padding: 7px 12px; border-top: 1px solid var(--dbn-border-soft, var(--dbn-border)); color: var(--dbn-text-dim); font-size: .72rem; }
.fs-jump-keys kbd { margin-right: 2px; }
@media (max-width: 575.98px) {
    .fs-jump { margin-top: 16px; }
    .fs-jump-keys { display: none; }
}

/* --- Race mode: the switch in the top bar (the live accent when on) and the note on a setup page --------------- */
.fs-race-switch {
    display: inline-flex; align-items: center; gap: .4rem; height: 30px; padding: 0 10px;
    border: 1px solid var(--dbn-border); border-radius: 999px; background: transparent; color: var(--dbn-text-muted);
    font-size: .78rem; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.fs-race-switch:hover { background: var(--dbn-hover); color: var(--dbn-text); }
.fs-race-switch:focus-visible { outline: 2px solid var(--dbn-accent); outline-offset: 2px; }
.fs-race-switch.fs-race-on { border-color: var(--fs-live); background: var(--fs-live); color: #fff; }
.fs-race-switch.fs-race-on:hover { border-color: var(--fs-live-hover); background: var(--fs-live-hover); color: #fff; }
.fs-racemode-note {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 12px; padding: 6px 12px;
    border-radius: var(--dbn-radius); background: var(--fs-live-soft); color: var(--dbn-text); font-size: .82rem;
}
.fs-racemode-note > .fa { color: var(--fs-live); }
.fs-racemode-note .btn-link { font-size: inherit; }
@media (max-width: 767.98px) {
    /* Narrow: the flag alone while off; on, the word stays - the state must be seen. */
    .fs-race-switch:not(.fs-race-on) > span { display: none; }
}
