/* =========================================================
   1) THEME / VARIABLES
   ========================================================= */

:root {
    /* Backgrounds */
    --bg-deep: #152d2a;
    --bg-surface: #1d413d;
    --bg-card: #21433f;
    --bg-hover: #29534d;

    /* Borders / focus */
    --border: #3c7b74;
    --border-focus: #e4916e;

    /* Text */
    --text: #d5d5d5;
    --text-dim: #a5aeac;
    --text-extradim: #535857;
    --text-bright: #f1f1f1;

    /* Accent */
    --accent: #e4916e;
    --accent-glow: rgba(228, 145, 110, 0.16);

    /* Semantic colors */
    --green: #58a38c;
    --yellow: #d8b36c;
    --orange: #c7845d;
    --red: #d46f6f;
    --purple: #77b8ae;

    /* Fonts */
    --mono: 'JetBrains Mono', monospace;
    --sans: 'Outfit', sans-serif;
    --inter: 'Inter', sans-serif;

    /* Layout */
    --radius: 6px;
    --transition: 150ms ease;
    --param-control-height: 40px;
    --top-panel-height: 256px;

    /* Table group accent colors */
    --table-accent-delete: #808080;
    --table-accent-id: #e4916e;
    --table-accent-typeconst: #e4916e;
    --table-accent-radec: #58a38c;
    --table-accent-startstop: #2b618e;
    --table-accent-duration: #b8ab4a;
    --table-accent-alt-window: #7d4ab8;

    --table-accent-filter-l: #d9d9d9;
    --table-accent-filter-r: #e53935;
    --table-accent-filter-g: #43a047;
    --table-accent-filter-b: #1e88e5;
    --table-accent-filter-s: #e6a23c;
    --table-accent-filter-h: #9b2624;
    --table-accent-filter-o: #3cb9d6;

    /* Now / Avg switch */
    --switch-now-bg: #2b618e;
    --switch-now-text: #f1f1f1;
    --switch-now-border: #3e7caf;

    --switch-mean-bg: #512f78;
    --switch-mean-text: #f1f1f1;
    --switch-mean-border: #6d46a1;

    --switch-track-bg: var(--bg-surface);
    --switch-track-border: var(--border);
}


/* =========================================================
   2) RESET / BASE
   ========================================================= */

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

body {
    height: 100vh;
    overflow: hidden;
    background: var(--bg-deep);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.12) 0%, transparent 100%),
        radial-gradient(1px 1px at 30% 60%, rgba(255, 255, 255, 0.08) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 10%, rgba(255, 255, 255, 0.10) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 80%, rgba(255, 255, 255, 0.06) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 40%, rgba(255, 255, 255, 0.09) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 90%, rgba(255, 255, 255, 0.07) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 15%, rgba(255, 255, 255, 0.11) 0%, transparent 100%);
}

#app {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    padding: calc(var(--header-height, 68px) + 20px) 24px 20px;
    overflow: hidden;
}


/* =========================================================
   4) GENERIC LABELS / FORM ELEMENTS
   ========================================================= */

.param-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.param-group label,
.target-search-wrap label,
.target-row > label,
.time-mode-label {
    padding-left: 5px;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
}

.param-group label {
    text-transform: none;
}

.target-search-wrap label,
.target-row > label {
    text-transform: uppercase;
}

.param-group input,
.param-group select,
.target-search-wrap input,
.target-row textarea,
.target-row input[type="file"] {
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 13px;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.param-group input,
.param-group select,
.target-search-wrap input,
.target-row input[type="file"] {
    height: var(--param-control-height);
    padding: 0 10px;
}

.target-row textarea {
    width: 100%;
    min-height: 188px;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.45;
}

.param-group input:focus,
.param-group select:focus,
.target-search-wrap input:focus,
.target-row textarea:focus,
.target-row input[type="file"]:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

input[type="date"],
input[type="time"] {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-bright);
    color-scheme: dark;
}

.param-group input[type="number"] {
    width: 100px;
}

/* Hide spinner controls for latitude / longitude / altitude */
#paramLat,
#paramLon,
#paramAlt,
#sitePickerLat,
#sitePickerLon {
    appearance: textfield;
    -moz-appearance: textfield;
}

#paramLat::-webkit-outer-spin-button,
#paramLat::-webkit-inner-spin-button,
#paramLon::-webkit-outer-spin-button,
#paramLon::-webkit-inner-spin-button,
#paramAlt::-webkit-outer-spin-button,
#paramAlt::-webkit-inner-spin-button,
#sitePickerLat::-webkit-outer-spin-button,
#sitePickerLat::-webkit-inner-spin-button,
#sitePickerLon::-webkit-outer-spin-button,
#sitePickerLon::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#paramLat      { width: 100px; }
#paramAlt      { width: 80px; }
#paramBortle   { width: 70px; }
#paramRH       { width: 65px; }
#paramMinAlt   { width: 65px; }
#paramBandpass { width: 65px; }

/* =========================================================
   Site picker inline trigger
   Keep same footprint as previous longitude field
   ========================================================= */

.site-inline-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 132px;
    min-width: 132px;
}

.site-inline-wrap #paramLon {
    width: 100px;
    padding-right: 10px;
}

.site-inline-btn {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--accent);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.site-inline-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-focus);
    color: #e36a36;
}

.site-inline-btn:focus-visible {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.site-inline-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}


/* =========================================================
   5) BUTTONS
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    min-height: var(--param-control-height);
    width: 120px;
    min-width: 120px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
}

.btn:hover {
    border-color: var(--border-focus);
    background: var(--bg-hover);
}

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

.btn-primary:hover {
    background: #e36a36;
}

#btnCalculate {
    width: 100px;
    border-color: #e4916e;
    background: #e4916e;
    color: #fff;
}

#btnCalculate:hover,
#btnCalculate:focus,
#btnCalculate:focus-visible,
#btnCalculate:active {
    border-color: #e36a36;
    background: #e36a36;
    color: #fff;
}

#btnCalculate.is-dirty {
    border-color: #ff0000;
    background: #ff0000;
    color: #fff;
}

#btnCalculate.is-dirty:hover,
#btnCalculate.is-dirty:focus,
#btnCalculate.is-dirty:focus-visible,
#btnCalculate.is-dirty:active {
    border-color: #ff0000;
    background: #ff0000;
    color: #fff;
}

.btn-danger {
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--red);
}

.btn-danger:hover {
    border-color: var(--red);
    background: rgba(248, 113, 113, 0.1);
}

/* =========================================================
   6) TOP PARAMETERS BAR
   ========================================================= */

.params-bar {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px 16px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
}

.params-bar .btn {
    height: var(--param-control-height);
}

.param-separator {
    align-self: stretch;
    width: 1px;
    margin: 0 8px;
    background: var(--border);
}


/* =========================================================
   7) DATE / TIME PICKER WRAPPERS
   ========================================================= */

.picker-wrap {
    position: relative;
    display: flex;
    align-items: center;
    height: var(--param-control-height);
}

.picker-wrap input {
    height: 100%;
    padding-right: 38px;
    color: var(--text-bright);
}

.picker-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    opacity: 0.95;
    transform: translateY(-50%);
}

.picker-btn:hover {
    color: #e36a36;
}

.picker-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
    opacity: 0;
}

@-moz-document url-prefix() {
    .picker-btn[data-target="paramDate"] {
        display: none;
    }

    .picker-wrap input[type="date"] {
        padding-right: 12px;
    }
}


/* =========================================================
   8) TIME / TIMEZONE
   ========================================================= */

.time-mode-group {
    min-width: 0;
    position: relative;
    overflow: visible;
}

.time-mode-grid {
    position: relative;
    overflow: visible;
    display: grid;
    grid-template-columns: 95px auto 76px;
    grid-template-rows: auto var(--param-control-height);
    column-gap: 6px;
    row-gap: 4px;
    align-items: end;
}

.time-main-label {
    grid-column: 1 / 4;
    grid-row: 1;
}

.time-picker-wrap {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    width: auto;
    height: var(--param-control-height);
}

/* Bordure et fond portés par ::before pour ne pas être masqués par loverlay */
.time-picker-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    pointer-events: none;
    z-index: 0;
}

/* Input invisible mais fonctionnel — capture focus et événements wheel */
.time-picker-wrap input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
    z-index: 2;
    border: none;
    background: transparent;
    padding: 0;
}

/* Span visible — affiche HHhMM */
.time-display-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding-left: 12px;
    padding-right: 38px;
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 13px;
    pointer-events: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
    z-index: 1;
}

.time-picker-wrap.is-open::before {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.time-wheel-popup {
    --wheel-row-height: 32px;
    --wheel-visible-rows: 5;
    --wheel-column-width: 56px;
    --wheel-popup-width: 164px;
    --wheel-popup-height: calc(var(--wheel-row-height) * var(--wheel-visible-rows));

    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 60;

    width: var(--wheel-popup-width);
    height: var(--wheel-popup-height);
    padding: 0;

    border: 1px solid rgba(228, 145, 110, 0.32);
    border-radius: 12px;
    background: rgba(29, 65, 61, 0.98);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);

    overflow: hidden;
    user-select: none;
}

.time-wheel-columns {
    position: relative;
    z-index: 1;

    display: grid;
    grid-template-columns: var(--wheel-column-width) 12px var(--wheel-column-width);
    align-items: stretch;
    justify-content: center;

    width: 100%;
    height: 100%;
}

.time-wheel-column {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.time-wheel-scroll {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;

    scroll-snap-type: y mandatory;
    overscroll-behavior: contain;
    scrollbar-width: none;

    padding-top: calc(var(--wheel-popup-height) / 2 - var(--wheel-row-height) / 2);
    padding-bottom: calc(var(--wheel-popup-height) / 2 - var(--wheel-row-height) / 2);

    -ms-overflow-style: none;
}

.time-wheel-scroll::-webkit-scrollbar {
    display: none;
}

.time-wheel-option {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: var(--wheel-row-height);
    padding: 0;
    border: 0;
    background: transparent;

    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 15px;
    line-height: 1;
    letter-spacing: 0.2px;

    scroll-snap-align: center;
    cursor: pointer;
    transition:
        color var(--transition),
        opacity var(--transition),
        transform var(--transition);
}

.time-wheel-option:hover {
    color: var(--text-bright);
}

.time-wheel-option.is-selected {
    color: var(--text-bright);
    font-weight: 600;
}

.time-wheel-separator {
    display: flex;
    align-items: center;
    justify-content: center;

    height: 100%;

    color: rgba(241, 241, 241, 0.78);
    font-family: var(--mono);
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
}

.time-wheel-selection-window {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 50%;
    z-index: 2;

    height: var(--wheel-row-height);
    transform: translateY(-50%);

    border: 1px solid rgba(228, 145, 110, 0.42);
    border-radius: 10px;
    background:
        linear-gradient(
            180deg,
            rgba(228, 145, 110, 0.08) 0%,
            rgba(228, 145, 110, 0.14) 100%
        );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12);

    pointer-events: none;
}

.time-wheel-popup::before,
.time-wheel-popup::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    height: calc(var(--wheel-row-height) * 1.5);
    pointer-events: none;
}

.time-wheel-popup::before {
    top: 0;
    background: linear-gradient(
        180deg,
        rgba(29, 65, 61, 0.98) 0%,
        rgba(29, 65, 61, 0.78) 55%,
        rgba(29, 65, 61, 0) 100%
    );
}

.time-wheel-popup::after {
    bottom: 0;
    background: linear-gradient(
        0deg,
        rgba(29, 65, 61, 0.98) 0%,
        rgba(29, 65, 61, 0.78) 55%,
        rgba(29, 65, 61, 0) 100%
    );
}

.time-picker-wrap.is-open .picker-btn {
    color: var(--text-bright);
}

.param-group .param-tz-select {
    grid-column: 3;
    grid-row: 2;
    width: 76px;
    min-width: 76px;
    height: var(--param-control-height);
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1;
}

.time-mode-group {
    position: relative;
    overflow: visible;
}

.time-mode-grid {
    position: relative;
    overflow: visible;
}

.time-input-notice {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 40;

    max-width: 180px;
    padding: 6px 8px;

    border: 1px solid rgba(228, 145, 110, 0.32);
    border-radius: var(--radius);
    background: rgba(29, 65, 61, 0.96);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);

    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.2;

    pointer-events: none;
    white-space: nowrap;
}

.time-input-notice.is-warning {
    color: var(--accent);
    border-color: rgba(228, 145, 110, 0.55);
}

.time-choice-popup {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 50;
    width: 220px;
    padding: 10px;
    border: 1px solid var(--border-focus);
    border-radius: var(--radius);
    background: var(--bg-surface);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.time-choice-popup-title {
    margin-bottom: 4px;
    color: var(--text-bright);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.time-choice-popup-text {
    margin-bottom: 10px;
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.35;
}

.time-choice-popup-actions {
    display: flex;
    gap: 8px;
}

.time-choice-popup-actions .btn {
    width: auto;
    min-width: 90px;
    padding: 0 12px;
}

/* =========================================================
   9) TOP DASHBOARD ROW
   Search / Sun / Moon phase / Moon
   ========================================================= */

.control-row {
    display: flex;
    flex-shrink: 0;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 20px;
}

.info-panel-temp {
    flex: 18;
    min-width: 0;
}

.moon-phase-panel {
    flex: 0 0 clamp(180px, 15vw, 240px);
    min-width: 130px;
}

.info-panel-ephem {
    flex: 16;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: none;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.info-panel-ephem-sun,
.info-panel-ephem-moon {
    flex: 1 1 0;
    min-height: 0;
}

.control-row > .target-bar,
.control-row > .info-panel,
.control-row > .moon-phase-panel,
.control-row > .info-panel-ephem {
    height: var(--top-panel-height);
    min-height: var(--top-panel-height);
}


/* =========================================================
   10) TARGET BAR
   ========================================================= */

.target-bar {
    display: flex;
    flex-direction: column;
    flex: 24;
    gap: 10px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
}

.target-bar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.target-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Layout colonne icônes */
.target-bar-actions.target-bar-actions-stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    width: 100%;
}

/* Boutons icônes carrés */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

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

.btn-icon-primary:hover {
    background: #e36a36;
    border-color: #e36a36;
}

.btn-icon-danger {
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--red);
}

.btn-icon-danger:hover {
    border-color: var(--red);
    background: rgba(248, 113, 113, 0.1);
}

.btn-icon-secondary {
    border-color: var(--border);
    color: var(--text-dim);
}

.btn-icon-secondary:hover {
    border-color: var(--border-focus);
    background: var(--bg-hover);
    color: var(--text-bright);
}

.target-preview {
    display: flex;
    flex: 1;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
}

.target-preview-compact {
    width: 100%;
}

/* Anciens items (non utilisés dans le nouveau panneau, conservés pour compatibilité) */
.target-preview-item {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.target-preview-label {
    margin-bottom: 2px;
    font-size: 14px;
    text-transform: uppercase;
    opacity: 0.75;
}

.target-preview-value {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.target-preview-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-dim);
    font-size: 12px;
}

/* --- Nouveau panneau de survol --- */

.preview-img-wrap {
    position: relative;
    flex: 0 0 auto;
    width: auto;
    aspect-ratio: 1;
    height: 100%;
    background: #0a1f1d;
    overflow: hidden;
}

.preview-dss-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-img-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-dim);
    z-index: 1;
}

.preview-fov-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1px;
    background: rgba(10, 20, 18, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 4px;
    padding: 2px 5px 2px 4px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.preview-img-wrap:hover .preview-fov-badge {
    opacity: 1;
}

.preview-fov-input {
    width: 20px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-bright, #e8f0ee);
    font-size: 11px;
    font-family: inherit;
    text-align: right;
    padding: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.preview-fov-input::-webkit-inner-spin-button,
.preview-fov-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.preview-fov-input:focus {
    color: #fff;
}

.preview-fov-unit {
    font-size: 11px;
    color: var(--text-dim, #8aada7);
    user-select: none;
    line-height: 1;
}

/* ── Brightness slider ──────────────────────────────────────────────────────── */

.preview-brightness-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 6px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(10, 20, 18, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 4px;
    padding: 3px 6px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.preview-img-wrap:hover .preview-brightness-badge {
    opacity: 1;
}

.preview-brightness-icon {
    font-size: 10px;
    color: var(--text-dim);
    user-select: none;
    flex-shrink: 0;
    line-height: 1;
}

.preview-brightness-slider {
    flex: 1;
    height: 3px;
    min-width: 0;
    cursor: pointer;
    accent-color: var(--accent);
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}

.preview-brightness-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.preview-brightness-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
}


.preview-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    padding: 14px 14px 10px;
    min-width: 0;
    overflow: hidden;
}

.preview-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--sans);
}

.preview-comname {
    font-size: 11px;
    font-style: italic;
    color: var(--accent);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--sans);
}

.preview-row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    line-height: 1.4;
}

.preview-label {
    display: inline-block;
    flex: 0 0 50px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-dim);
    white-space: nowrap;
}

.preview-value {
    display: inline-block;
    flex: 1;
    font-size: 10px;
    font-family: var(--mono);
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Valeur multi-ligne (ex. TYPE avec plusieurs codes) */
.preview-value--wrap {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.5;
}


/* =========================================================
   11) TARGET BAR — SPLIT LAYOUT
   ========================================================= */

.target-bar.target-bar-split {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 25px;
    align-items: stretch;
    height: var(--top-panel-height);
}

.target-bar-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    height: 100%;
    min-height: 0;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.target-bar-card-actions {
    justify-content: center;
    border: none;
    background: transparent;
    padding: 4px 0;
}

.target-bar-card-summary {
    justify-content: flex-start;
    padding: 0;
    overflow: hidden;
}

.target-bar-card-summary .target-bar-summary {
    display: none;
}

.target-bar-card-summary .target-preview {
    flex: 1 1 auto;
    margin: 0;
    min-height: 0;
    max-height: none;
    height: 100%;
    border: none;
    border-radius: 0;
}

.target-bar-card-summary .target-preview.target-preview-compact {
    display: flex;
    align-items: stretch;
    background: transparent;
}

.target-bar-card-summary .target-preview.target-preview-empty {
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 12px;
    background: transparent;
}


/* =========================================================
   12) MODALS
   ========================================================= */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(2px);
}

.target-modal {
    position: fixed;
    inset: 0;
    z-index: 901;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.target-modal[hidden],
.modal-backdrop[hidden] {
    display: none !important;
}

.target-modal-dialog {
    display: flex;
    flex-direction: column;
    width: min(980px, 100%);
    max-height: calc(100vh - 56px);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--bg-surface);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.42);
}

.target-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.target-modal-title-wrap {
    min-width: 0;
}

.target-modal-title-wrap h2 {
    margin: 0;
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 22px;
    font-weight: 500;
}

.target-modal-subtitle {
    margin-top: 4px;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.4;
}

.target-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-bright);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition:
        border-color var(--transition),
        background var(--transition),
        color var(--transition);
}

.target-modal-close:hover {
    border-color: var(--border-focus);
    background: var(--bg-hover);
}

.target-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    padding: 18px 20px 20px;
    overflow: auto;
}

.confirm-modal-dialog {
    width: min(520px, 100%);
}

.confirm-modal-body {
    gap: 18px;
}

.confirm-modal-message {
    color: var(--text-bright);
    font-size: 15px;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.confirm-modal-actions .btn {
    width: auto;
    min-width: 120px;
    padding: 0 16px;
}


/* =========================================================
   13) BROWSE MODAL CONTENT
   ========================================================= */

/* --- Dialog sizing --- */

.browse-modal-dialog {
    width: min(1020px, 100%);
}

.browse-modal-body {
    padding: 0 !important;
    gap: 0 !important;
    overflow: hidden !important;
}

/* --- Layout two-column --- */

.browse-layout {
    display: flex;
    min-height: 0;
    height: 560px;
    max-height: calc(100vh - 160px);
}

/* --- Left column: catalog list --- */

.browse-col-catalogs {
    display: flex;
    flex-direction: column;
    flex: 0 0 180px;
    min-width: 0;
    border-right: 1px solid var(--border);
    background: var(--bg-card);
    overflow: hidden;
}

.browse-col-header {
    padding: 10px 14px 8px;
    color: var(--text-dim);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.browse-catalog-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.browse-catalog-group {
    margin-bottom: 2px;
}

.browse-catalog-group-label {
    padding: 6px 14px 2px;
    color: var(--text-dim);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    opacity: 0.55;
}

.browse-catalog-item {
    display: flex;
    align-items: center;
    padding: 7px 14px;
    color: var(--text-muted);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    border-radius: 0;
    outline: none;
}

.browse-catalog-item:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.browse-catalog-item.is-active {
    background: rgba(228, 145, 110, 0.12);
    color: var(--accent);
    font-weight: 600;
}

.browse-catalog-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* --- Right column: filter + target list --- */

.browse-col-targets {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.browse-filter-wrap {
    padding: 10px 14px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.browse-filter-label {
    display: none; /* Le header "FILTER" est dans browse-col-header */
}

.browse-filter-input {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 13px;
    transition: border-color var(--transition);
    box-sizing: border-box;
}

.browse-filter-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.browse-filter-input:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.browse-summary {
    padding: 6px 14px 4px;
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.4;
    flex-shrink: 0;
    min-height: 24px;
}

.browse-target-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* --- Target items --- */

.browse-target-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: background var(--transition);
    outline: none;
}

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

.browse-target-item:hover {
    background: var(--bg-hover);
}

.browse-target-item.is-plan {
    opacity: 0.55;
    cursor: default;
}

.browse-target-item.is-adding {
    opacity: 0.6;
    pointer-events: none;
}

.browse-target-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.browse-target-texts {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.browse-target-id {
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.browse-target-name {
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

.browse-target-meta {
    color: var(--text-dim);
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 2;
    margin-left: auto;
}

.browse-target-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 7px;
    border: 1px solid rgba(228, 145, 110, 0.24);
    border-radius: 999px;
    background: rgba(228, 145, 110, 0.08);
    color: var(--accent);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* --- Empty / loading states --- */

.browse-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
}

.browse-loading {
    opacity: 0.55;
}

/* --- Import preview list (conservé pour la modale import) --- */

.import-preview-list {
    min-height: 240px;
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.import-preview-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 20px;
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
}

/* --- Target-row styles conservés pour modale import --- */

#importFile {
    width: 100%;
}

.target-row-import-tools,
.target-row-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.target-import-summary {
    flex: 1;
    min-width: 0;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.4;
}

.target-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.target-row-actions .btn {
    width: auto;
    min-width: 120px;
    padding: 0 14px;
}

/* =========================================================
   14) IMPORT PREVIEW (LEGACY / TEMPORARY)
   ========================================================= */

.import-preview-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.import-preview-main,
.import-preview-side {
    min-width: 0;
}

.import-preview-main {
    flex: 1;
}

.import-preview-raw {
    overflow: hidden;
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-preview-message {
    margin-top: 2px;
    color: var(--text-dim);
    font-size: 11px;
}

.import-preview-resolved {
    color: var(--text-dim);
    font-size: 11px;
    text-align: right;
    white-space: nowrap;
}

.import-preview-item.is-valid .import-preview-message {
    color: var(--green);
}

.import-preview-item.is-duplicate_plan .import-preview-message,
.import-preview-item.is-duplicate_import .import-preview-message {
    color: var(--yellow);
}

.import-preview-item.is-invalid .import-preview-message,
.import-preview-item.is-not_found .import-preview-message,
.import-preview-item.is-empty .import-preview-message {
    color: var(--red);
}


/* =========================================================
   15) PLAN I/O MODAL
   ========================================================= */

/* =========================================================
   15C) IMPORT / EXPORT MODALS
   ========================================================= */

#importModal .target-modal-dialog,
#exportModal .target-modal-dialog {
    width: min(620px, calc(100vw - 32px));
}

.import-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.import-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 36px 20px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    cursor: pointer;
    transition:
        border-color var(--transition),
        background var(--transition);
    text-align: center;
    outline: none;
}

.import-drop-zone:hover,
.import-drop-zone:focus,
.import-drop-zone.is-over {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.import-drop-zone.is-loaded {
    border-style: solid;
    border-color: var(--border-focus);
}

.import-drop-icon {
    width: 32px;
    height: 32px;
    fill: var(--text-dim);
    transition: fill var(--transition);
}

.import-drop-zone:hover .import-drop-icon,
.import-drop-zone:focus .import-drop-icon,
.import-drop-zone.is-over .import-drop-icon {
    fill: var(--accent);
}

.import-drop-label {
    margin: 0;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.6;
}

.import-drop-label span {
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.import-file-input {
    display: none;
}

.import-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.import-summary-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.import-summary-count-wrap {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.import-summary-count {
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
}

.import-summary-label {
    color: var(--text-dim);
    font-size: 13px;
}

.import-summary-filename {
    color: var(--text-dim);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    max-width: 220px;
    font-family: var(--mono);
}

.import-summary-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.import-summary-section-title {
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.import-summary-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.import-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 4px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 12px;
    transition: border-color var(--transition);
}

.import-type-pill.is-primary {
    border-color: rgba(228, 145, 110, 0.28);
    background: rgba(228, 145, 110, 0.07);
    color: var(--text-bright);
}

.import-type-count {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--bg-hover);
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.import-type-pill.is-primary .import-type-count {
    background: var(--accent);
    color: #fff;
}

.import-error {
    padding: 10px 14px;
    border: 1px solid rgba(220, 80, 60, 0.5);
    border-radius: var(--radius);
    background: rgba(220, 80, 60, 0.1);
    color: #e07060;
    font-size: 13px;
}

.import-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =========================================================
   15A) IMPORT RESULT MODAL
   ========================================================= */

.import-result-dialog {
    width: min(520px, 100%);
}

.import-result-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Succès total --- */

.import-result-success {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0 4px;
}

.import-result-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    fill: #5cba7d;
    background: rgba(92, 186, 125, 0.12);
    border-radius: 50%;
    padding: 6px;
    box-sizing: border-box;
}

.import-result-title {
    color: var(--text-bright);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
}

.import-result-subtitle {
    margin-top: 3px;
    color: var(--text-dim);
    font-size: 12px;
}

/* --- Import partiel --- */

.import-result-partial {
    padding: 4px 0 8px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.import-result-skipped-count {
    color: #e07060;
}

.import-result-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.import-result-group-label {
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.import-result-group-ids {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 180px;
    overflow-y: auto;
    padding: 2px 0;
}

.import-result-id {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 11px;
    white-space: nowrap;
}

/* =========================================================
   15B) SITE PICKER MODAL
   ========================================================= */

.site-picker-dialog {
    width: min(1040px, calc(100vw - 32px));
}

.site-picker-body {
    gap: 16px;
}

.site-picker-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.site-picker-search-wrap {
    min-width: 0;
}

.site-picker-search-wrap label {
    display: block;
    padding-left: 5px;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.site-picker-search-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    min-width: 0;
}

.site-picker-search-row input {
    flex: 1 1 auto;
    min-width: 0;
    height: var(--param-control-height);
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 13px;
}

.site-picker-search-row input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.site-picker-search-row .btn {
    width: auto;
    min-width: 120px;
    padding: 0 14px;
    align-self: stretch;
}

.site-picker-coords-row {
    display: grid;
    grid-template-columns: 120px 120px minmax(0, 1fr);
    gap: 12px;
    align-items: end;
}

.site-picker-coords-row .param-group input {
    width: 100%;
}

.site-picker-summary {
    display: flex;
    align-items: center;
    min-height: var(--param-control-height);
    padding: 0 12px;
    border: 1px dashed rgba(228, 145, 110, 0.24);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.35;
}

.site-picker-map-shell {
    min-width: 0;
}

.site-picker-map {
    width: 100%;
    height: 420px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
}

.site-picker-actions {
    justify-content: flex-end;
}

.site-picker-map .leaflet-control-layers {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-bright);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.site-picker-map .leaflet-control-layers-toggle {
    background-size: 18px 18px;
}

.site-picker-map .leaflet-control-layers-expanded {
    padding: 10px 12px;
    background: var(--bg-card);
    color: var(--text-bright);
}

.site-picker-map .leaflet-control-layers label {
    color: var(--text-bright);
    font-size: 12px;
}

.site-picker-map .leaflet-control-layers-base span {
    color: var(--text-bright);
}

/* =========================================================
   Leaflet theme adjustments
   ========================================================= */

.site-picker-map .leaflet-container {
    width: 100%;
    height: 100%;
    background: #172f2c;
    font-family: var(--sans);
}

.site-picker-map .leaflet-control-zoom a {
    border-color: var(--border);
    background: var(--bg-card);
    color: var(--text-bright);
}

.site-picker-map .leaflet-control-zoom a:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.site-picker-map .leaflet-bar {
    border: 1px solid var(--border);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.site-picker-map .leaflet-popup-content-wrapper,
.site-picker-map .leaflet-popup-tip {
    background: var(--bg-card);
    color: var(--text-bright);
}

.site-picker-map .leaflet-control-attribution {
    background: rgba(29, 65, 61, 0.92);
    color: var(--text-dim);
    font-size: 10px;
}

.site-picker-map .leaflet-control-attribution a {
    color: var(--accent);
}

/* =========================================================
   16) INFO PANELS
   ========================================================= */

.info-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
}

.info-summary-table {
    width: 100%;
    height: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.info-summary-table th,
.info-summary-table td {
    padding: 14px 10px;
    border-right: 1px solid rgba(228, 145, 110, 0.14);
    border-bottom: 1px solid rgba(228, 145, 110, 0.14);
    text-align: center;
    vertical-align: middle;
}

.info-summary-table th:last-child,
.info-summary-table td:last-child {
    border-right: none;
}

.info-summary-table tbody tr:last-child td {
    border-bottom: none;
}

.info-summary-table .info-group-row th {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 500;
    height: 40px;
}

.info-summary-table .info-label-row th {
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 400;
    white-space: nowrap;
    height: 40px;
}

.info-summary-table .info-value-row td {
    padding: 6px 8px;
    background: transparent;
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    height: 40px;
}


/* =========================================================
   17) MOON PHASE PANEL
   ========================================================= */

.moon-phase-panel {
    padding: 12px;
}

.moon-phase-panel-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 176px;
    padding: 10px 8px 44px;
    border: 1px dashed rgba(228, 145, 110, 0.28);
    border-radius: calc(var(--radius) - 2px);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.moon-phase-canvas {
    display: block;
    width: min(100%, 182px);
    height: auto;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
}

.moon-phase-name {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}


/* =========================================================
   17b) PLAN FILTER BAR
   ========================================================= */

.plan-filter-bar {
    display: flex;
    flex-shrink: 0;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 8px 0;
}

.plan-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.plan-filter-group > label {
    padding-left: 5px;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ── Multi-select type ───────────────────────────────────── */

.pf-multiselect {
    position: relative;
    display: flex;
    align-items: center;
    width: 130px;
    height: var(--param-control-height);
    padding: 0 28px 0 10px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    user-select: none;
}

.pf-multiselect:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.pf-multiselect.is-active {
    border-color: var(--accent);
}

.pf-multiselect-display {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 13px;
}

.pf-multiselect-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    fill: var(--text-dim);
    pointer-events: none;
    flex-shrink: 0;
}

.pf-multiselect-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 70;
    min-width: 180px;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 0;
    border: 1px solid rgba(228, 145, 110, 0.32);
    border-radius: 10px;
    background: rgba(29, 65, 61, 0.98);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
    scrollbar-width: thin;
}

.pf-ms-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.pf-ms-option:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.pf-ms-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.pf-ms-option:has(input:checked) {
    color: var(--text-bright);
}

/* ── Wheel pickers (Dur / Moon) ──────────────────────────── */

.pf-wheel-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 110px;
    height: var(--param-control-height);
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    user-select: none;
}

.pf-wheel-wrap:hover {
    border-color: var(--border-focus);
}

.pf-wheel-wrap.is-open {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.pf-wheel-wrap.is-active {
    border-color: var(--accent);
}

.pf-wheel-wrap.is-active.is-open {
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.pf-wheel-display {
    flex: 1;
    padding: 0 32px 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 13px;
    pointer-events: none;
}

.picker-btn-inline {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    fill: var(--accent);
    pointer-events: none;
    flex-shrink: 0;
    opacity: 0.9;
}

.pf-wheel-popup {
    --wheel-row-height: 32px;
    --wheel-visible-rows: 5;
    --wheel-popup-height: calc(var(--wheel-row-height) * var(--wheel-visible-rows));

    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 70;

    width: 120px;
    height: var(--wheel-popup-height);
    padding: 0;

    border: 1px solid rgba(228, 145, 110, 0.32);
    border-radius: 12px;
    background: rgba(29, 65, 61, 0.98);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
    overflow: hidden;
    user-select: none;
}

.pf-wheel-popup .time-wheel-selection-window {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 50%;
    z-index: 2;
    height: var(--wheel-row-height);
    transform: translateY(-50%);
    border: 1px solid rgba(228, 145, 110, 0.42);
    border-radius: 10px;
    background: linear-gradient(
        180deg,
        rgba(228, 145, 110, 0.08) 0%,
        rgba(228, 145, 110, 0.14) 100%
    );
    pointer-events: none;
}

.pf-wheel-popup::before,
.pf-wheel-popup::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    z-index: 3;
    height: calc(var(--wheel-row-height) * 1.5);
    pointer-events: none;
}

.pf-wheel-popup::before {
    top: 0;
    background: linear-gradient(
        180deg,
        rgba(29, 65, 61, 0.98) 0%,
        rgba(29, 65, 61, 0) 100%
    );
}

.pf-wheel-popup::after {
    bottom: 0;
    background: linear-gradient(
        0deg,
        rgba(29, 65, 61, 0.98) 0%,
        rgba(29, 65, 61, 0) 100%
    );
}

.pf-wheel-popup .time-wheel-scroll {
    position: relative;
    z-index: 1;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pf-wheel-popup .time-wheel-scroll::-webkit-scrollbar {
    display: none;
}

/* ── Reset button ────────────────────────────────────────── */

.btn-reset-filters {
    align-self: flex-end;
    height: var(--param-control-height);
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-dim);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-reset-filters:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--bg-hover);
}

/* =========================================================
   18) RESULTS TABLE / TOOLBAR / MODE SWITCH
   ========================================================= */

.table-toolbar {
    display: none;
}

.table-toolbar-left {
    display: none;
}

.toolbar-target-count {
    font-size: 13px;
    color: var(--text-dim);
    white-space: nowrap;
    align-self: flex-end;
    padding-bottom: 9px;
}

.alt-mode-switch {
    margin-left: auto;
    /* ... reste inchangé */
}

.alt-mode-switch {
    display: inline-flex;
    align-items: stretch;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--switch-track-border);
    border-radius: var(--radius);
    background: var(--switch-track-bg);
}

.alt-mode-btn {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    color: var(--text);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.alt-mode-btn:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.alt-mode-btn[data-alt-mode="now"].is-active {
    border-color: var(--switch-now-border);
    background: var(--switch-now-bg);
    color: var(--switch-now-text);
}

.alt-mode-btn[data-alt-mode="mean"].is-active {
    border-color: var(--switch-mean-border);
    background: var(--switch-mean-bg);
    color: var(--switch-mean-text);
}

.table-wrapper {
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}


/* =========================================================
   18B) RESULTS TABLE FIXED LAYOUT
   ========================================================= */

#targetTable {
    table-layout: fixed;
}

/* =========================================================
   19) RESULTS TABLE HEADER
   ========================================================= */

thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

thead th {
    padding: 8px 10px;
    border-bottom: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: center;
    text-transform: uppercase;
    user-select: none;
    transition: color var(--transition);
}

thead th:hover {
    color: var(--text-bright);
}

#targetTable thead th[data-sort] {
    position: relative;
    padding-right: 18px;
    cursor: pointer;
    white-space: nowrap;
}

#targetTable thead th[data-sort]::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 6px;
    width: 10px;
    font-size: 11px;
    text-align: center;
    opacity: 0.9;
    pointer-events: none;
    transform: translateY(-50%);
}

#targetTable thead th[data-sort].sort-asc::after {
    content: "▲";
}

#targetTable thead th[data-sort].sort-desc::after {
    content: "▼";
}

#targetTable thead th.col-delete        { border-bottom-color: var(--table-accent-delete); }
#targetTable thead th.col-id-h          { border-bottom-color: var(--table-accent-id); }
#targetTable thead th.col-type-h,
#targetTable thead th.col-const-h       { border-bottom-color: var(--table-accent-typeconst); }
#targetTable thead th.col-ra-h,
#targetTable thead th.col-dec-h         { border-bottom-color: var(--table-accent-radec); }
#targetTable thead th.col-start-h,
#targetTable thead th.col-stop-h        { border-bottom-color: var(--table-accent-startstop); }
#targetTable thead th.col-duration-h,
#targetTable thead th.col-transit-h,
#targetTable thead th.col-moonangle-h   { border-bottom-color: var(--table-accent-duration); }
#targetTable thead th.col-altstart-h,
#targetTable thead th.col-altend-h,
#targetTable thead th.col-altmode-h     { border-bottom-color: var(--table-accent-alt-window); }

#targetTable thead th.col-filter-l-h { border-bottom-color: var(--table-accent-filter-l); }
#targetTable thead th.col-filter-r-h { border-bottom-color: var(--table-accent-filter-r); }
#targetTable thead th.col-filter-g-h { border-bottom-color: var(--table-accent-filter-g); }
#targetTable thead th.col-filter-b-h { border-bottom-color: var(--table-accent-filter-b); }
#targetTable thead th.col-filter-s-h { border-bottom-color: var(--table-accent-filter-s); }
#targetTable thead th.col-filter-h-h { border-bottom-color: var(--table-accent-filter-h); }
#targetTable thead th.col-filter-o-h { border-bottom-color: var(--table-accent-filter-o); }

#targetTable thead th.col-delete,
#targetTable thead th.col-id-h,
#targetTable thead th.col-type-h,
#targetTable thead th.col-const-h,
#targetTable thead th.col-ra-h,
#targetTable thead th.col-dec-h,
#targetTable thead th.col-start-h,
#targetTable thead th.col-stop-h,
#targetTable thead th.col-duration-h,
#targetTable thead th.col-transit-h,
#targetTable thead th.col-moonangle-h,
#targetTable thead th.col-altstart-h,
#targetTable thead th.col-altend-h,
#targetTable thead th.col-altmode-h {
    color: var(--text);
}

#targetTable thead th.col-filter-l-h { color: var(--table-accent-filter-l); }
#targetTable thead th.col-filter-r-h { color: var(--table-accent-filter-r); }
#targetTable thead th.col-filter-g-h { color: var(--table-accent-filter-g); }
#targetTable thead th.col-filter-b-h { color: var(--table-accent-filter-b); }
#targetTable thead th.col-filter-s-h { color: var(--table-accent-filter-s); }
#targetTable thead th.col-filter-h-h { color: var(--table-accent-filter-h); }
#targetTable thead th.col-filter-o-h { color: var(--table-accent-filter-o); }


/* =========================================================
   20) RESULTS TABLE BODY
   ========================================================= */

tbody tr {
    border-bottom: 1px solid rgba(42, 54, 84, 0.5);
    transition: background var(--transition);
}

tbody tr:hover {
    background: var(--bg-hover);
}

tbody td {
    padding: 6px 10px;
    font-family: var(--mono);
    font-size: 12px;
}

#targetTable th,
#targetTable td {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

#targetTable th:last-child,
#targetTable td:last-child {
    border-right: none;
}

#targetTable thead th[data-sort="id"],
#targetTable tbody td.col-id {
    text-align: left;
}

#targetTable th[data-sort="ra"],
#targetTable th[data-sort="dec"],
#targetTable td.col-ra,
#targetTable td.col-dec {
    text-align: center;
}

td.col-id {
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
}

td.col-type,
td.col-const {
    color: var(--text-dim);
    font-family: var(--sans);
    font-size: 12px;
}

td.col-filter {
    font-weight: 500;
}

body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-start-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-stop-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-duration-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-transit-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-moonangle-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-altstart-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-altend-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-altmode-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-filter-l-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-filter-r-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-filter-g-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-filter-b-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-filter-s-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-filter-h-cell,
body:has(#btnCalculate.is-dirty) #targetTable tbody td.col-filter-o-cell {
    color: var(--text-extradim) !important;
    opacity: 0.45;
}
body:has(#btnCalculate.is-dirty) #infoTempPanel .info-value-row td,
body:has(#btnCalculate.is-dirty) #infoEphemPanel .info-value-row td,
body:has(#btnCalculate.is-dirty) #moonPhaseName {
    color: var(--text-extradim) !important;
    opacity: 0.45;
}
body:has(#btnCalculate.is-dirty) #moonPhaseCanvas {
    opacity: 0.45;
}
body:has(#btnCalculate.is-dirty) #infoTempPanel {
    opacity: 0.45;
}

/* =========================================================
   21) EXPOSURE FACTOR COLORS
   ========================================================= */

.expo-good   { color: var(--green); }
.expo-ok     { color: var(--yellow); }
.expo-warn   { color: var(--orange); }
.expo-bad    { color: var(--red); }
.expo-nomoon { color: var(--green); font-style: italic; font-weight: 300; }
.expo-na     { color: var(--text-dim); font-style: italic; font-weight: 300; }


/* =========================================================
   22) DELETE BUTTON IN TABLE
   ========================================================= */

td.col-del {
    padding: 4px 6px;
    text-align: center;
}

td.col-del button {
    padding: 0 4px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: none;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition);
}

td.col-del button:hover {
    border-color: var(--red);
    background: rgba(248, 113, 113, 0.1);
    color: var(--red);
}


/* =========================================================
   23) EMPTY STATE / STATUS / LOADING
   ========================================================= */

.empty-state {
    padding: 60px 20px;
    color: var(--text-dim);
    text-align: center;
}

.empty-state .icon {
    margin-bottom: 12px;
    font-size: 48px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 15px;
}

.status-bar {
    display: flex;
    flex-shrink: 0;
    justify-content: space-between;
    margin-top: 10px;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 11px;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-dim);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   24) TOOLTIPS
   ========================================================= */

.param-group[data-tooltip],
.target-search-wrap[data-tooltip] {
    position: relative;
}

.param-group[data-tooltip]::after,
.target-search-wrap[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 300;
    width: max-content;
    max-width: 260px;
    padding: 9px 11px;
    border: 1px solid var(--border-focus);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    white-space: pre-line;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity var(--transition), visibility var(--transition);
}

.param-group[data-tooltip]::before,
.target-search-wrap[data-tooltip]::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    z-index: 301;
    border: 6px solid transparent;
    border-top-color: var(--border-focus);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity var(--transition), visibility var(--transition);
}

.param-group[data-tooltip]:hover::after,
.param-group[data-tooltip]:hover::before,
.param-group[data-tooltip]:focus-within::after,
.param-group[data-tooltip]:focus-within::before,
.target-search-wrap[data-tooltip]:hover::after,
.target-search-wrap[data-tooltip]:hover::before,
.target-search-wrap[data-tooltip]:focus-within::after,
.target-search-wrap[data-tooltip]:focus-within::before {
    opacity: 1;
    visibility: visible;
}


/* =========================================================
   25) RESPONSIVE
   ========================================================= */

@media (max-width: 1400px) {
    .target-row-search-tools,
    .target-row-import-tools,
    .target-row-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .target-inline-actions {
        justify-content: flex-start;
    }

    .params-bar {
        gap: 8px;
    }

    .param-group input[type="number"] {
        width: 70px;
    }

    .param-separator {
        margin: 0 12px;
    }

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

    .target-bar,
    .moon-phase-panel,
    .info-panel-temp,
    .info-panel-ephem {
        flex: 1 1 100%;
        max-width: 100%;
        height: auto;
        min-height: 0;
    }

    .target-bar.target-bar-split {
        height: auto;
    }

    .moon-phase-panel {
        width: min(220px, 100%);
        min-width: 0;
    }
}

@media (max-width: 980px) {
    .target-bar.target-bar-split {
        grid-template-columns: 1fr;
    }

    .target-bar-card-summary .target-preview {
        min-height: 60px;
    }

    .site-picker-search-row {
        flex-wrap: wrap;
    }

    .site-picker-coords-row {
        grid-template-columns: 1fr 1fr;
    }

    .site-picker-summary {
        grid-column: 1 / -1;
    }

    .site-picker-map {
        height: 360px;
    }
}

@media (max-width: 768px) {
    #app {
        padding: calc(var(--header-height, 64px) + 12px) 12px 12px;
    }

    .params-bar {
        flex-direction: column;
    }

    .param-separator {
        margin: 0 8px;
    }

    .confirm-modal-actions {
        justify-content: flex-start;
    }

    .target-bar-main,
    .target-tabs,
    .target-subtabs,
    .target-inline-actions,
    .target-row-actions {
        flex-wrap: wrap;
    }

    .target-tab-btn,
    .target-subtab-btn {
        flex: 1 1 auto;
    }

    .target-row-top {
        flex-direction: column;
    }

    .catalog-group {
        flex: 1 1 auto;
    }

    .target-modal {
        padding: 12px;
    }

    .target-modal-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
    }

    .target-modal-header,
    .target-modal-body {
        padding-left: 14px;
        padding-right: 14px;
    }

    .site-picker-search-row {
        flex-direction: column;
    }

    .site-picker-search-row .btn {
        width: 100%;
        min-width: 0;
    }

    .site-picker-coords-row {
        grid-template-columns: 1fr;
    }

    .site-picker-map {
        height: 300px;
    }

    .import-preview-item {
        flex-direction: column;
        align-items: stretch;
    }

    .import-preview-side {
        width: 100%;
    }

    .import-preview-resolved {
        text-align: left;
        white-space: normal;
    }

    .target-row-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .target-bar-actions.target-bar-actions-stacked {
        flex-direction: column;
        align-items: stretch;
    }

    .target-bar-actions.target-bar-actions-stacked .btn {
        width: 100%;
        min-width: 0;
    }

    #planIoModal .target-row-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #planIoModal .target-row-actions .btn {
        width: 100%;
    }
}

/* =========================================================
   ALTGRAPH — Altitude graph in #infoTempPanel
   ========================================================= */

#infoTempPanel {
    position: relative;
    overflow: hidden;
    padding: 0;
}

.altgraph-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    padding: 4px 8px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 10px;
    white-space: nowrap;
    opacity: 0.95;
    transition: opacity 80ms ease;
    transform: translateX(-50%);
}

.altgraph-tooltip[hidden] {
    display: none;
}
