:root {
    --aether-teal: #00bfa5;
    --deep-nebula: #0B1C24;
    --space-black: #0B0C10;
    --panel-card-bg: #141923; 
    --starlight-white: #F4F6F9;
    --muted-text: #8a94a6;
    --gold-score: #ffb300;
}

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

body {
    background-color: var(--space-black);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--starlight-white);
    min-height: 100vh;
    overflow-x: hidden;
}

.tool-bar {
    background: linear-gradient(180deg, #102A36 0%, var(--deep-nebula) 100%);
    padding: 12px 24px;
    border-bottom: 2px solid var(--space-black);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-home-btn {
    text-decoration: none;
    color: var(--aether-teal);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.2s;
}

.back-home-btn:hover {
    opacity: 0.8;
}

.tool-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.6rem;
    letter-spacing: 1px;
    color: var(--starlight-white);
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.dashboard-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap; 
}

.control-panel {
    flex: 1;
    min-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.display-panel {
    flex: 1.4;
    min-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-card {
    background-color: var(--panel-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.panel-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    color: var(--starlight-white);
    border-left: 3px solid var(--aether-teal);
    padding-left: 10px;
}

.location-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted-text);
    letter-spacing: 0.5px;
}

.input-group input, .input-group select {
    background-color: var(--space-black);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--starlight-white);
    font-family: monospace; 
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-group select {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
}

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

.action-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(180deg, #00dfc4 0%, var(--aether-teal) 100%);
    color: var(--space-black);
    border: 2px solid var(--space-black);
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
}

.action-btn:hover {
    filter: brightness(1.1);
}

.filter-tabs {
    display: flex;
    background-color: var(--space-black);
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.05);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 4px;
    color: var(--muted-text);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.2s, background-color 0.2s;
}

.tab-btn.active {
    background-color: var(--panel-card-bg);
    color: var(--aether-teal);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

#target-list-container {
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

#target-list-container::-webkit-scrollbar {
    width: 5px;
}
#target-list-container::-webkit-scrollbar-track {
    background: var(--space-black);
}
#target-list-container::-webkit-scrollbar-thumb {
    background: rgba(0, 191, 165, 0.2);
    border-radius: 4px;
}

.target-list-row {
    background-color: var(--space-black);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.target-list-row:hover {
    border-color: rgba(0, 191, 165, 0.2);
}

.target-list-row.active {
    border-color: var(--aether-teal);
    background-color: rgba(0, 191, 165, 0.03);
}

.target-meta, .target-telemetry {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.target-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--starlight-white);
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-badge {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 0.85rem;
    color: var(--gold-score);
    background-color: rgba(255, 179, 0, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 179, 0, 0.2);
}

.target-alt, .target-window {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--muted-text);
}

.target-window strong {
    color: rgba(255,255,255,0.8);
}

.lst-clock-container {
    background-color: var(--space-black);
    border: 1px solid rgba(0, 191, 165, 0.15);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
}

.lst-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted-text);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

#lst-clock {
    font-family: monospace;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--aether-teal);
    text-shadow: 0 0 10px rgba(0, 191, 165, 0.4);
    letter-spacing: 2px;
}

#aladin-lite-div {
    width: 100%; 
    height: 350px; 
    background-color: #05070a; 
    border-radius: 8px; 
    position: relative; 
    overflow: hidden;
}

#aladin-loader {
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    color: var(--muted-text); 
    font-size: 0.9rem; 
    font-style: italic;
}

#fov-readout {
    color: var(--aether-teal); 
    font-family: monospace; 
    font-size: 0.9rem; 
    margin-top: 10px; 
    font-weight: bold;
}

#transit-canvas {
    width: 100%; 
    height: auto; 
    background-color: var(--space-black); 
    border-radius: 8px;
}

/* 1. The universal boundary lock for inputs */
input, select, textarea {
    max-width: 100%;
    width: 100%;
    /* This next line is the magic fix. It forces padding to stay INSIDE the width */
    box-sizing: border-box; 
}

/* 2. Mobile-specific stacking for those specific tabs */
@media screen and (max-width: 768px) {
    /* If your telemetry/sensor inputs are side-by-side, force them to stack on mobile */
    .your-input-container-class { 
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow: hidden; /* Prevents invisible horizontal scrollbars */
    }
}