/* ========================================
   Astralis — Thème nuit
   ======================================== */

/* ---- Splash screen ---- */

.splash-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 15, 0.97);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.splash-content {
    max-width: 420px;
    text-align: center;
}

.splash-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.splash-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: #7B5FE7;
    margin-bottom: 4px;
}

.splash-subtitle {
    color: #8888aa;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.splash-text {
    text-align: left;
    color: #d0d0dd;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.splash-text p {
    margin-bottom: 10px;
}

.splash-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}

/* ---- Cookie banner ---- */

#cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 400;
    background: #1a1a26;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 12px 16px;
}

.cookie-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
    color: #8888aa;
}

.cookie-btn {
    flex-shrink: 0;
    padding: 6px 16px;
    font-size: 0.78rem;
}

@font-face {
    font-family: 'Orbitron';
    font-weight: 700;
    font-display: swap;
    src: url('orbitron-700.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-weight: 400;
    font-display: swap;
    src: url('inter-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-weight: 500;
    font-display: swap;
    src: url('inter-500.ttf') format('truetype');
}

@font-face {
    font-family: 'Inter';
    font-weight: 600;
    font-display: swap;
    src: url('inter-600.ttf') format('truetype');
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a26;
    --bg-input: rgba(0, 0, 0, 0.3);
    --border: transparent;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --text-primary: #d0d0dd;
    --text-secondary: #8888aa;
    --text-muted: #555566;
    --accent: #7B5FE7;
    --accent-hover: #8E75EF;
    --danger: #d94a4a;
    --success: #4ad97a;
    --warning: #d9a84a;
    --score-high: #4ad97a;
    --score-medium: #d9a84a;
    --score-low: #d94a4a;
    --moon-lit: #e8e4d4;
    --moon-dark: #2a2a36;
    --moon-rim: #555;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

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

html {
    background: var(--bg-primary);
}

body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ========== Navigation ========== */

/* Top bar */
#topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(16px, calc((100vw - 768px) / 2));
    z-index: 100;
}

#topbar::before,
#topbar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: max(0px, calc((100vw - 768px) / 2));
    pointer-events: none;
}

#topbar::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-primary), var(--bg-secondary));
}

#topbar::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-primary), var(--bg-secondary));
}

/* Desktop nav links in topbar */
.nav-links-desktop {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.nav-links-desktop .tab-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px;
    border-radius: var(--radius);
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
}

.nav-links-desktop .tab-icon-svg {
    width: 20px;
    height: 20px;
}

.nav-links-desktop .tab-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-links-desktop .tab-link.active {
    color: var(--accent);
    background: rgba(123, 95, 231, 0.1);
}

/* Divider nav / date */
.nav-divider {
    width: 1px;
    height: 24px;
    background: linear-gradient(180deg, transparent, var(--accent), transparent);
    opacity: 0.3;
    margin: 0 10px;
}

/* Date in topbar */
.nav-date {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 0;
    margin-right: 8px;
    position: relative;
}

#nav-date-label {
    font-size: 0.85rem;
    color: var(--accent);
    white-space: nowrap;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.nav-date-btn {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.nav-date-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.hidden-date-input {
    position: absolute;
    right: 0;
    top: 100%;
    opacity: 0;
    width: 0;
    height: 0;
    border: none;
    pointer-events: none;
}

/* Mobile night toggle (hidden on desktop) */
.mobile-only {
    display: none;
}

/* Bottom bar (hidden on desktop) */
#bottombar {
    display: none;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    #topbar {
        height: calc(56px + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
    }

    .nav-links-desktop {
        display: none;
    }

    .nav-divider {
        display: none;
    }

    .twi-hide-mobile {
        display: none !important;
    }

    .mobile-only {
        display: block;
    }

    .nav-date {
        margin-left: auto;
        margin-right: 6px;
    }

    #nav-date-label {
        font-size: 0.78rem;
    }

    .nav-date-btn {
        width: 28px;
        height: 28px;
    }

    .nav-date-btn svg {
        width: 16px;
        height: 16px;
    }

    #bottombar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(56px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-subtle);
        display: flex;
        align-items: center;
        justify-content: space-around;
        z-index: 100;
    }

    #app {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }

    .home-controls {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .home-controls .form-group.inline {
        flex: 2 1 0;
        min-width: 0;
    }
    .home-controls .form-group.inline.filter-group {
        flex: 1 1 0;
        max-width: 28%;
    }

    .home-controls .form-group.inline select {
        font-size: 0.78rem;
        padding: 7px 6px;
        width: 100%;
    }

    .home-controls .form-group.inline label {
        font-size: 0.68rem;
    }

    .home-controls .select-icon {
        display: none;
    }

    .screen-header h1 {
        font-size: 1.3rem;
    }

    .screen-header p {
        font-size: 0.75rem;
    }

    .site-coords {
        font-size: 0.65rem;
        white-space: nowrap;
    }
}

/* Tab links (bottom bar mobile) */
#bottombar .tab-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    padding: 6px 8px;
    border-radius: 8px;
    transition: color 0.2s;
}

#bottombar .tab-link.active {
    color: var(--accent);
}

.tab-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.tab-icon-svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

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

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-logo {
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
    object-fit: contain;
}

.brand-name {
    font-family: 'Orbitron', sans-serif;
    color: #7B5FE7;
    text-shadow: 0 0 8px rgba(123, 95, 231, 0.6), 0 0 16px rgba(123, 95, 231, 0.3);
    -webkit-text-stroke: 0.5px #1c1348;
}
.brand-version {
    font-size: 0.5rem;
    color: var(--accent);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0;
    line-height: 1;
    padding-bottom: 5px;
    text-transform: lowercase;
    text-shadow: 0 0 6px rgba(123, 95, 231, 0.6);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link.active {
    color: var(--accent);
    background: rgba(74, 144, 217, 0.1);
}

/* ========== Main content ========== */

#app {
    padding-top: 56px;
    min-height: 100vh;
}

.screen {
    display: none;
    padding: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.screen.active {
    display: block;
}

.screen.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 200;
    overflow-y: auto;
    padding: 40px 20px;
    max-width: 100%;
}

.screen.overlay.active {
    display: block;
}

.screen.overlay .overlay-header {
    max-width: 800px;
    margin: 0 auto;
}

.screen.overlay #detail-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 16px;
    padding: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.screen-header {
    margin-bottom: 20px;
}

#screen-setups .screen-header,
#screen-checklist .screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.screen-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.screen-header h2 {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* ========== Barre de recherche ========== */

.search-bar {
    position: relative;
    margin-bottom: 12px;
}

#search-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}

#search-input:focus {
    border-color: var(--accent);
}

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

.search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 300px;
    overflow-y: auto;
    z-index: 200;
}

.search-dropdown.visible {
    display: block;
}

.search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s;
}

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

.search-item:hover {
    background: rgba(123, 95, 231, 0.1);
}

.search-item.empty {
    color: var(--text-muted);
    cursor: default;
    justify-content: center;
}

.search-item-name {
    font-size: 0.88rem;
    font-weight: 500;
}

.search-item-type {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========== Logo décoratif ========== */

.search-launcher {
    display: flex;
    justify-content: center;
    padding: 0;
    opacity: 0.3;
}

.search-launcher.hidden {
    display: none;
}

.search-launcher-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(123, 95, 231, 0.4));
}

/* ========== Sort controls ========== */

.sort-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 14px;
}

.sort-group {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.sort-label {
    display: flex;
    align-items: center;
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-right: 2px;
}

.sort-btn {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.sort-btn:hover {
    border-color: var(--text-muted);
}

.sort-btn.active[data-group="mag"] {
    border-color: #e8c84a;
    background: rgba(232, 200, 74, 0.08);
}

.sort-btn.active[data-group="dur"] {
    border-color: #4ac8e8;
    background: rgba(74, 200, 232, 0.08);
}

.sort-btn .mag-dot {
    width: 6px;
    height: 6px;
}

.dur-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
}

.dur-bar {
    display: inline-block;
    width: 4px;
    border-radius: 1px;
    background: var(--border-subtle);
    transition: background 0.2s;
}

.dur-bar.h1 { height: 6px; }
.dur-bar.h2 { height: 10px; }
.dur-bar.h3 { height: 14px; }

.dur-bar.on {
    background: #4ac8e8;
    opacity: 0.35;
}

.dur-bars-inline {
    vertical-align: middle;
    margin-right: 2px;
}
.dur-bars-inline .dur-bar.on {
    opacity: 0.7;
}

.sort-btn.active .dur-bar.on {
    opacity: 1;
}

.sort-btn:not(.active) .mag-dot.filled {
    opacity: 0.4;
}

/* Angular size dots */
.ang-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.ang-dot {
    display: inline-block;
    border-radius: 50%;
    background: var(--border-subtle);
    transition: background 0.2s;
}

.ang-dot.s1 {
    width: 5px; height: 5px;
    background: rgba(232, 200, 74, 0.15) !important;
    border-color: #e8c84a !important;
}
.ang-dot.s2 { width: 8px; height: 8px; }
.ang-dot.s3 { width: 11px; height: 11px; }

.ang-dot.on {
    background: rgba(74, 232, 74, 0.15);
    border: 1.5px solid #4ae84a;
    opacity: 0.5;
}

.sort-btn.active .ang-dot.on {
    opacity: 1;
}

.sort-btn.active[data-group="ang"] {
    border-color: #4ae84a;
    background: rgba(74, 232, 74, 0.08);
}

/* Flipped state (inversé) */
.sort-btn.flipped[data-group="mag"] {
    border-color: #e8c84a;
    background: rgba(232, 200, 74, 0.08);
}

.sort-btn.flipped[data-group="dur"] {
    border-color: #4ac8e8;
    background: rgba(74, 200, 232, 0.08);
}

.sort-btn.flipped[data-group="ang"] {
    border-color: #4ae84a;
    background: rgba(74, 232, 74, 0.08);
}

/* ========== Title + Moon row ========== */

.title-moon-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.title-block {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.title-block h1 {
    margin: 0;
}

.site-coords {
    font-size: 0.75rem;
    color: var(--accent);
    opacity: 0.6;
    margin: 2px 0 0 0;
}

/* Decorative divider */
.section-divider {
    display: flex;
    align-items: center;
    margin: 12px 0;
}

.section-divider span {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.3;
}



/* Moon visual */

.moon-visual {
    display: flex;
    align-items: center;
    gap: 12px;
}

.moon-icon-wrap {
    position: relative;
    width: 48px;
    height: 48px;
}

.moon-phase-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
}

.moon-zoom-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.moon-zoom-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.moon-zoom-img {
    width: 280px;
    height: 280px;
    object-fit: contain;
    border-radius: 50%;
}

.moon-zoom-label {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.moon-new-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #000;
    border: 1px solid #222;
}

.moon-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 12px rgba(200, 200, 160, 0.15);
}

.moon-light {
    position: absolute;
    top: 0;
    bottom: 0;
    background: #e8e4d4;
    transition: width 0.3s;
}

.moon-dark {
    position: absolute;
    top: 0;
    bottom: 0;
    background: #1a1a26;
    transition: width 0.3s;
}

.moon-info {
    text-align: right;
}

.moon-phase-pct {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e8e4d4;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.moon-trend {
    font-size: 1.1rem;
    color: var(--accent);
    text-shadow: 0 0 8px rgba(123, 95, 231, 0.6), 0 0 16px rgba(123, 95, 231, 0.3);
}

.moon-rise-set {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ========== Night summary ========== */

.night-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-top: 12px;
    margin-bottom: 4px;
}

.night-summary-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
}

.night-summary-times {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.night-summary-block {
    text-align: center;
}

.night-summary-block .time {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.night-summary-block .label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.night-summary-arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.night-summary-duration {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    padding: 6px 0;
    flex: 1;
    background: linear-gradient(90deg, transparent, rgba(123, 95, 231, 0.15), transparent);
}

.night-summary-poses {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.night-summary-pose {
    text-align: center;
    background: var(--bg-card);
    border-radius: 6px;
    padding: 8px 4px;
}

.night-summary-pose .pose-count {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.night-summary-pose .pose-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.night-summary-pose.recommended {
    border: 2px solid #4caf50;
    background: rgba(76, 175, 80, 0.1);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

.night-summary-pose .pose-recommended {
    font-size: 0.6rem;
    color: #4caf50;
    font-weight: 600;
    margin-top: 2px;
    text-transform: uppercase;
}

.night-summary-reco-note {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 10px;
    font-style: italic;
}

/* ========== Twilight bar ========== */

.twilight-bar {
    margin-top: 10px;
    margin-bottom: 4px;
}

.twilight-strip {
    display: flex;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
    border: 1px solid var(--border);
}

.twilight-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}

.twilight-segment.day       { background: #3b2d7a; }
.twilight-segment.civil     { background: #2a1e60; }
.twilight-segment.nautical  { background: #1c1348; }
.twilight-segment.astro     { background: #110a30; }
.twilight-segment.night     { background: #08051a; }

.twilight-labels {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.twilight-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.twilight-group {
    display: flex;
    gap: 6px 14px;
}

.twilight-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.twilight-dot.sunset   { background: #3b2d7a; }
.twilight-dot.civil    { background: #2a1e60; }
.twilight-dot.nautical { background: #1c1348; }
.twilight-dot.astro    { background: #110a30; }

/* ========== Home controls ========== */

.home-controls {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.home-controls .form-group.inline {
    flex: 1;
    margin-bottom: 0;
}

.home-controls .form-group.inline label {
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.home-controls .form-group.inline select {
    padding: 8px 10px;
    font-size: 0.85rem;
}

/* Seeing bar */
.seeing-bar {
    margin: 2px 0;
}

.seeing-loading {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.seeing-mode-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 4px;
    text-align: center;
    width: 100%;
}
.seeing-row-top {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 6px;
    margin-bottom: 2px;
}
.seeing-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-secondary);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
}
.seeing-btn:hover {
    background: rgba(255,255,255,0.15);
    color: var(--text-primary);
}
.seeing-btn-inline {
    display: flex;
    align-items: center;
}
.seeing-btn-refresh {
    padding: 2px 6px;
    font-size: 0.7rem;
    border: none;
    background: none;
    filter: grayscale(1) brightness(0.6) sepia(1) hue-rotate(220deg) saturate(3) brightness(1.2);
}
.seeing-refresh {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.seeing-ago {
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.6;
}
.seeing-cloud-toggle {
    cursor: pointer;
}
.seeing-cloud-toggle:hover .seeing-label {
    color: var(--text-primary);
}
.cloud-detail {
    display: none;
    gap: 14px;
}
.cloud-detail-open {
    display: contents;
}

.seeing-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 8px 0;
    font-size: 0.8rem;
    flex-wrap: wrap;
}
@media (min-width: 768px) {
    .seeing-row-top {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    .seeing-row-top,
    .seeing-row-meteo {
        display: contents;
    }
    .seeing-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 14px;
        padding: 8px 0;
        font-size: 0.8rem;
    }
}

.seeing-sub-item .seeing-label {
    font-size: 0.58rem;
    opacity: 0.7;
}

.seeing-sub-item .seeing-value {
    font-size: 0.75rem;
    font-weight: 600;
}

.seeing-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.seeing-main {
    flex-shrink: 0;
}

.seeing-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.seeing-value {
    font-weight: 700;
    font-size: 0.85rem;
}

.seeing-dots {
    display: flex;
    gap: 3px;
}

.seeing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.seeing-sub {
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

.seeing-warn .seeing-value {
    color: #ff8c42;
}

.seeing-warn .seeing-label {
    color: #ff8c42;
}

.controls-label {
    width: 100%;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.controls-info {
    margin-left: auto;
    opacity: 0.4;
    cursor: help;
}

.select-icon-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    vertical-align: middle;
}

.select-with-icon {
    display: flex;
    align-items: center;
    gap: 6px;
}

.select-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.select-with-icon select {
    flex: 1;
    min-width: 0;
}

/* ========== Favoris ========== */

.card-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-fav {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

.btn-fav:hover {
    color: #e74c6f;
    transform: scale(1.2);
}

.btn-fav.active {
    color: #e74c6f;
}

/* ========== Cards (liste de cibles) ========== */

.card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.1s;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.overlay-header h1 {
    font-family: 'Orbitron', sans-serif;
}



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

.card-score {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
}

.card-score:hover {
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(74, 217, 122, 0.4);
}


.card-score.high {
    background: rgba(74, 217, 122, 0.15);
    color: var(--score-high);
}

.card-score.medium {
    background: rgba(217, 168, 74, 0.15);
    color: var(--score-medium);
}

.card-score.low {
    background: rgba(217, 74, 74, 0.15);
    color: var(--score-low);
}

.card-meta {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.card-indicator {
    display: inline-flex;
    align-items: center;
}

.season-bar-wrap {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 10px 12px 6px;
    margin-top: 8px;
}

.season-bar {
    display: block;
    width: 100%;
}

.ang-dots-inline {
    vertical-align: middle;
}
.ang-dots-inline .ang-dot.on {
    opacity: 0.7;
}

/* ========== Top Picks ========== */

.top-picks {
    margin-bottom: 20px;
}

.top-picks-header,
.discoveries-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.top-picks-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--score-high);
    padding-left: 4px;
    letter-spacing: 0.3px;
}

.shuffle-btn {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.shuffle-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

body.night-red .shuffle-btn:hover {
    color: #cc3333;
    border-color: #cc3333;
}

.top-picks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card.top-pick {
    border: 1.5px solid var(--score-high);
    box-shadow: 0 0 10px rgba(74, 217, 122, 0.1);
}

.card.top-pick:hover {
    border-color: var(--score-high);
    box-shadow: 0 0 14px rgba(74, 217, 122, 0.2);
}

body.night-red .card.top-pick {
    border-color: #883322;
    box-shadow: 0 0 10px rgba(136, 51, 34, 0.15);
}

/* Discoveries */

.discoveries {
    margin-bottom: 20px;
}

.discoveries-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--score-medium);
    padding-left: 4px;
    letter-spacing: 0.3px;
}

.discoveries-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card.discovery {
    border: 1.5px solid var(--score-medium);
    box-shadow: 0 0 10px rgba(217, 168, 74, 0.1);
}

.card.discovery:hover {
    border-color: var(--score-medium);
    box-shadow: 0 0 14px rgba(217, 168, 74, 0.2);
}

body.night-red .card.discovery {
    border-color: #664422;
    box-shadow: 0 0 10px rgba(102, 68, 34, 0.15);
}

/* Card body layout */

.card-body {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.card-framing {
    flex-shrink: 0;
    background: rgba(10, 10, 15, 0.5);
    border-radius: 4px;
    padding: 2px;
    border: 1px solid var(--border);
}

.card-framing svg {
    display: block;
}

.framing-preview-large {
    display: flex;
    justify-content: center;
    background: rgba(5, 5, 10, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    margin-bottom: 16px;
}

.framing-preview-large svg {
    display: block;
}

.score-framing-section {
    margin-bottom: 4px;
}

/* Catalog badges */

.cat-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.3px;
}

.cat-messier { background: rgba(74, 217, 122, 0.2); color: #4ad97a; }
.cat-ngc     { background: rgba(74, 144, 217, 0.2); color: #4a90d9; }
.cat-ic      { background: rgba(138, 74, 217, 0.2); color: #b88adb; }
.cat-sh2     { background: rgba(217, 74, 74, 0.2); color: #d97a7a; }
.cat-barnard { background: rgba(160, 140, 100, 0.2); color: #a08c64; }
.cat-other   { background: rgba(100, 100, 100, 0.2); color: #888; }

body.night-red .cat-messier,
body.night-red .cat-ngc,
body.night-red .cat-ic,
body.night-red .cat-sh2,
body.night-red .cat-barnard {
    background: rgba(120, 40, 40, 0.2);
    color: #aa4444;
}

/* Magnitude dots */

.mag-dots {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.mag-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.mag-dot.filled {
    background: #e8c84a;
    box-shadow: 0 0 3px rgba(232, 200, 74, 0.5);
}

.mag-dot.empty {
    background: var(--bg-input);
    border: 1px solid var(--border);
}

.card-reason {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: italic;
}

/* ========== Forms ========== */

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-group label.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label.toggle-label input[type="checkbox"] {
    width: auto;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
}

select,
.form-group select,
.home-controls select,
.gear-form select {
    color-scheme: dark;
}

select option {
    background: #1a1a26;
    color: #d0d0dd;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* ========== Buttons ========== */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-input);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

/* ========== Settings sections ========== */

.settings-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}

.settings-section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 14px;
}

.sites-list {
    margin-bottom: 14px;
}

.site-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.site-item.active {
    border-color: var(--accent);
    background: rgba(123, 95, 231, 0.08);
}

.site-item-info {
    flex: 1;
}

.site-item-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.site-item-detail {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.site-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-icon-small {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.btn-icon-small:hover {
    opacity: 1;
}

.site-links {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

.site-links a {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.site-links a:hover {
    color: var(--accent);
}

/* ========== Setup list ========== */

.setup-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setup-item-info {
    flex: 1;
}

.setup-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.setup-item-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.setup-item-actions {
    display: flex;
    gap: 8px;
}

/* ========== Checklist ========== */

.checklist-group {
    margin-bottom: 16px;
}

.checklist-group-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(42, 42, 58, 0.5);
}

.checklist-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checklist-item.checked label {
    color: var(--text-muted);
    text-decoration: line-through;
}

.checklist-item label {
    font-size: 0.9rem;
    cursor: pointer;
    flex: 1;
}

.checklist-item .required {
    color: var(--warning);
    font-size: 0.75rem;
    font-weight: 600;
}

.checklist-item.important {
    background: rgba(255, 170, 0, 0.1);
    border-left: 3px solid #ffaa00;
    padding-left: 8px;
    border-radius: 4px;
}

.checklist-item.important label {
    color: #ffaa00;
    font-weight: 600;
}

.checklist-item.important.checked label {
    color: var(--text-muted);
}

.checklist-item.critical {
    background: rgba(220, 40, 40, 0.1);
    border-left: 3px solid #dc2828;
    padding-left: 8px;
    border-radius: 4px;
}

.checklist-item.critical label {
    color: #dc2828;
    font-weight: 600;
}

.checklist-item.critical.checked label {
    color: var(--text-muted);
}

.checklist-progress {
    margin-bottom: 16px;
}

.checklist-progress-bar {
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.checklist-progress-fill {
    height: 100%;
    background: #4caf50;
    border-radius: 4px;
    transition: width 0.3s;
}

.checklist-progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.checklist-group-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.checklist-group.done .checklist-group-title {
    color: #4caf50;
}

/* ---- Mode édition checklist ---- */

.checklist-edit-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checklist-edit-section-title {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 10px;
    outline: none;
}

.checklist-edit-section-title:focus {
    border-color: var(--accent);
}

.checklist-edit-btns {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.btn-icon-sm {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    width: 26px;
    height: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.btn-icon-sm:hover {
    background: rgba(123, 95, 231, 0.1);
    color: var(--accent);
}

.cl-delete-section:hover,
.cl-delete-item:hover {
    background: rgba(217, 74, 74, 0.15) !important;
    color: var(--danger) !important;
}

.checklist-edit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px !important;
}

.checklist-edit-item-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.checklist-edit-label {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.82rem;
    padding: 6px 10px;
    outline: none;
    min-width: 0;
}

.checklist-edit-label:focus {
    border-color: var(--accent);
}

.checklist-edit-flags {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.cl-flag {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    font-size: 0.75rem;
    width: 28px;
    height: 28px;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.15s;
}

.cl-flag:hover {
    opacity: 0.7;
}

.cl-flag.active {
    opacity: 1;
}

.cl-flag-critical {
    color: var(--danger);
}

.cl-flag-critical.active {
    background: rgba(217, 74, 74, 0.15);
    border-color: var(--danger);
}

.cl-flag-important {
    color: var(--warning);
}

.cl-flag-important.active {
    background: rgba(217, 168, 74, 0.15);
    border-color: var(--warning);
}

.cl-add-item {
    margin: 8px 0 4px;
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
    width: 100%;
}

#checklist-edit-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

#checklist-edit-toggle {
    font-size: 1.2rem;
    padding: 4px 8px;
}

/* ========== Guide cameras ========== */

.guide-cameras {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-camera {
    padding: 0;
}

.guide-camera-photo {
    display: block;
    width: 100px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    margin: 0 0 8px;
}

.guide-camera-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-camera-priority {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.guide-camera-priority.fallback {
    background: rgba(255, 170, 0, 0.15);
    color: #ffaa00;
}

/* ========== Système solaire ========== */

.solar-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.solar-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.solar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.solar-card.high {
    border-left: 3px solid #4caf50;
}

.solar-card.medium {
    border-left: 3px solid #ffaa00;
}

.solar-card.low {
    border-left: 3px solid #ff5555;
}

.solar-card.hidden {
    opacity: 0.5;
    border-left: 3px solid var(--border);
}

.solar-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.solar-emoji {
    font-size: 1.3rem;
}

.solar-name {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
}

.solar-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.solar-status.high {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.solar-status.medium {
    background: rgba(255, 170, 0, 0.15);
    color: #ffaa00;
}

.solar-status.low {
    background: rgba(255, 85, 85, 0.15);
    color: #ff5555;
}

.solar-status.hidden {
    background: rgba(128, 128, 128, 0.1);
    color: var(--text-muted);
}

.solar-card-body {
    padding-top: 4px;
}

.solar-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 12px;
    font-size: 0.85rem;
}

.solar-dl dt {
    color: var(--text-secondary);
}

.solar-dl dd {
    color: var(--text-primary);
}

.solar-extra {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

.solar-extra.warning {
    color: #ff5555;
}

.solar-constellation {
    font-size: 0.7rem;
    color: var(--accent);
    opacity: 0.7;
    font-style: italic;
}

.altitude-curve {
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 6px;
}

.altitude-curve-svg {
    width: 100%;
    height: auto;
}

.solar-section {
    margin-bottom: 24px;
}

.solar-section h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: 12px;
}

/* Calendrier lunaire (ligne) */

.moon-calendar-line {
    margin-top: 12px;
    padding: 4px 0;
}

.moon-calendar-title {
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-transform: capitalize;
}

.moon-cal-strip {
    display: flex;
    justify-content: space-between;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.moon-cal-strip::-webkit-scrollbar {
    display: none;
}

.moon-cal-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    border-radius: 4px;
    padding: 2px 1px;
}

.moon-cal-cell.today {
    background: none;
}
.moon-cal-cell.today .moon-cal-num {
    font-weight: 700;
    color: var(--accent);
}

.moon-cal-cell.selected {
    background: none;
}

.moon-cal-num {
    font-size: 0.55rem;
    color: var(--text-muted);
    line-height: 1;
}

.moon-cal-emoji {
    font-size: 0.7rem;
    line-height: 1;
}

/* Événements lunaires */

.moon-events {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.moon-event {
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 3px 8px;
    border-radius: 4px;
}

/* ========== Sky Map ========== */

.skymap-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-shrink: 0;
}
.skymap-time-header {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}
.skymap-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.skymap-svg {
    width: 100%;
    max-width: 600px;
    height: auto;
    touch-action: none;
}
.skymap-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: -12px 0 8px;
}
@media (max-width: 767px) {
    section#screen-skymap.screen.active {
        display: flex !important;
        flex-direction: column;
        height: calc(100dvh - 56px - 56px - env(safe-area-inset-bottom));
        box-sizing: border-box;
        padding-bottom: 0;
    }
    #skymap-container {
        flex: 1;
        min-height: 0;
        margin: 0 -16px;
        overflow: hidden;
        touch-action: none;
    }
    .skymap-wrap {
        width: 100%;
        height: 100%;
    }
    .skymap-svg {
        width: 100%;
        height: 100%;
    }
}

.skymap-target-label {
    font-family: 'Inter', sans-serif;
}

.skymap-star-label {
    font-family: 'Inter', sans-serif;
    font-style: italic;
}

/* ========== Overlay detail ========== */

.overlay-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.overlay-header h1 {
    font-size: 1.15rem;
}

#detail-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
}

.detail-section {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

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

.detail-links {
    display: flex;
    gap: 10px;
}

.detail-links .btn {
    flex: 1;
    text-align: center;
}

.detail-section h2 {
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    font-size: 0.88rem;
}

.detail-grid dt {
    color: var(--text-secondary);
}

.detail-grid dd {
    color: var(--text-primary);
    font-weight: 500;
}

/* Courbe d'altitude */

.alt-curve-wrap {
    margin-bottom: 10px;
}

.alt-curve-svg {
    width: 100%;
    height: auto;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 4px;
}

.alt-curve-legend {
    display: flex;
    justify-content: center;
    gap: 14px;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.alt-legend-green {
    color: #4caf50;
}

.alt-legend-red {
    color: #ff5555;
}

.alt-legend-line {
    color: var(--accent);
}

.alt-legend-moon {
    color: #ffdc64;
}

.aladin-survey-row {
    margin-bottom: 8px;
}

.aladin-survey-select {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    padding: 6px 10px;
    font-size: 0.8rem;
    outline: none;
    width: 100%;
}

#aladin-container {
    width: 100%;
    height: 300px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

/* ========== Meteoblue settings ========== */

.meteoblue-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.meteoblue-key-input {
    flex: 1;
    font-size: 0.8rem;
}
.btn-reveal {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    opacity: 0.6;
}
.btn-reveal:hover {
    opacity: 1;
}
.meteoblue-toggle {
    margin-top: 6px;
}
.meteoblue-toggle input {
    width: auto;
    display: inline;
    margin-right: 6px;
}

/* ========== Placeholder ========== */

.placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 10px;
    font-size: 0.9rem;
}
.spinner-dots {
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-align-items: center;
    align-items: center;
}
.spinner-dots .dot {
    width: 8px;
    height: 8px;
    margin: 0 2.5px;
    border-radius: 50%;
    background: var(--accent);
    -webkit-animation: dot-wave 1.2s ease-in-out infinite;
    animation: dot-wave 1.2s ease-in-out infinite;
}
.spinner-dots .dot:nth-child(2) { -webkit-animation-delay: 0.1s; animation-delay: 0.1s; }
.spinner-dots .dot:nth-child(3) { -webkit-animation-delay: 0.2s; animation-delay: 0.2s; }
.spinner-dots .dot:nth-child(4) { -webkit-animation-delay: 0.3s; animation-delay: 0.3s; }
.spinner-dots .dot:nth-child(5) { -webkit-animation-delay: 0.4s; animation-delay: 0.4s; }
@-webkit-keyframes dot-wave {
    0%, 60%, 100% { -webkit-transform: scale(0.4); opacity: 0.3; }
    30% { -webkit-transform: scale(1); opacity: 1; }
}
@keyframes dot-wave {
    0%, 60%, 100% { transform: scale(0.4); opacity: 0.3; }
    30% { transform: scale(1); opacity: 1; }
}

/* ========== Info bulle ========== */

.info-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    font-style: normal;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 4px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.info-toggle:active,
.info-toggle.active {
    border-color: var(--accent);
    color: var(--accent);
}
.info-bubble {
    display: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 6px 0;
    font-size: 0.62rem;
    line-height: 1.2;
    color: var(--text-muted);
    font-style: normal;
    text-align: center;
    width: 100%;
    flex-basis: 100%;
}
.info-bubble.visible {
    display: block;
}

/* ========== Responsive ========== */

@media (max-width: 480px) {

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

/* ========== Setup detail cards ========== */

.setup-detail-sensor {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.sensor-photo {
    display: block;
    width: 140px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    margin: 12px auto 0;
}

.setup-photo {
    display: block;
    width: 140px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    margin: 12px auto 0;
}

.setup-inline-photo {
    width: 80px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    margin-top: 4px;
}

.setup-detail-sensor h2 {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.setup-detail-card {
    background: linear-gradient(135deg, var(--bg-secondary), rgba(0, 0, 0, 0.2));
    border: 1px solid transparent;
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.setup-detail-card:hover {
    border-color: rgba(123, 95, 231, 0.3);
}

.gear-editing .setup-detail-card:hover {
    border-color: var(--warning);
}

/* Collapsed header */
.setup-card-header {
    padding: 12px 16px;
    cursor: pointer;
}

.setup-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setup-card-toggle {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.setup-card-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    flex: 1;
    min-width: 0;
}

.setup-card-header-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 10px;
}

.setup-card-photo {
    display: block;
    width: 140px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
    transition: width 0.2s;
}

.setup-detail-card.open .setup-card-photo {
    width: 100px;
}

.setup-card-preview {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 2px;
}

.preview-spec {
    font-size: 0.72rem;
    color: var(--text-secondary, rgba(255,255,255,0.5));
    line-height: 1.4;
}

.setup-detail-card.open .setup-card-preview {
    display: none;
}

/* Body hidden by default */
.setup-card-body {
    display: none;
    padding: 0 16px 16px;
}

.setup-detail-card.open .setup-card-body {
    display: block;
}

/* Legacy compat */
.setup-detail-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
}

.setup-detail-type {
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(74, 144, 217, 0.12);
    color: var(--accent);
}

.setup-detail-section {
    margin-bottom: 12px;
}

.setup-dual-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.82rem;
}

.setup-dual-table th {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.setup-dual-table th:first-child {
    text-align: left;
}

.setup-dual-table td {
    padding: 5px 8px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.setup-dual-table td:first-child {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.setup-dual-table td:nth-child(2),
.setup-dual-table td:nth-child(3) {
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
}

.setup-detail-section h3 {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 6px;
    font-weight: 600;
}

.setup-detail-targets,
.setup-detail-notes {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.setup-detail-filter-note {
    font-size: 0.8rem;
    color: var(--warning);
    margin-top: 4px;
    font-style: italic;
}

/* ========== Setup filter rows ========== */

.setup-filter-row {
    padding: 10px 0;
    border-bottom: 1px solid rgba(42, 42, 58, 0.5);
}

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

.setup-filter-name {
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 4px;
}

.setup-filter-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.setup-filter-type {
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.setup-filter-type.narrowband {
    background: rgba(138, 74, 217, 0.15);
    color: #b88adb;
}

.setup-filter-type.broadband {
    background: rgba(74, 217, 176, 0.15);
    color: #6ad9b0;
}

.setup-filter-channels {
    color: var(--accent);
    font-weight: 500;
}

.setup-filter-bandpass {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-style: italic;
}

.setup-filter-combo {
    font-size: 0.78rem;
    color: var(--warning);
    margin-top: 3px;
    font-style: italic;
}

/* ========== Modal ========== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
    flex: 1;
}

.modal-header .btn-icon {
    font-size: 1.6rem;
    color: var(--text-secondary);
}

/* Score breakdown */

.score-profile {
    display: inline-block;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(74, 144, 217, 0.15);
    color: var(--accent);
    margin-bottom: 14px;
}

.score-total {
    text-align: center;
    margin-bottom: 18px;
}

.score-total-value {
    font-size: 2.4rem;
    font-weight: 700;
}

.score-total-value.high { color: var(--score-high); }
.score-total-value.medium { color: var(--score-medium); }
.score-total-value.low { color: var(--score-low); }

.score-total-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.score-row {
    margin-bottom: 12px;
}

.score-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.score-row-label {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.score-row-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.score-bar {
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.score-bar-fill.high { background: var(--score-high); }
.score-bar-fill.medium { background: var(--score-medium); }
.score-bar-fill.low { background: var(--score-low); }

.score-row-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Tips */

.score-tips {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.score-tips h3 {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 8px;
}

.score-tip {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 6px 0;
    padding-left: 12px;
    border-left: 2px solid var(--accent);
    margin-bottom: 6px;
}

.score-warnings {
    margin-top: 12px;
}

.score-warning {
    font-size: 0.82rem;
    color: var(--warning);
    padding: 6px 0;
    padding-left: 12px;
    border-left: 2px solid var(--warning);
    margin-bottom: 6px;
}

/* ========== Night mode toggle ========== */

.night-mode-btn {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

.night-mode-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

body.night-red .night-mode-btn {
    color: #cc3333;
    border-color: rgba(204, 51, 51, 0.3);
    background: none;
}

@media (max-width: 767px) {
    .night-mode-btn {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
}

/* ========== Night red mode ========== */

body.night-red {
    --bg-primary: #0a0000;
    --bg-secondary: #120000;
    --bg-card: #1a0505;
    --bg-input: rgba(10, 0, 0, 0.3);
    --border: transparent;
    --border-subtle: rgba(204, 51, 51, 0.15);
    --moon-lit: #cc6666;
    --moon-dark: #1a0505;
    --moon-rim: #662222;
    --text-primary: #cc4444;
    --text-secondary: #883333;
    --text-muted: #552222;
    --accent: #cc3333;
    --accent-hover: #dd4444;
    --score-high: #cc4444;
    --score-medium: #aa3333;
    --score-low: #662222;
    --warning: #aa4422;
    --success: #883322;
}

body.night-red .brand-name {
    color: #cc3333;
    text-shadow: 0 0 8px rgba(204, 51, 51, 0.5);
}

body.night-red .card-score.high {
    background: rgba(204, 68, 68, 0.15);
    color: #cc4444;
}

body.night-red .card-score.medium {
    background: rgba(170, 51, 51, 0.15);
    color: #aa3333;
}

body.night-red .card-score.low {
    background: rgba(102, 34, 34, 0.15);
    color: #662222;
}

body.night-red .mag-dot.filled {
    background: #cc4444;
    box-shadow: 0 0 3px rgba(204, 68, 68, 0.4);
}

body.night-red .dur-bar {
    background: #cc4444;
}

body.night-red .sort-btn.active,
body.night-red .sort-btn.flipped {
    border-color: #cc4444;
    background: rgba(204, 68, 68, 0.08);
}

body.night-red .ang-dot.on {
    background: rgba(204, 68, 68, 0.15);
    border-color: #cc4444;
}

body.night-red .ang-dot.s1 {
    background: rgba(204, 68, 68, 0.15) !important;
    border-color: #cc4444 !important;
}

body.night-red .dur-bars-inline .dur-bar.on {
    background: #cc4444;
}

body.night-red .season-bar-wrap {
    border-color: rgba(204, 68, 68, 0.2);
}

body.night-red .moon-phase-pct {
    color: #cc4444;
}

body.night-red .moon-trend {
    color: #cc3333;
    text-shadow: 0 0 8px rgba(204, 51, 51, 0.5), 0 0 16px rgba(204, 51, 51, 0.3);
}

body.night-red .setup-filter-type.narrowband {
    background: rgba(170, 51, 51, 0.15);
    color: #aa4444;
}

body.night-red .setup-filter-type.broadband {
    background: rgba(170, 68, 51, 0.15);
    color: #aa5544;
}

body.night-red .twilight-segment.day     { background: #3a1515; }
body.night-red .twilight-segment.civil   { background: #2a0e0e; }
body.night-red .twilight-segment.nautical { background: #1a0808; }
body.night-red .twilight-segment.astro   { background: #100404; }
body.night-red .twilight-segment.night   { background: #080202; }
body.night-red .twilight-segment         { color: #883333; }
body.night-red .twilight-label           { color: #883333; }
body.night-red .twilight-dot             { background: #662222 !important; }

body.night-red .score-bar-fill.high   { background: #cc4444; }
body.night-red .score-bar-fill.medium { background: #aa3333; }
body.night-red .score-bar-fill.low    { background: #662222; }

body.night-red .night-summary-title     { color: #cc4444; }
body.night-red .night-summary-block .time { color: #cc4444; }
body.night-red .night-summary-block .label { color: #883333; }
body.night-red .night-summary-duration  { color: #cc4444; }
body.night-red .night-summary-reco-note { color: #883333; }
body.night-red .night-summary-pose      { border-color: #331111; }
body.night-red .night-summary-pose .pose-count { color: #cc4444; }
body.night-red .night-summary-pose .pose-label { color: #883333; }
body.night-red .night-summary-pose.recommended {
    border-color: #cc3333;
    background: rgba(204, 51, 51, 0.08);
}

body.night-red img {
    filter: saturate(0) brightness(0.6) sepia(1) hue-rotate(-30deg);
}

body.night-red .seeing-dot {
    background: #883333 !important;
}

body.night-red .seeing-dot:first-child {
    background: #cc4444 !important;
}

body.night-red .seeing-value {
    color: #cc4444 !important;
}

body.night-red .nav-divider,
body.night-red .section-divider span {
    background: linear-gradient(90deg, transparent, #cc3333, transparent);
}

body.night-red #nav-date-label {
    color: #883333;
}

body.night-red .spinner-dots .dot {
    background: #cc3333;
}

body.night-red .skymap-svg circle,
body.night-red .skymap-svg line {
    opacity: 0.7;
}

body.night-red .skymap-svg text {
    fill: #cc4444;
    opacity: 0.6;
}

/* ========== Scrollbar ========== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ========================================
   Compte (auth + sync)
   ======================================== */

.account-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.account-tab {
    flex: 1;
    padding: 8px 0;
    background: var(--bg-card);
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.account-tab.active {
    background: var(--accent);
    color: #fff;
}

.account-tab-content {
    display: none;
}

.account-tab-content.active {
    display: block;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.account-email {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.account-sync {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.account-actions .btn {
    flex: 1;
    min-width: 120px;
    font-size: 0.82rem;
    padding: 8px 12px;
}

.btn-danger-text {
    color: var(--danger) !important;
    border-color: rgba(217, 74, 74, 0.3) !important;
}

.btn-danger-text:hover {
    background: rgba(217, 74, 74, 0.1) !important;
}

.account-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.82rem;
    display: none;
}

.account-message.success {
    display: block;
    background: rgba(74, 217, 122, 0.1);
    color: var(--success);
    border: 1px solid rgba(74, 217, 122, 0.2);
}

.account-message.error {
    display: block;
    background: rgba(217, 74, 74, 0.1);
    color: var(--danger);
    border: 1px solid rgba(217, 74, 74, 0.2);
}

.account-message.info {
    display: block;
    background: rgba(123, 95, 231, 0.1);
    color: var(--accent);
    border: 1px solid rgba(123, 95, 231, 0.2);
}

/* ========================================
   Gear edit forms
   ======================================== */

.gear-form .form-group {
    margin-bottom: 10px;
}

.gear-form label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.gear-form input,
.gear-form select,
.gear-form textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.gear-form input:focus,
.gear-form select:focus,
.gear-form textarea:focus {
    border-color: var(--accent);
}

.gear-form textarea {
    resize: vertical;
    font-family: inherit;
}

.gear-form .form-row {
    display: flex;
    gap: 8px;
}

.gear-form .form-row .form-group {
    flex: 1;
}

.gear-form-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.gear-spec-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
}

.gear-spec-row input {
    flex: 1;
    min-width: 0;
}

.gear-edit-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.gear-edit-row .btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 6px 10px;
}

.gear-priority {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

.gear-priority.primaire {
    background: rgba(74, 217, 122, 0.15);
    color: var(--success);
}

.gear-priority.secondaire {
    background: rgba(217, 168, 74, 0.15);
    color: var(--warning);
}

.gear-quick-add {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.gear-quick-btn {
    font-size: 0.75rem !important;
    padding: 5px 10px !important;
    flex: 0 0 auto;
}

.gear-demo-banner {
    background: rgba(123, 95, 231, 0.08);
    border: 1px solid rgba(123, 95, 231, 0.2);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
}

.gear-demo-banner strong {
    color: var(--accent);
}

.gear-demo-banner a {
    color: var(--accent);
    text-decoration: underline;
}

.gear-form-preview {
    display: block;
    max-width: 120px;
    max-height: 80px;
    border-radius: var(--radius);
    margin-bottom: 6px;
    border: 1px solid var(--border-subtle);
}

.gear-file-input {
    width: 100%;
    padding: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.82rem;
}

.gear-file-input::file-selector-button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    margin-right: 8px;
}

.cal-preview {
    margin-bottom: 10px;
}

.cal-preview-section {
    margin-bottom: 8px;
}

.cal-preview-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cal-tag {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.cal-tag strong {
    color: var(--text-primary);
}

.cal-tag-muted {
    background: none;
    padding: 4px 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    align-self: center;
}

.cal-preview-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cal-preview-filters {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cal-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: var(--bg-card);
    border-radius: 4px;
    font-size: 0.8rem;
}

.cal-filter-name {
    flex: 1;
    color: var(--text-primary);
}

.cal-filter-flux {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
}

.cal-filter-topt {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 500;
    min-width: 55px;
    text-align: right;
}

.gear-cal-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.gear-cal-label {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.gear-cal-row input {
    width: 150px;
    flex: 0 0 150px;
}

.settings-help {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
    margin: 0 0 10px;
    padding: 8px 10px;
    background: rgba(123, 95, 231, 0.05);
    border-radius: var(--radius);
    border-left: 2px solid var(--accent);
}

#gear-edit-toggle {
    font-size: 0.85rem;
    padding: 6px 14px;
    white-space: nowrap;
    color: var(--accent);
}

.gear-edit-intro {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(123, 95, 231, 0.06);
    border-radius: var(--radius);
    border-left: 3px solid var(--accent);
}

.setup-detail-notes {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
    margin: 8px 0;
    padding: 6px 0 6px 10px;
    border-left: 2px solid var(--accent);
}

.setup-detail-notes::before {
    content: '📌 ';
}

.placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 16px 0;
}

/* ========================================
   Documentation modal + accordion
   ======================================== */

.modal-doc {
    max-width: 640px;
    max-height: 90vh;
}

.doc-intro {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.doc-accordion {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doc-section {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
}

.doc-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.doc-section-header:hover {
    background: rgba(123, 95, 231, 0.08);
}

.doc-section-header .doc-chevron {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.doc-section.open .doc-chevron {
    transform: rotate(90deg);
}

.doc-section-header .doc-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.doc-section-header .doc-section-icon {
    font-size: 1rem;
    flex-shrink: 0;
    filter: grayscale(0.3);
}

.doc-section-body {
    display: none;
    padding: 14px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle);
}

.doc-section.open .doc-section-body {
    display: block;
}

.doc-section-body h4 {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    margin: 12px 0 6px;
}

.doc-section-body h4:first-child {
    margin-top: 0;
}

.doc-section-body p {
    margin: 0 0 8px;
}

.doc-section-body ul {
    margin: 4px 0 10px;
    padding-left: 18px;
}

.doc-section-body li {
    margin-bottom: 4px;
}

.doc-section-body code {
    background: rgba(123, 95, 231, 0.12);
    color: var(--accent);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.78rem;
    font-family: 'Courier New', monospace;
}

.doc-section-body .doc-formula {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    overflow-x: auto;
}

.doc-section-body .doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 0.78rem;
}

.doc-section-body .doc-table th,
.doc-section-body .doc-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.doc-section-body .doc-table th {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.doc-section-body .doc-note {
    background: rgba(123, 95, 231, 0.06);
    border-left: 3px solid var(--accent);
    padding: 8px 12px;
    margin: 8px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.78rem;
    color: var(--text-primary);
}
