/* ==========================================================================
   NO-MAP – Stylesheet
   Structure: variables · base layout · header · sidebar · building blocks
           (sections, buttons, fields) · filters · overview · sorties · tactics
           · map (symbols, bars, Leaflet) · popups · notifications
   ========================================================================== */

:root {
    --bg: #0b0f14;
    --panel: #11171f;
    --panel-2: #171f29;
    --panel-3: #1e2834;
    --line: #243040;
    --line-2: #33435a;
    --text: #e6edf5;
    --text-2: #a9b6c6;
    --text-3: #6f7d90;
    --accent: #34d399;
    --accent-ink: #04261a;
    --blue: #3b82f6;
    --red: #ef4444;
    --gold: #facc15;
    --warn: #f59e0b;
    --bad: #f87171;
    --ok: #4ade80;
    --radius: 6px;
    --sb-w: clamp(320px, 23vw, 400px);
    --head-h: 48px;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    display: flex; flex-direction: column;
    overflow: hidden;
    background: var(--bg); color: var(--text);
    font: 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
hr { border: none; border-top: 1px solid var(--line); margin: 6px 0; }
.muted { color: var(--text-3); }

/* Always hide hidden elements (even if a class sets display) */
[hidden] { display: none !important; }

/* ---------- Line icons ---------- */
.ic {
    width: 15px; height: 15px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    vertical-align: -3px;
}
button .ic, label .ic, .popup-badge .ic, .popup-threat .ic, .popup-reward .ic, .popup-refs .ic, .hint-line .ic { margin-right: 5px; }
.ic.ok { color: var(--ok); }
.ic.bad { color: var(--bad); }

/* ==========================================================================
   Header
   ========================================================================== */
.top-bar {
    flex: none; height: var(--head-h);
    display: flex; align-items: center; gap: 16px;
    padding: 0 12px;
    background: var(--panel); border-bottom: 1px solid var(--line);
    position: relative; z-index: 2000;
}
.tb-group { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tb-right { margin-left: auto; }
.logo { font-weight: 800; letter-spacing: 0.08em; font-size: 14px; color: var(--text); margin: 0 4px 0 2px; }
.mission-chip {
    font-size: 11px; color: var(--text-3); border: 1px dashed var(--line-2); border-radius: 999px; padding: 1px 9px;
    max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mission-chip.loaded { color: var(--text-2); border-style: solid; background: var(--panel-2); }

.tb-icon {
    width: 32px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--text-2); cursor: pointer;
}
.tb-icon:hover:not(:disabled) { background: var(--panel-3); color: var(--text); }
.tb-icon:disabled { opacity: 0.35; cursor: default; }
.tb-icon .ic { width: 17px; height: 17px; margin: 0; }

.tb-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
    background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius);
    color: var(--text); cursor: pointer; white-space: nowrap; font-size: 12.5px;
}
.tb-btn .ic { margin: 0; }
.tb-btn:hover { background: var(--panel-3); border-color: #46597a; }
.tb-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tb-accent:hover { background: #4ee2ab; border-color: #4ee2ab; }

.plan-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
#plan-select {
    height: 30px; padding: 0 8px; max-width: 220px;
    background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius);
}
.plan-status { font-size: 11px; color: var(--text-3); white-space: nowrap; margin-left: 4px; }

.menu-wrap { position: relative; }
.dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 3000;
    min-width: 220px; padding: 4px;
    background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.dropdown-right { left: auto; right: 0; }
.dropdown button {
    display: flex; align-items: center; width: 100%; text-align: left;
    background: none; border: none; color: var(--text); padding: 7px 8px; cursor: pointer; border-radius: 4px; white-space: nowrap;
}
.dropdown button .ic { margin-right: 9px; color: var(--text-2); }
.dropdown button:hover { background: var(--panel-3); }
.dropdown button.danger, .dropdown button.danger .ic { color: var(--bad); }
.dd-h { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); padding: 6px 8px 2px; }
.dd-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; padding: 6px 10px 8px 32px; font-size: 12px; color: var(--text-2); }
.dd-opts label { display: flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.share-menu { min-width: 280px; }

/* ==========================================================================
   Base layout: sidebar | map
   ========================================================================== */
.layout { flex: 1; min-height: 0; display: flex; }

.sidebar {
    width: var(--sb-w); flex: none;
    display: flex; flex-direction: column; min-height: 0;
    background: var(--panel); border-right: 1px solid var(--line);
    transition: margin-left 0.2s ease;
    z-index: 1100;
}
body.sidebar-closed .sidebar { margin-left: calc(-1 * var(--sb-w)); }

.sidebar-tabs { display: flex; flex: none; border-bottom: 1px solid var(--line); padding: 0 6px; }
.tab-btn {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 8px 2px 7px; background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
    color: var(--text-3); font-weight: 600; font-size: 11.5px; cursor: pointer; white-space: nowrap;
}
.tab-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tab-btn .ic { margin: 0; width: 17px; height: 17px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { display: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px; }
.tab-content.active { display: block; }
.tab-content::-webkit-scrollbar, .tgt-results::-webkit-scrollbar, .fp-results::-webkit-scrollbar { width: 8px; }
.tab-content::-webkit-scrollbar-thumb, .tgt-results::-webkit-scrollbar-thumb, .fp-results::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }

.map-div { flex: 1; min-width: 0; position: relative; background: #000; }
.map-container { position: absolute; inset: 0; background: #000; }
.leaflet-container { background: #000 !important; font: inherit; }

/* ==========================================================================
   Building blocks
   ========================================================================== */

/* Collapsible sections */
.sec { border-top: 1px solid var(--line); margin: 0 -12px; padding: 0 12px; }
.tab-content > .sec:first-child, .tab-content > #overview-panel > .sec:first-child { border-top: none; }
.sec > summary {
    display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; user-select: none;
    padding: 10px 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-2);
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after {
    content: ''; margin-left: auto; width: 7px; height: 7px;
    border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3);
    transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.15s;
}
.sec:not([open]) > summary::after { transform: rotate(-45deg); }
.sec > summary:hover { color: var(--text); }
.sec-b { padding-bottom: 12px; }
.sec-n { font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.hint { color: var(--text-3); cursor: help; width: 14px; height: 14px; }
.hint:hover { color: var(--text); }
.sub-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin: 14px 0 6px; }

.hint-line { display: flex; align-items: flex-start; gap: 0; font-size: 11.5px; color: var(--text-3); margin: 6px 0 10px; }
.hint-line .ic { width: 13px; height: 13px; margin-top: 1px; flex: none; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0;
    padding: 6px 12px; border-radius: var(--radius); cursor: pointer;
    background: var(--panel-3); border: 1px solid var(--line-2); color: var(--text); font-weight: 600; font-size: 12.5px;
}
.btn:hover { border-color: #4a5f80; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #4ee2ab; border-color: #4ee2ab; }
.btn-block { width: 100%; padding: 8px 12px; }
.btn-small { padding: 4px 10px; font-size: 12px; font-weight: 500; }
.btn .ic { margin-right: 6px; }

/* Switch checkboxes */
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); margin: 4px 0; }
.switch input, .fp-switch input, .chip-check input, .th-kind input { accent-color: var(--accent); }
.layer-toggles { display: flex; flex-direction: column; gap: 2px; }

/* Input fields */
.filter-search-input, .sortie-form input[type="text"], .sortie-form input[type="number"], .sortie-form textarea, .sortie-form select,
#tab-markers select, #tab-markers input[type="number"], .fp-production, .pb-speed {
    width: 100%; padding: 6px 8px;
    background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius);
}
.filter-search-input:focus, .sortie-form input:focus, .sortie-form select:focus, .sortie-form textarea:focus { outline: none; border-color: var(--accent); }
.search-box { position: relative; }
.search-box > .ic { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; margin: 0; }
.search-box > input { padding-left: 30px; }

.filter-label { display: block; margin-bottom: 4px; cursor: pointer; color: var(--text); }
.chip-check { display: inline-flex; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--text-3); }
.chip-check input:checked + span { border-color: var(--accent); color: var(--text); background: rgba(52, 211, 153, 0.12); }

/* Switch buildings / vehicles */
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px; margin-bottom: 12px; }
.seg-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 0;
    padding: 6px 4px; border: none; border-radius: 5px; background: none; color: var(--text-3); cursor: pointer; font-weight: 600; font-size: 12px; white-space: nowrap;
}
.seg-btn .ic { margin-right: 5px; }
.seg-btn.active { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.seg-n { margin-left: 5px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Filter panel (Map tab)
   ========================================================================== */
.fp { display: flex; flex-direction: column; gap: 10px; font-size: 13px; margin-bottom: 8px; }
.fp-search { position: relative; }
.fp-results { margin-top: 4px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius); max-height: 260px; overflow-y: auto; }
.fp-result { display: flex; gap: 8px; align-items: center; padding: 6px 8px; cursor: pointer; border-bottom: 1px solid var(--line); }
.fp-result:hover { background: var(--panel-3); }
.fp-result-text { display: flex; flex-direction: column; min-width: 0; }
.fp-result-text b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-result-text small { color: var(--text-3); font-size: 11px; }
.fp-noresult { padding: 8px; color: var(--text-3); font-size: 12px; }
.fp-more { width: 100%; background: none; border: none; color: #60a5fa; padding: 6px; cursor: pointer; font-size: 12px; }

.fp-toggles { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.fp-switch { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text); }

.fp-status { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text-2); }
.fp-status b { color: var(--text); font-size: 14px; }
.fp-reset { background: none; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 8px; cursor: pointer; font-size: 12px; }
.fp-reset:hover { color: var(--text); border-color: #4a5f80; }

.fp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-chips:empty { display: none; }
.fp-chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(59, 130, 246, 0.15); color: #dbeafe; border: 1px solid rgba(59, 130, 246, 0.6);
  border-radius: 999px; padding: 1px 8px 1px 10px; font-size: 11px; cursor: pointer; }
.fp-chip .ic { width: 11px; height: 11px; margin: 0; }
.fp-chip:hover { background: rgba(239, 68, 68, 0.18); border-color: var(--red); color: #fee2e2; }

.fp-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin-bottom: 6px;
  display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.fp-h-actions { text-transform: none; letter-spacing: 0; font-weight: 400; }
.fp-link { background: none; border: none; color: #60a5fa; cursor: pointer; font-size: 11px; padding: 0 0 0 8px; }
.fp-link:hover { color: #93c5fd; }

.fp-factions { display: flex; gap: 6px; flex-wrap: wrap; }
.fp-faction { display: flex; align-items: center; gap: 6px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--fac); border-radius: var(--radius); padding: 4px 10px; cursor: pointer; font-size: 12px; }
.fp-faction.off { opacity: 0.4; border-style: dashed; text-decoration: line-through; }
.fp-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--fac); display: inline-block; flex: none; }
.fp-n { margin-left: auto; color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 11px; }
.fp-faction .fp-n { margin-left: 4px; }

.fp-group { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 4px; background: var(--panel-2); }
.fp-group.off { opacity: 0.55; }
.fp-group summary { display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer; list-style: none; font-weight: 600; }
.fp-group summary::-webkit-details-marker { display: none; }
.fp-group summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(-45deg); margin: 0 3px 0 1px; transition: transform 0.15s; }
.fp-group[open] summary::before { transform: rotate(45deg); }
.fp-group summary input { accent-color: var(--accent); }
.fp-cat { display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 26px; }
.fp-cat input { accent-color: var(--accent); }
.fp-cat label { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; min-width: 0; }
.fp-cat-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-cat.off .fp-cat-label { color: var(--text-3); text-decoration: line-through; }
.fp-cat.empty:not(.off) .fp-cat-label { color: var(--text-3); }
.fp-solo { background: none; border: 1px solid var(--line-2); color: var(--text-3); border-radius: 4px; font-size: 10px; padding: 1px 6px;
  cursor: pointer; visibility: hidden; }
.fp-cat:hover .fp-solo, .fp-group summary:hover .fp-solo { visibility: visible; }
.fp-solo:hover { color: var(--text); border-color: var(--text-3); }

/* ==========================================================================
   Overview
   ========================================================================== */
.mission-info { font-size: 12px; color: var(--text-2); }
.mi-file { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--text); }
.mi-file .ic { color: var(--text-3); }
.mi-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; }
.mi-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.ov-empty, .ov-hint { color: var(--text-3); font-size: 12px; margin: 4px 0; }
.ov-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.ov-table th:first-child { width: 36%; overflow: hidden; text-overflow: ellipsis; }
.ov-table th, .ov-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: right; }
.ov-table th:first-child { text-align: left; font-weight: normal; color: var(--text-2); }
.ov-table thead th { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-table thead th .fp-dot { margin-right: 5px; }
.ov-victory td { white-space: nowrap; }
.ov-total th, .ov-total td { font-weight: 700; color: var(--text); border-bottom: none; }
.ov-na { color: #3d4a5c; }
.ov-link { background: none; border: none; color: #93c5fd; cursor: pointer; font-size: 12px; padding: 0; text-decoration: underline dotted; font-variant-numeric: tabular-nums; }
.ov-link:hover { color: #fff; }
.ov-bar { height: 5px; background: var(--line); border-radius: 3px; margin-bottom: 3px; overflow: hidden; }
.ov-bar span { display: block; height: 100%; background: var(--fac); }
.ov-plan { border: 1px solid var(--line); border-left: 3px solid var(--fac); border-radius: var(--radius); padding: 8px; margin: 0 0 8px; font-size: 12px; background: var(--panel-2); }
.ov-plan-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.ov-plan-head span:last-child { margin-left: auto; color: var(--text-3); font-size: 11px; }
.ov-plan-line { margin: 4px 0; color: var(--text-2); }
.ov-plan-line .ic { margin-right: 4px; }
.ov-plan details { margin-top: 4px; }
.ov-plan summary { cursor: pointer; color: var(--text-2); }
.ov-plan summary .ic { color: var(--warn); margin-right: 4px; }
.ov-goals { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
.ov-goal { background: var(--panel-3); color: var(--text); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; font-size: 11px; cursor: pointer; }
.ov-goal:hover { border-color: var(--gold); }
.ov-goals small { color: var(--text-3); font-size: 10px; margin-right: 6px; }

/* Threats & AI routes */
.th-kinds { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; }
.th-kind { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; }
.th-kind.empty { color: var(--text-3); }
.th-swatch { width: 24px; height: 8px; flex: none; }
.th-row { display: flex; gap: 6px; margin: 6px 0; }
.th-opacity { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.th-opacity input { flex: 1; accent-color: var(--accent); }
.src { font-size: 9px; text-transform: uppercase; padding: 0 4px; border-radius: 3px; margin-left: 4px; vertical-align: middle; letter-spacing: 0.03em; }
.src-wiki { background: rgba(74, 222, 128, 0.16); color: #86efac; }
.src-assumed { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
.src-estimated { background: rgba(248, 113, 113, 0.18); color: #fca5a5; }

/* ==========================================================================
   Sortie planner
   ========================================================================== */
.sortie-hint { font-size: 11px; color: var(--text-3); margin: 6px 0 12px; }
.sortie-form { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.sortie-form h4 { margin: 0 0 10px; font-size: 14px; color: var(--text); }
.sortie-form label { display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 8px; }
.sortie-form input[type="text"], .sortie-form input[type="number"], .sortie-form textarea, .sortie-form select { margin-top: 3px; padding: 5px 7px; background: var(--panel); }
.sortie-form input[type="color"] { display: block; height: 28px; width: 50px; padding: 0; border: none; background: none; margin-top: 3px; }
.sortie-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.sortie-row > label { flex: 1; }
.form-actions { margin-top: 6px; }
.form-actions .btn { flex: 1; }
.sortie-status-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 6px; }
.sortie-list { list-style: none; padding: 0; margin: 8px 0 0; }
.sortie-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px;
    background: var(--panel-2); border: 1px solid var(--line); padding: 7px 8px; margin-bottom: 6px; border-radius: var(--radius); color: var(--text); }
.sortie-item:hover { border-color: var(--line-2); }
.sortie-item .marker-info { cursor: pointer; flex: 1; min-width: 0; }
.sortie-item .marker-info b { display: block; font-size: 13px; }
.sortie-item .marker-info span { display: block; font-size: 11px; color: var(--text-2); }
.sortie-item .marker-info .wp-warn, .sortie-item .marker-info .wp-radar { display: inline; }
.sortie-item.dim { opacity: 0.45; }
.sortie-actions { display: flex; gap: 2px; }
.sortie-actions button, .icon-btn { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 1px solid transparent; border-radius: 4px; cursor: pointer; background: none; color: var(--text-3); }
.sortie-actions button .ic { margin: 0; width: 14px; height: 14px; }
.sortie-actions button:hover { background: var(--panel-3); color: var(--text); }
.sortie-actions .btn-danger:hover { color: var(--bad); }
.sortie-empty { color: var(--text-3); font-size: 12px; list-style: none; padding: 4px 0; }
.sortie-name { font-weight: normal; color: var(--text-3); font-size: 11px; }
.sortie-callsign { display: inline-block; white-space: nowrap; font-weight: 700; font-size: 12px; color: #fff;
    background: rgba(11, 15, 20, 0.85); border: 1px solid var(--sc); border-left-width: 3px; padding: 0 6px; border-radius: 3px; }
.map-text-label { background: none; border: none; white-space: nowrap; font-weight: bold; font-size: 13px; }

.sf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.sortie-info { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--text-2); background: var(--panel);
  border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; margin: -3px 0 8px; }
.sortie-info b { color: var(--text); }
.sortie-info-sub { width: 100%; color: var(--text-3); display: flex; }
.sortie-info-sub .ic { width: 13px; height: 13px; margin: 1px 5px 0 0; }
.sortie-preset-items { display: flex; flex-wrap: wrap; gap: 4px; margin: -3px 0 8px; }
.chip-small { font-size: 10px; background: rgba(59, 130, 246, 0.16); color: #dbeafe; border-radius: 999px; padding: 1px 7px; }
.sf-h { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  color: var(--text-2); margin: 14px 0 6px; letter-spacing: 0.07em; padding-top: 10px; border-top: 1px solid var(--line); }
.sf-h-tools { text-transform: none; letter-spacing: 0; font-weight: 400; display: flex; align-items: center; gap: 4px; color: var(--text-3); }
.sf-h-tools input { width: 62px; padding: 2px 4px; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 3px; }
.wp-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 8px; }
.wp-table th { text-align: left; font-size: 10px; color: var(--text-3); font-weight: normal; padding: 2px 4px; }
.wp-table td { padding: 3px 4px; border-top: 1px solid var(--line); color: var(--text); }
.wp-num { font-weight: bold; width: 18px; text-align: center; }
.wp-alt-input { width: 76px; padding: 2px 4px; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 3px; }
.wp-alt-input.over { border-color: var(--red); background: #3a0d0d; }
.wp-ab { font-size: 11px; color: var(--text-3); display: inline-block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.wp-dist, .wp-eta { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wp-del { background: none; border: none; color: var(--text-3); cursor: pointer; padding: 2px; display: inline-flex; }
.wp-del .ic { width: 13px; height: 13px; margin: 0; }
.wp-del:hover { color: var(--bad); }
.wp-warn { color: #ff4d6d; }
.wp-radar { color: var(--warn); }
.wp-warn .ic, .wp-radar .ic { width: 13px; height: 13px; margin: 0; }
.sortie-summary { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; margin-bottom: 10px; font-size: 12px; }
.sortie-summary:empty { display: none; }
.sum-row { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.sum-row span { width: 70px; color: var(--text-3); flex: none; }
.sum-row small { color: var(--text-3); }
.sum-danger b { color: #ff6b81; }
.sum-warn b { color: #fbbf24; }
.sum-ok b, .sum-ok { color: var(--ok); }
.sum-note { font-size: 10px; color: var(--text-3); margin-top: 4px; }
.wp-icon { background: none; border: none; }
.wp-pin { width: 18px; height: 18px; border-radius: 50%; background: rgba(11, 15, 20, 0.9); border: 2px solid; color: #fff;
  font-size: 10px; font-weight: bold; line-height: 14px; text-align: center; }
.wp-alt-label { position: absolute; left: 21px; top: 2px; font-size: 10px; color: #f1f5f9; white-space: nowrap;
  text-shadow: 0 0 3px #000, 0 0 3px #000; pointer-events: none; }

/* Targets & revenue */
.tgt-search { position: relative; margin-bottom: 6px; }
.tgt-results { background: var(--panel); border-radius: var(--radius); max-height: 220px; overflow-y: auto; margin-top: 4px; }
.tgt-results:empty { display: none; }
.tgt-hit { display: flex; gap: 8px; align-items: center; width: 100%; background: none; border: none; border-bottom: 1px solid var(--line);
  color: var(--text); padding: 5px 8px; cursor: pointer; text-align: left; }
.tgt-hit:hover { background: var(--panel-3); }
.tgt-hit span:last-child { display: flex; flex-direction: column; }
.tgt-hit small { color: var(--text-3); font-size: 11px; }
.tgt-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 6px; }
.tgt-table td { border-top: 1px solid var(--line); padding: 4px; vertical-align: top; color: var(--text); }
.tgt-sym { width: 22px; }
.tgt-main small { display: block; color: var(--text-3); font-size: 11px; }
.tgt-main .vic { color: var(--gold); }
.tgt-name { background: none; border: none; color: var(--text); font-weight: bold; padding: 0; cursor: pointer; text-align: left; }
.tgt-name:hover { text-decoration: underline; }
.tgt-weapon { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 3px 0; }
.tgt-weapon select { width: auto !important; max-width: 130px; padding: 2px !important; }
.tgt-weapon input { width: 52px; padding: 2px 4px; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 3px; }
.tgt-reward { color: #fbbf24 !important; }
.tgt-bad { color: #ff6b81; font-size: 11px; }
.tgt-na { color: var(--text-3); font-size: 11px; }
.tgt-approx { color: #fbbf24; font-size: 11px; }
.tgt-ok { font-size: 11px; color: var(--ok); }
.tgt-empty { color: var(--text-3); font-size: 11px; }
.sortie-ammo { margin-bottom: 6px; }
.ammo-row { display: grid; grid-template-columns: 80px 80px 1fr; gap: 6px; font-size: 11px; color: var(--text-2); padding: 2px 0; }
.ammo-row b { color: var(--text); }
.ammo-row .ic { width: 13px; height: 13px; }
.ammo-over span:last-child { color: #ff6b81; font-weight: bold; }

/* Phases in the sortie form/list */
.sortie-phases-choice { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; }
.ph-choice { display: inline-flex !important; align-items: center; gap: 4px; font-size: 12px; color: var(--text) !important; border-left: 3px solid var(--pc); padding-left: 4px; margin: 0 !important; }
.ph-auto { width: 100%; font-size: 11px; color: var(--text-3); }
.ph-badge { display: inline-block; font-size: 10px; border: 1px solid var(--pc); color: var(--pc); border-radius: 999px; padding: 0 6px; margin-right: 3px; }
.ph-badge.auto { border-style: dashed; }

/* ==========================================================================
   Tactics
   ========================================================================== */
.tac-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 10px; }
.tac-tools button { display: flex; flex-direction: column; align-items: center; gap: 3px; background: var(--panel-2); color: var(--text-2);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 2px 6px; cursor: pointer; font-size: 11px; }
.tac-tools button .ic { width: 17px; height: 17px; margin: 0; }
.tac-tools button:hover { border-color: var(--line-2); color: var(--text); }
.tac-tools button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.tac-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tac-row-lbl { font-size: 11.5px; color: var(--text-2); }
.tac-palette { display: flex; gap: 5px; }
.tac-swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--panel); cursor: pointer; padding: 0; }
.tac-swatch.active { box-shadow: 0 0 0 2px var(--text); }
#tab-markers label { display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 6px; }
#tab-markers select, #tab-markers input[type="number"] { margin-top: 3px; padding: 5px 7px; }
.tac-list { list-style: none; padding: 0; margin: 0; }
.tac-item { display: flex; align-items: center; gap: 6px; padding: 4px 2px; border-bottom: 1px solid var(--line); font-size: 12px; }
.tac-item.dim { opacity: 0.45; }
.tac-ico { width: 18px; display: inline-flex; justify-content: center; }
.tac-ico .ic { margin: 0; }
.tac-go { background: none; border: none; color: var(--text); cursor: pointer; text-align: left; flex: 1; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tac-go:hover { text-decoration: underline; }
.tac-item small { color: var(--text-3); font-size: 10px; }
.phase-settings { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.ph-row { display: flex; align-items: center; gap: 4px; }
.ph-row input[type="color"] { width: 26px; height: 24px; padding: 0; border: none; background: none; flex: none; }
.ph-row input[type="text"] { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 6px; font-size: 12px; }
.ph-row span { color: var(--text-3); }
.ph-name { flex: 1; min-width: 0; }
.ph-time { width: 50px; text-align: center; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Map: symbols
   ========================================================================== */
.leaflet-container { --sym: 20px; }
.leaflet-container.zoom-far  { --sym: 12px; }
.leaflet-container.zoom-mid  { --sym: 18px; }
.leaflet-container.zoom-near { --sym: 26px; }

.sym-wrap { background: none; border: none; }
.sym {
  position: absolute;
  width: var(--sym); height: var(--sym);
  left: calc(var(--sym) / -2); top: calc(var(--sym) / -2);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--fac);
  background: color-mix(in srgb, var(--fac) 78%, #0b1220);
  box-shadow: 0 1px 3px rgba(0,0,0,0.7);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.sym:hover { transform: scale(1.25); z-index: 1; }
.sym svg { width: 78%; height: 78%; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.zoom-far .sym svg { display: none; }   /* zoomed far out: colour fill only */
.zoom-far .sym { border-width: 1.5px; }

.fac-blue    { --fac: #3b82f6; }
.fac-red     { --fac: #ef4444; }
.fac-neutral { --fac: #94a3b8; }

.shape-square { border-radius: 3px; }
.shape-circle { border-radius: 50%; }
.shape-ship   { border-radius: 999px; width: calc(var(--sym) * 1.5); left: calc(var(--sym) * -0.75); }

.sym-victory { outline: 2px solid var(--gold); outline-offset: 1px; box-shadow: 0 0 8px 2px rgba(250,204,21,0.65); }
.sym-reinf { border-style: dashed; background: rgba(15,23,42,0.55); opacity: 0.75; }
.sym-reinf svg { stroke: color-mix(in srgb, var(--fac) 60%, #fff); }
.sym-new { border-style: double; border-width: 3px; }
.sym-moving .sym { outline: 2px dashed #22c55e; outline-offset: 3px; }

/* Icon symbols (data/unit-icons.js): HUD symbols of vehicles and aircraft silhouettes */
.sym.shape-icon { border: none; background: none; box-shadow: none; }
.sym-img { display: block; width: 100%; height: 100%; -webkit-mask: var(--img) center / contain no-repeat; mask: var(--img) center / contain no-repeat; }
.icon-hud { width: calc(var(--sym) * 1.3); height: calc(var(--sym) * 1.3); left: calc(var(--sym) * -0.65); top: calc(var(--sym) * -0.65); }
.icon-hud::before { content: ''; position: absolute; inset: 9%; background: var(--fac); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8)); }
.icon-hud .sym-img { position: relative; background: #fff; }
.icon-air { width: calc(var(--sym) * 1.35); height: calc(var(--sym) * 1.35); left: calc(var(--sym) * -0.675); top: calc(var(--sym) * -0.675); }
.icon-air .sym-img { background: var(--fac); filter: drop-shadow(0 0 1px #fff) drop-shadow(0 1px 2px rgba(0,0,0,0.9)); }
.zoom-far .icon-hud .sym-img { display: none; }        /* far out: coloured diamond only, like the other symbols */
.sym.shape-icon.sym-victory { outline: none; box-shadow: none; filter: drop-shadow(0 0 3px var(--gold)) drop-shadow(0 0 2px var(--gold)); }
.sym.shape-icon.sym-built, .sym.shape-icon.sym-changed { outline-offset: 0; }
.sym.legend-sym.shape-icon { width: 20px; height: 20px; }
.sym.legend-sym.icon-hud::before { inset: 9%; }

/* Airbases */
.airbase-icon { background: none; border: none; }
.airbase-pin { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  background: rgba(11, 15, 20, 0.92); border: 2px solid; border-radius: 5px; box-shadow: 0 1px 4px rgba(0,0,0,0.7); }
.airbase-pin .ic { width: 14px; height: 14px; margin: 0; stroke-width: 1.8; }
.airbase-label { position: absolute; left: 27px; top: 2px; white-space: nowrap; font-size: 11px; font-weight: 700; pointer-events: none;
  color: #fff; background: rgba(11, 15, 20, 0.82); border-left: 3px solid var(--ab); padding: 1px 6px; border-radius: 0 3px 3px 0; }
.zoom-far .airbase-label { font-size: 10px; padding: 0 4px; }

/* Legend */
.map-legend {
  background: rgba(17, 23, 31, 0.95); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px;
  font-size: 12px; max-height: 60vh; overflow-y: auto; min-width: 150px; box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.legend-toggle { display: flex; align-items: center; width: 100%; background: none; border: none; color: var(--text); font-weight: 600;
  padding: 6px 10px; text-align: left; cursor: pointer; font-size: 12px; }
.map-legend.collapsed .legend-body { display: none; }
.legend-body { padding: 0 10px 8px; }
.legend-title { margin: 8px 0 4px; font-size: 10px; text-transform: uppercase; color: var(--text-3); letter-spacing: 0.05em; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; white-space: nowrap; }
.legend-count { margin-left: auto; padding-left: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sym.legend-sym { position: relative; left: 0; top: 0; width: 18px; height: 18px; flex: none; cursor: default; }
.sym.legend-sym.shape-ship { width: 26px; }
.sym.legend-sym:hover { transform: none; }
.sym.legend-sym svg { display: block; }

/* Routes, arrowheads, aircraft positions */
.route-arrow { background: none; border: none; }
.route-arrow div { font-size: 16px; line-height: 16px; text-shadow: 0 0 3px #000; }
.plane-icon { background: none; border: none; }
.plane-ico { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 0 2px #000) drop-shadow(0 0 2px #000); }
.plane-img { width: 26px; height: 26px; background: currentColor; -webkit-mask: var(--img) center / contain no-repeat; mask: var(--img) center / contain no-repeat; }
.plane-ico .ic { width: 22px; height: 22px; margin: 0; fill: currentColor; stroke: #0b0f14; stroke-width: 1.2; }
.plane-label { position: absolute; left: 26px; top: 3px; white-space: nowrap; font-size: 11px; font-weight: bold; color: #fff;
  background: rgba(11, 15, 20, 0.85); border-left: 3px solid; padding: 1px 5px; border-radius: 2px; }

/* Drawings on the map */
.tac-marker, .tac-arrowhead, .measure-label { background: none; border: none; }
.tac-pin { width: 26px; height: 26px; border-radius: 50%; background: rgba(11, 15, 20, 0.92); border: 2px solid;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.tac-pin .ic { width: 15px; height: 15px; margin: 0; }
.tac-label { position: absolute; left: 30px; top: 4px; white-space: nowrap; font-weight: bold; font-size: 12px; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000; }
.tac-text { white-space: nowrap; font-weight: bold; font-size: 15px; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000; transform: translate(-30%, 0); }
.tac-arrowhead div { font-size: 22px; line-height: 26px; text-align: center; text-shadow: 0 0 3px #000; }
.leaflet-tooltip.tac-tip { background: rgba(11, 15, 20, 0.85); color: #fff; border: none; font-weight: bold; font-size: 12px; box-shadow: none; padding: 2px 6px; }
.leaflet-tooltip.tac-tip::before { display: none; }
.measure-label span { background: rgba(0,0,0,0.75); color: #fde047; font-size: 11px; font-weight: bold; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.measure-label.total span { background: #fde047; color: #000; }
.leaflet-tooltip.measure-tip { background: rgba(0,0,0,0.85); color: #fde047; border: 1px solid #fde047; font-size: 12px; }
.leaflet-tooltip.measure-tip::before { display: none; }

/* Measuring / placing: clicks pass through all map objects to the map */
.leaflet-container.placing, .leaflet-container.measuring { cursor: crosshair !important; }
.measuring .sym-wrap, .measuring .tac-marker, .measuring .airbase-icon, .measuring .wp-icon,
.placing .sym-wrap, .placing .tac-marker, .placing .airbase-icon, .placing .wp-icon, .placing .qt-wrap, .measuring .qt-wrap,
.leaflet-container.measuring .leaflet-interactive, .leaflet-container.placing .leaflet-interactive { pointer-events: none !important; }

/* ==========================================================================
   Map: bars and Leaflet controls
   ========================================================================== */
.phase-bar { position: absolute; top: 10px; left: 0; right: 0; margin: 0 auto; width: max-content; z-index: 1000;
  background: rgba(17, 23, 31, 0.94); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 8px;
  display: flex; flex-direction: column; gap: 6px; max-width: min(760px, calc(100% - 140px));
  box-shadow: 0 4px 16px rgba(0,0,0,0.45); color: var(--text); font-size: 12px; }
.phase-bar.compact { padding: 4px; border-radius: 999px; }
.pb-chips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pb-chip { background: transparent; color: var(--text-2); border: 1px solid color-mix(in srgb, var(--pc) 55%, transparent); border-radius: 999px;
  padding: 3px 10px; cursor: pointer; font-size: 12px; display: flex; gap: 6px; align-items: baseline; }
.pb-chip:hover { color: var(--text); border-color: var(--pc); }
.pb-chip small { color: var(--text-3); font-size: 10px; font-variant-numeric: tabular-nums; }
.pb-chip.active { background: var(--pc); border-color: var(--pc); color: #0b1220; font-weight: 700; }
.pb-chip.active small { color: rgba(11, 18, 32, 0.75); }
.pb-time { display: flex; align-items: center; gap: 8px; }
.pb-play { background: var(--accent); color: var(--accent-ink); border: none; border-radius: 5px; width: 28px; height: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.pb-play .ic { width: 13px; height: 13px; margin: 0; }
.pb-slider { flex: 1; min-width: 160px; accent-color: var(--accent); }
.pb-t { font-variant-numeric: tabular-nums; min-width: 62px; font-weight: 700; }
.pb-speed { width: auto; padding: 2px 4px; }
.pb-planes-lbl { white-space: nowrap; cursor: pointer; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.pb-planes-lbl input { accent-color: var(--accent); }

.edit-bar { position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%); z-index: 1001; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--blue); border-radius: 8px; padding: 8px 10px 8px 12px; display: flex; gap: 10px; align-items: center; font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
.edit-bar > .ic { color: #93c5fd; }
.edit-bar button { display: inline-flex; align-items: center; border: none; border-radius: 5px; padding: 5px 10px; cursor: pointer; font-weight: 700; }
.edit-bar .eb-ok { background: var(--accent); color: var(--accent-ink); }
.edit-bar .eb-ok .ic { margin-right: 4px; }
.edit-bar .eb-cancel { background: var(--panel-3); color: var(--text); border: 1px solid var(--line-2); }

.coord-box { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); z-index: 999; font-size: 11px; color: var(--text);
  background: rgba(11, 15, 20, 0.8); padding: 2px 8px; border-radius: 4px; font-variant-numeric: tabular-nums; pointer-events: none; }
.coord-box:empty { display: none; }

/* Leaflet bars (zoom, Geoman, quick buttons) in dark style */
.leaflet-bar, .leaflet-pm-toolbar.leaflet-bar { border: 1px solid var(--line-2) !important; border-radius: 8px !important; box-shadow: 0 2px 10px rgba(0,0,0,0.45) !important; overflow: hidden; }
.leaflet-bar a, .leaflet-bar a:hover { background-color: var(--panel) !important; color: var(--text-2) !important; border-bottom: 1px solid var(--line) !important; width: 32px !important; height: 32px !important; line-height: 32px !important; }
.leaflet-bar a:hover { background-color: var(--panel-3) !important; color: var(--text) !important; }
.leaflet-bar a:last-child { border-bottom: none !important; }
.leaflet-bar a.leaflet-disabled { color: var(--text-3) !important; opacity: 0.5; }
.leaflet-pm-toolbar .button-container .leaflet-buttons-control-button { padding: 0 !important; }
.leaflet-pm-toolbar .control-icon { filter: invert(0.85); width: 100% !important; height: 100% !important; background-size: 18px !important; }
.leaflet-pm-toolbar .button-container.active .leaflet-buttons-control-button { background-color: #134e3a !important; }
.leaflet-pm-toolbar .leaflet-pm-actions-container .leaflet-pm-action { background: var(--panel-2) !important; color: var(--text) !important; border-color: var(--line-2) !important; }
.map-quick a { display: flex !important; align-items: center; justify-content: center; text-decoration: none; }
.map-quick a .ic { width: 17px; height: 17px; margin: 0; }
.map-quick a.active { background-color: #134e3a !important; color: var(--accent) !important; }
.leaflet-control-attribution { background: rgba(11, 15, 20, 0.6) !important; color: var(--text-3) !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }

/* Start screen & drag & drop */
.empty-state { position: absolute; inset: 0; z-index: 1050; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.es-card { pointer-events: auto; text-align: center; background: rgba(17, 23, 31, 0.94); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 24px 32px; max-width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.es-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.es-card p { color: var(--text-2); margin: 0 0 14px; }
.es-card p.muted { color: var(--text-3); font-size: 12px; margin: 10px 0 0; }
.es-card code { background: var(--panel-3); padding: 1px 4px; border-radius: 3px; }
.es-bundled { margin: 4px 0 2px; }
.es-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 6px 0 8px; }
.es-missions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.es-missions .btn { justify-content: center; }
.set-version { margin-top: 10px; font-size: 11px; color: var(--text-3); text-align: right; }
.noscript { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  background: #0b0f14; color: #e6edf3; font: 16px system-ui, sans-serif; }
.drop-overlay { position: fixed; inset: 0; z-index: 5000; background: rgba(4, 38, 26, 0.55); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.drop-overlay div { border: 2px dashed var(--accent); border-radius: 14px; padding: 30px 46px; font-size: 18px; font-weight: 700; color: #fff; background: rgba(11, 15, 20, 0.85); }

/* ==========================================================================
   Popups (dark)
   ========================================================================== */
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel-2); color: var(--text); box-shadow: 0 8px 28px rgba(0,0,0,0.6); }
.leaflet-popup-content-wrapper { border: 1px solid var(--line-2); border-radius: 8px; }
.leaflet-popup-content { margin: 12px 14px; font-size: 12.5px; line-height: 1.45; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-3); }
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--text); }
.map-popup { color: var(--text); font-size: 12.5px; min-width: 230px; }
.map-popup b { color: var(--text); }
.map-popup input[type="text"], .map-popup input[type="number"], .map-popup select, .tac-popup input[type="text"] {
  width: 100%; padding: 4px 6px; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 4px; }
.map-popup hr { border-top-color: var(--line); }
.popup-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; margin-bottom: 6px; padding-right: 14px; }
.popup-title .ic { color: var(--text-2); }
.popup-section { font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; margin-left: 2px; }
.popup-kv { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin: 0 0 6px; }
.popup-kv dt { color: var(--text-3); }
.popup-kv dd { margin: 0; }
.map-popup code { background: var(--panel-3); padding: 0 4px; border-radius: 3px; }
.popup-threat { display: flex; align-items: center; font-size: 12px; margin: 2px 0; cursor: help; color: var(--text-2); }
.popup-threat .ic { color: var(--warn); }
.popup-threat b { margin-left: 3px; }
.popup-badge { display: flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 3px 7px; border-radius: 4px; margin: 4px 0; }
.badge-victory { background: rgba(250, 204, 21, 0.14); color: #fde68a; border: 1px solid rgba(250, 204, 21, 0.5); }
.badge-reinf { background: rgba(129, 140, 248, 0.14); color: #c7d2fe; border: 1px solid rgba(129, 140, 248, 0.5); }
.badge-new { background: rgba(74, 222, 128, 0.12); color: #bbf7d0; border: 1px solid rgba(74, 222, 128, 0.45); }
.badge-battery { background: rgba(217, 70, 239, 0.12); color: #f5d0fe; border: 1px solid rgba(217, 70, 239, 0.5); }
.popup-reward { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; font-size: 11.5px; color: #fde68a; background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3); padding: 3px 7px; border-radius: 4px; margin: 6px 0; }
.popup-reward b { color: #fde68a; }
.popup-reward small { color: var(--text-3); }
.popup-refs { display: flex; align-items: center; font-size: 11px; color: var(--text-3); margin: 4px 0 6px; cursor: help; }
.popup-name-lbl { display: block; font-size: 11px; color: var(--text-3); margin: 8px 0 2px; }
#popup-name-input { margin-bottom: 4px; }
#popup-name-input.readonly { background: var(--panel-3); color: var(--text-2); }
.popup-near { font-size: 11px; color: var(--text-2); margin: 2px 0; }
.popup-note { font-size: 11.5px; color: var(--text-2); margin: 4px 0 6px; }
.popup-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  border: 1px solid var(--line-2); padding: 5px 8px; border-radius: 5px; cursor: pointer;
  font-weight: 600; font-size: 12px; margin-bottom: 4px; color: var(--text); background: var(--panel-3);
}
.popup-btn .ic { width: 13px; height: 13px; margin-right: 5px; }
.popup-btn:hover { border-color: #4a5f80; }
.popup-actions { display: flex; gap: 4px; margin-top: 8px; }
.popup-actions .popup-btn { flex: 1; width: auto; margin: 0; }
.popup-actions .popup-btn:only-child .ic, .popup-actions .popup-btn[title] .ic { margin-right: 0; }
.popup-btn-save { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.popup-btn-save:hover { background: #4ee2ab; }
.popup-btn-target { background: rgba(192, 38, 211, 0.25); border-color: #c026d3; color: #f5d0fe; margin-top: 6px; }
.popup-btn-delete:hover { color: var(--bad); border-color: var(--bad); }
.popup-btn-move, .popup-btn-duplicate { }
.bad { color: var(--bad); }
.tac-popup label { display: block; font-size: 12px; margin: 4px 0; color: var(--text-2); }
.tac-row label { display: inline-block; }
.tac-phases { font-size: 12px; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--text-2); }
.tac-phases label { display: inline-flex !important; gap: 3px; margin: 0 !important; }
.tac-phases small { width: 100%; color: var(--text-3); }
.tac-btns { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.tac-btns .popup-btn { width: auto; flex: 1; margin: 0; }
.tac-btns .popup-btn[title] { flex: none; width: 32px; }
.tac-btns .popup-btn[title] .ic { margin: 0; }
.tac-info { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }

/* ==========================================================================
   Notifications (toasts)
   ========================================================================== */
#toast-box { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 20000; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; background: rgba(23, 31, 41, 0.97); color: var(--text); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,0.5); transition: opacity 0.4s; max-width: 640px; }
.toast .ic { color: var(--accent); margin: 0; }
.toast.warn { border-color: var(--warn); }
.toast.warn .ic { color: var(--warn); }
.toast.hide { opacity: 0; }
.toast.has-actions { pointer-events: auto; }
.toast-btn { background: none; border: 1px solid var(--line-2); color: var(--accent); border-radius: 5px; padding: 2px 8px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.toast-btn:hover { background: var(--panel-3); }

/* ==========================================================================
   Narrow screens
   ========================================================================== */
@media (max-width: 1250px) {
    .tb-btn span { display: none; }
    .tb-btn { padding: 0 8px; }
    .tb-accent span { display: inline; }
    .plan-status { display: none; }
}
@media (max-width: 900px) {
    .mission-chip, .plan-label { display: none; }
    .sidebar { position: absolute; top: var(--head-h); bottom: 0; left: 0; box-shadow: 4px 0 20px rgba(0,0,0,0.5); }
}

/* ---------- Fine-tuning ---------- */
.sortie-item .marker-info .ph-badge { display: inline-block; }
.sortie-item .marker-info .sortie-phases { margin: 2px 0; }
.sf-h { flex-wrap: wrap; gap: 4px; }
.sf-h-tools { white-space: nowrap; font-size: 11px; }
.search-box > input.filter-search-input { padding-left: 30px !important; }
.tac-btns { flex-wrap: nowrap; }

/* ==========================================================================
   Settings menu (language, units)
   ========================================================================== */
.settings-menu { min-width: 260px; padding: 6px; }
.set-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px 4px 8px; }
.dropdown .set-opt {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel);
}
.dropdown .set-opt b { font-weight: 600; font-size: 13px; }
.dropdown .set-opt small { font-size: 11px; color: var(--text-3); }
.dropdown .set-opt.active { border-color: var(--accent); background: var(--panel-3); }
.dropdown .set-opt.active small { color: var(--text-2); }
.set-note { margin: 2px 6px 4px; font-size: 11px; line-height: 1.4; color: var(--text-3); white-space: normal; }

/* ==========================================================================
   Nukes (Tactics: kill radius + blast damage radius)
   ========================================================================== */
.nuke-menu { position: fixed; z-index: 3000; min-width: 290px; max-width: 340px; padding: 6px; }
.dropdown .nuke-opt { align-items: flex-start; gap: 9px; padding: 7px 8px; white-space: normal; }
.nuke-opt-ic .ic { width: 20px; height: 20px; color: #ef4444 !important; margin: 1px 0 0 !important; }
.nuke-opt-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; line-height: 1.3; }
.nuke-opt-text b { font-weight: 600; }
.nuke-opt-kind { font-size: 11px; color: var(--text-3); }
.nuke-opt-text small { flex-basis: 100%; font-size: 11px; color: var(--text-2); }
.nuke-pin { border-color: #ef4444 !important; color: #fca5a5 !important; }
.nuke-label { color: #fecaca !important; }
.nuke-radii { display: grid; gap: 3px; margin: 2px 0 8px; font-size: 12px; }
.nuke-radii small { color: var(--text-3); }
.nuke-sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -2px; }
.nuke-sw.kill { background: rgba(239, 68, 68, 0.45); border: 2px solid #ef4444; }
.nuke-sw.damage { background: rgba(249, 115, 22, 0.12); border: 2px dashed #f97316; }

/* ---------- Targets per waypoint ---------- */
.tgt-wp { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--text-3); }
.tgt-wp select { width: auto; padding: 2px 6px; font-size: 11px; }
.tgt-eta { color: var(--text-2); font-variant-numeric: tabular-nums; }
.wp-tgt { display: flex; align-items: center; justify-content: center; gap: 1px; font-size: 10px; line-height: 1; color: var(--accent); }
.wp-tgt .ic { width: 11px; height: 11px; margin: 0; }
.popup-wp-targets { margin-top: 8px; font-size: 12px; display: grid; gap: 3px; }
.popup-wp-targets .ic { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; }

/* ==========================================================================
   Sortie timeline
   ========================================================================== */
.tl         { position: relative; font-size: 11px; }
.tl-body    { position: relative; }
.tl-bands   { position: absolute; top: 0; bottom: 0; left: 64px; right: 4px; pointer-events: none; }
.tl-band    { position: absolute; top: 0; bottom: 0; overflow: hidden; background: color-mix(in srgb, var(--pc) 12%, transparent); border-left: 1px dashed color-mix(in srgb, var(--pc) 60%, transparent); }
.tl-band span { position: absolute; top: -1px; left: 3px; font-size: 9px; white-space: nowrap; color: var(--pc); opacity: 0.9; }
.tl-band.active { background: color-mix(in srgb, var(--pc) 24%, transparent); }
.tl-now     { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #facc15; }
.tl-row     { position: relative; display: flex; align-items: center; height: 20px; }
.tl-row:first-child { margin-top: 12px; }
.tl-label   { width: 60px; flex: none; padding-right: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tl-track   { position: relative; flex: 1; height: 100%; margin-right: 4px; }
.tl-bar     { position: absolute; top: 5px; height: 10px; border-radius: 3px; min-width: 3px; opacity: 0.85; }
.tl-bar.danger { box-shadow: 0 0 0 2px #ef4444; }
.tl-tot     { position: absolute; top: 2px; height: 16px; width: 0; border-left: 2px solid #fff; margin-left: -1px; }
.tl-tot::after { content: ''; position: absolute; top: -3px; left: -4px; border: 3px solid transparent; border-top: 4px solid #fff; }
.tl-axis    { position: relative; height: 16px; margin: 2px 4px 0 64px; border-top: 1px solid; }
.tl-axis span { position: absolute; top: 2px; transform: translateX(-50%); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.tl-legend  { margin-top: 4px; font-size: 10px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tl-legend span { display: inline-block; margin-left: 6px; }
.tl-key-bar { width: 14px; height: 7px; border-radius: 2px; background: #22c55e; }
.tl-key-tot { width: 2px; height: 10px; }
.tl-key-danger { width: 12px; height: 7px; border-radius: 2px; box-shadow: 0 0 0 2px #ef4444; }
.tl-empty   { font-size: 12px; }
.tl-label, .tl-legend { color: var(--text-2); }
.tl-axis { border-color: var(--line-2); color: var(--text-3); }
.tl-row:hover .tl-label { color: var(--text); }
.tl-bar[data-action] { cursor: pointer; }
.tl-bar[data-action]:hover { opacity: 1; outline: 1px solid #fff; }
.tl-key-tot { background: #fff; }
.tl-empty { color: var(--text-3); }

/* ==========================================================================
   Target selection (value of a group of targets)
   ========================================================================== */
.map-container.selecting, .map-container.selecting .leaflet-interactive { cursor: crosshair !important; }
.select-panel {
    position: absolute; top: 12px; left: 12px; z-index: 1000; width: 330px; max-height: calc(100% - 60px); overflow-y: auto;
    padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 12px; color: var(--text);
}
.select-panel .ic { width: 15px; height: 15px; margin-right: 5px; vertical-align: -3px; }
.sel-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.sel-head b { font-size: 13px; }
.sel-count { color: var(--accent); font-weight: 600; }
.sel-src { flex-basis: 100%; font-size: 11px; color: var(--text-3); }
.sel-close { margin-left: auto; background: none; border: none; color: var(--text-3); cursor: pointer; padding: 2px; }
.sel-close:hover { color: var(--text); }
.sel-mode { display: flex; gap: 4px; margin-bottom: 6px; }
.sel-mode button { flex: 1; padding: 5px 6px; background: var(--panel); color: var(--text-2); border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; font-size: 12px; }
.sel-mode button.active { border-color: var(--accent); color: var(--text); background: var(--panel-3); }
.sel-mode .sel-done { color: var(--accent); }
.sel-hint { margin: 2px 0 8px; font-size: 11px; line-height: 1.4; color: var(--text-3); }
.sel-att { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin: 4px 0 6px; color: var(--text-2); }
.sel-att .fp-faction { padding: 3px 7px; font-size: 11px; white-space: nowrap; }
.sel-own-toggle { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--text-2); cursor: pointer; }
.sel-table { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.sel-table th, .sel-table td { padding: 3px 4px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.sel-table th:first-child, .sel-table tbody th { text-align: left; font-weight: normal; color: var(--text-2); }
.sel-table thead th { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.sel-own { color: var(--text-3); }
.sel-line { margin: 4px 0; color: var(--text-2); }
.sel-line small { color: var(--text-3); }
.sel-det { margin-top: 6px; }
.sel-det summary { cursor: pointer; color: var(--text-2); padding: 3px 0; }
.sel-roles { width: 100%; border-collapse: collapse; }
.sel-roles td, .sel-roles th { padding: 2px 3px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sel-roles th { font-weight: normal; font-size: 10px; color: var(--text-3); }
.sel-roles td:first-child { text-align: left; color: var(--text); white-space: normal; }
.sel-det .sel-roles { display: block; max-height: 220px; overflow-y: auto; }
.sel-units { display: grid; gap: 2px; max-height: 180px; overflow-y: auto; }
.sel-unit { display: flex; align-items: center; gap: 6px; padding: 3px 4px; background: none; border: none; color: var(--text); cursor: pointer; text-align: left; border-radius: 4px; }
.sel-unit:hover { background: var(--panel-3); }
.sel-unit span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-x { color: var(--text-3); }
.sel-x:hover { color: var(--bad); }
.sel-actions { display: grid; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.sel-actions select { width: 100%; min-width: 0; }
.sel-actions .btn { justify-self: start; }
.sel-actions-h { display: flex; align-items: center; font-size: 12.5px; }
.sel-actions .sel-hint { margin: 0; }
.sel-field { display: grid; gap: 2px; color: var(--text-2); font-size: 11px; }
.sel-prev { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; line-height: 1.45; }
.sel-prev .sum-warn { margin-top: 4px; }
.sel-prev .sum-warn small { display: block; }
.sel-prev-tip { background: rgba(17,24,39,0.92); color: #facc15; border: 1px solid #facc15; font-size: 11px; padding: 1px 5px; box-shadow: none; }
.sel-prev-tip::before { display: none; }
.sel-filters { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.sel-filters:empty { display: none; }
.sel-chip { display: inline-flex; align-items: center; background: var(--panel); border: 1px solid var(--line-2); color: var(--text-2); border-radius: 12px; padding: 2px 8px; font-size: 11px; cursor: pointer; }
.sel-chip:hover { color: var(--text); border-color: var(--accent); }
.sel-chip .ic { width: 12px; height: 12px; }
.sel-mini { background: none; border: none; color: var(--text-3); cursor: pointer; padding: 1px 2px; line-height: 0; }
.sel-mini:hover { color: var(--accent); }
.sel-mini .ic { width: 13px !important; height: 13px !important; margin: 0 !important; }
.sel-role-btns { white-space: nowrap; }
.sel-grp-save { display: flex; gap: 4px; margin: 4px 0; }
.sel-grp-save input { flex: 1; min-width: 0; }
.sel-grp-update { margin-bottom: 4px; }
.sel-grps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.sel-grps li { display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: 4px; }
.sel-grps li.active { background: var(--panel-3); }
.sel-grp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-grp-name small { color: var(--text-3); }
.sel-edit-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.nuke-sel { display: grid; gap: 4px; margin: 0 0 8px; }
.nuke-sel .popup-btn { justify-content: flex-start; }
.tgt-weapon input[type=number] { width: 56px !important; flex: none; }
.tgt-wp { white-space: nowrap; }
.tgt-wp select { width: auto !important; max-width: 140px; padding: 2px 4px !important; }
.wp-table td.wp-flag { width: 24px; padding: 3px 2px; text-align: center; }
.wp-table input.wp-alt-input[type=number] { width: 76px !important; }

/* ==========================================================================
   Modal dialog (reset local data)
   ========================================================================== */
.modal-backdrop { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center;
    background: rgba(2, 6, 12, 0.66); padding: 16px; }
.modal-backdrop[hidden] { display: none; }
.modal { width: 460px; max-width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; padding: 16px 18px;
    background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    color: var(--text); font-size: 13px; }
.modal .ic { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.modal-head { display: flex; align-items: center; gap: 2px; font-size: 15px; margin-bottom: 8px; }
.modal-head > .ic { color: var(--bad); }
.modal-x { margin-left: auto; background: none; border: none; color: var(--text-3); cursor: pointer; padding: 2px; }
.modal-x:hover { color: var(--text); }
.modal-text { margin: 0 0 10px; color: var(--text-2); line-height: 1.45; }
.modal-note { margin: 10px 0; font-size: 12px; color: var(--text-3); line-height: 1.45; }
.modal-warn { margin: 10px 0; font-size: 12px; color: #fbbf24; line-height: 1.45; }
.modal-warn[hidden] { display: none; }
.reset-list { display: grid; gap: 6px; }
.reset-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px;
    background: var(--panel); cursor: pointer; }
.reset-row input { margin-top: 3px; }
.reset-row span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.reset-row small { color: var(--text-3); font-size: 11px; line-height: 1.35; }
.reset-size { font-size: 11px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.reset-backup { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reset-backup small { color: var(--text-3); font-size: 11px; }
.about-modal { width: 600px; }
.about-modal .modal-head > .ic { color: var(--accent); }
.about-lang { margin-left: auto; display: inline-flex; gap: 2px; }
.about-lang button { background: none; border: 1px solid var(--line-2); color: var(--text-3); border-radius: 4px; font-size: 11px; padding: 1px 6px; cursor: pointer; }
.about-lang button.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.about-lang + .modal-x { margin-left: 6px; }
.about-sec { border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 10px; }
.about-sec h3 { font-size: 13px; margin: 0 0 6px; display: flex; align-items: center; }
.about-sec h3 .ic { color: var(--accent); }
.about-sec p, .about-sec li { color: var(--text-2); line-height: 1.5; font-size: 12.5px; }
.about-sec p { margin: 0 0 6px; }
.about-sec ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
.about-sec a { color: var(--accent); }
.about-sec code { background: var(--panel-3); padding: 0 4px; border-radius: 3px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.btn.btn-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn.btn-danger:hover:not(:disabled) { background: #dc2626; border-color: #dc2626; }
.btn.btn-danger:disabled { opacity: 0.4; cursor: default; }
.settings-menu hr { border: none; border-top: 1px solid var(--line-2); margin: 6px 4px; }
.ic-wrap { display: inline-flex; vertical-align: middle; }
.ic-wrap.hint .ic { width: 14px; height: 14px; margin: 0; }

/* ---------- Builder: placed and changed units ---------- */
.shape-air { border-radius: 50% 50% 22% 22%; }
.sym-built { outline: 2px dashed var(--accent); outline-offset: 2px; }
.sym-changed { outline: 2px dotted #fbbf24; outline-offset: 2px; }
.legend-sym.sym-built { outline-offset: 1px; }
.bld-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bld-item { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-bottom: 1px solid var(--line); }
.bld-item .tac-go { flex: 1; display: grid; text-align: left; min-width: 0; }
.bld-item .tac-go b, .bld-item .tac-go small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bld-item .tac-go small { color: var(--text-3); font-size: 11px; font-weight: normal; }
.popup-builder { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); display: grid; gap: 6px; }
.pbd-h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.pbd-h .ic { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; }
.pbd-row { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 6px; font-size: 12px; }
.pbd-check { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.pbd-note { font-size: 11px; color: #fbbf24; }
.popup-builder .popup-actions { margin-top: 2px; }
.sym-dir { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.sym-dir::before { content: ''; position: absolute; left: -5px; top: calc(var(--sym) / -2 - 9px);
    border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 7px solid var(--fac); }
.zoom-far .sym-dir { display: none; }
.pbd-heading { display: flex; align-items: center; gap: 4px; }
.pbd-heading input { width: 70px; }

/* ---------- Builder palette ---------- */
.bld-fac { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.bld-fac .fp-faction { padding: 3px 8px; font-size: 11px; }
.bld-cat { margin: 8px 0; max-height: 380px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.bld-group summary { cursor: pointer; padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--panel-2); border-bottom: 1px solid var(--line); }
.bld-group summary .fp-n { float: right; font-weight: normal; }
.bld-type-row { display: flex; align-items: center; }
.bld-type { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: none; border: none;
    border-left: 3px solid transparent; color: var(--text); cursor: pointer; text-align: left; }
.bld-type:hover { background: var(--panel-3); }
.bld-type.active { background: var(--panel-3); border-left-color: var(--accent); }
.bld-type-name { flex: 1; min-width: 0; display: grid; font-size: 12px; }
.bld-type-name small { font-size: 10.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bld-price { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.bld-custom { margin: 8px 0; padding: 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); }
.bld-custom .bld-wide { grid-column: 1 / -1; }
.src-own { background: #1e3a5f; color: #93c5fd; }
.pbd-inline { display: flex; align-items: center; gap: 4px; }
.pbd-inline input { width: 80px; }
.pbd-note-lbl { display: grid; gap: 3px; font-size: 12px; }
.pbd-note-lbl textarea { width: 100%; resize: vertical; font: inherit; font-size: 12px; }
.pbd-phases { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; align-items: center; }
.pbd-phases small { flex-basis: 100%; color: var(--text-3); font-size: 11px; }
.pbd-own summary { cursor: pointer; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.pbd-own { display: grid; gap: 5px; }
.pbd-hint { color: var(--text-3); font-size: 11px; line-height: 1.35; }
.leaflet-popup-content .popup-builder { max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.sel-edit summary .ic { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; }
.sel-edit-row { display: flex; align-items: center; gap: 6px; margin: 6px 0; color: var(--text-2); }
.sel-edit-row select { flex: 1; min-width: 0; }
.sel-edit-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.sym-alt { position: absolute; left: 0; top: calc(var(--sym) / 2 + 3px); transform: translateX(-50%); white-space: nowrap;
    font-size: 10px; font-weight: 600; color: #e2e8f0; background: rgba(15, 23, 42, 0.85); padding: 0 4px; border-radius: 3px; pointer-events: none; }
.zoom-far .sym-alt { display: none; }

/* ---------- Sortie form: targets grouped by waypoint, bulk actions, shared targets ---------- */
.tgt-grp td { padding: 6px 4px 2px !important; font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line-2); }
.tgt-grp small { color: var(--text-3); text-transform: none; letter-spacing: 0; }
.tgt-sym { white-space: nowrap; }
.tgt-sym input[type=checkbox] { margin: 0 4px 0 0; vertical-align: middle; }
.tgt-also { color: var(--warn); font-size: 11px; display: flex; align-items: center; gap: 3px; }
.tgt-also .ic { width: 12px; height: 12px; }
.tgt-bulk { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; padding: 5px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.tgt-bulk[hidden] { display: none; }
.tgt-bulk-all { display: flex; align-items: center; gap: 4px; color: var(--text-2); }
.tgt-bulk-n { color: var(--accent); font-weight: 600; }
.tgt-bulk-hint { color: var(--text-3); font-size: 11px; }
.tgt-bulk select { max-width: 110px; }
.tgt-group-row { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.tgt-group-row[hidden] { display: none; }
.tgt-group-row select { flex: 1; min-width: 0; }
.sortie-shared { color: var(--warn); display: inline-flex; align-items: center; gap: 3px; }
.sortie-shared .ic { width: 12px; height: 12px; }
.dup-modal .sf-grid { margin-bottom: 8px; }
.dup-modal .modal-head > .ic { color: var(--accent); }

/* ==========================================================================
   Tactics board (quick planning): tokens and palette
   ========================================================================== */
.qt-wrap { background: none; border: none; }
.qt { position: relative; width: 40px; height: 40px; cursor: grab; }
.qt:active { cursor: grabbing; }
.qt-img { display: block; width: 34px; height: 34px; margin: 3px; background: var(--fac);
    -webkit-mask: var(--img) center / contain no-repeat; mask: var(--img) center / contain no-repeat;
    filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 2px 3px rgba(0,0,0,0.9)); transition: transform 0.12s ease; }
.qt-noimg { -webkit-mask: none; mask: none; clip-path: polygon(50% 0, 85% 100%, 50% 80%, 15% 100%); }
.qt-label { position: absolute; left: 50%; top: 38px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 700;
    color: #fff; background: rgba(11, 15, 20, 0.85); border: 1px solid var(--fac); border-radius: 4px; padding: 0 5px; pointer-events: none; }
.qt-label small { font-weight: 400; color: var(--text-2); }
.qt.sel::before { content: ''; position: absolute; inset: -4px; border: 2px dashed #facc15; border-radius: 50%; }
.qt:hover .qt-img { filter: drop-shadow(0 0 2px #facc15) drop-shadow(0 0 1px #fff) drop-shadow(0 2px 3px rgba(0,0,0,0.9)); }

.quick-panel {
    position: absolute; left: 12px; bottom: 28px; z-index: 1000; width: 300px; max-height: calc(100% - 80px); overflow-y: auto;
    padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 12px; color: var(--text);
}
.quick-panel[hidden] { display: none; }
.quick-panel .ic { width: 15px; height: 15px; margin-right: 5px; vertical-align: -3px; }
.qp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; }
.qp-fac { display: flex; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }
.qp-fac .fp-faction { padding: 3px 8px; font-size: 11px; }
.qp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 6px; }
.qp-ac { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px 3px; background: var(--panel);
    border: 1px solid var(--line); border-radius: 6px; color: var(--text-2); cursor: grab; }
.qp-ac:hover { border-color: var(--line-2); color: var(--text); }
.qp-ac.active { border-color: var(--accent); background: var(--panel-3); color: var(--text); }
.qp-ac .qt-img { width: 30px; height: 30px; margin: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8)); }
.qp-ac small { font-size: 9.5px; white-space: nowrap; }
.qp-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.qp-row .sel-own-toggle { margin: 0; }
.qp-actions:empty { display: none; }
.qp-pop .qp-pop-head { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.qp-pop .qp-pop-head input { flex: 1; font-weight: 700; }
.qp-rot { display: inline-flex; align-items: center; gap: 4px; }
.qp-rot input[type=range] { width: 100px; }
.qp-pop .qp-fac { margin: 0; }
.qp-phases { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.qp-phases .pbd-hint { flex-basis: 100%; }
.qp-pop .qp-fac .fp-faction { padding: 2px 7px; font-size: 11px; }
