.container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    padding: 1rem;
    max-width: 1100px;
    margin: 0.8rem auto;
}

@media (min-width: 960px) {
    .container {
        grid-template-columns: minmax(320px, 420px) 1fr;
        align-items: start;
    }
}

.builder {
    width: 100%;
}

.widget-preview {
    width: 100%;
    min-width: 0;
}

.tra-list,
.airspace-list {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px;
    background: #f8f9fb;
    margin-bottom: 0.9rem;
}

.tra-list label,
.airspace-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 1.02em;
    cursor: pointer;
}

.button-row {
    display: flex;
    gap: 0.7rem;
    margin-top: 0.7rem;
    align-items: center;
}

a.button-link, button.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: #0d6efd;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 0.98rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease;
    min-height: 42px;
}

a.button-link:hover, button.copy-btn:hover {
    background: #0a58ca;
}

.copy-feedback {
    color: #28a745;
    font-size: 0.97em;
    margin-left: 0.5em;
    opacity: 0;
    transition: opacity 0.2s;
}

.copy-feedback.visible {
    opacity: 1;
}

iframe {
    width: 100%;
    min-height: 500px;
    border: 0px solid #aaa;
    border-radius: 10px;
    background: #fff;
    margin-top: 0.7rem;
}

#fontSizeSelect {
    padding: 0.25em 1em 0.25em 0.6em;
    border-radius: 7px;
    border: 1px solid #bbb;
    background: #fff;
    color: #222;
    font-size: 1em;
    margin-left: 0.3em;
}

body.dark-mode .container {
    background: #1e1e1e !important;
    box-shadow: 0 2px 10px #0005;
}

body.dark-mode .airspace-list {
    background: #23272e;
    border-color: #444;
}

body.dark-mode a.button-link,
body.dark-mode button.copy-btn {
    background: #0056b3;
    color: #fff !important;
}

body.dark-mode a.button-link:hover,
body.dark-mode button.copy-btn:hover {
    background: #003366;
}

body.dark-mode .copy-feedback {
    color: #7fff7f;
}

body.dark-mode #fontSizeSelect {
    background: #23272e;
    color: #e0e0e0;
    border-color: #444;
}

/* Cards & grids */
.card {
    background: #fdfefe;
    border: 1px solid #e6e8ec;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 0.7rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.slim-card {
    padding: 10px 12px;
}
.card-title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 1.05em;
}
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 6px 10px;
}
.toggle-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.98em;
    padding: 6px 8px;
    border-radius: 8px;
    background: #f5f7fa;
}
body.dark-mode .card {
    background: #1f242b;
    border-color: #30363d;
    box-shadow: 0 1px 6px rgba(0,0,0,0.4);
}
body.dark-mode .toggle-line {
    background: #242a33;
}

.row-alpha-preview {
    margin: 8px 0 12px 0;
}

.row-alpha-preview-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.preview-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 5px 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.93rem;
    transition: background 0.2s ease, color 0.2s ease;
    border: 1px solid transparent;
}

.preview-pill--green { border-color: #2ecc40; }
.preview-pill--red   { border-color: #e74c3c; }
.preview-pill--gray  { border-color: #b3b3b3; }
.preview-pill--hourglass { border-color: #ffa500; }

body.dark-mode .row-alpha-preview-pills {
    background: #1e1e1e;
    border-color: #333;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

body.dark-mode .tra-list {
    background: #23272e;
    border-color: #444;
}

body.dark-mode .tra-list label {
    color: #e0e0e0;
}

body.dark-mode #widget-legend {
    background: #23272e !important;
    color: #e0e0e0 !important;
}

body.dark-mode #widget-legend .legend-green {
    color: #7fff7f !important;
}
body.dark-mode #widget-legend .legend-red {
    color: #ff6f6f !important;
}
body.dark-mode #widget-legend .legend-gray {
    color: #bbb !important;
}
body.dark-mode #widget-legend .legend-hourglass {
    color: #ffb347 !important;
}
body.dark-mode #widget-legend .fa-down-long {
    color: #940202 !important;
}
#widget-legend .fa-down-long {
    color: #940202 !important;
}
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        padding: 1rem;
    }
    .builder, .preview {
        min-width: 0;
    }
    .widget-preview {
        min-width: 0;
        max-width: 100%;
    }
    iframe {
        max-width: 100%;
    }
}
.control-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.control-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
}
.slider-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
}
.slider-wrap input[type="range"] {
    width: 120px;
}
.compact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.compact-select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
}
.signal-demo .tra-widget-row {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(46, 204, 64, 0.3);
    background: rgba(46, 204, 64, 0.15);
}
