/* ARGUS rework — minimal dark shell. Mobile-first, no framework. */
:root {
  --bg: #0f141a; --panel: #161d26; --line: #263241;
  --fg: #dbe4ee; --muted: #8496a8; --accent: #4f8fd8; --danger: #d86a5a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 15px/1.45 system-ui, sans-serif; }

/* Login */
.login-page { display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 32px; max-width: 380px; width: 100%; text-align: center; }
.login-card h1 { margin: 0 0 8px; letter-spacing: 2px; }
.btn-discord { display: block; margin: 20px 0 12px; padding: 12px; border-radius: 8px;
  background: #5865f2; color: #fff; text-decoration: none; font-weight: 600; }
.btn-discord:hover { filter: brightness(1.1); }

/* Shell */
.shell { display: flex; flex-direction: column; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: 2px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 6px; }
.nav a.active { color: var(--fg); background: #1f2a37; }
.nav a:hover { color: var(--fg); }
.spacer { flex: 1; }
.user { color: var(--muted); font-size: 13px; }
.btn-ghost { background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.btn-ghost:hover { color: var(--fg); }

/* View */
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.empty { margin: auto; color: var(--muted); text-align: center; padding: 24px; max-width: 460px; }
.empty h2 { color: var(--fg); margin: 0 0 6px; }

/* Battles — dense tables remain horizontally scrollable on phones while the
   page itself keeps a stable single-column reading order. */
.battle-page { flex: 1; min-height: 0; overflow: auto; padding: 16px; background: #11100f; }
.battle-head, .battle-title, .battle-detail-head, .battle-scan { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.battle-head h1, .battle-title h2, .battle-card h2, .battle-card h3 { margin: 0; }
.battle-head p, .battle-title p { margin: 3px 0 0; }
.battle-open { display: flex; gap: 6px; flex-wrap: wrap; }
.battle-open input { width: min(360px, 75vw); }
.battle-open input, .battle-open button, .battle-title button, .battle-scan button,
.battle-tabs button { background: #1b2531; color: var(--fg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; }
.battle-open button, .battle-title button, .battle-scan button, .battle-tabs button { cursor: pointer; }
.battle-open button:hover, .battle-title button:hover, .battle-scan button:hover, .battle-tabs button:hover,
.battle-tabs button.active { border-color: var(--accent); background: #203149; }
.battle-open button:disabled, .battle-title button:disabled, .battle-scan button:disabled { opacity: .6; cursor: wait; }
.battle-tabs { display: flex; gap: 5px; margin: 14px 0 9px; }
.battle-detail-head { justify-content: flex-start; margin-bottom: 12px; }
.battle-title { margin-bottom: 12px; }
.battle-card { background: #191816; border: 1px solid #302e2b; border-radius: 11px; padding: 13px; margin-bottom: 14px; }
.battle-card h3 { margin-bottom: 9px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.battle-table-wrap { max-width: 100%; overflow-x: auto; }
.battle-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.battle-table th, .battle-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.battle-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.battle-table tbody tr[data-id] { cursor: pointer; }
.battle-table tbody tr:hover { background: #1b2531; }
.battle-live { color: #6bd06b; font-size: 12px; font-weight: 700; }
.battle-overview td { vertical-align: middle; }
.battle-overview th:nth-child(6), .battle-overview td:nth-child(6) { min-width: 250px; }
.battle-region { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.battle-region-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.battle-tag { width: max-content; border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.battle-tag.capital { color: #ffd166; border-color: #6d5726; background: #2b2415; }
.battle-tag.resource { color: #63d8c3; border-color: #265f58; background: #142a28; }
.battle-score span:first-child { color: #ff5666; }
.battle-score span:nth-child(2) { color: #65a4ff; }
.battle-score small { color: var(--muted); }
.battle-damage { display: grid; gap: 4px; }
.battle-damage-values { display: grid; grid-template-columns: 1fr auto auto 1fr; gap: 7px; align-items: center; font-size: 10px; }
.battle-damage-values span:last-child { text-align: right; }
.battle-damage-values b:nth-child(2) { color: #ff7b86; }
.battle-damage-values b:nth-child(3) { color: #78adff; }
.battle-damage-bar { height: 8px; display: flex; overflow: hidden; border-radius: 3px; background: #28313c; }
.battle-damage-bar i:first-child { background: #ce3143; }
.battle-damage-bar i:last-child { background: #3272c8; }
.battle-progress h3 { display: flex; align-items: center; gap: 7px; }
.battle-spinner { width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: battle-spin .8s linear infinite; }
.battle-progress-row { display: grid; grid-template-columns: 145px minmax(180px, 1fr) 76px; align-items: center; gap: 10px; margin: 9px 0; font-size: 12px; }
.battle-progress-row > b { text-align: right; color: var(--muted); font-size: 11px; }
.battle-progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #29313b; }
.battle-progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4392ff, #6bd6c5); transition: width .3s ease; }
.battle-progress-track.indeterminate i { width: 35% !important; animation: battle-indeterminate 1.2s ease-in-out infinite; }
@keyframes battle-spin { to { transform: rotate(360deg); } }
@keyframes battle-indeterminate { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.battle-analytics-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.battle-analytics-head p { margin: 0; font-size: 11px; }
.battle-chart-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.battle-chart-controls > span { display: flex; gap: 2px; padding: 2px; border-radius: 6px; background: #242321; }
.battle-chart-controls button { border: 1px solid var(--line); border-radius: 6px; background: #171e27; color: var(--muted); padding: 5px 9px; cursor: pointer; font-size: 11px; }
.battle-chart-controls button.active { color: var(--fg); border-color: var(--accent); background: #203149; }
.battle-chart-controls button:disabled { opacity: .35; cursor: not-allowed; }
.battle-chart-legend { min-height: 27px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; padding: 7px 0 2px; font-size: 11px; color: var(--muted); }
.battle-chart-legend span, .battle-group-name { display: inline-flex; align-items: center; gap: 6px; }
.battle-chart-legend i, .battle-group-name > i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.battle-chart { display: block; width: 100%; min-width: 1500px; height: auto; overflow: visible; }
.battle-chart text { fill: var(--muted); font-size: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.battle-chart .chart-grid { stroke: var(--line); stroke-width: 1; }
.battle-chart .chart-grid.vertical { opacity: .45; }
.battle-chart .chart-axis-title { font-size: 11px; }
.battle-analytics { overflow-x: auto; }
.battle-group-table { min-width: 1450px; }
.battle-group-name small { color: var(--muted); }
.battle-group-name > span { display: flex; flex-direction: column; }
.battle-group-table td:not(:first-child):not(:nth-child(2)), .battle-group-table th:not(:first-child):not(:nth-child(2)) { text-align: right; }
.battle-group-table td small { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.battle-group-bar { position: relative; min-width: 210px; height: 24px; overflow: hidden; border-radius: 6px; background: #252b33; }
.battle-group-bar > i { display: block; height: 100%; background: #b52f3d; border-radius: inherit; }
.battle-group-bar > b { position: absolute; inset: 0 7px; display: flex; align-items: center; justify-content: flex-end; font-size: 10px; }
.battle-group-table .positive { color: #6bd06b; }
.positive { color: #55c56a; }
.negative { color: #ff5b61; }
.battle-best { margin-left: 7px; color: #f6b91a; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.battle-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; margin-bottom: 12px; }
.battle-kpis-reference { display: flex; align-items: stretch; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.battle-kpis-reference .battle-kpi { flex: 0 1 auto; min-width: 125px; }
.battle-kpis-reference .battle-kpi:last-child { min-width: 235px; }
.battle-kpis-reference .battle-kpi { background: #191816; border-color: #302e2b; }
.battle-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.battle-kpi span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.battle-kpi b { display: block; margin-top: 3px; font-size: 15px; }
.battle-kpi b small { color: var(--muted); font-size: 9px; font-weight: 500; }
.battle-scan-summary { padding: 13px; }
.battle-scan-top, .battle-scan-line { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.battle-scan-line { justify-content: flex-start; margin-top: 5px; color: var(--muted); font-size: 12px; }
.battle-scan-line > b { color: var(--fg); }
.battle-scan-summary > p { margin: 10px 0 0; font-size: 11px; }
.battle-scan-top button { background: transparent; color: var(--fg); border: 1px solid #46433f; border-radius: 7px; padding: 6px 10px; cursor: pointer; }
.battle-scan-top button:disabled { opacity: .5; cursor: wait; }
.battle-payout { margin-top: 12px; padding-top: 11px; border-top: 1px solid #302e2b; }
.battle-payout > h3 { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.battle-payout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.battle-payout-side { min-width: 0; padding: 9px 10px; border: 1px solid #302e2b; border-left: 3px solid #ff5666; border-radius: 8px; background: #141311; }
.battle-payout-side.defender { border-left-color: #65a4ff; }
.battle-payout-country { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.battle-payout-country > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.battle-payout-country > strong { color: #ff7b86; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.battle-payout-side.defender .battle-payout-country > strong { color: #78adff; }
.battle-payout-bar { height: 4px; margin: 7px 0; overflow: hidden; border-radius: 999px; background: #2a2926; }
.battle-payout-bar i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: #ce3143; }
.battle-payout-side.defender .battle-payout-bar i { background: #3272c8; }
.battle-payout-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.battle-payout-stats span { min-width: 0; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.battle-payout-stats b { display: block; overflow: hidden; color: var(--fg); font: 700 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; }
.battle-payout-contracts { margin-top: 7px; padding-top: 5px; border-top: 1px solid #302e2b; font-size: 10px; }
.battle-payout-contracts summary { color: var(--muted); cursor: pointer; }
.battle-payout-contracts > div { display: grid; grid-template-columns: minmax(100px,1fr) auto auto; gap: 8px; padding: 4px 0; border-bottom: 1px solid #25231f; }
.battle-payout-contracts > div:last-child { border-bottom: 0; }
.battle-payout-contracts > div > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.battle-payout-contracts small { color: var(--muted); }
.battle-payout-contracts em { color: #f6b91a; font-style: normal; font-size: 8px; }
.battle-analytics .chart-grid { stroke: #302e2b; }
.battle-analytics .battle-chart-controls button { border-color: transparent; background: transparent; }
.battle-analytics .battle-chart-controls button.active { border-color: #34322f; background: #161513; }
.battle-proof summary, .eff-cell summary { cursor: pointer; }
.battle-proof > details > summary { font-weight: 700; }
.battle-formula { background: #10161e; border-left: 3px solid var(--accent); border-radius: 5px; padding: 9px 11px; margin: 8px 0; font-size: 12px; line-height: 1.65; white-space: normal; min-width: 320px; }
.coverage-line { display: flex; align-items: baseline; gap: 8px; }
.coverage-line b { font-size: 22px; color: #6bd06b; }
.coverage-line + p { margin-bottom: 0; }
.battle-player-card { padding: 0; overflow: hidden; }
.battle-player-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; padding: 10px 13px; border-bottom: 1px solid #302e2b; }
.battle-player-head > div { display: flex; align-items: center; gap: 10px; }
.battle-player-head h2 { font-size: 15px; }
.battle-player-head select { height: 30px; min-width: 185px; border: 1px solid #3a3835; border-radius: 7px; background: #211f1d; color: var(--fg); padding: 4px 9px; }
.battle-players { min-width: 1750px; table-layout: fixed; }
.battle-players th[data-player-sort] { cursor: pointer; user-select: none; }
.battle-players th[data-player-sort]:hover { color: var(--fg); }
.battle-players td:not(:nth-child(2)):not(:nth-child(3)):not(:last-child), .battle-players th:not(:nth-child(2)):not(:nth-child(3)):not(:last-child) { text-align: right; }
.battle-players td { vertical-align: middle; }
.battle-burned-items { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; min-width: 145px; max-width: 330px; }
.battle-item-icon { position: relative; display: inline-grid; place-items: center; width: 23px; height: 23px; flex: none;
  overflow: visible; border: 2px solid #9ca3af; border-radius: 5px; background: #202833; }
.battle-item-icon.q2 { border-color: #4ade80; }
.battle-item-icon.q3 { border-color: #60a5fa; }
.battle-item-icon.q4 { border-color: #c084fc; }
.battle-item-icon.q5 { border-color: #facc15; }
.battle-item-icon.q6 { border-color: #f87171; }
.battle-item-icon img { display: block; width: 19px; height: 19px; border-radius: 3px; object-fit: contain; }
.battle-item-fallback { display: none; color: var(--muted); font-size: 11px; font-weight: 800; }
.battle-item-icon.missing img { display: none; }
.battle-item-icon.missing .battle-item-fallback { display: block; }
.battle-item-icon > b { position: absolute; right: -4px; bottom: -5px; min-width: 13px; height: 13px; padding: 0 3px;
  display: grid; place-items: center; border: 1px solid #556476; border-radius: 999px; background: #0b1118; color: #fff;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; box-shadow: 0 1px 3px rgba(0,0,0,.65); }
.battle-show-all { width: 100%; border: 0; border-top: 1px solid #302e2b; background: transparent; color: var(--muted); padding: 9px; cursor: pointer; }
.battle-show-all:hover { color: var(--fg); background: #211f1d; }
.eff-cell { position: relative; }
.eff-cell[open] .battle-formula { position: absolute; right: 12px; z-index: 10; width: min(620px, 80vw); box-shadow: 0 8px 24px rgba(0,0,0,.45); }

@media (max-width: 640px) {
  .battle-page { padding: 10px; }
  .battle-open { width: 100%; }
  .battle-progress-row { grid-template-columns: 95px minmax(100px, 1fr) 60px; gap: 6px; }
  .battle-open input { flex: 1; width: auto; min-width: 180px; }
  .battle-formula { min-width: 260px; }
  .battle-payout-grid { grid-template-columns: 1fr; }
}

/* Map — WarEra-artiger tiefblauer Ozean mit feinem Koordinatenraster. */
.map-wrap { flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: none;
  background:
    radial-gradient(circle at center, #061c2d, #030e16); }
.map-canvas-plane { position: absolute; inset: 0; pointer-events: none; }
.map-canvas { position: absolute; left: -100%; top: -25%; width: 300%; height: 150%; display: block; pointer-events: none; }
.map-wrap svg { position: relative; z-index: 1; width: 100%; height: 100%; display: block; cursor: grab; overflow: visible; }
.map-world-copy { pointer-events: none; }
/* Bei hohem Zoom ist der Canvas allein die Interaktionsebene. Der komplexe
   SVG-Baum (Labels, Marker, Grenzpfade) wird nach dem Loslassen sofort wieder
   eingeblendet, muss aber nicht in jedem Drag-Frame komponiert werden. */
.map-wrap svg.map-panning .map-world-strip { visibility: hidden; }
/* Weltgruppe als eigener Compositing-Layer: Zoom/Pan skaliert gecachte
   Pixel und rendert erst nach der Geste scharf nach — flüssig statt ruckelig. */
.map-wrap svg, .map-canvas-plane { will-change: transform; }
.map-wrap svg:focus { outline: none; }
.map-wrap svg:active { cursor: grabbing; }
.map-grid { opacity: .58; }
.map-grid line { stroke: #082338; stroke-width: calc(0.55px / var(--k, 1)); }
.region { fill: #172934; stroke: rgba(1,8,12,.92); stroke-width: calc(0.55px / var(--k, 1)); transition: filter .12s ease; }
.region.map-hit-region { visibility: hidden !important; pointer-events: none !important; }
.region:hover { filter: brightness(1.28) saturate(1.08); }
.region.adjacent { filter: brightness(1.12); stroke: #9fb2c6; stroke-width: 1; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
.region.selected { filter: brightness(1.34) saturate(1.15); stroke: var(--selection-color, #f3f7fb); stroke-width: 1.6; vector-effect: non-scaling-stroke; }

/* Besitz-Ebene: deckende, ruhige Farben; Hover/Auswahl werden hier gespiegelt,
   weil sie über der Basiskarte liegt. Zustände zusätzlich per Form/Kontur
   (nicht nur Farbe) erkennbar. */
.intel-own { pointer-events: auto; }
.intel-own.hover { filter: brightness(1.22); }
.intel-own.adjacent { filter: brightness(1.1); stroke: #9fb2c6; stroke-width: 0.7; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
.intel-own.selected { filter: brightness(1.35); stroke: var(--selection-color, #f3f7fb); stroke-width: 1.6; vector-effect: non-scaling-stroke; }

/* Grenzhierarchie: dunkle Regionslinien kommen einheitlich aus Canvas; SVG
   ergänzt nur Küsten. Länder sind bereits durch ihre Besitzfarbe erkennbar. */
.border-layer { pointer-events: none; }
.border-layer path { fill: none; }
/* LOD der Grenzen: Weltzoom nutzt die groben Arcs (billiges Stroking),
   ab Land-Zoom nur die feinen Küsten. */
svg[data-zoom="world"] .border-fine { display: none; }
svg:not([data-zoom="world"]) .border-coarse { display: none; }
.border-coast { stroke: rgba(79, 139, 161, 0.58); stroke-width: calc(0.72px / var(--k, 1)); }

/* Kompakte Flagge + Ländername wie im Spiel. Beide bleiben dank Halo auch auf
   ähnlich gefärbten Territorien lesbar, ohne die Karte zu überdecken. */
.country-marker { pointer-events: none; }
.country-label { fill: #c9d2d8; stroke: #071019; stroke-width: 3px; paint-order: stroke;
  font-weight: 760; letter-spacing: -0.015em; pointer-events: none;
  font-family: "Saira", system-ui, sans-serif; }
.country-flag-bg { fill: rgba(3, 8, 12, .88); stroke: #050808; stroke-width: 1px; }
.country-flag { pointer-events: none; }
.country-flag-fallback { fill: #cee0e3; stroke: #050808; stroke-width: 2px; paint-order: stroke;
  font-family: "Saira", system-ui, sans-serif; font-weight: 700; pointer-events: none; }

/* Zoom-Steuerung */
.map-zoomctl { position: absolute; z-index: 3; left: 14px; top: 14px; display: flex; flex-direction: column; gap: 6px; }
.map-zoomctl button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(12,21,29,.82); backdrop-filter: blur(12px); color: var(--fg); font-size: 16px; cursor: pointer;
  box-shadow: 0 5px 18px rgba(0,0,0,.22); }
.map-zoomctl button:hover { background: #243747; border-color: #58738a; }
.map-hud { position: absolute; z-index: 3; left: 10px; bottom: 10px; background: rgba(15,20,26,.85);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13px;
  max-width: min(320px, calc(100% - 20px)); }
.map-hud .muted { display: block; }
.module-note { padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--muted);
  font-size: 13px; background: var(--panel); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

@media (max-width: 640px) {
  .topbar { padding: 6px 8px; gap: 8px; }
  .user { display: none; }
}

/* Ebenensteuerung: kompakt, einklappbar; Touch-Ziele ≥ 44 px auf Mobil. */
.layer-panel { position: absolute; z-index: 3; right: 14px; top: 14px; background: rgba(10,18,25,.84);
  backdrop-filter: blur(16px) saturate(1.15); border: 1px solid rgba(115,145,168,.34); border-radius: 12px; font-size: 12px;
  display: flex; flex-direction: column; width: 220px; max-width: min(260px, calc(100% - 28px));
  max-height: calc(100% - 20px); overflow: hidden; }
.layer-head { background: none; border: 0; color: var(--fg); font: inherit; font-weight: 600;
  text-align: left; padding: 9px 12px; cursor: pointer; min-height: 40px; }
.layer-head::before { content: "−"; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 7px;
  border-radius: 5px; background: rgba(116,151,177,.14); color: #a9bed0; }
.layer-panel.collapsed { width: auto; }
.layer-panel.collapsed .layer-head::before { content: "+"; }
.layer-body { display: flex; flex-direction: column; gap: 2px; padding: 0 12px 10px; overflow-y: auto; }
.layer-panel.collapsed .layer-body { display: none; }
.layer-panel label { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 32px; padding: 0 3px; border-radius: 6px; }
.layer-panel label:hover { background: rgba(115,145,168,.1); }
.layer-panel input { accent-color: #5ca7d3; }
.region-name { fill: #e1ebf2; stroke: #071019; stroke-width: 3px; paint-order: stroke; pointer-events: none;
  font-weight: 620; letter-spacing: .01em; text-rendering: geometricPrecision; }
.res-legend { display: flex; flex-wrap: wrap; gap: 3px 10px; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.res-legend[hidden] { display: none; }
.fort-legend { display: flex; flex-wrap: wrap; gap: 3px 10px; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.fort-legend[hidden] { display: none; }
.intel-hud { max-width: min(300px, calc(100% - 20px)); }
.intel-details summary { cursor: pointer; color: var(--muted); font-size: 11px; margin-top: 2px; }

/* Whiteboard */
.wb { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wb-top { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--panel);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wb-top select { background: #1f2a37; color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.wb-status { font-size: 12px; color: var(--muted); }
.wb-status.ok { color: #6bd06b; } .wb-status.warn { color: #ffd24a; } .wb-status.err { color: var(--danger); }
.wb-tools { display: flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--panel);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wb-tool { background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--fg);
  width: 32px; height: 30px; cursor: pointer; }
.wb-tool.active { background: var(--accent); border-color: var(--accent); }
.wb-swatch { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--line); cursor: pointer; }
.wb-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.wb-cursor-name { fill: #9fb2c6; font-size: 4px; }
.wb-overlay-note { top: 10px; left: 10px; bottom: auto; }
.wb-obj { }

/* Strategy */
.st { display: flex; flex: 1; min-height: 0; }
.st-side { width: 320px; min-width: 260px; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow-y: auto; }
.st-planbar { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.st-planbar select { flex: 1; background: #1f2a37; color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 4px; min-width: 0; }
.st-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.st-compose { margin: 7px 8px 3px; padding: 9px 10px; border: 1px solid #6d5726; border-radius: 8px;
  background: #201b10; color: var(--fg); }
.st-compose strong { display: block; margin-bottom: 4px; }
.st-compose .warn-text { color: #ff9d7a; }
.st-compose button { margin-top: 7px; }
.st-steps { flex: 1; overflow-y: auto; padding: 4px; }
.st-group { padding: 6px 6px 2px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.st-group-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--group-color, #f7faf9);
  box-shadow: 0 0 0 1px rgba(255,255,255,.2); }
.st-step { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; margin: 4px 2px; background: #131a22; cursor: grab; }
.st-step:focus { outline: 2px solid var(--accent); }
.st-num { background: var(--accent); color: #fff; border-radius: 50%; width: 20px; height: 20px;
  display: grid; place-items: center; font-size: 11px; flex: none; }
.st-step.st-resistance .st-num { background: #8f6a3f; }
.st-step.st-build .st-num { background: #3f7f4f; }
.st-mini { padding: 1px 6px; font-size: 12px; }
.st-touch { margin-left: auto; display: flex; gap: 2px; }
.st-add-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 2px; }
.st-add-actions button { min-width: 0; padding: 6px 4px; }
.st-actions { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.st-map { position: relative; }
[data-layer="route"] { pointer-events: none; }
.st-arrow-halo { fill: none; stroke: rgba(2,7,10,.9); stroke-width: 6.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.st-arrow { fill: none; stroke: var(--route-color, #f7faf9); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px rgba(255,210,40,.92)); }
.st-arrow.active { stroke-width: 4.4; filter: drop-shadow(0 0 6px rgba(255,210,40,1)); }
.st-arrow-flow { fill: none; stroke: #1a1300; stroke-width: 2.3; stroke-linecap: round;
  stroke-dasharray: 6 10; vector-effect: non-scaling-stroke; animation: stAttackFlow .9s linear infinite; }
@keyframes stAttackFlow { to { stroke-dashoffset: -16; } }
.st-route-end circle { vector-effect: non-scaling-stroke; }
.st-route-source circle { fill: none; stroke: #ffe24a; stroke-width: 1.6; }
.st-route-target circle { fill: #ffe24a; stroke: #1a1300; stroke-width: 1.2; }
.st-route-target.active { filter: drop-shadow(0 0 6px rgba(255,210,40,.95)); }
.st-marker circle { fill: #1a1300; stroke: var(--route-color, #ffe24a); stroke-width: 1.4; }
.st-marker text { fill: var(--route-color, #ffe24a); font-size: 9px; font-weight: 700; }

/* Regionsdetails wie im alten Planer: Desktop als rechter Drawer, Mobil als
   Bottom Sheet. Der Drawer liegt bewusst ueber den Kartenebenen-Schaltern. */
.st-detail { z-index: 5; left: auto; right: 0; bottom: 0; top: 0; width: min(460px, calc(100% - 20px));
  max-width: none; max-height: none; overflow-y: auto; padding: 16px 14px;
  border-radius: 12px 0 0 12px; border-top: 0; border-right: 0; border-bottom: 0;
  background: rgba(15,20,26,.96); backdrop-filter: blur(16px) saturate(1.12);
  box-shadow: -10px 0 30px rgba(0,0,0,.42); }
.st-detail strong { display: block; margin-bottom: 4px; font-size: 14px; }
.st-neighbors { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; }
.st-nb { background: #1b2531; border: 1px solid var(--line); color: var(--fg); border-radius: 999px;
  padding: 2px 9px; font-size: 11px; cursor: pointer; }
.st-nb:hover { border-color: var(--accent); color: #fff; }
.st-region-planner { margin-top: 12px; padding: 11px; border: 1px solid #2a456e; border-radius: 8px;
  background: linear-gradient(160deg, #0d1928, #0a1320); }
.st-planner-title { color: #ffe24a; font-weight: 700; margin-bottom: 8px; }
.st-region-planner label { display: grid; gap: 4px; margin-top: 8px; color: #7f9db8; font-size: 11px;
  letter-spacing: .04em; text-transform: uppercase; }
.st-region-planner select, .st-region-planner input, .st-region-planner textarea {
  width: 100%; box-sizing: border-box; background: #0c1828; color: var(--fg); border: 1px solid #2a456e;
  border-radius: 5px; padding: 7px 8px; font: inherit; font-size: 12px; color-scheme: dark; }
.st-region-planner textarea { resize: vertical; min-height: 58px; }
.st-region-planner select:focus, .st-region-planner input:focus, .st-region-planner textarea:focus {
  outline: 2px solid rgba(255,226,74,.35); border-color: #ffe24a; }
.st-planner-grid { display: grid; grid-template-columns: 1fr 110px; gap: 7px; }
.st-planner-status { margin-top: 7px; line-height: 1.35; }
.st-planner-status.warn-text { color: #ff9d7a; }
.st-region-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--line); }
.st-region-actions .btn { grid-column: 1 / -1; }
.st-region-actions button { min-width: 0; }
.st-region-actions .st-plan-attack { background: #5a4b12; color: #fff3a5; border: 1px solid #ffe24a; }
.st-region-actions button.preferred { border-color: #ffe24a; box-shadow: 0 0 0 1px rgba(255,226,74,.18); }
.st-detail > button.st-mini { position: absolute; top: 6px; right: 6px; min-width: 28px; min-height: 28px; }

@media (max-width: 760px) {
  .st { flex-direction: column; }
  .st-side { width: 100%; max-height: 45%; border-right: none; border-bottom: 1px solid var(--line); }
  /* Bottom Sheet: volle Breite, Karte bleibt oben sichtbar */
  .st-detail { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-width: none; max-height: 45%;
    border-radius: 12px 12px 0 0; border-left: 0; border-right: 0; border-bottom: 0; }
  /* Status bleibt als Einzeiler sichtbar (Aktualität!), Details eingeklappt */
  .intel-hud { padding: 4px 8px; font-size: 11px; max-width: calc(100% - 20px); }
  .map-zoomctl button { width: 44px; height: 44px; }
  .layer-head { min-height: 44px; }
  .layer-panel label { min-height: 44px; }
}

/* Exchange (Phase G) */
.x-modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 50; }
.x-modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: min(720px, 94vw);
  max-height: 88vh; display: flex; flex-direction: column; }
.x-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.x-modal-body { padding: 12px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.x-modal-body select, .x-modal-body input { background: #1f2a37; color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.x-modal-foot { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.x-prop { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.x-chip { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.x-sketch-wrap { position: relative; touch-action: none; }
.x-sketch-wrap canvas { width: 100%; display: block; border: 1px solid var(--line); border-radius: 6px; }
#x-rect { position: absolute; display: none; border: 2px dashed var(--accent); background: rgba(90,169,255,.15); pointer-events: none; }
.x-preview { max-width: 100%; border: 1px solid var(--accent); border-radius: 6px; }
.x-overlay-badges { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; max-width: min(420px, 70%); }
.x-badge { background: rgba(15,20,26,.85); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12px; }
.x-badge.warn { color: var(--danger); border-color: var(--danger); }
.st-attach { padding: 4px 8px; }
.st-attach-img { max-width: 100%; border: 1px solid var(--line); border-radius: 6px; }

/* ---- Phase H: Intel-Ebenen + Aktualität ------------------------------- */
.intel-fresh { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; max-width: 320px; }
.intel-overall { font-size: 12px; font-weight: 600; }
.intel-overall.intel-stale, .intel-row.intel-stale { color: #c47f17; }
.intel-overall.intel-unavailable, .intel-row.intel-unavailable { color: var(--muted, #8a93a6); }
.intel-overall.intel-current { color: #3f9d5a; }
.intel-row { font-size: 11px; color: var(--muted, #8a93a6); }
.intel-row.intel-stale::before { content: "⚠ "; }
/* Marker: kleine, ruhige Symbole in Bildschirmgröße (Skalierung via JS).
   Innere Einheiten entsprechen Bildschirm-Pixeln. Marker sind klickbar
   (wählen ihre Region aus) und tragen Tooltips. */
.intel-capital, .intel-res, .intel-battle { cursor: pointer; }
.intel-capital text, .intel-res text, .intel-battle text { pointer-events: none; }
.intel-capital .cap-ring { fill: none; stroke: #d8b44a; stroke-width: 1.2; }
.intel-capital .cap-dot { fill: #e8c964; }
.intel-res rect { fill: rgba(12, 20, 16, 0.85); stroke-width: 1.2; }
.intel-res text { font-size: 6.5px; fill: #dff2e6; font-weight: 600; }
/* Befestigungen: 5-Segment-Ringe. Bunker blau (außen), Basis rot (innen);
   gefüllte Segmente = Level, aktive Upgrades leuchten dezent (statisch). */
.intel-fort { cursor: pointer; }
.intel-fort path { fill: none; stroke-width: 2.6; stroke-linecap: round; }
.intel-fort .fort-b.on { stroke: #5aa9ff; filter: drop-shadow(0 0 3px rgba(90, 169, 255, 0.95)); }
.intel-fort .fort-m.on { stroke: #e05a4e; filter: drop-shadow(0 0 3px rgba(224, 90, 78, 0.95)); }
.intel-fort .off { stroke: rgba(155, 170, 185, 0.45); stroke-width: 1.8; }

.intel-battle .battle-ring { fill: #2a1113; stroke: #e04a3e; stroke-width: 1.6; }
.intel-battle text { font-size: 8px; fill: #ffd7d2; }
.intel-battle { animation: battle-pulse 3s ease-in-out infinite; }
@keyframes battle-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }
.intel-battle.stale { animation: none; }
.intel-battle.stale .battle-ring { stroke: #8a6a4a; fill: #241d16; }
.intel-battle.incomplete .battle-ring { stroke-dasharray: 3 2; }
.intel-battle-cluster { cursor: pointer; }
.intel-battle-cluster circle { fill: #2a1113; stroke: #e04a3e; stroke-width: 1.8; }
.intel-battle-cluster.stale circle { stroke: #8a6a4a; fill: #241d16; }
.intel-battle-cluster text { font-size: 9px; font-weight: 700; fill: #ffd7d2; pointer-events: none; }
.intel-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; max-width: 340px; max-height: 96px; overflow: auto; }
.intel-legend-item { font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.intel-legend-item i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.st-territory-warn { border-left: 3px solid #c47f17; top: auto; bottom: 12px; max-width: 380px; }
.st-territory-warn strong { color: #c47f17; }

/* Info-HUD der Strategy Map ist reine Anzeige: Gesten gehen zur Karte durch.
   Nur die scrollbare Besitz-Legende bleibt interaktiv. */
.map-hud.st-hud { pointer-events: none; }
.map-hud.st-hud .intel-legend { pointer-events: auto; }

.intel-row.intel-incomplete { color: #c47f17; font-weight: 600; }

/* ARGUS-Branding: quadratisches Logo, nie verzerrt (aspect-ratio 1:1). */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo { width: 28px; height: 28px; aspect-ratio: 1 / 1; object-fit: contain; display: block; }
.login-logo { width: 160px; height: 160px; max-width: 60%; aspect-ratio: 1 / 1; object-fit: contain; margin: 0 auto 8px; display: block; }
.empty-logo { width: 96px; height: 96px; aspect-ratio: 1 / 1; object-fit: contain; margin: 0 auto 10px; display: block; opacity: .9; }

/* Adminansicht "Discord-Zugänge" — Desktop + Mobil (kein Overflow bei 390px). */
.admin-wrap { flex: 1; min-height: 0; overflow: auto; padding: 14px; }
.admin-grid { display: grid; gap: 14px; max-width: 980px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.card h2 { margin: 0 0 10px; font-size: 16px; }
.card h3 { margin: 12px 0 6px; font-size: 14px; }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.form-row label { min-width: 130px; color: var(--muted); font-size: 13px; }
.form-row input[type=text], .form-row select, .admin-wrap input[type=search] {
  background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; font: inherit; min-width: 0; flex: 1; max-width: 100%; }
.form-row input:focus-visible, .admin-wrap select:focus-visible, .admin-wrap button:focus-visible,
.admin-wrap input:focus-visible, .modal button:focus-visible, .modal input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { background: var(--accent); border: none; color: #0b0f14; font-weight: 600;
  border-radius: 6px; padding: 9px 14px; cursor: pointer; min-height: 40px; }
.btn:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--muted); }
.chip.on { color: #7ad48a; border-color: #2c4a33; }
.chip.off { color: var(--danger); border-color: #4a2c2c; }
.module-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px; }
.module-picker label { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 6px;
  border: 1px solid transparent; cursor: pointer; font-size: 13px; min-height: 40px; }
.module-picker label:hover { border-color: var(--line); }
.mapping-list { display: grid; gap: 8px; }
.mapping-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 6px; }
.mapping-item .row1 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mapping-item .mods { font-size: 12px; color: var(--muted); word-break: break-word; }
.mapping-item .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.role-list, .member-list { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.member-list:empty { display: none; }
.role-list button, .member-list button { display: flex; width: 100%; gap: 8px; align-items: center; background: none; border: 0;
  border-bottom: 1px solid var(--line); color: var(--fg); padding: 9px 10px; cursor: pointer; text-align: left;
  font: inherit; min-height: 40px; }
.role-list button:hover, .member-list button:hover, .member-list button.selected { background: #1f2a37; }
.role-list .rid, .member-list .rid { color: var(--muted); font-size: 12px; margin-left: auto; }
.member-list button > span:first-child { display: grid; gap: 2px; }
.selected-member { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin: 10px 0;
  border-left: 3px solid var(--accent); padding: 7px 10px; background: #131a22; }
.warn { border: 1px solid #6b5a2c; background: #241f10; color: #e8d48b; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.audit-table th, .audit-table td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line);
  word-break: break-word; }
.audit-scroll { max-height: 300px; overflow: auto; }

/* ---- Military-Modul ----------------------------------------------------- */
.mil-wrap { width: 100%; min-width: 0; max-width: none; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.mil-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mil-tabs { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.mil-tab { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 6px; }
.mil-tab.active { color: var(--fg); background: #1f2a37; }
.mil-tab:hover { color: var(--fg); }
.mil-controls { display: flex; flex-direction: column; gap: 6px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.mil-controls select, .mil-controls input { background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font: inherit; min-width: 0; }
.mil-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.mil-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; }
.mil-x:hover { color: var(--danger); }
.mil-cols { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.mil-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.mil-kpis-wide { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.mil-kpi { background: #131a22; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px; }
.mil-kpi-v { font-size: 20px; font-weight: 700; }
.mil-kpi-l { font-size: 12px; color: var(--muted); }
.mil-kpi.warn-kpi { border-color: #6b5a2c; }
.chip.warn-chip { color: #e8d48b; border-color: #6b5a2c; }
.mil-info { cursor: help; color: var(--accent); font-style: normal; font-size: 12px; }
.mil-chart-wrap { position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px; min-height: 120px; }
.mil-chart { width: 100%; display: block; }
.mil-chart text { fill: var(--muted); font-size: 10px; font-family: system-ui, sans-serif; }
.mil-grid line { stroke: #223041; stroke-width: 1; }
.mil-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.mil-market-up { stroke: #2fbf71; }
.mil-market-down { stroke: #ef5b5b; }
.mil-market-flat { stroke: #7f8b99; }
.mil-line.mil-market-outline { stroke-width: 9; stroke-linecap: butt; stroke-linejoin: round; }
.mil-line.mil-market-separator { stroke: #0b1118; stroke-width: 6; stroke-linecap: butt; stroke-linejoin: round; }
.mil-line.mil-market-trend { stroke-width: 3; stroke-linecap: butt; stroke-linejoin: round; }
.mil-scope-delta { margin-left: 4px; font-size: 11px; }
.mil-scope-delta.up { color: #2fbf71; }
.mil-scope-delta.down { color: #ef5b5b; }
.mil-scope-delta.flat { color: #7f8b99; }
.mil-series-focus [data-series] { opacity: .12; }
.mil-series-focus [data-series].mil-series-focused { opacity: 1; filter: drop-shadow(0 0 3px currentColor); }
.mil-market-end { stroke: var(--trend-color, #7f8b99); stroke-width: 3; filter: drop-shadow(0 0 4px #05080c); }
.mil-market-key { display: inline-flex; align-items: center; color: var(--muted); }
.mil-market-key .mil-key-line { margin-left: 0; }
.mil-market-key .mil-market-up { border-color: #2fbf71; }
.mil-market-key .mil-market-down { border-color: #ef5b5b; }
.mil-market-key .mil-market-flat { border-color: #7f8b99; }
.mil-cross { stroke: #3a4a5c; stroke-width: 1; }
.mil-now { stroke: #8e8571; stroke-width: 1; stroke-dasharray: 3 4; }
.mil-chart .mil-now-label { fill: #aaa18d; font-size: 11px; }
.mil-weekly-marker line { stroke: #d5a642; stroke-width: 1.5; stroke-dasharray: 5 5; opacity: .9; }
.mil-chart .mil-weekly-marker text { fill: #d5a642; font-size: 10px; font-weight: 700; }
.mil-bar { cursor: pointer; }
.mil-bar:hover rect { filter: brightness(1.2); }
.mil-tip { position: absolute; background: rgba(15,20,26,.95); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; pointer-events: none; max-width: 260px; z-index: 5; }
.mil-tip i, .mil-legend-item i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.mil-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.mil-legend-item { display: inline-flex; align-items: center; }
.mil-leg-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; padding: 3px 4px; }
.mil-leg-btn.off { opacity: .35; text-decoration: line-through; }
.mil-subctl .btn-ghost.active { color: var(--fg); background: #1f2a37; border-color: var(--accent); }
.mil-mini { padding: 2px 8px; font-size: 12px; min-height: 26px; }
.mil-h3 { margin: 12px 0 6px; font-size: 14px; }
.mil-search { background: var(--bg); color: var(--fg); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 9px; font: inherit; width: 100%; max-width: 320px; margin-bottom: 6px; }
.mil-table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.mil-table-wrap th { position: sticky; top: 0; background: var(--panel); cursor: pointer; }
.mil-timeline { display: flex; gap: 2px; align-items: flex-end; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow-x: auto; }
.mil-tl-col { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 22px; }
.mil-tl-bars { display: flex; gap: 2px; align-items: flex-end; height: 72px; }
.mil-tl-bar { width: 7px; border-radius: 2px 2px 0 0; min-height: 1px; }
.mil-tl-h { font-size: 10px; color: var(--muted); }
.mil-details summary { cursor: pointer; color: var(--accent); padding: 6px 0; }
.btn-danger-ghost { border-color: #4a2c2c; color: var(--danger); }
.mil-scope-card h2 { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
/* Durchsuchbarer Scope-Picker (Nationen/Allianzen/MUs/Gruppen) */
.mil-combo { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.mil-combo-in { width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 30px 8px 34px; font: inherit; min-height: 40px; }
.mil-combo-icon { position: absolute; left: 11px; top: 9px; z-index: 1; color: var(--muted); font-size: 18px; pointer-events: none; }
.mil-combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  max-height: min(320px, 50vh); overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.mil-combo-list button { display: grid; grid-template-columns: 92px minmax(120px, 1fr) auto; width: 100%; gap: 9px; align-items: center; background: none;
  border: 0; border-bottom: 1px solid var(--line); color: var(--fg); padding: 9px 10px; cursor: pointer;
  text-align: left; font: inherit; min-height: 44px; }
.mil-combo-list button:hover, .mil-combo-list button.active { background: #1f2a37; }
.mil-combo-list .chip { margin-left: auto; flex: none; }
.mil-result-type { color: var(--accent); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.mil-result-main { display: flex; min-width: 0; flex-direction: column; }
.mil-result-main strong, .mil-result-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mil-result-main small { color: var(--muted); font-size: 10px; font-weight: 400; }
.mil-result-selected { color: #72d6a9; font-size: 10px; white-space: nowrap; }
.chip.mil-status { font-size: 11px; padding: 2px 8px; }
.mil-dashed { stroke-dasharray: 5 3; }
.mil-legend { row-gap: 6px; }
.mil-cycle-panel { background: #191a18; border: 1px solid #3b3a31; border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px; }
.mil-cycle-picks { display: flex; flex-wrap: wrap; gap: 7px; }
.mil-cycle-pick { border: 1px solid #3b3a31; border-radius: 999px; padding: 6px 12px; background: #22221f;
  color: #aaa18d; cursor: pointer; font: inherit; font-size: 12px; }
.mil-cycle-pick:hover { color: var(--fg); border-color: #5c5a4b; }
.mil-cycle-pick.active { color: #fff; background: var(--scope-color, #3987e5); border-color: var(--scope-color, #3987e5); font-weight: 700; }
.mil-cycle-head { border-bottom: 1px solid #3b3a31; padding-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.mil-cycle-head h3 { margin: 0; flex: 1; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.mil-cycle-chart { background: #191a18; border-color: transparent; padding: 2px; }
.mil-cycle-note { color: #aaa18d; }
.mil-key-line { width: 20px; height: 0; border-top: 3px solid; display: inline-block; margin-right: 5px; }
.mil-key-line.dashed { border-top-style: dashed; margin-left: 9px; }
.mil-plan-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.mil-plan-card { border-top: 3px solid var(--accent); padding: 11px; }
.mil-plan-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mil-plan-card-head span { color: var(--muted); font-size: 11px; text-align: right; }
.mil-plan-card-meta { display: flex; flex-wrap: wrap; gap: 5px 13px; margin: 7px 0; color: var(--muted); font-size: 12px; }
.mil-build-strip { height: 7px; display: flex; overflow: hidden; margin-top: 8px; border-radius: 999px; background: #27313d; }
.mil-build-strip i { display: block; height: 100%; min-width: 0; }
.mil-scan-coverage { position: relative; height: 18px; overflow: hidden; margin: 7px 0; border: 1px solid var(--line); border-radius: 5px; background: #111820; }
.mil-scan-coverage i { position: absolute; inset: 0 auto 0 0; background: rgba(57,135,229,.2); }
.mil-scan-coverage span { position: relative; z-index: 1; display: block; padding: 1px 6px; color: var(--muted); font-size: 10px; text-align: center; }
.mil-plan-history { padding: 10px; }
.mil-plan-history .mil-h3 { margin: 0; }
.mil-plan-per.active { color: var(--fg); border-color: var(--accent); background: #1f2a37; }
.mil-plan-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.mil-plan-table { width: 100%; min-width: 580px; border-collapse: collapse; font-size: 12px; }
.mil-plan-table th, .mil-plan-table td { border-bottom: 1px solid var(--line); padding: 7px 9px; }
.mil-plan-table thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); text-align: right; border-top: 3px solid transparent; }
.mil-plan-table thead th:first-child { left: 0; z-index: 3; text-align: left; }
.mil-plan-table thead small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.mil-plan-section th { background: #1c2632; color: var(--muted); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; text-align: left; }
.mil-plan-metric { position: sticky; left: 0; z-index: 1; min-width: 145px; background: var(--panel); color: var(--muted); }
.mil-plan-value { position: relative; min-width: 118px; text-align: right; overflow: hidden; }
.mil-plan-value span { position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.mil-plan-value i { position: absolute; inset: 3px auto 3px 0; max-width: 100%; border-radius: 3px; background: rgba(57,135,229,.1); }
.mil-plan-value.leader { color: #72d6a9; font-weight: 700; }
.mil-plan-value.leader i { background: rgba(25,158,112,.16); }
@media (max-width: 640px) {
  .mil-combo { max-width: none; }
  .mil-combo-list button { grid-template-columns: 70px minmax(100px, 1fr) auto; }
  .mil-tip { max-width: min(240px, 86vw); }
  .mil-cycle-panel { padding: 9px; }
  .mil-cycle-head { align-items: flex-start; }
  .mil-cycle-head h3 { font-size: 11px; }
  .mil-cycle-chart { overflow-x: auto; }
  .mil-plan-summary { grid-template-columns: 1fr; }
  .mil-plan-card-head { align-items: flex-start; }
}
@media (max-width: 640px) {
  .mil-kpis { grid-template-columns: repeat(2, 1fr); }
  .mil-controls .mil-row { gap: 6px; }
}

/* Modal (echte Dialoge statt prompt()) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid;
  place-items: center; padding: 14px; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.modal h2 { margin: 0 0 10px; font-size: 16px; }
.modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }

/* ---- Operations — Scheduler-Timeline + Attack Priorities (additiv) ---- */
.ops-page { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.ops-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ops-head h1 { margin: 0; }
.ops-head p { margin: 3px 0 0; }
.ops-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ops-head-actions button, .ops-filters select, .ops-filters .ops-range button {
  background: #1b2531; color: var(--fg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; cursor: pointer; }
#ops-new { border-color: var(--accent); background: #203149; font-weight: 600; }
.ops-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.ops-range { display: flex; gap: 4px; }
.ops-range button.active { border-color: var(--accent); background: #203149; color: var(--fg); }
.ops-mine { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.ops-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.ops-content { min-width: 0; }

/* Timeline (Gantt) */
.ops-timeline-scroll { overflow: auto; max-height: 620px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.ops-timeline { position: relative; min-width: 1100px; min-height: 230px; }
.ops-drop-hint { display: none; position: sticky; left: 16px; top: 44px; z-index: 8; width: max-content;
  background: #173552; color: #dceeff; border: 1px dashed var(--accent); border-radius: 8px; padding: 8px 12px; }
.ops-timeline.drag-over { outline: 2px dashed var(--accent); outline-offset: -5px; }
.ops-timeline.drag-over .ops-drop-hint { display: block; }
.ops-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid #1d2733; pointer-events: none; }
.ops-tick.day { border-left-color: #33445a; }
.ops-tick span { position: absolute; top: 6px; left: 4px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.ops-tick.day span { color: var(--fg); font-weight: 700; }
.ops-now { position: absolute; top: 0; bottom: 0; border-left: 2px solid #ff5666; z-index: 3; pointer-events: none;
  box-shadow: 0 0 8px rgba(255, 86, 102, .8); }
.ops-now span { position: absolute; top: 18px; left: 3px; font-size: 9px; font-weight: 800; color: #ff5666; letter-spacing: .08em; }
.ops-prio-marker { position: absolute; top: 0; bottom: 0; border-left: 2px dashed #f6a90a; z-index: 2; pointer-events: auto; }
.ops-prio-marker span { position: absolute; top: 2px; left: 1px; font-size: 11px; color: #f6a90a; }
.ops-bar { position: absolute; height: 38px; min-width: 24px; border: none; border-radius: 7px; cursor: pointer;
  background: color-mix(in srgb, var(--bar) 28%, #10151c); border-left: 4px solid var(--bar);
  color: var(--fg); text-align: left; padding: 3px 8px; overflow: hidden; z-index: 1; }
.ops-bar:hover, .ops-bar:focus-visible { outline: 2px solid var(--bar); z-index: 4; }
.ops-bar b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-bar small { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-bar.status-cancelled { opacity: .45; text-decoration: line-through; }
.ops-bar.status-draft { border-left-style: dashed; opacity: .8; }
.ops-bar.estimated { border-right: 2px dashed var(--bar); }
.ops-empty-inline { position: absolute; inset: 34px 0 0; display: grid; place-items: center; }

/* Live-Kontext */
.ops-battles { margin-top: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 13px; }
.ops-battles h3 { margin: 0 0 9px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.ops-battles a { color: var(--accent); }
.ops-drag { cursor: grab; font-size: 17px; color: var(--muted); user-select: none; }
.ops-battles tr[draggable="true"]:active .ops-drag { cursor: grabbing; }
.ops-add-battle { white-space: nowrap; }

/* Attack-Priorities-Seitenleiste */
.ops-sidebar { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 13px; }
.ops-sidebar-head { display: flex; align-items: center; justify-content: space-between; }
.ops-sidebar-head h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.ops-drawer-close { display: none; }
.ops-prio { border: 1px solid var(--line); border-radius: 9px; padding: 9px; margin-bottom: 9px; font-size: 13px; }
.ops-prio.relevant { border-color: #6d5726; background: #201b10; }
.ops-prio-head { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.ops-prio-star { color: #ffd166; }
.ops-prio-meta { display: grid; gap: 2px; margin: 6px 0; color: var(--muted); font-size: 12px; }
.ops-prio-meta abbr { text-decoration: none; cursor: help; color: var(--accent); }
.ops-prio-bar { height: 7px; border-radius: 4px; background: #28313c; overflow: hidden; margin-bottom: 6px; }
.ops-prio-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f6a90a, #d8564f); }
.ops-prio-warn { color: #f6a90a; font-size: 12px; margin: 6px 0; }
.ops-prio a { color: var(--accent); font-size: 12px; }

/* Detail/Formular-Dialog */
#ops-dialog { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; width: min(560px, 94vw); max-height: 90vh; }
#ops-dialog::backdrop { background: rgba(4, 8, 12, .7); }
.ops-form, .ops-detail { display: grid; gap: 10px; }
.ops-form h3, .ops-detail h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.ops-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.ops-form input, .ops-form select, .ops-form textarea {
  background: #1b2531; color: var(--fg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; font: inherit; }
.ops-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ops-color-row { display: flex !important; align-items: center; gap: 8px; }
.ops-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ops-form-actions button[type=submit], .ops-form-actions button[data-edit] {
  background: #203149; color: var(--fg); border: 1px solid var(--accent); border-radius: 7px; padding: 7px 14px; cursor: pointer; }
.ops-delete { border-color: var(--danger) !important; color: var(--danger) !important; }
.ops-form-error { color: #ff7b86; border: 1px solid #6a2a2a; background: #2a1414; border-radius: 7px; padding: 7px 9px; }
.ops-detail dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; }
.ops-detail dt { color: var(--muted); font-size: 12px; }
.ops-detail dd { margin: 0; }
.ops-notes { white-space: pre-wrap; }
.ops-ref-missing { color: #f6a90a; }
.ops-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.small { font-size: 12px; }

/* Settings */
.settings-page { flex: 1; overflow: auto; padding: 18px; display: grid; gap: 14px; align-content: start; }
.settings-page header h1, .settings-card h2 { margin: 0; }
.settings-page header p, .settings-card p { margin: 4px 0 12px; }
.settings-card { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 16px; }
.settings-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.settings-discord-profile { display: flex; align-items: center; gap: 14px; }
.settings-discord-profile img, .settings-avatar-fallback { width: 64px; height: 64px; border-radius: 50%; border: 2px solid #33445a; }
.settings-avatar-fallback { display: grid; place-items: center; background: #203149; font-size: 26px; font-weight: 700; }
.settings-card select, .settings-profile-form input, .settings-profile-form select { background: #1b2531; color: var(--fg); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; }
.settings-profiles { display: grid; gap: 8px; }
.settings-profile { border: 1px solid var(--line); border-left: 4px solid var(--profile); border-radius: 9px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-profile.active { background: #162331; }
.settings-profile small { display: block; color: var(--muted); }
.settings-profile-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#settings-dialog { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 18px; width: min(520px, 94vw); }
#settings-dialog::backdrop { background: rgba(4,8,12,.7); }
.settings-profile-form { display: grid; gap: 12px; }
.settings-profile-form h3 { margin: 0; }
.settings-profile-form label { display: grid; gap: 4px; color: var(--muted); }

/* Tablet/Mobil: Seitenleiste als Overlay-Drawer, Timeline behält volle Breite */
@media (max-width: 1100px) {
  .ops-main { grid-template-columns: 1fr; }
  .ops-sidebar { position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 92vw); z-index: 50;
    border-radius: 0; overflow-y: auto; transform: translateX(100%); transition: transform .2s ease;
    box-shadow: -12px 0 32px rgba(0, 0, 0, .55); }
  .ops-sidebar.open { transform: none; }
  .ops-drawer-close { display: inline-block; }
}
@media (max-width: 600px) {
  .ops-form-row { grid-template-columns: 1fr; }
  .ops-timeline { min-width: 720px; }
  .settings-profile { align-items: flex-start; flex-direction: column; }
}
