/* Full-viewport dispatch dashboard — loaded globally (not scoped) so flex/map fill works. */
.app-shell--fullscreen {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.app-shell--fullscreen > .navbar {
    flex: 0 0 auto;
}

.app-shell--navbar-hidden > .navbar {
    display: none !important;
}

.app-shell--fullscreen > .app-main.app-main--fullscreen {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.app-main-content.app-main-content--fullscreen {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Event setup is a tall form. Scroll the dashboard main pane so bottom actions stay reachable.
   Dispatch keeps overflow:hidden so the map fills the viewport.
   Selectors are more specific than MainLayout scoped overflow:hidden. */
.app-shell--fullscreen:has(.dashboard--setup) > .app-main.app-main--fullscreen {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.app-main-content.app-main-content--fullscreen:has(.dashboard--setup) {
    overflow: visible;
    flex: 0 0 auto;
    min-height: auto;
}

.dashboard {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    gap: 0.5rem;
    padding: 0.5rem;
    box-sizing: border-box;
    overflow: hidden;
}

.dashboard:not(.dashboard--setup) {
    background: var(--brand-light, #F2F2F2);
}

.dashboard--map-expanded {
    padding: 0;
    gap: 0;
}

.dashboard.dashboard--setup {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
}

.dashboard-toolbar {
    flex: 0 0 auto;
}

.dashboard-toolbar-inner {
    padding: 0.35rem 0.75rem 0.75rem;
}

.dashboard-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.dashboard-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.dashboard-event-title {
    font-family: var(--brand-display);
    font-size: clamp(1.75rem, 3.5vw, 3.375rem);
    font-weight: 700;
    margin: 0;
    line-height: 1.15;
    color: var(--brand-dark, #333);
    overflow-wrap: anywhere;
    min-width: 0;
}

.dashboard-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.7rem;
    height: 2rem;
    padding: 0 0.85rem;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.dashboard-status-chip--live {
    background: var(--brand-primary, #B80009);
}

.dashboard-status-chip--recon {
    background: var(--brand-accent, #F26522);
}

.dashboard-status-chip--complete {
    background: var(--brand-secondary, #465362);
}

.dashboard-status-chip--setup {
    background: var(--brand-secondary, #465362);
}

.dashboard-recon-banner {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.375rem;
    padding: 0.5rem 0.85rem;
    background: var(--brand-accent, #F26522);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.dashboard-recon-banner i {
    flex-shrink: 0;
}

.dispatch-request-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 60px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--brand-border, #CCC);
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.dispatch-request-card:hover,
.dispatch-request-card:focus {
    outline: 2px solid var(--brand-primary, #B80009);
    outline-offset: 0;
}

.dispatch-request-card--selected {
    border-color: var(--brand-primary, #B80009);
    box-shadow: inset 3px 0 0 var(--brand-primary, #B80009);
}

.dispatch-request-body {
    flex: 1 1 auto;
    min-width: 0;
}

.dispatch-request-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-dark, #333);
}

.dispatch-request-meta {
    font-size: 13px;
    color: #555;
}

.dispatch-test-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.7rem;
    height: 2rem;
    padding: 0 0.65rem;
    border-radius: 4px;
    background: var(--brand-highlight, #F9DC5C);
    color: var(--brand-dark, #333);
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.dashboard-list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.25rem 0.5rem;
}

.dashboard-list-header-label {
    font-size: 14px;
    color: var(--brand-dark, #333);
}

.dispatch-map-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 9rem;
    min-height: 2.5rem;
    padding: 0.35rem 0.85rem;
    background: #fff;
    color: var(--brand-dark, #333);
    border: 1px solid var(--brand-border, #CCC);
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
}

.dispatch-map-btn:hover,
.dispatch-map-btn:focus {
    opacity: 0.85;
}

.dispatch-map-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dispatch-map-btn--warn {
    background: var(--brand-highlight, #F9DC5C);
}

.dispatch-map-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    padding: 0;
    border: 0;
    background: #fff;
    color: var(--brand-dark, #333);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dispatch-map-expand:hover,
.dispatch-map-expand:focus {
    opacity: 0.85;
}

.dashboard-map-overlay-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.dashboard-map-legend {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    padding: 0.45rem 0.65rem;
    background: #fff;
    border-top: 1px solid var(--brand-border, #CCC);
    font-size: 10px;
    line-height: 1.2;
    color: var(--brand-dark, #333);
}

.dashboard-map-pick {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: #fff;
    border: 1px solid var(--brand-border, #CCC);
    font-size: 14px;
}

.dashboard-banner-complete {
    flex: 0 0 auto;
}

.dashboard-toolbar-logo {
    height: 32px !important;
    width: 32px !important;
    object-fit: contain;
    flex-shrink: 0;
}

.dashboard-toolbar .mud-input-control {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.dashboard-setup-page {
    background: var(--brand-light, #F2F2F2);
    padding: 1.5rem 1rem 2.5rem;
    min-height: 100%;
}

.setup-back-link {
    display: inline-block;
    color: var(--brand-navy, #022550);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.setup-back-link:hover {
    text-decoration: underline;
    color: var(--brand-navy, #022550);
}

.setup-page-title {
    font-family: var(--brand-display);
    font-size: clamp(2rem, 4vw, 4.5rem);
    font-weight: 700;
    margin: 0 0 1.5rem;
    color: var(--brand-dark, #333);
}

.setup-gpx-field {
    border: 1px solid var(--brand-border, #CCC);
    border-radius: 4px;
    padding: 0.75rem;
    background: #fff;
}

.setup-inline-btn {
    min-width: 7.5rem;
    min-height: 2rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
}

.setup-action-btn {
    min-height: 3.1rem;
    width: 100%;
}

.setup-action-hint {
    color: var(--brand-dark, #333);
    font-size: 11px;
}

.dashboard-setup-price-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    width: 100%;
    align-self: start;
    isolation: isolate;
}

.dashboard-setup-fields,
.dashboard-setup-price,
.dashboard-setup-actions {
    background: #fff;
}

.dashboard-setup-price,
.dashboard-setup-actions {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.list-page {
    background: var(--brand-light, #F2F2F2);
    margin: -1.5rem;
    padding: 1.5rem 1.25rem 2.5rem;
    min-height: calc(100vh - 12rem);
}

.list-section-title {
    font-family: var(--brand-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 1.5rem 0 0.75rem;
}

.list-card {
    background: #fff;
}

.list-card-logo {
    height: 69px;
    width: 107px;
    object-fit: contain;
    flex-shrink: 0;
}

.list-card-icon-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.list-icon-btn {
    min-width: 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
}

.mud-button-root.list-icon-btn {
    min-width: 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border-width: 2px;
    background: transparent;
}

.list-icon-btn .mud-button-label {
    margin: 0;
}

.list-icon-btn i {
    font-size: 18px;
    line-height: 1;
}

.list-icon-btn--primary,
.mud-button-root.list-icon-btn--primary {
    color: var(--brand-primary, #B80009);
    border-color: var(--brand-primary, #B80009);
}

.list-icon-btn--navy,
.mud-button-root.list-icon-btn--navy {
    color: #1E3050;
    border-color: #1E3050;
}

.mud-button-root.list-icon-btn--primary:hover,
.mud-button-root.list-icon-btn--navy:hover {
    background: transparent;
    opacity: 0.85;
}

.mud-button-root.list-icon-btn--primary:hover {
    color: var(--brand-primary, #B80009);
    border-color: var(--brand-primary, #B80009);
}

.mud-button-root.list-icon-btn--navy:hover {
    color: #1E3050;
    border-color: #1E3050;
}

.sag-units-toolbar {
    margin-bottom: 1rem;
}

.sag-unit-card {
    background: #fff;
    min-height: 6.8125rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.625rem;
}

.sag-unit-card-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sag-unit-card-copy {
    min-width: 0;
    flex: 1 1 12rem;
}

.sag-unit-card-title {
    font-family: var(--brand-display);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    color: var(--brand-dark, #333);
    overflow-wrap: anywhere;
}

.sag-unit-card-meta {
    font-size: 1rem;
    line-height: 1.4;
    margin: 0.35rem 0 0;
    color: var(--brand-dark, #333);
    overflow-wrap: anywhere;
}

.sag-unit-card-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 1 auto;
    flex-wrap: wrap;
}

.sag-unit-switch {
    margin-inline-end: 0;
}

.sag-unit-icon-btn {
    color: var(--brand-primary, #B80009);
    border-color: var(--brand-primary, #B80009);
}

.sag-unit-icon-btn i {
    font-size: 1.125rem;
}

@media (max-width: 899.98px) {
    .sag-unit-card-inner {
        flex-wrap: wrap;
        align-items: flex-start;
    }
}

.report-stat-card {
    background: #fff;
    min-height: 8rem;
}

.report-stat-value {
    font-family: var(--brand-display);
    font-size: clamp(1.75rem, 3vw, 2.75rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.35rem;
}

.profile-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (min-width: 900px) {
    .profile-layout {
        grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
        max-width: 64rem;
        margin: 0 auto;
    }
}

.profile-card {
    background: #fff;
}

.privacy-page {
    background: #F2F2F2;
    box-sizing: border-box;
    min-height: 100%;
    padding: 61px clamp(1.25rem, 9.7917vw, 188px) 45px;
}

.privacy-page-inner {
    max-width: 1544px;
    margin: 0 auto;
}

.privacy-page-title {
    font-family: var(--brand-display);
    font-size: clamp(2.25rem, 3.75vw, 72px);
    font-weight: 700;
    line-height: 1.14;
    color: #000000;
    margin: 0 0 20px;
}

.privacy-updated {
    font-family: var(--brand-font);
    font-size: 16px;
    line-height: 18px;
    color: var(--brand-dark, #333333);
    margin: 0 0 30px;
}

.privacy-block {
    margin: 0;
}

.privacy-block p {
    font-family: var(--brand-font);
    font-size: 16px;
    line-height: 18px;
    color: var(--brand-dark, #333333);
    margin: 0;
}

.privacy-block p + p {
    margin-top: 18px;
}

.privacy-block .privacy-subhead {
    font-weight: 700;
}

.privacy-block .privacy-subhead + p {
    margin-top: 0;
}

.privacy-section {
    margin: 30px 0 0;
}

.privacy-section-title {
    font-family: var(--brand-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 32px;
    color: #000000;
    margin: 0 0 20px;
}

.privacy-link {
    color: #B80009;
    text-decoration: none;
}

.privacy-link:hover,
.privacy-link:focus {
    color: #B80009;
    text-decoration: underline;
}

.privacy-link--inherit {
    color: inherit;
}

.privacy-link--inherit:hover,
.privacy-link--inherit:focus {
    color: inherit;
}

.page-hero-bleed {
    margin: -1.5rem -1.5rem 0;
}

.dashboard-setup {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
    padding-bottom: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

.dashboard-setup-fields,
.dashboard-setup-price-stack {
    min-width: 0;
}

@media (min-width: 960px) {
    .dashboard-setup {
        grid-template-columns: minmax(0, 3fr) minmax(16rem, 1fr);
    }

    /* Stick the whole right column (price + actions) so the two cards
       cannot slide over each other while the form scrolls. */
    .dashboard-setup-price-stack {
        position: sticky;
        top: 0.5rem;
        z-index: 1;
    }
}

.dashboard-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 32%) minmax(0, 1fr);
    gap: 0.5rem;
}

.dashboard-list,
.dashboard-map {
    min-height: 0;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.12));
    box-sizing: border-box;
}

.dashboard-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.dashboard-detail {
    flex: 0 1 auto;
    max-height: 45%;
    overflow: auto;
}

.dashboard-map-toolbar {
    flex: 0 0 auto;
}

.dashboard-map-frame {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}

/* Leaflet root must fill the frame; absolute avoids % height collapse. */
.dashboard-map-frame > div {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    border-radius: 4px;
    z-index: 0;
}

@media (min-width: 960px) {
    .dashboard-body {
        grid-template-columns: minmax(240px, 1fr) minmax(0, 3fr);
        grid-template-rows: minmax(0, 1fr);
    }
}

.dashboard-body--expanded {
    grid-template-columns: 89px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
}

.dashboard-body--expanded.dashboard-body--expanded-detail {
    grid-template-columns: minmax(200px, 532px) minmax(0, 1fr);
}

.dashboard-body--expanded:not(.dashboard-body--expanded-detail) .dispatch-request-body,
.dashboard-body--expanded:not(.dashboard-body--expanded-detail) .dispatch-test-chip,
.dashboard-body--expanded:not(.dashboard-body--expanded-detail) .dashboard-list-header,
.dashboard-body--expanded:not(.dashboard-body--expanded-detail) .dashboard-detail {
    display: none;
}

.dashboard-body--expanded:not(.dashboard-body--expanded-detail) .dispatch-request-card {
    justify-content: center;
    padding: 0.5rem 0.25rem;
}

/* Event map replay (fullscreen dialog) */
.event-replay-dialog .mud-dialog-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100dvh - 4.5rem);
    padding-top: 0.5rem !important;
    padding-bottom: 0.75rem !important;
}

.event-replay {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    gap: 0.5rem;
}

.event-replay-map {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}

.event-replay-map > div {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    border-radius: 4px;
    z-index: 0;
}

.event-replay-controls {
    flex: 0 0 auto;
}

.event-replay-clock {
    min-width: 10rem;
}

.event-replay-scrubber {
    width: 100%;
}

/* Leaflet pin captions (e.g. replay "show request info") */
.sag-marker.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
}

.sag-marker-stack {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: max-content;
}

.sag-marker-caption {
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
    text-align: center;
    line-height: 1.15;
    max-width: 7.5rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
}

.sag-marker-caption-name {
    font-weight: 700;
    font-size: 11px;
    color: #212529;
    font-family: system-ui, sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sag-marker-caption-type {
    font-size: 9px;
    color: #6c757d;
    font-family: system-ui, sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive YouTube embeds (home / about) */
.sag-youtube-embed {
    width: 100%;
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
}

.sag-youtube-embed-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.sag-youtube-embed-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
