/* =========================================================
   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;

    /* Layout */
    --radius: 6px;
    --transition: 150ms ease;
    --param-control-height: 40px;
    --top-panel-height: 225px;

    /* 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 {
    min-height: 100vh;
    overflow-x: 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;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 24px;
}


/* =========================================================
   3) HEADER
   ========================================================= */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

header h1 {
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 40px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

header h1 span {
    color: var(--accent);
    font-weight: 600;
}

.header-moon {
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 12px;
    text-align: right;
}

.header-moon .moon-phase {
    margin-right: 6px;
    font-size: 20px;
    vertical-align: middle;
}


/* =========================================================
   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-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;
    width: auto;
    height: var(--param-control-height);
}

.time-picker-wrap input {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.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);
}

.time-picker-wrap.is-open input {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.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;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 20px;
}

.target-bar {
    flex: 30;
    min-width: 0;
}

.info-panel-sun {
    flex: 24;
    min-width: 0;
}

.moon-phase-panel {
    flex: 0 0 clamp(160px, 13vw, 220px);
    min-width: 160px;
}

.info-panel-moon {
    flex: 32;
    min-width: 0;
}

.control-row > .target-bar,
.control-row > .info-panel,
.control-row > .moon-phase-panel {
    height: var(--top-panel-height);
    min-height: var(--top-panel-height);
}


/* =========================================================
   10) TARGET BAR
   ========================================================= */

.target-bar {
    display: flex;
    flex-direction: column;
    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;
}

.target-bar-actions .btn {
    width: auto;
    min-width: 120px;
    padding: 0 14px;
}

.target-preview {
    display: flex;
    flex: 1;
    align-items: stretch;
    gap: 12px;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.target-preview-compact {
    width: 100%;
}

.target-preview-item {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.target-preview-label {
    margin-bottom: 2px;
    font-size: 10px;
    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 {
    padding: 0;
    border: 1px solid var(--border);
    background: var(--bg-card);
}


/* =========================================================
   11) TARGET BAR — SPLIT LAYOUT
   ========================================================= */

.target-bar.target-bar-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    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: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.target-bar-card-actions {
    justify-content: flex-start;
}

.target-bar-card-summary {
    justify-content: space-between;
}

.target-bar-actions.target-bar-actions-stacked {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.target-bar-actions.target-bar-actions-stacked .btn {
    min-width: 140px;
}

.target-bar-card-summary .target-bar-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    text-align: center;
    font-size: 15px;
    color: var(--text-dim);
}

.target-bar-card-summary .target-preview {
    flex: 1 1 auto;
    margin-top: 12px;
    min-height: 146px;
}

.target-bar-card-summary .target-preview.target-preview-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: rgba(0, 0, 0, 0.06);
}

.target-bar-card-summary .target-preview.target-preview-empty {
    color: var(--text-dim);
}


/* =========================================================
   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) SEARCH MODAL CONTENT
   ========================================================= */

.target-tabs,
.target-subtabs {
    display: flex;
    gap: 6px;
    min-width: 0;
}

.target-tab-btn,
.target-subtab-btn {
    min-height: 34px;
    padding: 0 14px;
    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:
        border-color var(--transition),
        background var(--transition),
        color var(--transition);
}

.target-tab-btn:hover,
.target-subtab-btn:hover {
    border-color: var(--border-focus);
    background: var(--bg-hover);
    color: var(--text-bright);
}

.target-tab-btn.is-active,
.target-subtab-btn.is-active {
    border-color: var(--accent);
    background: rgba(228, 145, 110, 0.14);
    color: var(--text-bright);
}

.target-panel,
.target-subpanel {
    display: none;
    min-width: 0;
}

.target-panel.is-active,
.target-subpanel.is-active {
    display: block;
}

.target-panel {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.target-panel.is-active {
    display: flex;
}

.target-row {
    min-width: 0;
}

.target-row-top {
    display: flex;
    align-items: stretch;
    gap: 18px;
}

.catalog-group {
    flex: 0 0 170px;
    min-width: 0;
}

.catalog-group select,
.target-search-wrap input,
#importFile {
    width: 100%;
}

.target-search-wrap {
    flex: 1;
    min-width: 0;
}

.target-row-search-tools,
.target-row-import-tools,
.target-row-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.target-search-summary,
.target-import-summary {
    flex: 1;
    min-width: 0;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.4;
}

.target-inline-actions,
.target-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.target-inline-actions .btn,
.target-row-actions .btn {
    width: auto;
    min-width: 120px;
    padding: 0 14px;
}

.search-results-list,
.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);
}

.search-results-empty,
.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;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.is-active {
    background: var(--bg-hover);
}

.search-result-item.is-plan {
    opacity: 0.82;
}

.search-result-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.search-result-checkbox {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}

.search-result-texts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.search-result-id {
    overflow: hidden;
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-meta {
    overflow: hidden;
    color: var(--text-dim);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-side {
    flex: 0 0 auto;
}

.search-result-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.search-result-badge.is-plan {
    border-color: rgba(228, 145, 110, 0.24);
    background: rgba(228, 145, 110, 0.10);
    color: var(--accent);
}


/* =========================================================
   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
   ========================================================= */

#planIoModal .target-modal-dialog {
    width: min(620px, calc(100vw - 32px));
}

#planIoModal .target-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#planIoModal .target-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#planIoModal .target-row-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

#planIoModal .target-import-summary {
    min-height: 20px;
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.4;
}

/* =========================================================
   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: 36px 12px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 18px;
    font-weight: 500;
}

.info-summary-table .info-label-row th {
    padding: 20px 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;
}

.info-summary-table .info-value-row td {
    padding: 20px 8px;
    background: transparent;
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
}


/* =========================================================
   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;
}


/* =========================================================
   18) RESULTS TABLE / TOOLBAR / MODE SWITCH
   ========================================================= */

.table-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 10px 0;
}

.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 {
    overflow-x: 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;
}


/* =========================================================
   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) #infoSunPanel .info-value-row td,
body:has(#btnCalculate.is-dirty) #infoMoonPanel .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;
}

/* =========================================================
   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;
    justify-content: space-between;
    margin-top: 16px;
    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-sun,
    .info-panel-moon {
        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: 120px;
    }

    .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: 12px;
    }

    header {
        flex-direction: column;
        gap: 8px;
    }

    .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;
    }

    .search-result-item,
    .import-preview-item {
        flex-direction: column;
        align-items: stretch;
    }

    .search-result-side,
    .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%;
    }
}