/* ─── ING Brand Colors ─── */
:root {
    --ing-orange: #FF6200;
    --ing-orange-light: #FF9F43;
    --ing-orange-pale: #FFF3E8;
    --ing-navy: #071D49;
    --ing-navy-light: #0A2A5E;
    --ing-white: #FFFFFF;
    --ing-gray-50: #F8F9FA;
    --ing-gray-100: #F0F1F3;
    --ing-gray-200: #E2E4E7;
    --ing-gray-300: #C4C8CE;
    --ing-gray-600: #6B7280;
    --ing-gray-900: #1A1A2E;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.05);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--ing-gray-50);
    color: var(--ing-gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ing-orange); text-decoration: none; }
a:hover { color: var(--ing-orange-light); }

h1 { font-size: 1.75rem; font-weight: 700; color: var(--ing-navy); }
h2 { font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }

.subtitle { color: var(--ing-gray-600); margin-bottom: 1.5rem; }

/* ─── Navigation ─── */
.nav {
    background: var(--ing-white);
    border-bottom: 2px solid var(--ing-gray-100);
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.nav-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.nav-brand:hover { opacity: 1; }
.nav-links {
    display: flex;
    gap: 2px;
    flex: 1;
    justify-content: center;
}
.nav-link {
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    color: var(--ing-gray-600);
    font-weight: 500;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.nav-link:hover {
    background: var(--ing-orange-pale);
    color: var(--ing-orange);
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    padding-left: 0.5rem;
    border-left: 1px solid var(--ing-gray-200);
}
.nav-username {
    font-size: 0.82rem;
    color: var(--ing-gray-500);
    font-weight: 500;
}
.nav-logout {
    font-size: 0.78rem;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    background: var(--ing-navy);
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.12s;
}
.nav-logout:hover {
    background: #0a2a5e;
    color: white;
}

.badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    animation: none;
}
@keyframes pulse {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    background: var(--ing-white);
    color: var(--ing-navy);
    border-color: var(--ing-gray-300);
}
.btn:hover { background: var(--ing-gray-100); }
.btn-primary {
    background: var(--ing-orange);
    color: white;
    border-color: var(--ing-orange);
}
.btn-primary:hover { background: #E55A00; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #FEE2E2; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn.active { background: var(--ing-orange); color: white; border-color: var(--ing-orange); }
.btn-outline { border-color: var(--ing-gray-300); background: transparent; }

/* ─── Main Layout ─── */
.main { max-width: 1400px; margin: 0 auto; padding: 2rem; }

/* ─── Dashboard ─── */
.dashboard-header {
    margin-bottom: 2rem;
}
.header-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.stat-card {
    background: var(--ing-white);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.stat-label { font-size: 0.75rem; color: var(--ing-gray-600); text-transform: uppercase; }
.stat-value { font-size: 1.25rem; font-weight: 700; color: var(--ing-navy); }
.stat-warning .stat-value { color: var(--warning); }

/* Graph Grid */
.graph-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.graph-card {
    background: var(--ing-white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.graph-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--ing-orange);
    transform: translateY(-2px);
}
.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-icon { font-size: 1.5rem; }
.card-title { font-weight: 600; font-size: 0.95rem; color: var(--ing-navy); }
.card-chart { height: 80px; }
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--ing-gray-600);
}
.card-type {
    background: var(--ing-gray-100);
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.65rem;
}

/* ─── Graph Detail ─── */
.detail-header { margin-bottom: 1.5rem; }
.back-link { font-size: 0.9rem; display: inline-block; margin-bottom: 0.5rem; }
.graph-desc {
    background: var(--ing-navy);
    color: rgba(255,255,255,0.9);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-top: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.55;
}
.graph-desc p { margin: 0; }
.graph-use {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--ing-orange-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.wiki-link {
    display: inline-block;
    margin-top: 0.5rem;
    margin-left: 1.25rem;
    font-size: 0.8rem;
    color: var(--ing-white);
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background var(--transition);
}
.wiki-link:hover {
    background: rgba(255,255,255,0.3);
}
.detail-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.period-selector { display: flex; gap: 0.35rem; align-items: center; }
.custom-range { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.month-input {
    padding: 0.35rem 0.5rem;
    border: 2px solid var(--ing-gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--ing-white);
    color: var(--ing-navy);
}
.month-input:focus { outline: none; border-color: var(--ing-orange); }

.chart-container {
    background: var(--ing-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: 400px;
    margin-bottom: 1.5rem;
}
.chart-container.half { height: 350px; flex: 1; min-width: 400px; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.detail-card {
    background: var(--ing-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* ─── Forms ─── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 0.85rem; color: var(--ing-gray-600); }
.form-group input,
.form-group select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 2px solid var(--ing-gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--ing-white);
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--ing-orange);
    box-shadow: 0 0 0 3px var(--ing-orange-pale);
}
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.checkbox-group { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-group input[type="checkbox"] { width: auto; }
.checkbox-group label { margin: 0; }

/* ─── Alerts ─── */
.alert-item, .alert-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--ing-gray-50);
    margin-bottom: 0.5rem;
}
.alert-card.inactive, .alert-item.inactive { opacity: 0.5; }
.alert-actions { display: flex; gap: 0.5rem; align-items: center; }
.threshold-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 0.5rem;
}
.threshold-badge.above { background: #FEE2E2; color: var(--danger); }
.threshold-badge.below { background: #DBEAFE; color: #2563EB; }
.threshold-badge.change_up { background: #FEF3C7; color: #D97706; }
.threshold-badge.change_down { background: #D1FAE5; color: #059669; }
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--ing-gray-300);
}
.status-dot.active { background: var(--success); }

.trigger-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--ing-gray-100);
}
.trigger-icon { font-size: 1.1rem; }
.trigger-value { font-weight: 600; margin-left: auto; margin-right: 1rem; }

.alerts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ─── Compare ─── */
.compare-grid { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 1.5rem; }
.compare-side { flex: 1; background: var(--ing-white); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.compare-vs { font-size: 1.5rem; font-weight: 800; color: var(--ing-orange); }
.compare-results { display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* ─── Auth ─── */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 140px);
}
.auth-card {
    background: var(--ing-white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo h2 { margin-top: 0.75rem; }
.auth-form p { margin-bottom: 1rem; }
.auth-form label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.auth-form input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--ing-gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--ing-orange);
}
.auth-form .helptext {
    font-size: 0.75rem;
    color: var(--ing-gray-600);
    display: block;
    margin-top: 0.25rem;
}
.auth-form .errorlist {
    color: var(--danger);
    font-size: 0.8rem;
    list-style: none;
}
.auth-switch { text-align: center; margin-top: 1rem; font-size: 0.9rem; }

/* ─── Messages ─── */
.messages { margin-bottom: 1.5rem; }
.msg {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.msg-success { background: #D1FAE5; color: #065F46; }
.msg-error { background: #FEE2E2; color: #991B1B; }
.msg-warning { background: #FEF3C7; color: #92400E; }

.empty { color: var(--ing-gray-600); font-style: italic; padding: 1rem 0; }

.recent-alerts {
    background: var(--ing-white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-top: 1rem;
}
.alert-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}
.alert-row strong { color: var(--danger); }

/* ─── Compare Redesign ─── */
.compare-selects { max-width: 500px; margin-bottom: 1rem; }
.compare-periods {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.compare-periods .compare-side {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--ing-white);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.compare-periods .compare-side h3 {
    margin: 0 0.5rem 0 0;
    font-size: 0.85rem;
}
.compare-periods input[type="month"] {
    padding: 0.4rem 0.5rem;
    border: 2px solid var(--ing-gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--ing-white);
}
.compare-legend { text-align: center; margin-top: 0.5rem; font-size: 0.85rem; color: var(--ing-gray-600); }
.dot-a { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--ing-orange); margin-right: 4px; }
.dot-b { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--ing-navy); margin-right: 4px; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .graph-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .detail-grid, .alerts-grid { grid-template-columns: 1fr; }
    .compare-grid { flex-direction: column; }
    .chart-container {
        min-height: 350px !important;
        max-height: 500px;
        padding: 0.5rem;
    }
    .nav { padding: 0 0.75rem; gap: 0.5rem; }
    .nav-links { gap: 0; overflow-x: auto; justify-content: flex-start; }
    .nav-link { padding: 0.35rem 0.5rem; font-size: 0.78rem; }
    .nav-username { display: none; }
    .nav-user { border-left: none; padding-left: 0; }
    .main { padding: 1rem; }
    .detail-controls { flex-direction: column; gap: 0.5rem; }
}

/* Extra small screens — even more compact */
@media (max-width: 480px) {
    .chart-container {
        min-height: 300px !important;
        max-height: 400px;
        padding: 0.25rem;
    }
    .detail-controls { gap: 0.35rem; }
}

/* ─── Compare Redesign ─── */
.compare-selects { max-width: 500px; margin-bottom: 1rem; }
.compare-periods {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.compare-periods .compare-side {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--ing-white);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.compare-periods .compare-side h3 {
    margin: 0 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--ing-navy);
}
.compare-periods input[type="month"] {
    padding: 0.4rem 0.5rem;
    border: 2px solid var(--ing-gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--ing-white);
}
.compare-legend {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--ing-gray-600);
}
.dot-a { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--ing-orange); margin-right: 4px; }
.dot-b { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--ing-navy); margin-right: 4px; }

/* ─── DATA SOURCES PAGE ─── */
.data-sources-page h1 { margin-bottom: 0.25rem; }
.data-sources-page .subtitle { color: var(--ing-gray-600); margin-bottom: 2rem; }

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.source-card {
    background: white;
    border: 1px solid var(--ing-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.source-header { display: flex; align-items: center; gap: 0.5rem; }
.source-header h2 { font-size: 1.1rem; margin: 0; }
.source-icon { font-size: 1.5rem; }
.source-desc {
    font-size: 0.88rem;
    color: var(--ing-gray-700);
    line-height: 1.45;
    flex: 1;
}
.source-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
}
.meta-row { display: flex; gap: 0.25rem; }
.meta-label { color: var(--ing-gray-500); }
.meta-value { color: var(--ing-navy); font-weight: 600; }
.source-graphs { font-size: 0.82rem; }
.source-graphs strong { color: var(--ing-gray-500); margin-right: 0.5rem; }
.graph-tag {
    display: inline-block;
    background: rgba(255,98,0,0.1);
    color: var(--ing-orange);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    margin: 2px 3px;
    text-decoration: none;
}
.graph-tag:hover { background: var(--ing-orange); color: white; }
.source-link {
    font-size: 0.8rem;
    color: var(--ing-blue-700);
    word-break: break-all;
}

/* Scheduler table */
.sources-scheduler-info {
    background: white;
    border: 1px solid var(--ing-border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.sources-scheduler-info h2 { margin-top: 0; }
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}
.schedule-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--ing-navy);
    color: white;
    font-weight: 600;
}
.schedule-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--ing-border);
}
.schedule-table code {
    background: var(--ing-gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ─── DOWNLOAD BAR ─── */
.download-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    background: white;
    border: 1px solid var(--ing-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--ing-gray-600);
}
.download-bar .btn {
    font-size: 0.85rem;
    padding: 6px 14px;
}
.quick-save-input {
    width: 140px;
    padding: 4px 8px;
    font-size: 0.8rem;
    border: 1px solid var(--ing-gray-300);
    border-radius: 4px;
    outline: none;
}
.quick-save-input:focus {
    border-color: var(--ing-orange);
}


/* ─── HTML COLUMN LEGEND ─── */
.custom-legend {
    background: var(--ing-white);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    column-gap: 1.5rem;
    column-rule: 1px solid var(--ing-gray-100);
    overflow: visible;
}

.legend-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 3px 4px;
    margin: 0 -4px;
    cursor: pointer;
    break-inside: avoid;
    font-size: 11px;
    color: var(--ing-gray-900);
    user-select: none;
    border-radius: 3px;
    transition: background 0.05s, opacity 0.2s;
}
.legend-item:hover {
    background: #e8edf3;
}
.legend-item:active {
    background: #d0d8e2;
}

/* JS-driven tooltip bubble */
.legend-tooltip {
    position: fixed;
    background: var(--ing-navy);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 10000;
    pointer-events: none;
    max-width: 600px;
    white-space: normal;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    display: none;
}

.legend-item.hidden {
    opacity: 0.4;
}
.legend-item.hidden .legend-box {
    position: relative;
}
.legend-item.hidden .legend-box::after {
    content: '';
    position: absolute;
    top: 1px; left: 4px;
    width: 1.5px; height: 100%;
    background: #555;
    transform: rotate(45deg);
    transform-origin: center;
}

.legend-box {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.12);
}

.legend-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
    direction: rtl;
    text-align: left;
}

/* ─── Legend toolbar ─── */
.legend-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.legend-toolbar .btn-sm {
    font-size: 10px;
    padding: 2px 8px;
    border: 1px solid var(--ing-gray-300);
    background: var(--ing-white);
    color: var(--ing-gray-700);
    border-radius: 3px;
    cursor: pointer;
    transition: var(--transition);
}
.legend-toolbar .btn-sm:hover {
    background: var(--ing-navy);
    color: var(--ing-white);
    border-color: var(--ing-navy);
}
.legend-search-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.legend-search {
    width: 180px;
    padding: 2px 8px;
    font-size: 10px;
    border: 1px solid var(--ing-gray-300);
    border-radius: 3px;
    background: var(--ing-white);
    color: var(--ing-gray-800);
    outline: none;
    transition: border-color 0.12s;
}
.legend-search:focus {
    border-color: var(--ing-orange);
    box-shadow: 0 0 0 2px var(--ing-orange-pale);
}
.legend-search-btn {
    display: none;
}
.legend-item.filtered-out {
    display: none;
}

/* Mobile: fewer columns */
@media (max-width: 768px) {
    .custom-legend {
        column-count: 2 !important;
        column-gap: 1rem;
        padding: 0.5rem 0.75rem;
    }
    .legend-item { font-size: 10px; gap: 0.3rem; }
    .legend-box { width: 8px; height: 8px; }
}
@media (max-width: 480px) {
    .custom-legend {
        column-count: 1 !important;
    }
}


/* ─── Text blocks in saved views ─── */
.text-block-content {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--ing-gray-800);
    white-space: pre-wrap;
    word-break: break-word;
}
.text-block-content strong, .text-block-content b { font-weight: 700; color: var(--ing-navy); }
.text-block-content em, .text-block-content i { font-style: italic; }
.text-block-content s, .text-block-content del, .text-block-content strike { text-decoration: line-through; color: var(--ing-gray-500); }
.text-block-content a { color: var(--ing-orange); text-decoration: underline; }
.text-block-content ul, .text-block-content ol { padding-left: 1.5rem; margin: 0.5rem 0; }
.text-block-content li { margin-bottom: 0.25rem; }


/* ─── FEATURE REQUEST SECTION ─── */
.feature-request-section {
    margin-top: 2.5rem;
    border-top: 3px solid var(--ing-orange);
    padding-top: 1.25rem;
}

.fr-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--ing-white);
    border: 1px solid var(--ing-gray-200);
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--ing-navy);
    transition: var(--transition);
    list-style: none;
}
.fr-toggle::-webkit-details-marker { display: none; }
.fr-toggle:hover {
    background: var(--ing-orange-pale);
    border-color: var(--ing-orange);
}
.fr-toggle-hint {
    font-weight: 400;
    font-size: 0.82rem;
    color: var(--ing-gray-600);
}

.fr-form-wrapper {
    padding: 1.5rem;
    background: var(--ing-white);
    border: 1px solid var(--ing-gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.fr-intro {
    font-size: 0.9rem;
    color: var(--ing-gray-600);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.fr-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fr-form-row input,
.fr-form-row textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--ing-gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--ing-white);
    transition: var(--transition);
    resize: vertical;
}

.fr-form-row input:focus,
.fr-form-row textarea:focus {
    outline: none;
    border-color: var(--ing-orange);
    box-shadow: 0 0 0 3px var(--ing-orange-pale);
}

.fr-form .btn {
    align-self: flex-start;
    margin-top: 0.25rem;
}


/* ─── FEATURE REQUEST CLOSE PAGE ─── */
.fr-close-page {
    max-width: 700px;
    margin: 0 auto;
}

.fr-close-detail {
    background: var(--ing-white);
    border: 1px solid var(--ing-gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.25rem 0;
}

.fr-close-detail blockquote {
    background: var(--ing-gray-50);
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--ing-orange);
    margin: 0.75rem 0 0 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
    color: var(--ing-gray-600);
}

.fr-close-form {
    background: var(--ing-white);
    border: 1px solid var(--ing-gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.fr-close-form textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--ing-gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    resize: vertical;
    margin-top: 0.5rem;
}

.fr-close-form textarea:focus {
    outline: none;
    border-color: var(--ing-orange);
    box-shadow: 0 0 0 3px var(--ing-orange-pale);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
