/* ============================================================================
   Blackbox app styles — Seafar Design System (dark Command Center default,
   light product theme via html[data-theme="light"]).
   Tokens/theming live in seafar-tokens.css (linked first — owns @layer order
   and the Radzen import). This sheet contains only layered rules:
     base | radzen-overrides | components | responsive
   Rules consume SEMANTIC tokens (--text-*, --surface-*, --border-*,
   --status-*, --color-primary*, --radius-*) — no raw hex except chrome on
   permanently-dark media surfaces (camera/map/VHF) and ink-tinted shadows.
   Written against Radzen.Blazor 10.4.7 material-base. Bump the ?v= on the
   stylesheet links in index.html with every change (dev caches CSS hard).
   ============================================================================ */

@layer reset {
*, ::before, ::after {
    box-sizing: border-box;
    border: 0 solid var(--border-subtle);
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    line-height: inherit;
}

hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
}

abbr:where([title]) {
    text-decoration: underline dotted;
}

h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
}

a {
    color: inherit;
    text-decoration: inherit;
    color: inherit;
    text-decoration: none;
}

b, strong {
    font-weight: bolder;
}

code, kbd, pre, samp {
    font-family: var(--font-mono);
    font-size: 1em;
}

small {
    font-size: 80%;
}

sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sub {
    bottom: -0.25em;
}

sup {
    top: -0.5em;
}

table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
}

button, input, optgroup, select, textarea {
    font-family: inherit;
    font-size: 100%;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
}

button, select {
    text-transform: none;
}

button, [type="button"], [type="reset"], [type="submit"] {
    -webkit-appearance: button;
    background-color: transparent;
    background-image: none;
}

:-moz-focusring {
    outline: auto;
}

:-moz-ui-invalid {
    box-shadow: none;
}

progress {
    vertical-align: baseline;
}

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
    height: auto;
}

[type="search"] {
    -webkit-appearance: textfield;
    outline-offset: -2px;
}

::-webkit-search-decoration {
    -webkit-appearance: none;
}

::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit;
}

summary {
    display: list-item;
}

blockquote, dd, dl, figure, h1, h2, h3, h4, h5, h6, hr, p, pre {
    margin: 0;
}

fieldset {
    margin: 0;
    padding: 0;
}

legend {
    padding: 0;
}

menu, ol, ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

dialog {
    padding: 0;
}

textarea {
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    opacity: 1;
    color: var(--text-dim);
}

[role="button"], button {
    cursor: pointer;
}

:disabled {
    cursor: default;
}

audio, canvas, embed, iframe, img, object, svg, video {
    display: block;
    vertical-align: middle;
}

img, video {
    max-width: 100%;
    height: auto;
}

[hidden]:where(:not([hidden="until-found"])) {
    display: none;
}
}

@layer base {

html,
body,
#app {
    font-family: var(--font-sans);
    background: var(--surface-page);
    color: var(--text-body);
    min-height: 100%;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Command Center ground: faint dotted control-room grid (none in light theme) */
body {
    background-image: var(--page-grid);
    background-size: var(--page-grid-size);
}

::selection {
    background: color-mix(in srgb, var(--color-primary) 35%, transparent);
    color: var(--text-strong);
}

:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Telemetry / timestamps / IDs — the DS mandates tabular mono for data */
.seafar-data,
.mono-data {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}
}
@layer radzen-overrides {

.rz-dialog-wrapper {
    background: transparent;
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Dropdown/multiselect type-to-filter box. The theme already paints the popup and leaves the
   filter input transparent, so this only adds the gap between the search icon and the first
   typed character (the container is row-reverse, so the input sits flush against the icon and
   Radzen zeroes its padding). The old hardcoded near-black background is deliberately gone: it
   applied to single-select dropdowns only, rendering a black box inside light-themed dialogs. */
.rz-dropdown-filter-container .rz-inputtext,
.rz-multiselect-filter-container .rz-inputtext,
.rz-dropdown-filter {
    padding-left: 0.5rem;
}

.blackbox-grid tr:hover td *,
.blackbox-grid .rz-selectable tbody tr:hover td *,
.blackbox-grid .rz-datatable-data tr:hover td *,
.blackbox-grid .rz-data-row:hover td * {
    color: inherit;
}
.blackbox-grid .footage-check {
    appearance: none;
    width: 1.05rem;
    height: 1.05rem;
    border: 1px solid var(--blackbox-border);
    border-radius: 3px;
    background: var(--blackbox-surface);
    pointer-events: none;
}

.blackbox-grid .footage-check:checked {
    border-color: var(--blackbox-primary);
    background: var(--blackbox-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E") center / 0.75rem no-repeat;
}

.blackbox-grid .rz-paginator-page,
.blackbox-grid .rz-paginator-first,
.blackbox-grid .rz-paginator-prev,
.blackbox-grid .rz-paginator-next,
.blackbox-grid .rz-paginator-last {
    color: var(--text-muted);
    border-radius: var(--bb-radius-pill);
}

.blackbox-grid .rz-state-active {
    background: color-mix(in srgb, var(--color-primary) 22%, transparent);
    color: var(--text-strong);
}

.rz-notification {
    width: min(440px, calc(100vw - 2rem));
}

.rz-notification-message,
.rz-growl-message {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: #dff7f4;
}

.rz-notification-detail,
.rz-growl-message p {
    color: #b7d7d3;
    overflow-wrap: anywhere;
}

.rz-notification-icon,
.rz-growl-image {
    color: #5eead4;
}
.blackbox-grid .footage-row-actions .rz-button,
.blackbox-grid .footage-row-actions .rz-button i,
.blackbox-grid tr:hover td .footage-row-actions .rz-button,
.blackbox-grid tr:hover td .footage-row-actions .rz-button i {
    color: var(--blackbox-primary);
}

/* Form fields read as wells: a lighter surface than the card behind them
   plus a visible hairline (seafar.eu form pattern). */
.rz-inputtext,
.rz-textbox,
.rz-textarea,
.rz-dropdown,
.rz-numeric,
.rz-datepicker,
.rz-spinner,
.rz-calendar .rz-inputtext,
.rz-multiselect {
    border: 1px solid var(--input-border);
    border-radius: var(--radius-input);
    background: var(--input-bg);
    color: var(--text-strong);
    transition: border-color var(--dur-fast) var(--ease),
                box-shadow var(--dur-fast) var(--ease);
}

.rz-dropdown-label,
.rz-multiselect-label,
.rz-numeric input,
.rz-datepicker input,
.rz-dropdown .rz-inputtext,
.rz-datepicker .rz-inputtext,
.rz-numeric .rz-inputtext,
.rz-spinner input {
    border: 0;
    box-shadow: none;
    background: transparent;
    color: var(--text-strong);
}

.rz-inputtext:hover:not(:focus),
.rz-textarea:hover:not(:focus),
.rz-dropdown:hover:not(:focus-within),
.rz-multiselect:hover:not(:focus-within),
.rz-datepicker:hover:not(:focus-within),
.rz-numeric:hover:not(:focus-within) {
    border-color: color-mix(in srgb, var(--color-primary) 50%, transparent);
}

.rz-inputtext:focus,
.rz-textarea:focus,
.rz-dropdown:focus-within,
.rz-multiselect:focus-within,
.rz-datepicker:focus-within,
.rz-numeric:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 16%, transparent);
    outline: none;
}

.rz-placeholder,
.rz-dropdown-label.rz-placeholder {
    color: var(--text-dim);
}

/* Chevron/stepper affordances float on the field itself — no second surface */
.rz-dropdown-trigger,
.rz-multiselect-trigger,
.rz-datepicker-trigger,
.rz-spinner-button {
    color: var(--text-muted);
    background: transparent;
    border: 0;
}

.rz-dropdown:hover .rz-dropdown-trigger,
.rz-dropdown:focus-within .rz-dropdown-trigger,
.rz-datepicker:hover .rz-datepicker-trigger,
.rz-numeric:hover .rz-spinner-button {
    color: var(--color-primary);
}

.rz-dropdown-panel,
.rz-multiselect-panel,
.rz-autocomplete-panel,
.rz-context-menu,
.rz-calendar {
    border-color: var(--blackbox-border);
    background: var(--surface-card);
    color: var(--text-body);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .16);
    border: 1px solid color-mix(in srgb, var(--color-primary) 24%, transparent);
    border-radius: var(--bb-radius-md);
    overflow: hidden;
}

.rz-dropdown-items,
.rz-dropdown-item,
.rz-multiselect-item,
.rz-autocomplete-list-item,
.rz-calendar td,
.rz-calendar th {
    background: var(--surface-card);
    color: var(--text-body);
}

.rz-dropdown-item:hover,
.rz-dropdown-item.rz-state-hover,
.rz-multiselect-item:hover,
.rz-autocomplete-list-item:hover,
.rz-state-highlight,
.rz-dropdown-item.rz-state-highlight {
    background: var(--surface-hover);
    color: var(--color-primary-active);
}

/* ---------------------------------------------------------------------------
   Button system (seafar.eu): a solid accent button and an outlined companion.
   Primary  — accent fill, inverse text; hover brightens the fill.
   Secondary/light/ghost — transparent with an accent hairline; hover FILLS
   with the accent and flips the text to inverse.
   Near-sharp corners on dark, soft on light (via --radius-button).
   --------------------------------------------------------------------------- */
.rz-button {
    border-radius: var(--radius-button);
    border: 1px solid transparent;
    font-weight: 600;
    letter-spacing: .01em;
    transition: background-color var(--dur-fast) var(--ease),
                border-color var(--dur-fast) var(--ease),
                color var(--dur-fast) var(--ease),
                box-shadow var(--dur-fast) var(--ease),
                translate var(--dur-fast) var(--ease);
}

/* `translate` composes with Radzen's own `transform` (the date picker trigger
   is centred with translateY(-50%)); overriding `transform` slides that trigger
   13px on press, the release misses it and the calendar never opens. */
.rz-button:active:not(.rz-state-disabled) {
    translate: 0 1px;
}

.rz-button.rz-primary,
.rz-button.rz-button-md.rz-primary,
.rz-button.rz-button-sm.rz-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
}

.rz-button.rz-primary:hover:not(.rz-state-disabled),
.rz-button.rz-primary:focus-visible:not(.rz-state-disabled) {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--color-on-primary);
    box-shadow: var(--glow-primary);
}

.rz-button.rz-secondary,
.rz-button.rz-light,
.rz-button.rz-base {
    background-color: transparent;
    border-color: color-mix(in srgb, var(--color-primary) 55%, transparent);
    color: var(--color-primary);
}

.rz-button.rz-secondary:hover:not(.rz-state-disabled),
.rz-button.rz-secondary:focus-visible:not(.rz-state-disabled),
.rz-button.rz-light:hover:not(.rz-state-disabled),
.rz-button.rz-light:focus-visible:not(.rz-state-disabled),
.rz-button.rz-base:hover:not(.rz-state-disabled),
.rz-button.rz-base:focus-visible:not(.rz-state-disabled) {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
}

.rz-chart {
    color: var(--blackbox-text);
}

.rz-chart .rz-legend-item {
    color: var(--blackbox-text);
}

.rz-chart-tooltip-content {
    border: 1px solid var(--blackbox-border);
    backdrop-filter: blur(16px);
}

.rz-chart-tooltip-title,
.rz-chart-tooltip-item-content,
.rz-chart-tooltip-item-value {
    color: var(--blackbox-text);
}

.blackbox-grid {
    --rz-grid-header-background-color: var(--surface-raised);
    --rz-grid-cell-color: var(--text-body);
    --rz-grid-background-color: var(--surface-card);
    /* Radzen's per-cell rules drew vertical dividers once the element reset
       stopped suppressing them; keep horizontal separation only. */
    --rz-grid-cell-border: none;
    --rz-grid-right-cell-border: none;
    --rz-grid-header-cell-border: none;
    --rz-grid-frozen-cell-border: none;
    --rz-grid-group-header-item-border: none;
}

.rz-data-grid,
.rz-datatable,
.blackbox-grid .rz-data-grid,
.blackbox-grid .rz-datatable {
    background: var(--surface-card);
    color: var(--text-body);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.blackbox-grid .rz-grid-table,
.blackbox-grid table,
.blackbox-grid .rz-datatable-data,
.blackbox-grid .rz-datatable-scrollable-body {
    background: var(--surface-card);
    color: var(--text-body);
}

.blackbox-grid .rz-column-title,
.blackbox-grid .rz-sortable-column,
.blackbox-grid .rz-sortable-column-icon,
.blackbox-grid th,
.blackbox-grid .rz-datatable-thead th {
    color: var(--text-body);
}

.blackbox-grid th,
.blackbox-grid .rz-datatable-thead th {
    background: var(--surface-raised);
    border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 24%, transparent);
    font-size: .72rem;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.blackbox-grid td,
.blackbox-grid .rz-datatable-data td {
    
    background: var(--surface-card);
    color: var(--text-body);
    border-bottom: 1px solid rgba(255,255,255,.075);
}

.blackbox-grid tr:nth-child(even) td,
.blackbox-grid .rz-datatable-even td {
    background: color-mix(in srgb, var(--text-strong) 3%, transparent);
}

.blackbox-grid .rz-selectable tbody tr,
.blackbox-grid .rz-data-row {
    cursor: pointer;
}

.blackbox-grid tr:hover td,
.blackbox-grid .rz-selectable tbody tr:hover td,
.blackbox-grid .rz-datatable-data tr:hover td,
.blackbox-grid .rz-datatable-data tr.rz-state-highlight td,
.blackbox-grid .rz-data-row:hover td {
    background: color-mix(in srgb, var(--color-primary) 12%, var(--surface-card));
    color: var(--text-strong);
}

/* Accent edge marks the hovered row without shifting layout */
.blackbox-grid .rz-selectable tbody tr:hover td:first-child,
.blackbox-grid .rz-data-row:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.blackbox-grid .rz-paginator,
.blackbox-grid .rz-pager {
    border-top-color: var(--blackbox-border);
    background: var(--surface-card);
    color: var(--text-body);
    border-top: 1px solid rgba(255,255,255,.09);
}

.rz-dialog-mask {
    background: var(--surface-scrim);
    backdrop-filter: blur(5px);
}

.rz-dialog {
    border-color: var(--blackbox-border);
    background: var(--surface-card);
    color: var(--text-body);
    box-shadow: 0 24px 80px rgba(15, 23, 42, .18);
    border: 1px solid var(--blackbox-border);
    border-radius: var(--radius-panel);
    max-width: calc(100vw - 3rem);
    max-height: calc(100vh - 3rem);
    overflow: hidden;
}

.rz-dialog-titlebar {
    border-bottom-color: var(--blackbox-border);
    background: var(--surface-card);
    color: var(--text-strong);
    border-bottom: 0;
    padding-bottom: 1.05rem;
}

.rz-dialog-content {
    color: var(--text-body);
    padding: 1.65rem;
    padding-top: 1.15rem;
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
}

/* Focus lands on the dialog body when it opens (see blackboxDialogs.focusNext); the ring belongs on the controls. */
.rz-dialog-content:focus {
    outline: none;
}

.blackbox-grid .rz-data-grid,
.blackbox-grid .rz-datatable {
    border-radius: var(--radius-input);
}

.rz-datepicker-calendar .rz-state-highlight,
.rz-calendar .rz-state-highlight,
.rz-calendar .rz-state-active,
.rz-calendar td.rz-state-highlight,
.rz-calendar td.rz-state-active {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.rz-calendar .rz-button.rz-primary,
.rz-datepicker .rz-button.rz-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
}
.rz-notification-item-wrapper {
    background: transparent;
    border-radius: var(--radius-input);
}

.rz-notification-item,
.rz-growl-item {
    border: 1px solid var(--blackbox-border);
    border-radius: var(--radius-input);
    background: var(--surface-card);
    color: var(--text-body);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .16);
    overflow: hidden;
}

.rz-notification-summary,
.rz-growl-title {
    color: var(--text-strong);
    font-weight: 800;
}

.rz-notification-message,
.rz-growl-message,
.rz-notification-detail,
.rz-growl-message p {
    color: var(--text-body);
}

.rz-notification-success,
.rz-growl-success {
    border-left: 0;
    box-shadow: inset 4px 0 0 var(--status-good), 0 18px 50px rgba(15, 23, 42, .16);
}

.rz-notification-info,
.rz-growl-info {
    border-left: 0;
    box-shadow: inset 4px 0 0 var(--color-primary), 0 18px 50px rgba(15, 23, 42, .16);
}

.rz-notification-warning,
.rz-growl-warning {
    border-left: 0;
    box-shadow: inset 4px 0 0 var(--status-warn), 0 18px 50px rgba(15, 23, 42, .16);
}

.rz-notification-error,
.rz-growl-error {
    border-left: 0;
    box-shadow: inset 4px 0 0 var(--status-bad), 0 18px 50px rgba(15, 23, 42, .16);
}

.timeline-controls .timeline-speed-dropdown .rz-dropdown-label {
    color: var(--text-body);
}

.timeline-controls .timeline-speed-dropdown .rz-dropdown-trigger {
    background: var(--surface-sunken);
    color: var(--blackbox-primary-dark);
}

.rz-multiselect-header {
    background: var(--surface-card);
    color: var(--text-body);
}

.rz-multiselect-header:hover {
    background: var(--surface-hover);
    color: var(--color-primary-active);
}

.rz-multiselect-header .rz-chkbox-box,
.rz-multiselect-item .rz-chkbox-box {
    border: 1px solid color-mix(in srgb, var(--color-primary) 28%, transparent);
    background: var(--surface-card);
    box-shadow: none;
}

.rz-multiselect-header:hover .rz-chkbox-box,
.rz-multiselect-header .rz-chkbox-box:hover,
.rz-multiselect-header .rz-chkbox-box.rz-state-hover,
.rz-multiselect-header .rz-chkbox-box.rz-state-focus,
.rz-multiselect-item:hover .rz-chkbox-box,
.rz-multiselect-item .rz-chkbox-box:hover,
.rz-multiselect-item .rz-chkbox-box.rz-state-hover,
.rz-multiselect-item .rz-chkbox-box.rz-state-focus {
    border-color: color-mix(in srgb, var(--color-primary) 52%, transparent);
    background: var(--surface-hover);
}

.rz-multiselect-header .rz-chkbox-box.rz-state-active,
.rz-multiselect-header:hover .rz-chkbox-box.rz-state-active,
.rz-multiselect-header .rz-chkbox-box.rz-state-active.rz-state-hover,
.rz-multiselect-header .rz-chkbox-box.rz-state-active:hover,
.rz-multiselect-item .rz-chkbox-box.rz-state-active,
.rz-multiselect-item:hover .rz-chkbox-box.rz-state-active,
.rz-multiselect-item .rz-chkbox-box.rz-state-active.rz-state-hover,
.rz-multiselect-item .rz-chkbox-box.rz-state-active:hover {
    border-color: var(--blackbox-primary);
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.rz-multiselect-header .rz-chkbox-icon,
.rz-multiselect-item .rz-chkbox-icon {
    color: var(--color-on-primary);
}

.rz-calendar .rz-button.rz-primary:hover,
.rz-calendar .rz-button.rz-primary:focus-visible,
.rz-datepicker .rz-button.rz-primary:hover,
.rz-datepicker .rz-button.rz-primary:focus-visible {
    background: var(--color-primary-active);
    border-color: var(--color-primary-active);
    color: var(--color-on-primary);
}

.rz-datepicker-popup-container,
.rz-datepicker-footer {
    --rz-secondary: var(--color-primary);
    --rz-secondary-dark: var(--color-primary-active);
    --rz-secondary-darker: var(--color-primary-active);
    --rz-on-secondary: var(--color-on-primary);
    --rz-on-secondary-dark: var(--color-on-primary);
    --rz-on-secondary-darker: var(--color-on-primary);
}

.rz-datepicker-popup-container .rz-calendar-header .rz-button,
.rz-datepicker-popup-container .rz-calendar-prev,
.rz-datepicker-popup-container .rz-calendar-next {
    background: transparent;
    background-color: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--rz-datepicker-header-color);
}

.rz-datepicker-popup-container .rz-calendar-prev .rzi,
.rz-datepicker-popup-container .rz-calendar-next .rzi {
    color: var(--rz-datepicker-header-color);
}

.rz-datepicker-popup-container .rz-calendar-header .rz-button:hover:not(.rz-state-disabled),
.rz-datepicker-popup-container .rz-calendar-header .rz-button:focus-visible:not(.rz-state-disabled),
.rz-datepicker-popup-container .rz-calendar-prev:hover:not(.rz-state-disabled),
.rz-datepicker-popup-container .rz-calendar-prev:focus-visible:not(.rz-state-disabled),
.rz-datepicker-popup-container .rz-calendar-next:hover:not(.rz-state-disabled),
.rz-datepicker-popup-container .rz-calendar-next:focus-visible:not(.rz-state-disabled) {
    background: var(--surface-hover);
    background-color: var(--surface-hover);
    border-color: transparent;
    color: var(--blackbox-primary-dark);
}

.rz-datepicker-popup-container .rz-calendar-header .rz-button:hover:not(.rz-state-disabled) .rzi,
.rz-datepicker-popup-container .rz-calendar-header .rz-button:focus-visible:not(.rz-state-disabled) .rzi,
.rz-datepicker-popup-container .rz-calendar-prev:hover:not(.rz-state-disabled) .rzi,
.rz-datepicker-popup-container .rz-calendar-prev:focus-visible:not(.rz-state-disabled) .rzi,
.rz-datepicker-popup-container .rz-calendar-next:hover:not(.rz-state-disabled) .rzi,
.rz-datepicker-popup-container .rz-calendar-next:focus-visible:not(.rz-state-disabled) .rzi {
    color: var(--blackbox-primary-dark);
}

.rz-datepicker-footer .rz-button.rz-secondary,
.rz-datepicker-footer .rz-button.rz-secondary.rz-shade-default {
    background: var(--blackbox-primary);
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
}

.rz-datepicker-footer .rz-button.rz-secondary:hover,
.rz-datepicker-footer .rz-button.rz-secondary:focus-visible,
.rz-datepicker-footer .rz-button.rz-secondary.rz-shade-dark,
.rz-datepicker-footer .rz-button.rz-secondary.rz-shade-darker {
    background: var(--blackbox-primary-dark);
    background-color: var(--blackbox-primary-dark);
    border-color: var(--blackbox-primary-dark);
}
/* Tabs read as a nav rail: spaced items, muted until active, accent underline
   on the selected one. Padding is stated explicitly rather than inherited from
   Radzen — the tab header element differs by version (<a> vs <button>). */
.rz-tabview .rz-tabview-nav {
    gap: var(--space-2);
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
}

.rz-tabview .rz-tabview-nav li,
.rz-tabview .rz-tabview-nav .rz-tabview-nav-item {
    border: 0;
    margin: 0;
    padding: 0;
}

.rz-tabview .rz-tabview-nav li a,
.rz-tabview .rz-tabview-nav li button,
.rz-tabview .rz-tabview-nav .rz-tabview-nav-item a,
.rz-tabview .rz-tabview-nav .rz-tabview-nav-item button {
    padding: .7rem 1.1rem;
    border: 0;
    border-bottom: 2px solid transparent;
    /* sit on top of the nav's 1px rule so the two never read as two lines */
    margin-bottom: -1px;
    white-space: nowrap;
}

.rz-tabview .rz-tabview-nav li a,
.rz-tabview .rz-tabview-nav li button,
.rz-tabview .rz-tabview-nav li .rz-tabview-title,
.rz-tabview .rz-tabview-nav .rz-tabview-nav-item a,
.rz-tabview .rz-tabview-nav .rz-tabview-nav-item button,
.rz-tabview .rz-tabview-nav .rz-tabview-nav-item .rz-tabview-title {
    color: var(--text-muted);
    font-weight: 600;
    transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.rz-tabview .rz-tabview-nav li:hover a,
.rz-tabview .rz-tabview-nav li:hover button,
.rz-tabview .rz-tabview-nav li:hover .rz-tabview-title,
.rz-tabview .rz-tabview-nav li.rz-state-focused a,
.rz-tabview .rz-tabview-nav li.rz-state-focused button {
    color: var(--color-primary);
}

.rz-tabview .rz-tabview-nav li.rz-tabview-selected a,
.rz-tabview .rz-tabview-nav li.rz-state-active a,
.rz-tabview .rz-tabview-nav li.rz-tabview-selected button,
.rz-tabview .rz-tabview-nav li.rz-state-active button,
.rz-tabview .rz-tabview-nav li.rz-tabview-selected .rz-tabview-title,
.rz-tabview .rz-tabview-nav li.rz-state-active .rz-tabview-title {
    color: var(--color-primary);
}

.rz-tabview .rz-tabview-nav li.rz-tabview-selected a,
.rz-tabview .rz-tabview-nav li.rz-state-active a,
.rz-tabview .rz-tabview-nav li.rz-tabview-selected button,
.rz-tabview .rz-tabview-nav li.rz-state-active button {
    border-bottom-color: var(--color-primary);
}
.blackbox-grid .rz-datatable-data tr.rz-selected td,
.blackbox-grid .rz-data-row.rz-selected td,
.blackbox-grid .rz-selectable tbody tr.rz-state-highlight td,
.blackbox-grid tr.rz-selected td,
.blackbox-grid tr:focus-within td {
    background: var(--surface-hover);
    color: var(--text-strong);
}

.blackbox-grid tr.rz-selected td *,
.blackbox-grid .rz-data-row.rz-selected td *,
.blackbox-grid tr.rz-state-highlight td *,
.blackbox-grid tr:focus-within td * {
    color: inherit;
}
.blackbox-grid .candidate-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .15rem;
}

.blackbox-grid .candidate-actions .rz-button,
.blackbox-grid tr:hover td .candidate-actions .rz-button {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.blackbox-grid .candidate-actions .rz-button,
.blackbox-grid .candidate-actions .rz-button i,
.blackbox-grid .candidate-actions .rz-button .rzi,
.blackbox-grid tr:hover td .candidate-actions .rz-button,
.blackbox-grid tr:hover td .candidate-actions .rz-button i,
.blackbox-grid tr:hover td .candidate-actions .rz-button .rzi {
    color: var(--color-primary);
}

.blackbox-grid .candidate-actions .rz-button:hover,
.blackbox-grid .candidate-actions .rz-button:focus-visible,
.blackbox-grid tr:hover td .candidate-actions .rz-button:hover {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    box-shadow: none;
}
.blackbox-grid th.candidate-actions-col,
.blackbox-grid td.candidate-actions-col {
    padding-right: 1.1rem;
}
.manage-footage .blackbox-grid .rz-group-row td,
.manage-footage .blackbox-grid .rz-group-row:hover td {
    background: var(--surface-raised);
    border: 0;
}

/* The expander cell/button carry no chrome of their own */
.blackbox-grid .rz-group-row td:first-child,
.blackbox-grid td.rz-col-icon,
.blackbox-grid .rz-group-row .rz-button {
    border: 0;
    box-shadow: none;
}

.manage-footage .blackbox-grid .rz-group-row strong {
    color: var(--color-primary);
    letter-spacing: .02em;
}
.manage-footage .blackbox-grid .rz-group-row .rz-button,
.manage-footage .blackbox-grid .rz-group-row .rz-button:hover,
.manage-footage .blackbox-grid .rz-group-row .rz-button:focus,
.manage-footage .blackbox-grid .rz-group-row .rz-button:focus-visible,
.manage-footage .blackbox-grid .rz-group-row .rz-button:active,
.manage-footage .blackbox-grid .rz-group-row .rz-button.rz-state-focused {
    background: transparent;
    background-color: transparent;
    box-shadow: none;
    outline: none;
    color: var(--blackbox-primary-dark);
}
.manage-footage .blackbox-grid tr.rz-datatable-edit td {
    background: var(--surface-hover);
    border-left: none;
    border-right: none;
    box-shadow: none;
}
.blackbox-grid tr:hover td .footage-row-actions .rz-button:hover,
.blackbox-grid tr:hover td .footage-row-actions .rz-button:hover .rzi,
.blackbox-grid tr:hover td .footage-row-actions .rz-button:hover i,
.blackbox-grid .footage-row-actions .rz-button:focus-visible,
.blackbox-grid .footage-row-actions .rz-button:focus-visible .rzi,
.blackbox-grid .footage-row-actions .rz-button:focus-visible i {
    color: var(--blackbox-primary-dark);
}
.blackbox-grid .footage-row-actions .rz-button:hover .rzi,
.blackbox-grid .footage-row-actions .rz-button:hover .rz-button-box,
.blackbox-grid .footage-row-actions .rz-button:hover i,
.blackbox-grid .footage-row-actions .rz-button:focus-visible .rzi,
.blackbox-grid .footage-row-actions .rz-button:focus-visible .rz-button-box,
.blackbox-grid .footage-row-actions .rz-button:focus-visible i {
    background: transparent;
}

.blackbox-grid .footage-row-actions .rz-button:hover,
.blackbox-grid .footage-row-actions .rz-button:focus-visible {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    box-shadow: none;
}
}
@layer components {

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.eyebrow, small, dt {
    color: var(--blackbox-muted);
}

.candidate-refresh-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--blackbox-primary);
    border-radius: var(--radius-card);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.candidate-refresh-message {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    color: var(--blackbox-primary);
    font-weight: 700;
}

.candidate-refresh-message i {
    color: inherit;
}

.header-action-button {
    border: 1px solid var(--blackbox-border);
    border-radius: var(--bb-radius-pill);
    padding: .5rem .95rem;
    background: rgba(255,255,255,.06);
    color: #e2f3f1;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.login-card h1 {
    margin: .1rem 0;
}

.login-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.login-support-copy {
    color: #a9cbc6;
    margin: 0;
}

.hero-panel h1 {
    margin: .35rem 0;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1;
}

.hero-copy {
    max-width: 760px;
    color: #b7d7d3;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: .8rem;
    min-width: 390px;
}

.hero-stats div {
    border: 1px solid var(--blackbox-border);
    border-radius: 22px;
    background: rgba(0,0,0,.18);
    padding: 1rem;
}

.hero-stats span {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--blackbox-primary-dark);
}

.toolbar-grid, .incident-form-grid, .dialog-form-grid, .upload-grid, .analysis-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

/* Direct child only: as a descendant selector this also caught Radzen's own
   spans inside a field (the trigger icon shrank to 12px and the selected value
   rendered uppercase + letter-spaced), which is why dialog dropdowns looked
   different from the dashboard filters. */
label > span,
.filter-field > span {
    display: block;
    margin-bottom: .35rem;
    color: var(--blackbox-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
}

.span-2 {
    grid-column: span 2;
}

.toolbar-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    margin-top: 1rem;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    margin-top: 1.25rem;
}
/* The time-shift note belongs with its inputs — tuck it up close and pull the file picker
   nearer, so two full grid gaps don't stack between the time shift and the upload. */
/* VHF and camera stack a control block beside the picker in the top row, so their grids have an
   extra track above the file list (which stays the flexible, scrolling row). */

/* Camera upload carries four controls (mapping, bulk position, shift h/m) — 2x2 beside the picker. */

.retained-file-input {
    display: none;
}

/* Upload tabs read better in sentence case — undo the global uppercase label treatment
   (which was designed for caps, hence the tighter letter-spacing here). */
/* Upload lists reuse the manage-grid look: a plain table under .blackbox-grid picks up the shared
   th/td/striping/hover rules. The wrapper is the scroller; the header row stays pinned. */

/* Radzen grid headers override the .blackbox-grid th font rules via .rz-column-title, which reads
   these theme variables. Use the same variables so our plain th renders identically to the manage
   grids (letter-spacing and color still come from .blackbox-grid th, as they do there).
   Doubled class outranks the later .blackbox-grid th rule. */

/* File names carry the recording timestamp, so they are checked against the
   parsed start time — wrap the full name instead of ellipsizing it away. */

/* Manage-footage grid: same reasoning as .upload-table-file strong — show the
   whole name (wrapping if needed) rather than cutting the timestamp off. */
.footage-file-name {
    display: block;
    overflow-wrap: anywhere;
    white-space: normal;
}

.file-hint {
    color: var(--blackbox-muted);
}

/* batch-wide progress shown above the actions while a multi-file upload runs */

.upload-status {
    border-radius: var(--bb-radius-pill);
    padding: .25rem .55rem;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.upload-status-uploading {
    background: rgba(96,165,250,.16);
    color: #bfdbfe;
}

.upload-status-succeeded {
    background: color-mix(in srgb, var(--color-primary) 18%, transparent);
    color: #99f6e4;
}

.upload-status-failed {
    background: color-mix(in srgb, var(--status-bad) 18%, transparent);
    color: #fecaca;
}

.upload-error {
    margin-top: .75rem;
    color: #fecaca;
    word-break: break-word;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.section-heading h2, .content-card h2 {
    margin: .2rem 0 .8rem;
}

.dialog-intro {
    margin-bottom: 1.25rem;
}

.dialog-intro h2 {
    margin: .25rem 0 .35rem;
    color: var(--text-strong);
}

.dialog-intro p:not(.eyebrow), .section-copy, .file-hint {
    color: #a9cbc6;
}

/* Display-only footage indicator: pointer-events instead of disabled (browsers grey out
   disabled checkboxes), and hand-drawn instead of accent-color (the browser picks the
   checkmark color there — black on our teal; we want white). */

dl {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: .5rem .8rem;
}

dd {
    margin: 0;
}

.camera-layout-shell {
    display: grid;
    gap: 1rem;
}

.media-grid {
    display: grid;
    gap: 1rem;
}

.media-grid-regular {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.media-grid-secondary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.timeline-icon-button i,
.vhf-channel-icon-button i {
    font-size: 1.05rem;
}

.camera-footage-status {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: .85rem 1rem;
    border: 1px solid var(--blackbox-border);
    border-radius: var(--radius-card);
    background: radial-gradient(circle at left, color-mix(in srgb, var(--color-primary) 10%, transparent), rgba(2,8,9,.6));
    color: var(--blackbox-muted);
}

.camera-footage-status strong {
    color: #dff7f4;
}

.candidate-actions {
    display: inline-flex;
    gap: .35rem;
    align-items: center;
}
.footage-row-actions {
    display: inline-flex;
    gap: .25rem;
    align-items: center;
}

/* Color the icon-only action buttons with the theme accent in both rest and row-hover states
   (the generic grid hover rule otherwise darkens them to near-black). */

.footage-group-count {
    margin-left: .5rem;
    color: var(--blackbox-muted);
    font-size: .78rem;
}

/* Fixed-height, scrollable footage grid so the dialog does not grow with the number of rows. */
.manage-footage {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}
.navigation-map-canvas {
    width: 100%;
    height: 220px;
    background: #081012;
}
.navigation-map-meta {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .7rem .85rem .85rem;
    border-top: 1px solid var(--blackbox-border);
    color: var(--blackbox-muted);
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
}

.navigation-map-meta strong {
    color: #dff7f4;
    margin-right: .35rem;
}

.empty-state {
    display: grid;
    place-items: center;
    color: var(--blackbox-muted);
}

/* Text-message empty states keep their breathing room; .camera-empty must not — it sits in a
   height-stretched grid row next to fixed-height video panels, and margin here made empty panels
   ~100px taller than video ones, stretching the video panels and padding their bottoms. */
.empty-state {
    margin: 50px;
}

.timeline-jump-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--blackbox-primary);
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: .18rem;
    cursor: pointer;
}

.timeline-jump-link:hover,
.timeline-jump-link:focus-visible {
    color: var(--blackbox-primary-dark);
    outline: 0;
}

.camera-segment-list span {
    flex: 0 0 auto;
    border: 1px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
    border-radius: var(--bb-radius-pill);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    color: var(--blackbox-text);
    font-size: .78rem;
    padding: .3rem .55rem;
}

.camera-segment-list small {
    margin-left: .35rem;
    color: var(--blackbox-muted);
}
.actions-list {
    display: grid;
    gap: .8rem;
}

.action-row {
    border: 1px solid var(--blackbox-border);
    border-radius: var(--radius-panel);
    background: rgba(0,0,0,.18);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.vhf-section-meta {
    color: var(--blackbox-muted);
    font-size: .82rem;
}

.vhf-channel-list {
    display: grid;
    gap: 1rem;
}

.vhf-channel {
    border: 1px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
    border-radius: var(--bb-radius-lg);
    background: linear-gradient(180deg, rgba(18, 28, 33, .95), rgba(7, 14, 18, .92));
    overflow: hidden;
}

.vhf-channel-muted {
    border-style: dashed;
    opacity: .76;
}

.vhf-channel-shell {
    display: grid;
    grid-template-columns: 8.75rem minmax(0, 1fr);
}

.vhf-channel-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .4rem;
    min-height: 132px;
    padding: 1rem;
    background: linear-gradient(135deg, var(--color-primary-active), var(--color-primary));
    color: #ecfeff;
    box-shadow: inset -1px 0 0 rgba(255,255,255,.08);
}

.vhf-channel-label-title {
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .86;
}

.vhf-channel-label strong {
    font-size: 1.05rem;
    line-height: 1.2;
}

.vhf-channel-label small {
    color: rgba(236, 254, 255, .8);
}

.vhf-channel-body {
    display: grid;
    gap: .85rem;
    padding: 1rem 1.1rem;
}

.vhf-channel-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.vhf-channel-status {
    display: grid;
    gap: .2rem;
}

.vhf-channel-status strong {
    font-size: .95rem;
}

.vhf-channel-status small {
    color: var(--blackbox-muted);
}

.vhf-channel-actions {
    display: flex;
    gap: .55rem;
    flex-wrap: wrap;
}

.vhf-channel-button {
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--bb-radius-pill);
    background: rgba(255,255,255,.05);
    color: var(--blackbox-text);
    padding: .5rem .85rem;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.vhf-channel-button:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    transform: translateY(-1px);
}

.vhf-channel-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.vhf-channel-button.is-inactive {
    border-color: color-mix(in srgb, var(--color-primary) 38%, transparent);
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    color: #ccfbf1;
}

.vhf-channel-icon-button {
    width: 2.4rem;
    justify-content: center;
    padding: .5rem !important;
}

.vhf-timeline-shell {
    position: relative;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-panel);
    background: #0b1116;
    overflow: hidden;
    padding: .35rem .5rem;
}

.vhf-timeline-canvas {
    display: block;
    width: 100%;
    height: 112px;
    cursor: pointer;
}

.vhf-hidden-audio {
    display: none;
}

.vhf-timeline-scale {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    color: var(--blackbox-muted);
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
}

.vhf-timeline-scale strong {
    color: #ccfbf1;
}

.vhf-chat-window {
    display: grid;
    gap: .75rem;
    padding: 0 1.1rem 1.1rem calc(8.75rem + 1.1rem);
    max-height: 22rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-right: .55rem;
}

.vhf-chat-bubble {
    width: 100%;
    display: grid;
    gap: .55rem;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--bb-radius-md);
    background: rgba(255,255,255,.04);
    color: var(--blackbox-text);
    padding: .9rem 1rem;
    text-align: left;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.vhf-chat-bubble:hover {
    border-color: color-mix(in srgb, var(--color-primary) 38%, transparent);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    transform: translateY(-1px);
}

.vhf-chat-bubble.is-active {
    border-color: color-mix(in srgb, var(--color-primary) 50%, transparent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 14%, transparent), rgba(255,255,255,.04));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.vhf-chat-bubble p {
    margin: 0;
}

.vhf-chat-bubble-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: var(--blackbox-muted);
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
}

blockquote {
    margin: .8rem 0;
    padding: .75rem 1rem;
    border-left: 3px solid var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    border-radius: var(--bb-radius-sm);
}

.telemetry-chart {
    display: block;
    width: 100%;
}

.telemetry-state-shell,
.telemetry-line-shell,
.telemetry-position-shell {
    display: grid;
    gap: .75rem;
}

.telemetry-state-track {
    fill: var(--blackbox-chart-surface);
    stroke: var(--blackbox-chart-surface-border);
    stroke-width: 1;
}

.telemetry-state-segment.is-running {
    fill: var(--blackbox-chart-state-remote-fill);
}

.telemetry-state-segment.is-idle {
    fill: var(--blackbox-chart-state-local-fill);
}

/* Line charts follow Signac's FleetView look: a 44 px y-axis gutter with tick labels, a hairline
   grid on both axes, 1.6 px lines that keep their weight at any card width, a dashed crosshair with a
   dot per series, and the on-point tooltip. The SVG is 200 px tall with an anisotropic viewBox
   (1000 x 200), so labels and dots are HTML overlays positioned in % (x) and px (y). */
.telemetry-line-shell {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 6px 4px;
    align-items: start;
}

.telemetry-line-shell > .telemetry-axis {
    grid-column: 2;
}

.telemetry-line-shell > .telemetry-legend {
    grid-column: 1 / -1;
}

.telemetry-y-axis {
    position: relative;
    height: 200px;
}

.telemetry-y-axis .telemetry-tick-label {
    position: absolute;
    right: 4px;
    transform: translateY(-50%);
}

.telemetry-tick-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    line-height: 1;
    color: var(--blackbox-chart-tick-label);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
}

.telemetry-tick-label-x {
    position: absolute;
    transform: translateX(-50%);
}

.telemetry-grid-line {
    stroke: var(--blackbox-chart-grid);
    stroke-width: 1;
}

.telemetry-tick {
    stroke: var(--blackbox-chart-axis);
    stroke-width: 1;
}

.telemetry-line-path {
    fill: none;
    stroke: var(--blackbox-chart-line);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.telemetry-line-hover-wrap {
    position: relative;
    min-width: 0;
}

.telemetry-line-chart {
    height: 200px;
    cursor: crosshair;
}

/* Keep pointer events on the svg root so OffsetX/OffsetY map cleanly to viewBox coordinates. */
.telemetry-line-chart * {
    pointer-events: none;
}

.telemetry-cursor-dot,
.telemetry-hover-dot {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.telemetry-cursor-dot {
    width: 9px;
    height: 9px;
    background: var(--blackbox-chart-marker-fill);
    border: 2px solid var(--blackbox-chart-cursor);
}

.telemetry-hover-dot {
    width: 8px;
    height: 8px;
    background: var(--blackbox-chart-line);
    border: 2px solid var(--surface-raised);
}

.telemetry-hover-line {
    stroke: var(--blackbox-chart-crosshair);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.telemetry-hover-tooltip {
    position: absolute;
    bottom: calc(100% + .25rem);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: .4rem .6rem;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--rz-chart-tooltip-background);
    color: var(--rz-chart-tooltip-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
    z-index: 3;
}

.telemetry-tooltip-value {
    color: var(--blackbox-chart-line);
    font-weight: 600;
}

.telemetry-tooltip-time {
    color: var(--text-dim);
}

.telemetry-position-surface {
    fill: var(--blackbox-chart-surface);
    stroke: var(--blackbox-chart-surface-border);
    stroke-width: 1;
}

.telemetry-track-path {
    fill: none;
    stroke: var(--blackbox-chart-line);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.telemetry-track-start {
    fill: var(--blackbox-chart-track-start);
    stroke: var(--blackbox-chart-marker-fill);
    stroke-width: 2;
}

.telemetry-track-end {
    fill: var(--blackbox-chart-track-end);
    stroke: var(--blackbox-chart-marker-fill);
    stroke-width: 2;
}

.telemetry-track-cursor {
    fill: var(--blackbox-chart-marker-fill);
    stroke: var(--blackbox-chart-cursor);
    stroke-width: 3;
}

.telemetry-axis {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
}

.telemetry-axis strong {
    color: var(--blackbox-chart-legend-value);
    font-size: 12px;
}

.telemetry-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.telemetry-legend-item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .76rem;
    color: var(--blackbox-muted);
    font-variant-numeric: tabular-nums;
}

.telemetry-legend-swatch {
    width: .7rem;
    height: .7rem;
    border-radius: 2px;
    flex: 0 0 auto;
}

/* A dashed series (requested propulsion values, COG) gets a dashed swatch to match its line. */
.telemetry-legend-swatch.is-dashed {
    height: 0;
    border-radius: 0;
    border-top: 2px dashed;
}

/* Thrust plan: drawing and value table, drawn by blackboxThrustPlan; theme colours come from here. */
.compass-title { display: inline-flex; align-items: center; gap: .35rem; cursor: help; }
.compass-title i { font-size: .85em; color: var(--text-muted); }
.tp-house { fill: none; stroke: var(--blackbox-chart-heading); stroke-opacity: .45; }
.tp-cmd { fill: none; stroke: var(--color-primary); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tp-act { fill: var(--color-primary); opacity: .3; }
.tp-rudder { stroke: var(--color-primary); stroke-width: 4; stroke-linecap: round; }
.tp-rudder-act { stroke: var(--text-muted); stroke-width: 2; opacity: .6; }
.tp-rot-track { fill: none; stroke: var(--blackbox-chart-axis); stroke-width: 4; stroke-linecap: round; }
.tp-rot { fill: none; stroke: var(--status-warn); stroke-width: 3; stroke-linecap: round; }
.tp-rot-head { fill: var(--status-warn); }
.tp-badge circle { fill: var(--surface-card); stroke: var(--color-primary); stroke-width: 1.2; }
.tp-badge text { font-size: 8px; font-weight: 800; fill: var(--text-strong); }
.tp-unit.is-bad .tp-cmd, .tp-unit.is-bad .tp-rudder { stroke: var(--status-bad); }
.tp-unit.is-bad .tp-act { fill: var(--status-bad); }
.tp-badge.is-bad circle { stroke: var(--status-bad); }
.compass-dial-column.is-local .tp-cmd, .compass-dial-column.is-local .tp-rudder { stroke: var(--status-warn); }
.compass-dial-column.is-local .compass-rot-cmd { fill: var(--status-warn); }
/* Table in the compass readout's type: mono values, dim uppercase mono labels. */
.tp-table { width: 100%; table-layout: fixed; border-collapse: collapse; font: 600 13px var(--font-mono); font-variant-numeric: tabular-nums; }
.tp-table th { padding: 2px 6px; font: 500 10.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; text-align: right; color: var(--text-dim);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* a long translation clips instead of running into its neighbour */
.tp-table .tp-group th { text-align: center; border-bottom: 1px solid var(--border-default); }
.tp-table th:first-child, .tp-table td:first-child { text-align: left; }
.tp-table .tp-group th:first-child { vertical-align: bottom; padding-right: 0; } /* "EINH." fits the 17 % column */
.tp-table tr:not(.tp-group) th:first-child { padding: 2px 4px 2px 2px; text-align: right; } /* Act under Power, not the unit column (that header spans both rows) */
.tp-table .tp-col-unit { width: 17%; }
.tp-table .tp-col-power { width: 17%; }
.tp-table .tp-col-angle { width: 24.5%; }
.tp-table td { text-overflow: clip; }
.tp-table th:not(:first-child), .tp-table td:not(:first-child) { padding-left: 2px; padding-right: 4px; } /* "-180°" fits a 49 px column */
.tp-table td { padding: 5px 6px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid var(--border-subtle); }
.tp-name { font: 500 13px var(--font-sans); color: var(--text-body); }
.tp-table th[title] { cursor: help; }
.tp-code { display: inline-block; min-width: 2.1em; margin-right: .5em; padding: 1px 4px; border-radius: 5px; text-align: center; font-size: 11px; font-weight: 800;
    background: color-mix(in srgb, var(--color-primary) 16%, transparent); color: var(--color-primary); }
/* Round 3 O2: what the unit did reads first, what it was told sits beside it, dimmed. */
.tp-actv { font-weight: 700; color: var(--text-strong); }
.tp-cmdv, .tp-none { font-weight: 500; color: var(--text-dim); }
.compass-units.is-local .tp-cmdv { color: var(--status-warn); }
.tp-table.is-list th { text-align: left; }
.tp-table.is-list td { text-align: left; }
.tp-table tr.is-bad td, .tp-table tr.is-bad .tp-cmdv { color: var(--status-bad); }
.tp-table tr.is-bad .tp-code { background: color-mix(in srgb, var(--status-bad) 18%, transparent); color: var(--status-bad); }
.tp-status { margin: 0; font-size: 12.5px; font-weight: 700; }
.tp-status.is-local { color: var(--status-warn); }
.tp-status.is-bad { color: var(--status-bad); }

/* Propulsion & joystick before it is loaded: what it is, and the button that reads the vessel log. */
.propulsion-load {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--bb-space-3);
    padding: var(--bb-space-4);
    border: 1px dashed var(--blackbox-border);
    border-radius: var(--bb-radius-md);
    color: var(--blackbox-muted);
    font-size: var(--bb-font-sm);
}

.telemetry-legend-item strong {
    color: var(--blackbox-chart-legend-value);
}

.telemetry-chip {
    display: inline-flex;
    align-items: center;
    border-radius: var(--bb-radius-pill);
    padding: .35rem .7rem;
    font-size: .76rem;
    font-weight: 700;
    border: 1px solid var(--blackbox-chart-pill-border);
}

.telemetry-chip-running {
    background: var(--blackbox-chart-state-remote-fill);
    color: var(--blackbox-chart-state-remote-text);
}

.telemetry-chip-idle {
    background: var(--blackbox-chart-state-local-fill);
    color: var(--blackbox-chart-state-local-text);
}

.telemetry-chip-dynamic {
    backdrop-filter: blur(8px);
}

.telemetry-position-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--blackbox-muted);
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
}

.telemetry-position-meta strong {
    color: var(--blackbox-chart-legend-value);
    margin-right: .35rem;
}

.telemetry-card-placeholder p {
    margin-top: .75rem;
    min-height: 3rem;
}

.telemetry-empty-state {
    /*min-height: 220px;*/
}

.telemetry-empty-state-icon {
    font-size: 1.65rem;
    color: color-mix(in srgb, var(--color-primary) 42%, transparent);
}

.audit-row span, .audit-row small {
    display: block;
    color: var(--blackbox-muted);
}

.inline-loading-state {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    color: var(--blackbox-muted);
}

.compact-empty-state {
    min-height: 0;
    justify-content: flex-start;
    padding: 1rem 0;
}

.compact-empty-state .telemetry-empty-state-icon {
    font-size: 1.15rem;
}

.timeline-action-chevron {
    font-size: .8rem;
    opacity: .82;
}

.full-camera {
    position: fixed;
    inset: 2rem;
    z-index: 100;
    background: rgba(0,0,0,.94);
    border: 1px solid var(--blackbox-border);
    border-radius: var(--radius-panel);
    padding: 1rem;
}

.loading-card {
    padding: 2rem;
}

.incident-loading-card {
    min-height: 14rem;
    display: grid;
    place-items: center;
    gap: .9rem;
    text-align: center;
}

.app-header {
    border-bottom: 1px solid var(--header-border);
    background: var(--header-bg);
    color: #ffffff; /* header ground is dark in both themes (navy / brand teal) */
    box-shadow: 0 8px 24px color-mix(in srgb, var(--color-primary) 18%, transparent);
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 2rem;
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 30;
}

.app-header small {
    color: rgba(255,255,255,.76);
}

.header-action-button {
    border-color: rgba(255,255,255,.28);
    background: rgba(255,255,255,.12);
    color: #ffffff;
}

.header-action-button:hover,
.header-action-button:focus-visible {
    border-color: rgba(255,255,255,.45);
    background: rgba(255,255,255,.2);
    color: #ffffff;
}

.app-main {
    width: min(1320px, 100%);
    padding-top: 1.5rem;
    margin: 0 auto;
    padding: 1.5rem 2rem var(--timeline-clearance);
}

.hero-panel,
.toolbar-card,
.grid-panel,
.form-card,
.content-card,
.loading-card {
    border: 1px solid var(--blackbox-border);
    border-radius: var(--bb-radius-sm);
    background: var(--blackbox-surface);
    box-shadow: var(--blackbox-shadow);
    backdrop-filter: none;
}

.hero-panel {
    border-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
    background: linear-gradient(135deg, var(--surface-card) 0%, var(--surface-hover) 100%);
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem;
}

.hero-panel h1,
.login-card h2 {
    color: var(--text-strong);
}

.hero-copy,
.dialog-intro p:not(.eyebrow),
.section-copy,
.file-hint,
.login-support-copy {
    color: var(--blackbox-muted);
}

.eyebrow {
    color: var(--blackbox-primary-dark);
    margin: 0;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.hero-stats div,
.action-row {
    border-color: var(--blackbox-border);
    background: var(--surface-card);
}

.toolbar-card,
.grid-panel,
.form-card,
.content-card {
    margin-top: 1rem;
    padding: 1.25rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: var(--bb-radius-pill);
    padding: .28rem .65rem;
    font-size: .75rem;
    font-weight: 800;
    border: 1px solid var(--blackbox-border);
    background: var(--surface-sunken);
    color: var(--text-body);
}

/* Status colors are supplementary — the text label stays the primary signal. */
.status-pill.status-open {
    background: var(--status-warn-bg);
    color: var(--status-warn);
    border-color: color-mix(in srgb, var(--status-warn) 35%, transparent);
}

.status-pill.status-reviewing {
    background: var(--status-info-bg);
    color: var(--status-info);
    border-color: color-mix(in srgb, var(--status-info) 30%, transparent);
}

.status-pill.status-closed,
.status-pill.status-promoted {
    background: var(--status-good-bg);
    color: var(--status-good);
    border-color: color-mix(in srgb, var(--status-good) 35%, transparent);
}

.status-pill.status-discarded {
    background: var(--surface-sunken);
    color: var(--text-muted);
    border-color: var(--border-subtle);
}

/* AI triage suggestion (candidates grid, candidate details, promote wizard). Suggest-only: the
   badge reuses the priority-badge bands so the suggestion reads like the reviewer's own answer will. */
.triage-cell {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

/* Wrench + count of affected systems in the grid cell. */
.triage-fault {
    display: inline-flex;
    align-items: flex-start;
    gap: .1rem;
    color: var(--status-bad);
    font-size: .75rem;
    line-height: 1;
}

.triage-fault sup {
    top: 0;
    font-family: var(--font-mono);
    font-size: .58rem;
    font-weight: 700;
    line-height: 1;
}

.triage-unassessed {
    color: var(--text-dim);
    font-weight: 600;
}

.triage-linked {
    text-decoration: none;
}

.triage-linked i {
    margin-right: .3rem;
    font-size: .68rem;
}

.grid-subline {
    display: block;
    font-size: .7rem;
    color: var(--text-muted);
    margin-top: .1rem;
}

/* Footage as a glyph: a disabled checkbox read as a form control. */
.footage-ic {
    color: var(--text-body);
    font-size: .85rem;
}

.footage-ic.is-off {
    color: var(--text-dim);
}

/* Column titles stay on one line and never truncate to an ellipsis behind the sort glyph. */
.blackbox-grid .rz-column-title {
    overflow: visible;
    white-space: nowrap;
}

/* Trigger type: icon-only disc, colour from one rule per key (same keys as the replay lane). The disc
   is a span around the <i>: Font Awesome's own display rule on .fas is un-layered and would beat a
   layered rule on the glyph element itself. */
.trigger-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.trigger-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: color-mix(in srgb, currentColor 16%, transparent);
}

.trigger-ic i {
    font-size: .7rem;
    line-height: 1;
}

/* Same-type detections folded into the candidate within the dedup window. */
.trigger-count {
    margin-left: .3rem;
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 700;
    color: var(--text-muted);
}

.trigger-cell[data-trigger-type="estop"] { color: var(--status-bad); }
.trigger-cell[data-trigger-type="postcheck"] { color: var(--status-info); }
.trigger-cell[data-trigger-type="zone"] { color: var(--status-bad); }
.trigger-cell[data-trigger-type="connectivity"] { color: var(--status-warn); }
.trigger-cell[data-trigger-type="station"] { color: var(--blackbox-chart-series-4); }
.trigger-cell[data-trigger-type="power"] { color: var(--status-warn); }
.trigger-cell[data-trigger-type="manual"] { color: var(--color-primary); }
.trigger-cell[data-trigger-type="other"] { color: var(--text-muted); }

/* "Suggested" chip on the option the verdict proposed (event type card, priority rung). */
.event-type-option,
.priority-option {
    position: relative;
}

/* Event type card: a robot glyph in the corner instead of a chip, which overlapped the title. */
.event-type-option .suggested-mark {
    position: absolute;
    top: .6rem;
    right: .6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--status-info) 16%, transparent);
    color: var(--status-info);
    font-size: .7rem;
}

.event-type-option:has(.suggested-mark) strong {
    padding-right: 1.9rem;
}

.priority-option .suggested-chip {
    margin-left: auto;
}

/* The wide "AI assessment" cell, two lines under a hairline: badges + fault pills + alert glyph,
   then the one-sentence rationale. Admins get a muted provenance line. Suggest-only. */
.details-cell.ai-assessment {
    padding-top: .5rem;
}

/* Compound selector on purpose: the generic .details-cell dd { margin: 0 } later in this layer has
   the same specificity as .ai-assessment dd and would win by source order. */
.details-cell.ai-assessment dd {
    display: block;
    margin-top: .6rem;
}

.ai-title-icon {
    margin-right: .3rem;
    color: var(--status-info);
    font-size: .75rem;
}

.ai-lines {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    padding-top: .6rem;
    border-top: 1px solid var(--border-subtle);
}

.ai-line-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
}

.ai-line-why {
    margin: 0;
    font-size: .85rem;
    font-weight: 400;
    color: var(--text-body);
    line-height: 1.45;
}

.ai-line-admin {
    margin: 0;
    font-size: .68rem;
    color: var(--text-dim);
}

.ai-line-admin .footage-log-tag {
    margin-right: .4rem;
    vertical-align: middle;
}

.ai-card-alert {
    color: var(--status-info);
    font-size: .75rem;
}

/* One tinted pill per affected system (glyph + name); each has its own tooltip. */
.fault-glyph {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    height: 26px;
    padding: 0 .65rem 0 .55rem;
    border-radius: 13px;
    background: color-mix(in srgb, var(--status-bad) 14%, transparent);
    color: var(--status-bad);
    font-size: .74rem;
    font-weight: 600;
    white-space: nowrap;
}

.fault-glyph i {
    font-size: .72rem;
}

.ai-why {
    font-weight: 400;
    font-size: .85rem;
    color: var(--text-body);
    line-height: 1.45;
}

/* Hover tooltips in the Blackbox design (HoverTip component over Radzen's TooltipService). Radzen's
   own tooltip rules live in the radzen layer, so these win without !important. */
.hovertip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
}

/* The popup must never sit under the pointer: when it did, mouseleave fired on the anchor, the
   tooltip closed, mouseenter fired again, and the cursor flickered at badge edges. */
.rz-tooltip.bb-tooltip {
    pointer-events: none;
}

.rz-tooltip.bb-tooltip .rz-tooltip-content {
    background: var(--surface-raised);
    color: var(--text-body);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-chip);
    box-shadow: var(--shadow-card);
    font-family: var(--font-sans);
    font-size: .74rem;
    font-weight: 500;
    line-height: 1.4;
    padding: .45rem .65rem;
    max-width: 340px;
    white-space: pre-line;
}

/* Native title attributes rendered in the same look (blackboxTitleTips in blackbox.js). */
.bb-title-tip {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2000;
    max-width: 340px;
    padding: .45rem .65rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-chip);
    background: var(--surface-raised);
    color: var(--text-body);
    box-shadow: var(--shadow-card);
    font-family: var(--font-sans);
    font-size: .74rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: pre-line;
    pointer-events: none;
}

.bb-title-tip[hidden] {
    display: none;
}

.rz-tooltip.bb-tooltip .rz-tooltip-content::before,
.rz-tooltip.bb-tooltip .rz-tooltip-content::after {
    border-color: var(--surface-raised) transparent transparent transparent;
}

.action-badge {
    border: 1px solid currentColor;
    cursor: pointer;
    font: inherit;
}

.action-badge:hover,
.action-badge:focus-visible,
.inline-value-button:hover,
.inline-value-button:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 16%, transparent);
    outline: 0;
}

.text-button {
    color: var(--blackbox-primary-dark);
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    margin-bottom: 1rem;
}

.inline-value-button {
    border: 0;
    border-radius: var(--bb-radius-pill);
    background: var(--surface-hover);
    color: var(--blackbox-primary-dark);
    padding: .18rem .55rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.navigation-map-stack,
.navigation-map-canvas {
    background: #0d1f31;
}

.navigation-map-meta,
.camera-segment-list {
    border-color: rgba(255,255,255,.12);
}

.navigation-map-meta strong {
    color: #f8fafc;
    color: var(--text-strong);
}

.navigation-map-meta {
    color: #cbd5e1;
    color: var(--text-muted);
}

.vhf-audio-sync-pool {
    display: none;
}

.vhf-channel-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

/* Slim channel pills: a mute toggle with the channel name and its call count. */
.vhf-channel-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    height: 1.9rem;
    padding: 0 .3rem 0 .65rem;
    border: 1px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
    border-radius: var(--bb-radius-pill);
    background: color-mix(in srgb, var(--color-primary) 7%, transparent);
    color: var(--color-primary-active);
    font-size: .8rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.vhf-channel-chip > i {
    font-size: .72rem;
}

.vhf-channel-chip:hover {
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.vhf-channel-chip small {
    display: inline-grid;
    place-items: center;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 .3rem;
    border-radius: var(--bb-radius-pill);
    background: var(--surface-card);
    color: var(--text-body);
    font-size: .68rem;
    font-weight: 700;
}

.vhf-channel-chip.is-muted {
    border-style: dashed;
    background: transparent;
    color: var(--text-muted);
}

/* Channels left, the transcripts switch right, one row while there is room. */
.vhf-panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
}

.vhf-panel-toolbar > .vhf-channel-summary {
    flex: 1 1 auto;
    min-width: 0;
}

.vhf-panel-toolbar > .vhf-language-bar {
    flex: 0 1 auto;
    margin-left: auto;
}

/* On-demand translation of free text: a quiet link under the text that says what it does. */
.translate-link {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-top: .3rem;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.3;
}

.translate-link > i {
    color: var(--color-primary-active);
    font-size: 12px;
}

.translate-link > button {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-primary-active);
    font: inherit;
    cursor: pointer;
}

.translate-link > button:hover,
.translate-link > button:focus-visible {
    text-decoration: underline;
    outline: 0;
}

.vhf-language-icon {
    color: var(--color-primary-active);
    font-size: 14px;
}

.vhf-language-icon.is-warning {
    color: var(--status-warn);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Compact mute toggle used in the manage-VHF recordings grid. */
.vhf-mute-toggle {
    padding: .35rem .55rem;
    gap: 0;
}

.vhf-mute-toggle:disabled {
    opacity: .55;
    cursor: default;
}

/* Small "Manual" badge on manually uploaded VHF clips in the transcript stream. */
.vhf-transcript-manual-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-left: .4rem;
    padding: .05rem .4rem;
    border-radius: var(--bb-radius-pill);
    background: color-mix(in srgb, var(--color-primary) 16%, transparent);
    color: var(--color-primary-active);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    vertical-align: middle;
}

.vhf-recordings-audio {
    width: 100%;
    max-width: 200px;
    height: 32px;
}

/* Leave headroom for the dialog title, footer and content padding so the tab area plus chrome fits
   within Radzen's dialog-content max-height (~80vh). At 72vh the chrome tipped it ~34px over,
   adding a second, dialog-body scrollbar beside the list's own; 68vh stays inside that margin.
   Long lists still scroll inside the section panel — that stays the single, intended scrollbar. */
/* Per-section tabs fill the panel; their tab strip stays fixed while only the body scrolls. */

.vhf-transcript-stream {
    display: grid;
    gap: .75rem;
    max-height: 34rem;
    overflow-y: auto;
    padding-right: .35rem;
    gap: .5rem;
    max-height: 28rem;
    gap: .45rem;
    max-height: 24rem;
    height: 18.6rem;
    min-height: 18.6rem;
    max-height: 18.6rem;
}

.vhf-transcript-item {
    width: 100%;
    display: grid;
    grid-template-columns: 9rem 9rem 12rem minmax(0, 1fr);
    gap: .75rem;
    align-items: start;
    border: 1px solid var(--blackbox-border);
    border-radius: var(--bb-radius-sm);
    background: var(--surface-card);
    color: var(--text-body);
    padding: .85rem 1rem;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    grid-template-columns: 7.5rem 7.5rem 9rem minmax(0, 1fr);
    gap: .55rem;
    padding: .65rem .75rem;
    font-size: .88rem;
    grid-template-columns: 6.75rem 6.75rem 8.5rem minmax(0, 1fr);
    gap: .45rem;
    padding: .55rem .65rem;
    font-size: .84rem;
}

.vhf-transcript-item:hover,
.vhf-transcript-item:focus-visible {
    border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
    outline: 0;
}

.vhf-transcript-item.is-active {
    border-color: var(--blackbox-primary);
    background: var(--surface-hover);
}

/* The conversation: upcoming clips dim, the playing one carries a progress bar that
   blackbox.js moves per frame through --vhf-progress. */
.vhf-transcript-item {
    position: relative;
    overflow: hidden;
}

/* overflow:hidden drops the items' automatic minimum height, so without this the fixed-height
   list squeezes every row instead of scrolling. */
.vhf-transcript-stream {
    grid-auto-rows: max-content;
    align-content: start;
}

.vhf-transcript-item.is-upcoming {
    opacity: .55;
}

.vhf-transcript-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: calc(var(--vhf-progress, 0) * 100%);
    background: var(--blackbox-primary);
}

.vhf-transcript-play {
    margin-right: .35rem;
    font-size: .72em;
    color: var(--color-primary-active);
}

.vhf-transcript-duration {
    display: block;
    color: var(--text-muted);
    font-size: .74rem;
    font-weight: 500;
}

.vhf-empty-toggle {
    justify-self: start;
}

.vhf-transcript-time {
    color: var(--text-body);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.vhf-transcript-channel {
    color: var(--color-primary-active);
    font-weight: 800;
}

.vhf-transcript-language {
    color: var(--text-muted);
    font-size: .85rem;
    font-size: .78rem;
    font-size: .74rem;
}

.vhf-transcript-message {
    color: var(--text-strong);
    line-height: 1.35;
    /* uploaded .txt transcripts keep their own line breaks */
    white-space: pre-line;
}

.vhf-transcript-translation {
    grid-column: 4;
    margin-top: .25rem;
    border-left: 3px solid var(--blackbox-primary);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    color: var(--text-body);
    padding: .5rem .75rem;
    margin-top: .15rem;
    padding: .4rem .6rem;
    font-size: .82rem;
    line-height: 1.35;
    padding: .35rem .5rem;
    font-size: .78rem;
}

/* A translated clip: the translation is the message, the original transcript stays below it as the record. */
.vhf-transcript-original {
    grid-column: 4;
    color: var(--text-muted);
    font-size: .78rem;
    font-style: italic;
    line-height: 1.35;
    white-space: pre-line;
}

/* Upload list: the transcript files of one clip (original language picker + translation codes). */
.vhf-upload-transcripts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin-top: .3rem;
}

.vhf-upload-language {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--text-muted);
    font-size: .74rem;
}

.vhf-upload-language select {
    font: inherit;
    color: var(--text-body);
    background: var(--surface-raised, transparent);
    border: 1px solid var(--border-subtle, currentColor);
    border-radius: var(--radius-input);
    padding: .1rem .3rem;
}

.vhf-upload-translation {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .05em;
    color: var(--color-primary-active);
    border: 1px solid currentColor;
    border-radius: var(--radius-pill);
    padding: 0 .4rem;
}

/* Transcripts bar: as spoken or translated, and the translation's progress (a sliding line while busy). */
.vhf-language-bar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
    padding-bottom: 4px;
    overflow: hidden;
}

.vhf-language-switch {
    display: inline-flex;
    padding: 2px;
    gap: 2px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-input);
    background: var(--surface-card);
}

.vhf-language-switch > button {
    border: 0;
    border-radius: calc(var(--radius-input) - 2px);
    background: transparent;
    color: var(--text-body);
    font: inherit;
    font-size: .82rem;
    padding: .3rem .85rem;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.vhf-language-switch > button:hover:not(.is-selected) {
    background: var(--surface-hover);
}

.vhf-language-switch > button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

.vhf-language-switch > button.is-selected {
    background: var(--color-primary);
    color: var(--text-inverse);
    font-weight: 600;
}

.vhf-language-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    overflow: hidden;
}

.vhf-language-progress::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    background: var(--color-primary);
    animation: vhf-language-progress 1.1s ease-in-out infinite alternate;
}

@keyframes vhf-language-progress {
    from { transform: translateX(-100%); }
    to { transform: translateX(290%); }
}

@media (prefers-reduced-motion: reduce) {
    .vhf-language-progress::before {
        width: 100%;
        opacity: .5;
        animation: none;
    }
}

/* Phones: the switch spans the bar with two equal halves, everything centred. */
@media (max-width: 767px) {
    .vhf-panel-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .vhf-panel-toolbar > .vhf-language-bar {
        margin-left: 0;
    }

    .vhf-language-bar {
        justify-content: center;
        text-align: center;
    }

    .vhf-language-switch {
        flex: 1;
    }

    .vhf-language-switch > button {
        flex: 1;
        min-height: 2.25rem;
    }
}

.vhf-transcript-language.is-translated {
    color: var(--color-primary-active);
    font-weight: 600;
}

.telemetry-axis strong,
.telemetry-position-meta strong {
    color: var(--blackbox-chart-legend-value);
}

.telemetry-state-track,
.telemetry-position-surface {
    fill: var(--blackbox-chart-surface);
    stroke: var(--blackbox-chart-surface-border);
}

.telemetry-line-path,
.telemetry-track-path {
    stroke: var(--blackbox-chart-line);
}

.telemetry-track-cursor {
    fill: var(--blackbox-chart-marker-fill);
    stroke: var(--blackbox-chart-cursor);
}

.telemetry-cursor-line {
    stroke: var(--blackbox-chart-cursor);
    stroke-width: 1.5;
    stroke-linecap: round;
}

.audit-row {
    border-bottom-color: var(--blackbox-border);
    border-bottom: 1px solid var(--blackbox-border);
    padding: .7rem 0;
}

.dialog-form-grid-single {
    grid-template-columns: 1fr;
}

.dialog-form-grid-create-incident {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Vessel / time / type share the top row; the description gets the full dialog width below it. */
.dialog-form-grid-create-incident > .field-full-width {
    grid-column: 1 / -1;
}

.priority-wizard {
    display: grid;
    gap: 1rem;
}

.priority-wizard-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.priority-wizard-copy h3 {
    margin: 0;
    color: var(--text-strong);
    font-size: 1.15rem;
}

.priority-wizard-copy p {
    margin: .4rem 0 0;
    color: var(--text-muted);
    line-height: 1.45;
}

.priority-wizard-step,
.priority-preview-card > span {
    display: block;
    color: var(--text-muted);
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
}

.priority-preview-card {
    min-width: 11rem;
    display: grid;
    gap: .5rem;
    padding: .95rem 1rem;
    border: 1px solid var(--blackbox-border);
    border-radius: var(--bb-radius-md);
    background: var(--surface-sunken);
}

.priority-wizard-options {
    display: grid;
    gap: .65rem;
}

.priority-option {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: .95rem;
    padding: .9rem 1rem;
    border: 1px solid var(--blackbox-border);
    border-radius: var(--bb-radius-md);
    background: var(--surface-card);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.priority-option:hover,
.priority-option:focus-visible {
    border-color: color-mix(in srgb, var(--color-primary) 38%, transparent);
    background: var(--surface-sunken);
    box-shadow: 0 12px 28px rgba(15,23,42,.08);
    outline: 0;
}

.priority-option:active {
    transform: translateY(1px);
}

.priority-option.is-selected {
    border-color: color-mix(in srgb, var(--color-primary) 52%, transparent);
    background: var(--surface-hover);
    box-shadow: 0 14px 32px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.priority-option-score {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--bb-radius-pill);
    background: var(--surface-sunken);
    color: var(--text-strong);
    font-weight: 800;
}

.priority-option-copy {
    display: grid;
    gap: .22rem;
}

.priority-option-copy strong {
    color: var(--text-strong);
    font-size: .95rem;
}

.priority-option-copy small {
    color: var(--text-muted);
    line-height: 1.45;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: .38rem .72rem;
    border: 1px solid transparent;
    border-radius: var(--bb-radius-pill);
    font-size: .82rem;
    font-weight: 800;
}

.priority-badge-low {
    border-color: color-mix(in srgb, var(--status-good) 35%, transparent);
    background: var(--status-good-bg);
    color: var(--status-good);
}

.priority-badge-medium {
    border-color: color-mix(in srgb, var(--status-warn) 35%, transparent);
    background: var(--status-warn-bg);
    color: var(--status-warn);
}

.priority-badge-high {
    border-color: color-mix(in srgb, var(--status-warn) 35%, transparent);
    background: var(--status-warn-bg);
    color: var(--status-warn);
}

.priority-badge-critical {
    border-color: color-mix(in srgb, var(--status-bad) 35%, transparent);
    background: var(--status-bad-bg);
    color: var(--status-bad);
}

.event-type-field {
    display: grid;
    gap: .35rem;
    grid-column: 1 / -1;
}

.event-type-field-label {
    color: var(--blackbox-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
}

.event-type-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .65rem;
}

@media (max-width: 767px) {
    .event-type-picker {
        grid-template-columns: 1fr;
    }
}

.event-type-option {
    display: grid;
    gap: .22rem;
    padding: .9rem 1rem;
    border: 1px solid var(--blackbox-border);
    border-radius: var(--bb-radius-md);
    background: var(--surface-card);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.event-type-option:hover,
.event-type-option:focus-visible {
    border-color: color-mix(in srgb, var(--color-primary) 38%, transparent);
    background: var(--surface-sunken);
    box-shadow: 0 12px 28px rgba(15,23,42,.08);
    outline: 0;
}

.event-type-option:active {
    transform: translateY(1px);
}

.event-type-option.is-selected {
    border-color: color-mix(in srgb, var(--color-primary) 52%, transparent);
    background: var(--surface-hover);
    box-shadow: 0 14px 32px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.event-type-option strong {
    color: var(--text-strong);
    font-size: .95rem;
}

.event-type-option-nearmiss strong {
    color: var(--status-good);
}

.event-type-option-incident strong {
    color: var(--status-warn);
}

.event-type-option-accident strong {
    color: var(--status-bad);
}

.event-type-option small {
    color: var(--text-muted);
    line-height: 1.45;
}

.event-type-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: .38rem .72rem;
    border: 1px solid transparent;
    border-radius: var(--bb-radius-pill);
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
}

.event-type-badge-nearmiss {
    border-color: color-mix(in srgb, var(--status-good) 35%, transparent);
    background: var(--status-good-bg);
    color: var(--status-good-text);
}

.event-type-badge-incident {
    border-color: color-mix(in srgb, var(--status-warn) 35%, transparent);
    background: var(--status-warn-bg);
    color: var(--status-warn-text);
}

.event-type-badge-accident {
    border-color: color-mix(in srgb, var(--status-bad) 35%, transparent);
    background: var(--status-bad-bg);
    color: var(--status-bad-text);
}

.event-type-badge-unclassified {
    border-color: var(--blackbox-border);
    background: var(--surface-sunken);
    color: var(--text-muted);
}

.priority-preview-placeholder {
    color: var(--text-muted);
    font-size: .92rem;
}

.priority-preview-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
}

.priority-preview-inline > span {
    color: var(--text-muted);
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
}

.priority-preview-inline > strong {
    display: inline-flex;
    align-items: center;
}

.login-page-shell {
    min-height: calc(100vh - 9rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    gap: 2rem;
    align-items: center;
    grid-template-columns: minmax(0, 440px);
    justify-content: center;
    min-height: 100%;
    align-content: center;
}

.login-hero-panel {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    border-radius: var(--radius-panel);
    padding: 3rem;
    /* dark default: command-center navy panel with grid motif + cyan glow */
    background: linear-gradient(180deg, var(--cmd-panel-2), var(--cmd-panel));
    background-image: var(--page-grid), linear-gradient(180deg, var(--cmd-panel-2), var(--cmd-panel));
    background-size: var(--page-grid-size), auto;
    border: 1px solid var(--border-default);
    color: #ffffff;
    box-shadow: var(--shadow-panel), var(--glow-primary);
}

/* light product theme keeps the brand-teal hero */
html[data-theme="light"] .login-hero-panel {
    background: linear-gradient(135deg, var(--brand-teal), #244E54);
    border-color: transparent;
    box-shadow: 0 22px 60px color-mix(in srgb, var(--brand-teal) 30%, transparent);
}

.login-hero-panel .eyebrow,
.login-hero-panel .hero-copy {
    color: rgba(255,255,255,.78);
}

.login-hero-panel h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    line-height: 1;
}

.login-brand-mark {
    width: 4.5rem;
    height: 4.5rem;
    display: grid;
    place-items: center;
    border-radius: var(--bb-radius-md);
    background: rgba(255,255,255,.16);
    color: #ffffff;
    font-weight: 900;
    font-size: 2rem;
}

.login-card {
    width: 100%;
    max-width: 440px;
    margin: 0;
    padding: 2rem;
    margin: 0 auto;
    max-width: 420px;
    display: grid;
    gap: 1rem;
}

.login-action-primary {
    width: 100%;
    justify-content: center;
    display: inline-flex;
    gap: .55rem;
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: var(--color-on-primary);
}

.login-action-primary:hover,
.login-action-primary:focus-visible {
    background: var(--blackbox-primary-dark) !important;
}

/* Prototype alignment refinements */
.header-actions {
    gap: .9rem;
    margin-left: auto;
    display: flex;
    align-items: center;
}

.header-user-status {
    color: rgba(255,255,255,.82);
    font-size: .9rem;
}

/* Header icon buttons (assistant, privacy, language, theme, sign out): rounded squares of one size and
   one glyph size, centred, matching the user pill's height. Scoped to .app-header so it beats .iconbtn's 30px square, which is
   declared later in this layer. No !important: the phone sheet restyles them from @layer responsive. */
.app-header .header-icon-action {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 8px;
    font-size: 15px;
}

.app-header .header-icon-action > i,
.app-header .header-icon-action > svg {
    width: 1em;
    height: 1em;
    line-height: 1;
    text-align: center;
}

/* The language button shows its code beside the globe ("NL"), so it is wider than the others. */
.app-header .header-icon-action.header-language {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: 0 .7rem;
}

.header-language-code {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
}

/* The language list: Radzen's dropdown panel (same look as the filters), centred under the button. */
.header-language-wrap {
    position: relative;
    display: inline-flex;
}

.header-language-panel {
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 10.5rem;
    z-index: 2;
}

.header-language-panel .rz-dropdown-item {
    cursor: pointer;
    white-space: nowrap;
}

.header-language-panel .rz-dropdown-item:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.header-language-scrim {
    position: fixed;
    inset: 0;
    z-index: 29;
}

/* The settings menu (privacy mode, theme, report presets, administration): the language list's panel,
   opening from the button's right edge so it stays on screen. */
.header-settings-panel {
    left: auto;
    right: 0;
    transform: none;
    min-width: 14rem;
}

/* Radzen pads the list item; the button inside carries the padding instead, so it fills the row. */
.header-settings-panel .rz-dropdown-items > li {
    padding: 0;
}

.header-menu-item {
    padding: .55rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
}

.header-menu-item .fas {
    width: 1rem;
    text-align: center;
    color: var(--text-muted);
}

.header-menu-state {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.header-menu-item[aria-checked="true"] .header-menu-state {
    color: var(--text-link);
    font-weight: 600;
}

.header-settings-panel .header-menu-sep {
    height: 1px;
    margin: .3rem .75rem;
    padding: 0;
    background: var(--border-subtle);
}

.app-header .header-actions {
    gap: .5rem;
}

.app-header .userpill {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
}

.dashboard-filters {
    margin: 0 0 1rem;
}

.dashboard-filters .toolbar-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid-panel {
    border-radius: var(--radius-input);
}

.dashboard-state-card {
    min-height: 14rem;
    display: grid;
    place-items: center;
    gap: .9rem;
    text-align: center;
}

.dialog-intro-compact {
    margin-bottom: 1.75rem;
}

.dialog-intro-compact h2 {
    margin: 0;
    color: var(--text-strong);
}

/* Keep long file names on a single line and ellipsize so they never break the sidebar layout. */
/* Linked documents — on-page grid (LinkedDocumentsPanel): images as thumbnails, other files as a
   typed icon card. */

/* Manage evidence -> Documents tab: a compact row list with download + delete. */
.documents-manage-list {
    display: grid;
    gap: .6rem;
}

.document-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    border: 1px solid var(--blackbox-border);
    border-radius: var(--bb-radius-sm);
    background: var(--surface-card);
    padding: .7rem .85rem;
}
.document-row-main {
    display: grid;
    min-width: 0;
    flex: 1;
}

.document-row-main strong {
    font-size: .85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-row-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 0 0 auto;
}

.navigation-map-stack,
.navigation-map-canvas {
    background: var(--surface-sunken);
}

/* The name takes the slack so the header's action buttons stay grouped right
   (fullscreen sits next to pin/back). */

.navigation-map-stack {
    position: relative;
    z-index: 0;
}

/* Deepen the state fills so they read well both in the donut summary charts and behind the
   white in-bar labels of the timeline. Applied to both so the two stay visually consistent. */
/* White labels only inside the colored timeline bars (the donut centres keep their dark text). */


/* Alarms — Zabbix problems grouped by trigger (host + name) */
.alarm-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .75rem;
}

.alarm-toolbar .filter-field {
    width: min(240px, 100%);
}

.alarm-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .5rem;
}

.alarm-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .5rem .75rem;
    padding: .55rem .7rem;
    border: 1px solid var(--blackbox-chart-surface-border);
    border-radius: var(--bb-radius-sm);
}

.alarm-severity-chip {
    display: inline-flex;
    align-items: center;
    border-radius: var(--bb-radius-pill);
    padding: .2rem .6rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.alarm-body {
    display: grid;
    gap: .1rem;
    min-width: 0;
}

.alarm-headline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}

.alarm-name {
    color: var(--blackbox-chart-legend-value);
    font-size: .86rem;
    font-weight: 700;
}

.alarm-host {
    color: var(--blackbox-muted);
    font-size: .76rem;
}

.alarm-count {
    color: var(--blackbox-muted);
    font-size: .74rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.alarm-ongoing {
    display: inline-flex;
    align-items: center;
    border-radius: var(--bb-radius-pill);
    padding: .1rem .45rem;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--status-bad) 14%, transparent);
    color: var(--status-bad);
}

/* Full-row lane under the alarm details, aligned to the incident window like the device tracks. */
.alarm-track {
    grid-column: 1 / -1;
}

/* Alarm segments are sparse (unlike the contiguous device states), so give the lane a visible
   surface — the full incident window reads as the bar, active spans as coloured blocks on it. */
.alarm-track .status-track {
    background: var(--blackbox-chart-surface);
    border: 1px solid var(--blackbox-chart-surface-border);
}

/* Shared time axis under the alarm lanes; side padding matches the alarm-row inset
   (.7rem padding + 1px border) so the labels line up with the track edges. */
.alarm-axis {
    margin-top: .35rem;
    padding: 0 calc(.7rem + 1px);
}

.alarm-empty {
    margin: 30px;
}

/* Zabbix severities 0-5 */
.alarm-severity-chip.is-unclassified { background: color-mix(in srgb, var(--text-dim) 16%, transparent); color: var(--text-muted); }
.alarm-severity-chip.is-information { background: rgba(37, 99, 235, .14); color: var(--status-info); }
.alarm-severity-chip.is-warning { background: color-mix(in srgb, var(--status-warn) 16%, transparent); color: var(--status-warn); }
.alarm-severity-chip.is-average { background: rgba(234, 88, 12, .16); color: var(--status-warn); }
.alarm-severity-chip.is-high { background: color-mix(in srgb, var(--status-bad) 14%, transparent); color: var(--status-bad); }
.alarm-severity-chip.is-disaster { background: rgba(124, 45, 96, .18); color: #86198f; }

/* Compact status tracks — shared by "Onboard devices" and "Dome carriers" */
.status-track-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .9rem;
}

.status-track-legend-item {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .76rem;
    color: var(--blackbox-muted);
}

.status-track-swatch {
    display: inline-block;
    width: .8rem;
    height: .8rem;
    border-radius: 3px;
    flex: 0 0 auto;
}

.device-status-category {
    display: grid;
    gap: .5rem;
}

.device-status-category-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem;
}

.device-status-category-header span {
    color: var(--blackbox-chart-axis-label);
    font-size: .74rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 700;
}

.device-status-category-header small {
    color: var(--blackbox-muted);
    font-size: .74rem;
}

.status-track-rows {
    display: grid;
    gap: .4rem;
}

.status-track-row {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr);
    align-items: center;
    gap: .75rem;
}

.status-track-name {
    color: var(--blackbox-chart-legend-value);
    font-size: .70rem;
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Positioning context for the hover tooltip; .status-track clips (overflow:hidden), so the
   tooltip lives on this sibling wrapper instead. */
.status-track-hover-wrap {
    position: relative;
}

/* Hover/click-to-seek tracks: pointer events stay on the track root so OffsetX maps cleanly to
   the track width (segments' native title tooltips are replaced by the shared hover tooltip).
   Pointer, not crosshair: the OS crosshair cursor inverts against the segment colour under it. */
.status-track-interactive {
    cursor: pointer;
}

.status-track-interactive * {
    pointer-events: none;
}

.status-track {
    position: relative;
    min-height: 1.7rem;
    border-radius: 9px;
    overflow: hidden;
}

/* Status bars (feature requests 2026-10-27, as in Signac and the request artifact): each state carries a
   hue token in --h (a state class below, or the page's style); the segment is that hue mixed into the
   card, with a hue edge on its left and a hue outline while hovered. is-nodata is hatched. */
.status-track-segment {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Padding lives on the label; on the segment it would inflate sub-1% widths (see
       .operational-status-segment). */
    padding: 0;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    overflow: hidden;
    color: var(--text-strong);
    background: color-mix(in srgb, var(--h, var(--bb-status-none)) var(--bb-status-mix), var(--surface-card));
    box-shadow: inset 2px 0 0 var(--h, var(--bb-status-none));
}

.status-track-segment-label {
    max-width: 100%;
    min-width: 0;
    padding: 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-track-segment.is-active {
    z-index: 2;
}

.status-track-segment.is-hover {
    z-index: 4;
    outline: 2px solid var(--h, var(--border-default));
    outline-offset: -2px;
}

.status-track-segment.is-online { --h: var(--bb-status-go); }
.status-track-segment.is-offline,
.status-track-segment.is-error,
.status-track-segment.is-high { --h: var(--bb-status-alert); }

/* Alarm tracks: the Zabbix severity hues */
.status-track-segment.is-unclassified { --h: var(--bb-status-still); }
.status-track-segment.is-information { --h: var(--bb-status-remote); }
.status-track-segment.is-warning { --h: var(--status-warn); }
.status-track-segment.is-average { --h: #EA580C; }
.status-track-segment.is-disaster { --h: var(--bb-status-p2); }
.status-track-segment.is-nodata {
    color: var(--text-muted);
    background: repeating-linear-gradient(135deg, var(--blackbox-chart-surface) 0 5px, var(--border-subtle) 5px 7px);
    box-shadow: inset 2px 0 0 var(--border-default);
}

.status-track-swatch.is-online { background: color-mix(in srgb, var(--bb-status-go) var(--bb-status-mix), var(--surface-card)); box-shadow: inset 2px 0 0 var(--bb-status-go); }
.status-track-swatch.is-offline { background: color-mix(in srgb, var(--bb-status-alert) var(--bb-status-mix), var(--surface-card)); box-shadow: inset 2px 0 0 var(--bb-status-alert); }
.status-track-swatch.is-nodata {
    background-color: color-mix(in srgb, var(--text-dim) 22%, transparent);
    background-image: repeating-linear-gradient(
        45deg,
        color-mix(in srgb, var(--text-dim) 50%, transparent) 0,
        color-mix(in srgb, var(--text-dim) 50%, transparent) 3px,
        transparent 3px,
        transparent 6px);
}

.status-track-cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--blackbox-chart-cursor);
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
}

.status-track-empty {
    display: flex;
    align-items: center;
    padding: 0 .6rem;
}

.status-track-empty-label {
    color: var(--blackbox-muted);
    font-size: .72rem;
}

/* Dome carriers — rendered inside the Connectivity section, below its charts */
.dome-carrier-block {
    display: grid;
    gap: .6rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--blackbox-chart-surface-border);
}

.dome-carrier-heading {
    margin: 0;
    color: var(--blackbox-chart-axis-label);
    font-size: .74rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 700;
}

/* Radzen wraps each toast in .rz-notification-item-wrapper which carries its own
   background and square corners — it pokes out behind the rounded item. Make it
   invisible so only the item shows. */
/* ---- Handover reports (precheck / postcheck) ---- */
/* Handover reports live in their own category-list, so it needs the gap the inter-card
   grid gap (.85rem) would otherwise give it — below the TELEMETRY title and above the next cards. */

.handover-dot {
    display: inline-block;
    width: .6rem;
    height: .6rem;
    border-radius: var(--bb-radius-pill);
    flex: none;
    background: var(--text-dim);
}
.handover-meta {
    display: grid;
    gap: .3rem;
}

.handover-meta span {
    color: var(--text-strong);
    font-size: .85rem;
}

.handover-meta label {
    display: inline-block;
    /* fits the longest remark label (COMMUNICATION) so .handover-remarks values line up with these */
    min-width: 7.5rem;
    margin-right: .4rem;
    color: var(--blackbox-muted);
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 700;
}

.handover-note {
    margin: 0;
    color: var(--text-body);
    font-size: .85rem;
    line-height: 1.4;
}

.handover-late {
    color: var(--status-warn);
}
.handover-components {
    display: grid;
    gap: .4rem;
}

.handover-component {
    border: 1px solid var(--blackbox-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-card) 60%, transparent);
    overflow: hidden;
}

.handover-component > summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .65rem;
    cursor: pointer;
    list-style: none;
}

.handover-component > summary::-webkit-details-marker {
    display: none;
}

.handover-component > summary span {
    display: inline-flex;
}

.handover-component-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-strong);
    font-size: .8rem;
}

.handover-checks {
    list-style: none;
    margin: 0;
    padding: .25rem .65rem .6rem 1.7rem;
    display: grid;
    gap: .4rem;
}

.handover-checks li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    font-size: .82rem;
    color: var(--text-body);
}

.handover-check-name {
    font-weight: 600;
    color: var(--text-strong);
}

.handover-check-message {
    width: 100%;
    padding-left: 1.05rem;
    color: var(--blackbox-muted);
    font-size: .78rem;
}

/* One remark per row: operators write anything from "ok" to a full incident account, and side-by-side
   columns squeezed the long ones into a narrow strip. The label column matches .handover-meta (7.5rem
   + .4rem) so values line up with the voyage rows above; a narrow card wraps the text under the label. */
.handover-remarks {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    border-top: 1px solid var(--border-subtle);
}

.handover-remarks > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .15rem .4rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.handover-remarks dt {
    flex: 0 0 7.5rem;
    color: var(--blackbox-muted);
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 700;
}

.handover-remarks dd {
    flex: 1 1 18rem;
    min-width: 0;
    max-width: 75ch;
    margin: 0;
    color: var(--text-body);
    font-size: .85rem;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* The operator's own account of a flagged incident is the remark that matters: full width, label
   above, marked like the "Incident flagged" pill. */
.handover-remarks > div.is-incident {
    display: grid;
    gap: .3rem;
    margin: .55rem 0;
    padding: .65rem .8rem;
    border: 0;
    border-left: 3px solid var(--status-bad);
    border-radius: 8px;
    background: color-mix(in srgb, var(--status-bad) 7%, transparent);
}

.handover-remarks > div.is-incident dt {
    color: var(--status-bad);
}

.handover-remarks > div.is-incident dd {
    max-width: none;
    color: var(--text-strong);
}

/* Status colors shared by pills and dots */
.handover-pill.is-ok { background: color-mix(in srgb, var(--color-primary-active) 14%, transparent); color: var(--color-primary-active); }
.handover-pill.is-warning { background: color-mix(in srgb, var(--status-warn) 16%, transparent); color: var(--status-warn); }
.handover-pill.is-severe { background: rgba(234, 88, 12, .16); color: var(--status-warn); }
.handover-pill.is-critical { background: color-mix(in srgb, var(--status-bad) 14%, transparent); color: var(--status-bad); }
.handover-pill.is-neutral { background: color-mix(in srgb, var(--text-dim) 16%, transparent); color: var(--text-muted); }

.handover-dot.is-ok { background: var(--color-primary-active); }
.handover-dot.is-warning { background: var(--status-warn); }
.handover-dot.is-severe { background: #ea580c; }
.handover-dot.is-critical { background: var(--status-bad); }
.handover-dot.is-neutral { background: var(--text-dim); }

.timeline-controls button:hover,
.timeline-controls button:focus-visible,
.timeline-controls select:hover,
.timeline-controls select:focus-visible {
    border-color: color-mix(in srgb, var(--color-primary) 52%, transparent);
    background: var(--surface-hover);
    color: var(--color-primary-active);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--color-primary) 14%, transparent);
    outline: 0;
}

.timeline-controls button:active {
    transform: translateY(1px);
}

.vhf-transcript-time,
.vhf-transcript-channel {
    font-size: .82rem;
    font-size: .78rem;
}

.incident-loading-card small {
    color: var(--text-muted);
    font-size: .82rem;
}

.telemetry-summary-grid {
    margin-top: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
    margin-bottom: 1rem;
}


.dialog-cancel-button.rz-button,
.dialog-cancel-button.rz-button.rz-light {
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-body);
}

.dialog-cancel-button.rz-button:hover,
.dialog-cancel-button.rz-button:focus-visible,
.dialog-cancel-button.rz-button.rz-light:hover,
.dialog-cancel-button.rz-button.rz-light:focus-visible {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.timeline-controls .timeline-speed-dropdown.rz-dropdown {
    min-width: 7rem;
}

.app-main:has(.login-page-shell) {
    min-height: calc(100vh - 72px);
    padding: 0 2rem !important;
    display: grid;
    align-items: center;
    overflow: hidden;
}

.app-main:has(.incident-page) {
    width: 100%;
    max-width: none;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.grid-panel > .section-heading {
    margin-bottom: .9rem;
}
.incident-content .content-card {
    padding: .95rem;
}

.camera-layout-shell,
.media-grid {
    gap: .85rem;
}
/* The pinned panel stays a child of the grid (see CamerasInLayout: moving it to a separate
   featured slot re-creates its <video> tags and reloads the footage). Hoisting it to a
   full-width first row here is what makes it *look* featured. */

.navigation-map-stack {
    min-height: 190px;
}

.navigation-map-canvas {
    height: 190px;
}

/* The pinned map fills the featured panel like a pinned camera does; without
   this it keeps the 190px grid height and leaves dead space below.
   (blackbox.js observes the element and re-invalidates the Mapbox size.) */

.camera-segment-list,
.navigation-map-meta {
    padding: .55rem .7rem .7rem;
}

.camera-segment-list {
    gap: .4rem;
    display: flex;
    overflow-x: auto;
    border-top: 1px solid var(--blackbox-border);
}

.timeline-speed-menu {
    position: relative;
    min-width: 0;
}
.timeline-speed-trigger {
    width: 100%;
    min-width: 6.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--bb-radius-pill);
    background: var(--surface-card) !important;
    color: var(--text-body) !important;
    padding: .42rem .72rem;
    font-weight: 800;
}

.timeline-speed-dropdown-panel {
    position: absolute;
    left: 50%;
    bottom: calc(100% + .6rem);
    transform: translateX(-50%);
    animation: bb-popover-in var(--dur-fast) var(--ease);
    /* above the event-lane markers (z 2-5) and replay cursor (z 6) */
    z-index: 10;
    min-width: 9rem;
    display: grid;
    gap: .35rem;
    padding: .45rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    background: var(--surface-card);
    box-shadow: 0 18px 50px rgba(15,23,42,.16);
}

.timeline-speed-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border-radius: var(--bb-radius-sm) !important;
    background: var(--surface-card) !important;
    color: var(--text-body) !important;
    box-shadow: none !important;
    text-align: left;
}

.timeline-speed-option.is-selected {
    border-color: color-mix(in srgb, var(--color-primary) 36%, transparent) !important;
    background: var(--surface-hover) !important;
    color: var(--color-primary-active) !important;
}

.timeline-speed-option i {
    font-size: .8rem;
}

.timeline-controls button:hover:not(:disabled),
.timeline-controls button:focus-visible:not(:disabled),
.timeline-controls select:hover,
.timeline-controls select:focus-visible {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 14%, var(--surface-card));
    color: var(--color-primary);
    box-shadow: none;
    outline: 0;
}

/* The base colours of these three are !important, so the generic ".timeline-controls button:hover"
   above never lands on them and they read as dead. Hover has to shout back at the same volume. */
.timeline-speed-trigger:hover:not(:disabled),
.timeline-speed-trigger:focus-visible:not(:disabled) {
    border-color: var(--color-primary) !important;
    background: color-mix(in srgb, var(--color-primary) 14%, var(--surface-card)) !important;
    color: var(--color-primary-active) !important;
}

.timeline-speed-option:hover:not(.is-selected),
.timeline-speed-option:focus-visible:not(.is-selected) {
    border-color: color-mix(in srgb, var(--color-primary) 36%, transparent) !important;
    background: var(--surface-hover) !important;
}

/* filled primary button: brighten rather than re-declare the gradient */

.timeline-controls-bottom.is-collapsed {
    width: auto;
}

.timeline-controls-bottom.is-collapsed .timeline-speed-menu,
.timeline-controls-bottom.is-collapsed .timeline-control-group-scrub {
    display: none;
}

.timeline-controls-bottom.is-collapsed .timeline-control-group-playback,
.timeline-controls-bottom.is-collapsed .timeline-control-group-tools {
    gap: .35rem;
    padding-left: 0;
}
.vhf-card {
    position: relative;
    display: grid;
    gap: .75rem;
}

/* VHF and Documents are one collapsible each: no second frame inside the card, the actions beside
   the summary (a click inside a summary would open or close it). */
.content-card:has(> .card-collapse) {
    position: relative;
}

.content-card > .card-collapse {
    border: 0;
    background: none;
    margin: -.4rem -.6rem;
}

.content-card > .card-actions {
    position: absolute;
    top: .7rem;
    right: 3.6rem;
    z-index: 1;
}

/* Room for the actions, sized for the longest translation ("+ VHF hinzufügen" beside the gear); the
   count gives way with an ellipsis rather than sliding under them, and phones drop it. */
.content-card:has(> .card-actions) > .card-collapse > .collapse-head {
    padding-right: 17.5rem;
}

.content-card:has(> .card-actions) > .card-collapse > .collapse-head > .collapse-meta {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .content-card:has(> .card-actions) > .card-collapse > .collapse-head > .collapse-meta {
        display: none;
    }
}

.vhf-panel-body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: .7rem;
    min-height: 25rem;
}

.vhf-transcript-empty {
    height: 100%;
    min-height: 18.6rem;
    display: grid;
    align-content: center;
    gap: .35rem;
    padding: 1rem 1.15rem;
    border: 1px dashed color-mix(in srgb, var(--text-dim) 35%, transparent);
    border-radius: var(--bb-radius-md);
    background: var(--surface-sunken);
}

.vhf-transcript-empty strong,
.vhf-transcript-empty small {
    display: block;
}

.vhf-transcript-empty strong {
    color: var(--text-strong);
}

.vhf-transcript-empty small {
    color: var(--text-muted);
    line-height: 1.45;
}


.navigation-map-panel .mapboxgl-map,
.navigation-map-panel .mapboxgl-canvas {
    background: var(--surface-sunken);
}

.navigation-map-panel .mapboxgl-ctrl-group {
    border-color: var(--blackbox-border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.navigation-map-panel .mapboxgl-ctrl button {
    background: var(--surface-card);
}

.navigation-map-panel .mapboxgl-ctrl-attrib {
    background: color-mix(in srgb, var(--surface-page) 88%, transparent);
    color: var(--text-body);
}

.navigation-map-panel .mapboxgl-ctrl-attrib a {
    color: var(--color-primary-active);
}

.navigation-map-marker {
    display: block;
    width: .95rem;
    height: .95rem;
    border: 2px solid #ffffff;
    border-radius: var(--bb-radius-pill);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .24);
}

.navigation-map-marker-start {
    background: #38bdf8;
}

.navigation-map-marker-end {
    background: #f59e0b;
}

.navigation-map-marker-incident {
    width: 1.1rem;
    height: 1.1rem;
    background: #7c3aed;
}

.navigation-map-marker-cursor {
    width: 1rem;
    height: 1rem;
    background: var(--status-bad);
}

/* The own hull (ais-own layer) is the vessel while it is on screen; the marker steps aside.
   visibility, not opacity: Mapbox's unlayered .mapboxgl-marker rule pins opacity to 1. */
.navigation-map-marker-cursor.is-hull {
    visibility: hidden;
    pointer-events: none;
}

/* AIS hover card: the JS joins vessel details with newlines and sets them as text
   (never HTML — vessel names come from an external feed). Styled on the same tokens as the
   timeline event tooltip so it belongs to the theme instead of Mapbox's white default;
   ::first-line lifts the vessel name without needing markup. !important throughout: the Mapbox
   CDN stylesheet is unlayered, so it outranks anything app.css says from inside @layer. */
.ais-popup .mapboxgl-popup-content {
    white-space: pre-line;
    font-size: .78rem;
    line-height: 1.5;
    padding: .5rem .7rem !important;
    background: var(--surface-raised) !important;
    border: 1px solid var(--border-default) !important;
    border-radius: var(--radius-chip) !important;
    color: var(--text-body) !important;
    box-shadow: var(--shadow-card) !important;
}

.ais-popup .mapboxgl-popup-content::first-line {
    color: var(--text-strong);
    font-weight: 600;
}

/* The popup tip is a CSS-border triangle; recolour every direction to the card surface. */
.ais-popup .mapboxgl-popup-tip {
    border-top-color: var(--surface-raised) !important;
    border-bottom-color: var(--surface-raised) !important;
}

.ais-popup.mapboxgl-popup-anchor-left .mapboxgl-popup-tip { border-right-color: var(--surface-raised) !important; border-top-color: transparent !important; border-bottom-color: transparent !important; }
.ais-popup.mapboxgl-popup-anchor-right .mapboxgl-popup-tip { border-left-color: var(--surface-raised) !important; border-top-color: transparent !important; border-bottom-color: transparent !important; }

/* Header button pair on the navigation map panel (follow + pin/back). */

/* ------------------------------------------------------------------ */
/* UI fixes: tabs, grid row selection/actions, navigation-map empty.   */
/* ------------------------------------------------------------------ */

/* Tabs: keep inactive labels muted instead of the default near-black,
   the hovered tab in the accent, and the active tab in the darker accent. */

/* Selected/clicked grid row: keep the text in the theme colour rather than
   the default link-blue that lingers after a row is clicked. */

/* Candidate row actions are icon-only ghost buttons: no fill/border, theme-coloured
   icons (Promote accent, Discard danger) that stay readable on row hover instead of
   inheriting the dark hover text colour. */

/* Keep the Actions header/cells off the right edge. */

/* ------------------------------------------------------------------ */
/* Candidate dialogs                                                   */
/* ------------------------------------------------------------------ */

/* Intro/context line shared by the promote & discard dialogs. */
.dialog-context-line {
    margin: 0 0 1.15rem;
    padding-bottom: .8rem;
    border-bottom: 1px solid var(--blackbox-border);
    color: var(--blackbox-muted);
    font-size: .9rem;
    line-height: 1.45;
}

/* Promote/discard actions at the bottom of the details sidebar card in candidate
   review mode: two square icon-only buttons, centered. */
.candidate-detail-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--blackbox-border);
}

.candidate-detail-actions .candidate-action-button {
    width: 40px;
    height: 40px;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-button);
    color: var(--color-primary);
}

.candidate-detail-actions .candidate-action-button .rzi,
.candidate-detail-actions .candidate-action-button i {
    color: var(--color-primary);
}

.candidate-detail-actions .candidate-action-button:hover:not(.rz-state-disabled),
.candidate-detail-actions .candidate-action-button:focus-visible:not(.rz-state-disabled) {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    border-color: var(--color-primary);
    box-shadow: none;
}

.candidate-detail-actions .candidate-action-button .rzi {
    font-size: 1.4rem;
}

/* ------------------------------------------------------------------ */
/* Manage camera footage grid                                          */
/* ------------------------------------------------------------------ */

/* Group header rows ("Bridge — 1 segment") read as a tinted section band
   instead of a stark white block, with the camera name in the accent colour. */

/* The group expand/collapse toggle is a Radzen button; neutralise its default
   near-white hover/focus background AND the focus ring/outline that otherwise
   lingers after a click, so it blends into the group band. */

/* The row being edited stays clearly active and themed (just a tint — no per-cell
   accent lines, which read as column separators). */

/* Action icons darken to the accent on hover/focus. The `tr:hover td` ancestor is
   included so this beats the row-hover rule that otherwise pins the lighter accent. */

/* The glyph stays transparent — a background on the <i>/box AND the button produced
   the doubled background; keep the single subtle tint on the button only. */

/* Navigation-map "no GPS points" message: give the centred text padding so
   it isn't flush against the panel edges. */
/* Hint line under a dialog field (e.g. the promote dialog priority note). */
.dialog-hint {
    margin: .35rem 0 0;
    color: var(--blackbox-muted);
    font-size: .82rem;
}

/* Collapsible evidence-window override; needs to clear the form grid above it in every dialog
   that hosts it (create, promote, edit time). */
.evidence-window-fields {
    margin-top: 1rem;
}

/* Per-panel progressive-loading placeholder (B9.2): telemetry / VHF / handover panels render this
   compact spinner + label while their sub-resource fetch is in flight, so the shell stays responsive. */
.panel-loading {
    display: flex;
    align-items: center;
    gap: var(--bb-space-3);
    padding: var(--bb-space-4);
    color: var(--blackbox-muted);
    font-size: var(--bb-font-sm);
}
/* Per-severity alarm counts on the collapsed Alarms summary (B10). The aggressive
   `.telemetry-category summary span` title rule needs a higher-specificity override for the chips. */

/* ------------------------------------------------------------------ */
/* Scrub hover readout (all viewports)                                 */
/* ------------------------------------------------------------------ */
.timeline-scrub-tooltip {
    position: absolute;
    bottom: calc(100% + .4rem);
    z-index: 12;
    transform: translateX(-50%);
    padding: .18rem .5rem;
    border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
    border-radius: var(--radius-pill);
    background: var(--surface-card);
    color: var(--color-primary-active);
    box-shadow: var(--shadow-card);
    font-size: .78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
}

/* Keep the bubble inside the bar at the ends of the track */
.timeline-scrub-tooltip.is-edge-start {
    transform: none;
}

.timeline-scrub-tooltip.is-edge-end {
    transform: translateX(-100%);
}

/* ------------------------------------------------------------------ */
/* Phone replay-bar sheet (speed · skip · events · actions)             */
/* ------------------------------------------------------------------ */
/* Only rendered below 768px (TimelineControls.IsCompactLayout), so these
   rules need no breakpoint of their own. */
/* Deliberately NOT positioned: the sheet then anchors to the replay bar itself
   (the nearest positioned ancestor), so it spans the bar's inner width instead of
   hanging off the left edge from a trigger that sits near the right. */
.timeline-more-menu {
    position: static;
}

.timeline-controls button.timeline-more-trigger.is-open {
    border-color: var(--blackbox-primary) !important;
    background: var(--surface-hover) !important;
    color: var(--color-primary-active) !important;
}

.timeline-more-panel {
    position: absolute;
    left: .85rem;
    right: .85rem;
    bottom: calc(100% + .6rem);
    z-index: 20;
    display: grid;
    gap: .5rem;
    padding: .7rem;
    border: 1px solid color-mix(in srgb, var(--text-dim) 18%, transparent);
    border-radius: 22px;
    background: var(--surface-card);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .38);
    animation: bb-sheet-in var(--dur-fast) var(--ease);
    /* Landscape phones have ~230px above the bar; scroll rather than overflow. */
    max-height: calc(100dvh - 10rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.timeline-more-section {
    display: grid;
    gap: .35rem;
}

.timeline-more-label {
    color: var(--text-muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

/* Even columns rather than wrapping flex: 6 speeds and 5 steps both land on two
   tidy rows instead of a ragged 4+2 / 4+1. */
.timeline-more-chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .3rem;
}

.timeline-controls button.timeline-more-chip {
    min-height: 2.4rem;
    padding: .35rem .5rem;
    border-radius: var(--bb-radius-sm) !important;
    background: var(--surface-card) !important;
    color: var(--text-body) !important;
    box-shadow: none !important;
    font-size: .82rem;
    font-weight: 600;
}

.timeline-controls button.timeline-more-chip.is-selected {
    border-color: color-mix(in srgb, var(--color-primary) 36%, transparent) !important;
    background: var(--surface-hover) !important;
    color: var(--color-primary-active) !important;
}
/* Shared entry animation for the replay sheet and the header menu */
@keyframes bb-sheet-in {
    from {
        opacity: 0;
        transform: translateY(.4rem) scale(.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Replay-bar popovers rise a few pixels into place; they are centred with a
   transform, so both frames carry it. */
@keyframes bb-popover-in {
    from {
        opacity: 0;
        transform: translate(-50%, .3rem) scale(.98);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

@keyframes bb-drawer-in {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes bb-scrim-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ------------------------------------------------------------------ */
/* Phone header menu                                                   */
/* ------------------------------------------------------------------ */
/* The hamburger, its scrim, the in-menu Dashboard link and the button
   labels exist in the markup at every width but only participate below
   768px (@layer responsive turns .header-actions into the sheet). */
.header-nav-toggle,
.header-menu-scrim,
.header-action-label {
    display: none;
}
}
@layer responsive {
@media (max-width: 1279px) {
    .media-grid-secondary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .media-grid-regular {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}
@media (max-width: 1023px) {
    .hero-panel {
        grid-template-columns: 1fr;
        display: block;
    }

    .hero-stats,
    .toolbar-grid,
    .incident-form-grid,
    .dialog-form-grid,
    .upload-grid,
    .analysis-grid,
    .media-grid,
    .telemetry-summary-grid {
        grid-template-columns: 1fr;
        min-width: 0;
    }
.span-2 {
        grid-column: auto;
    }

    /* Tablets keep the header on one row — brand + actions fit well under
       1024px, and wrapping it cost a second row of mostly empty chrome. */
    .app-header {
        gap: .9rem;
        padding: 0 1.25rem;
    }
.vhf-channel-shell {
        grid-template-columns: 1fr;
    }

    .vhf-channel-label {
        min-height: 0;
        box-shadow: inset 0 -1px 0 rgba(255,255,255,.08);
    }

    .vhf-chat-window {
        padding-left: 1rem;
    }

    .timeline-controls {
        width: calc(100vw - 1rem);
        bottom: .75rem;
        padding: .85rem;
        border-radius: var(--bb-radius-lg);
    }

.timeline-control-group {
        width: 100%;
        flex-wrap: wrap;
    }

.timeline-scrub-readout {
        min-width: 0;
        text-align: left;
    }

    /* ---------------------------------------------------------------- */
    /* ---------------------------------------------------------------- */
    /* Clearance follows the bar's real height without a ResizeObserver.
       ponytail: two :has() states cover today's bar; measure in JS only if
       the bar grows more variable rows. */
    :root {
        --timeline-clearance: 7.5rem;
    }
:root:has(.timeline-controls-bottom.is-collapsed) {
        --timeline-clearance: 4.75rem;
    }

    .timeline-controls-bottom {
        gap: .4rem;
    }

    /* Event chips stay on one swipeable row instead of stacking rows of
       filters on top of a bar that is already the tallest thing on screen. */

.timeline-controls button.timeline-event-chip {
        flex: none;
    }

    /* Wrapping flex instead of the desktop grid: the transport cluster (and, on
       tablets, the inline chips/actions) centre on the first line and the scrub
       row is forced onto its own full-width line. Two rows total on a phone. */
/* order pushes the scrub row past the transport + tools groups regardless of
       DOM order, so the collapse chevron stays on line 1; nowrap keeps the time
       readout beside the slider (the 1023px rule wraps control groups). */
.timeline-controls-bottom .timeline-speed-trigger {
        gap: .2rem;
        padding: .48rem .5rem;
        font-size: .8rem;
    }

    .timeline-controls-bottom .timeline-scrub-readout {
        min-width: 0;
        text-align: right;
        font-size: 1rem;
    }
.timeline-controls-bottom .timeline-control-group-tools {
        width: auto;
        justify-content: flex-end;
        gap: .3rem;
    }

    .login-page-shell {
        grid-template-columns: 1fr;
    }

    .login-hero-panel {
        min-height: 0;
        padding: 2rem;
    }

    .vhf-transcript-item {
        grid-template-columns: 1fr;
    }

    /* Cameras stay paired on tablets (the generic 1fr rule above is too eager);
       they drop to a single column only on phones. */
    .media-grid-regular,
    .media-grid-secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Data grids: scroll sideways instead of crushing every column to a few
       pixels (a fixed-width column such as Footage otherwise eats the row).
       .rz-data-grid-data is Radzen's scroll box; the table needs the
       min-width or table-layout:fixed just squeezes to fit. */
    .rz-data-grid,
    .rz-datatable,
    .rz-data-grid-data {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Let each column take the width its content needs and scroll the table
       sideways, instead of an even fixed split that ellipsizes timestamps. */
    .blackbox-grid .rz-grid-table {
        min-width: max-content;
        table-layout: auto;
    }

    .blackbox-grid .rz-grid-table td,
    .blackbox-grid .rz-grid-table th {
        white-space: nowrap;
    }

    /* Upload/manage dialog tables are plain <table>s under .blackbox-grid */

/* Pager: keep it inside the card on narrow screens */
    .rz-paginator,
    .rz-pager {
        flex-wrap: wrap;
        gap: .25rem;
        row-gap: .35rem;
    }

    .vhf-transcript-translation,
    .vhf-transcript-original {
        grid-column: 1;
    }
    /* Filters pair up instead of stacking four full-width fields */
    .dashboard-filters .toolbar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
.dialog-form-grid-create-incident {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 767px) {
    /* Replay bar: full-bleed bottom sheet with safe-area padding */
    :root {
        --timeline-clearance: 9rem;
    }

    /* Floating card rather than a full-bleed sheet: a little air on all sides
       reads better, and the outer offset absorbs the home-indicator inset so the
       inner padding stays even. */
    .timeline-controls-bottom {
        left: .5rem;
        right: .5rem;
        bottom: calc(.5rem + env(safe-area-inset-bottom));
        transform: none;
        width: auto;
        max-width: none;
        border-radius: var(--radius-card);
        padding: .7rem .85rem;
    }

    /* Dialogs: recover the wrapper gutter on small screens */
    .rz-dialog-wrapper {
        padding: var(--space-3);
    }

/* The left rail sizes every item to the rail width; in a row that leaves
       four 320px-wide tabs, so size them to their labels instead. */

/* ---------------------------------------------------------------- */
    /* Phone manage/upload dialogs: flow instead of fixed-height panes   */
    /* ---------------------------------------------------------------- */
    /* Desktop sizes these panes to a share of the viewport and scrolls inside
       them; at 780px tall that clipped the file picker and the upload button
       clean out of view. On phones everything is content-height and the dialog
       body is the single scroller. */

/* Pick files first, then correct the mapping/shift below — the reverse of the
       desktop two-column layout, where both are visible at once. */

/* Action rows flow with the content (two stacked sticky rows — the panel's own
       and the dialog's Close — would overlap at the bottom of the sheet). */

.status-track-row {
        grid-template-columns: 7rem minmax(0, 1fr);
        gap: .5rem;
    }
/* ---------------------------------------------------------------- */
    /* Phone header: one compact row, everything else in a menu sheet   */
    /* ---------------------------------------------------------------- */
    :root {
        --header-h: 58px;
    }

    .app-header {
        gap: .55rem;
        padding: 0 .85rem;
    }

    .brand {
        gap: .55rem;
    }

.header-nav-toggle {
        display: inline-grid;
        place-items: center;
        margin-left: auto;
        width: 2.6rem;
        height: 2.6rem;
        border: 1px solid rgba(255,255,255,.28);
        border-radius: 10px;
        background: rgba(255,255,255,.12);
        color: #ffffff;
        font-size: 1.05rem;
        cursor: pointer;
    }

    .header-menu-scrim {
        display: block;
        position: fixed;
        inset: var(--header-h) 0 0;
        z-index: 1150;
        background: var(--surface-scrim);
    }

    /* The sheet and its scrim live inside the header, so the header's own
       stacking context has to clear the fixed replay bar (z 900) while the
       menu is open — otherwise the bar paints over the menu on detail pages. */
    .app-header:has(.header-actions.is-open) {
        z-index: 1200;
    }

    /* Kept in the layout and hidden with visibility so it can slide in/out; a
       display toggle cannot transition (and visibility:hidden still drops it out
       of the tab order). */
    .header-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        visibility: hidden;
        position: fixed;
        top: calc(var(--header-h) + .3rem);
        right: .55rem;
        z-index: 1160;
        width: min(15.5rem, calc(100vw - 1.1rem));
        margin: 0;
        padding: .4rem;
        gap: .1rem;
        border: 1px solid var(--border-default);
        border-radius: var(--radius-card);
        background: var(--surface-card);
        box-shadow: var(--shadow-overlay);
        opacity: 0;
        transform: translateY(-.5rem) scale(.98);
        transform-origin: top right;
        transition: opacity var(--dur-fast) var(--ease),
                    transform var(--dur-fast) var(--ease),
                    visibility var(--dur-fast) var(--ease);
        pointer-events: none;
    }

    .header-actions.is-open {
        visibility: visible;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .header-menu-scrim {
        animation: bb-scrim-in var(--dur-fast) var(--ease);
    }

    /* Menu rows: icon + label, full width, touch height */
    .header-actions .header-action-button {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: .65rem;
        width: 100%;
        height: auto;
        min-height: 2.75rem;
        padding: .55rem .7rem;
        border: 0;
        border-radius: var(--radius-input);
        background: transparent;
        color: var(--text-strong);
        font-size: .95rem;
        text-align: left;
    }

    .header-action-label {
        display: inline;
    }

    /* The share header has no menu sheet: its buttons stay icons (the language keeps its code), and the
       language list opens from the right edge instead of centred, which would run off the screen. */
    .share-header-actions .header-action-label {
        display: none;
    }

    .share-header-actions .header-language-panel {
        left: auto;
        right: 0;
        transform: none;
    }

    .header-actions .header-action-button:hover,
    .header-actions .header-action-button:focus-visible {
        border-color: transparent;
        background: var(--surface-hover);
        color: var(--text-strong);
    }

    .header-actions .header-action-button i {
        width: 1.15rem;
        text-align: center;
        color: var(--color-primary-active);
    }

    /* Identity reads as the sheet's header row rather than a pill */
    .header-actions .header-user-status {
        order: -1; /* identity first, whatever the markup order */
        width: 100%;
        max-width: none;
        margin: 0 0 .15rem;
        padding: .5rem .7rem;
        border-bottom: 1px solid var(--border-subtle);
        border-radius: 0;
        color: var(--text-strong);
    }

    /* The base rule paints this white for the dark header; in the sheet it sits
       on a card surface, so it has to follow the theme. */

.timeline-controls-bottom.is-collapsed {
        padding: .45rem .55rem;
    }

    /* ---------------------------------------------------------------- */
    /* Phone dashboard: 2-up filters, scrollable grids                  */
    /* ---------------------------------------------------------------- */
    /* ---------------------------------------------------------------- */
    /* Phone content panels                                             */
    /* ---------------------------------------------------------------- */
    /* Nested gutters (page 32 + tab panel 16 + card 20 per side) ate 36%
       of a 375px viewport. Trim them so grids and charts get the width. */
    .app-main,
    .app-main:has(.incident-page) {
    width: 100%;
    max-width: none;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

    .app-main > .rz-tabview > .rz-tabview-panels > .rz-tabview-panel {
        padding-left: 0;
        padding-right: 0;
    }

    .grid-panel,
    .content-card,
    .incident-content .content-card {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    /* 50px on every side is desktop breathing room; on a phone it halves
       the text measure and adds ~100px to each of a dozen empty cards. */
    .empty-state {
        margin: 1.25rem .5rem;
    }

    .telemetry-card .empty-state {
        margin: .75rem 0;
    }

    /* Category headers put their description under the title instead of
       squeezing both into one row */

/* A single transcript in the fixed-height stream must not stretch its
       rows apart (the stream keeps a stable 18.6rem height). */
    .vhf-transcript-item {
        align-content: start;
    }

    /* ---------------------------------------------------------------- */
    /* ---------------------------------------------------------------- */

/* 2x2 (set at 1023px) gets tighter gaps on phones */
    .dashboard-filters .toolbar-grid {
        gap: .55rem .6rem;
    }

    .section-heading {
        align-items: center;
        gap: .6rem;
    }

    .section-heading .rz-button .rz-button-text {
        white-space: nowrap;
    }
}
@media (max-width: 639px) {
    /* Dialogs go full-screen on phones. !important justified: it must beat
       the inline style="width: min(Npx, 94vw)" Radzen writes on .rz-dialog. */
    .rz-dialog-wrapper {
        padding: 0;
    }

    .rz-dialog {
        width: 100dvw !important;
        max-width: 100dvw !important;
        height: 100dvh;
        max-height: 100dvh !important;
        margin: 0;
        border-radius: 0;
        border: 0;
        display: flex;
        flex-direction: column;
    }

    .rz-dialog-content {
        flex: 1 1 auto;
        max-height: none !important;
        overflow-y: auto;
    }

    /* Keep primary actions reachable while full-screen content scrolls */
    .rz-dialog .dialog-actions,
    .rz-dialog .action-row {
        position: sticky;
        bottom: 0;
        background: var(--surface-card);
        padding-top: var(--space-3);
        padding-bottom: var(--space-3);
        z-index: 5;
    }

    .hero-stats {
        min-width: 0;
        grid-template-columns: 1fr;
    }

    .media-grid-regular,
    .media-grid-secondary {
        grid-template-columns: 1fr;
    }
}
/* Phone/tablet in landscape: a 220px replay bar would eat 55% of a 390px-tall
   viewport, so the bar folds into one row and drops the chip legend (the lane
   itself stays — its markers are the point of it). */
@media (max-width: 1023px) and (max-height: 540px) {
    :root {
        --timeline-clearance: 7.5rem;
    }

    /* Same specificity as the rule above and declared after it, so the
       collapsed mini-player keeps its own (smaller) clearance. */
    :root:has(.timeline-controls-bottom.is-collapsed) {
        --timeline-clearance: 4.5rem;
    }
}
@media (max-height: 850px) {
    .rz-dialog-wrapper.create-incident-dialog-wrapper {
        align-items: flex-start !important;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .rz-dialog.create-incident-dialog {
        margin-top: 0 !important;
    }
}

/* Touch ergonomics: 44px minimum targets on coarse pointers (phones, tablets,
   touch laptops) regardless of viewport width. */
@media (pointer: coarse) {
    .rz-button,
    .header-action-button,
    .text-button,
    .inline-value-button,
    .rz-paginator-page,
    .rz-paginator-first,
    .rz-paginator-prev,
    .rz-paginator-next,
    .rz-paginator-last,
    .rz-tabview-nav li a,
    .timeline-controls button,
    .timeline-controls select,
    .rz-inputtext,
    .rz-textbox,
    .rz-dropdown,
    .rz-numeric input,
    .vhf-channel-button {
        min-block-size: 44px;
    }

    .blackbox-grid td {
        min-height: 44px;
    }

    /* Icon-only buttons are square: widen them too, or 44px tall x 34px wide
       still misses under a thumb. */
    .header-icon-action {
        min-inline-size: 44px;
    }

    /* The scrub slider is the most-used control on a phone: give it a real
       hit area and a thumb big enough to drag. */

/* Data grids scroll horizontally instead of crushing fixed-px columns */
    .rz-data-grid,
    .rz-datatable {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Slide-ins are decoration; honour the OS setting. */
@media (prefers-reduced-motion: reduce) {
    .header-actions,
    .header-menu-scrim,
    .timeline-more-panel,
    .timeline-speed-dropdown-panel,
    .timeline-events-popover,
    .timeline-edge-popover {
        animation: none !important;
        transition: none !important;
    }
}
}

/* ===========================================================================
   Incident page redesign (2026-09) — Signac/Fleetview design language on the
   Blackbox tokens. Header wordmark, boot loader, navigation rail, details
   header, footage section + status strip, camera tiles, upload dialogs,
   range brush, align dialog, one-row replay bar, Signac chart shells.
   Everything consumes T2 tokens only.
   =========================================================================== */
@layer components {

/* ---------- Header: Signac wordmark + crumb, icon buttons, user pill ---------- */
.brand {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .30em;
    color: #ffffff;
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.brand b {
    font-weight: 500;
    color: var(--cyan);
}

html[data-theme="light"] .app-header .brand b {
    color: #BFF3EE;
}

.crumb {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crumb b {
    font-weight: 500;
    color: #ffffff;
}

.crumb-sep {
    margin: 0 .55rem;
    opacity: .6;
}

.userpill {
    font-size: 12.5px;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: var(--radius-pill);
    padding: 5px 13px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(255,255,255,.12);
}

/* Square icon button (Signac .iconbtn). Themed everywhere; the header variant is white chrome. */
.iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    flex-shrink: 0;
    background: var(--surface-raised);
    color: var(--text-muted);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12.5px;
    line-height: 1;
    text-decoration: none;
    transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.iconbtn:hover:not(:disabled),
.iconbtn:focus-visible:not(:disabled) {
    border-color: var(--cyan-dim);
    color: var(--color-primary);
    outline: 0;
}

.iconbtn:disabled {
    opacity: .45;
    cursor: default;
}

.iconbtn.is-active,
.iconbtn.on {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

.iconbtn-sm {
    width: 26px;
    height: 26px;
    font-size: 11px;
    border-radius: 7px;
}

.iconbtn-xs {
    width: 22px;
    height: 22px;
    font-size: 10px;
    border-radius: 6px;
}

.app-header .iconbtn {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.28);
    color: #ffffff;
}

.app-header .iconbtn:hover:not(:disabled),
.app-header .iconbtn:focus-visible:not(:disabled) {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.45);
    color: #ffffff;
}

/* Toggled on (privacy mode, the assistant open, the language list open): the button fills with the
   accent, so the state reads at a glance. Declared after the white chrome above, which it overrides. */
.app-header .iconbtn.on,
.app-header .iconbtn.is-open,
.app-header .iconbtn.on:hover:not(:disabled),
.app-header .iconbtn.on:focus-visible:not(:disabled),
.app-header .iconbtn.is-open:hover:not(:disabled),
.app-header .iconbtn.is-open:focus-visible:not(:disabled) {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--text-inverse);
}

/* The light header is teal itself: there the on-state is white with a teal glyph. */
:root[data-theme="light"] .app-header .iconbtn.on,
:root[data-theme="light"] .app-header .iconbtn.is-open,
:root[data-theme="light"] .app-header .iconbtn.on:hover:not(:disabled),
:root[data-theme="light"] .app-header .iconbtn.is-open:hover:not(:disabled) {
    background: #ffffff;
    border-color: #ffffff;
    color: var(--color-primary-active);
}

/* Signac ghost button: mono label, hairline border; .primary fills with the accent. */
.ghost {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--surface-raised);
    color: var(--text-strong);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-button);
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.45;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.ghost:hover:not(:disabled) {
    border-color: var(--cyan-dim);
}

.ghost.danger {
    color: var(--status-bad);
}

.ghost.primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
    font-weight: 600;
}

.ghost.primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.ghost:disabled {
    opacity: .45;
    cursor: default;
}

/* Radzen buttons read as Signac buttons: sentence case, 7px corners. */
.rz-button {
    text-transform: none !important;
    letter-spacing: .01em;
    border-radius: var(--radius-button);
}

/* ---------- Boot / loading: the Signac boot block, one indicator for every wait ---------- */
.boot {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    background: var(--surface-page);
}

.app-main .boot,
.boot.boot-inline {
    height: auto;
    min-height: calc(100vh - var(--header-h) - 6rem);
    background: transparent;
}

.boot .brand {
    color: var(--text-strong);
}

.boot .brand b {
    color: var(--color-primary);
}

.boot .muted {
    font-size: 13px;
    color: var(--text-muted);
}

.boot .loadbar {
    width: min(220px, 60vw);
    margin-top: 4px;
}

.loadbar {
    height: 4px;
    width: 100%;
    max-width: 420px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--border-subtle);
}

.loadbar-fill {
    height: 100%;
    width: 38%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--cyan-deep), var(--cyan));
    box-shadow: var(--glow-primary);
    animation: bb-loadslide 1.5s ease-in-out infinite;
}

.loadbar-determinate {
    max-width: none;
}

/* Inline activity mark next to a heading (Connectivity summary, Navigation header). */
.loadbar-mini {
    display: inline-block;
    width: 40px;
    max-width: 40px;
    height: 3px;
    vertical-align: middle;
}

.loadbar-determinate .loadbar-fill {
    animation: none;
    transition: width .4s ease;
}

@keyframes bb-loadslide {
    0% { margin-left: -38%; }
    100% { margin-left: 100%; }
}

.panel-loading {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--text-muted);
    font-size: 12.5px;
}

.panel-loading .loadbar {
    width: 8rem;
    max-width: 8rem;
    flex: none;
}

/* ---------- Shared small pieces ---------- */
.mono {
    font-family: var(--font-mono);
}

.num {
    font-variant-numeric: tabular-nums;
}

.grow {
    flex: 1 1 auto;
}

.vp-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-dim);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-dim) 18%, transparent);
}

.vp-dot.good {
    background: var(--status-good);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-good) 18%, transparent), 0 0 12px color-mix(in srgb, var(--status-good) 45%, transparent);
}

.vp-dot.dim {
    background: var(--text-muted);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .08em;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-pill);
    padding: 0 10px;
    color: var(--text-muted);
    line-height: 1;
    white-space: nowrap;
}

.chip-good { color: var(--status-good); border-color: color-mix(in srgb, var(--status-good) 45%, transparent); }
.chip-bad { color: var(--status-bad); border-color: color-mix(in srgb, var(--status-bad) 45%, transparent); }
.chip-info { color: var(--status-info); border-color: color-mix(in srgb, var(--status-info) 45%, transparent); }
.chip-neutral { color: var(--text-muted); }

.field-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.field {
    min-width: 0;
}

.field-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.field-row > .field {
    flex: 1 1 150px;
}

.field-row > .field-camera {
    flex: 0 1 220px;
}

.inp {
    background: var(--input-bg);
    color: var(--text-body);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-input);
    padding: 7px 10px;
    font-size: 13px;
    font-family: var(--font-sans);
}

.inp-time {
    min-width: 112px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-body);
    cursor: pointer;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

.table-scroll {
    overflow-x: auto;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: .9rem;
}

.section-title {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin: 0;
    font-size: 12.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-strong);
}

.section-title::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 13px;
    background: var(--color-primary);
    transform: translateY(1px);
    flex: none;
}

.section-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: none;
    color: var(--text-dim);
    font-weight: 400;
}

.section-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Dashboard: slimmer page picker, mono filter labels ---------- */
.app-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.25rem 1.5rem var(--timeline-clearance);
}

.rz-tabview .rz-tabview-nav li a,
.rz-tabview .rz-tabview-nav li button,
.rz-tabview .rz-tabview-nav .rz-tabview-nav-item a,
.rz-tabview .rz-tabview-nav .rz-tabview-nav-item button {
    padding: .45rem .85rem;
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 600;
}

.rz-tabview > .rz-tabview-panels > .rz-tabview-panel {
    padding-top: 1rem;
}

.dashboard-filters .filter-field > span {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 500;
}

.grid-panel > .section-heading {
    align-items: center;
    margin-bottom: .9rem;
}

/* ---------- Page layout: rail + content, full width ---------- */
.incident-page {
    display: grid;
    grid-template-columns: 228px minmax(0, 1fr);
    gap: 0 1.25rem;
    align-items: start;
    transition: grid-template-columns .2s ease;
}

.incident-page.rail-collapsed {
    grid-template-columns: 56px minmax(0, 1fr);
}

.incident-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.incident-content > .content-card,
.incident-content .page-section > .content-card {
    margin-top: 0;
}

.page-section {
    scroll-margin-top: calc(var(--header-h) + .75rem);
}

.rail-scrim {
    display: none;
}

.rail-open-button {
    display: none;
}

/* ---------- Navigation rail ---------- */
.incident-rail {
    position: sticky;
    top: calc(var(--header-h) + 1.25rem);
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 10px 8px;
    box-shadow: var(--shadow-card);
    max-height: calc(100vh - var(--header-h) - var(--timeline-clearance) - 2rem);
    overflow: hidden;
}

.rail-context {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 6px;
    min-width: 0;
    overflow: hidden;
}

.rail-vessel {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}

.rail-vessel-name {
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity .16s ease .1s;
}

.rail-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    overflow: hidden;
    max-height: 72px;
    transition: opacity .16s ease .1s, max-height .2s ease;
}

.rail-meta b {
    color: var(--text-muted);
    font-weight: 500;
}

/* The full case id fits on two lines instead of being cut off. */
.rail-case {
    font-size: 10.5px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}

.rail-time {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}

.rail-time:hover {
    color: var(--color-primary);
}

.rail-chip {
    align-self: flex-start;
    margin-top: 6px;
    max-height: 30px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity .16s ease .1s, max-height .2s ease;
}

.rail-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-width: 0;
    background: none;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 8px 10px;
    color: var(--text-muted);
    cursor: pointer;
    text-align: left;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.rail-ic {
    width: 16px;
    display: inline-flex;
    justify-content: center;
    color: var(--text-dim);
    font-size: 13px;
    flex-shrink: 0;
}

.rail-label,
.rail-count {
    overflow: hidden;
    transition: opacity .16s ease .1s;
}

.rail-count {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-dim);
}

.rail-item:hover {
    background: var(--surface-hover);
    color: var(--text-strong);
}

.rail-item.on {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-color: color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.rail-item.on .rail-ic {
    color: var(--color-primary);
}

.rail-foot {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
}

.rail-close {
    display: none;
}

/* Collapsed: labels fade to zero width instead of toggling display, so nothing wraps or flashes
   while the grid column animates. */
.rail-collapsed .rail-context {
    padding: 4px 0 10px;
    align-items: center;
}

.rail-collapsed .rail-vessel {
    justify-content: center;
    gap: 0;
}

.rail-collapsed .rail-vessel-name,
.rail-collapsed .rail-label,
.rail-collapsed .rail-count {
    opacity: 0;
    width: 0;
    margin: 0;
    transition: opacity .06s ease;
}

.rail-collapsed .rail-meta,
.rail-collapsed .rail-chip {
    opacity: 0;
    max-height: 0;
    margin: 0;
    transition: opacity .06s ease, max-height .12s ease;
}

.rail-collapsed .rail-item {
    justify-content: center;
    padding: 9px 0;
    gap: 0;
}

.rail-collapsed .rail-ic {
    width: auto;
    font-size: 14px;
}

.rail-collapsed .rail-foot {
    justify-content: center;
}

/* ---------- Details header ---------- */
.details-card {
    padding: 0;
    position: relative;
}

/* Top-edge activity bar while any evidence section is still loading (picked over a chip). */
.details-loadbar {
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    overflow: hidden;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    background: var(--border-subtle);
}

.details-loadbar span {
    display: block;
    height: 100%;
    width: 38%;
    background: linear-gradient(90deg, var(--cyan-deep), var(--cyan));
    animation: bb-loadslide 1.5s ease-in-out infinite;
}

.details-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 18px 12px;
}

.back-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    cursor: pointer;
}

.back-link:hover {
    color: var(--color-primary);
}

.details-title {
    display: flex;
    align-items: center;
    gap: 8px 14px;
    flex-wrap: wrap;
}

.details-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 4px 0 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.2;
    color: var(--text-strong);
}

.details-heading .vp-dot {
    width: 10px;
    height: 10px;
}

.details-heading small {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 400;
    color: var(--text-dim);
    letter-spacing: .04em;
}

.details-chips {
    display: flex;
    gap: 6px 8px;
    align-items: center;
    flex-wrap: wrap;
}

.details-title-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.details-facts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 4px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.details-facts > span + span::before {
    content: "·";
    margin: 0 9px;
    color: var(--text-dim);
}

.details-facts b {
    color: var(--text-body);
    font-weight: 500;
}

.fact-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.fact-button:hover b {
    color: var(--color-primary);
}

/* Manager-only hover affordance around an editable chip or fact. */
.edit-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px dashed transparent;
    border-radius: 7px;
    padding: 1px 5px;
    margin: -1px -5px;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.edit-hint:hover,
.edit-hint:focus-visible {
    border-color: var(--border-default);
    outline: 0;
}

.edit-hint .pen {
    font-size: 10px;
    color: var(--text-dim);
    opacity: 0;
    transition: opacity .12s;
}

.edit-hint:hover .pen,
.edit-hint:focus-visible .pen {
    opacity: 1;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 12px;
    margin: 0 18px;
    padding: 12px 0;
    border-top: 1px solid var(--border-subtle);
}

.details-cell {
    min-width: 0;
}

.details-cell-wide {
    grid-column: 1 / -1;
}

.details-cell dt {
    margin: 0 0 2px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.details-cell dd {
    margin: 0;
    font-size: 13px;
    color: var(--text-strong);
    font-weight: 500;
}

.details-cell dd small {
    display: block;
    font-weight: 400;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 1px;
}

.details-desc {
    display: block;
    margin: 0 18px;
    padding: 12px 0 14px;
    border-top: 1px solid var(--border-subtle);
}

.details-desc dt {
    margin: 0 0 4px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
}

.details-desc dd {
    margin: 0;
    font-size: 13px;
    color: var(--text-body);
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.details-desc dd.is-empty {
    color: var(--text-dim);
    font-style: italic;
}

/* ---------- Footage section ---------- */
.footage-section .camera-layout-shell {
    margin-top: .9rem;
}

.footage-strip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-default);
    background: var(--surface-raised);
}

/* Every active request gets a row; past about three the stack scrolls instead of pushing the footage down. */
.footage-strips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 190px;
    overflow-y: auto;
}

.footage-strip-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    background: var(--surface-hover);
    color: var(--text-muted);
}

.footage-strip.is-running .footage-strip-icon { background: var(--color-primary-soft); color: var(--color-primary); }
.footage-strip.is-done { border-color: color-mix(in srgb, var(--status-good) 40%, transparent); }
.footage-strip.is-done .footage-strip-icon { background: var(--status-good-bg); color: var(--status-good); }
.footage-strip.is-failed { border-color: color-mix(in srgb, var(--status-bad) 40%, transparent); }
.footage-strip.is-failed .footage-strip-icon { background: var(--status-bad-bg); color: var(--status-bad); }

.footage-strip-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.footage-strip-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}

.footage-strip-line b {
    color: var(--text-strong);
    font-weight: 600;
}

.footage-strip-line > span + span::before {
    content: "·";
    margin: 0 9px;
    color: var(--text-dim);
}

.footage-strip-line .mono {
    font-size: 12px;
}

.footage-strip-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Admin request log: dashed disclosure, compact paged grid inside. */
.footage-log {
    margin-top: .9rem;
    border: 1px dashed var(--border-default);
    border-radius: 10px;
}

.footage-log summary {
    cursor: pointer;
    padding: 9px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
}

.footage-log summary::-webkit-details-marker {
    display: none;
}

.footage-log-tag {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--status-warn);
    border: 1px solid color-mix(in srgb, var(--status-warn) 45%, transparent);
    border-radius: var(--radius-pill);
    padding: 1px 6px;
}

.edit-camera-source .footage-log-tag,
.edit-camera-table .footage-log-tag {
    margin-left: 6px;
}

.footage-log .footage-log-grid {
    margin: 0 8px 8px;
    font-size: 12px;
}

.footage-log-grid .rz-data-grid,
.footage-log-grid .rz-datatable {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.footage-log-grid th .rz-column-title,
.footage-log-grid th .rz-column-title-content {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 500;
}

.footage-log-grid td {
    font-variant-numeric: tabular-nums;
    vertical-align: top;
}

.footage-log-sub {
    display: block;
    font-size: 10.5px;
    color: var(--text-dim);
    margin-top: 2px;
    font-family: var(--font-mono);
}

.footage-log-detail {
    display: block;
    max-width: 24rem;
    overflow-wrap: anywhere;
    color: var(--text-muted);
    font-size: 11.5px;
}

.footage-log-warn {
    color: var(--status-warn) !important;
}

.footage-log-dim {
    color: var(--text-dim);
}

/* ---------- Camera tiles: dark, header overlaid on the footage ---------- */
.camera-panel {
    position: relative;
    background: var(--navy-1);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: none;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

.camera-panel.navigation-map-panel {
    background: var(--map-bg, #0B1E2A);
}

html[data-theme="light"] .camera-panel.navigation-map-panel {
    --map-bg: #DCE8EC;
}

.camera-panel video,
.full-camera video {
    width: 100%;
    height: 220px;
    object-fit: contain;
    object-position: center;
    display: none;
    background: #000;
}

.camera-panel video.is-active,
.full-camera video.is-active {
    display: block;
}

.camera-video-stack {
    position: relative;
    min-height: 220px;
    background: #000;
    flex: 1 1 auto;
}

.camera-panel-featured {
    min-height: 360px;
}

.camera-panel-featured video,
.camera-panel-featured .camera-video-stack {
    height: 100%;
    min-height: 360px;
}

.camera-panel-compact,
.camera-panel-compact .camera-video-stack,
.camera-panel-compact .camera-empty {
    min-height: 132px;
}

.camera-panel-compact video {
    height: 132px;
}

.camera-header {
    position: absolute;
    inset: 0 0 auto 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    background: linear-gradient(180deg, rgba(4,16,26,.72), transparent);
    z-index: 2;
    border: 0;
}

.navigation-map-panel .camera-header {
    background: linear-gradient(180deg, color-mix(in srgb, var(--map-bg, #0B1E2A) 85%, transparent), transparent);
}

.camera-loading {
    display: inline-flex;
    align-items: center;
    margin-left: .5rem;
}

.camera-name {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #E8F3F4;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-theme="light"] .navigation-map-panel .camera-name {
    color: var(--ink-900);
}

.camera-actions {
    margin-left: auto;
    display: flex;
    gap: 5px;
}

.camera-actions .iconbtn {
    background: rgba(7,21,31,.55);
    border-color: rgba(255,255,255,.14);
    color: #E8F3F4;
}

.camera-actions .iconbtn:hover:not(:disabled),
.camera-actions .iconbtn:focus-visible:not(:disabled) {
    border-color: var(--cyan);
    color: var(--cyan-bright);
    background: rgba(7,21,31,.8);
}

.camera-actions .iconbtn.is-active {
    color: var(--cyan);
    border-color: var(--cyan);
    background: rgba(46,211,211,.18);
}

.camera-actions .iconbtn:disabled {
    opacity: .35;
}

.camera-empty {
    flex: 1 1 auto;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2.4rem 1rem 1rem;
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.camera-empty .ic {
    font-size: 18px;
    opacity: .5;
}

.camera-empty.navigation-map-empty {
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-muted);
}

.navigation-map-stack {
    flex: 1 1 auto;
}

/* Gap overlay: same tile vocabulary — icon, mono time, slim jump chips. */
.camera-gap-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: 2.2rem 1rem 1rem;
    text-align: center;
    background: color-mix(in srgb, #071722 82%, transparent);
    color: var(--text-muted);
    overflow: auto;
}

.camera-gap-overlay .ic {
    font-size: 16px;
    opacity: .5;
    color: #E8F3F4;
}

.camera-gap-overlay strong {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #E8F3F4;
    font-weight: 500;
}

.camera-gap-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.camera-gap-overlay .camera-jump-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(7,21,31,.6);
    color: #E8F3F4;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: var(--radius-button);
    padding: 4px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.camera-gap-overlay .camera-jump-link:hover,
.camera-gap-overlay .camera-jump-link:focus-visible {
    border-color: var(--cyan);
    color: var(--cyan-bright);
}

.camera-gap-overlay small {
    color: #88A4AB;
    font-size: 11px;
}

.camera-panel-compact .camera-gap-overlay {
    padding: 1.8rem .5rem .5rem;
    gap: .25rem;
}

.camera-panel-compact .camera-gap-overlay strong {
    font-size: 10px;
}

/* ---------- Upload dialogs (footage, VHF, documents): dropzone · fields · table · footer ---------- */
.upload-dialog {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 1px dashed var(--border-default);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12.5px;
    background: var(--surface-sunken);
    transition: border-color .16s ease, background .16s ease;
}

.dropzone:hover {
    border-color: var(--color-primary);
}

.dropzone b {
    color: var(--color-primary);
    font-weight: 500;
}

.dropzone .ic {
    display: block;
    margin: 0 auto 4px;
    font-size: 18px;
    color: var(--text-dim);
}

.dropzone-hint {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-dim);
    margin-top: 4px;
    max-width: 60ch;
}

.dropzone.is-disabled {
    opacity: .5;
    pointer-events: none;
}

/* The active file input covers the whole zone (invisible), so click and drop land on it;
   used inputs stay in the DOM (display:none) for the retained-file lookup. */
.dropzone-input {
    position: absolute;
    inset: 0;
}

.dropzone-input input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    padding: 0;
    border: 0;
}

.retained-file-input {
    display: none;
}

.seg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.seg-table th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 500;
    white-space: nowrap;
}

.seg-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
    color: var(--text-body);
}

.seg-table tr:last-child td {
    border-bottom: 0;
}

.seg-table td.mono {
    font-size: 12px;
}

.seg-table .sub {
    display: block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-dim);
}

.seg-file {
    max-width: 22rem;
}

.seg-file-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seg-progress {
    margin-top: 6px;
}

.seg-camera {
    min-width: 150px;
}

.seg-time {
    min-width: 128px;
    width: 128px;
}

.seg-time .rz-datepicker,
.seg-camera .rz-dropdown {
    width: 100%;
}

.upload-status {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    border-radius: var(--radius-pill);
    padding: 2px 7px;
    white-space: nowrap;
}

.upload-error {
    margin: 4px 0 0;
    font-size: 11.5px;
    color: var(--status-bad);
    font-family: var(--font-sans);
}

.upload-overall-progress {
    display: grid;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* Sunken full-bleed footer inside a Radzen dialog (its content pads 1.65rem / 1.15rem top). */
.dialog-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin: .25rem -1.65rem -1.65rem;
    padding: 12px 1.65rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--surface-sunken);
    border-radius: 0 0 var(--radius-panel) var(--radius-panel);
}

.dialog-foot .grow {
    flex: 1;
}

/* ---------- Range brush (footage request) and picker lane (align) ---------- */
.range-brush {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 24px;
}

.brush-lane {
    position: relative;
    height: 56px;
    border-radius: 8px;
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
}

.brush-lane-picker {
    height: 168px;
}

.brush-selection {
    position: absolute;
    top: 0;
    bottom: 0;
    background: var(--color-primary-soft);
    border-left: 2px solid var(--color-primary);
    border-right: 2px solid var(--color-primary);
    pointer-events: none;
}

.brush-baseline {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 6px;
    height: 2px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.brush-marker {
    position: absolute;
    bottom: 4px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 22px;
    color: var(--text-muted);
    font-size: .7rem;
    pointer-events: none;
}

.brush-marker.is-trigger {
    height: 40px;
    color: var(--status-bad);
}

/* Same disc as the replay bar's trigger marker: the 1px card-coloured ring is what separates the
   crosshairs from its halo, and line-height:1 stops Font Awesome's own line box from pushing the
   glyph off centre inside the grid cell. Keep in step with .timeline-event-marker.is-trigger. */
/* The disc is this wrapper, never the <i>, and that is the whole point: Font Awesome's all.css is
   NOT in a cascade layer, so its `.fas { display: inline-block }` beats anything app.css declares
   inside @layer components no matter how specific. Centring the glyph by making the <i> a grid
   silently did nothing and the crosshairs sat in the top-left corner of the disc. The replay bar's
   .timeline-event-icon has always been a plain span for the same reason; these two are now built
   the same way and should stay that way. */
.brush-icon {
    display: grid;
    place-items: center;
}

.brush-marker.is-trigger .brush-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--status-bad);
    border: 1px solid var(--surface-card);
    color: var(--color-on-primary);
    font-size: .52rem;
    line-height: 1;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-bad) 30%, transparent);
}

.brush-marker[data-event-type="transfer"] { color: var(--color-primary-active); }
.brush-marker[data-event-type="estop"] { color: var(--status-bad); }
.brush-marker[data-event-type="alarm"] { color: var(--status-warn); }
.brush-marker[data-event-type="traffic"] { color: var(--blackbox-chart-series-4); }
.brush-marker[data-event-type="passage"] { color: var(--status-good); }
.brush-marker[data-event-type="marker"] { color: var(--color-primary); }

.brush-stem {
    width: 2px;
    flex: 1;
    min-height: 5px;
    background: currentColor;
    opacity: .45;
}

.brush-lane input[type="range"] {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 7;
}

.brush-lane input[type="range"]::-webkit-slider-runnable-track { background: transparent; }
.brush-lane input[type="range"]::-moz-range-track { background: transparent; }

.brush-lane input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 14px;
    height: 36px;
    border-radius: 5px;
    background: var(--surface-card);
    border: 2px solid var(--color-primary);
    cursor: ew-resize;
    box-shadow: var(--shadow-card);
}

.brush-lane input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 14px;
    height: 36px;
    border-radius: 5px;
    background: var(--surface-card);
    border: 2px solid var(--color-primary);
    cursor: ew-resize;
}

/* Single-thumb picker: the thumb is a thin cursor line so it never drifts from the markers. */
.brush-lane-picker input[type="range"]::-webkit-slider-thumb {
    width: 4px;
    height: 166px;
    border-radius: 2px;
    background: var(--color-primary);
    border: 0;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.brush-lane-picker input[type="range"]::-moz-range-thumb {
    width: 4px;
    height: 166px;
    border-radius: 2px;
    background: var(--color-primary);
    border: 0;
}

/* Labels sit above the range input so the time is always readable. */
.brush-handle-label {
    position: absolute;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    z-index: 9;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--surface-card);
    border: 1px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
    border-radius: 5px;
    padding: 1px 6px;
    white-space: nowrap;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}

/* The handle nearer the pointer is on top and the one being dragged keeps its time on top and
   highlighted (blackboxForms.brushLane sets data-top / data-active on the lane). */
.brush-lane[data-top="start"] input.brush-start,
.brush-lane[data-top="end"] input.brush-end {
    z-index: 8;
}

.brush-lane[data-active="start"] .brush-handle-label.brush-start,
.brush-lane[data-active="end"] .brush-handle-label.brush-end {
    z-index: 11;
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
}

.brush-handle-label.is-top {
    bottom: auto;
    top: 6px;
}

.brush-scale {
    position: relative;
    height: 14px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-dim);
}

.brush-scale span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    white-space: nowrap;
}

.brush-scale span.is-first {
    transform: none;
}

.brush-scale span.is-last {
    transform: translateX(-100%);
}

/* ---------- Request footage dialog ---------- */
.footage-request-dialog {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footage-request-reset {
    display: flex;
    justify-content: center;
}

.request-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 18px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    font-size: 13px;
}

.request-summary dt {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    align-self: baseline;
}

.request-summary dd {
    margin: 0;
    color: var(--text-strong);
    font-weight: 500;
}

.request-summary dd small {
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 6px;
}

/* ---------- Align dialog ---------- */
.align-dialog {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.align-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}

.align-step {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.align-kicker {
    display: flex;
    gap: 8px;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.align-kicker b {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-on-primary);
    display: grid;
    place-items: center;
    font-size: 9.5px;
    letter-spacing: 0;
}

.align-media {
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border-default);
    min-height: 168px;
}

.align-media video {
    display: block;
    width: 100%;
    height: 168px;
    object-fit: contain;
    background: #000;
}

.align-media-audio {
    background: var(--surface-sunken);
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.align-media audio {
    width: 100%;
}

.align-readout {
    font-size: 11.5px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.align-result {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
}

.align-result .field-label {
    margin: 0;
}

/* ---------- Edit camera dialog ---------- */
.edit-camera-dialog {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.edit-camera-source {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.edit-camera-source .field-label {
    margin: 0;
}

.edit-camera-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.edit-camera-table th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 500;
    white-space: nowrap;
}

.edit-camera-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
    color: var(--text-body);
    white-space: nowrap;
}

.edit-camera-table tr:last-child td {
    border-bottom: 0;
}

.edit-camera-table td small {
    display: block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-dim);
}

.edit-camera-file {
    font-size: 11.5px;
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dialog-actions-split {
    display: flex;
    align-items: center;
    gap: .6rem;
}

/* ---------- Replay bar: one row, lane = scrubber ---------- */
.timeline-controls {
    z-index: 900;
    border: 1px solid color-mix(in srgb, var(--color-primary) 38%, transparent);
    background: var(--surface-raised);
    color: var(--text-body);
    box-shadow: var(--shadow-overlay), 0 0 0 1px color-mix(in srgb, var(--color-primary) 12%, transparent);
    position: fixed;
    left: 50%;
    bottom: .8rem;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: auto minmax(200px, 1fr) auto;
    align-items: center;
    gap: .6rem;
    width: min(1040px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    padding: .45rem .6rem;
    border-radius: 14px;
    backdrop-filter: blur(18px);
}

.timeline-controls button,
.timeline-controls select {
    border: 1px solid var(--border-default);
    background: var(--surface-card);
    color: var(--text-strong);
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
    border-radius: var(--radius-pill);
    padding: .34rem .6rem;
    cursor: pointer;
    font-size: 12px;
}

.timeline-controls button:hover:not(:disabled) {
    border-color: var(--color-primary);
}

.timeline-controls .timeline-icon-button {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.timeline-controls .timeline-play-button {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
    width: 36px;
    height: 36px;
    font-size: 13px;
}

.timeline-controls .timeline-play-button:hover:not(:disabled) {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.timeline-control-group {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.timeline-control-group-scrub {
    min-width: 0;
    gap: .55rem;
}

.timeline-speed-trigger {
    font-family: var(--font-mono);
    font-size: 11px;
}

.timeline-controls.is-collapsed {
    width: auto;
    grid-template-columns: auto auto;
    border-radius: var(--radius-pill);
    padding: .35rem .45rem;
}

.timeline-controls.is-collapsed .timeline-control-group-scrub,
.timeline-controls.is-collapsed .timeline-speed-menu,
.timeline-controls.is-collapsed .timeline-more-menu,
.timeline-controls.is-collapsed .timeline-events-menu {
    display: none;
}

.timeline-lane {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    cursor: pointer;
}

.timeline-lane.is-tall {
    height: 62px;
}

.timeline-lane-track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-primary) 28%, transparent);
}

/* VHF talk strip: the track turns VHF-blue wherever someone is on air (merged clips). */
.timeline-talk {
    position: absolute;
    bottom: 14px;
    height: 6px;
    margin-bottom: -1px; /* centred on the 4px track, whatever its bottom per breakpoint */
    min-width: 3px;
    border-radius: var(--radius-pill);
    background: var(--status-info);
    box-shadow: 0 0 0 1px var(--surface-raised); /* stays readable over the played (cyan) part */
    pointer-events: none;
}

.timeline-talk-tooltip {
    display: block;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--status-info);
}

/* Phone now-speaking strip: floats above the replay bar like the events sheet, and yields to it. */
.timeline-now-speaking {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + .5rem);
    z-index: 19;
}

.timeline-controls-bottom.is-collapsed .timeline-now-speaking {
    display: none;
}

.now-speaking {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: .2rem;
    width: 100%;
    padding: .5rem .7rem .6rem;
    border: 1px solid var(--border-default);
    border-radius: 12px;
    background: var(--surface-raised);
    box-shadow: var(--shadow-overlay);
    color: var(--text-body);
    font: inherit;
    font-size: 12.5px;
    text-align: left;
}

.now-speaking-row {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
}

.now-speaking-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--status-bad);
    flex: none;
}

.now-speaking-channel {
    color: var(--color-primary);
    font-weight: 800;
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-speaking-when {
    margin-left: auto;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    white-space: nowrap;
}

.now-speaking-text {
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}

.now-speaking.is-idle {
    cursor: pointer;
}

.now-speaking.is-idle .now-speaking-text {
    color: var(--text-muted);
}

/* After the last clip: one centred line with a muted microphone. */
.now-speaking.is-done {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color: var(--text-muted);
}

.now-speaking-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: calc(var(--vhf-progress, 0) * 100%);
    background: var(--color-primary);
}

.timeline-lane-fill {
    position: absolute;
    left: 0;
    bottom: 14px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    opacity: .85;
    pointer-events: none;
}

.timeline-lane-tick {
    position: absolute;
    bottom: 12px;
    width: 1px;
    height: 8px;
    background: color-mix(in srgb, var(--color-primary) 45%, transparent);
    pointer-events: none;
}

.timeline-lane-tick.is-edge {
    display: none;
}

.timeline-lane-time {
    position: absolute;
    bottom: 0;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    white-space: nowrap;
}

.timeline-lane-time.is-first {
    transform: none;
}

.timeline-lane-time.is-last {
    transform: translateX(-100%);
}

/* The scrubber overlays the lane; only its thumb takes the pointer, so lane clicks still seek and
   markers stay clickable. The thumb is drawn as the cursor line; the input's own track is invisible. */
.timeline-controls .timeline-lane input.timeline-lane-scrub {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-block-size: 0;
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 0;
    pointer-events: none;
    z-index: 7;
    accent-color: var(--color-primary);
}

.timeline-controls .timeline-lane input.timeline-lane-scrub::-webkit-slider-runnable-track {
    background: transparent;
    height: 100%;
    border: 0;
}

.timeline-controls .timeline-lane input.timeline-lane-scrub::-moz-range-track {
    background: transparent;
    border: 0;
}

.timeline-controls .timeline-lane input.timeline-lane-scrub::-moz-range-progress {
    background: transparent;
}

.timeline-controls .timeline-lane input.timeline-lane-scrub::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 3px;
    height: 48px;
    margin: 0;
    border: 0;
    border-radius: 2px;
    background: var(--color-primary);
    cursor: ew-resize;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 22%, transparent);
}

.timeline-controls .timeline-lane input.timeline-lane-scrub::-moz-range-thumb {
    pointer-events: auto;
    width: 3px;
    height: 48px;
    border-radius: 2px;
    background: var(--color-primary);
    border: 0;
    cursor: ew-resize;
}

.timeline-controls .timeline-lane.is-tall input.timeline-lane-scrub::-webkit-slider-thumb { height: 62px; }
.timeline-controls .timeline-lane.is-tall input.timeline-lane-scrub::-moz-range-thumb { height: 62px; }

.timeline-scrub-readout {
    color: var(--color-primary-active);
    min-width: 4.6rem;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Markers: bare icons over the track, tiers for stacked bursts; trigger and clusters keep a disc. */
.timeline-controls button.timeline-event-marker {
    position: absolute;
    bottom: 20px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    z-index: 4;
    color: var(--text-muted);
}

.timeline-controls button.timeline-event-marker:hover,
.timeline-controls button.timeline-event-marker:focus-visible {
    border: 0;
    background: transparent;
    box-shadow: none;
    z-index: 5;
}

.timeline-controls button.timeline-event-marker.tier-1 { height: 30px; z-index: 3; }
.timeline-controls button.timeline-event-marker.tier-2 { height: 42px; z-index: 2; }

.timeline-controls :is(button.timeline-event-marker, .timeline-event-diamond, button.timeline-events-sheet-row)[data-event-type="transfer"] { color: var(--color-primary-active); }
.timeline-controls :is(button.timeline-event-marker, .timeline-event-diamond, button.timeline-events-sheet-row)[data-event-type="estop"] { color: var(--status-bad); }
.timeline-controls :is(button.timeline-event-marker, .timeline-event-diamond, button.timeline-events-sheet-row)[data-event-type="alarm"] { color: var(--status-warn); }
.timeline-controls :is(button.timeline-event-marker, .timeline-event-diamond, button.timeline-events-sheet-row)[data-event-type="trigger"] { color: var(--status-bad); }
.timeline-controls :is(button.timeline-event-marker, .timeline-event-diamond, button.timeline-events-sheet-row)[data-event-type="traffic"] { color: var(--blackbox-chart-series-4); }
.timeline-controls :is(button.timeline-event-marker, .timeline-event-diamond, button.timeline-events-sheet-row)[data-event-type="passage"] { color: var(--status-good); }
.timeline-controls :is(button.timeline-event-marker, .timeline-event-diamond, button.timeline-events-sheet-row)[data-event-type="marker"] { color: var(--color-primary); }

/* flex: none, because the marker is an 18px flex column of icon over stem: without it the 16px
   trigger and cluster discs were shrunk to 14px and drew as slight ellipses. Those two markers get
   2px more height below so nothing has to shrink. */
.timeline-event-icon {
    display: grid;
    place-items: center;
    flex: none;
    height: 14px;
    font-size: .66rem;
    min-width: 12px;
    transition: transform .12s ease;
}

.timeline-event-marker:hover .timeline-event-icon,
.timeline-event-marker:focus-visible .timeline-event-icon {
    transform: scale(1.15);
}

.timeline-event-stem {
    width: 2px;
    flex: 1;
    min-height: 4px;
    background: currentColor;
    opacity: .45;
}

.timeline-controls button.timeline-event-marker.is-trigger,
.timeline-controls button.timeline-event-marker.is-cluster {
    height: 20px;
}

.timeline-event-marker.is-trigger .timeline-event-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--status-bad);
    border: 1px solid var(--surface-card);
    color: var(--color-on-primary);
    font-size: .52rem;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-bad) 30%, transparent);
}

.timeline-event-marker.is-cluster .timeline-event-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--surface-hover);
    border: 1px solid var(--border-default);
    color: var(--text-strong);
    font-size: .56rem;
    font-weight: 700;
    box-shadow: none;
}

.timeline-controls button.timeline-event-group-band {
    position: absolute;
    top: 0;
    bottom: 12px;
    min-width: 30px;
    transform: translateX(0);
    padding: 0;
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-chip);
    background: color-mix(in srgb, var(--text-strong) 4%, transparent);
    box-shadow: none;
    z-index: 1;
}

.timeline-controls button.timeline-event-group-band:hover,
.timeline-controls button.timeline-event-group-band:focus-visible {
    border: 1px dashed var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    box-shadow: none;
}

.timeline-event-group-band-icon {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--surface-hover);
    border: 1px solid var(--border-default);
    color: var(--text-strong);
    display: grid;
    place-items: center;
    font-size: .5rem;
}

.timeline-event-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    gap: .1rem;
    background: var(--surface-raised);
    border: 1px solid var(--border-default);
    color: var(--text-body);
    font-size: .72rem;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
    padding: .35rem .55rem;
    border-radius: var(--radius-chip);
    white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--shadow-card);
    z-index: 10;
}

.timeline-event-tooltip strong {
    color: var(--text-strong);
}

.timeline-event-marker:hover .timeline-event-tooltip,
.timeline-event-marker:focus-visible .timeline-event-tooltip {
    display: flex;
}

.timeline-event-tooltip.is-edge-start { left: 0; transform: none; }
.timeline-event-tooltip.is-edge-end { left: auto; right: 0; transform: none; }

.timeline-event-tooltip-hint {
    color: var(--text-dim);
    font-size: .68rem;
}

.timeline-scrub-tooltip {
    position: absolute;
    bottom: calc(100% - 4px);
    transform: translateX(-50%);
    background: var(--surface-raised);
    border: 1px solid var(--border-default);
    color: var(--text-body);
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 2px 6px;
    border-radius: 5px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 9;
}

.timeline-scrub-tooltip.is-edge-start { transform: none; }
.timeline-scrub-tooltip.is-edge-end { transform: translateX(-100%); }

/* Events popover behind the layers button */
.timeline-events-menu {
    position: relative;
}

.timeline-controls .timeline-events-toggle {
    position: relative;
}

.timeline-controls .timeline-events-toggle.is-open {
    border-color: color-mix(in srgb, var(--color-primary) 52%, transparent);
    background: var(--surface-hover);
    color: var(--color-primary-active);
}

.timeline-events-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-radius: var(--radius-pill);
    font-size: .6rem;
    font-weight: 700;
    padding: .05rem .34rem;
    line-height: 1.25;
}

.timeline-events-popover {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    animation: bb-popover-in var(--dur-fast) var(--ease);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    background: var(--surface-raised);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    box-shadow: var(--shadow-overlay);
    min-width: 190px;
    z-index: 20;
}

.timeline-events-label {
    padding: 4px 8px 6px;
    font-family: var(--font-mono);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.timeline-controls .timeline-events-popover button.timeline-event-chip {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    border: 1px solid transparent;
    border-radius: var(--radius-chip);
    background: transparent;
    padding: .3rem .5rem;
    font-size: .74rem;
    font-weight: 600;
    text-align: left;
    box-shadow: none;
}

.timeline-controls .timeline-events-popover button.timeline-event-chip:hover {
    border-color: var(--border-default);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.timeline-controls button.timeline-event-chip.is-off {
    opacity: .4;
}

.timeline-event-chip-count {
    margin-left: auto;
    color: var(--text-muted);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: .7rem;
}

.timeline-event-chip[data-event-type="transfer"] i { color: var(--color-primary-active); }
.timeline-event-chip[data-event-type="estop"] i { color: var(--status-bad); }
.timeline-event-chip[data-event-type="alarm"] i { color: var(--status-warn); }
.timeline-event-chip[data-event-type="traffic"] i { color: var(--blackbox-chart-series-4); }
.timeline-event-chip[data-event-type="passage"] i { color: var(--status-good); }
.timeline-event-chip[data-event-type="marker"] i { color: var(--color-primary); }

.timeline-events-separator {
    display: block;
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 2px;
}

/* ---------- Telemetry: Signac ops row, chart shells, collapsibles ---------- */
.tele-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tele-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ops {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

/* The review tile shows the lanes alone. */
.ops:not(:has(> .donuts)) {
    grid-template-columns: minmax(0, 1fr);
}

.donuts {
    display: flex;
    gap: 16px;
}

.donut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 96px;
    text-align: center;
}

.ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    position: relative;
    display: grid;
    place-items: center;
    background: var(--border-subtle);
}

.ring::after {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    background: var(--surface-card);
}

.ring b {
    position: relative;
    z-index: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-strong);
}

.donut .lbl {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-dim);
    line-height: 1.3;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.donut-legend span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.donut-legend i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: none;
}

.donut-legend b {
    margin-left: auto;
    color: var(--text-body);
    font-weight: 500;
}

.lanes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.lane {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.lane-name {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lane-bar {
    position: relative;
    height: 22px;
    background: var(--border-subtle);
    border-radius: 5px;
    overflow: visible;
    cursor: crosshair;
}

.lane-bar-empty {
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: default;
    color: var(--text-dim);
    font-size: 11px;
    overflow: hidden;
}

.lane-bar .seg-b {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    border: 0;
    background: color-mix(in srgb, var(--h, var(--bb-status-none)) var(--bb-status-mix), var(--surface-card));
    box-shadow: inset 2px 0 0 var(--h, var(--bb-status-none));
}

.lane-bar .seg-b:first-child {
    border-radius: 5px 0 0 5px;
}

.lane-bar .seg-b.is-none {
    background: repeating-linear-gradient(135deg, var(--blackbox-chart-surface) 0 5px, var(--border-subtle) 5px 7px);
    box-shadow: inset 2px 0 0 var(--border-default);
}

.lane-bar .seg-b.is-hover {
    z-index: 2;
    outline: 2px solid var(--h, var(--border-default));
    outline-offset: -2px;
}

.lane-bar .seg-b > span {
    font-size: 11px;
    color: var(--text-strong);
    padding: 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.lane-bar .seg-b.is-none > span {
    color: var(--text-muted);
}

.lane-cursor {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: var(--color-primary);
    opacity: .85;
    pointer-events: none;
    transform: translateX(-50%);
    z-index: 3;
}

.lane-axis {
    align-items: start;
}

.lane-axis .telemetry-axis {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-dim);
    margin: 0;
}

.lane-axis .telemetry-axis strong {
    color: var(--color-primary-active);
    font-weight: 600;
}

.chartgrid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.metric-card.telemetry-card,
.handover-card {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 11px 13px 8px;
    min-width: 0;
    overflow: hidden;
    box-shadow: none;
}

.telemetry-card-heading {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    gap: 2px 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.telemetry-card-heading > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.telemetry-card-heading > div > span:first-child,
.telemetry-card-heading > div > strong:first-child {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 500;
}

.telemetry-card-heading small {
    display: block;
    font-size: 11.5px;
    color: var(--text-muted);
}

.chart-unit {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
}

.telemetry-card p {
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

/* Collapsible telemetry groups (weather, connectivity) and the alarms / devices categories. */
.collapsible,
.telemetry-category {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--surface-raised);
    overflow: hidden;
}

.collapse-head,
.telemetry-category > summary {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    background: none;
    border: 0;
    color: var(--text-strong);
    padding: 11px 14px;
    cursor: pointer;
    text-align: left;
    font: inherit;
    list-style: none;
}

.collapse-head::-webkit-details-marker,
.telemetry-category > summary::-webkit-details-marker {
    display: none;
}

.telemetry-category > summary::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 13px;
    background: var(--color-primary);
    transform: translateY(1px);
    flex: none;
}

.telemetry-category > summary > span {
    font-size: 12.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-strong);
}

.telemetry-category > summary > small,
.collapse-meta {
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
}

/* Chevron first, title, then the count on the right (round 3 H2). */
.collapse-head .chev {
    color: var(--text-dim);
    transition: transform .15s ease;
    font-size: 11px;
    display: inline-flex;
}

.collapse-head > .section-title {
    margin: 0;
}

.collapse-head > .collapse-meta {
    flex: none;
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.collapse-head:hover .chev,
details[open] > .collapse-head .chev {
    color: var(--color-primary);
}

.collapse-head:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    border-radius: 12px;
}

details[open] > .collapse-head .chev {
    transform: rotate(90deg);
}

.collapse-body,
.telemetry-category-body {
    padding: 0 14px 14px;
}

.telemetry-category-body-stacked {
    display: grid;
    gap: 1rem;
}

.telemetry-category:not([open]) > summary::before {
    opacity: .45;
}

/* Handover reports: pre and post side by side in chart shells. */
.handover-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.handover-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.handover-card {
    display: grid;
    gap: .75rem;
    align-content: start;
    padding: 12px 14px 14px;
}

.handover-card .telemetry-card-heading {
    justify-content: space-between;
    margin-bottom: 0;
}

.handover-card .telemetry-card-heading > div > * {
    display: block;
}

.handover-card .telemetry-card-heading strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-strong);
    font-family: var(--font-sans);
    letter-spacing: 0;
    text-transform: none;
}

.handover-body {
    display: grid;
    gap: .6rem;
}

.handover-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 500;
    line-height: 1.6;
    white-space: nowrap;
}

.handover-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.handover-empty {
    margin: 0;
    color: var(--text-dim);
    font-size: 12.5px;
}

/* ---------- Documents: Signac file rows ---------- */
.docs-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.doc {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
}

.doc .ico {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 16px;
    background: var(--surface-sunken);
    color: var(--text-muted);
    overflow: hidden;
}

.doc .ico.img {
    background: var(--surface-sunken);
}

.doc .ico img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.doc-main {
    min-width: 0;
}

.doc .name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc .meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

/* ---------- VHF card head ---------- */
.vhf-card .section-heading,
.documents-card .section-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.vhf-transcript-manual-badge {
    white-space: nowrap;
}

}

@layer responsive {

@media (max-width: 1279px) {
    .details-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .chartgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    /* The rail becomes an off-canvas drawer behind a fixed hamburger in the header. */
    .incident-page,
    .incident-page.rail-collapsed {
        grid-template-columns: minmax(0, 1fr);
    }

    body:has(.incident-page) .app-header {
        padding-left: 3.4rem;
    }

    .rail-open-button {
        display: inline-flex;
        position: fixed;
        top: calc((var(--header-h) - 30px) / 2);
        left: .85rem;
        z-index: 31;
        background: rgba(255,255,255,.12);
        border-color: rgba(255,255,255,.28);
        color: #ffffff;
    }

    .rail-open-button:hover:not(:disabled) {
        background: rgba(255,255,255,.2);
        border-color: rgba(255,255,255,.45);
        color: #ffffff;
    }

    .incident-rail {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 950; /* above the fixed replay bar (900), below Radzen dialogs (1001) */
        width: min(280px, 86vw);
        max-height: none;
        border-radius: 0 var(--radius-panel) var(--radius-panel) 0;
        transform: translateX(-105%);
        /* Hidden once it has slid out, so the closed drawer leaves the tab order and the accessibility tree. */
        visibility: hidden;
        transition: transform var(--dur-slow) var(--ease), visibility 0s linear var(--dur-slow);
        padding-top: 16px;
        overflow-y: auto;
    }

    .rail-open .incident-rail {
        transform: none;
        visibility: visible;
        transition: transform var(--dur-slow) var(--ease);
    }

    .rail-collapsed .rail-vessel-name,
    .rail-collapsed .rail-label,
    .rail-collapsed .rail-count {
        opacity: 1;
        width: auto;
    }

    .rail-collapsed .rail-meta,
    .rail-collapsed .rail-chip {
        opacity: 1;
        max-height: 72px;
    }

    .rail-collapsed .rail-item {
        justify-content: flex-start;
        padding: 8px 10px;
        gap: 11px;
    }

    .rail-collapsed .rail-context {
        padding: 6px 8px 12px;
        align-items: stretch;
    }

    .rail-collapse {
        display: none;
    }

    .rail-close {
        display: inline-flex;
    }

    .rail-open .rail-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 940;
        background: var(--surface-scrim);
        backdrop-filter: blur(2px);
    }

    .ops {
        grid-template-columns: minmax(0, 1fr);
    }

    .donuts {
        flex-wrap: wrap;
    }

    .align-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .app-main {
        padding-left: .8rem;
        padding-right: .8rem;
    }

    .details-head {
        padding: 12px 14px 10px;
        align-items: center;
        text-align: center;
    }

    .back-link {
        align-self: center;
    }

    .details-title,
    .details-chips {
        justify-content: center;
    }

    /* Desktop pushes the actions (Share, candidate actions) to the right edge; centred here like the rest. */
    .details-title-actions {
        margin-left: 0;
    }

    .details-heading {
        font-size: 18px;
        justify-content: center;
    }

    /* One fact per line, centred: no more mid-line wraps between label and value. */
    .details-facts {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .details-facts > span + span::before {
        content: none;
        margin: 0;
    }

    .details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 0 14px;
    }

    .details-desc {
        margin: 0 14px;
    }

    .section-head {
        justify-content: center;
        text-align: center;
    }

    .section-head .section-actions {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .footage-strip {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px;
    }

    .footage-strip-actions {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .chartgrid,
    .handover-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .lane {
        grid-template-columns: 84px minmax(0, 1fr);
    }

    /* Notifications: the group's name above its lane, so the strips and their labels get the whole width
       (beside it, the name wrapped and the labels were cut to a few letters). The axis follows. */
    .cmd-lane.is-notes,
    .cmd-lanes:has(.is-notes) .lane-axis {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .cmd-lane.is-notes + .cmd-lane.is-notes {
        margin-top: 4px;
        padding-top: 10px;
        border-top: 1px solid var(--border-subtle);
    }

    .cmd-lanes:has(.is-notes) .lane-axis .lane-name {
        display: none;
    }

    .donuts {
        justify-content: center;
    }

    .docs-body {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Replay bar: transport · lane · tools on one slim row, no speed menus, no quarter marks. */
    .timeline-controls {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
        bottom: .5rem;
        padding: .4rem .5rem;
        gap: .45rem;
        grid-template-columns: auto minmax(0, 1fr) auto;
        border-radius: 12px;
    }

    .timeline-control-group {
        gap: .28rem;
    }

    .timeline-goto-incident,
    .timeline-speed-menu,
    .timeline-lane-time:not(.is-first):not(.is-last),
    .timeline-lane-tick {
        display: none;
    }

    .timeline-controls .timeline-icon-button {
        width: 28px;
        height: 28px;
    }

    .timeline-controls .timeline-play-button {
        width: 34px;
        height: 34px;
    }

    .timeline-lane,
    .timeline-lane.is-tall {
        height: 40px;
    }

    .timeline-controls .timeline-lane input.timeline-lane-scrub::-webkit-slider-thumb,
    .timeline-controls .timeline-lane.is-tall input.timeline-lane-scrub::-webkit-slider-thumb {
        height: 40px;
    }

    .timeline-controls .timeline-lane input.timeline-lane-scrub::-moz-range-thumb,
    .timeline-controls .timeline-lane.is-tall input.timeline-lane-scrub::-moz-range-thumb {
        height: 40px;
    }

    .timeline-lane-track,
    .timeline-lane-fill,
    .timeline-talk {
        bottom: 12px;
    }

    .timeline-controls button.timeline-event-marker {
        bottom: 18px;
    }

    .timeline-scrub-readout {
        min-width: 0;
        font-size: 11px;
    }

    .timeline-control-group-scrub {
        gap: .4rem;
    }

    /* Phone header sheet: the icon buttons become full-width rows with their labels. */
    .header-actions .iconbtn,
    .header-actions .userpill {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: .65rem;
        width: 100%;
        height: auto;
        min-height: 2.75rem;
        max-width: none;
        padding: .55rem .7rem;
        border: 0;
        border-radius: var(--radius-input);
        background: transparent;
        color: var(--text-strong);
        font-size: .95rem;
        text-align: left;
        white-space: normal;
    }

    .header-actions .iconbtn:hover:not(:disabled),
    .header-actions .iconbtn:focus-visible:not(:disabled) {
        background: var(--surface-hover);
        border-color: transparent;
        color: var(--text-strong);
    }

    .header-actions .userpill {
        font-weight: 600;
        cursor: default;
    }

    /* In the sheet the rows are transparent: a toggled row is tinted instead of filled. */
    .header-actions .iconbtn.on,
    .header-actions .iconbtn.is-open {
        background: var(--color-primary-soft);
        color: var(--color-primary-active);
    }

    /* The sheet row already names the language; the code beside the globe is for the bar. */
    .header-actions .header-language-code {
        display: none;
    }

    /* The language list opens in the sheet itself, under its row. */
    .header-actions .header-language-wrap {
        display: block;
        width: 100%;
    }

    .header-actions .header-language-panel {
        position: static;
        transform: none;
        min-width: 0;
        margin: .25rem 0 .35rem 2.4rem;
        box-shadow: none;
    }

    .request-summary {
        grid-template-columns: 1fr;
        gap: 2px 0;
    }

    .request-summary dd {
        margin-bottom: 8px;
    }

    .field-row > .field,
    .field-row > .field-camera {
        flex: 1 1 100%;
    }

    .dialog-foot {
        position: sticky;
        bottom: 0;
        margin: .25rem -1.65rem -1.65rem;
    }
}

}


@layer responsive {
@media (max-width: 767px) {
    /* Phone header: wordmark + the two menu buttons only. */
    .crumb {
        display: none;
    }

    /* Phone replay bar: 26px transport, no lane clock labels (they collide on a 100px lane). */
    .timeline-controls {
        gap: .35rem;
        padding: .35rem .45rem;
    }

    .timeline-control-group {
        gap: .2rem;
    }

    .timeline-controls .timeline-icon-button {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .timeline-controls .timeline-play-button {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .timeline-lane-time,
    .timeline-events-badge {
        display: none;
    }

    .timeline-lane,
    .timeline-lane.is-tall {
        height: 34px;
    }

    .timeline-lane-track,
    .timeline-lane-fill,
    .timeline-talk {
        bottom: 8px;
    }

    .timeline-controls button.timeline-event-marker {
        bottom: 14px;
    }

    .timeline-controls .timeline-lane input.timeline-lane-scrub::-webkit-slider-thumb,
    .timeline-controls .timeline-lane.is-tall input.timeline-lane-scrub::-webkit-slider-thumb {
        height: 34px;
    }

    .timeline-controls .timeline-lane input.timeline-lane-scrub::-moz-range-thumb,
    .timeline-controls .timeline-lane.is-tall input.timeline-lane-scrub::-moz-range-thumb {
        height: 34px;
    }

    .timeline-scrub-readout {
        font-size: 10.5px;
        font-weight: 600;
    }

    .timeline-control-group-scrub {
        gap: .3rem;
    }
}
}

@layer components {
/* Inline boot block (dashboard / candidates / event loading) centres inside its card. */
.boot.boot-inline {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    min-height: 12rem;
    padding: 2rem 1rem;
}

.app-main > .boot.boot-inline {
    min-height: calc(100vh - var(--header-h) - 6rem);
}
}

@layer components {
/* ---------- Round 3 fixes ---------- */
/* Camera tiles: the gap overlay only shows between segments; the pinned tile spans the first row. */
[data-has-active-video] .camera-gap-overlay {
    display: none;
}

.media-grid > .camera-panel-featured {
    grid-column: 1 / -1;
    order: -1;
}

.camera-panel-featured,
.camera-panel-featured .camera-video-stack {
    min-height: 360px;
}

.camera-panel-featured video {
    height: 360px;
}

.navigation-map-stack {
    position: relative;
    z-index: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

.navigation-map-canvas {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 220px;
}

.camera-panel-compact .navigation-map-stack,
.camera-panel-compact .navigation-map-canvas {
    min-height: 132px;
}

.camera-panel-featured .navigation-map-stack,
.camera-panel-featured .navigation-map-canvas {
    min-height: 360px;
}

/* Replay bar: icons sized to breathe inside their 30px buttons. */
.timeline-controls .timeline-icon-button i {
    font-size: 11px;
}

.timeline-controls .timeline-play-button i {
    font-size: 12px;
    margin-left: 1px;
}

/* One tooltip at a time: a hovered marker (or cluster band) hides the lane's clock tooltip. */
.timeline-lane:has(.timeline-event-marker:hover) .timeline-scrub-tooltip,
.timeline-lane:has(.timeline-event-group-band:hover) .timeline-scrub-tooltip {
    display: none;
}

/* Align dialog */
.align-result {
    justify-content: center;
}

.align-media-audio {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    min-height: 168px;
}

.wave-canvas {
    display: block;
    width: 100%;
    height: 72px;
    color: var(--status-info);
}

/* Upload dialogs: about six rows, then the table scrolls; wider time column. */
.upload-dialog .table-scroll {
    max-height: 19.5rem;
    overflow: auto;
}

.upload-dialog .seg-table thead th {
    position: sticky;
    top: 0;
    background: var(--surface-card);
    z-index: 1;
}

.seg-time {
    width: 158px;
    min-width: 158px;
}

.seg-state {
    margin-top: 3px;
}

.seg-state.upload-status-succeeded {
    color: var(--status-good);
}

.seg-state.upload-status-failed {
    color: var(--status-bad);
}

/* Telemetry: shells must not clip the hover tooltip. */
.metric-card.telemetry-card,
.handover-card,
.collapsible,
.telemetry-category {
    overflow: visible;
}

.telemetry-hover-tooltip {
    z-index: 20;
}

/* Status-bar hues (feature requests 2026-10-27, the request artifact's colours): dark values here, light
   ones below. The page and the state classes put one in --h; segments, donut slices and review lanes
   mix it into the card at --bb-status-mix. */
:root {
    --bb-status-remote: #5BA8E0;
    --bb-status-local: #7F95A0;
    --bb-status-auto: #B79AF5;
    --bb-status-manual: #2ED3D3;
    --bb-status-quiet: #3F6B62;
    --bb-status-alert: #E5604B;
    --bb-status-go: #37C98B;
    --bb-status-still: #66757A;
    --bb-status-none: #66757A;
    --bb-status-p1: #E5A53B;
    --bb-status-p2: #B77CE0;
    --bb-status-p3: #5BC0EB;
    --bb-status-p4: #F07FA6;
    --bb-status-p5: #7BD88F;
    --bb-status-p6: #D9C95A;
    --bb-status-mix: 46%;
}

html[data-theme="light"] {
    --bb-status-remote: #2F6FB3;
    --bb-status-local: #7F95A0;
    --bb-status-auto: #6B3FB8;
    --bb-status-manual: #007A7A;
    --bb-status-quiet: #8FA9A4;
    --bb-status-alert: #D64545;
    --bb-status-go: #1B9C6B;
    --bb-status-still: #8A9A9E;
    --bb-status-none: #8A9A9E;
    --bb-status-p1: #C26A00;
    --bb-status-p2: #8B4FC9;
    --bb-status-p3: #1F7FA8;
    --bb-status-p4: #B0466B;
    --bb-status-p5: #3E8E4F;
    --bb-status-p6: #8C7A00;
    --bb-status-mix: 30%;
}

/* Status-bar tooltip: the state and how long it lasted, its times under it. */
.telemetry-hover-tooltip.status-hover-tooltip {
    gap: 2px;
    font-family: var(--font-sans);
    font-size: 12px;
}

.status-tip-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.status-tip-head b {
    color: var(--text-strong);
    font-weight: 600;
}

.status-tip-length {
    margin-left: auto;
    color: var(--text-strong);
    font-family: var(--font-mono);
    font-weight: 600;
}

.status-tip-range {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
}

.review-lane-segment {
    opacity: 1;
    fill: color-mix(in srgb, var(--h, var(--bb-status-none)) var(--bb-status-mix), var(--surface-card));
}

/* The hover outline of the status bars; the browser's tooltip names the state, its length and times. */
.review-lane-segment:hover {
    stroke: var(--h, var(--bb-status-none));
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

/* Chart zoom (D1 + E1): the bar above the evidence; while zoomed it sticks under the app header and the
   Evidence / Investigation tabs (.view-bar, ~45 px) so Reset stays in reach. Phones get +-1 / +-5 min
   instead of the drag hint. */
.chart-zoom-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    min-height: 32px;
    margin: 0 0 .6rem;
    color: var(--text-dim);
    font-size: 12px;
}

.chart-zoom-bar.is-zoomed {
    position: sticky;
    top: calc(var(--header-h, 58px) + 54px);
    z-index: 5;
    justify-self: start;
    width: fit-content;
    max-width: 100%;
    padding: 3px 4px 3px 12px;
    border: 1px solid var(--color-primary);
    border-radius: 10px;
    background: color-mix(in srgb, var(--color-primary) 12%, var(--surface-card));
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    color: var(--text-strong);
}

.chart-zoom-hint,
.chart-zoom-range {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chart-zoom-range b {
    font-family: var(--font-mono);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.chart-zoom-bar .ghost {
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
}

.chart-zoom-reset i {
    margin-right: 5px;
}

.chart-zoom-presets {
    display: none;
    gap: 6px;
}

@media (hover: none) {
    .chart-zoom-hint { display: none; }
    .chart-zoom-presets { display: inline-flex; }
}

.zoom-select {
    position: fixed;
    z-index: 40;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    background: color-mix(in srgb, var(--color-primary) 16%, transparent);
    pointer-events: none;
}

.zoom-select span {
    margin-top: -22px;
    padding: 1px 6px;
    border-radius: 5px;
    background: var(--color-primary);
    color: var(--color-on-primary, #04101A);
    font: 600 11px var(--font-mono);
    white-space: nowrap;
}

html.bb-zooming .telemetry-hover-tooltip,
html.bb-zooming .telemetry-hover-line {
    display: none;
}

html.bb-zooming,
html.bb-zooming * {
    user-select: none;
}

/* The replay bar shades the range the charts are zoomed to. */
.timeline-lane-zoom {
    position: absolute;
    bottom: 10px;
    height: 12px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--color-primary) 22%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-primary) 70%, transparent);
    pointer-events: none;
}
}

@layer responsive {
@media (max-width: 767px) {
    /* Phone replay bar: transport + lane + time only. Markers, filters, speed and collapse go. */
    .timeline-controls button.timeline-event-marker,
    .timeline-controls button.timeline-event-group-band,
    .timeline-events-menu,
    .timeline-more-menu,
    .timeline-collapse-toggle,
    .timeline-control-group-tools,
    .timeline-scrub-tooltip,
    .timeline-edge,
    .marker-open {
        display: none;
    }

    .timeline-controls {
        grid-template-columns: auto minmax(0, 1fr);
    }
}
}

@layer components {
/* Mapbox's own controls sit below the tile header so pin/follow stay clickable. !important: the
   Mapbox CDN stylesheet is unlayered and its top: 0 outranks anything said from inside @layer. */
.navigation-map-panel .mapboxgl-ctrl-top-right {
    top: 38px !important;
}

.lane-name {
    white-space: normal;
    line-height: 1.15;
    overflow: visible;
}
}

@layer components {
/* ---------- Round 4 ---------- */
/* Loaders: block-level bars (inline spans collapsed the animation), centred in their section. */
.loadbar,
.loadbar-fill {
    display: block;
}

.panel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 2rem 1rem;
    min-height: 9rem;
    color: var(--text-muted);
    font-size: 12.5px;
    text-align: center;
}

.panel-loading .loadbar {
    width: min(220px, 60vw);
    max-width: none;
    flex: none;
}

/* Empty states with an icon (VHF, documents). */
.empty-state.empty-state-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 40px auto;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.empty-state-icon .ic {
    font-size: 22px;
    color: var(--text-dim);
    opacity: .7;
}

/* Time input (align dialog): design colours, themed picker, cyan focus ring. */
.inp-time {
    height: 34px;
    padding: 6px 10px;
    color-scheme: dark;
    accent-color: var(--color-primary);
}

html[data-theme="light"] .inp-time {
    color-scheme: light;
}

.inp:hover {
    border-color: var(--cyan-dim);
}

.inp:focus,
.inp:focus-visible {
    outline: 0;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.inp-time::-webkit-calendar-picker-indicator {
    opacity: .7;
    cursor: pointer;
}

.inp-time::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Handover: the status pill carries its colour dot; component and check dots stay .6rem. */
.handover-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.handover-component > summary .handover-dot,
.handover-checks .handover-dot {
    display: inline-block;
    width: .6rem;
    height: .6rem;
    min-width: .6rem;
    border-radius: 50%;
}

.nowrap {
    white-space: nowrap;
}

/* Alarms: room between the severity filter and the list. */
.alarm-toolbar {
    margin-bottom: 1rem;
    padding-top: .25rem;
}
}

@layer responsive {
@media (max-width: 1023px) {
    /* PostHog's support launcher sits above the replay bar instead of on top of it. */
    #ph-conversations-widget-container > div {
        bottom: 78px !important;
        right: 12px !important;
    }
}
}

@layer components {
/* ---------- Manual timeline entries ("actions", Odoo #13699) ---------- */
/* The create item, last in the marker popover under Hide/Show markers. */
.timeline-controls .timeline-events-popover button.timeline-event-chip.is-create {
    color: var(--color-primary);
    font-weight: 700;
}

.timeline-controls .timeline-events-popover button.timeline-event-chip.is-create i {
    color: var(--color-primary);
}

.timeline-controls .timeline-events-popover button.timeline-event-chip.is-create:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.timeline-controls .timeline-events-popover button.timeline-event-chip.is-create:disabled {
    opacity: .45;
    cursor: default;
}

/* A note can be long; the action tooltip wraps where the sensor tooltips stay on one line. */
.timeline-controls button.timeline-event-marker[data-event-type="marker"] .timeline-event-tooltip {
    white-space: normal;
    width: max-content;
    max-width: 260px;
}

/* Out-of-window entries: the track carries on past the lane, fading outward, and the entries out
   there collapse into a count above it. 56px per side, rendered only when such entries exist. */
.timeline-edge {
    position: relative;
    flex: none;
    width: 56px;
    height: 48px;
}

.timeline-edge .spill-track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    height: 4px;
    border-radius: var(--radius-pill);
}

.timeline-edge.is-before .spill-track {
    background: linear-gradient(to right, transparent, color-mix(in srgb, var(--color-primary) 28%, transparent));
}

.timeline-edge.is-after .spill-track {
    background: linear-gradient(to left, transparent, color-mix(in srgb, var(--color-primary) 28%, transparent));
}

.timeline-controls button.timeline-edge-count {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    height: 18px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--color-primary);
    font-family: var(--font-mono);
    font-size: .7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.timeline-controls button.timeline-edge-count:hover:not(:disabled),
.timeline-controls button.timeline-edge-count.is-open {
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--color-primary-hover);
}

.timeline-edge-count .edge-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-raised);
    border: 1px solid color-mix(in srgb, var(--color-primary) 62%, transparent);
    color: var(--color-primary);
    font-size: .56rem;
    line-height: 1;
}

.timeline-edge-count:hover .edge-dot,
.timeline-edge-count.is-open .edge-dot {
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-color: var(--color-primary);
}

.timeline-edge-popover {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    animation: bb-popover-in var(--dur-fast) var(--ease);
    z-index: 22;
    width: 286px;
    padding: 6px;
    background: var(--surface-raised);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    box-shadow: var(--shadow-overlay);
    text-align: left;
}

.timeline-controls .timeline-edge-popover button.timeline-edge-row {
    display: grid;
    grid-template-columns: 16px 1fr auto;
    gap: .5rem;
    align-items: center;
    width: 100%;
    border: 1px solid transparent;
    border-radius: var(--radius-chip);
    background: transparent;
    box-shadow: none;
    padding: .3rem .5rem;
    font-size: .74rem;
    text-align: left;
    color: var(--text-body);
}

.timeline-controls .timeline-edge-popover button.timeline-edge-row:hover:not(:disabled) {
    border-color: var(--border-default);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.timeline-edge-row i {
    color: var(--color-primary);
    font-size: .7rem;
}

.timeline-edge-row .row-label {
    color: var(--text-strong);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-edge-row .row-time {
    font-family: var(--font-mono);
    font-size: .68rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Seven rows, then scroll: a night of cargo work must not grow the popover up the page. The label
   and the note pane sit outside the scroller and stay visible. */
.timeline-edge-rows {
    display: block;
    max-height: calc(7 * 27.5px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.timeline-edge-rows::-webkit-scrollbar {
    width: 8px;
}

.timeline-edge-rows::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--color-primary) 30%, transparent);
    border-radius: var(--radius-pill);
}

.timeline-edge-rows::-webkit-scrollbar-track {
    background: transparent;
}

/* Centring is the rule, but the two right-hand menus sit close to the end of the bar: once the bar
   stops being narrower than the screen (bar = min(1040px, 100vw - 2rem), so from about 1100px down)
   half the menu would hang off the right edge. There they anchor to their trigger's right edge
   instead and rise straight up. The before-cap has the whole transport cluster to its left and never
   needs this. */
@media (max-width: 1110px) {
    .timeline-events-popover,
    .timeline-edge.is-after .timeline-edge-popover {
        left: auto;
        right: 0;
        transform: none;
        animation-name: bb-sheet-in;
    }
}

/* Hovering a row writes its note here, so the list never changes height. */
.timeline-edge-note {
    display: block;
    margin-top: 4px;
    padding: .42rem .5rem 0;
    border-top: 1px solid var(--border-subtle);
    font-size: .7rem;
    line-height: 1.4;
    color: var(--text-muted);
    min-height: 2.6em;
    white-space: normal;
}

/* Open pill on a selected action marker. A span, not a button: markers are buttons already. */
.marker-open {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    z-index: 11;
    padding: .14rem .45rem;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.marker-open:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.timeline-controls button.timeline-event-marker.is-selected .timeline-event-icon {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 34%, transparent);
    border-radius: 50%;
}

/* The pill sits where the tooltip would, so the tooltip stands down while it shows. */
.timeline-controls button.timeline-event-marker.is-selected:hover .timeline-event-tooltip {
    display: none;
}

/* Add-action dialog: the type as one row of chips. */
.timeline-entry-dialog {
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
}

.type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.type-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-chip);
    background: var(--surface-raised);
    padding: .4rem .7rem;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-body);
    transition: border-color 120ms ease, background 120ms ease;
}

.type-chip i {
    font-size: 12px;
    color: var(--text-muted);
}

.type-chip:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--color-primary) 50%, transparent);
}

.type-chip.is-selected {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
}

.type-chip.is-selected i {
    color: var(--color-on-primary);
}

.type-chip:disabled {
    opacity: .55;
    cursor: default;
}
}

/* ---------- Footage request log: full detail text, live strip ---------- */
/* Radzen cells default to a single ellipsised line; the Detail column carries the playbook's
   error text and must be readable in full. Scoped to the request log so other grids keep the
   compact one-line cells. */
.footage-log-grid .rz-cell-data {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.footage-log .footage-log-detail {
    max-width: none;
}

/* ---------- Maximize, footage review mode, phone event diamonds ---------- */
/* In @layer responsive on purpose: the media grid's column counts and the tile heights are restated per
   breakpoint in this layer, and a later layer wins over any specificity in an earlier one. */
@layer responsive {
/* Maximize (map and cameras): a class, not browser fullscreen. The tile fills the page between the
   header and the replay bar, which stays usable, and keeps its DOM parent, so its <video> or map never
   reloads (Mapbox resizes through its ResizeObserver). z 880: under the replay bar (900) so its menus
   open over the tile; the rail drawer (950) and the header menu (1200) stay on top. */
.camera-panel.is-maximized {
    position: fixed;
    /* Down to the bottom edge, padded clear of the replay bar: the tile covers the page instead of
       leaving it visible around the bar. */
    inset: var(--header-h) 0 0 0;
    padding-bottom: var(--timeline-clearance);
    z-index: 880;
    margin: 0;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: var(--surface-page);
}

/* Review mode: the footage section takes the same box; the rail and every other section hide.
   Footage lives in the Evidence view (#view-evidence), so that panel stays and its other cards go. */
.incident-page.is-review .incident-rail,
.incident-page.is-review .rail-scrim,
.incident-page.is-review .incident-content > :not(#view-evidence),
.incident-page.is-review #view-evidence > :not(#footage) {
    display: none;
}

/* The app header goes too, for the space; the toolbar names the event and has Exit. */
body:has(.incident-page.is-review) .app-header {
    display: none;
}

.incident-page.is-review #footage {
    position: fixed;
    inset: 0;
    z-index: 870;
    margin: 0;
    padding: .6rem .9rem var(--timeline-clearance);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    overflow: hidden;
}

:root:has(.incident-page.is-review),
:root:has(.camera-panel.is-maximized) {
    overflow: hidden;
}

.incident-page.is-review .camera-layout-shell {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: .5rem;
}

.media-grid[data-review-layout] {
    min-height: 0;
    height: 100%;
    gap: .5rem;
}

/* Layout presets: grid areas s0..s5; a tile's data-review-slot picks its area, -1 waits in the tray.
   Swapping two tiles only swaps two attributes. */
.media-grid[data-review-layout="focus"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    grid-template-areas: "s0 s0 s1" "s0 s0 s2" "s3 s4 s5";
}

.media-grid[data-review-layout="grid2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-template-areas: "s0 s1" "s2 s3";
}

.media-grid[data-review-layout="grid3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-template-areas: "s0 s1 s2" "s3 s4 s5";
}

.media-grid[data-review-layout="side"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-template-areas: "s0 s0 s1" "s0 s0 s2";
}

.media-grid[data-review-layout] > [data-review-slot="0"] { grid-area: s0; }
.media-grid[data-review-layout] > [data-review-slot="1"] { grid-area: s1; }
.media-grid[data-review-layout] > [data-review-slot="2"] { grid-area: s2; }
.media-grid[data-review-layout] > [data-review-slot="3"] { grid-area: s3; }
.media-grid[data-review-layout] > [data-review-slot="4"] { grid-area: s4; }
.media-grid[data-review-layout] > [data-review-slot="5"] { grid-area: s5; }

/* A tile, in review or maximized, fills its box: video, map and the empty state stretch, the picture
   letterboxes. */
.media-grid[data-review-layout] > .camera-panel,
.camera-panel.is-maximized {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
}

/* After the flex rule above: same specificity, so source order decides. */
.media-grid[data-review-layout] > [data-review-slot="-1"] {
    display: none;
}

.media-grid[data-review-layout] .camera-video-stack,
.media-grid[data-review-layout] .navigation-map-stack,
.media-grid[data-review-layout] .navigation-map-canvas,
.media-grid[data-review-layout] .camera-empty,
.camera-panel.is-maximized .camera-video-stack,
.camera-panel.is-maximized .navigation-map-stack,
.camera-panel.is-maximized .navigation-map-canvas,
.camera-panel.is-maximized .camera-empty {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

.media-grid[data-review-layout] video,
.camera-panel.is-maximized video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.review-toolbar {
    flex-wrap: wrap;
}

.alarm-summary-counts {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.review-presets {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.review-preset.is-selected {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

/* Enter/exit review and maximize/restore run in a view transition (blackboxReview.transition): the
   footage section (bb-footage) and the tile (bb-tile) morph between their boxes, the rest cross-fades.
   The names are set from JS for the transition only; see there why never permanently. */
::view-transition-group(bb-footage),
::view-transition-group(bb-tile) {
    animation-duration: .32s;
    animation-timing-function: cubic-bezier(.2, 0, .1, 1);
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: .22s;
}

/* Drag sources (blackboxReview, pointer events). touch-action only on the header bar and the tray
   chips: a finger on the picture still scrolls the phone layout, a finger on the bar drags. */
[data-review-drag] {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

[data-review-drag] :is(button, a) {
    cursor: pointer;
}

.media-grid[data-review-layout] .camera-header,
.review-tray-chip {
    touch-action: none;
}

.is-review-dragging,
.is-review-dragging * {
    cursor: grabbing !important;
}

.media-grid[data-review-layout] > .is-dragging {
    opacity: .45;
}

/* The name of the tile being dragged, following the pointer. */
.review-drag-ghost {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1300;
    padding: .3rem .65rem;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-chip);
    background: var(--surface-raised);
    color: var(--text-strong);
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    box-shadow: var(--shadow-overlay);
    pointer-events: none;
}

.camera-review-grip {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-right: .15rem;
    border-radius: 5px;
    cursor: grab;
    color: inherit;
    opacity: .8;
}

.camera-review-grip:hover,
.camera-review-grip:focus-visible {
    opacity: 1;
    background: rgba(255, 255, 255, .12);
}

.media-grid[data-review-layout] > .is-drop-target {
    outline: 3px dashed var(--status-warn);
    outline-offset: -3px;
}

.is-swap-source {
    outline: 3px solid var(--color-primary);
    outline-offset: -3px;
}

.review-tray {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .4rem .6rem;
    border: 1px dashed var(--border-default);
    border-radius: 10px;
}

.review-tray-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.review-tray-chip {
    display: inline-flex;
    width: auto;
    height: auto;
    margin: 0;
    padding: .3rem .6rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-chip);
    background: var(--surface-raised);
    color: var(--text-body);
    font-size: 12px;
    opacity: 1;
}

@media (max-width: 767px) {
    /* Footage header: the buttons share the row and wrap instead of pushing the page wider than the
       phone (which let every section below slide sideways). */
    .footage-section .section-head .section-actions {
        flex-wrap: wrap;
    }

    .footage-section .section-head .section-actions > button {
        flex: 1 1 auto;
        justify-content: center;
        min-width: 0;
    }

    /* Footage status strip: the facts stack under the title (no dot separators starting a wrapped
       line) and the dismiss / cancel / retry controls stay top-right instead of a row of their own. */
    .footage-strip {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: start;
    }

    .footage-strip-actions {
        grid-column: auto;
        justify-content: flex-end;
    }

    .footage-strip-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .footage-strip-line > span + span::before {
        content: none;
    }

    .footage-strip-line > span {
        overflow-wrap: anywhere;
    }

    /* Status lanes: the start / cursor / end times fit the narrow lane. */
    .lane-axis .operational-status-axis {
        gap: .35rem;
        font-size: 9.5px;
        min-width: 0;
    }

    .lane-axis .operational-status-axis strong {
        font-size: 10.5px;
    }

    /* Alarms header: the per-severity counts wrap under the title. */
    .telemetry-category > summary {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    /* Phone events lane: Signac-style 8px diamonds in the event's colour. Display only
       (pointer-events: none), so a tap or drag anywhere on the lane scrubs; the events button beside
       the time opens the list. */
    .timeline-controls .timeline-event-diamond {
        position: absolute;
        bottom: 2px;
        width: 24px;
        height: 24px;
        margin-left: -12px;
        z-index: 4;
        pointer-events: none;
    }

    .timeline-event-diamond::before,
    .timeline-events-sheet-diamond {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 1px;
        background: currentColor;
        transform: rotate(45deg);
    }

    .timeline-event-diamond::before {
        position: absolute;
        left: 8px;
        top: 8px;
        opacity: .9;
    }

    .timeline-event-diamond.is-trigger::before {
        box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 35%, transparent);
    }

    .timeline-controls button.timeline-events-near {
        flex: none;
    }

    .timeline-controls button.timeline-events-near.is-open {
        border-color: var(--color-primary);
        color: var(--color-primary);
    }

    .timeline-events-sheet {
        position: absolute;
        left: 0;
        right: 0;
        bottom: calc(100% + .5rem);
        max-height: 45vh;
        overflow-y: auto;
        padding: .5rem;
        border: 1px solid var(--border-default);
        border-radius: 14px;
        background: var(--surface-raised);
        box-shadow: var(--shadow-overlay);
        z-index: 20;
    }

    .timeline-events-sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .5rem;
        padding: .15rem .35rem .4rem;
        color: var(--text-strong);
        font-size: 12.5px;
    }

    .timeline-controls button.timeline-events-sheet-close,
    .timeline-controls button.timeline-events-sheet-row {
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .timeline-controls button.timeline-events-sheet-row {
        display: grid;
        grid-template-columns: 12px auto minmax(0, 1fr) auto;
        align-items: center;
        gap: .6rem;
        width: 100%;
        padding: .5rem .45rem;
        border-radius: 8px;
        text-align: left;
    }

    .timeline-controls button.timeline-events-sheet-row:hover,
    .timeline-controls button.timeline-events-sheet-row:focus-visible {
        background: var(--surface-hover);
        box-shadow: none;
    }

    .timeline-events-sheet-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--text-body);
    }

    .timeline-events-sheet-row .mono {
        color: var(--text-muted);
        font-size: 11.5px;
    }

    .timeline-events-sheet-row .fa-crosshairs {
        color: var(--text-dim);
        font-size: 11px;
    }
}
}

/* Event sharing (Odoo #13750) and privacy mode (Signac port). */
@layer components {
    /* Privacy mode: a thin accent line along the top of the internal app (never on a shared report). */
    html.privacy .app-shell:not(.share-shell) > .app-header {
        box-shadow: inset 0 2px 0 var(--color-primary), 0 8px 24px color-mix(in srgb, var(--color-primary) 18%, transparent);
    }

    /* A name removed from a shared report. */
    .redacted-name {
        display: inline-block;
        padding: 0 .45em;
        border-radius: var(--radius-chip);
        border: 1px solid var(--border-default);
        background: var(--surface-sunken);
        color: var(--text-muted);
        font-size: .85em;
        font-weight: 600;
        line-height: 1.5;
    }

    /* Shared report: what the recipient is looking at, in the title row's quiet mono voice (like the
       section counts), not as extra pills next to the status chips. */
    .shared-note {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 4px 14px;
        color: var(--text-dim);
        font-family: var(--font-mono);
        font-size: 11px;
        letter-spacing: .06em;
        white-space: nowrap;
    }

    .shared-note i {
        margin-right: 4px;
        color: var(--text-muted);
    }

    .share-header-actions {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: .5rem;
    }

    /* Share dialog: laid out like the prototype (expiry pills, link and password rows, Close). */
    .share-dialog {
        display: grid;
        gap: 1rem;
    }

    .share-dialog-sub {
        margin: -.35rem 0 0;
        color: var(--text-muted);
        font-size: 12.5px;
    }

    .share-field {
        display: grid;
        gap: .5rem;
        min-width: 0;
    }

    .share-label {
        display: flex;
        align-items: center;
        gap: .4rem;
        color: var(--text-muted);
        font-size: 12px;
    }

    .share-label b {
        margin-left: auto;
        color: var(--text-strong);
        font-weight: 500;
    }

    .share-info {
        color: var(--text-dim);
    }

    .share-pills {
        display: flex;
        gap: .5rem;
    }

    .share-pill {
        flex: 1;
        padding: .5rem 0;
        border: 1px solid var(--border-default);
        border-radius: var(--radius-button);
        background: transparent;
        color: var(--text-muted);
        font-size: 12.5px;
        cursor: pointer;
    }

    .share-pill:hover:not(:disabled) {
        border-color: var(--color-primary);
        color: var(--text-strong);
    }

    .share-pill.is-selected {
        border-color: var(--color-primary);
        background: var(--color-primary);
        color: var(--color-on-primary);
        font-weight: 600;
    }

    .share-row {
        display: flex;
        align-items: center;
        gap: .5rem;
        min-width: 0;
    }

    .share-input {
        flex: 1;
        min-width: 0;
        padding: .5rem .65rem;
        border: 1px solid var(--border-default);
        border-radius: var(--radius-button);
        background: var(--surface-sunken);
        color: var(--text-strong);
        font-family: var(--font-mono);
        font-size: 12.5px;
    }

    .share-input[aria-invalid="true"] {
        border-color: var(--status-bad);
    }

    .share-option {
        display: flex;
        align-items: center;
        gap: .45rem;
        width: fit-content;
        color: var(--text-muted);
        font-size: 12px;
        cursor: pointer;
    }

    .share-option input {
        accent-color: var(--color-primary);
    }

    .share-copied {
        display: inline-flex;
        align-items: center;
        gap: .3rem;
        padding: 1px 7px;
        border: 1px solid color-mix(in srgb, var(--status-good) 35%, transparent);
        border-radius: 5px;
        background: var(--status-good-bg);
        color: var(--status-good);
        font-size: 11px;
        font-weight: 600;
        letter-spacing: normal;
        text-transform: none;
    }

    .share-warning {
        margin: 0;
        padding: .55rem .7rem;
        border-left: 3px solid var(--status-warn);
        border-radius: 8px;
        background: var(--status-warn-bg);
        color: var(--text-strong);
        font-size: 12.5px;
    }

    .share-links {
        display: grid;
        gap: .4rem;
        padding-top: .75rem;
        border-top: 1px solid var(--border-subtle);
    }

    .share-links .table-scroll {
        max-height: 12.5rem;
        overflow-y: auto;
    }

    .share-links-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
    }

    .share-links-table thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: var(--surface-card);
    }

    .share-links-table th {
        padding: 4px 10px 4px 0;
        border-bottom: 1px solid var(--border-subtle);
        color: var(--text-dim);
        font-family: var(--font-mono);
        font-size: 10px;
        font-weight: 600;
        letter-spacing: .1em;
        text-align: left;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .share-links-table td {
        padding: 5px 10px 5px 0;
        border-bottom: 1px solid var(--border-subtle);
        color: var(--text-body);
        white-space: nowrap;
    }

    /* Right-aligned, and kept clear of the list's scrollbar. */
    .share-links-table th:last-child,
    .share-links-table td:last-child {
        text-align: right;
        padding-right: .75rem;
    }

    /* A long name wraps rather than pushing the table past the dialog. */
    .share-links-table td:nth-child(2) {
        white-space: normal;
    }

    .share-links-table tr.is-expired td {
        color: var(--text-dim);
    }

    /* Recipient gate, expired and lockout: one small card, nothing that names the event. */
    .share-gate {
        display: grid;
        place-items: center;
        min-height: calc(100vh - var(--header-h) - 4rem);
        padding: 2rem 1rem;
    }

    .share-gate-card {
        display: grid;
        gap: .75rem;
        width: min(360px, 100%);
        text-align: center;
    }

    .share-gate-card h1 {
        margin: 0;
        color: var(--text-strong);
        font-size: 1.15rem;
    }

    .share-gate-card p {
        margin: 0;
        color: var(--text-muted);
        font-size: 13px;
    }

    .share-gate-icon {
        display: grid;
        place-items: center;
        justify-self: center;
        width: 44px;
        height: 44px;
        border: 1px solid var(--border-default);
        border-radius: 12px;
        background: var(--surface-card);
        color: var(--text-muted);
        font-size: 17px;
    }

    .share-gate-form {
        display: grid;
        gap: .5rem;
        margin-top: .5rem;
    }

    .share-gate-form .ghost.primary {
        justify-content: center;
        padding: .55rem;
    }

    .share-gate-error {
        color: var(--status-bad);
        font-size: 12.5px;
    }
}

@layer components {
/* Dashed: the second series sharing an axis, so the pair never relies on color alone. */
.telemetry-line-path.telemetry-line-dashed {
    stroke-dasharray: 6 4;
}

/* Vessel grid: the compass on its own row on top, then Heading & COG and SOG half a row each, then
   the other cards a third each (six tracks on desktop; the tablet and phone rules take over below
   1280 px). Dense packing lets a single card fill any gap. */
.chartgrid-vessel {
    grid-auto-flow: row dense;
}

.chartgrid-vessel > .compass-card {
    grid-column: 1 / -1;
    container-type: inline-size;
}

@media (min-width: 1280px) {
    .chartgrid-vessel {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .chartgrid-vessel > * {
        grid-column: span 2;
    }

    .chartgrid-vessel > .vessel-half {
        grid-column: span 3;
    }
}

.propulsion-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Round 3 G1: power over direction in one card per unit; the upper chart drops its time axis. */
.propulsion-card {
    --chart-h: 120px;
}

.propulsion-part + .propulsion-part {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-subtle);
}

.propulsion-part-label {
    display: block;
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.propulsion-part:not(:last-child) .telemetry-axis,
.propulsion-part:not(:last-child) .telemetry-tick-label-x {
    display: none;
}

.propulsion-head > .compass-orientation {
    display: inline-flex;
    gap: 4px;
}

.compass-rose-heading {
    justify-content: space-between;
}

.telemetry-card-heading > .compass-orientation {
    display: inline-flex;
    gap: 4px;
}

.compass-orientation .ghost {
    padding: 2px 8px;
    font-size: 10.5px;
}

.compass-orientation .ghost.is-selected {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

/* Drawn by blackboxCompass: a dial column (dial + ROT bar) and a values column (readout, and with a
   plan the units table). Narrow card: stacked. Wide card (container queries below): side by side,
   centred, both columns fixed so the dial never moves. */
.compass-rose {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 6px 22px;
}

.compass-dial-column {
    display: grid;
    gap: 2px;
    width: 100%;
    max-width: 230px;
}

.compass-rose.has-units .compass-dial-column {
    max-width: 340px;
}

.compass-rose-dial,
.compass-rot {
    display: block;
    width: 100%;
    height: auto;
}

.compass-values {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    min-width: 0;
}

/* The units table: left of the dial on a wide card, under the readouts on a narrow one. */
.compass-units {
    display: grid;
    gap: 8px;
    width: 100%;
    max-width: 360px;
    min-width: 0;
    overflow-x: auto;
}

.compass-face {
    fill: var(--blackbox-chart-surface);
    stroke: var(--blackbox-chart-surface-border);
}

.compass-ring {
    fill: none;
    stroke: var(--blackbox-chart-axis);
}

.compass-tick {
    stroke: var(--blackbox-chart-tick-label);
    stroke-width: 1.2;
}

.compass-tick-major {
    stroke: var(--text-strong);
    stroke-width: 2;
}

.compass-label {
    font: 500 13px var(--font-mono);
    fill: var(--blackbox-chart-tick-label);
}

.compass-label-cardinal {
    font-size: 16px;
    font-weight: 700;
    fill: var(--text-strong);
}

.compass-trail,
.compass-pivot {
    fill: var(--blackbox-chart-heading);
}

.compass-heading-line {
    stroke: var(--blackbox-chart-heading);
    stroke-width: 2;
    stroke-dasharray: 6 4;
}

.compass-hull {
    fill: var(--surface-raised);
    stroke: var(--blackbox-chart-heading);
    stroke-width: 2.4;
    stroke-linejoin: round;
}

/* ---------- Round 3: the vessel's equipment (L2), jets under a see-through hull (M2), the command as
   a faint dashed plume (N1). Units are drawn at x2, so widths here are half of what shows. ---------- */
.compass-hull.is-glass {
    fill-opacity: .3;
}

.cb-plume {
    stroke: var(--blackbox-chart-heading);
    stroke-width: .5;
    stroke-opacity: .55;
}

.cb-plume.is-astern {
    stroke: var(--status-warn);
}

.cb-flow {
    fill: none;
    stroke: #FFFFFF;
    stroke-width: .7;
    stroke-dasharray: 1.6 4.4;
    stroke-linecap: round;
    opacity: .85;
}

/* The command: a white dashed outline where the unit is told to blow, a tip at its reach, and for
   a pod the dashed nozzle it is told to take. Clear on the jet and on the hull alike. */
.cb-ghost {
    fill: color-mix(in srgb, #FFFFFF 7%, transparent);
    stroke: var(--text-strong);
    stroke-width: .75;
    stroke-dasharray: 2 1.4;
    stroke-linejoin: round;
    opacity: .9;
}

.cb-nozzle-cmd {
    fill: none;
    stroke: var(--text-strong);
    stroke-width: .8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cb-nozzle-cmd {
    stroke-dasharray: 1.4 1.1;
}

.compass-dial-column.is-local :is(.cb-ghost, .cb-nozzle-cmd) {
    stroke: var(--status-warn);
}

.cb-body,
.cb-duct {
    fill: var(--blackbox-chart-surface);
    stroke: var(--text-strong);
    stroke-width: .9;
    stroke-linejoin: round;
}

.cb-pin {
    fill: var(--blackbox-chart-heading);
}

.cb-shaft {
    stroke: var(--text-muted);
    stroke-width: 1.1;
    stroke-linecap: round;
}

.cb-blade {
    fill: var(--blackbox-chart-heading);
}

.cb-blade.is-back {
    opacity: .35;
}

.cb-hub {
    fill: var(--text-strong);
}

.cb-spoke {
    fill: none;
    stroke: var(--blackbox-chart-heading);
    stroke-width: 1.1;
    stroke-linecap: round;
}

.cb-rudder {
    fill: var(--blackbox-chart-heading);
    stroke: var(--text-strong);
    stroke-width: .5;
}

.cb-blade-cmd {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: .6;
    stroke-dasharray: 1.4 1.2;
}

.cb-unit.is-bad :is(.cb-body, .cb-duct, .cb-rudder) {
    stroke: var(--status-bad);
}

.compass-code {
    font: 800 11px var(--font-mono);
    fill: var(--text-muted);
    paint-order: stroke;
    stroke: var(--blackbox-chart-surface);
    stroke-width: 3px;
}

.compass-code.is-bad {
    fill: var(--status-bad);
}

/* The compass card under the footage. */
.footage-section > .compass-card {
    margin-top: 14px;
    container-type: inline-size;
}

.telemetry-card-heading > .compass-heading-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.compass-heading-actions > .compass-orientation {
    display: inline-flex;
    gap: 4px;
}

/* COG: a thin speed vector over everything but the unit codes; the halo keeps it readable where it
   crosses the hull and the thruster arrows. */
/* Round 3 feedback: thinner and quieter, under the equipment, so it reads with the drawing. */
.compass-cog-halo {
    fill: none;
    stroke: var(--blackbox-chart-surface);
    stroke-width: 4;
    stroke-linecap: round;
    opacity: .6;
}

.compass-cog-line {
    fill: none;
    stroke: var(--blackbox-chart-cog);
    stroke-width: 1.6;
    stroke-linecap: round;
    opacity: .85;
}

.compass-cog-notch {
    fill: none;
    stroke: var(--blackbox-chart-cog);
    stroke-width: 1.2;
    stroke-linecap: round;
    opacity: .75;
}

.compass-cog-head {
    fill: var(--blackbox-chart-cog);
    stroke: var(--blackbox-chart-surface);
    stroke-width: 1.2;
    stroke-linejoin: round;
    paint-order: stroke;
    opacity: .9;
}

.compass-cog.compass-faded {
    opacity: .45;
}

.compass-cog.compass-faded .compass-cog-line {
    stroke-dasharray: 5 4;
}

.compass-rot-track {
    stroke: var(--blackbox-chart-axis);
    stroke-width: 6;
    stroke-linecap: round;
}

.compass-rot-bar {
    fill: var(--blackbox-chart-heading);
}

.compass-rot-cmd {
    fill: var(--color-primary);
}

.compass-rot-mid {
    stroke: var(--blackbox-chart-tick-label);
    stroke-width: 1.5;
}

.compass-rot-side {
    font: 10px var(--font-mono);
    fill: var(--text-dim);
}

/* Fixed columns, never sized by their values: a longer SOG or ROT must not shift the dial or rewrap
   the readout while the cursor moves. Values that outgrow a column are clipped, not pushed. */
.compass-readout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 6px 12px;
    margin: 0;
}

.compass-readout div {
    display: grid;
    align-content: start; /* a taller neighbour (COG's speed note) must not push the value down */
    gap: 1px;
    min-width: 0;
}

/* "12°/min stbd" is wider than a third of a phone panel. */
.compass-readout .compass-readout-wide {
    grid-column: span 2;
}

@container (min-width: 380px) {
    .compass-rose:not(.has-units) {
        grid-template-columns: minmax(0, 230px) 160px;
        justify-content: center;
        align-items: center;
    }

    /* Fill the fixed column; centred it would slide with the text width. */
    .compass-rose:not(.has-units) .compass-values {
        justify-self: stretch;
    }

    .compass-rose:not(.has-units) .compass-readout {
        grid-template-columns: minmax(0, 1fr); /* the global dl rule is a 110px label grid */
        gap: 8px;
    }

    .compass-rose:not(.has-units) .compass-readout div {
        grid-template-columns: 48px minmax(0, 1fr);
        align-items: baseline;
        gap: 0 6px;
    }

    .compass-rose:not(.has-units) .compass-readout .compass-readout-wide {
        grid-column: auto;
    }
}

/* With units (round 3): the table left, the dial in the middle, the readouts right. All three columns
   are fixed, so longer values, a wider table or a status line never move the dial. */
@container (min-width: 700px) {
    .compass-rose.has-units {
        grid-template-columns: minmax(0, 250px) minmax(0, 340px) minmax(0, 170px);
        justify-content: center;
        align-items: center;
        gap: 0 32px;
    }

    .compass-rose.has-units .compass-units {
        order: -1;
        justify-self: stretch;
        max-width: none;
    }

    .compass-rose.has-units .compass-values {
        justify-self: stretch;
    }

    .compass-rose.has-units .compass-readout {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .compass-rose.has-units .compass-readout .compass-readout-wide {
        grid-column: auto;
    }

    .compass-rose.has-units .compass-readout dd {
        font-size: 16px;
    }
}

/* Narrow card (a phone): dial, the readouts on a sunken strip in three columns, then the table. */
@container (max-width: 699px) {
    .compass-rose.has-units .compass-values {
        max-width: 360px;
        padding: 8px 12px;
        border-radius: 10px;
        background: var(--surface-sunken);
    }
}

.compass-readout dt {
    font: 500 10.5px var(--font-mono);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.compass-readout dd {
    margin: 0;
    font: 600 13px var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compass-readout .compass-faded dd {
    color: var(--text-muted);
}

.compass-readout dd small {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-dim);
}

.compass-readout dd small.compass-hidden {
    visibility: hidden;
}
}

@layer responsive {
@media (max-width: 767px) {
    /* Phone: the codes match the drawing, so the long unit names go. */
    .tp-name {
        display: none;
    }

    .tp-table .tp-group th:first-child {
        width: 20%;
    }

    .compass-dial-column,
    .compass-rose.has-units .compass-dial-column {
        max-width: 300px;
    }

    .tp-table.is-list .tp-name {
        display: inline;
    }
}
}

/* ==========================================================================================
   Review mode layout system and the compact details header (2026-10 redesign). In the responsive
   layer, after every other rule of it: the desktop header rules sit behind min-width queries so the
   phone rules earlier in this layer keep the phone layout.
   ========================================================================================== */
@layer responsive {

/* ---------- Details header: one title row (back, vessel, chips, facts, actions), one row of cells ---------- */
@media (min-width: 768px) {
    .details-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 8px 12px;
        padding: 11px 16px 10px;
    }

    .details-main {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 12px;
        min-width: 0;
    }

    .details-head .back-link {
        align-self: center;
    }

    .details-sep {
        width: 1px;
        height: 18px;
        background: var(--border-default);
    }

    .details-heading {
        margin: 0;
        font-size: 19px;
    }

    .details-chips {
        gap: 6px;
    }

    .details-chips :is(.priority-badge, .event-type-badge, .status-pill) {
        padding: .16rem .55rem;
        font-size: .74rem;
    }

    .details-chips .chip {
        letter-spacing: .04em;
    }

    .details-chips .edit-hint {
        gap: 4px;
    }

    /* No rule before the facts: on a narrower screen they wrap to their own line and would start with it. */
    .details-facts {
        margin-left: 0;
    }

    .details-facts > span + span::before {
        margin: 0 7px;
    }

    .details-title-actions {
        margin-left: 0;
    }

    .details-desc {
        display: grid;
        grid-template-columns: 132px minmax(0, 1fr);
        gap: 16px;
        margin: 0 16px;
        padding: 9px 0 10px;
    }

    .details-desc dt {
        align-self: start;
        margin: 1px 0 0;
    }

    .details-grid {
        margin: 0 16px;
        padding: 9px 0 10px;
    }
}

@media (min-width: 1280px) {
    .details-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        column-gap: 16px;
    }
}

/* The candidate's discard / promote / more buttons sit in the header's corner like Share (their old
   sidebar rule added a divider above them). */
.details-title-actions .candidate-detail-actions {
    gap: 6px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.details-title-actions .candidate-detail-actions .candidate-action-button {
    width: 32px;
    height: 32px;
}

.details-title-actions .candidate-detail-actions .candidate-action-button .rzi {
    font-size: 1.15rem;
}

.details-share {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
}

/* Two lines of description, Show all when blackboxClamp finds more. Line breaks are kept in the text
   only: on the dd, pre-wrap turned the markup's own whitespace into empty lines. */
.details-desc dd {
    white-space: normal;
}

.details-desc-text {
    white-space: pre-wrap;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.details-desc dd.is-expanded .details-desc-text {
    display: block;
    -webkit-line-clamp: unset;
}

.details-desc-more {
    display: none;
    margin-top: 2px;
    padding: 0;
    border: 0;
    background: none;
    font: 500 11px var(--font-mono);
    color: var(--color-primary);
    cursor: pointer;
}

.details-desc-text[data-overflowing] + .details-desc-more,
.details-desc dd.is-expanded .details-desc-more {
    display: inline-block;
}

/* Phone: the title items stack centred, as before the wrapper. */
@media (max-width: 767px) {
    .details-main {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .details-card {
        position: relative;
    }

    .details-disclosure {
        position: absolute;
        top: 10px;
        left: 10px;
    }
}

/* Round 3 I3: the disclosure arrow at the start of the title row folds the header to that row. */
.details-disclosure i {
    transition: transform var(--dur-fast, .15s) ease;
}

.details-disclosure[aria-expanded="true"] i {
    transform: rotate(90deg);
}

.details-disclosure:hover,
.details-disclosure[aria-expanded="false"] {
    color: var(--color-primary);
}

/* ---------- Review toolbar: the event, the preset, the grid, the placements ---------- */
.incident-page.is-review #footage > .section-head {
    margin-bottom: 0;
    gap: 8px 14px;
}

.review-event {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 13px;
    white-space: nowrap;
}

.review-event strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-strong);
}

.review-event small {
    font-size: 10.5px;
    letter-spacing: .04em;
    color: var(--text-dim);
}

.review-event :is(.priority-badge, .status-pill) {
    padding: .12rem .5rem;
    font-size: .72rem;
}

.review-event-time {
    color: var(--text-muted);
}

.review-event-time b {
    color: var(--text-strong);
    font-weight: 500;
}

.review-event-time:hover b {
    color: var(--color-primary);
}

.review-toolbar {
    gap: 6px;
}

.review-grids {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--surface-sunken);
}

.review-grids .review-grid {
    display: grid;
    place-items: center;
    width: 32px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text-dim);
}

.review-grids .review-grid:hover {
    color: var(--text-strong);
}

.review-grid-glyph {
    width: 18px;
    height: 13px;
    fill: currentColor;
}

.review-grids .review-grid.is-selected,
.review-toggle.is-selected,
.review-lane-range .ghost.is-selected {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-color: var(--border-strong);
}

/* ---------- Grid, lane and tray share the footage section's height ---------- */
.incident-page.is-review .camera-layout-shell {
    grid-template-rows: minmax(0, 1fr);
    grid-auto-rows: auto;
}

.review-tray-chip {
    gap: 6px;
    align-items: center;
}

.review-tray-chip i {
    font-size: 11px;
    color: var(--text-dim);
}

.review-tray-chip.is-data i {
    color: inherit;
}

.review-tray-chip.is-data {
    border-style: dashed;
    border-color: var(--border-strong);
    color: var(--color-primary);
}

/* ---------- Round 3 K1: the bar is the one way to add; zones show while a panel is held ---------- */
/* One row that scrolls sideways, grouped, so a vessel with many charts does not eat the grid. */
/* One row of category dropdowns; the open one lists its panels above the bar to drag from. */
.review-tray-group {
    position: relative;
}

.review-tray-group-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .3rem .6rem;
    font-size: 12px;
}

.review-tray-group-button b {
    min-width: 1.4em;
    padding: 0 .35em;
    border-radius: 999px;
    background: var(--surface-sunken);
    color: var(--text-muted);
    font: 600 10.5px var(--font-mono);
    text-align: center;
}

.review-tray-chevron {
    font-size: 9px;
    color: var(--text-dim);
    transition: transform var(--dur-fast, .15s) ease;
}

.review-tray-group.is-open .review-tray-group-button {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.review-tray-group.is-open .review-tray-chevron {
    transform: rotate(180deg);
}

.review-tray-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: max-content;
    max-width: min(560px, 80vw);
    max-height: 50vh;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border-default);
    border-radius: 12px;
    background: var(--surface-raised);
    box-shadow: var(--shadow-overlay);
}

.review-tray-hint {
    margin-left: auto;
    padding-left: 1rem;
    color: var(--text-dim);
    font-size: 11.5px;
}

/* Anything already placed can come back to the bar. */
html.is-review-dragging:not([data-review-from="chip"]) .review-tray {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

.review-tray.is-drop-target {
    outline: 3px dashed var(--status-warn);
    outline-offset: 2px;
}

.review-float-zone,
.review-lane-drop {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px dashed var(--color-primary);
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    color: var(--color-primary);
    font-size: 12.5px;
    font-weight: 700;
}

.review-float-zone {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(46%, 220px);
    height: min(40%, 120px);
    transform: translate(-50%, -40%);
    background: rgba(4, 16, 26, .72);
    color: #E8F3F4;
    pointer-events: auto;
}

html.is-review-dragging[data-review-places~="Overlay"] .review-float-zone,
html.is-review-dragging[data-review-places~="Lane"] .review-lane-drop {
    display: flex;
}

.review-lane-drop {
    min-height: 36px;
    margin: 10px 0 8px;
}

.review-float-zone.is-drop-target,
.review-lane-drop.is-drop-target {
    border-color: var(--status-warn);
    color: var(--status-warn);
    border-style: solid;
}

/* An empty lane is only its drop row, and only while a chart is held. */
.review-lane.is-empty {
    display: none;
}

html.is-review-dragging[data-review-places~="Lane"] .review-lane.is-empty {
    display: grid;
}

/* Overlays and lane rows drag like tiles. */
.review-overlay.camera-review-grip {
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    place-items: initial;
    opacity: 1;
    cursor: grab;
}

.review-overlay-compass.camera-review-grip {
    width: clamp(110px, 20%, 170px);
}

.review-overlay.is-swap-source,
.review-lane-label.is-swap-source {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.review-lane-label.camera-review-grip {
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    place-items: initial;
    opacity: 1;
    cursor: grab;
    touch-action: none;
}

.review-lane-chart[data-lane-seek] {
    cursor: pointer;
}


.review-scroll {
    height: 100%;
    overflow: auto;
    padding: 4px 2px;
}

/* ---------- Data tiles: the header sits above the content, not over a picture ---------- */
.review-data-tile {
    background: var(--surface-card);
}

.review-data-tile .camera-header {
    position: static;
    flex: none;
    padding: 6px 8px;
    background: none;
    border-bottom: 1px solid var(--border-subtle);
}

.review-data-tile .camera-name {
    color: var(--text-muted);
    font-weight: 600;
}

.review-data-tile .camera-actions .iconbtn {
    background: var(--surface-sunken);
    border-color: var(--border-default);
    color: var(--text-body);
}

.review-data-tile .camera-actions .iconbtn.is-on {
    color: var(--color-primary);
    border-color: var(--border-strong);
}

.review-data-tile .chart-unit {
    align-self: center;
    margin-right: 4px;
    font: 400 10.5px var(--font-mono);
    color: var(--text-dim);
}

.review-tile-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 6px 10px 8px;
    overflow: hidden;
    container-type: inline-size;
}

.camera-panel.is-maximized .review-tile-body {
    overflow: auto;
}

.review-tile-empty {
    margin: auto;
    padding: 12px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-dim);
}

.review-tile-body > .vhf-transcript-stream {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    gap: 6px;
    padding-right: 2px;
}

/* A narrow conversation: time and channel on the left, the message beside them. */
.review-tile-body .vhf-transcript-item {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 2px 10px;
    padding: 6px 8px;
}

.review-tile-body .vhf-transcript-time {
    grid-area: 1 / 1;
}

.review-tile-body .vhf-transcript-channel {
    grid-area: 2 / 1;
    font-size: 10.5px;
}

.review-tile-body .vhf-transcript-language {
    display: none;
}

.review-tile-body .vhf-transcript-message {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.review-tile-body .vhf-transcript-translation,
.review-tile-body .vhf-transcript-original {
    grid-column: 2;
}

/* A chart fills its tile: the 200 px plot stretches (labels and dots are placed in %). */
.review-chart {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}

.review-chart .telemetry-line-shell {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    grid-auto-rows: auto;
    gap: 4px;
    --chart-h: 100%;
}

.review-chart .telemetry-y-axis,
.review-chart .telemetry-line-hover-wrap {
    height: 100%;
    min-height: 0;
}

.telemetry-y-axis {
    height: var(--chart-h, 200px);
}

.telemetry-line-chart {
    height: var(--chart-h, 200px);
}

/* ---------- Compass variants (blackboxCompass draws the same markup for all) ---------- */
/* Compact: HDG and COG left of the dial, SOG and ROT right, the ROT bar under it, no table. */
.compass-rose.is-compact {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 6px 16px;
}

.compass-rose.is-compact .compass-dial-column {
    grid-column: 2;
    grid-row: 1 / span 2;
    height: 100%;
    max-width: none;
    width: auto;
    grid-template-rows: minmax(0, 1fr) auto;
    justify-items: center;
}

.compass-rose.is-compact .compass-rose-dial {
    width: auto;
    height: 100%;
    max-width: 100%;
}

.compass-rose.is-compact .compass-rot {
    width: 100%;
    max-width: 220px;
}

.compass-rose.is-compact :is(.compass-values, .compass-readout) {
    display: contents;
}

.compass-rose.is-compact .compass-readout > div {
    min-width: 0;
    max-width: 150px;
}

.compass-rose.is-compact .compass-readout > div:nth-child(1) { grid-area: 1 / 1; align-self: end; justify-self: end; text-align: right; }
.compass-rose.is-compact .compass-readout > div:nth-child(2) { grid-area: 2 / 1; align-self: start; justify-self: end; text-align: right; }
.compass-rose.is-compact .compass-readout > div:nth-child(3) { grid-area: 1 / 3; align-self: end; justify-self: start; }
.compass-rose.is-compact .compass-readout > div:nth-child(4) { grid-area: 2 / 3; align-self: start; justify-self: start; }

.compass-rose.is-compact .compass-readout > div:nth-child(5),
.compass-rose:is(.is-compact, .is-mini, .is-readouts) .compass-units {
    display: none;
}

/* Mini: the dial alone (an overlay). */
.compass-rose.is-mini {
    display: block;
}

.compass-rose.is-mini :is(.compass-values, .compass-rot) {
    display: none;
}

.compass-rose.is-mini .compass-dial-column {
    max-width: none;
}

/* Readouts: the values in one row (an overlay). */
.compass-rose.is-readouts {
    display: block;
}

.compass-rose.is-readouts :is(.compass-dial-column, .tp-table, .tp-status) {
    display: none;
}

.compass-rose.is-readouts .compass-values {
    display: block;
    max-width: none;
}

.compass-rose.is-readouts .compass-readout {
    display: flex;
    width: auto;
    gap: 0;
}

.compass-rose.is-readouts .compass-readout > div {
    display: grid;
    gap: 0;
    min-width: 86px;
    padding: 0 12px;
    border-left: 1px solid var(--border-default);
}

.compass-rose.is-readouts .compass-readout > div:first-child {
    border-left: 0;
}

.compass-rose.is-readouts .compass-readout > div:nth-child(5),
.compass-rose.is-readouts .compass-readout dd small {
    display: none;
}

/* Overlays on the main camera: dark glass in both themes, over footage. */
.review-overlays {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.review-overlay {
    position: absolute;
    top: 44px;
    border: 1px solid rgba(170, 225, 232, .24);
    border-radius: 12px;
    background: rgba(4, 16, 26, .72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto;
    --text-strong: #E8F3F4;
    --text-muted: #A3BBC1;
    --text-dim: #7A959C;
    --border-default: rgba(170, 225, 232, .24);
    --surface-raised: #102A38;
    --blackbox-chart-surface: rgba(4, 16, 26, .35);
    --blackbox-chart-surface-border: rgba(120, 190, 200, .16);
    --blackbox-chart-axis: rgba(120, 190, 200, .22);
    --blackbox-chart-tick-label: #A3BBC1;
    --blackbox-chart-heading: #2ED3D3;
    --blackbox-chart-cog: #E5A53B;
}

.review-overlay-readouts {
    left: 12px;
    padding: 6px 0;
}

.review-overlay-compass {
    right: 12px;
    width: clamp(110px, 20%, 170px);
    padding: 6px;
}

/* ---------- Chart lane: rows on one time axis above the replay bar ---------- */
.review-lane {
    display: grid;
    gap: 2px;
    padding: 6px 12px 4px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: var(--surface-card);
}

.review-lane-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-lane-title {
    font: 600 10.5px var(--font-mono);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.review-lane-range {
    display: inline-flex;
    gap: 4px;
}

.review-lane-range .ghost {
    padding: 1px 8px;
    font-size: 10.5px;
}

.review-lane-row,
.review-lane-axis {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 160px 22px;
    align-items: center;
    gap: 10px;
}

.review-lane-row {
    height: 30px;
}

.review-lane-label {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.review-lane-chart {
    display: block;
    width: 100%;
    height: 28px;
    overflow: hidden;
    border-bottom: 1px solid var(--blackbox-chart-grid);
}

.review-lane-cursor {
    stroke: var(--color-primary);
    stroke-width: 1.5;
    pointer-events: none;   /* the segment under it keeps its hover */
}

.review-lane-value {
    font: 600 12px var(--font-mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.review-lane-axis {
    font: 500 10px var(--font-mono);
    color: var(--text-dim);
}

.review-lane-axis > span:first-child {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
}

.review-lane-axis > strong {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    color: var(--color-primary);
    font-weight: 600;
}

.review-lane-axis > span:last-child {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
}

/* ---------- Now speaking on desktop: a compact card centred above the replay bar ---------- */
/* Its toggle (and the phone's events button) reads as on: filled like a selected chip. */
.timeline-controls button.timeline-events-near.is-open {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

@media (min-width: 768px) {
    .timeline-now-speaking {
        left: 50%;
        right: auto;
        width: min(440px, 90vw);
        transform: translateX(-50%);
    }

    .timeline-now-speaking:has(.now-speaking.is-idle) {
        width: max-content;
        max-width: min(440px, 90vw);
    }

    .timeline-now-speaking .now-speaking.is-idle .now-speaking-text {
        display: none;
    }

    .timeline-now-speaking:has(.now-speaking.is-done) {
        display: none;
    }
}

/* "more…" over the end of the second caption line, only while the clamp hides text; "less" under the full caption. */
.now-speaking-more {
    display: none;
    position: absolute;
    right: .7rem;
    bottom: .6rem;
    padding-left: 1.6em;
    background: linear-gradient(to right, transparent, var(--surface-raised) 1.4em);
    color: var(--color-primary);
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
}

/* While expanded, "less" stays for every clip, also a short one that would not overflow. */
.now-speaking-text[data-overflowing] + .now-speaking-more,
.now-speaking.is-expanded .now-speaking-more {
    display: inline;
}

.now-speaking.is-expanded .now-speaking-text {
    display: block;
    max-height: 40vh;
    overflow-y: auto;
    padding-bottom: 1.35em;
}

}

@layer components {
/* ---------- Commands & notifications (propulsion:commands, CommandLanesPanel) ----------
   The status lanes' look: on = the manual hue, a command not followed = amber hatching, markers above the
   bar, notification strips by type. Hover or focus a marker or strip for its tooltip. */
.cmd-lanes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cmd-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 2px 0 6px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Propulsion: the range buttons, the start/stop lanes and the unit cards each get their own room. */
.propulsion-head + .cmd-lanes {
    margin-top: 14px;
}

.cmd-lanes + .chartgrid {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.cmd-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cmd-legend i {
    width: 16px;
    height: 9px;
    border-radius: 2px;
    box-sizing: border-box;
}

.cmd-legend i.is-mark {
    width: 0;
    height: 0;
    border-radius: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid var(--bb-status-manual);
}

.cmd-legend i.is-on,
.cmd-span.is-on {
    background: color-mix(in srgb, var(--bb-status-manual) 60%, var(--surface-card));
    box-shadow: inset 0 0 0 1px var(--bb-status-manual);
}

.cmd-legend i.is-off,
.cmd-span.is-off {
    background: color-mix(in srgb, var(--text-dim) 28%, var(--surface-card));
}

/* The bare track is time the vessel reported no state: dashed, so it never reads as off. */
.cmd-legend i.is-none,
.cmd-track .lane-bar {
    background: transparent;
    border: 1px dashed var(--border-default);
    box-sizing: border-box;
}

.cmd-legend i.is-miss,
.cmd-span.is-miss {
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bb-status-p1) 45%, transparent) 0 4px, transparent 4px 8px);
    box-shadow: inset 0 0 0 1px var(--bb-status-p1);
}

.cmd-legend i.is-A,
.cmd-strip.is-A .cmd-strip-fill {
    background: color-mix(in srgb, var(--bb-status-alert) 55%, var(--surface-card));
    border: 1px solid var(--bb-status-alert);
}

.cmd-legend i.is-W,
.cmd-strip.is-W .cmd-strip-fill {
    background: color-mix(in srgb, var(--bb-status-p1) 45%, var(--surface-card));
    border: 1px solid var(--bb-status-p1);
}

.cmd-legend i.is-E,
.cmd-strip.is-E .cmd-strip-fill {
    background: color-mix(in srgb, var(--bb-status-p4) 45%, var(--surface-card));
    border: 1px solid var(--bb-status-p4);
}

.cmd-legend i.is-I,
.cmd-strip.is-I .cmd-strip-fill {
    background: color-mix(in srgb, var(--bb-status-remote) 40%, var(--surface-card));
    border: 1px solid var(--bb-status-remote);
}

.cmd-group-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}

.cmd-group-title {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-strong);
}

.cmd-group-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.cmd-group-meta.is-warn {
    color: var(--bb-status-p1);
}

.cmd-lane {
    align-items: end;
}

.cmd-lane.is-notes {
    align-items: start;
}

.cmd-lane.is-notes .lane-name {
    line-height: 16px;
}

/* Markers sit in the 13 px above the bar; children ignore the pointer so a click's offset is the track's. */
.cmd-track {
    position: relative;
    padding-top: 13px;
    cursor: crosshair;
}

.cmd-track .lane-bar,
.cmd-track .lane-cursor {
    pointer-events: none;
}

.cmd-span {
    position: absolute;
    top: 0;
    bottom: 0;
    min-width: 2px;
    border-radius: 3px;
}

.cmd-mark {
    position: absolute;
    top: 0;
    display: flex;
    align-items: flex-start;
    gap: 3px;
    margin-left: -5px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--bb-status-manual);
    font: 600 10px/11px var(--font-mono);
    white-space: nowrap;
    cursor: pointer;
    z-index: 2;
}

.cmd-mark::before {
    content: "";
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid currentColor;
}

.cmd-mark.is-warn {
    color: var(--bb-status-p1);
}

.cmd-mark.is-none {
    color: var(--text-muted);
}

.cmd-notes {
    padding-top: 0;
}

.cmd-strip {
    position: absolute;
    height: 16px;
    min-width: 4px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    z-index: 1;
}

.cmd-strip-fill {
    display: block;
    box-sizing: border-box;
    height: 100%;
    padding: 0 5px;
    border-radius: 3px;
    overflow: hidden;
    color: var(--text-strong);
    font: 500 10px/14px var(--font-mono);
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A strip too short for its label carries it beside it, never cut: the page stacks strips so it fits. */
.cmd-strip-label {
    position: absolute;
    top: 0;
    overflow: hidden;
    color: var(--text-strong);
    font: 500 10px/16px var(--font-mono);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cmd-strip.label-after .cmd-strip-label {
    left: calc(100% + 4px);
}

.cmd-strip.label-before .cmd-strip-label {
    right: calc(100% + 4px);
}

.cmd-strip-fill.fade-in {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px);
    mask-image: linear-gradient(90deg, transparent, #000 20px);
}

.cmd-strip-fill.fade-out {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent);
}

.cmd-strip-fill.fade-in.fade-out {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
}

.cmd-mark:hover,
.cmd-mark:focus-visible,
.cmd-strip:hover,
.cmd-strip:focus-visible {
    z-index: 4;
}

.cmd-strip:hover .cmd-strip-fill,
.cmd-strip:focus-visible .cmd-strip-fill {
    box-shadow: 0 0 0 2px var(--text-strong);
}

.cmd-more {
    margin: 2px 0;
    font-size: 12px;
}

.cmd-note {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* The page's body-level tooltip (blackboxFloatTip) for lanes in panels that scroll or clip: the status
   tooltip's look, above every panel, its first line bold. */
.float-tip {
    position: fixed;
    z-index: 2000;
    display: none;
    flex-direction: column;
    gap: 2px;
    max-width: min(420px, calc(100vw - 16px));
    padding: .4rem .6rem;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--rz-chart-tooltip-background);
    color: var(--text-muted);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    font-size: 12px;
    line-height: 1.4;
    pointer-events: none;
}

.float-tip > span:first-child {
    color: var(--text-strong);
    font-weight: 600;
}
}

@layer components {
/* ---------- Review mode: the vessel log's sections and Operational status as lane groups ----------
   One entry in the chart lane: a head row (grip, what stands out, remove), then a thin row per lane. */
/* Groups make the lane tall: it keeps to half the screen and scrolls, so the tiles stay in view. */
.incident-page.is-review .review-lane:not(.is-empty) {
    max-height: 50vh;
    overflow-y: auto;
}

.review-lane-group {
    display: grid;
    gap: 1px;
    padding: 2px 0 4px;
    border-top: 1px solid var(--border-subtle);
}

.review-lane-group-head .review-lane-label {
    color: var(--text-strong);
    font-weight: 600;
}

.review-lane-group-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.review-lane-row.is-sub {
    height: 22px;
}

.review-lane-label.is-sub {
    padding-left: 12px;
    font-size: 11px;
    color: var(--text-dim);
}

.review-lane-chart.is-sub {
    height: 18px;
}

.review-lane-row.is-sub .review-lane-value {
    font-size: 11px;
}

.review-lane-miss {
    fill: color-mix(in srgb, var(--bb-status-p1) 40%, transparent);
}

.review-lane-mark {
    stroke-width: 3;
    pointer-events: stroke;
}

.review-lane-mark.is-ok {
    stroke: var(--bb-status-manual);
}

.review-lane-mark.is-warn {
    stroke: var(--bb-status-p1);
}

.review-lane-mark.is-none {
    stroke: var(--text-muted);
}

.review-lane-note.is-A {
    fill: color-mix(in srgb, var(--bb-status-alert) 70%, var(--surface-card));
}

.review-lane-note.is-E {
    fill: color-mix(in srgb, var(--bb-status-p4) 70%, var(--surface-card));
}

.review-lane-note.is-W {
    fill: color-mix(in srgb, var(--bb-status-p1) 70%, var(--surface-card));
}

.review-lane-note.is-I {
    fill: color-mix(in srgb, var(--bb-status-remote) 70%, var(--surface-card));
}

/* Lanes in a narrow review tile: a narrower name column leaves the bars room, and the axis never makes the
   tile wider than it is (its middle time goes first). */
@container (max-width: 480px) {
    .review-tile-body .lane {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 8px;
    }

    .review-tile-body .lane-name {
        font-size: 10px;
        letter-spacing: .04em;
    }
}

@container (max-width: 360px) {
    .review-tile-body .lane-axis .telemetry-axis strong {
        display: none;
    }
}

.review-tile-body .lane-axis .telemetry-axis {
    min-width: 0;
    overflow: hidden;
}

/* While a chip is held (tapped or dragged), its open list fades and lets clicks through, so the chart
   lane's drop row under it can be seen and hit. */
html.is-review-dragging .review-tray-menu {
    opacity: .2;
    pointer-events: none;
}
}

@layer components {
/* ---------- Compass: the lights and system functions on at the cursor (pick C1) ----------
   A strip of chips under the dial and readouts: lights, then functions, then in amber a command that has
   not followed. The review readouts overlay and the small compass tile get it as one line. */
.compass-switches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.compass-switches-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.compass-switches-group + .compass-switches-group {
    padding-left: 12px;
    border-left: 1px solid var(--border-default);
}

.compass-switches-label {
    margin-right: 2px;
    font: 500 10.5px var(--font-mono);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.compass-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 9px;
    border: 1px solid color-mix(in srgb, var(--bb-status-manual) 40%, transparent);
    border-radius: 11px;
    background: color-mix(in srgb, var(--bb-status-manual) 9%, transparent);
    color: var(--text-strong);
    font-size: 11.5px;
    white-space: nowrap;
    cursor: default;
}

.compass-chip.is-warn {
    border-color: color-mix(in srgb, var(--bb-status-p1) 60%, transparent);
    background: color-mix(in srgb, var(--bb-status-p1) 10%, transparent);
    color: var(--bb-status-p1);
}

.compass-chip-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bb-status-manual);
    box-shadow: 0 0 6px color-mix(in srgb, var(--bb-status-manual) 70%, transparent);
}

.compass-chip-dot.is-warn {
    box-sizing: border-box;
    width: 7px;
    height: 7px;
    border: 1.5px solid var(--bb-status-p1);
    background: transparent;
    box-shadow: none;
}

.compass-switches-none {
    font-size: 12px;
    color: var(--text-muted);
}

.compass-switch-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px 0;
    font: 600 12px var(--font-mono);
    color: var(--text-strong);
    white-space: nowrap;
}

.review-overlay-readouts .compass-switch-line {
    padding: 0 12px;
    border-left: 1px solid var(--border-default);
    font-size: 13px;
}
}

@layer responsive {
/* In the readouts overlay the compass line is one more cell after ROT: the overlay grip rule (this layer)
   makes overlays blocks. */
.review-overlay.review-overlay-readouts.camera-review-grip {
    display: flex;
    align-items: center;
}
}
