/* Noctapilot Stylesheet */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2128;
    --bg-input: #0d1117;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --success: #3fb950;
    --warning: #d29922;
    --danger: #f85149;
    --purple: #bc8cff;
}

html {
    scroll-behavior: smooth;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
}

.navbar-menu { display: flex; gap: 1.5rem; }

.navbar-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.navbar-menu a:hover, .navbar-menu a.active {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* Sections */
.section { margin-bottom: 2rem; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

h2 { font-size: 1.4rem; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--text-secondary); }
h4 { font-size: 0.95rem; margin-bottom: 0.5rem; }

/* Grid */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
}

/* Forms */
.form-group { margin-bottom: 0.75rem; }

.horizon-preview { margin: 0.75rem 0 1rem; }
.horizon-preview figcaption { font-size: 0.9rem; font-weight: 600; }
.horizon-preview-svg { display: block; width: 100%; height: auto; margin-top: 0.5rem; }
.horizon-visible-area { fill: #163348; background: #163348; }
.horizon-obstructed-area { fill: #424954; background: #424954; }
.horizon-minimum-area { fill: #5b4b24; background: #5b4b24; }
.horizon-azimuth-area { fill: #342c48; background: #342c48; }
.horizon-azimuth-hatch { stroke: var(--purple); stroke-width: 1; opacity: 0.5; }
.horizon-grid-line { fill: none; stroke: var(--text-muted); stroke-width: 0.5; opacity: 0.45; }
.horizon-profile-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.horizon-minimum-line { stroke: var(--warning); stroke-width: 2; stroke-dasharray: 5 3; }
.horizon-plot-border { fill: none; stroke: var(--border); }
.horizon-axis-text { fill: var(--text-secondary); font-size: 14px; }
.horizon-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; font-size: 0.75rem; color: var(--text-secondary); }
.horizon-legend span { display: inline-flex; align-items: center; gap: 0.3rem; }
.horizon-swatch { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--text-muted); }
.horizon-preview .btn { margin-top: 0.5rem; }
.horizon-preview .help-text { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.5; margin: 0.35rem 0; }
.target-visibility { margin: 0.75rem 0; border-top: 1px solid var(--border); padding-top: 0.5rem; }
.target-visibility summary { cursor: pointer; font-weight: 600; color: var(--text-secondary); }
.visibility-track-visible { fill: none; stroke: var(--success); stroke-width: 2.5; }
.visibility-track-hidden { fill: none; stroke: var(--danger); stroke-width: 2; stroke-dasharray: 5 3; }
.visibility-marker { fill: var(--text-primary); stroke: var(--bg-primary); stroke-width: 1.5; }
.visibility-time-label { fill: var(--text-primary); font-size: 12px; paint-order: stroke; stroke: var(--bg-primary); stroke-width: 3; stroke-linejoin: round; }
.visibility-swatch-visible, .visibility-swatch-hidden { display: inline-block; width: 16px; border-top: 2px solid var(--success); }
.visibility-swatch-hidden { border-color: var(--danger); border-top-style: dashed; }

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

.tooltip-anchor {
    position: relative;
}

.tooltip-anchor[data-tooltip] {
    cursor: help;
}

.tooltip-anchor[data-tooltip]:hover::after,
.tooltip-anchor[data-tooltip]:focus-within::after,
.tooltip-anchor[data-tooltip][data-tooltip-open="true"]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    bottom: calc(100% + 0.45rem);
    z-index: 250;
    min-width: 15rem;
    max-width: 22rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(88, 166, 255, 0.28);
    border-radius: 8px;
    background: rgba(13, 17, 23, 0.97);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.45;
    white-space: normal;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
    pointer-events: none;
}

.tooltip-anchor[data-tooltip]:hover::before,
.tooltip-anchor[data-tooltip]:focus-within::before,
.tooltip-anchor[data-tooltip][data-tooltip-open="true"]::before {
    content: '';
    position: absolute;
    left: 0.8rem;
    bottom: calc(100% + 0.15rem);
    z-index: 251;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(88, 166, 255, 0.28) transparent transparent transparent;
    pointer-events: none;
}

.tooltip-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.tooltip-hint {
    color: var(--text-muted);
    font-size: 0.82em;
}

@media (max-width: 768px) {
    .tooltip-anchor[data-tooltip]:hover::after,
    .tooltip-anchor[data-tooltip]:focus-within::after,
    .tooltip-anchor[data-tooltip][data-tooltip-open="true"]::after {
        left: auto;
        right: 0;
        min-width: 13rem;
        max-width: min(18rem, 80vw);
    }

    .tooltip-anchor[data-tooltip]:hover::before,
    .tooltip-anchor[data-tooltip]:focus-within::before,
    .tooltip-anchor[data-tooltip][data-tooltip-open="true"]::before {
        left: auto;
        right: 0.8rem;
    }
}

input, select {
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
}

.btn:hover { border-color: var(--text-secondary); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: 600;
}

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

.btn-dirty {
    animation: pulse-glow 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px var(--accent);
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 8px var(--accent); }
    50% { box-shadow: 0 0 18px var(--accent); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.btn-small { padding: 0.25rem 0.75rem; font-size: 0.85rem; }

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.badge-catalog { color: var(--accent); }
.badge-type { color: var(--purple); }

/* Bortle Badges */
.bortle-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 0.5rem;
}

.bortle-1, .bortle-2 { background: #003300; color: #00ff00; }
.bortle-3 { background: #1a3300; color: #66ff00; }
.bortle-4 { background: #333300; color: #ccff00; }
.bortle-5 { background: #4d3300; color: #ffcc00; }
.bortle-6 { background: #663300; color: #ff9900; }
.bortle-7 { background: #660000; color: #ff6600; }
.bortle-8 { background: #660000; color: #ff3300; }
.bortle-9 { background: #4d0000; color: #ff0000; }

.bortle-display {
    display: flex;
    align-items: center;
}

.bortle-display select { flex: 1; }

/* Banners */
.info-banner, .warning-banner {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.info-banner {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    color: var(--accent);
}

.warning-banner {
    background: rgba(210, 153, 34, 0.1);
    border: 1px solid rgba(210, 153, 34, 0.3);
    color: var(--warning);
}

/* Hero */
.hero-card {
    position: relative;
    overflow: hidden;
    padding: 1.75rem;
    border: 1px solid rgba(88, 166, 255, 0.22);
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(88, 166, 255, 0.18), transparent 28%),
        linear-gradient(135deg, rgba(28, 33, 40, 0.98), rgba(13, 17, 23, 0.98));
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.hero-eyebrow {
    margin-bottom: 0.75rem;
    color: var(--accent-hover);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(220px, 0.8fr);
    align-items: end;
    gap: 1.5rem;
}

.hero h1 {
    max-width: 18ch;
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 4.2vw, 3.15rem);
    line-height: 1.02;
    text-wrap: balance;
}

.hero-copy {
    max-width: 62ch;
    color: var(--text-secondary);
    font-size: 1rem;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-self: end;
    align-self: center;
}

.hero-actions .btn {
    min-width: 220px;
}

.hero-trust {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .hero-layout {
        grid-template-columns: 1fr;
    }

    .hero-card {
        padding: 1.35rem;
    }

    .hero h1 {
        max-width: 13ch;
        font-size: clamp(2rem, 8vw, 2.7rem);
        text-wrap: pretty;
    }

    .hero-copy {
        max-width: none;
    }

    .hero-actions {
        justify-self: start;
        align-self: start;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

/* Night Info */
.night-info { margin-top: 0.75rem; }

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    font-size: 0.85rem;
}

.info-row span:first-child { color: var(--text-secondary); }

.equipment-meta {
    margin: 0.55rem 0 0.8rem;
    padding: 0.35rem 0 0.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.equipment-meta .info-row {
    font-size: 0.78rem;
    gap: 0.75rem;
    padding: 0.16rem 0;
}

.equipment-meta .info-row span:last-child {
    text-align: right;
    color: var(--text-primary);
    max-width: 68%;
    line-height: 1.35;
}

.spectral-chart-wrap {
    margin-top: 0.5rem;
    padding: 0.4rem 0.2rem 0;
    position: relative;
}

.spectral-chart-stage {
    height: 200px;
    position: relative;
}

.spectral-chart-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.spectral-axis-line {
    stroke: rgba(255, 255, 255, 0.22);
    stroke-width: 1;
}

.spectral-grid-line {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}

.spectral-grid-line-vertical {
    stroke: rgba(255, 255, 255, 0.05);
}

.spectral-axis-text,
.spectral-axis-label {
    fill: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    font-family: inherit;
}

.spectral-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.spectral-chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.spectral-chart-legend-swatch {
    width: 14px;
    height: 0;
    border-top: 2px solid var(--swatch);
    display: inline-block;
}

.spectral-chart-legend-swatch.is-dashed {
    border-top-style: dashed;
}

.spectral-hover-line {
    position: absolute;
    top: 10px;
    bottom: 28px;
    width: 2px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 0 0 1px rgba(8, 12, 18, 0.28);
    pointer-events: none;
    z-index: 3;
}

.spectral-hover-tooltip {
    position: absolute;
    min-width: 180px;
    max-width: 220px;
    background: rgba(8, 12, 18, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    font-size: 0.72rem;
    color: var(--text-primary);
    pointer-events: none;
    z-index: 2;
}

.spectral-hover-title {
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.spectral-hover-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.45rem;
    align-items: center;
    color: var(--text-secondary);
}

.spectral-hover-swatch {
    width: 14px;
    height: 0;
    border-top: 2px solid var(--swatch);
    display: inline-block;
}

.spectral-hover-swatch.is-dashed {
    border-top-style: dashed;
}

/* Target Cards */
.target-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.target-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s;
}

.target-card:hover { border-color: var(--accent); }

.target-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.target-rank {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 1.5rem;
}

.target-header h3 {
    font-size: 1rem;
    margin: 0;
    color: var(--text-primary);
}

.target-common-name {
    min-height: 1.35rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-style: italic;
    line-height: 1.35rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.target-common-name-empty {
    visibility: hidden;
}

.target-details, .target-exposure, .target-snr { margin-top: 0.5rem; }

.target-exposure {
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

.target-snr {
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

.target-snr h4 {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--accent);
}

.text-green { color: #4caf50; font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-yellow { color: #facc15; font-weight: 600; }
.text-red { color: #f87171; font-weight: 600; }
.text-orange { color: #ff9800; font-weight: 600; }

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.2rem 0;
    font-size: 0.85rem;
}

.detail-row > span:first-child {
    color: var(--text-secondary);
    flex: 0 0 42%;
    max-width: 42%;
    line-height: 1.45;
}

.detail-row > span:nth-child(2) {
    margin-left: auto;
    min-width: 0;
    text-align: right;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.detail-row > span:nth-child(3) {
    flex: 0 0 auto;
    margin-left: 0.25rem;
}

.detail-value {
    display: block;
}

.detail-value-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.05rem;
}

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

.detail-row-stack > span:first-child,
.detail-row-stack > .detail-value {
    padding-top: 0.05rem;
}

.score-badge {
    background: var(--accent);
    color: #000;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Table */
.table-wrapper { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.data-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover { background: var(--bg-secondary); }

.designation { font-weight: 600; color: var(--accent); }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 2rem;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: calc(100% - 2rem);
    margin: auto;
    color: var(--text-primary);
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h2 { margin: 0; }

.modal-body { padding: 1.5rem; }

.common-name {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1rem;
}

/* Object Image */
.object-image-container {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.object-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.loading {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* Utility */
[x-cloak] { display: none !important; }

/* Credits Page */
.credit-list { display: flex; flex-direction: column; gap: 1rem; }
.credit-item { padding: 0.75rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.credit-item:last-child { border-bottom: none; }
.credit-item strong { color: var(--accent-blue, #60a5fa); }
.credit-item p { margin: 0.25rem 0 0; font-size: 0.85em; color: var(--text-secondary, #aaa); line-height: 1.5; }
.credit-item a { color: var(--accent-blue, #60a5fa); text-decoration: none; }
.credit-item a:hover { text-decoration: underline; }
.credit-license { display: inline-block; margin-left: 0.5rem; font-size: 0.72em; padding: 0.1rem 0.4rem; border-radius: 3px; background: rgba(255,255,255,0.08); color: var(--text-secondary, #aaa); vertical-align: middle; }
.credit-ack { font-size: 0.78em !important; color: var(--text-secondary, #888) !important; margin-top: 0.4rem !important; }

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 500; padding: 0.75rem; color: var(--text-primary); background: var(--bg-card); }
.skip-link:focus { top: 0.5rem; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.navbar-brand { min-width: 0; white-space: nowrap; }
.navbar-toggle { display: none; }
.icon-button { width: 44px; height: 44px; padding: 0.5rem; flex: 0 0 auto; }
.planner-heading, .workspace-actions, .selection-actions, .dialog-actions, .planning-status, .setup-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.planner-heading { justify-content: space-between; margin-bottom: 1.5rem; }
.planner-heading h1 { font-size: 1.65rem; line-height: 1.25; }
.workspace-actions { font-size: 0.8rem; }
.setup-summary { font-size: 0.85rem; color: var(--text-secondary); margin: 0.75rem 0; }
.advanced-options { border-top: 1px solid var(--border); padding: 0.75rem 0; margin-top: 0.5rem; }
.advanced-options > summary, .target-technical > summary { cursor: pointer; min-height: 36px; padding: 0.35rem 0; color: var(--text-secondary); }
.advanced-options[open] > summary, .target-technical[open] > summary { margin-bottom: 0.75rem; color: var(--text-primary); }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 2rem; font-size: 0.85rem; }
.info-row { gap: 0.5rem; }
.info-row > :last-child { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.background-limited-row { align-items: center; min-height: 2rem; padding: 0.3rem 0.45rem; border-left: 2px solid var(--warning); background: rgba(210, 153, 34, 0.08); }
.background-limited-row > span:first-child { color: var(--text-primary); }
.background-limited-value { color: var(--warning); font-size: 0.98rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.field-error { display: block; font-size: 0.8rem; color: #f87171; margin-top: 0.3rem; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.validation-summary { margin-bottom: 1rem; color: #f87171; font-size: 0.85rem; }
.validation-summary ul { padding-left: 1.25rem; }
.validation-summary a { color: inherit; }
.place-option-active { background: var(--bg-secondary); outline: 1px solid var(--accent); outline-offset: -1px; }
.catalog-targets { margin: 1rem 0; }
.catalog-target { display: inline-flex; align-items: center; gap: 0.5rem; border-bottom: 1px solid var(--border); margin: 0.25rem 1rem 0.25rem 0; max-width: 100%; }
.catalog-target > span { min-width: 0; overflow-wrap: anywhere; }
.btn-close { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.target-card.is-selected { border-color: var(--accent); }
.target-card.results-stale { border-style: dashed; }
.target-header { flex-wrap: wrap; }
.target-header h3 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.target-header label { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.target-header input[type="checkbox"] { flex: 0 0 auto; width: 24px !important; height: 24px !important; }
.target-summary { margin-top: 0.5rem; }
.profile-options { margin-bottom: 1.5rem; }
.profile-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; }
.profile-controls .form-group { flex: 1 1 230px; min-width: 0; margin: 0; }
.profile-controls > button { min-height: 44px; }
.empty-result-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }
.planning-preferences { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-bottom: 1rem; }
.checkbox-label { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; min-height: 44px; }
.checkbox-label input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--accent); }
.object-type-filter { margin-bottom: 1rem; }
.object-type-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 0.25rem 1rem; }
.object-type-options .checkbox-label { min-width: 0; font-size: 0.85rem; }
.object-type-options .checkbox-label span { overflow-wrap: anywhere; }
.filter-advice { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; color: var(--text-secondary); font-size: 0.85rem; }
.target-cautions { margin: 0.75rem 0 0; padding: 0.5rem 0.5rem 0.5rem 1.5rem; border-left: 2px solid var(--warning); color: var(--text-secondary); font-size: 0.8rem; }
.target-cautions li + li { margin-top: 0.25rem; }
.detail-row > strong { min-width: 0; flex: 1; text-align: right; overflow-wrap: anywhere; font-size: 0.85rem; }
.target-technical { margin-top: 0.75rem; border-top: 1px solid var(--border); font-size: 0.85rem; }
.planner-results, .planner-night-plan { scroll-margin-top: 5rem; }
.planner-actionbar { position: fixed; inset: auto 0 0; z-index: 90; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.75rem; padding: 0.75rem 1rem; border-top: 1px solid var(--border); background: var(--bg-secondary); }
.planner-actionbar .btn { white-space: normal; }
body:has(.planner-actionbar) .footer { padding-bottom: 8rem; }
.object-link { border: 0; background: transparent; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; min-height: 36px; text-align: left; }
.modal::backdrop { background: rgba(0, 0, 0, 0.75); }
.dialog-actions { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

@media (max-width: 900px) {
    .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .container { padding: 1rem; }
    .navbar { padding: 0.5rem 1rem; gap: 0.5rem; }
    .navbar-toggle { display: inline-flex; min-width: 44px; min-height: 44px; padding: 0.5rem; }
    .navbar-menu { display: none; position: absolute; top: 100%; right: 0; width: min(100vw, 320px); padding: 1rem; background: var(--bg-secondary); border: 1px solid var(--border); flex-direction: column; gap: 0.5rem; }
    .navbar-menu.is-open { display: flex; }
    .navbar-menu > a { display: block; min-height: 44px; }
    .navbar-menu > span { margin-left: 0 !important; padding: 0.5rem; }
    .section-header { flex-wrap: wrap; justify-content: flex-start; gap: 0.75rem; }
    .section-header h2 { flex: 1 1 100%; margin: 0; }
    .summary-grid { grid-template-columns: 1fr; }
    .card { padding: 1rem; }
    .btn, .object-link, .advanced-options > summary, .target-technical > summary { min-height: 44px; }
    .planner-actionbar { gap: 0.5rem; padding: 0.5rem 0.75rem; }
    .planner-actionbar > .selection-actions { flex: 1 1 100%; justify-content: center; }
    .planner-actionbar > .btn-primary { flex: 1 1 100%; }
    .planner-actionbar > .btn-secondary { flex: 1 1 40%; }
    body:has(.planner-actionbar) .footer { padding-bottom: 15rem; }
    .modal-body, .modal-header { padding: 1rem; }
    .night-entry { flex-wrap: wrap; }
}
