/* =============================================================================
   WeatherVue — main.css
   Design system: dark navy base, warm amber accent, clean data-forward aesthetic.
   Fonts: Syne (headings) + DM Sans (body) — loaded non-blocking in base.html.

   STRUCTURE
   ─────────
   1.  Design tokens (CSS custom properties)
   2.  Reset & base
   3.  Navigation
   4.  Flash messages
   5.  Layout & page structure
   6.  Cards
   7.  Buttons
   8.  Forms
   9.  Auth pages
   10. Dashboard (desktop)
   11. Tables
   12. Badges
   13. Loading spinner
   14. Footer
   15. Utilities
   16. Theme system (light theme overrides)
   17. Mobile bottom sheet components (desktop: hidden)
   18. Statistics panel
   19. How To Use page
   20. RESPONSIVE — single consolidated @media block
       20a. Tablet (≤ 1024px)
       20b. Mobile (≤ 768px) — ALL mobile overrides in ONE place
============================================================================= */


/* =============================================================================
   1. DESIGN TOKENS
============================================================================= */
:root {
    --navy-950:  #060d1f;  --navy-900:  #0b1530;  --navy-800:  #111f42;
    --navy-700:  #1a2d5a;  --navy-600:  #243972;  --navy-400:  #3d5fa0;
    --slate-300: #8899bb;  --slate-200: #b0bdcf;  --slate-100: #d8dfe8;
    --white:     #f4f7fb;
    --amber-400: #f5a623;  --amber-300: #fbbf47;  --amber-200: #fdd078;
    --green-400: #22c55e;  --red-400:   #ef4444;  --blue-400:  #3b82f6;

    --bg-base:        var(--navy-950);
    --bg-card:        var(--navy-900);
    --bg-input:       var(--navy-800);
    --bg-hover:       var(--navy-700);
    --border:         var(--navy-600);
    --border-subtle:  var(--navy-700);
    --text-primary:   var(--white);
    --text-secondary: var(--slate-200);
    --text-muted:     var(--slate-300);
    --accent:         var(--amber-400);
    --accent-light:   var(--amber-300);

    --font-display: 'Syne', sans-serif;
    --font-body:    'DM Sans', sans-serif;
    --radius-sm: 6px;  --radius-md: 10px;  --radius-lg: 16px;
    --transition: 0.18s ease;
}


/* =============================================================================
   2. RESET & BASE
============================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg-base); color: var(--text-primary); min-height: 100vh; display: flex; flex-direction: column; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-light); }

/* ── World map background ────────────────────────────────────────────────────
   Inlined SVG in base.html with class .worldmap-bg.
   Target polygon elements directly to override SVG default black fill. */
.worldmap-bg polygon {
    fill: #111f42 !important;   /* Dark theme — navy-800, one step above #060d1f bg */
}
[data-theme="light"] .worldmap-bg polygon {
    fill: #ecebe7 !important;   /* Light theme — R:0.925 G:0.921 B:0.906 per colour meter */
}


/* =============================================================================
   3. NAVIGATION
============================================================================= */
.navbar { background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.nav-brand:hover { color: var(--accent); }
.brand-icon { font-size: 1.3rem; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); padding: 6px 12px; border-radius: var(--radius-sm); transition: background var(--transition), color var(--transition); }
.nav-link:hover, .nav-link.active { background: var(--bg-hover); color: var(--text-primary); }
.nav-link--logout { color: var(--text-muted); }
.nav-link--logout:hover { color: var(--red-400); background: transparent; }

/* Hamburger — visible on mobile only (activated in responsive section) */
.nav-hamburger { display: none; }

/* Theme toggle */
.theme-toggle { all: unset; box-sizing: border-box; cursor: pointer; font-size: 0.875rem; font-weight: 500; font-family: var(--font-body); color: var(--text-muted); padding: 6px 12px; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 5px; transition: background var(--transition), color var(--transition); white-space: nowrap; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
.theme-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }


/* =============================================================================
   4. FLASH MESSAGES
============================================================================= */
.flash-container { max-width: 1200px; margin: 16px auto 0; padding: 0 24px; display: flex; flex-direction: column; gap: 8px; }
.flash { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-md); font-size: 0.9rem; border: 1px solid transparent; }
.flash--success { background: #0d2e1a; border-color: #1a5c34; color: #4ade80; }
.flash--danger  { background: #2e0d0d; border-color: #5c1a1a; color: #f87171; }
.flash--warning { background: #2e200d; border-color: #5c3e1a; color: #fbbf24; }
.flash--info    { background: #0d1e2e; border-color: #1a3a5c; color: #60a5fa; }
.flash-close { background: none; border: none; cursor: pointer; color: inherit; opacity: 0.6; font-size: 1.1rem; padding: 0 0 0 12px; flex-shrink: 0; }
.flash-close:hover { opacity: 1; }


/* =============================================================================
   5. LAYOUT
============================================================================= */
.main-content { flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 32px 24px; }
.page-header { margin-bottom: 28px; }
.page-title { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; color: var(--text-primary); }
.page-subtitle { color: var(--text-muted); margin-top: 4px; font-size: 0.95rem; }


/* =============================================================================
   6. CARDS
============================================================================= */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.card-title { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.05em; }


/* =============================================================================
   7. BUTTONS
============================================================================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--font-body); font-size: 0.9rem; font-weight: 500; padding: 10px 20px; border-radius: var(--radius-md); border: none; cursor: pointer; transition: background var(--transition), transform var(--transition), opacity var(--transition); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary        { background: var(--accent); color: var(--navy-950); }
.btn--primary:hover  { background: var(--accent-light); color: var(--navy-950); }
.btn--secondary      { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border); }
.btn--secondary:hover { background: var(--navy-600); }
.btn--danger         { background: #7f1d1d; color: #fca5a5; }
.btn--danger:hover   { background: #991b1b; }
.btn--sm   { padding: 6px 14px; font-size: 0.85rem; }
.btn--full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }


/* =============================================================================
   8. FORMS
============================================================================= */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-control { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-primary); font-family: var(--font-body); font-size: 0.95rem; padding: 10px 14px; transition: border-color var(--transition); outline: none; }
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text-muted); }
input[type="date"].form-control { color-scheme: dark; }
select.form-control[multiple] { height: auto; min-height: 140px; padding: 6px; }
select.form-control[multiple] option { padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; }
select.form-control[multiple] option:checked { background: var(--navy-600); color: var(--accent); }


/* =============================================================================
   9. AUTH PAGES
============================================================================= */
.auth-wrapper { min-height: calc(100vh - 120px); display: flex; align-items: flex-start; justify-content: flex-start; padding-top: 0; }
.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 440px; }
.auth-title    { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.auth-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }
.auth-footer   { text-align: center; color: var(--text-muted); font-size: 0.875rem; margin-top: 20px; }


/* =============================================================================
   10. DASHBOARD (desktop)
============================================================================= */
.dashboard-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.controls-panel { position: sticky; top: 80px; }

.chart-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; min-height: 400px; display: flex; flex-direction: column; }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.chart-title  { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.chart-container { flex: 1; position: relative; min-height: 360px; }
.chart-empty     { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 360px; color: var(--text-muted); gap: 12px; font-size: 0.9rem; }
.chart-empty-icon { font-size: 2.5rem; opacity: 0.4; }

/* City grid wrapper — scrollable container, plain block so groups stack vertically */
.city-grid { display: block; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.city-grid::-webkit-scrollbar       { width: 4px; }
.city-grid::-webkit-scrollbar-track { background: var(--bg-input); border-radius: 2px; }
.city-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Each continent block — always full width, never shares a row */
.city-continent-group { display: block; width: 100%; margin-bottom: 12px; }

/* Continent header — bold, display font, full width */
.city-continent-header {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 6px 0 4px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 6px;
}
.city-continent-group:first-child .city-continent-header { padding-top: 0; }

/* Two-column city grid within each continent */
.city-continent-cities {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.city-check { display: flex; align-items: center; gap: 6px; }
.city-check input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.city-check label { font-size: 0.82rem; color: var(--text-secondary); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-check:has(input:checked) label { color: var(--text-primary); }
.date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Mobile sheet continent groups — always full width, stack vertically */
.sheet-continent-group { display: block; width: 100%; margin-bottom: 8px; }

/* Mobile sheet continent headers */
.sheet-continent-header {
    display: block;
    width: 100%;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 10px 0 4px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
}
.sheet-continent-group:first-child .sheet-continent-header { padding-top: 0; }


/* =============================================================================
   11. TABLES
============================================================================= */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-size: 0.78rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 10px 14px; border-bottom: 1px solid var(--border); }
td { padding: 11px 14px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }


/* =============================================================================
   12. BADGES
============================================================================= */
.badge        { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.75rem; font-weight: 500; }
.badge--green { background: #14532d; color: #4ade80; }
.badge--amber { background: #451a03; color: #fbbf24; }
.badge--red   { background: #7f1d1d; color: #f87171; }
.badge--slate { background: var(--navy-700); color: var(--slate-200); }


/* =============================================================================
   13. LOADING SPINNER
============================================================================= */
.spinner { width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


/* =============================================================================
   14. FOOTER
============================================================================= */
.footer       { border-top: 1px solid var(--border); padding: 16px 24px; font-size: 0.82rem; color: var(--text-muted); }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 8px; }
.footer-sep   { opacity: 0.4; }
.footer a      { color: var(--text-muted); }
.footer a:hover { color: var(--accent); }


/* =============================================================================
   15. UTILITIES
============================================================================= */
.text-muted      { color: var(--text-muted); }
.text-secondary  { color: var(--text-secondary); }
.text-primary    { color: var(--text-primary); }
.text-accent     { color: var(--accent); }
.text-danger     { color: var(--red-400); }
.text-success    { color: var(--green-400); }
.text-sm         { font-size: 0.875rem; }
.text-xs         { font-size: 0.8rem; }
.text-xxs        { font-size: 0.75rem; }

.mt-0 { margin-top: 0; }     .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; }   .mb-1 { margin-bottom: 8px; }
.mt-2 { margin-top: 16px; }  .mb-2 { margin-bottom: 16px; }
.mt-3 { margin-top: 24px; }  .mb-3 { margin-bottom: 24px; }
.mt-4 { margin-top: 32px; }  .mb-4 { margin-bottom: 32px; }
.ml-1 { margin-left: 8px; }  .mr-1 { margin-right: 8px; }
.ml-2 { margin-left: 16px; } .mr-2 { margin-right: 16px; }

/* Numeric utilities for precise porting from inline styles */
.mt-4px  { margin-top: 4px; }
.mt-6px  { margin-top: 6px; }
.mt-10px { margin-top: 10px; }
.mt-12px { margin-top: 12px; }
.mt-20px { margin-top: 20px; }
.mb-4px  { margin-bottom: 4px; }
.mb-6px  { margin-bottom: 6px; }
.mb-10px { margin-bottom: 10px; }
.mb-12px { margin-bottom: 12px; }
.mb-20px { margin-bottom: 20px; }
.ml-2px  { margin-left: 2px; }
.ml-4px  { margin-left: 4px; }
.ml-6px  { margin-left: 6px; }
.ml-10px { margin-left: 10px; }
.mr-4px  { margin-right: 4px; }
.mr-6px  { margin-right: 6px; }
.mr-10px { margin-right: 10px; }

.p-0   { padding: 0; }
.pt-1  { padding-top: 8px; }
.pb-1  { padding-bottom: 8px; }
.pt-2  { padding-top: 16px; }
.pb-2  { padding-bottom: 16px; }

.d-block  { display: block; }
.d-inline { display: inline; }
.d-flex   { display: flex; }
.d-grid   { display: grid; }
.hidden   { display: none !important; }

.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1   { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.items-start   { align-items: flex-start; }
.items-center  { align-items: center; }
.items-end     { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end   { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

.gap-4px  { gap: 4px; }
.gap-6px  { gap: 6px; }
.gap-8px  { gap: 8px; }
.gap-10px { gap: 10px; }
.gap-12px { gap: 12px; }
.gap-16px { gap: 16px; }

.w-full  { width: 100%; }
.w-14    { width: 14px; }   .h-14    { height: 14px; }
.w-16    { width: 16px; }   .h-16    { height: 16px; }
.max-w-340 { max-width: 340px; }
.max-w-440 { max-width: 440px; }
.max-w-480 { max-width: 480px; }
.max-w-540 { max-width: 540px; }
.max-w-560 { max-width: 560px; }
.max-w-720 { max-width: 720px; }
.max-w-760 { max-width: 760px; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.cursor-pointer { cursor: pointer; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0  { top: 0; right: 0; bottom: 0; left: 0; }

.border-top    { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }
.border-left   { border-left: 1px solid var(--border); }
.border-danger { border: 1px solid #7f1d1d; }

.city-check { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.city-check input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; accent-color: var(--accent); }
.city-check label { cursor: pointer; font-size: 0.73rem; flex: 1; user-select: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-link-muted { background: none; border: none; cursor: pointer; font-size: 0.78rem; color: var(--text-muted); text-decoration: underline; }
.btn-link-muted:hover { color: var(--text-secondary); }

/* =============================================================================
   16. THEME SYSTEM — LIGHT THEME OVERRIDES
   Dark is the default (:root above). Light is activated by data-theme="light"
   on <html>. The theme manager JS lives in base.html.
============================================================================= */
[data-theme="light"] {
    --bg-base:        #f5f0e8;
    --bg-card:        #fdfaf4;
    --bg-input:       #faf6ee;
    --bg-hover:       #ede5d5;
    --border:         #d4c4a8;
    --border-subtle:  #e8deca;
    --text-primary:   #2c1f0e;
    --text-secondary: #4a3728;
    --text-muted:     #8a7560;
    --accent:         #c96b00;
    --accent-light:   #e87d00;
    color-scheme: light;
}
[data-theme="light"] input[type="date"].form-control { color-scheme: light; }
[data-theme="light"] .flash--success { background: #f0fae8; border-color: #a8d878; color: #2d5a1b; }
[data-theme="light"] .flash--danger  { background: #fdf0ec; border-color: #e8a898; color: #7a2010; }
[data-theme="light"] .flash--warning { background: #fdf5e0; border-color: #e8c870; color: #6b3800; }
[data-theme="light"] .flash--info    { background: #f0ede8; border-color: #c4b898; color: #3a2c1e; }
[data-theme="light"] .badge--green   { background: #e8f5d8; color: #2d5a1b; }
[data-theme="light"] .badge--amber   { background: #fdecc8; color: #6b3800; }
[data-theme="light"] .badge--red     { background: #fde8e0; color: #7a2010; }
[data-theme="light"] .badge--slate   { background: #ede5d5; color: #4a3728; }
[data-theme="light"] .btn--danger        { background: #fde8e0; color: #7a2010; border: 1px solid #e8a898; }
[data-theme="light"] .btn--danger:hover  { background: #f8d5c8; }
[data-theme="light"] tr:hover td         { background: #f0e8d8; }
[data-theme="light"] ::-webkit-scrollbar-track { background: #ede5d5; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c8b898; }


/* =============================================================================
   17. MOBILE BOTTOM SHEET COMPONENTS
   Base styles live here so .open state works from JS on any viewport.
   The mobile-fab is activated (display:flex) in section 20b.
============================================================================= */
.mobile-fab     { display: none; }
.sheet-overlay  { display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0,0,0,0.55); z-index: 200; opacity: 0; transition: opacity 0.25s ease; }
.sheet-overlay.open { display: block; opacity: 1; }
.bottom-sheet   { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-card); border-radius: 20px 20px 0 0; z-index: 201; max-height: 88vh; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1); flex-direction: column; }
.bottom-sheet.open { display: flex; transform: translateY(0); }

.sheet-handle  { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 12px auto 0; flex-shrink: 0; }
.sheet-header  { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 8px; flex-shrink: 0; border-bottom: 1px solid var(--border-subtle); }
.sheet-title   { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.sheet-close   { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; padding: 4px 8px; line-height: 1; border-radius: var(--radius-sm); }
.sheet-close:hover { background: var(--bg-hover); }
.sheet-body    { overflow-y: auto; padding: 16px 20px; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-footer  { padding: 12px 20px 20px; flex-shrink: 0; border-top: 1px solid var(--border-subtle); background: var(--bg-card); display: flex; gap: 10px; }
.sheet-footer .btn { flex: 1; min-height: 48px; font-size: 1rem; }

.sheet-section-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin: 16px 0 8px; }
.sheet-section-title:first-child { margin-top: 0; }

.sheet-city-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sheet-city-check { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--transition); }
.sheet-city-check:has(input:checked) { background: var(--bg-hover); }
.sheet-city-check input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.sheet-city-check label { font-size: 0.875rem; color: var(--text-secondary); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-city-check:has(input:checked) label { color: var(--text-primary); font-weight: 500; }

.sheet-metric-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-metric-chip { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-input); cursor: pointer; transition: all var(--transition); -webkit-tap-highlight-color: transparent; }
.sheet-metric-chip input[type="checkbox"] { display: none; }
.sheet-metric-chip span { font-size: 0.875rem; color: var(--text-secondary); font-weight: 500; pointer-events: none; }
.sheet-metric-chip:has(input:checked) { background: var(--accent); border-color: var(--accent); }
.sheet-metric-chip:has(input:checked) span { color: var(--navy-950); }

.sheet-date-presets { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
.sheet-date-presets::-webkit-scrollbar { display: none; }
.sheet-date-preset  { flex-shrink: 0; padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; font-family: var(--font-body); cursor: pointer; transition: all var(--transition); -webkit-tap-highlight-color: transparent; }
.sheet-date-preset:hover,
.sheet-date-preset.active { background: var(--accent); border-color: var(--accent); color: var(--navy-950); }


/* =============================================================================
   18. STATISTICS PANEL
============================================================================= */
.stat-card      { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; border-left: 4px solid var(--border); }
.stat-card-title { font-family: var(--font-display); font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-subtle); }
.stat-rows       { display: flex; flex-direction: column; gap: 6px; }
.stat-row        { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.82rem; gap: 8px; }
.stat-label      { color: var(--text-muted); flex-shrink: 0; }
.stat-value      { color: var(--text-primary); font-weight: 500; text-align: right; }
.stat-value--highlight { color: var(--accent); }
.stat-date       { color: var(--text-muted); font-size: 0.75rem; margin-left: 4px; }
.stat-divider    { height: 1px; background: var(--border-subtle); margin: 6px 0; }


/* =============================================================================
   19. HOW TO USE PAGE
============================================================================= */
.how-to-tabs { display: flex; gap: 8px; margin-bottom: 28px; }
.how-to-tab  { padding: 10px 24px; border-radius: 24px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-secondary); font-family: var(--font-body); font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: all var(--transition); }
.how-to-tab:hover  { border-color: var(--accent); color: var(--accent); }
.how-to-tab.active { background: var(--accent); border-color: var(--accent); color: var(--navy-950); font-weight: 700; }
.how-to-section    { margin-bottom: 24px; }
.how-to-step       { display: flex; gap: 20px; align-items: flex-start; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.how-to-step-number { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--navy-950); font-family: var(--font-display); font-size: 1rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.how-to-step-body  { flex: 1; }
.how-to-step-title { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }


/* =============================================================================
   21. SPRINT 24 CSP EXTRACTION
   Utilities and component classes to replace inline style= attributes.
============================================================================= */

/* Spacing & Layout Utilities */
.mt-12px { margin-top: 12px; }
.mt-14px { margin-top: 14px; }
.mt-32px { margin-top: 32px; }
.mb-2px  { margin-bottom: 2px; }
.mb-4px  { margin-bottom: 4px; }
.mb-6px  { margin-bottom: 6px; }
.mb-8px  { margin-bottom: 8px; }
.mb-10px { margin-bottom: 10px; }
.mb-12px { margin-bottom: 12px; }
.mb-14px { margin-bottom: 14px; }
.mb-16px { margin-bottom: 16px; }
.mb-18px { margin-bottom: 18px; }
.mb-20px { margin-bottom: 20px; }
.mb-24px { margin-bottom: 24px; }
.mb-025rem { margin-bottom: 0.25rem; }
.mb-05rem  { margin-bottom: 0.5rem; }
.mb-15rem  { margin-bottom: 1.5rem; }
.mb-2rem   { margin-bottom: 2rem; }
.pt-24px { padding-top: 24px; }
.pr-4px  { padding-right: 4px; }
.py-8px  { padding: 8px 0; }
.p-7-10  { padding: 7px 10px; }
.p-12-14 { padding: 12px 14px; }
.p-12-16 { padding: 12px 16px; }
.p-14-16 { padding: 14px 16px; }
.p-16-20 { padding: 16px 20px; }
.p-075-1 { padding: 0.75rem 1rem; }
.p-05-1  { padding: 0.5rem 1rem; }
.p-045-075 { padding: 0.45rem 0.75rem; }
.p-05-075  { padding: 0.5rem 0.75rem; }

.gap-05rem { gap: 0.5rem; }
.gap-10px  { gap: 10px; }
.gap-12px  { gap: 12px; }
.gap-24px  { gap: 24px; }

/* Display & Flex/Grid */
.d-none { display: none !important; }
.d-inline-block { display: inline-block; }
.flex-1-min-200 { flex: 1; min-width: 200px; }
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.grid-1-1    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-admin-cities { display: grid; grid-template-columns: 1fr 80px 130px 130px auto; gap: 12px; align-items: end; }
.grid-user-profile { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* Typography */
.fs-07rem  { font-size: 0.7rem; }
.fs-072rem { font-size: 0.72rem; }
.fs-075rem { font-size: 0.75rem; }
.fs-078rem { font-size: 0.78rem; }
.fs-08rem  { font-size: 0.8rem; }
.fs-082rem { font-size: 0.82rem; }
.fs-085rem { font-size: 0.85rem; }
.fs-0875rem { font-size: 0.875rem; }
.fs-088rem { font-size: 0.88rem; }
.fs-09rem  { font-size: 0.9rem; }
.fs-1rem   { font-size: 1rem; }
.fs-4rem   { font-size: 4rem; }
.lh-15 { line-height: 1.5; }
.lh-16 { line-height: 1.6; }
.lh-18 { line-height: 1.8; }
.ls-06 { letter-spacing: 0.06em; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.no-wrap { white-space: nowrap; }

/* Colors & Borders */
.bg-error-subtle { background: #160808; border-color: #7f1d1d; }
.bg-info-subtle  { background: #0d1e2e; border: 1px solid #1a3a5c; }
.bg-success-subtle { background: #0d2e1a; border: 1px solid #1a5c34; }
.bg-danger-subtle { background: #2e0d0d; border: 1px solid #5c1a1a; }
.text-info { color: #60a5fa; }
.text-error-light { color: #fca5a5; }
.border-accent { border: 1px solid var(--accent); }
.border-danger-strong { border: 1px solid #ef4444; color: #ef4444; }

/* Components */
.map-toolbar {
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.map-results-wrapper {
    position: relative;
    width: 360px;
    max-width: 100%;
}
.map-search-input {
    width: 100%;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-primary);
    box-sizing: border-box;
}
.map-results-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    margin-top: 2px;
    z-index: 9999;
    list-style: none;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    display: none;
    max-height: 220px;
    overflow-y: auto;
}
.map-toggle-container {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.tooltip-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    pointer-events: none;
}
.tooltip-box {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    max-width: 300px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    pointer-events: all;
    display: none;
}

.how-to-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.how-to-footer-title {
    margin-bottom: 16px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.city-list-scroll {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.chat-message-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 760px;
}
.chat-message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.w-10px { width: 10px; }
.h-10px { height: 10px; }
.opacity-02 { opacity: 0.2; }
.pointer-events-all { pointer-events: all; }
.scroll-y-600 { max-height: 600px; overflow-y: auto; }

/* ── World Map Page ───────────────────────────────────────────────────────── */
#map {
    height: calc(100vh - 200px);
    min-height: 400px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    z-index: 0;
    background: #0e0e0e;
}
[data-theme="light"] #map { background: #f2f2f0; }

.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
    padding: 0 !important;
}
.leaflet-popup-content { margin: 0 !important; min-width: 200px; }
.leaflet-popup-tip { background: var(--bg-card) !important; }
.leaflet-popup-close-button { color: var(--text-muted) !important; font-size: 18px !important; padding: 6px 8px !important; top: 4px !important; right: 4px !important; }
.leaflet-popup-close-button:hover { color: var(--text-primary) !important; }

.wv-popup         { padding: 16px; }
.wv-popup-city    { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; padding-right: 20px; }
.wv-popup-country { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }
.wv-popup-stat    { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 3px; }
.wv-popup-stat span { color: var(--text-primary); font-weight: 500; }
.wv-popup-btn {
    display: block; margin-top: 8px; padding: 8px 14px;
    background: var(--accent); color: var(--navy-950) !important;
    border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600;
    text-align: center; text-decoration: none; transition: background 0.15s;
    font-family: var(--font-body);
}
.wv-popup-btn:hover { background: var(--accent-light); color: var(--navy-950) !important; }
.wv-popup-btn-secondary {
    display: block; margin-top: 6px; padding: 7px 14px;
    background: var(--bg-hover); color: var(--text-primary) !important;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500; text-align: center;
    text-decoration: none; transition: background 0.15s;
    font-family: var(--font-body); cursor: pointer; width: 100%;
}
.wv-popup-btn-secondary:hover { background: var(--navy-600); }
.wv-popup-btn-secondary.selected { color: var(--text-muted) !important; border-color: var(--border-subtle); }

/* Comparison tray — fixed bar at bottom of viewport */
#compare-tray {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 500;
    background: var(--bg-card);
    border-top: 2px solid var(--accent);
    padding: 10px 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
#compare-tray.visible { display: flex; }

.tray-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; flex-shrink: 0; }
.tray-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; align-items: center; min-width: 0; }
.tray-chip  { display: flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; color: var(--navy-950); white-space: nowrap; }
.tray-chip-remove { background: none; border: none; cursor: pointer; color: rgba(0,0,0,0.5); font-size: 1rem; line-height: 1; padding: 0; margin-left: 2px; font-weight: 700; }
.tray-chip-remove:hover { color: rgba(0,0,0,0.9); }
.tray-limit { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.tray-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: auto; }

/* On mobile, tray stacks a bit more */
@media (max-width: 768px) {
    #map { height: calc(100vh - 180px); }
    .tray-actions { width: 100%; justify-content: flex-end; }
}


.how-to-step-desc  { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65; margin-bottom: 8px; }
.how-to-step-desc strong { color: var(--text-primary); }
.how-to-step-desc em     { color: var(--accent); font-style: normal; }
.how-to-tip  { margin-top: 10px; padding: 10px 14px; background: var(--bg-input); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; }
.how-to-list { margin: 10px 0 0 0; padding-left: 20px; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }
.how-to-list li { margin-bottom: 4px; }
.how-to-list strong { color: var(--text-primary); }
.how-to-tips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.how-to-tip-card  { display: flex; gap: 14px; align-items: flex-start; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.how-to-tip-icon  { font-size: 1.4rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.how-to-tip-text  { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }
.how-to-tip-text strong { color: var(--text-primary); }


/* =============================================================================
   20. RESPONSIVE STYLES
   ALL @media rules live here — nothing above contains a media query.
   This makes it impossible for a rule outside a media block to accidentally
   bleed into one, which was the source of all previous CSS instability.
============================================================================= */

/* ── 20a. Tablet (≤ 1024px) ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .main-content { padding: 24px 16px; }
    .nav-inner    { padding: 0 16px; }
}

/* ── 20b. Mobile (≤ 768px) ──────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* Typography */
    .page-title    { font-size: 1.4rem; }
    .page-subtitle { font-size: 0.8rem; }
    .auth-title    { font-size: 1.3rem; }

    /* Layout */
    .main-content { padding: 16px 12px; }
    .page-header  { padding: 12px 16px 8px; }
    .page-header.flex { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header.flex > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; }

    /* Navigation: hamburger */
    .nav-inner { height: 56px; padding: 0 16px; position: relative; }
    .nav-hamburger {
        display: flex; flex-direction: column; justify-content: center; gap: 5px;
        background: none; border: none; cursor: pointer; padding: 8px; border-radius: var(--radius-sm);
    }
    .nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--text-secondary); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
    .nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-hamburger.open span:nth-child(2) { opacity: 0; }
    .nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .nav-links { display: none; position: fixed; top: 56px; left: 0; right: 0; background: var(--bg-card); border-bottom: 1px solid var(--border); flex-direction: column; padding: 12px; gap: 4px; z-index: 99; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
    .nav-links.nav-open { display: flex; }
    .nav-link { padding: 12px 16px; border-radius: var(--radius-md); font-size: 1rem; width: 100%; }
    .theme-toggle { width: 100%; justify-content: flex-start; padding: 10px 16px; border-radius: 0; font-size: 0.95rem; }

    /* Cards & Auth */
    .card         { padding: 16px; border-radius: var(--radius-md); }
    .auth-card    { padding: 24px 20px; border-radius: var(--radius-md); }
    .auth-wrapper { align-items: flex-start; padding-top: 16px; }
    .login-wrapper { flex-direction: column; gap: 24px; padding: 24px 0; }
    .login-pitch { display: none; }
    .login-card-wrapper { max-width: 100%; }

    /* Forms */
    .form-control { padding: 12px 14px; font-size: 1rem; }
    .form-label   { font-size: 0.9rem; }
    .date-row     { grid-template-columns: 1fr; }

    /* Buttons */
    .btn          { padding: 12px 20px; min-height: 44px; }
    .btn--sm      { padding: 8px 14px; min-height: 36px; font-size: 0.875rem; }
    .btn--mobile-full { width: 100%; }

    /* Tables */
    table  { font-size: 0.82rem; }
    th, td { padding: 9px 10px; }
    .hide-mobile { display: none; }

    /* Flash & footer */
    .flash-container { padding: 0 12px; margin-top: 12px; }
    .footer          { padding: 12px 16px; }
    .footer-inner    { flex-wrap: wrap; gap: 4px; font-size: 0.8rem; }

    /* Admin grids & profile width */
    div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
    div[style*="grid-template-columns: 1fr 1fr"][class=""] { display: block !important; }
    div[style*="max-width:480px"],
    div[style*="max-width: 480px"] { max-width: 100% !important; }

    /* Dashboard: replace sidebar with bottom sheet */
    .controls-panel  { display: none !important; }
    .dashboard-grid  { grid-template-columns: 1fr; gap: 0; }
    #export-buttons  { display: none !important; }
    #landscape-hint  { display: none; font-size: 0.75rem; color: var(--text-muted); }
    .chart-container { min-height: calc(100vh - 220px); }
    .chart-empty     { height:    calc(100vh - 220px); }
    .chart-panel     { border-radius: 0; border-left: none; border-right: none; padding-bottom: 72px; }

    /* Floating action button */
    .mobile-fab {
        display: flex; align-items: center; gap: 10px;
        position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
        z-index: 100; background: var(--accent); color: var(--navy-950);
        border: none; border-radius: 28px; padding: 14px 28px;
        font-size: 1rem; font-weight: 700; font-family: var(--font-body);
        cursor: pointer; box-shadow: 0 4px 20px rgba(245,166,35,0.4);
        white-space: nowrap; transition: transform 0.15s, box-shadow 0.15s;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-fab:active { transform: translateX(-50%) scale(0.96); box-shadow: 0 2px 10px rgba(245,166,35,0.3); }
    .mobile-fab-icon   { font-size: 1.1rem; }
    .mobile-fab.chart-active { bottom: 16px; padding: 10px 20px; font-size: 0.875rem; border-radius: 20px; opacity: 0.9; }

    /* Statistics panel: vertical stack */
    #stats-panel { margin-top: 12px; }
    #stats-grid  { display: flex; flex-direction: column; gap: 12px; padding-bottom: 88px; }
    .stat-card   { min-width: 0; width: 100%; }

    /* How To Use page */
    .how-to-step        { padding: 16px; gap: 14px; }
    .how-to-step-number { width: 30px; height: 30px; font-size: 0.875rem; }
    .how-to-tips-grid   { grid-template-columns: 1fr; }

    /* Dashboard: components added during chart updates */
    .howto-nudge         { max-width: 100%; width: 100%; box-sizing: border-box; }
    .share-popup         { min-width: 0; width: calc(100vw - 48px); left: 0; right: auto; }
    .chart-loading-inner { height: calc(100vh - 220px); }
    .ai-panel-header     { flex-wrap: wrap; }
    .ai-content          { padding: 14px 16px; }
    .sub-chart-wrap      { height: 130px; }

} /* end @media (max-width: 768px) */


/* ── Button pulse animation (dashboard Update Chart button) ──────────────── */
@keyframes btn-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(251,191,36,0.45); }
    70%  { box-shadow: 0 0 0 8px rgba(251,191,36,0); }
    100% { box-shadow: 0 0 0 0 rgba(251,191,36,0); }
}

/* ── AI Chat panel ───────────────────────────────────────────────────────── */
@keyframes chat-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%            { transform: translateY(-4px); opacity: 1; }
}

.chat-msg-user {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-radius: 16px 16px 4px 16px;
    padding: 10px 14px;
    max-width: 85%;
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-msg-assistant {
    align-self: flex-start;
    background: var(--bg-hover);
    color: var(--text-primary);
    border-radius: 16px 16px 16px 4px;
    padding: 10px 14px;
    max-width: 90%;
    font-size: 0.85rem;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-msg-assistant strong { color: var(--accent); }

/* ── Sprint 24 utility classes ─────────────────────────────────────────── */

/* Display */
.hidden   { display: none !important; }
.d-block  { display: block; }
.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-inline { display: inline; }

/* Text colours */
.text-danger    { color: #f87171; }
.text-success   { color: #4ade80; }
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* Font weight */
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* Font size */
.fs-sm   { font-size: 0.875rem; }
.fs-xs   { font-size: 0.8rem; }
.fs-xxs  { font-size: 0.75rem; }

/* Margin utilities */
.mt-0  { margin-top: 0; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mr-8  { margin-right: 8px; }
.ml-2  { margin-left: 2px; }
.ml-4  { margin-left: 4px; }
.ml-6  { margin-left: 6px; }
.ml-8  { margin-left: 8px; }
.ml-10 { margin-left: 10px; }

/* Padding */
.p-0 { padding: 0; }
.py-4 { padding-top: 4px; padding-bottom: 4px; }
.px-8 { padding-left: 8px; padding-right: 8px; }
.px-10 { padding-left: 10px; padding-right: 10px; }

/* Width/Height */
.w-full    { width: 100%; }
.w-14      { width: 14px; }
.h-14      { height: 14px; }
.max-w-560 { max-width: 560px; }
.max-w-480 { max-width: 480px; }
.max-w-440 { max-width: 440px; }
.max-w-420 { width: 420px; max-width: 95vw; }
.max-w-340 { max-width: 340px; }
.max-w-320 { min-width: 320px; max-width: 480px; }
.max-w-300 { max-width: 300px; }
.max-w-280 { max-width: 280px; }

/* Border */
.border-danger { border: 1px solid #7f1d1d; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Flex helpers */
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end  { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-4  { gap: 4px; }
.gap-5  { gap: 5px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.flex-1  { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow-1   { flex-grow: 1; }

/* Margin */
.mb-6  { margin-bottom: 6px; }
.mb-10 { margin-bottom: 10px; }

/* Font */
.fw-700 { font-weight: 700; }
.lh-1-4 { line-height: 1.4; }
.lh-1-5 { line-height: 1.5; }
.lh-1-7 { line-height: 1.7; }
.ls-05  { letter-spacing: 0.05em; }
.ls-08  { letter-spacing: 0.08em; }
.ls-10  { letter-spacing: 0.1em; }
.text-uppercase { text-transform: uppercase; }
.font-display { font-family: var(--font-display); }
.font-mono    { font-family: monospace; }
.font-inherit { font-family: inherit; }
.italic       { font-style: italic; }

/* Grid helpers */
.grid-2col    { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.grid-2col-sm { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Position */
.pos-relative { position: relative; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Admin scheduler component classes */
.scheduler-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
}
.scheduler-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    font-size: 0.875rem;
}
.scheduler-job-name { color: var(--text-secondary); font-weight: 500; }
.scheduler-job-meta { color: var(--text-muted); margin-top: 2px; }

/* Admin version badge (in page-title) */
.admin-version-badge {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 10px;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

/* Activity dot indicators */
.activity-dot-green {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
}
.activity-dot-muted {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    display: inline-block;
}
.activity-count-online { font-size: 0.82rem; color: #4ade80; font-weight: 600; }
.activity-count-none   { font-size: 0.82rem; color: var(--text-muted); }

/* Profile / user info meta labels */
.meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.meta-value       { font-size: 0.9rem; }
.meta-value-mono  { font-size: 0.9rem; font-family: monospace; }
.meta-sub         { font-size: 0.78rem; color: var(--text-muted); }
.meta-sub-break   { font-size: 0.75rem; color: var(--text-muted); word-break: break-all; }

/* Tooltip dismiss button */
.btn-link-muted {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: underline;
}

/* Comparison cards (used in dashboard.js innerHTML) */
.comparison-card       { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; }
.comparison-card__title   { font-size: 0.92rem; font-weight: 600; color: var(--text-primary); margin: 0 0 8px 0; }
.comparison-card__no-data { font-size: 0.82rem; color: var(--text-muted); margin: 0; }
.comparison-card__stat    { font-size: 0.82rem; color: var(--text-secondary); margin: 0 0 4px 0; }

/* World map SVG background */
.worldmap-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    display: block;
}

/* Dashboard-specific utility classes */
.city-filter-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    margin-bottom: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: var(--font-body);
}
.city-no-data-dot { font-size: 0.7rem; color: var(--text-muted); margin-left: 2px; }
.metric-hint { font-size: 0.75rem; color: var(--text-muted); margin: 10px 0 0; line-height: 1.5; }
.update-btn-pulse {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(251,191,36,0.5);
    animation: btn-pulse 1.8s ease-out infinite;
}
.chart-type-select {
    font-size: 0.8rem;
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
}
.chart-status { font-size: 0.8rem; color: var(--text-muted); }
.export-buttons { display: none; gap: 6px; }
.share-popup {
    display: none;
    position: absolute;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    min-width: 320px;
    max-width: 480px;
    top: 100%;
    right: 0;
    margin-top: 6px;
}
.share-popup-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.share-url-input {
    flex: 1;
    font-size: 0.78rem;
    font-family: monospace;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    color: var(--text-primary);
    outline: none;
}
.share-copied { display: none; font-size: 0.78rem; color: #4ade80; margin-top: 6px; }
.landscape-hint { display: none; font-size: 0.75rem; color: var(--text-muted); font-weight: 700; }
.chart-empty-hint  { font-size: 1rem; color: var(--text-secondary); margin-bottom: 6px; }
.chart-empty-sub   { font-size: 0.82rem; color: var(--text-muted); }
.howto-nudge {
    margin-top: 20px;
    padding: 14px 18px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 340px;
    text-align: left;
    position: relative;
}
.howto-nudge-dismiss {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
}
.howto-nudge-title  { font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.howto-nudge-body   { margin-bottom: 10px; }
.howto-nudge-link   { color: var(--accent); font-weight: 500; }
.howto-nudge-footer { font-size: 0.78rem; color: var(--text-muted); }
.tooltip-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1000;
    pointer-events: none;
}
.tooltip-box {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    max-width: 280px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    pointer-events: all;
    display: none;
}
.tooltip-step-indicator {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 6px;
}
.tooltip-text { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 14px; }
.tooltip-actions { display: flex; align-items: center; justify-content: space-between; }
.tooltip-skip {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--text-muted);
}
/* ── Tooltip anchor highlight ring ──────────────────────────────────────── */
@keyframes tooltipHighlightPulse {
    0%, 100% { outline-offset: 8px;  opacity: 0.6; }
    50%       { outline-offset: 14px; opacity: 1;   }
}
.tooltip-highlight {
    outline: 2px solid var(--accent);
    animation: tooltipHighlightPulse 2s ease-in-out infinite;
    animation-fill-mode: both;
    border-radius: var(--radius-md);
}
.tooltip-skip-chip {
    position: absolute;
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 1001;
    pointer-events: all;
    transition: color 0.15s ease;
}
.tooltip-skip-chip:hover { color: var(--text-primary); }
.sub-chart-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.sub-chart-wrap { position: relative; height: 160px; }
.chart-loading-inner {
    display: none;
    align-items: center;
    justify-content: center;
    height: 360px;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.stats-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.ai-panel-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ai-panel-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.ai-request-btn { font-size: 0.75rem; padding: 4px 10px; }
.ai-refresh-btn { font-size: 0.75rem; padding: 4px 10px; display: none; }
.ai-content {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
.ai-loading { color: var(--text-muted); font-style: italic; display: none; }
.ai-text    { display: none; }
.ai-error   { display: none; color: var(--text-muted); font-style: italic; }

/* Chat overlay & panel */
.chat-overlay {
    display: none;
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0,0,0,0.35);
    z-index: 400;
}
.chat-panel {
    position: fixed;
    top: 0; right: 0;
    height: 100%;
    width: 420px;
    max-width: 95vw;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 401;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}
.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-panel-header-left { display: flex; align-items: center; gap: 10px; }
.chat-title-text { font-weight: 600; font-size: 0.95rem; }
.chat-session-select {
    font-size: 0.75rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    padding: 3px 6px;
    max-width: 160px;
}
.chat-panel-header-right { display: flex; gap: 6px; align-items: center; }
.chat-new-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 3px 8px;
}
.chat-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    padding: 2px 4px;
}
.chat-context-badge {
    padding: 8px 16px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    display: none;
}
.chat-messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-empty-state { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin: auto; }
.chat-empty-icon  { font-size: 2rem; margin-bottom: 10px; }
.chat-empty-tagline { margin-bottom: 6px; font-weight: 500; color: var(--text-secondary); }
.chat-empty-examples { font-size: 0.78rem; line-height: 1.5; }
.chat-typing-inner {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    background: var(--bg-hover);
    border-radius: 12px;
    padding: 8px 14px;
}
.chat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: chat-dot 1.2s ease-in-out infinite;
}
.chat-dot--2 { animation-delay: 0.2s; }
.chat-dot--3 { animation-delay: 0.4s; }
.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-textarea {
    flex: 1;
    resize: none;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: inherit;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.15s;
}
.chat-send-btn   { padding: 8px 14px; flex-shrink: 0; }
.chat-footer-btn { padding: 8px 14px; flex-shrink: 0; }
.chat-hint { font-size: 0.7rem; color: var(--text-muted); margin-top: 6px; }

/* What's New modal */
.whats-new-overlay {
    display: none;
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    align-items: center;
    justify-content: center;
}
.whats-new-modal {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 28px 32px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    position: relative;
}
.whats-new-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 10px;
}
.whats-new-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 16px; }
.whats-new-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.whats-new-item { font-size: 0.88rem; color: var(--text-secondary); display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.whats-new-dismiss { width: 100%; }

/* Mobile sheet custom dates */
.sheet-custom-dates { display: none; margin-top: 12px; }
.sheet-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-metrics-hint { font-size: 0.72rem; color: var(--text-muted); margin: 8px 0 0; line-height: 1.4; }

/* Non-env warning banner */
.env-warning-banner {
    background: #7f1d1d;
    color: #fca5a5;
    text-align: center;
    padding: 6px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}
.footer-version      { color: var(--text-muted); font-size: 0.8em; }

/* Admin backup page */
.backup-list { display: flex; flex-direction: column; gap: 8px; max-height: 600px; overflow-y: auto; }
.backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    gap: 12px;
}
.backup-item-info  { min-width: 0; }
.backup-item-name  { font-size: 0.85rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.backup-item-meta  { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.backup-item-dl    { flex-shrink: 0; }
.backup-footer-note { margin-top: 12px; font-size: 0.78rem; color: var(--text-muted); }
.backup-merge-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}
.backup-merge-title { font-weight: 500; margin-bottom: 6px; color: var(--text-primary); }
.backup-full-box {
    background: #2e0d0d;
    border: 1px solid #5c1a1a;
    border-radius: var(--radius-md);
    padding: 16px;
}
.backup-full-title  { font-weight: 500; margin-bottom: 6px; color: #f87171; }
.backup-full-desc   { font-size: 0.82rem; color: #fca5a5; margin-bottom: 14px; line-height: 1.6; }

/* Admin cities page info box */
.city-info-box {
    background: #0d2e1a;
    border: 1px solid #1a5c34;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: #4ade80;
    line-height: 1.6;
}
.city-add-grid { display: grid; grid-template-columns: 1fr 80px 130px 130px auto; gap: 12px; align-items: end; }
.city-add-hint { margin-top: 10px; font-size: 0.8rem; color: var(--text-muted); }

/* Admin logs page */
.logs-filter-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.logs-pagination  { display: flex; gap: 8px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.logs-page-info   { font-size: 0.85rem; color: var(--text-muted); }
.logs-filter-badge { font-weight: 400; color: var(--text-muted); font-size: 0.875rem; }

/* Chat session (admin view) */
.chat-session-nav { margin-bottom: 16px; display: flex; gap: 8px; }
.chat-session-context {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-hover);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.chat-session-messages { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.chat-session-row      { display: flex; }
.chat-session-row--user { justify-content: flex-end; }
.chat-session-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}
.chat-session-bubble--user {
    background: var(--accent);
    color: #fff;
    border-radius: 16px 16px 4px 16px;
}
.chat-session-bubble--assistant {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 16px 16px 16px 4px;
}
.chat-session-meta {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    opacity: 0.7;
}
.chat-session-actions { margin-top: 24px; }
.btn-delete-session {
    background: none;
    border: 1px solid #ef4444;
    color: #ef4444;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 6px 14px;
}

/* Cities/search page info boxes */
.city-search-info {
    background: #0d1e2e;
    border: 1px solid #1a3a5c;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 0.85rem;
    color: #60a5fa;
    line-height: 1.6;
}
.city-search-results-label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; }
.city-results-list { display: flex; flex-direction: column; gap: 6px; }
.city-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}
.city-result-name { font-size: 0.9rem; }
.city-remove-btn  { padding: 3px 10px; font-size: 0.78rem; }
.city-confirm-detail { margin-bottom: 16px; line-height: 1.8; font-size: 0.9rem; }
.city-confirm-actions { display: flex; gap: 10px; }
.city-add-result {
    display: none;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-top: 12px;
    font-size: 0.875rem;
}
.city-hint { margin-top: 12px; font-size: 0.8rem; color: var(--text-muted); }

/* cities/manage.html */
.manage-container { max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem; }
.manage-title     { margin-bottom: 0.25rem; }
.manage-subtitle  { color: var(--text-muted); margin-top: 0; margin-bottom: 1.5rem; }
.manage-section   { margin-bottom: 2rem; }
.manage-section-title { font-size: 1rem; margin-bottom: 0.5rem; }
.manage-search-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    position: relative;
}
.manage-search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-primary);
}
.manage-search-results {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    display: none;
    max-height: 260px;
    overflow-y: auto;
}
.manage-add-message  { margin-top: 0.5rem; font-size: 0.9rem; }
.manage-table        { width: 100%; border-collapse: collapse; }
.manage-table-header { border-bottom: 2px solid var(--border); text-align: left; }
.manage-th           { padding: 0.5rem 0.75rem; }
.manage-row          { border-bottom: 1px solid var(--border); }
.manage-td           { padding: 0.5rem 0.75rem; }
.manage-td-muted     { padding: 0.5rem 0.75rem; color: var(--text-muted); font-size: 0.85rem; }
.manage-td-right     { padding: 0.5rem 0.75rem; text-align: right; }
.manage-no-cities    { color: var(--text-muted); }



/* how_to_use.html */
.how-to-tips-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.how-to-tips-label {
    margin-bottom: 16px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* auth/login.html */
.login-wrapper { flex-direction: column; align-items: center; gap: 32px; padding: 8px 0 40px; }
.login-pitch { width: 100%; max-width: 560px; }
.login-headline {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.2;
}
.login-tagline { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 18px; }
.login-features { display: flex; flex-direction: column; gap: 8px; }
.login-feature-row { display: flex; align-items: flex-start; gap: 10px; font-size: 0.875rem; color: var(--text-secondary); }
.login-feature-arrow { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.login-card-wrapper { width: 100%; max-width: 440px; }
.login-remember-label { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--text-muted); cursor: pointer; }
.login-remember-checkbox { accent-color: var(--accent); }
.login-resend-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.login-resend-text { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 10px; }

/* auth/profile.html */
.profile-container { max-width: 480px; }
.profile-table     { width: 100%; }
.profile-label-td  { color: var(--text-muted); padding: 8px 0; width: 140px; font-size: 0.875rem; }
.profile-value-td  { padding: 8px 0; }

/* auth/register.html */
.register-name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* admin/settings.html */
.settings-card-desc  { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; }
.settings-hint       { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.settings-form-row   { display: flex; gap: 10px; align-items: flex-end; }
.settings-grid-2col  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.settings-test-result { margin-top: 8px; font-size: 0.85rem; display: none; }
.settings-section-div { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.settings-section-title { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; }
.settings-test-row    { display: flex; gap: 8px; align-items: flex-end; }
.settings-smtp-label  { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9rem; color: var(--text-secondary); }
.settings-smtp-note   { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.settings-password-row { display: flex; gap: 8px; align-items: center; }
.smtp-warning { color: var(--accent); }
.danger-card-title { color: #f87171; }
.danger-p          { font-size: 0.85rem; color: #f87171; margin-bottom: 16px; }
.danger-code       { font-size: 0.82rem; }
.btn-danger-submit { background: #dc2626; color: #fff; border: none; }

/* admin/index.html */
.admin-page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-card-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.admin-card-title-inline { margin-bottom: 0; }
.fetch-result { margin-top: 16px; font-size: 0.875rem; color: var(--text-muted); }
.users-count  { font-size: 0.9rem; color: var(--text-secondary); }
.user-row-name  { font-weight: 500; }
.user-row-email { font-size: 0.78rem; color: var(--text-muted); }
.no-data-link  { color: var(--accent); }

/* admin/users.html */
.users-table-row { cursor: pointer; }
.user-link { color: var(--accent); font-weight: 500; }
.user-you-badge { font-size: 0.72rem; color: var(--text-muted); margin-left: 4px; }
.user-email-cell { font-family: monospace; font-size: 0.82rem; }
.user-ua-note { font-size: 0.75rem; color: var(--text-muted); }
.user-never   { color: var(--text-muted); }

/* admin/user_profile.html */
.profile-admin-action-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.profile-delete-note  { font-size: 0.8rem; color: var(--text-muted); margin-left: 8px; }
.profile-self-note    { font-size: 0.82rem; color: var(--text-muted); }
.chat-session-title-link { color: var(--accent); font-weight: 500; }
.chat-session-cities  { font-size: 0.75rem; color: var(--text-muted); }
.btn-chat-delete { color: #f87171; border-color: #f87171; }

/* admin/backup.html */
.backup-badge-ml { margin-left: 8px; }

/* setup.html */
.setup-code-hint    { font-size: 0.8rem; color: #475569; margin-top: 10px; }
.setup-code-env     { color: #7dd3fc; }
.setup-inline-block { display: inline-block; margin: 2px 4px 2px 0; }
.setup-restart-hint { font-size: 0.8rem; color: #4a7a5a; margin-top: 12px; }
.setup-card-desc-green { color: #86efac; }
.setup-restart-block   { margin-top: 12px; }
.setup-strong-opt-a { color: #e2e8f0; }
.setup-code-green   { color: #4ade80; }

/* Error pages */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; gap: 16px; }
.error-code { font-size: 4rem; opacity: 0.2; }
