#header {
    width: 100%;
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 20px;
    z-index: 1000;
    box-sizing: border-box;
}

#header nav ul {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: center;  /* vertical centering */
}

#header a {
    color: white;
    margin-right: 20px;
    text-decoration: none;
}

#header a:hover {
    text-decoration: none;
}

#header a.router-link-active {
    color: orange;
    font-weight: bold;
    text-decoration: none;
}


#map {
    width: 100%;
    height: calc(100vh - 60px);
}



.fileItem { cursor: pointer; margin: 10px 0; color: orange; text-decoration: underline; }
.fileItem.active { font-weight: bold; color: orange; }
#waveform { margin-top: 20px; }
#playBtn { margin-top: 10px; }
.transcript {
    white-space: pre-wrap;
    color: #aaa;
    margin: 5px 0 15px 0;
    font-size: 0.9em;
    line-height: 1.4em;
}

.highlight {
    background-color: yellow;
    color: black;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 3px;
}


.trainLog {
    font-size: 0.9em;
    color: lightblue;
}
.trainLog a {
    text-decoration: none;
}

.trainEvent {
    font-size: 0.9em;
    color: #757575;
}

.guessed {
    color: grey;
}

.guessed a {
    color: grey;
    text-decoration: none;
}

.no-link-color a {
    color: white;
    text-decoration: none;
}

.text-no-underline {
    text-decoration: none;
}

.time-to-me-past {
    color: grey;
}

.time-to-me-late {
    color: yellow;
}

.train-map {
    width: 100%;
    height: 100%;        /* dynamic height */
    min-height: 300px;   /* but never shrink below 300 */
}


/* prevent leaflet background flashes */
.train-map,
.train-map .leaflet-container,
.train-map .leaflet-tile-pane {
    background-color: #000 !important;
}


.loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 10px;
    font-size: 1.2rem;
    color: #444;
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid #ccc;
    border-top-color: #5583ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


.train-marker {
    position: relative;
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #fff;
    /*pointer-events: none;*/

    background: rgba(0,0,0,0.75);
    padding: 2px 4px;
    border-radius: 3px;
    margin-right: 4px;
}

.train-marker .label {
    white-space: nowrap;
}

.train-marker .arrow {
    color: #00e1ff; /* cyan heading arrow */
    margin-left: 4px;
}

.train-marker--selected {
    outline: 2px solid #ffd740;
    background: rgba(53, 40, 0, 0.9);
}

.camera-marker-container {
    pointer-events: none;
}

.camera-marker {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
}


.table-disabled {
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}


.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.footer-link:hover {
    color: rgba(255, 255, 255, 1);
    text-decoration: underline;
}

.app-logo {
    height: 28px;
    width: auto;
    padding-left: 12px;
}


/* Brand */
.app-bar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Optional subtle hover feedback */
.app-bar-brand:hover {
    opacity: 0.9;
}

.app-bar-title {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Nav buttons */
.app-bar-btn {
    text-transform: none !important;
    font-weight: 500;
    letter-spacing: 0.02em;
    font-size: 14px;
}

/* Remove active pill only for app bar buttons */
.app-bar-btn.v-btn--active {
    background-color: transparent !important;
}

/* Camera snapshot player responsive sizing */
.player-frame {
    width: 100%;
}

.player-image {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-image-el {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.camera-player-controls .v-btn {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.motion-summary-label {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 2px 8px;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.motion-summary-label--global {
    color: #1976D2;
}

.motion-summary-label--left {
    color: #757575;
}

.motion-summary-label--right {
    color: #E91E63;
}

.motion-summary-label--active {
    font-weight: 700;
    background-color: rgba(255, 193, 7, 0.18);
    border-color: rgba(255, 193, 7, 0.65);
    box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.25);
    transform: translateY(-1px);
    color: #fff;
}

.motion-summary-label--moving {
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Optional: subtle hover */
.app-bar-btn:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.unparsed-alert-btn .v-icon {
    color: #f59e0b;
}

.error-alert-btn .v-icon {
    color: #ef4444;
}

.unfinished-tasks-alert-btn .v-icon {
    color: #38ff00;
}

.unparsed-alert-menu-content {
    padding: 8px;
}

.hbd-source-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hbd-source-icon {
    opacity: 0.95;
}

.hbd-source-label {
    display: inline-block;
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #9e9e9e;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 2px 6px;
}

.camera-table-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.camera-table-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.camera-table-empty {
    padding: 20px 14px;
}

.camera-events-table thead th {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.68);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.camera-events-table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.015);
}

.camera-events-table tbody tr.hover-row:hover {
    background: rgba(59, 130, 246, 0.12);
    transition: background-color 0.15s ease;
}

.camera-events-table td,
.camera-events-table th {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.camera-events-table a {
    color: #93c5fd;
    text-decoration: none;
}

.camera-events-table a:hover {
    color: #bfdbfe;
    text-decoration: underline;
}

.unparsed-popup {
    position: fixed;
    z-index: 2000;
    min-width: 240px;
    max-width: 320px;
    padding: 10px 12px;
    background: #1f1f1f;
    border: 1px solid rgba(245, 158, 11, 0.45);
}

.unparsed-popup-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(245, 158, 11, 0.9);
    margin-bottom: 8px;
}

.unparsed-popup-list {
    display: grid;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.unparsed-popup-row {
    text-align: left;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.unparsed-popup-row:hover {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
}

.unparsed-popup-row:focus-visible {
    outline: 2px solid rgba(245, 158, 11, 0.6);
    outline-offset: 2px;
}

.unparsed-popup-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
}

.unparsed-popup-meta {
    display: flex;
    flex-wrap: wrap;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.unparsed-popup-meta-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.unparsed-popup-source {
    font-weight: 600;
}


.unparsed-popup-axles {
    color: rgba(245, 158, 11, 0.85);
}

.unparsed-popup-phrase {
    flex-basis: 100%;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.7);
}

.unparsed-popup-clear-one {
    margin-left: auto;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.75);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.unparsed-popup-clear-one:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.45);
    color: rgba(255, 255, 255, 0.95);
}

.error-details-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.error-details-grid {
    display: grid;
    gap: 4px 10px;
    font-size: 13px;
}

.error-details-label {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
    margin-right: 6px;
}

.error-details-stack-wrap {
    margin-top: 6px;
}

.error-details-stack {
    margin: 6px 0 0;
    padding: 8px;
    max-height: 260px;
    overflow: auto;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    white-space: pre-wrap;
    font-size: 11px;
    line-height: 1.35;
}

.unparsed-popup-empty {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.unparsed-popup-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}

.unparsed-clear-btn {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(245, 158, 11, 0.9);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.45);
}

.unparsed-clear-btn:hover {
    background: rgba(245, 158, 11, 0.12);
}

.welcome-logo {
    height: 64px;     /* hero-sized, not app-bar sized */
    width: auto;
    opacity: 0.95;
}


.map-fullscreen-main {
    padding: 0 !important;
    margin: 0 !important;
    height: 100vh;
}

.player-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.roi-canvas {
    cursor: crosshair;
    user-select: none;
}

.analysis-result-badge {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
}

.favorite-camera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
}

.favorite-camera-card {
    min-height: 360px;
}

.favorite-image-wrap {
    width: 100%;
    min-height: 220px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    display: block;
}

.favorite-image-empty {
    padding: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
}
