/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Archivo",-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff; /* #f5f5f5; */
    color: #061a2b; /* #333; */
    line-height: 1.6;
}

.container {
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background-color: #003059;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    flex: 1;
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.version-badge {
    font-size: 0.7rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 0.5rem;
}

header p {
    font-size: 0.9rem;
    color: #bdc3c7;
}

/* Auth Status */
.auth-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.auth-status span {
    color: #bdc3c7;
}

.btn-small {
    padding: 0.25rem 0.6rem !important;
    font-size: 0.6rem !important;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 48, 89, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-modal {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-modal h2 {
    color: #003059;
    margin-bottom: 1rem;
}

.login-modal p {
    color: #666;
    margin-bottom: 2rem;
}

.login-modal .btn-primary {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Search Panel */
.search-panel {
    width: 360px;
    background-color: white;
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.25rem; /* 1.25rem */
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem; /* 0.5rem */
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="date"] {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #7f8c8d;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.2rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #003059; /*#3498db*/
    color: white;
    width: 100%;
/* Search Imagery button */
}

.btn-primary:hover:not(:disabled) {
    background-color: #00213d; /* #2980b9; */
/* Hover over Search Imagery button */
}

.btn-secondary {
    /* This is the Hide Marker button */
    background-color: #ffffff; /* #909dba; /* #95a5a6; */
    color: #061a2b; /* white; */
    border-width: 1px;
    border-style: solid;
    border-color: #00213d;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #e1e2e5; /* #7f8c8d; */
}

/* Status Message */
.status-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    display: none;
}

.status-message.show {
    display: block;
}

.status-message.loading {
    background-color: #e3f2fd;
    color: #1391D1;
    border-left: 4px solid #1391D1; /* #1976d2; */
}

.status-message.error {
    background-color: #ffebee;
    color: #ab231a; /* #c62828; */
    border-left: 4px solid #ab231a; /* #c62828; */
}

.status-message.success {
    background-color: #e8f5e9;
    color: #007578; /* #2e7d32; */
    border-left: 4px solid #007578;
}

.status-message.warning {
    background-color: #fff3e0;
    color: #ba4e00; /* #ef6c00; */
    border-left: 4px solid #ba4e00; /* #ef6c00; */
}

/* Results Panel */
.results-panel {
    margin-top: 1.2rem; /* 1.5rem * - space between the bar and the no imagery found textbox */
    padding-top: 0.8rem; /* 1.5rem - space from the caption to the bar */
    border-top: 1px solid #e0e0e0;
}

.results-panel h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem; /* 1rem; */
    color: #2c3e50;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.results-header h3 {
    margin-bottom: 0;
}

.results-nav {
    display: flex;
    gap: 0.3rem;
}

.btn-nav {
    background: transparent;
    border: 1px solid #bdc3c7;
    color: #2c3e50;
}

.btn-nav:hover:not(:disabled) {
    background: #ecf0f1;
    border-color: #95a5a6;
}

.btn-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* 0.75rem */
}

.result-item {
    padding: 0.3rem; /* 0.5rem */
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.result-item:hover {
    background-color: #e3f2fd;
    border-color: #3498db;
}

.result-item.selected {
    background-color: #e3f2fd;
    border-color: #3498db;
    border-width: 2px;
}

.result-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-platform {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
}

.result-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    background-color: #3498db;
    color: white;
}

.result-details {
    font-size: 0.75rem;
    color: #7f8c8d;
}

.result-details div {
    margin-bottom: 0.25rem;
}

/* Map Panel */
.map-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.map-controls {
    background-color: white;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.map-info {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.tile-counter {
    font-size: 0.85rem;
    color: #006FB4; /* #27ae60; */
    font-weight: 500;
    margin-left: 1rem;
    padding: 0.25rem 0.5rem;
    background-color: #e8f5e9;
    border-radius: 4px;
}

.request-counter {
    font-size: 0.8rem;
    color: #6a7388; /* #7f8c8d; */
    font-weight: 500;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-family: monospace;
}

.zoom-indicator {
    font-size: 0.8rem;
    color: #061a2b; /* #2980b9; */
    font-weight: 600;
    margin-left: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: #ebf5fb;
    border-radius: 4px;
    font-family: monospace;
}

/* Toggle Switch Styles */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 0.5rem;
}

.toggle-switch:first-of-type {
    margin-left: auto;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: background-color 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #30ffd6;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-switch:has(input:disabled) {
    cursor: not-allowed;
}

.toggle-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #061a2b;
}

#map {
    flex: 1;
    background-color: #e0e0e0;
}

/* Leaflet Overrides */

/* Toggle browser-side upscaling - applied when map has .pixelated class */
.pixelated .leaflet-image-layer {
    image-rendering: pixelated;
}

.leaflet-container {
    font-family: inherit;
}

/* Measurement Tool Styles */
.leaflet-draw-toolbar a {
    background-color: white;
    border: 2px solid #3498db;
}

.leaflet-draw-toolbar a:hover {
    background-color: #e3f2fd;
}

.leaflet-draw-actions {
    background-color: white;
}

/* Measurement popup styling */
.leaflet-popup-content {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Measurement shapes */
.leaflet-interactive {
    cursor: crosshair;
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Map-controls navbar buttons (Select Ship, Catalogue, Overlay AIS,
   Search Area, Track Vessel) — match the white/navy scheme of the
   Lookup Ship button (.btn-secondary). Toggle buttons fill navy when
   active so on/off remains visually obvious. */
.btn-ship {
    background-color: #ffffff;
    color: #061a2b;
    border: 1px solid #00213d;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.btn-ship:hover:not(:disabled) {
    background-color: #e1e2e5;
}

.btn-ship.active {
    background-color: #00213d;
    color: #ffffff;
}

.btn-ship.active:hover {
    background-color: #001628;
}

.btn-catalogue {
    background-color: #ffffff;
    color: #061a2b;
    border: 1px solid #00213d;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.btn-catalogue:hover {
    background-color: #e1e2e5;
}

.btn-ais {
    background-color: #ffffff;
    color: #061a2b;
    border: 1px solid #00213d;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.btn-ais:hover:not(:disabled) {
    background-color: #e1e2e5;
}

.btn-ais.active {
    background-color: #00213d;
    color: #ffffff;
}

/* AIS vessel marker icons (scaled SVG ship shapes). */
.ais-vessel-icon {
    cursor: pointer;
    background: transparent;
    border: none;
}

.ais-vessel-icon svg {
    display: block;
    overflow: visible;
}

/* AIS popup */
.ais-popup {
    font-size: 0.8rem;
    min-width: 180px;
}

.ais-popup-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: #061a2b;
}

.ais-popup-row {
    margin: 0.1rem 0;
    color: #333;
}

.ais-popup-time {
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: #888;
    font-style: italic;
}

/* Track button + duration dropdown inside the AIS popup. */
.ais-popup-track-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e8ec;
}

.ais-popup-track-btn {
    background-color: #3778ed;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    flex-shrink: 0;
}

.ais-popup-track-btn:hover:not(:disabled) {
    background-color: #2d65cc;
}

.ais-popup-track-btn:disabled {
    background-color: #aab8cc;
    cursor: wait;
}

.ais-popup-track-btn-stop {
    background-color: #b03030;
}

.ais-popup-track-btn-stop:hover:not(:disabled) {
    background-color: #8e2424;
}

.ais-popup-track-duration {
    padding: 0.3rem 0.4rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.78rem;
    background-color: #fff;
    min-width: 5.5rem;
}

.ais-popup-track-error {
    flex-basis: 100%;
    color: #b03030;
    font-size: 0.72rem;
    margin-top: 0.25rem;
}

.ais-popup-code {
    font-family: monospace;
    color: #888;
    font-size: 0.75rem;
}

/* Ghost-vessel indicator (used in popups and the search-results table). */
.ais-popup-ghost {
    margin-top: 0.4rem;
    padding: 0.15rem 0.4rem;
    background-color: #6a7388;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-radius: 3px;
    text-align: center;
}

/* IMO lookup row + button + inline status (Select Ship modal). */
.imo-lookup-row {
    display: flex;
    gap: 0.4rem;
    align-items: stretch;
}

.imo-lookup-row input {
    flex: 1;
}

.btn-imo-lookup {
    background-color: #3778ed;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0 0.7rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-imo-lookup:hover:not(:disabled) {
    background-color: #2d65cc;
}

.btn-imo-lookup:disabled {
    background-color: #aab8cc;
    cursor: not-allowed;
}

.imo-lookup-status {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: #666;
    min-height: 1em;
}

.imo-lookup-status.found { color: #2a8c3f; }
.imo-lookup-status.not-found { color: #b06a00; }
.imo-lookup-status.error { color: #b03030; }

.ghost-vessel-tag {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.35rem;
    background-color: #6a7388;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 3px;
    vertical-align: middle;
    user-select: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #4ea6ff; /* #2c3e50; */
    color: #061a2b; /* white; */
    border-radius: 8px 8px 0 0;
}

.modal-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.modal-header h2 i {
    margin-right: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #bdc3c7;
}

.modal-body {
    padding: 1.5rem;
}

.ship-preview {
    width: 100%;
    height: 200px;
    background-color: #ecf0f1;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ship-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-row .form-group.full-width {
    flex: 1 0 100%;
}

.modal-body select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
}

.modal-body textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    resize: vertical;
}

.modal-body input[readonly] {
    background-color: #f8f9fa;
    color: #7f8c8d;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.form-error {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #fdeaea;
    border: 1px solid #f5c6c6;
    border-radius: 4px;
    color: #ab231a; /* #c0392b; */
    font-size: 0.9rem;
}

/* Add to Existing Ship Section */
.existing-ship-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.section-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 1rem;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.section-divider span {
    padding: 0 1rem;
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
}

.existing-ship-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #34495e;
}

.existing-ship-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.existing-ship-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.existing-ship-form .form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: #555;
}

.existing-ship-form input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.existing-ship-confirm {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #e8f6e8;
    border-radius: 4px;
    border: 1px solid #c3e6c3;
}

.existing-ship-confirm p {
    margin: 0 0 0.75rem 0;
    color: #3d7500; /* #2d6a2d; */
    font-weight: 500;
}

.existing-ship-confirm.error {
    background-color: #fdeaea;
    border-color: #f5c6c6;
}

.existing-ship-confirm.error p {
    color: #ab231a; /* #c0392b; */
}

/* Catalogue Panel */
.catalogue-panel {
    position: fixed;
    right: -450px;
    top: 0;
    width: 450px;
    height: 100vh;
    background-color: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1500;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.catalogue-panel.show {
    right: 0;
}

.catalogue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #00bbb4; /* #8e44ad; */
    color: #061a2b; /* white; */
}

.catalogue-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.catalogue-header h2 i {
    margin-right: 0.5rem;
}

.catalogue-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.catalogue-close:hover {
    color: #d5b8e8;
}

.catalogue-search {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.catalogue-search input[type="text"] {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.catalogue-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.catalogue-filters select {
    flex: 1 1 45%;
    min-width: 120px;
    padding: 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;
}

.catalogue-filters input {
    flex: 1 1 45%;
    min-width: 80px;
    padding: 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;
}

.catalogue-stats {
    padding: 0.5rem 1.5rem;
    background-color: #f8f9fa;
    font-size: 0.85rem;
    color: #7f8c8d;
    border-bottom: 1px solid #e0e0e0;
}

.catalogue-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.catalogue-empty {
    text-align: center;
    color: #7f8c8d;
    padding: 2rem;
    font-style: italic;
}

/* Ship Card in Catalogue */
.ship-card {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.ship-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #ecf0f1;
    cursor: pointer;
}

.ship-card-header:hover {
    background-color: #e3e7ea;
}

.ship-card-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.ship-card-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    background-color: #3498db;
    color: white;
}

.ship-card-body {
    padding: 1rem;
    display: none;
}

.ship-card.expanded .ship-card-body {
    display: block;
}

.ship-card-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.ship-card-info span {
    color: #7f8c8d;
}

.ship-card-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ship-thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
}

.ship-thumbnail:hover {
    border-color: #3498db;
}

.ship-card-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
}

.btn-edit {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: background-color 0.2s;
}

.btn-edit:hover {
    background-color: #2980b9;
}

/* Imagery overlay - square display */
/* .circular-imagery {
    /* Circular clipping disabled for now to avoid distortion */
/*}

/* Click coordinates display box */
.click-coords-box {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#clickCoordsText {
    font-family: monospace;
    color: #2c3e50;
}

.btn-copy {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.btn-copy:hover {
    color: #2980b9;
}

.btn-copy.copied {
    color: #007573; /* #27ae60; */
}

/* Polygon popup copy/close buttons */
.btn-polygon-copy,
.btn-polygon-close {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    transition: background-color 0.2s, color 0.2s;
    color: #333;
}

.btn-polygon-copy:hover {
    background: #e0e0e0;
    color: #3498db;
}

.btn-polygon-close:hover {
    background: #e0e0e0;
    color: #30ffd6; /* #e74c3c; */
}

/* Marker reposition control */
.reposition-control {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reposition-control label {
    color: #2c3e50;
    font-weight: 500;
    white-space: nowrap;
}

.reposition-control input {
    width: 160px;
    padding: 0.3rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.85rem;
    font-family: monospace;
}

.reposition-control input:focus {
    outline: none;
    border-color: #3498db;
}

.btn-reposition {
    background-color: #3498db;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.btn-reposition:hover {
    background-color: #2980b9;
}

/* Ship Selection Rectangle */
.ship-selection-rectangle {
    border: 3px solid #00bbb4 !important; /* #27ae60 */ 
    background-color: #30ffd6 !important; /* rgba(39, 174, 96, 0.1) */ 
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .search-panel {
        width: 100%;
        max-height: 50vh;
    }

    .map-panel {
        height: 50vh;
    }

    .catalogue-panel {
        width: 100%;
        right: -100%;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .form-row {
        flex-direction: column;
    }
}

/* Image Viewer Modal */
.image-viewer-modal {
    z-index: 2000;
    background-color: transparent;
    pointer-events: none;
}

.image-viewer-modal.show {
    pointer-events: none;
}

.image-viewer-modal .image-viewer-content {
    pointer-events: auto;
}

.image-viewer-content {
    background-color: #1a1a1a;
    border-radius: 8px;
    width: 600px;
    height: 500px;
    min-width: 300px;
    min-height: 250px;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    position: absolute;
    overflow: visible;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.image-viewer-resize {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    cursor: nwse-resize;
    background-color: rgba(80, 80, 80, 0.9);
    border-radius: 4px 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    transition: background-color 0.2s, color 0.2s;
}

.image-viewer-resize:hover {
    background-color: rgba(100, 100, 100, 1);
    color: white;
}

.image-viewer-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.image-viewer-close:hover {
    opacity: 1;
}

.image-viewer-delete {
    position: absolute;
    top: 12px;
    right: 50px;
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0.25rem;
}

.image-viewer-delete:hover {
    opacity: 1;
}

.delete-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 8px;
}

.delete-confirm-box {
    background-color: #2a2a2a;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    text-align: center;
}

.delete-confirm-box p {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.delete-confirm-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.image-viewer-details {
    padding: 1rem 1.5rem;
    background-color: #2a2a2a;
    border-bottom: 1px solid #3a3a3a;
    cursor: move;
}

.image-viewer-details h3 {
    color: white;
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.image-viewer-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #aaa;
}

.image-viewer-info span {
    white-space: nowrap;
}

.image-viewer-notes {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

.image-viewer-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
    min-height: 100px;
}

.image-viewer-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.image-viewer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #2a2a2a;
    border-top: 1px solid #3a3a3a;
}

.btn-zoom {
    background-color: #444;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn-zoom:hover {
    background-color: #555;
}

#zoomLevel,
#rotationLevel {
    color: white;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: center;
}

.controls-divider {
    width: 1px;
    height: 24px;
    background-color: #555;
    margin: 0 0.5rem;
}

/* Ship Selection Confirm Popup */
.ship-selection-confirm-popup .leaflet-popup-content-wrapper {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.3);
}

.ship-selection-confirm-popup .leaflet-popup-content {
    margin: 0;
}

.ship-selection-popup {
    padding: 0.75rem;
    text-align: center;
}

.ship-selection-popup p {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: #555;
}

.btn-confirm-selection,
.btn-cancel-selection {
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin: 0 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: background-color 0.2s;
}

.btn-confirm-selection {
    background-color: #3d7500; /* #27ae60 */
    color: white;
}

.btn-confirm-selection:hover {
    background-color: rgb(27, 128, 68);
}

.btn-cancel-selection {
    background-color: #ab231a; /* #e74c3c; */
    color: white;
}

.btn-cancel-selection:hover {
    background-color: #911e16;
}

/* ============================================================
   Header right side (auth + STAC/WMS counter)
   ============================================================ */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-request-counter {
    font-size: 0.8rem;
    color: #ffffff;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    background-color: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    font-family: monospace;
    white-space: nowrap;
}

/* ============================================================
   Search Positions button
   ============================================================ */
.btn-search-positions {
    background-color: #ffffff;
    color: #061a2b;
    border: 1px solid #00213d;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.btn-search-positions:hover:not(:disabled) {
    background-color: #e1e2e5;
}

.btn-search-positions.active {
    background-color: #00213d;
    color: #ffffff;
}

/* ============================================================
   Stacked toggle switches (compact column layout in map controls)
   ============================================================ */
.toggle-stack {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-left: auto;
}

.toggle-switch-compact {
    gap: 0.35rem;
    font-size: 0.7rem;
}

.toggle-switch-compact .toggle-slider {
    width: 26px;
    height: 14px;
}

.toggle-switch-compact .toggle-slider::before {
    width: 10px;
    height: 10px;
    top: 2px;
    left: 2px;
}

.toggle-switch-compact input:checked + .toggle-slider::before {
    transform: translateX(12px);
}

.toggle-switch-compact .toggle-label {
    font-size: 0.7rem;
}

/* The compact-stack toggles should not pick up the original
   "first-of-type margin-left:auto" rule. */
.toggle-stack .toggle-switch-compact:first-of-type {
    margin-left: 0;
}

/* ============================================================
   Search Positions input modal
   ============================================================ */
.modal-content-narrow {
    max-width: 480px;
}

.modal-help-text {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* ============================================================
   Search Positions results modal
   ============================================================ */
.search-results-summary {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.search-results-list {
    max-height: 60vh;
    overflow-y: auto;
}

.search-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.search-results-table th,
.search-results-table td {
    padding: 0.5rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    /* Allow user to highlight + copy any cell content. */
    user-select: text;
    -webkit-user-select: text;
}

.search-results-table th {
    background-color: #f6f6f6;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.search-results-table td.cell-imo {
    font-family: monospace;
}

.search-results-table td.cell-dwt {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.search-results-empty {
    padding: 1rem 0;
    text-align: center;
    color: #888;
    font-style: italic;
}

/* Drawn search-area rectangle (faded, non-interactive). */
.search-area-rect {
    pointer-events: none;
}

/* ============================================================
   Favorite locations: input row, dropdown, manage modal
   ============================================================ */
.coords-input-row {
    position: relative;
    display: flex;
    gap: 0.4rem;
    align-items: stretch;
}

.coords-input-row input[type="text"] {
    flex: 1;
}

.btn-favorites {
    background-color: #e0a800;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0 0.7rem;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.btn-favorites:hover {
    background-color: #c69200;
}

/* Place-search icon button — opens the place search modal. Uses the same
   blue as the IMO lookup button for visual consistency with other LLI
   utility actions. */
.btn-place-search {
    background-color: #3778ed;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0 0.7rem;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.btn-place-search:hover {
    background-color: #2d65cc;
}

/* Place search modal: name input row, results list, individual rows. */
.place-search-row {
    display: flex;
    gap: 0.4rem;
    align-items: stretch;
}

.place-search-row input {
    flex: 1;
    min-width: 0;
}

/* `.btn-primary` is defined globally as `width: 100%` (for the main
   "Search Imagery" button). Override here so the Search button only
   takes its content width, leaving room for the input. */
.place-search-row .btn-primary {
    width: auto;
    flex-shrink: 0;
}

.place-search-results {
    margin-top: 0.75rem;
    max-height: 50vh;
    overflow-y: auto;
}

.place-search-result {
    display: block;
    width: 100%;
    text-align: left;
    background-color: #fff;
    border: 1px solid #d8dde5;
    border-radius: 4px;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    margin-bottom: 0.4rem;
    transition: background-color 0.15s, border-color 0.15s;
}

.place-search-result:hover {
    background-color: #eef4ff;
    border-color: #3778ed;
}

.place-search-result-name {
    font-weight: 600;
    color: #1f2c3a;
    font-size: 0.9rem;
}

.place-search-result-meta {
    color: #555;
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

.place-search-result-coords {
    color: #888;
    font-size: 0.75rem;
    font-family: monospace, monospace;
    margin-top: 0.15rem;
}

.place-search-empty {
    color: #888;
    font-style: italic;
    padding: 0.75rem 0;
    text-align: center;
    font-size: 0.85rem;
}

.favorites-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 280px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
}

.favorites-dropdown-list {
    padding: 0.25rem 0;
}

.favorites-dropdown-list .favorite-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
}

.favorites-dropdown-list .favorite-item:hover {
    background-color: #eef4ff;
}

.favorites-dropdown-list .favorite-name {
    display: block;
    font-weight: 500;
    color: #1f2c3a;
}

.favorites-dropdown-list .favorite-coords {
    display: block;
    color: #888;
    font-size: 0.75rem;
    margin-top: 0.1rem;
}

.favorites-dropdown-empty {
    padding: 0.75rem;
    color: #888;
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
}

.favorites-manage-link {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: #f7f8fa;
    border: none;
    border-top: 1px solid #e0e0e0;
    text-align: left;
    cursor: pointer;
    font-size: 0.8rem;
    color: #3778ed;
}

.favorites-manage-link:hover {
    background-color: #eef4ff;
}

/* Manage Favorites modal */
.favorites-list {
    margin-bottom: 1rem;
}

.favorites-list-empty {
    color: #888;
    font-style: italic;
    padding: 0.5rem 0;
    margin: 0;
}

.favorite-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.favorite-row:last-child {
    border-bottom: none;
}

.favorite-row-info {
    flex: 1;
    min-width: 0;
}

.favorite-row-name {
    font-weight: 500;
    color: #1f2c3a;
    font-size: 0.9rem;
}

.favorite-row-coords {
    color: #666;
    font-size: 0.75rem;
    margin-top: 0.1rem;
    word-break: break-all;
}

.favorite-row-edit {
    flex: 1;
    min-width: 0;
}

.favorite-row-edit input {
    width: 100%;
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.favorite-row-edit input:last-child {
    margin-bottom: 0;
}

.favorite-row-actions {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.favorite-row-actions button {
    background: none;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 0.3rem 0.55rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: #444;
}

.favorite-row-actions button:hover {
    background-color: #f0f0f0;
}

.favorite-row-actions .favorite-delete-btn:hover {
    background-color: #fde8e8;
    color: #b03030;
    border-color: #e8a8a8;
}

.favorites-add-form {
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
    margin-top: 1rem;
}

.favorites-add-form h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: #2c3e50;
}

/* ============================================================
   Track Vessel: button, modals, on-map panel
   ============================================================ */
.btn-track-vessel {
    background-color: #ffffff;
    color: #061a2b;
    border: 1px solid #00213d;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.btn-track-vessel:hover:not(:disabled) {
    background-color: #e1e2e5;
}

.track-vessel-chooser-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 50vh;
    overflow-y: auto;
}

.track-vessel-candidate {
    display: block;
    width: 100%;
    text-align: left;
    background-color: #fff;
    border: 1px solid #d8dde5;
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.15s, border-color 0.15s;
}

.track-vessel-candidate:hover {
    background-color: #eef4ff;
    border-color: #8e5cd9;
}

.track-vessel-candidate-name {
    font-weight: 600;
    color: #1f2c3a;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.track-vessel-candidate-meta {
    color: #555;
    font-size: 0.78rem;
    margin-bottom: 0.15rem;
}

.track-vessel-candidate-range {
    color: #888;
    font-size: 0.75rem;
}

/* On-map "Tracked Vessels" panel — pinned top-right but shifted left of the
   Leaflet-draw toolbar (which lives at right:10px) so its remove buttons
   aren't hidden behind the draw controls. */
.tracked-vessels-panel {
    position: absolute;
    top: 12px;
    right: 60px;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.96);
    border: 1px solid #d0d6de;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0.6rem;
    min-width: 220px;
    max-width: 280px;
    font-size: 0.8rem;
}

.tracked-vessels-header {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e0e4ea;
    font-size: 0.78rem;
}

.tracked-vessels-header i {
    margin-right: 0.3rem;
    color: #8e5cd9;
}

.tracked-vessel-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
}

.tracked-vessel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.tracked-vessel-label {
    flex: 1;
    color: #1f2c3a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
}

.tracked-vessel-remove {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 2px 5px;
    font-size: 0.75rem;
    border-radius: 3px;
}

.tracked-vessel-remove:hover {
    background-color: #fde8e8;
    color: #b03030;
}

.tracked-vessels-clear {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border: none;
    border-top: 1px solid #e0e4ea;
    background: none;
    color: #3778ed;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: center;
}

.tracked-vessels-clear:hover {
    color: #1f5cd6;
}

.tracked-vessels-warning {
    margin: 0.4rem 0;
    padding: 0.4rem 0.5rem;
    background-color: #fff8e1;
    color: #6b4d00;
    border: 1px solid #ffe0a0;
    border-radius: 4px;
    font-size: 0.72rem;
    line-height: 1.3;
}

.tracked-vessels-warning i {
    color: #b07d00;
    margin-right: 0.3rem;
}

/* AIS Overlay filter panel — pinned top-left of the map (clear of zoom
   controls). Visible only while the AIS overlay is active. Filters are
   applied client-side after the API call, so the user can see all
   vessels and narrow down without re-fetching. */
.ais-filter-panel {
    position: absolute;
    top: 12px;
    left: 60px;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.97);
    border: 1px solid #d0d6de;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0.65rem;
    width: 240px;
    font-size: 0.78rem;
}

.ais-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e0e4ea;
    font-size: 0.78rem;
    cursor: pointer;
    user-select: none;
}

.ais-filter-header-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ais-filter-chevron {
    color: #888;
    font-size: 0.7rem;
    transition: transform 0.15s;
}

/* Collapsed state: keep header visible, hide everything else.
   Chevron rotates to point right to indicate "expand". */
.ais-filter-panel.collapsed .ais-filter-section,
.ais-filter-panel.collapsed .ais-filter-reset-btn {
    display: none;
}

.ais-filter-panel.collapsed .ais-filter-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.ais-filter-panel.collapsed .ais-filter-chevron {
    transform: rotate(-90deg);
}

.ais-filter-header i {
    margin-right: 0.3rem;
    color: #00bbb4;
}

.ais-filter-count {
    font-weight: normal;
    color: #888;
    font-size: 0.72rem;
}

.ais-filter-section {
    margin: 0.55rem 0;
}

.ais-filter-label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
}

.ais-filter-dwt input[type="range"] {
    width: 100%;
    margin: 0.1rem 0;
}

.ais-filter-dwt-label {
    display: block;
    text-align: center;
    color: #2c3e50;
    font-size: 0.72rem;
    font-family: monospace, monospace;
    margin-top: 0.2rem;
}

.ais-filter-type-list {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #e0e4ea;
    border-radius: 4px;
    padding: 0.25rem 0.4rem;
    background-color: #fff;
}

.ais-filter-type-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0;
    font-size: 0.74rem;
    cursor: pointer;
    user-select: none;
    color: #1f2c3a;
}

.ais-filter-type-row input {
    cursor: pointer;
    margin: 0;
}

.ais-filter-reset-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.35rem;
    background-color: #f0f0f0;
    border: 1px solid #d0d6de;
    border-radius: 4px;
    font-size: 0.72rem;
    cursor: pointer;
    color: #444;
}

.ais-filter-reset-btn:hover {
    background-color: #e0e4ea;
}

/* Polyline-on/off toggle inside the Tracked Vessels panel. */
.tracked-vessels-line-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.3rem 0 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e0e4ea;
    font-size: 0.74rem;
    color: #2c3e50;
    cursor: pointer;
    user-select: none;
}

.tracked-vessels-line-toggle input {
    margin: 0;
    cursor: pointer;
}

/* Arrow icon for tracked-vessel positions — kill Leaflet's default DivIcon
   white background/border so only the SVG arrow renders. */
.track-arrow-icon {
    background: transparent !important;
    border: none !important;
}
