/* === DESIGN TOKENS === */
:root {
    /* Colors */
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-secondary: #6b7280;
    --color-secondary-hover: #4b5563;
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-purple: #8b5cf6;
    --color-purple-hover: #7c3aed;
    --color-cyan: #0891b2;
    --color-cyan-hover: #0e7490;

    /* Backgrounds */
    --bg-dark: #1f2937;
    --bg-darker: #111827;
    --bg-light: #f3f4f6;
    --bg-white: #ffffff;
    --bg-sidebar: #ffffff;

    /* Text */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-light: #f9fafb;

    /* Borders */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;

    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Sidebar */
    --sidebar-width: 380px;
    --sidebar-z-index: 2000;

    /* Mobile-specific (T001) */
    --touch-target-min: 44px;
    --mobile-breakpoint: 768px;
    --mobile-small-breakpoint: 480px;
    --mobile-padding: var(--space-sm);
}

/* T002: Base touch-action for better mobile interactions */
button,
a,
select,
input[type="checkbox"],
input[type="range"],
.clickable-cell,
.filter-tag,
.toggle-switch {
    touch-action: manipulation;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f3f4f6;
    overflow: hidden;
    height: 100vh;
}

html {
    overflow: hidden;
    height: 100vh;
}

#app {
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

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

h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Control bar using design tokens (T024) */
.controls {
    background-color: var(--bg-white);
    padding: var(--space-sm) var(--space-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Button row - keeps all action buttons together */
.button-row {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

/* Hide element but keep space on desktop (prevents layout shift) */
.hidden-keep-space {
    visibility: hidden;
    pointer-events: none;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.controls-spacer {
    flex: 1;
}

/* Active filters summary in header */
.active-filters-summary {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-primary-light, #eff6ff);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

.active-filters-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px 2px 8px;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.filter-tag:hover {
    background: var(--color-primary-dark, #2563eb);
}

.filter-remove {
    background: none;
    border: none;
    color: white;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 2px;
    margin-left: 2px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.filter-remove:hover {
    opacity: 1;
}

/* Highlight animation for filter editing */
.filter-highlight {
    animation: filterPulse 0.5s ease-in-out 2;
    background-color: rgba(59, 130, 246, 0.15) !important;
    border-radius: var(--radius-md);
}

@keyframes filterPulse {
    0%, 100% { background-color: rgba(59, 130, 246, 0.15); }
    50% { background-color: rgba(59, 130, 246, 0.3); }
}

.filter-group label {
    font-weight: 500;
    color: #374151;
}

select {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

/* Buttons using design tokens (T022) */
.refresh-btn {
    padding: var(--space-sm) var(--space-lg);
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-normal), transform var(--transition-fast);
}

.refresh-btn:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.refresh-btn:active {
    transform: translateY(0);
}

/* Legacy buttons - hidden but kept for compatibility */
.weights-btn {
    padding: var(--space-sm) var(--space-lg);
    background-color: var(--color-purple);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-normal);
    display: none; /* Hidden - superseded by unified settings button */
}

.weights-btn:hover {
    background-color: var(--color-purple-hover);
}

/* Legacy filter button - hidden */
.filter-btn {
    padding: var(--space-sm) var(--space-lg);
    background-color: var(--color-cyan);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-normal);
    display: none; /* Hidden - superseded by unified settings button */
}

.filter-btn:hover {
    background-color: var(--color-cyan-hover);
}

.filter-btn.filter-active {
    background-color: var(--color-success);
}

/* Filter Modal */
.filter-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 3000;
    padding-top: 80px;
    overflow-y: auto;
}

.filter-modal {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 95%;
    max-height: calc(100vh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f8fafc;
}

.filter-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1f2937;
}

.filter-modal-actions {
    display: flex;
    gap: 0.5rem;
}

.filter-modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.filter-modal .filter-group {
    display: block;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.filter-modal .filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-modal .filter-group h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.filter-description {
    margin: 0 0 1rem 0;
    font-size: 0.8125rem;
    color: #6b7280;
    font-style: italic;
}

.filter-row {
    margin-bottom: 0.75rem;
}

.filter-row label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: #374151;
}

.filter-value {
    font-weight: 600;
    color: #0891b2;
}

.filter-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #e5e7eb, #0891b2);
    border-radius: 3px;
    outline: none;
}

.filter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0891b2;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f8fafc;
}

.apply-filters-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background-color: #059669;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.apply-filters-btn:hover {
    background-color: #047857;
}

/* Greyed out cells in table */
.cell-greyed-out {
    opacity: 0.4;
    position: relative;
}

.cell-greyed-out::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        rgba(156, 163, 175, 0.2) 3px,
        rgba(156, 163, 175, 0.2) 6px
    );
    pointer-events: none;
}

/* Weight panel */
.weight-panel {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    max-width: 500px;
    width: 90%;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.weight-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.weight-panel-header h3 {
    font-size: 1.125rem;
    color: #1f2937;
    margin: 0;
}

.weight-panel .reset-btn {
    padding: 0.4rem 0.8rem;
    background-color: #6b7280;
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.weight-panel .reset-btn:hover {
    background-color: #4b5563;
}

.weight-panel .close-btn {
    padding: 0.2rem 0.6rem;
    background-color: transparent;
    color: #6b7280;
    border: none;
    border-radius: 0.25rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    line-height: 1;
}

.weight-panel .close-btn:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.weight-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.weight-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.weight-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #374151;
}

.weight-label {
    font-weight: 500;
}

.weight-value {
    font-weight: 600;
    color: #8b5cf6;
    min-width: 45px;
    text-align: right;
}

.panel-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.weight-description {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
    line-height: 1.3;
    font-style: italic;
}

.weight-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e5e7eb, #8b5cf6);
    outline: none;
    cursor: pointer;
}

.weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.weight-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.weight-total {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 2px solid #e5e7eb;
    text-align: center;
}

.weight-total strong {
    font-size: 1.125rem;
    color: #1f2937;
}

.weight-warning {
    display: block;
    margin-top: 0.5rem;
    color: #f59e0b;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Golf Weight Section */
.golf-weight-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #6ee7b7;
    background-color: #ecfdf5;
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
}

.golf-weight-section h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #065f46;
}

.golf-weight-description {
    margin: 0 0 1rem 0;
    font-size: 0.8125rem;
    color: #059669;
    font-style: italic;
}

.golf-slider {
    background: linear-gradient(to right, #d1fae5, #059669) !important;
}

.golf-slider::-webkit-slider-thumb {
    background: #059669 !important;
}

/* Safety Thresholds Section */
.safety-thresholds {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #e5e7eb;
}

.safety-thresholds h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.threshold-description {
    margin: 0 0 1rem 0;
    font-size: 0.8125rem;
    color: #6b7280;
    font-style: italic;
}

.threshold-group {
    margin-bottom: 0.75rem;
}

.threshold-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.threshold-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.threshold-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #dc2626;
    min-width: 80px;
    text-align: right;
}

.threshold-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e5e7eb, #dc2626);
    outline: none;
    cursor: pointer;
}

.threshold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dc2626;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.threshold-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dc2626;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.legend {
    position: absolute;
    top: 70px;
    right: 20px;
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 200px;
}

.legend h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.legend-color {
    width: 30px;
    height: 20px;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
}

.legend-item span:last-child {
    font-size: 0.875rem;
    color: #4b5563;
}

#map {
    flex: 1;
    min-height: 0;
    width: 100%;
}

.loading, .error {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    z-index: 2000;
}

.loading {
    color: #3b82f6;
    font-weight: 500;
}

.error {
    color: #ef4444;
    font-weight: 500;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
}

.leaflet-popup-content {
    margin: 1rem;
    min-width: 380px;
    max-width: 420px;
}

/* Fixed height popup content to prevent popup from resizing */
.leaflet-popup-content .popup-content {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.popup-content h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Clean header layout */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.popup-title {
    flex: 1;
}

.popup-region {
    display: block;
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.popup-score {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    padding: 0.4rem 0.6rem;
    border-radius: 0.375rem;
    min-width: 2.5rem;
    text-align: center;
    margin-right: 1.5rem;
}

.popup-content .region-name {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.popup-content .score-main {
    background-color: #f3f4f6;
    padding: 0.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    text-align: center;
}

.popup-content .score-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #059669;
}

.popup-content .weather-section,
.popup-content .tips-section,
.popup-content .attributes-section {
    margin-bottom: 0.75rem;
}

.popup-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.25rem;
}

.popup-content p {
    margin: 0.25rem 0;
    color: #4b5563;
    font-size: 0.875rem;
}

.detailed-popup .leaflet-popup-content-wrapper {
    padding: 0.5rem;
}

/* Travel tips styling */
.popup-content .tips-section {
    background-color: #fef3c7;
    padding: 0.5rem;
    border-radius: 0.375rem;
    border-left: 3px solid #f59e0b;
}

.popup-content .tip-pro {
    color: #047857;
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.popup-content .tip-con {
    color: #b91c1c;
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.popup-content .tips-section h4 {
    color: #92400e;
    margin-bottom: 0.5rem;
}

/* Safety warning styling */
.popup-content .safety-warning {
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.popup-content .safety-warning.severe {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.popup-content .safety-warning.moderate {
    background-color: #fed7aa;
    border-left: 4px solid #f97316;
    color: #9a3412;
}

.popup-content .safety-warning strong {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

/* Toggle breakdown button */
.toggle-breakdown-btn {
    width: 100%;
    padding: 0.5rem;
    margin: 0.5rem 0;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
}

.toggle-breakdown-btn:hover {
    background-color: #2563eb;
}

.toggle-breakdown-btn:active {
    background-color: #1d4ed8;
}

/* Score breakdown styling */
.popup-content .score-breakdown {
    background-color: #f0f9ff;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border: 1px solid #bfdbfe;
}

.popup-content .score-breakdown h4 {
    color: #1e40af;
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}

.popup-content .breakdown-item {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: white;
    border-radius: 0.25rem;
}

.popup-content .breakdown-item strong {
    color: #1f2937;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.popup-content .sub-items {
    margin-top: 0.25rem;
    margin-left: 0.5rem;
}

.popup-content .sub-items small {
    display: block;
    color: #6b7280;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.popup-content .breakdown-calculation {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px solid #bfdbfe;
    text-align: center;
}

.popup-content .breakdown-calculation strong {
    display: block;
    color: #1e40af;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.popup-content .capped-notice {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #fef3c7;
    border-radius: 0.25rem;
    color: #92400e;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Region selector styling */
.popup-content .region-selector {
    background-color: #f9fafb;
    padding: 0.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
}

.popup-content .region-selector h4 {
    font-size: 0.875rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #374151;
}

.popup-content .region-option {
    padding: 0.4rem 0.6rem;
    margin: 0.25rem 0;
    cursor: pointer;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.popup-content .region-option:hover {
    background-color: #e5e7eb;
}

.popup-content .region-option.active {
    background-color: #3b82f6;
    color: white;
}

.popup-content .region-option.active strong {
    color: white;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    /* Reduce popup width on mobile */
    .leaflet-popup-content-wrapper {
        max-height: calc(100vh - 100px);
        overflow: hidden;
    }

    .leaflet-popup-content {
        margin: 0.75rem;
        min-width: 320px;
        max-width: calc(100vw - 60px);
        max-height: calc(100vh - 140px);
    }

    /* Reduce font sizes slightly */
    .popup-content h3 {
        font-size: 1rem;
    }

    .popup-content .score-value {
        font-size: 1.125rem;
    }

    .popup-content h4 {
        font-size: 0.8125rem;
    }

    .popup-content p {
        font-size: 0.8125rem;
    }

    /* Reduce padding in sections */
    .popup-content .safety-warning {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }

    .popup-content .tips-section {
        padding: 0.4rem;
    }

    .popup-content .score-main {
        padding: 0.4rem;
        margin-bottom: 0.75rem;
    }

    /* Make legend smaller and repositionable */
    .legend {
        top: 100px;
        right: 10px;
        padding: 0.75rem;
        min-width: 160px;
        font-size: 0.875rem;
    }

    .legend h3 {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }

    .legend-item {
        margin-bottom: 0.4rem;
    }

    .legend-color {
        width: 24px;
        height: 16px;
    }

    .legend-item span:last-child {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screens - even more compact */
    .leaflet-popup-content-wrapper {
        max-height: calc(100vh - 80px);
        overflow: hidden;
    }

    .leaflet-popup-content {
        margin: 0.5rem;
        min-width: 200px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 120px);
    }

    .popup-content h3 {
        font-size: 0.9375rem;
    }

    /* Make popup more compact */
    .popup-content .weather-section,
    .popup-content .tips-section,
    .popup-content .attributes-section {
        margin-bottom: 0.5rem;
    }

    .popup-content h4 {
        margin-top: 0.4rem;
        margin-bottom: 0.4rem;
    }
}

/* Pro/Con Travel Tips Styling */
.pro-con-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.75rem;
}

.pro-item,
.con-item {
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.pro-item {
    background-color: #f0fdf4;
    border-left-color: #22c55e;
}

.con-item {
    background-color: #fef2f2;
    border-left-color: #ef4444;
}

.pro-header,
.con-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pro-header .icon {
    font-size: 1.125rem;
}

.con-header .icon {
    font-size: 1.125rem;
}

.pro-header strong {
    color: #16a34a;
    font-size: 0.9375rem;
    font-weight: 600;
}

.con-header strong {
    color: #dc2626;
    font-size: 0.9375rem;
    font-weight: 600;
}

.pro-item p,
.con-item p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
}

.tips-section h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

/* Responsive adjustments for pro/con */
@media (max-width: 768px) {
    .pro-con-container {
        gap: 0.75rem;
    }

    .pro-item,
    .con-item {
        padding: 0.75rem;
    }

    .pro-item p,
    .con-item p {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .pro-con-container {
        gap: 0.625rem;
    }

    .pro-item,
    .con-item {
        padding: 0.625rem;
    }

    .pro-item p,
    .con-item p {
        font-size: 0.75rem;
    }
}

/* Travel Conditions Grid */
.travel-conditions {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.travel-conditions h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #1e293b;
    font-size: 1rem;
}

.conditions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.condition-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: white;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
}

.condition-icon {
    font-size: 1.125rem;
}

.condition-label {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
}

.condition-value {
    font-size: 0.875rem;
    color: #1e293b;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
    min-width: max-content;
}

.conditions-note {
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
    text-align: right;
}

/* Toggle Attributes Button */
.toggle-attributes-btn {
    width: 100%;
    padding: 0.5rem;
    margin: 0.75rem 0 0.5rem 0;
    background-color: #64748b;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
}

.toggle-attributes-btn:hover {
    background-color: #475569;
}

/* Attributes Section */
.attributes-section {
    margin-top: 0.5rem;
    padding: 1rem;
    background-color: #f1f5f9;
    border-radius: 0.375rem;
}

.attribute-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.attribute-item {
    font-size: 0.875rem;
    color: #334155;
    padding: 0.5rem;
    background-color: white;
    border-radius: 0.25rem;
    border: 1px solid #e2e8f0;
}

/* Month Overview Toggle Button */
.toggle-month-overview-btn {
    width: 100%;
    padding: 0.5rem;
    margin: 0.75rem 0 0.5rem 0;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
}

.toggle-month-overview-btn:hover {
    background-color: #2563eb;
}

/* Month Overview Section */
.month-overview-section {
    margin-top: 0.5rem;
    padding: 1rem;
    background-color: #eff6ff;
    border-radius: 0.375rem;
    border: 1px solid #bfdbfe;
}

.best-months-hint {
    margin: 0.75rem 0;
    padding: 0.5rem 0.75rem;
    background-color: #dbeafe;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #1e40af;
    border: 1px solid #93c5fd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.year-overview-toggle {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    cursor: pointer;
    white-space: nowrap;
}

.year-overview-toggle:hover {
    background: #2563eb;
}

.month-score-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.month-score-item {
    text-align: center;
    padding: 0.5rem 0.25rem;
    border-radius: 0.375rem;
    background-color: white;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.month-score-item.current-month {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.month-score-item.score-high {
    background-color: #dcfce7;
}

.month-score-item.score-medium {
    background-color: #fef9c3;
}

.month-score-item.score-low {
    background-color: #fee2e2;
}

.month-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.month-score {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.month-details {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.125rem;
}

/* Month Overview Responsive */
@media (max-width: 480px) {
    .month-score-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .month-score-item {
        padding: 0.375rem 0.125rem;
    }

    .month-label {
        font-size: 0.625rem;
    }

    .month-score {
        font-size: 0.875rem;
    }

    .month-details {
        font-size: 0.625rem;
    }
}

/* Responsive adjustments for grids */
@media (max-width: 768px) {
    .conditions-grid,
    .attribute-grid {
        gap: 0.5rem;
    }

    .condition-item,
    .attribute-item {
        padding: 0.375rem;
        font-size: 0.8125rem;
    }

    .condition-icon {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .conditions-grid {
        grid-template-columns: 1fr;
    }

    .attribute-grid {
        grid-template-columns: 1fr;
    }

    .condition-value {
        font-size: 0.8125rem;
    }
}

/* Star ratings using Font Awesome */
.star-rating {
    display: inline-block;
    white-space: nowrap;
    line-height: 1;
    letter-spacing: -0.1em;
}

.star-rating i {
    color: #f59e0b; /* Gold color for all stars */
    font-size: 0.9rem;
    margin: 0;
}

/* Simplified Tips Section */
.tips-section-simple {
    margin: 1rem 0;
    padding: 0;
}

.recommendation-text {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.summary-text {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #4b5563;
    font-size: 0.9375rem;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.insight-item {
    line-height: 1.6;
    color: #374151;
    font-size: 0.875rem;
}

.insight-item strong {
    color: #1f2937;
    font-weight: 600;
}

/* Simplified Travel Conditions */
.travel-conditions-simple {
    margin: 1rem 0;
    padding: 0;
}

.travel-conditions-simple h4 {
    margin: 0 0 0.75rem 0;
    color: #1f2937;
    font-size: 0.9375rem;
    font-weight: 600;
}

.conditions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.condition-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: #374151;
    font-size: 0.875rem;
}

.condition-row > span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Conditions Table */
.conditions-table {
    width: 100%;
    margin: 0.75rem 0;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.conditions-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.conditions-table tr:last-child td {
    border-bottom: none;
}

.cond-label {
    color: #6b7280;
    white-space: nowrap;
    width: 25%;
}

.cond-value {
    color: #1f2937;
    font-weight: 500;
}

/* Compact Conditions (2 rows) */
.conditions-compact {
    margin: 0.75rem 0;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
}

.cond-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #374151;
    padding: 0.2rem 0;
}

.cond-icon {
    font-size: 0.9rem;
}

.cond-sep {
    color: #9ca3af;
    margin: 0 0.25rem;
}

/* Scores Section */
.toggle-scores-btn {
    background: none;
    border: 1px solid #d1d5db;
    padding: 0.35rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    color: #4b5563;
    margin-top: 0.5rem;
}

.toggle-scores-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.toggle-scores-btn span {
    margin-right: 0.25rem;
}

.scores-section {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
}

.scores-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.scores-table td {
    padding: 0.25rem 0.35rem;
}

.scores-table .scores-header td {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding-top: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.scores-table .score-val {
    font-weight: 600;
    color: #1f2937;
    text-align: right;
    width: 2rem;
}

/* Combined Info Table */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.8rem;
    background: #f8fafc;
    border-radius: 0.375rem;
    overflow: hidden;
}

.info-table td {
    padding: 0.35rem 0.6rem;
}

.info-section-header td {
    background: #e2e8f0;
    font-weight: 600;
    font-size: 0.7rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.3rem 0.6rem;
}

.info-label {
    color: #64748b;
    width: 5rem;
}

.info-value {
    color: #1f2937;
}

.info-value .star-rating {
    font-size: 0.7rem;
}

/* Info sections with two-column grid */
.info-section {
    background: #f8fafc;
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin: 0.5rem 0;
}

.info-section .info-section-header {
    background: #e2e8f0;
    font-weight: 600;
    font-size: 0.7rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.3rem 0.6rem;
    border-radius: 0.25rem;
    margin-bottom: 0.4rem;
}

.info-grid-2col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.2rem 1rem;
}

.info-grid-2col .info-row { min-width: 0; gap: 8px; }
.info-grid-2col .info-value { text-align: right; }

/* Stack to one column on phones so values are never cut off */
@media (max-width: 520px) {
    .info-grid-2col { grid-template-columns: minmax(0, 1fr); }
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.info-row .info-label {
    color: #64748b;
    flex-shrink: 0;
    white-space: nowrap;
}

.info-row .info-label small {
    font-size: 0.65em;
    color: #94a3b8;
}

.info-row .info-value {
    color: #1f2937;
    text-align: right;
}

/* Show More Section */
.show-more-section {
    margin-top: 0.5rem;
    text-align: center;
}

.show-calc-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.65rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    display: inline-block;
}

.show-calc-btn:hover {
    color: #64748b;
}

/* Calculation Table */
.calc-section {
    background: #f1f5f9;
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.calc-header {
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.calc-table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
}

.calc-table td {
    padding: 0.2rem 0.4rem;
    color: #64748b;
}

.calc-table td:first-child {
    color: #374151;
}

.calc-table td:last-child {
    text-align: right;
    color: #374151;
}

.calc-table .calc-total {
    border-top: 1px solid #cbd5e1;
}

.calc-table .calc-total td {
    padding-top: 0.4rem;
    font-weight: 600;
    color: #1f2937;
}

.calc-table .calc-warning td {
    color: #d97706;
    font-size: 0.7rem;
    padding-top: 0.3rem;
}

/* Clickable month items */
.month-score-item {
    transition: transform 0.15s, box-shadow 0.15s;
}

.month-score-item:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1;
}

/* Compact Tips with Pros/Cons Boxes */
.tips-compact {
    margin: 0.75rem 0;
}

.tips-compact .summary-text {
    font-size: 0.8rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    padding-left: 0.6rem;
    border-left: 3px solid #e2e8f0;
}

.tips-compact .summary-text.border-go {
    border-left-color: #22c55e;
}

.tips-compact .summary-text.border-check {
    border-left-color: #eab308;
}

.tips-compact .summary-text.border-avoid {
    border-left-color: #ef4444;
}

.tips-compact .summary-text.border-neutral {
    border-left-color: #94a3b8;
}

.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.pro-box, .con-box {
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

.pro-box {
    background-color: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.con-box {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.pro-box strong, .con-box strong {
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

/* Info tooltip for golf score breakdown */
.info-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.25rem;
}

.info-icon {
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.info-icon:hover {
    opacity: 1;
}

.info-tooltip {
    display: none !important;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

.info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

/* Show tooltip on hover (desktop) */
.info-tooltip-wrapper:hover .info-tooltip {
    display: block !important;
}

/* Show tooltip on focus/click (mobile) */
.info-tooltip-wrapper:focus-within .info-tooltip,
.info-tooltip-wrapper.active .info-tooltip {
    display: block !important;
}

/* === TABLE VIEW STYLES (T017, T018) === */

/* View toggle - segmented control */
.view-toggle {
    display: inline-flex;
    background-color: #1f2937;
    border-radius: var(--radius-md);
    padding: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    height: 32px;
}

.view-btn {
    padding: 0 0.625rem;
    background-color: transparent;
    color: #9ca3af;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.8125rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
    height: 26px;
    min-width: 60px;
}

.view-btn:hover:not(.active) {
    color: #e5e7eb;
    background-color: rgba(255, 255, 255, 0.1);
}

.view-btn.active {
    background-color: var(--color-success);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Column selector */
.column-selector {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #f3f4f6;
    border-radius: 0.375rem;
}

.column-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.column-toggle input[type="checkbox"] {
    width: 0.875rem;
    height: 0.875rem;
}

.column-toggle input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Table container */
.table-container {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    height: calc(100% - 60px); /* Account for table controls bar */
}

.table-loading,
.table-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 1.125rem;
    color: #6b7280;
}

/* Destination table */
.destination-table {
    width: max-content;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.8125rem;
}

/* Fixed header (FR-013) */
.destination-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #1f2937;
}

/* Fixed first column (FR-014) */
.destination-table th.destination-header,
.destination-table td.destination-cell,
.destination-table td.single-region-cell,
.destination-table td.country-header-cell {
    position: sticky;
    left: 0;
    z-index: 10;
}

.destination-table th.destination-header {
    background-color: #1f2937;
    color: white;
    width: 180px;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 500;
}

.destination-table td.destination-cell {
    z-index: 5;
    background-color: #374151;
    color: #f9fafb;
    width: 180px;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 400;
}

/* Cover gap with pseudo-element extending right */
.destination-table th.destination-header::after,
.destination-table td.destination-cell::after,
.destination-table td.single-region-cell::after,
.destination-table td.country-header-cell::after {
    content: '';
    position: absolute;
    top: 0;
    right: -6px;
    bottom: 0;
    width: 6px;
    background-color: inherit;
}

/* Month header row */
.month-header-row th {
    background-color: #1f2937;
    color: white;
    padding: 0.5rem 0.25rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: none;
    box-shadow: inset 0 -1px 0 #4b5563, 0 2px 0 #1f2937;
}

.month-header {
    border-left: 2px solid #4b5563;
}

/* Score type header row */
.score-type-header-row th {
    background-color: #1f2937;
    color: #d1d5db;
    padding: 0.375rem 0.25rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.6875rem;
    cursor: pointer;
    transition: background-color 0.15s;
    white-space: nowrap;
    box-shadow: 0 -2px 0 #1f2937, 0 2px 0 #1f2937;
}

.score-type-header-row th:hover {
    background-color: #374151;
    box-shadow: 0 -2px 0 #374151, 0 2px 0 #374151;
}

.score-type-header-row th.sorted {
    background-color: #4b5563;
    color: #fbbf24;
    box-shadow: 0 -2px 0 #4b5563, 0 2px 0 #4b5563;
}

/* Score cells with color coding (T018) */
.score-cell {
    padding: 0.375rem 0.25rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.75rem;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    width: 48px;
    transition: transform 0.1s;
}

.score-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
    position: relative;
}

/* Weather cells with temperature display */
.weather-cell .score-value {
    display: block;
}

.weather-cell .temp-display {
    display: block;
    font-size: 0.6rem;
    font-weight: 400;
    opacity: 0.8;
    line-height: 1;
}

/* Subtle alternating row backgrounds */
.destination-table tbody tr.row-even td.destination-cell,
.destination-table tbody tr.row-even td.single-region-cell,
.destination-table tbody tr.row-even td.region-cell {
    background-color: #3d4551 !important;
    border-right: 4px solid #3d4551 !important;
    box-shadow: 4px 0 0 0 #3d4551 !important;
}

.destination-table tbody tr.row-even td.flight-cell,
.destination-table tbody tr.row-even td.region-flight-cell {
    background-color: #3d4551 !important;
}

.destination-table tbody tr.row-odd td.destination-cell,
.destination-table tbody tr.row-odd td.single-region-cell,
.destination-table tbody tr.row-odd td.region-cell {
    background-color: #374151 !important;
    border-right: 4px solid #374151 !important;
    box-shadow: 4px 0 0 0 #374151 !important;
}

.destination-table tbody tr.row-odd td.flight-cell,
.destination-table tbody tr.row-odd td.region-flight-cell {
    background-color: #374151 !important;
}

/* Row hover - subtle highlight on destination cell only */
.destination-table tbody tr:hover td.destination-cell,
.destination-table tbody tr:hover td.single-region-cell,
.destination-table tbody tr:hover td.region-cell,
.destination-table tbody tr:hover td.country-header-cell {
    background-color: #4a5568 !important;
    border-right: 4px solid #4a5568 !important;
    box-shadow: 4px 0 0 0 #4a5568 !important;
}

/* Hovered cell - simple outline */
.destination-table .score-cell:hover {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: -2px;
}

/* Header highlight when cell is hovered */
.destination-table th.header-highlight {
    background-color: #4b5563 !important;
}

/* Responsive table adjustments */
@media (max-width: 768px) {
    .destination-table {
        font-size: 0.75rem;
    }

    .destination-table th.destination-header,
    .destination-table td.destination-cell {
        width: 120px;
        padding: 0.375rem 0.5rem;
    }

    .score-cell {
        width: 36px;
        padding: 0.25rem 0.125rem;
        font-size: 0.6875rem;
    }

    .column-selector {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .controls {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .column-selector {
        justify-content: center;
    }
}

/* Table popup modal */
.table-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 1000;
    padding: 2rem 1rem;
    overflow: hidden;
}

.table-popup-modal {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    position: relative;
}

.table-popup-close {
    position: absolute;
    top: 0.5rem;
    right: 1.25rem; /* Account for scrollbar */
    background: #f3f4f6;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #6b7280;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
}

.table-popup-close:hover {
    background-color: #e5e7eb;
    color: #111827;
}

.table-popup-content {
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.table-popup-content .popup-content {
    font-size: 0.875rem;
}

.table-popup-content .popup-content h3 {
    margin-bottom: 0.25rem;
    padding-right: 2rem;
}

/* Clickable table cells */
.clickable-cell {
    cursor: pointer;
    transition: filter 0.15s ease;
}

.clickable-cell:hover {
    filter: brightness(0.9);
}

.destination-cell {
    cursor: pointer;
}

.destination-cell:hover {
    background-color: #2d3748 !important;
}

/* === UNIFIED SETTINGS SIDEBAR (T003-T005) === */

/* Sidebar overlay backdrop */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--sidebar-z-index) - 1);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.settings-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Sidebar container */
.settings-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-sidebar);
    box-shadow: var(--shadow-xl);
    z-index: var(--sidebar-z-index);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-sidebar.open {
    transform: translateX(0);
}

/* Sidebar header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background-color: var(--bg-dark);
    color: var(--text-light);
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
}

.sidebar-header-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.sidebar-close-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-xs);
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.sidebar-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-reset-btn {
    padding: var(--space-xs) var(--space-sm);
    background-color: var(--color-secondary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.sidebar-reset-btn:hover {
    background-color: var(--color-secondary-hover);
}

/* Sidebar content area */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

/* Help button */
.help-btn {
    padding: 0.375rem 0.5rem;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.help-btn:hover {
    background-color: var(--color-primary);
    color: white;
}

/* Help overlay */
.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.help-modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    max-width: 650px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.help-modal h2 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.help-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.help-close:hover {
    color: var(--text-primary);
}

.help-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.help-section h3,
.help-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.help-section p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.help-section.help-tip {
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-bottom: none;
}

.help-tip strong {
    color: var(--color-primary);
}

/* Score logic collapsible sections */
.score-logic {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.score-logic summary {
    cursor: pointer;
    color: var(--color-primary);
    font-weight: 600;
    padding: 0.25rem 0;
    user-select: none;
}

.score-logic summary:hover {
    text-decoration: underline;
}

.logic-content {
    margin: 0.5rem 0 0 0;
    padding: 0.75rem 1rem;
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.logic-content p {
    margin: 0 0 0.5rem 0;
}

.logic-content p:last-child {
    margin-bottom: 0;
}

.logic-content ul {
    margin: 0.25rem 0 0.5rem 0;
    padding-left: 1.25rem;
}

.logic-content li {
    margin: 0.15rem 0;
    color: var(--text-secondary);
}

.logic-content blockquote {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background-color: #e0f2fe;
    border-radius: var(--radius-sm);
    font-style: italic;
    color: #0369a1;
    border: none;
}

.prompt-label {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem !important;
}

.prompt-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem !important;
}

.profile-section {
    background-color: #fefce8;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid #fef08a;
}

.profile-section .score-logic {
    margin-top: 0;
}

.profile-section blockquote {
    background-color: #fef9c3;
    color: #854d0e;
}

.help-category {
    margin: 1.5rem 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.25rem;
}

.help-category:first-of-type {
    margin-top: 0.5rem;
}

.help-category-desc {
    margin: 0 0 1rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.score-type {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.score-type.absolute {
    background-color: #dbeafe;
    color: #1e40af;
}

.score-type.relative {
    background-color: #fef3c7;
    color: #92400e;
}

/* Show more button for filters */
.show-more-btn {
    width: 100%;
    padding: var(--space-sm);
    margin-top: var(--space-sm);
    background: transparent;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
}

.show-more-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.secondary-filters {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-light);
}

/* Filter month selector */
.filter-month-selector {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.filter-month-selector label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.filter-month-dropdown {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    width: 100%;
}

.filter-month-dropdown:hover {
    border-color: var(--color-primary);
}

.filter-month-dropdown:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Filter presets */
.filter-presets {
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.presets-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.preset-buttons {
    display: flex;
    gap: var(--space-xs);
}

.preset-btn {
    flex: 1;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    white-space: nowrap;
}

.preset-btn:hover {
    border-color: var(--color-primary);
    background-color: rgba(59, 130, 246, 0.05);
}

.preset-btn.active {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: white;
}

/* Budget input */
.budget-input-row {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

.budget-input {
    flex: 1;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 100%;
}

.budget-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.clear-budget-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.clear-budget-btn:hover {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

/* Collapsible sections */
.settings-section {
    margin-bottom: var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background-color: var(--bg-light);
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast);
}

.section-header:hover {
    background-color: #e5e7eb;
}

.section-header h3 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-toggle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    transition: transform var(--transition-fast);
}

.section-header.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-content {
    padding: var(--space-md);
    max-height: 1000px;
    overflow: hidden;
    transition: max-height var(--transition-slow), padding var(--transition-slow);
}

.section-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Weight/filter controls inside sections */
.setting-row {
    margin-bottom: var(--space-md);
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.setting-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.setting-value {
    font-weight: 600;
    color: var(--color-primary);
    min-width: 45px;
    text-align: right;
}

.setting-description {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
    font-style: italic;
}

.setting-subheader {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: var(--space-md);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-light);
}

.setting-subheader:first-of-type {
    margin-top: var(--space-sm);
}

/* Slider styling for settings */
.setting-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--border-light), var(--color-primary));
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-md);
}

.setting-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-md);
}

/* Golf-specific slider */
.setting-slider.golf-slider {
    background: linear-gradient(to right, #d1fae5, var(--color-success));
}

.setting-slider.golf-slider::-webkit-slider-thumb {
    background: var(--color-success);
}

.setting-slider.golf-slider::-moz-range-thumb {
    background: var(--color-success);
}

/* Safety threshold slider */
.setting-slider.safety-slider {
    background: linear-gradient(to right, var(--border-light), var(--color-danger));
}

.setting-slider.safety-slider::-webkit-slider-thumb {
    background: var(--color-danger);
}

.setting-slider.safety-slider::-moz-range-thumb {
    background: var(--color-danger);
}

/* Column visibility toggles */
.column-toggles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.column-toggle-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.column-toggle-item:hover {
    background-color: #e5e7eb;
}

.column-toggle-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.column-toggle-item label {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
    flex: 1;
}

/* Display options in column settings */
.display-options {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
}

.display-option-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
}

.display-option-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.display-option-item label {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
}

/* Weight total display */
.weight-total-display {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 2px solid var(--border-light);
    text-align: center;
}

.weight-total-display strong {
    font-size: var(--font-size-lg);
    color: var(--text-primary);
}

.weight-warning-text {
    display: block;
    margin-top: var(--space-sm);
    color: var(--color-warning);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* Settings and Filters buttons */
.settings-btn,
.filters-btn {
    position: relative;
    padding: 0.375rem 0.625rem;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition-normal), box-shadow var(--transition-normal);
    font-size: 0.8125rem;
    line-height: 1;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.settings-btn i,
.filters-btn i {
    font-size: 0.875rem;
}

.btn-label {
    font-weight: 500;
}

.settings-btn {
    background-color: var(--color-purple);
}

.filters-btn {
    background-color: #2563eb;
}

.settings-btn:hover {
    background-color: var(--color-purple-hover);
}

.filters-btn:hover {
    background-color: #1d4ed8;
}

.settings-btn.active,
.filters-btn.active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.filter-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--color-success);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* Responsive sidebar (T005) */
@media (max-width: 767px) {
    .settings-sidebar {
        width: 100%;
    }

    .settings-overlay.visible {
        display: block;
    }

    .sidebar-content {
        padding: var(--space-sm);
    }

    .column-toggles {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .settings-overlay {
        display: none;
    }
}

/* === TABLE SEARCH AND COLLAPSIBLE GROUPS === */

/* Table controls bar */
.table-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 20;
}

/* Search input wrapper */
.table-search-wrapper {
    position: relative;
    flex: 1;
    max-width: 200px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

.table-search-input {
    width: 100%;
    padding: 0.375rem 0.5rem 0.375rem 1.75rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.table-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.table-search-input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--text-muted);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.search-clear:hover {
    background-color: var(--text-secondary);
}

/* Small toggle switch for table controls */
.toggle-switch-small {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
}

.toggle-switch-small input {
    display: none;
}

.toggle-slider-small {
    position: relative;
    width: 32px;
    height: 18px;
    background-color: #cbd5e1;
    border-radius: 9px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.toggle-slider-small::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.toggle-switch-small input:checked + .toggle-slider-small {
    background-color: var(--color-primary);
}

.toggle-switch-small input:checked + .toggle-slider-small::after {
    transform: translateX(14px);
}

.toggle-label-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    user-select: none;
}

.toggle-switch-small:hover .toggle-label-small {
    color: var(--text-primary);
}

/* Text buttons for expand/collapse */
.text-btn {
    padding: 0.25rem 0.5rem;
    background: none;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.text-btn:hover {
    color: var(--color-primary);
    background-color: var(--bg-light);
}

.text-btn i {
    font-size: 0.625rem;
}

/* Table stats */
.table-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Country header row (expandable multi-region countries) */
.country-header-row {
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.country-header-row:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Single-region country rows (styled same as country headers) */
.single-region-row {
    transition: background-color var(--transition-fast);
}

.single-region-row:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.single-region-cell {
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: #374151 !important;
    border-right: 4px solid #374151 !important;
    box-shadow: 4px 0 0 0 #374151 !important;
}

.country-header-cell {
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: #374151;
    color: white;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 500;
    border-right: 4px solid #374151;
    box-shadow: 4px 0 0 0 #374151;
    min-width: 180px;
    white-space: nowrap;
}

.expand-icon {
    display: inline-block;
    transition: transform var(--transition-fast);
    font-size: 0.625rem;
    color: #9ca3af;
    margin-right: 0.5rem;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

.country-name {
    font-weight: 500;
}

.region-count {
    font-size: var(--font-size-xs);
    color: #9ca3af;
    font-weight: 400;
    margin-left: 0.375rem;
}

/* Country score cells (summary row) */
.country-score-cell {
    font-weight: 500 !important;
}

/* Region rows (indented under expanded countries) */
.region-row {
    background-color: transparent;
}

.region-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.region-cell {
    padding-left: 1.75rem !important;
    font-weight: 400 !important;
    font-size: 0.8125rem;
    color: #d1d5db !important;
}

/* Removed - using .row-even/.row-odd classes instead */

/* Responsive adjustments for table controls */
@media (max-width: 768px) {
    .table-controls {
        flex-wrap: nowrap;
        gap: var(--space-xs);
        padding: var(--space-xs) var(--space-sm);
    }

    .table-search-wrapper {
        flex: 1;
        max-width: none;
        min-width: 80px;
    }

    .table-stats {
        display: none;
    }

    .text-btn {
        padding: 0.25rem 0.375rem;
    }
}

@media (max-width: 480px) {
    .toggle-label-small {
        display: none;
    }

    .text-btn {
        font-size: 0.6875rem;
        padding: 0.25rem;
    }

    .country-header-cell {
        min-width: 140px;
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }

    .region-cell {
        padding-left: 1rem !important;
        font-size: 0.75rem;
    }
}

/* === TOGGLE SWITCH === */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: background-color 0.2s ease;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--color-primary);
}

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

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* === FLIGHT TIME TABLE COLUMN === */
.flight-header {
    background-color: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-weight: 500;
    border-right: 2px solid #4b5563;
    min-width: 80px;
    white-space: nowrap;
    cursor: pointer;
}

.flight-header:hover {
    background-color: #3d4a5c;
}

.flight-header.sorted {
    background-color: #1a202c;
}

.flight-cell {
    background-color: #374151;
    color: #e5e7eb;
    padding: 0.375rem 0.5rem;
    text-align: center;
    font-size: 0.8125rem;
    border-right: 2px solid #4b5563;
    min-width: 80px;
    white-space: nowrap;
}

.flight-transfers {
    font-size: 0.6875rem;
    color: #9ca3af;
}

.country-flight-cell {
    background-color: #374151;
    font-weight: 500;
}

.region-flight-cell {
    /* background inherited from row-even/row-odd */
}

/* === MOBILE-FRIENDLY RESPONSIVE DESIGN (005-mobile-friendly) === */

/* T003/T004: Button touch targets - handled by button-row spacing on mobile */

/* T005: Month dropdown touch target */
.filter-group select {
    min-height: var(--touch-target-min);
    padding: var(--space-sm) var(--space-md);
}

/* T006: Filter tag remove button touch target */
.filter-remove {
    min-width: 24px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

/* T007: Modal/popup close buttons touch targets */
.table-popup-close {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    /* Touch target is 44px via padding, visual size is 32px */
    padding: 6px;
    box-sizing: content-box;
}

/* Ensure popup header has room for close button, score on left */
.table-popup-content .popup-header {
    padding-right: 2.5rem;
    justify-content: flex-start;
}

/* Score badge on left in modal */
.table-popup-content .popup-header .popup-score {
    order: -1;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.table-popup-content .popup-header .popup-title {
    order: 1;
    flex: 0 1 auto;
}

/* T008: Filter checkboxes touch targets */
.filter-checkbox-label,
.column-toggle label {
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    padding: var(--space-xs) 0;
}

.filter-checkbox-label input[type="checkbox"],
.column-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: var(--space-sm);
}

/* ========================================
   PHASE 3: US1 - Map on Mobile (T009-T014)
   ======================================== */

@media (max-width: 768px) {
    /* T009: Control bar vertical stacking on mobile */
    .controls {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-sm) var(--space-md);
        align-items: stretch;
    }

    .controls > * {
        width: 100%;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }

    .filter-group select {
        width: 100%;
    }

    .controls-spacer {
        display: none;
    }

    /* Fully hide elements with this class on mobile */
    .hidden-keep-space {
        display: none !important;
    }

    /* Button row stays together on mobile */
    .button-row {
        display: flex;
        gap: var(--space-xs);
        flex-shrink: 0;
    }

    /* Hide button labels on mobile, icon only */
    .btn-label {
        display: none;
    }

    .settings-btn,
    .filters-btn {
        padding: 0.375rem;
        width: 36px;
        height: 36px;
    }

    .settings-btn i,
    .filters-btn i {
        font-size: 1rem;
    }

    .help-btn {
        width: 36px;
        height: 36px;
    }

    .view-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }

    .view-toggle {
        height: 38px;
    }

    .view-btn {
        height: 32px;
    }

    /* T010: Map fills available space */
    #map {
        flex: 1;
        min-height: 300px;
    }

    .map-container {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    /* T011: Legend positioning on mobile */
    .legend {
        top: auto;
        bottom: 10px;
        right: 10px;
        max-width: 140px;
        font-size: 0.75rem;
        padding: var(--space-sm);
    }

    .legend h3 {
        font-size: 0.75rem;
    }

    /* T012: Leaflet popup sizing - already has styles, enhance */
    .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 40px);
    }

    .leaflet-popup-content {
        max-height: calc(100vh - 160px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* T013: Popup close button touch target */
    .leaflet-popup-close-button {
        width: var(--touch-target-min) !important;
        height: var(--touch-target-min) !important;
        font-size: 24px !important;
        line-height: var(--touch-target-min) !important;
        padding: 0 !important;
        top: 0 !important;
        right: 0 !important;
    }

    /* T014: Popup content scrollable */
    .popup-content {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* ========================================
   PHASE 4: US2 - Settings/Filters (T015-T020)
   ======================================== */

@media (max-width: 767px) {
    /* T015: Settings sidebar full-width (already exists, enhance) */
    .settings-sidebar {
        width: 100%;
        max-width: 100vw;
    }

    /* T017: Larger close button for sidebar */
    .sidebar-header .sidebar-close {
        width: var(--touch-target-min);
        height: var(--touch-target-min);
        min-width: var(--touch-target-min);
        font-size: 1.5rem;
    }

    /* T018: Filter controls no horizontal scroll */
    .filter-section {
        overflow-x: hidden;
    }

    .filter-options {
        flex-wrap: wrap;
    }
}

/* T016: Slider track height for touch (all sizes) */
input[type="range"] {
    height: var(--touch-target-min);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 4px;
    background: var(--border-medium);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-primary);
    margin-top: -8px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: var(--border-medium);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* T019: Touch-action for sliders (already in base rule at top) */

/* ========================================
   PHASE 5: US5 - Detail Modal (T021-T026)
   ======================================== */

@media (max-width: 768px) {
    /* T021: Modal near full-width on mobile */
    .table-popup-modal {
        max-width: calc(100vw - 16px);
        width: calc(100vw - 16px);
        margin: 8px;
        box-sizing: border-box;
    }

    /* T022: Reduce modal padding on mobile */
    .table-popup-content {
        padding: var(--space-sm);
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .table-popup-content .popup-content {
        max-width: 100%;
        overflow-x: hidden;
        word-wrap: break-word;
    }

    .table-popup-overlay {
        padding: 8px;
        align-items: flex-start;
        overflow: hidden;
    }

    /* T026: Modal max-height with safe areas */
    .table-popup-modal {
        max-height: calc(100vh - 40px);
        max-height: calc(100dvh - 40px); /* Dynamic viewport height for mobile */
    }

    /* Close button position on mobile - avoid scrollbar */
    .table-popup-close {
        right: 0.75rem;
        top: 0.75rem;
    }
}

/* T023: Overscroll behavior for modal */
.table-popup-content {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* T024: Year overview grid on small mobile */
@media (max-width: 480px) {
    .month-score-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-xs);
    }

    .month-score-cell {
        padding: var(--space-xs);
        font-size: 0.6875rem;
        min-height: var(--touch-target-min);
    }
}

/* T025: Modal interactive elements touch targets */
.show-calculation-btn,
.expand-year-btn,
.modal-section-toggle {
    min-height: var(--touch-target-min);
    padding: var(--space-sm);
}

/* ========================================
   PHASE 6: US3 - Table Sticky Column (T027-T031)
   ======================================== */

@media (max-width: 768px) {
    /* Prevent any horizontal overflow on mobile */
    body, html, #app {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* T027: Horizontal scroll wrapper for table */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100vw;
        width: 100%;
    }

    /* Sticky thead with solid background - highest z-index */
    .destination-table thead {
        position: sticky;
        top: 0;
        z-index: 30;
    }

    /* All header cells need solid backgrounds */
    .destination-table thead th {
        background-color: #1f2937 !important;
        color: white !important;
    }

    /* Entire thead gets a bottom border to prevent bleed */
    .destination-table thead {
        border-bottom: 3px solid #1f2937;
    }

    /* Score type header row (second/last row) - extra protection */
    .destination-table .score-type-header-row th,
    .destination-table .score-header {
        background-color: #1f2937 !important;
        border-bottom: 3px solid #1f2937;
    }

    /* T028: Sticky destination column (left: 0) */
    .destination-table .destination-cell,
    .destination-table .single-region-cell,
    .destination-table .country-header-cell {
        position: sticky;
        left: 0;
        z-index: 20;
        background-color: #374151 !important;
        color: #f9fafb !important;
        border-right: 4px solid #374151;
        box-shadow: 4px 0 0 0 #374151; /* Extend background to cover subpixel gaps */
    }

    /* Destination HEADER - sticky on BOTH axes (top via thead, left via this) */
    .destination-table th.destination-header {
        position: sticky;
        left: 0;
        z-index: 35; /* Higher than thead (30) since it's the corner */
        background-color: #1f2937 !important;
        color: white !important;
        border-right: 4px solid #1f2937;
        border-bottom: 3px solid #1f2937;
        box-shadow: 4px 0 0 0 #1f2937; /* Extend background to cover subpixel gaps */
    }

    .destination-table tbody tr.row-even .destination-cell,
    .destination-table tbody tr.row-even .single-region-cell,
    .destination-table tbody tr.row-even .country-header-cell {
        background-color: #3d4551 !important;
        border-right: 4px solid #3d4551;
        box-shadow: 4px 0 0 0 #3d4551;
    }

    .destination-table tbody tr.row-odd .destination-cell,
    .destination-table tbody tr.row-odd .single-region-cell,
    .destination-table tbody tr.row-odd .country-header-cell {
        background-color: #374151 !important;
        border-right: 4px solid #374151;
        box-shadow: 4px 0 0 0 #374151;
    }

    /* T029: Cover gap to prevent color bleed */
    .destination-table .destination-header::after {
        content: '';
        position: absolute;
        top: 0;
        right: -8px;
        bottom: 0;
        width: 8px;
        background-color: #1f2937;
        pointer-events: none;
    }

    .destination-table .destination-cell::after,
    .destination-table .single-region-cell::after,
    .destination-table .country-header-cell::after {
        content: '';
        position: absolute;
        top: 0;
        right: -8px;
        bottom: 0;
        width: 8px;
        background-color: #374151;
        pointer-events: none;
    }

    .destination-table tbody tr.row-even .destination-cell::after,
    .destination-table tbody tr.row-even .single-region-cell::after,
    .destination-table tbody tr.row-even .country-header-cell::after {
        background-color: #3d4551;
    }

    .destination-table tbody tr.row-odd .destination-cell::after,
    .destination-table tbody tr.row-odd .single-region-cell::after,
    .destination-table tbody tr.row-odd .country-header-cell::after {
        background-color: #374151;
    }

    /* T030: Score cell touch target - increase size */
    .score-cell {
        min-width: var(--touch-target-min);
        min-height: var(--touch-target-min);
        padding: var(--space-xs);
    }

}

/* ========================================
   PHASE 7: US4 - Month Selector (T032-T034)
   ======================================== */

@media (max-width: 768px) {
    /* T032: Month dropdown full-width */
    .filter-group {
        width: 100%;
    }

    .filter-group select {
        width: 100%;
        font-size: 1rem;
        padding: var(--space-sm) var(--space-md);
    }

    /* T033: Dropdown doesn't get cut off */
    .filter-group {
        position: relative;
        overflow: visible;
    }
}

/* ========================================
   PHASE 8: Edge Cases & Orientation (T035-T039)
   ======================================== */

/* T035: Landscape adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    /* Control bar horizontal in landscape */
    .controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .controls > * {
        width: auto;
    }

    .filter-group {
        flex-direction: row;
        width: auto;
    }

    .filter-group select {
        width: auto;
        min-width: 150px;
    }

    .controls-spacer {
        display: block;
        flex: 1;
    }

    /* T036: Button row in landscape */
    .button-row {
        gap: var(--space-xs);
    }

    /* T037: Height-dependent layout fixes */
    .legend {
        top: 10px;
        bottom: auto;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .popup-content {
        max-height: calc(100vh - 120px);
    }

    .table-popup-modal {
        max-height: calc(100vh - 20px);
    }
}

/* T038: Filter tag wrapping */
@media (max-width: 768px) {
    .active-filters-summary {
        flex-wrap: wrap;
        gap: var(--space-xs);
    }

    .filter-tag {
        margin-bottom: var(--space-xs);
    }
}

/* T039: 320px minimum width support */
@media (max-width: 320px) {
    .controls {
        padding: var(--space-xs);
        gap: var(--space-xs);
    }

    .button-row {
        gap: 2px;
    }

    .settings-btn,
    .filters-btn,
    .help-btn {
        width: 32px;
        height: 32px;
    }

    .settings-btn i,
    .filters-btn i,
    .help-btn i {
        font-size: 0.875rem;
    }

    .view-toggle {
        height: 32px;
    }

    .view-btn {
        padding: 0.25rem 0.375rem;
        font-size: 0.6875rem;
        height: 26px;
        min-width: 50px;
    }

    .legend {
        max-width: 120px;
        font-size: 0.6875rem;
    }

    .leaflet-popup-content {
        min-width: 280px;
        max-width: calc(100vw - 20px);
    }

    .table-popup-modal {
        max-width: calc(100vw - 10px);
        width: calc(100vw - 10px);
    }

    .month-score-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* === LIST FEATURE === */

.filter-list-selector {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color, #374151);
}

.filter-list-selector label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.filter-list-manager {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color, #374151);
}

.list-manager-header label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.list-manager-item {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.list-manager-item:last-child {
    border-bottom: none;
}

/* Destination name wrapper for list toggle */
.destination-name-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.destination-name-text {
    flex: 1;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-toggle-btn {
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.3;
    font-size: 0.85em;
    transition: opacity 0.15s;
    user-select: none;
}

.list-toggle-btn:hover {
    opacity: 0.8;
}

.list-toggle-btn.in-list {
    opacity: 1;
    color: var(--color-primary, #3b82f6);
}

/* List dropdown menu */
.list-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    background: #1f2937;
    border: 1px solid #4b5563;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    min-width: 140px;
    padding: 4px 0;
}

.list-dropdown-item {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.list-dropdown-item:hover {
    background: #374151;
}

.list-check {
    width: 16px;
    text-align: center;
    color: var(--color-primary, #3b82f6);
    font-weight: bold;
}

/* Popup list controls */
.popup-list-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 1rem;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    font-size: 0.85em;
}

.popup-add-to-list-btn {
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    font-size: 0.85em;
}

.popup-add-to-list-btn:hover {
    background: #e5e7eb;
}

.popup-list-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.85em;
}

.popup-list-badge-remove {
    background: none;
    border: none;
    color: #1d4ed8;
    cursor: pointer;
    font-size: 1.1em;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.6;
}

.popup-list-badge-remove:hover {
    opacity: 1;
}

.popup-list-menu {
    position: absolute;
    top: 100%;
    left: 1rem;
    z-index: 20;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    padding: 4px 0;
}

.popup-list-menu-item {
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
}

.popup-list-menu-item:hover {
    background: #f3f4f6;
}

.popup-list-menu-check {
    width: 16px;
    text-align: center;
    color: #2563eb;
    font-weight: bold;
}

/* Detail view: plain-language tags and the safety note */
.tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}
.tag-good { background: #dcfce7; color: #166534; }
.tag-neutral { background: #e2e8f0; color: #334155; }
.tag-warn { background: #fef3c7; color: #92400e; }
.tag-bad { background: #fee2e2; color: #991b1b; }

.safety-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 4px solid #94a3b8;
    background: #f8fafc;
    font-size: 0.9em;
    line-height: 1.45;
}
.safety-note.safety-good { border-left-color: var(--color-success); }
.safety-note.safety-neutral { border-left-color: #94a3b8; }
.safety-note.safety-warn { border-left-color: var(--color-warning); background: #fffbeb; }
.safety-note.safety-bad { border-left-color: var(--color-danger); background: #fef2f2; }
.safety-note-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.safety-note-header small { color: var(--color-secondary); white-space: nowrap; }
.safety-note p { margin: 0; }
.safety-sources { margin-top: 4px; font-size: 0.85em; color: var(--color-secondary); }
.safety-sources a { margin-right: 4px; }

.calc-note { font-size: 0.75rem; color: #64748b; text-align: center; margin: -2px 0 6px; }
.calc-table td small { color: #64748b; font-size: 0.75em; display: block; }
