/* ops/assets/css/style.css */

:root {
    --bg-dark: #1a2332;
    --primary: #FEEEA5;
    --text-white: #FFFFFF;
    --text-gray: rgba(255, 255, 255, 0.65);
    --glass-bg: rgba(20, 28, 42, 0.97);
    --glass-border: 1px solid rgba(255, 255, 255, 0.09);
    --blur: blur(12px);
    --radius: 12px;
    --header-height: 54px;
    --nav-height: 52px;
    --panel-w: 300px;
    --wind-good: #2ecc71;
    --wind-caution: #f0b90b;
    --wind-bad: #e74c3c;
}

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

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: var(--bg-dark);
    color: var(--text-white);
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

/* ===== Header ===== */
.app-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    display: flex; align-items: center;
    padding: 0 12px;
    background: rgba(55, 58, 70, 0.88);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    z-index: 1100;
}
.header-logo { display: flex; align-items: center; flex-shrink: 0; padding-right: 8px; }
.header-logo img { height: 22px; opacity: 0.85; }
.header-title {
    flex: 1;
    font-size: 0.95em; font-weight: 700;
    letter-spacing: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-actions { display: flex; gap: 2px; }
.header-btn {
    background: none; border: none;
    color: var(--text-gray);
    font-size: 1.25em; padding: 8px;
    cursor: pointer; border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.header-btn:hover { color: var(--primary); }
.header-btn.active { color: var(--primary); background: rgba(254,238,165,0.15); }
/* Parking button — blue */
.header-btn-parking.active { color: #3498db !important; background: rgba(52,152,219,0.15) !important; }
/* Toilets button — teal */
.header-btn-toilets.active { color: #1abc9c !important; background: rgba(26,188,156,0.15) !important; }
/* Aircraft button — blue */
.header-btn-aircraft.active { color: #4DA6FF !important; background: rgba(77,166,255,0.15) !important; }

/* Parking / toilet map icons */
.map-icon-parking, .map-icon-toilet {
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
.map-icon-parking span {
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    background: #3498db;
    border-radius: 4px;
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));
}
.map-icon-toilet span {
    font-size: 13px;
    border-radius: 4px;
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));
}

/* Aircraft icon marker */
.ac-marker { background: transparent; border: none; }
.ac-svg {
    width: 40px; height: 40px;
    filter: drop-shadow(0 0 3px rgba(0,0,0,0.85));
    transition: transform 0.5s linear;
    transform-origin: center;
    display: block;
}
.ac-svg.airborne { color: #4DA6FF; }
.ac-svg.ground   { color: #2ecc71; width: 30px; height: 30px; }
.ac-svg.heli      { color: #FEEEA5; }
.ac-svg.light     { color: #1ABC9C; }
.ac-svg.emergency { color: #e74c3c; }
.ac-label-inner {
    background: rgba(15,22,35,0.85);
    border: 1px solid rgba(240,185,11,0.5);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px; font-weight: 700;
    color: #f0b90b; white-space: nowrap;
    font-family: 'Noto Sans TC', monospace;
    transform: translate(-50%, 6px);
    display: inline-block;
}

/* ===== Main layout: FLEXBOX (more reliable than grid for RWD) ===== */
.ops-layout {
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

/* Map wrapper — takes all remaining width */
.map-wrapper {
    flex: 1 1 auto;
    position: relative;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}
/* Override nav.css #map { bottom: 52px !important } with higher specificity */
.map-wrapper > #map {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    width: 100% !important; height: 100% !important;
}

/* Basemap control — Leaflet layers control, dark theme (top-right under zoom) */
.leaflet-control-layers {
    background: rgba(26,35,50,0.92) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--text-white);
}
.leaflet-control-layers-toggle {
    width: 40px !important; height: 40px !important;
    background-size: 22px 22px !important;
}
.leaflet-control-layers-expanded {
    padding: 8px 12px 8px 10px !important;
    color: var(--text-white);
}
.leaflet-control-layers label {
    margin: 3px 0;
    font-size: 0.84em; font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
}
.leaflet-control-layers label:hover { color: var(--text-white); }
.leaflet-control-layers input[type="radio"] { accent-color: var(--primary); margin-right: 6px; }

/* Side panel: hidden by default (phone) */
.ops-panel {
    flex: 0 0 var(--panel-w);
    display: none;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--glass-bg);
    border-left: var(--glass-border);
    height: 100%;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
}

/* ===== PHONE OVERRIDE — always map-only, no panel ===== */
@media (max-width: 767px) {
    .ops-layout { flex-direction: column; }
    .map-wrapper { flex: 1 1 auto; width: 100%; }
    .ops-panel { display: none !important; }
    .bottom-sheet { display: flex !important; }
    .fab-import { display: flex !important; }
}

/* ===== Tablet 768px+ ===== */
@media (min-width: 768px) {
    .ops-panel { display: flex; }
    .fab-import { display: none !important; }
    .bottom-sheet { display: none !important; }
}

/* ===== Wide 1200px+ ===== */
@media (min-width: 1200px) {
    :root { --panel-w: 340px; }
}

/* ===== Auto mode (class-based override, min 768px only) ===== */
@media (min-width: 768px) {
    body.auto-mode .ops-panel { display: flex; flex: 0 0 380px; }
    body.auto-mode { font-size: 15px; }
    body.auto-mode .wind-spd { font-size: 2.6em !important; }
    body.auto-mode .section-hdr { padding: 13px 16px; }
    body.auto-mode .rw-event { padding: 9px 14px; font-size: 1em; }
    body.auto-mode .airport-select { font-size: 0.95em; padding: 10px 14px; }
    body.auto-mode .btn-full-primary { padding: 12px 16px; font-size: 0.9em; }
}

/* ===== Panel sections ===== */
.panel-section {
    border-bottom: var(--glass-border);
    flex-shrink: 0;
}

.section-hdr {
    display: flex; align-items: center; gap: 6px;
    padding: 9px 14px;
    font-size: 0.72em; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.9px;
    color: var(--text-gray);
    background: rgba(255,255,255,0.025);
    border-bottom: var(--glass-border);
}
.section-hdr i { font-size: 1.3em; color: var(--primary); flex-shrink: 0; }
.section-hdr > span:nth-child(2) { flex: 1; }
.section-update { font-size: 0.88em; font-weight: 400; opacity: 0.55; }

.section-action-btn {
    background: none; border: none; color: var(--text-gray);
    cursor: pointer; font-size: 1.1em; padding: 2px 4px;
    border-radius: 4px; transition: color 0.2s;
}
.section-action-btn:hover { color: #e74c3c; }

.panel-hint {
    padding: 10px 14px;
    font-size: 0.8em; color: var(--text-gray); font-style: italic;
}
.panel-hint.error { color: #e74c3c; font-style: normal; }

/* ===== Wind widget ===== */
.wind-body { padding: 10px 14px 12px; }
.wind-display { display: flex; flex-direction: column; gap: 7px; }
.wind-main { display: flex; align-items: center; gap: 14px; }
.wind-arrow {
    font-size: 2.2em; line-height: 1;
    color: rgba(255,255,255,0.5);
    transition: transform 0.6s ease;
    flex-shrink: 0; user-select: none;
}
.wind-vals { flex: 1; min-width: 0; }
.wind-spd { font-size: 2.2em; font-weight: 700; line-height: 1; letter-spacing: -1px; }
.wind-spd.good    { color: var(--wind-good); }
.wind-spd.caution { color: var(--wind-caution); }
.wind-spd.bad     { color: var(--wind-bad); }
.wind-unit { font-size: 0.4em; font-weight: 400; margin-left: 2px; opacity: 0.8; vertical-align: top; line-height: 2.8; }
.wind-dir  { font-size: 0.82em; color: var(--text-gray); margin-top: 3px; }
.wind-gust { font-size: 0.8em; color: var(--text-gray); }
.wind-bar {
    padding: 5px 10px; border-radius: 6px;
    font-size: 0.75em; font-weight: 700;
    text-align: center; letter-spacing: 0.5px;
}
.wind-bar.good    { background: rgba(46,204,113,0.12); color: var(--wind-good); }
.wind-bar.caution { background: rgba(240,185,11,0.12); color: var(--wind-caution); }
.wind-bar.bad     { background: rgba(231,76,60,0.12);  color: var(--wind-bad); }

/* Wind height layers */
.wl-section {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding-top: 8px; margin-top: 2px;
}
.wl-title {
    font-size: 0.68em; color: var(--text-gray);
    text-transform: uppercase; letter-spacing: 0.7px;
    margin-bottom: 7px;
}
.wl-row {
    display: grid;
    grid-template-columns: 38px 1fr 34px;
    align-items: center; gap: 6px;
    margin-bottom: 5px;
}
.wl-label { font-size: 0.76em; color: var(--text-gray); text-align: right; font-variant-numeric: tabular-nums; }
.wl-bar-wrap {
    position: relative; height: 7px;
    background: rgba(255,255,255,0.07);
    border-radius: 4px; overflow: hidden;
}
.wl-bar {
    position: absolute; top: 0; left: 0;
    height: 100%; border-radius: 4px;
    transition: width 0.4s ease;
}
.wl-bar.gust  { background: rgba(255,255,255,0.18); }
.wl-bar.speed.good    { background: var(--wind-good); }
.wl-bar.speed.caution { background: var(--wind-caution); }
.wl-bar.speed.bad     { background: var(--wind-bad); }
.wl-val { font-size: 0.78em; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-gray); }

/* ===== 適飛指數 (P3) ===== */
.aw-display { display: flex; flex-direction: column; gap: 9px; }
.aw-head {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px; border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border-left: 3px solid var(--text-gray);
}
.aw-head.good    { border-left-color: var(--wind-good);    background: rgba(46,204,113,0.10); }
.aw-head.caution { border-left-color: var(--wind-caution); background: rgba(240,185,11,0.10); }
.aw-head.bad     { border-left-color: var(--wind-bad);     background: rgba(231,76,60,0.10); }
.aw-score { font-size: 2.1em; font-weight: 800; line-height: 1; letter-spacing: -1px; flex-shrink: 0; }
.aw-head.good .aw-score    { color: var(--wind-good); }
.aw-head.caution .aw-score { color: var(--wind-caution); }
.aw-head.bad .aw-score     { color: var(--wind-bad); }
.aw-pct { font-size: 0.4em; font-weight: 600; margin-left: 1px; vertical-align: top; line-height: 2.6; opacity: 0.85; }
.aw-head-meta { min-width: 0; }
.aw-head-label { font-size: 0.9em; font-weight: 700; }
.aw-head-sub { font-size: 0.76em; color: var(--text-gray); margin-top: 2px; }

.aw-layers { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 8px; }
.aw-legend { font-size: 0.66em; color: var(--text-gray); letter-spacing: 0.5px; margin-bottom: 7px; }
.aw-row {
    display: grid; grid-template-columns: 44px 1fr 54px;
    align-items: center; gap: 7px; margin-bottom: 5px;
}
.aw-lbl { font-size: 0.74em; color: var(--text-gray); text-align: right; font-variant-numeric: tabular-nums; }
.aw-bar-wrap { height: 8px; background: rgba(255,255,255,0.07); border-radius: 4px; overflow: hidden; }
.aw-bar { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.aw-bar.good    { background: var(--wind-good); }
.aw-bar.caution { background: var(--wind-caution); }
.aw-bar.bad     { background: var(--wind-bad); }
.aw-cell { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.aw-val { font-size: 0.82em; font-weight: 700; font-variant-numeric: tabular-nums; }
.aw-val.good    { color: var(--wind-good); }
.aw-val.caution { color: var(--wind-caution); }
.aw-val.bad     { color: var(--wind-bad); }
.aw-wind { font-size: 0.66em; color: var(--text-gray); font-variant-numeric: tabular-nums; }

.aw-detail { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 6px; }
.aw-detail summary {
    cursor: pointer; font-size: 0.76em; color: var(--text-gray);
    list-style: none; user-select: none; padding: 2px 0;
}
.aw-detail summary::-webkit-details-marker { display: none; }
.aw-detail summary::before { content: '▸ '; }
.aw-detail[open] summary::before { content: '▾ '; }
.aw-ind-list { margin-top: 6px; display: flex; flex-direction: column; gap: 5px; }
.aw-ind { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; font-size: 0.78em; }
.aw-dot { width: 9px; height: 9px; border-radius: 50%; }
.aw-dot.good    { background: var(--wind-good); }
.aw-dot.caution { background: var(--wind-caution); }
.aw-dot.bad     { background: var(--wind-bad); }
.aw-ind-k { color: var(--text-gray); }
.aw-ind-v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ===== Runway widget ===== */
.airport-select {
    display: block; width: 100%;
    background: rgba(255,255,255,0.05);
    border: none; border-bottom: var(--glass-border);
    color: var(--text-white);
    font-family: inherit; font-size: 0.86em;
    padding: 9px 14px;
    cursor: pointer; outline: none;
    -webkit-appearance: none;
}
.airport-select option, .airport-select optgroup { background: #1a2332; color: var(--text-white); }
.airport-select:focus { background: rgba(255,255,255,0.08); }

.runway-body { padding-bottom: 6px; }
.runway-airport-name { padding: 5px 14px 3px; font-size: 0.78em; font-weight: 700; color: var(--text-gray); }

/* Next gap banner */
.rw-next-gap {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 14px; gap: 8px;
    font-size: 0.8em; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rw-next-gap .ngap-label { color: var(--text-gray); flex-shrink: 0; }
.rw-next-gap .ngap-detail { font-weight: 700; text-align: right; }
.rw-next-gap.gap-long  { background: rgba(46,204,113,0.08);  color: var(--wind-good); }
.rw-next-gap.gap-long .ngap-label { color: var(--wind-good); opacity: 0.8; }
.rw-next-gap.gap-med   { background: rgba(240,185,11,0.08);  color: var(--wind-caution); }
.rw-next-gap.gap-med .ngap-label { color: var(--wind-caution); opacity: 0.8; }
.rw-next-gap.gap-short { background: rgba(231,76,60,0.06);   color: var(--wind-bad); }
.rw-next-gap.gap-short .ngap-label { color: var(--wind-bad); opacity: 0.8; }

.rw-events { display: flex; flex-direction: column; }
.rw-event {
    display: grid;
    grid-template-columns: 40px 18px 1fr auto;
    align-items: center; gap: 7px;
    padding: 6px 14px; font-size: 0.84em;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.15s;
}
.rw-event:hover { background: rgba(255,255,255,0.03); }
.rw-event.past { opacity: 0.4; }
.rw-time  { font-weight: 700; font-variant-numeric: tabular-nums; }
.rw-icon  { text-align: center; }
.rw-icon.dep { color: #4DA6FF; }
.rw-icon.arr { color: #FF9F40; }
.rw-code  { font-size: 0.9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-route { font-size: 0.78em; color: var(--text-gray); }

.rw-gap {
    padding: 3px 14px;
    font-size: 0.74em; font-weight: 700;
    text-align: center; letter-spacing: 0.3px;
}
.rw-gap.gap-long  { background: rgba(46,204,113,0.08); color: var(--wind-good); }
.rw-gap.gap-med   { background: rgba(240,185,11,0.08); color: var(--wind-caution); }
.rw-gap.gap-short { background: rgba(231,76,60,0.06);  color: var(--wind-bad); }

/* NOW marker in runway timeline */
.rw-now {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 14px;
    background: rgba(254,238,165,0.12);
    border-left: 3px solid var(--primary);
    font-size: 0.8em; font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.3px;
}
.rw-now i { font-size: 1em; }

/* GPS dot on map */
@keyframes gps-ring {
    0%   { transform: scale(1);   opacity: 0.8; }
    70%  { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(2.2); opacity: 0; }
}
@keyframes gps-btn-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}
.gps-dot { background: transparent; border: none; }
.gps-dot-inner {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #4DA6FF;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 0 rgba(77,166,255,0.6);
    position: relative;
}
.gps-dot-inner::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(77,166,255,0.5);
    animation: gps-ring 1.8s ease-out infinite;
}
.header-btn.gps-active {
    animation: gps-btn-pulse 1.6s ease-in-out infinite;
    color: var(--primary) !important;
    background: rgba(254,238,165,0.15) !important;
}

/* ===== Mission zones ===== */
.zones-list { padding: 2px 0; }

/* Plan group */
.plan-item { border-bottom: 1px solid rgba(255,255,255,0.05); }
.plan-hdr {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 10px 4px 14px;
}
.plan-name { flex: 1; font-size: 0.84em; font-weight: 600; }
.plan-name.plan-hidden { opacity: 0.45; }
.plan-vis-btn, .plan-del-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1.05em; padding: 3px; flex-shrink: 0;
    border-radius: 4px; transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.plan-vis-btn { color: var(--primary); }
.plan-vis-btn:hover { color: var(--text-white); }
.plan-del-btn { color: var(--text-gray); }
.plan-del-btn:hover { color: #e74c3c; }

/* Zone row inside a plan */
.plan-zone {
    display: flex; align-items: center; gap: 8px;
    padding: 3px 14px 3px 32px;
    font-size: 0.78em; color: var(--text-gray);
}
.zone-dot  { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.zone-name { flex: 1; }
.zone-pts  { font-size: 0.75em; opacity: 0.7; }

.zone-label { background: transparent; border: none; }
.zone-label-inner {
    background: rgba(15,22,35,0.88);
    border: 1.5px solid; border-radius: 6px;
    padding: 2px 8px; font-size: 11px; font-weight: 700;
    white-space: nowrap; font-family: 'Noto Sans TC', sans-serif;
    backdrop-filter: blur(4px); pointer-events: none;
    transform: translate(-50%, -50%); display: inline-block;
}

/* ===== Buttons ===== */
.btn-full-primary {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 10px 14px;
    background: rgba(254,238,165,0.1);
    border: 1px solid rgba(254,238,165,0.25);
    border-radius: 0;
    color: var(--primary);
    font-family: inherit; font-size: 0.86em; font-weight: 700;
    cursor: pointer; transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.btn-full-primary:hover { background: rgba(254,238,165,0.2); }
.btn-full-primary i { font-size: 1.1em; }

.btn-outline {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    width: 100%; padding: 9px 14px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px; color: var(--text-gray);
    font-family: inherit; font-size: 0.84em;
    cursor: pointer; transition: 0.2s;
}
.btn-outline:hover { border-color: rgba(255,255,255,0.28); color: var(--text-white); }

/* ===== FAB ===== */
.fab-import {
    position: fixed;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 16px); right: 16px;
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--primary); border: none; color: #1a2332;
    font-size: 1.5em;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(254,238,165,0.45);
    z-index: 900; transition: transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.fab-import:active { transform: scale(0.9); }

/* ===== Bottom sheet ===== */
.bottom-sheet {
    position: fixed; left: 0; right: 0;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    background: var(--glass-bg);
    border-top: var(--glass-border);
    border-radius: 16px 16px 0 0;
    z-index: 800;
    transform: translateY(calc(100% - 46px));
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 72vh;
    display: flex; flex-direction: column;
}
.bottom-sheet.expanded { transform: translateY(0); }

.bs-handle {
    height: 46px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.bs-bar { width: 36px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.22); }

.bs-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.bs-tabs { display: flex; flex-shrink: 0; border-bottom: var(--glass-border); }
.bs-tab {
    flex: 1; padding: 9px 4px;
    background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--text-gray); font-family: inherit; font-size: 0.8em; font-weight: 500;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 4px;
    transition: 0.2s; -webkit-tap-highlight-color: transparent;
}
.bs-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.bs-tab i { font-size: 1.1em; }

.bs-panel { display: none; flex: 1; overflow-y: auto; }
.bs-panel.active { display: block; }

/* ===== Import overlay ===== */
.import-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.72); z-index: 2000;
    align-items: center; justify-content: center; padding: 16px;
}
.import-overlay.active { display: flex; }

.import-modal {
    background: #1b2840; border: var(--glass-border);
    border-radius: var(--radius); width: 100%; max-width: 560px;
    max-height: 88vh; display: flex; flex-direction: column;
    overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.import-modal-hdr {
    display: flex; align-items: center;
    padding: 14px 18px; border-bottom: var(--glass-border); flex-shrink: 0;
}
.import-modal-hdr h2 { flex: 1; font-size: 0.95em; font-weight: 700; }
.btn-icon-close {
    background: none; border: none; color: var(--text-gray);
    font-size: 1.5em; cursor: pointer; padding: 4px; border-radius: 6px;
    transition: color 0.2s;
}
.btn-icon-close:hover { color: var(--text-white); }

.import-tabs { display: flex; flex-shrink: 0; border-bottom: var(--glass-border); }
.itab {
    flex: 1; padding: 10px 8px;
    background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--text-gray); font-family: inherit; font-size: 0.85em; font-weight: 500;
    cursor: pointer; transition: 0.2s;
}
.itab.active { color: var(--primary); border-bottom-color: var(--primary); }

.itab-content { display: none; padding: 14px 18px 18px; overflow-y: auto; }
.itab-content.active { display: flex; flex-direction: column; gap: 10px; }

.tab-desc { font-size: 0.82em; color: var(--text-gray); line-height: 1.55; }
.tab-desc strong { color: var(--text-white); }

.itab-content textarea {
    width: 100%; background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.11); border-radius: 8px;
    color: var(--text-white); font-family: inherit; font-size: 0.83em;
    padding: 10px 12px; resize: vertical; line-height: 1.65;
}
.itab-content textarea::placeholder { color: rgba(255,255,255,0.25); }
.itab-content textarea:focus { outline: none; border-color: rgba(254,238,165,0.35); }

.file-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    border: 2px dashed rgba(255,255,255,0.18); border-radius: 10px; padding: 28px 16px;
    cursor: pointer; transition: 0.2s; text-align: center;
}
.file-drop:hover, .file-drop.drag-over { border-color: var(--primary); background: rgba(254,238,165,0.05); }
.file-drop i { font-size: 2em; color: var(--text-gray); }
.file-drop > span { font-size: 0.88em; }
.file-drop small { font-size: 0.76em; color: var(--text-gray); }

.parse-status { font-size: 0.83em; min-height: 20px; }
.parse-status.success { color: var(--wind-good); }
.parse-status.error   { color: var(--wind-bad); }
.parse-status.parsing { color: var(--text-gray); }

.manual-zone { border: 1px solid rgba(255,255,255,0.09); border-radius: 8px; overflow: hidden; }
.mz-hdr {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px; background: rgba(255,255,255,0.035); font-size: 0.84em;
}
.mz-label { font-weight: 700; color: var(--primary); flex-shrink: 0; }
.mz-name {
    flex: 1; background: none; border: none;
    border-bottom: 1px solid rgba(255,255,255,0.14);
    color: var(--text-white); font-family: inherit; font-size: inherit; padding: 2px 4px;
}
.mz-name:focus { outline: none; border-bottom-color: var(--primary); }
.mz-name::placeholder { color: rgba(255,255,255,0.3); }
.btn-mz-remove {
    background: none; border: none; color: var(--text-gray);
    cursor: pointer; font-size: 1.15em; padding: 2px; flex-shrink: 0;
}
.btn-mz-remove:hover { color: #e74c3c; }

.manual-zone textarea {
    width: 100%; padding: 9px 12px;
    background: rgba(255,255,255,0.025);
    border: none; border-top: 1px solid rgba(255,255,255,0.06);
    color: var(--text-white); font-family: inherit;
    font-size: 0.8em; line-height: 1.7; resize: vertical;
}
.manual-zone textarea::placeholder { color: rgba(255,255,255,0.22); }
.manual-zone textarea:focus { outline: none; background: rgba(255,255,255,0.04); }

.import-action-row { display: flex; gap: 8px; align-items: stretch; }
.import-action-row .btn-full-primary { flex: 1; border-radius: 8px; }
.import-action-row .btn-sm { width: auto; padding: 9px 14px; flex-shrink: 0; }
