/* ==========================================================================
   Carte Galactique — thème (palette reprise de l'addon GMod Galactic Warfare V2)
   ========================================================================== */
:root {
  --bg:            #030812;
  --bg-dim:        #050d18;
  --panel:         rgba(7, 17, 31, 0.96);
  --panel-solid:   #07111f;
  --panel-alt:     #0a1626;
  --panel-alt2:    #102034;
  --border:        #1e5b85;
  --border-dim:    #143c5f;
  --border-strong: #2a83b8;
  --text:          #eaf6ff;
  --text-strong:   #ffffff;
  --text-dim:      #7f9bb2;
  --text-faint:    #5a6e82;
  --accent:        #6ec8ff;
  --accent-dim:    #2a83b8;
  --gold:          #ffd21f;
  --gold-dim:      #b48c08;
  --success:       #21c76a;
  --danger:        #ff2525;
  --warning:       #ffaa32;
  --fac-republic:   #ff2525;
  --fac-separatist: #149cff;
  --fac-hutt:       #21c76a;
  --fac-neutral:    #7f9bb2;
  --shadow: 0 8px 32px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Roboto Condensed", Tahoma, sans-serif;
  overflow: hidden;
}
body { display: flex; flex-direction: column; }

/* fallback pour le titre : Orbitron si dispo, sinon générique large */
.title-font { font-family: "Orbitron", "Segoe UI", sans-serif; font-weight: 800; letter-spacing: .04em; }

a { color: var(--accent); }
button {
  font-family: inherit; cursor: pointer;
  background: var(--panel-alt); color: var(--text);
  border: 1px solid var(--border-dim); border-radius: 6px;
  padding: 7px 12px; font-size: 14px; transition: .12s;
}
button:hover { background: var(--panel-alt2); border-color: var(--border-strong); }
button.primary { background: var(--accent-dim); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--accent); color: #04121f; }
button.danger { border-color: var(--danger); color: #ffb3b3; }
button.danger:hover { background: var(--danger); color: #fff; }
input, select, textarea {
  font-family: inherit; font-size: 14px;
  background: var(--bg-dim); color: var(--text);
  border: 1px solid var(--border-dim); border-radius: 6px; padding: 7px 9px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
label { display: block; font-size: 12px; color: var(--text-dim); margin: 10px 0 3px; text-transform: uppercase; letter-spacing: .05em; }

/* ---------------------------------------------------------------- topbar -- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; background: var(--panel-solid);
  border-bottom: 1px solid var(--border-dim); z-index: 20; flex: 0 0 auto;
}
.topbar h1 { font-size: 18px; margin: 0; color: var(--text-strong); }
.topbar h1 .sub { color: var(--gold); font-weight: 400; font-size: 13px; margin-left: 8px; letter-spacing: .1em; }
.topbar .spacer { flex: 1; }
.topbar .stat { font-size: 13px; color: var(--text-dim); }
.topbar .stat b { color: var(--accent); }

/* ---------------------------------------------------------------- layout -- */
/* clip (et pas hidden) : les panneaux cachés hors écran (translateX) ne
   doivent jamais faire défiler la scène quand un champ prend le focus */
.stage { position: relative; flex: 1 1 auto; overflow: hidden; overflow: clip; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#map.dragging { cursor: grabbing; }
#map.picking { cursor: crosshair; }
#map.fleet-hover { cursor: move; }          /* MJ, joueur : pion de flotte saisissable */
#map.fleet-drag { cursor: grabbing; }

/* message bref en bas de la carte (glisser-déposer des flottes, MJ) */
.map-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 8px); z-index: 60;
  background: var(--panel-solid); border: 1px solid var(--accent); border-radius: 18px;
  padding: 7px 16px; box-shadow: var(--shadow); font-size: 13px; color: var(--text);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.map-toast.show { opacity: 1; transform: translate(-50%, 0); }
.map-toast.err { border-color: var(--danger); color: var(--danger); }

/* ------------------------------------------------ espace joueur (V.2) -- */
.topbar .pl-btn.on { border-color: var(--accent); color: var(--text-strong); background: color-mix(in srgb, var(--accent) 16%, var(--panel-alt)); }
.pl-panel {
  position: absolute; top: 12px; left: 12px; bottom: 12px; z-index: 18; width: min(380px, calc(100% - 24px));
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); transform: translateX(calc(-100% - 24px)); transition: transform .22s ease; visibility: hidden;
}
.pl-panel.open { transform: none; visibility: visible; }
.pl-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 14px; border-bottom: 1px solid var(--border-dim); }
.pl-ava {
  width: 36px; height: 36px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  font-weight: 800; color: var(--accent); border: 2px solid var(--accent); background: rgba(3, 12, 22, .5);
}
.pl-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-who b { color: var(--text-strong); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-who small { color: var(--text-dim); font-size: 12px; }
.pl-head .pl-ico { width: 32px; height: 32px; padding: 0; border-radius: 50%; }
.pl-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 16px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.pl-sec { margin: 16px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.pl-empty { color: var(--text-faint); font-size: 13px; font-style: italic; }
.pl-card {
  --cc: var(--accent);
  margin-bottom: 8px; padding: 10px 11px; border-radius: 12px; background: var(--bg-dim);
  border: 1px solid var(--border-dim); border-left: 3px solid var(--cc);
}
.pl-card-top { display: flex; gap: 10px; align-items: center; }
.pl-por { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; border: 2px solid var(--cc); background: var(--panel-alt); }
.pl-ph { display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--cc); }
.pl-card-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pl-card-t b { color: var(--text-strong); font-size: 14.5px; }
.pl-card-t small { color: var(--text-dim); font-size: 12px; }
.pl-where { margin-top: 3px; font-size: 12.5px; color: var(--text); }
.pl-warn { margin-top: 3px; font-size: 12px; color: #ffb8b8; }
.pl-acts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.pl-acts button { padding: 4px 10px; font-size: 12.5px; border-radius: 14px; }
.pl-acts select { flex: 1 1 100%; padding: 4px 8px; font-size: 12.5px; }
.pl-perms { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.pl-perms .on { color: #9ff0c0; }
.pl-perms .off { color: var(--text-faint); }
/* fenêtres de l'espace joueur */
.pl-dlg-ov { position: absolute; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2, 6, 12, .55); }
.pl-dlg {
  width: min(460px, 100%); max-height: 100%; display: flex; flex-direction: column;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.pl-dlg.pl-build { width: min(620px, 100%); }
.pl-dlg-h { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--border-dim); }
.pl-dlg-h h3 { flex: 1; margin: 0; font-size: 14px; letter-spacing: .06em; color: var(--text-strong); }
.pl-dlg-h .pl-x { width: 32px; height: 32px; padding: 0; border-radius: 50%; }
.pl-dlg-b { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.pl-dlg-b > label { margin: 4px 0 -4px; }
.pl-dlg-b textarea { resize: vertical; }
.pl-login { display: flex; flex-direction: column; gap: 8px; }
.pl-login label { margin: 2px 0 -4px; }
.pl-login .primary { margin-top: 6px; }
.pl-err { min-height: 18px; color: var(--danger); font-size: 13px; }
.pl-plist { display: flex; flex-direction: column; gap: 3px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.pl-plist .pl-pl {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; text-align: left; border-radius: 8px;
  background: transparent; border-color: transparent; box-shadow: none;
}
.pl-plist .pl-pl:hover { background: var(--panel-alt); box-shadow: none; }
.pl-plist .pl-pl.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pl-pl .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.pl-pl .n { flex: 1; color: var(--text-strong); }
.pl-pl .o { font-size: 12px; color: var(--text-dim); }
.pl-prev { min-height: 20px; font-size: 13px; color: var(--gold); }
.pl-creds { font-size: 13px; color: var(--gold); }
.pl-bi { padding: 9px 11px; border-radius: 10px; background: var(--bg-dim); border: 1px solid var(--border-dim); }
.pl-bi.off { opacity: .75; }
.pl-bi-t { display: flex; flex-direction: column; gap: 2px; }
.pl-bi-t b { color: var(--text-strong); }
.pl-bi-t small { font-size: 12px; color: var(--text-dim); }
.pl-why { margin-top: 5px; font-size: 12px; color: #ff9a9a; }
.pl-toast {
  position: absolute; bottom: 26px; left: 50%; transform: translate(-50%, 8px); z-index: 80; max-width: calc(100% - 32px);
  background: var(--panel-solid); border: 1px solid var(--accent); border-radius: 18px;
  padding: 7px 16px; box-shadow: var(--shadow); font-size: 13px; color: var(--text);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.pl-toast.show { opacity: 1; transform: translate(-50%, 0); }
.pl-toast.err { border-color: var(--danger); color: #ffb8b8; }
@media (max-width: 720px) {
  .topbar .pl-btn { padding: 6px 9px; }
  .pl-panel { top: 8px; left: 8px; bottom: 8px; width: calc(100% - 16px); }
}

/* serveur à relancer (fichiers mis à jour depuis son lancement) */
.stale-banner {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  background: var(--panel-solid); border: 1px solid var(--danger); border-radius: 12px;
  padding: 8px 10px 8px 14px; box-shadow: var(--shadow); font-size: 13px; color: var(--text);
}
.stale-banner code { font-size: 12px; }

/* bandeau « clique une planète » pendant la sélection de destination */
.pick-banner {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%); z-index: 55;
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-solid); border: 1px solid var(--accent); border-radius: 22px;
  padding: 8px 10px 8px 16px; box-shadow: var(--shadow); font-size: 13px; color: var(--text);
  animation: pick-pulse 1.6s ease-in-out infinite;
}
@keyframes pick-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(110,200,255,.4); } 50% { box-shadow: 0 0 0 6px rgba(110,200,255,0); } }

/* ------------------------------------------------------------- legend HUD - */
.hud {
  position: absolute; top: 14px; left: 14px; z-index: 10;
  background: var(--panel); border: 1px solid var(--border-dim);
  border-radius: 10px; padding: 12px 14px; min-width: 210px;
  box-shadow: var(--shadow); backdrop-filter: blur(3px);
}
.hud h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 12px; letter-spacing: .12em; color: var(--text-dim); text-transform: uppercase; cursor: pointer; user-select: none; }
.hud h3:hover { color: var(--text); }
.hud .hud-chev { margin-left: auto; font-size: 11px; }
/* V.2 : repli HORIZONTAL. Replié (état de départ), le panneau glisse hors de
   l'écran par la gauche ; seule reste la languette collée au bord. Son contenu
   devient invisible une fois sorti (plus de tabulation dans un panneau caché). */
.hud { transition: transform .28s cubic-bezier(.2, .7, .2, 1); }
.stage .hud.collapsed { transform: translateX(calc(-100% - 14px)); box-shadow: none; }   /* 14px = left du panneau : la languette affleure le bord */
.hud > :not(.hud-tab) { transition: visibility 0s; }
.hud.collapsed > :not(.hud-tab) { visibility: hidden; transition: visibility 0s .28s; }
/* languette : sous l'équerre décorative du coin, n'apparaît que replié */
.hud .hud-tab {
  position: absolute; top: 26px; left: 100%; margin-left: 1px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 28px; padding: 11px 0; border-radius: 0 9px 9px 0;
  background: var(--panel); border: 1px solid var(--border-dim); border-left: none;
  box-shadow: var(--shadow); backdrop-filter: blur(6px); color: var(--text-dim);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.hud.collapsed .hud-tab { opacity: 1; pointer-events: auto; transition: opacity .2s .15s; }
.hud .hud-tab:hover { color: var(--text-strong); border-color: var(--border-strong); background: var(--panel-alt2); }
.hud-tab-ico { font-size: 11px; line-height: 1; }
.hud-tab-lbl { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.legend-row { display: flex; align-items: center; gap: 9px; padding: 4px 0; font-size: 14px; cursor: pointer; }
.legend-row .dot { width: 13px; height: 13px; border-radius: 3px; flex: 0 0 auto; box-shadow: 0 0 8px currentColor; }
.legend-row .nm { flex: 1; }
.legend-row .ct { color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 13px; }
.legend-row.off { opacity: .38; }

.toggles { margin-top: 12px; border-top: 1px solid var(--border-dim); padding-top: 10px; display: grid; gap: 7px; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; user-select: none; }
.toggle input { width: auto; }

/* ------------------------------------------------------------- search box - */
.searchwrap { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 10; width: min(360px, 42vw); }
.searchwrap input { background: var(--panel); border-color: var(--border-dim); box-shadow: var(--shadow); }
.search-results {
  margin-top: 6px; background: var(--panel-solid); border: 1px solid var(--border-dim);
  border-radius: 8px; max-height: 300px; overflow-y: auto; display: none; box-shadow: var(--shadow);
}
.search-results.show { display: block; }
.search-results div { padding: 8px 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--border-dim); }
.search-results div:hover { background: var(--panel-alt); }
.search-results .owner-tag { font-size: 12px; color: var(--text-dim); float: right; }

/* ---------------------------------------------------------- planet dossier */
.dossier {
  position: absolute; top: 0; right: 0; height: 100%; width: 380px; max-width: 92vw; z-index: 15;
  background: var(--panel); border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(0,0,0,.5); transform: translateX(100%);
  transition: transform .22s cubic-bezier(.2,.7,.2,1); display: flex; flex-direction: column;
}
.dossier.open { transform: translateX(0); }
.dossier .hero { position: relative; height: 190px; background: var(--panel-alt); flex: 0 0 auto; overflow: hidden; }
.dossier .hero img { width: 100%; height: 100%; object-fit: cover; opacity: .95; }
.dossier .hero .grad { position: absolute; inset: 0; background: linear-gradient(to top, var(--panel) 4%, transparent 60%); }
.dossier .hero .close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; padding: 0;
  border-radius: 50%; font-size: 18px; line-height: 1; background: rgba(0,0,0,.5);
}
.dossier .body { padding: 4px 18px 48px; overflow-y: auto; flex: 1; }  /* marge basse : dégage le bandeau HoloNews (34px) */
.dossier .pname { font-size: 24px; margin: 6px 0 2px; color: var(--text-strong); }
.dossier .arch { color: var(--gold); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.owner-chip { display: inline-flex; align-items: center; gap: 7px; margin: 12px 0; padding: 5px 11px; border-radius: 20px; background: var(--bg-dim); border: 1px solid var(--border-dim); font-size: 14px; }
.owner-chip .dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 14px; }
.fact { background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 8px; padding: 8px 10px; }
.fact .k { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.fact .v { font-size: 15px; color: var(--text); margin-top: 2px; }
.section-h { font-size: 12px; letter-spacing: .12em; color: var(--text-dim); text-transform: uppercase; margin: 18px 0 8px; border-bottom: 1px solid var(--border-dim); padding-bottom: 5px; }
.desc { line-height: 1.6; font-size: 14.5px; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--panel-alt); border: 1px solid var(--border-dim); border-radius: 6px; padding: 5px 10px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.chip .cd { width: 9px; height: 9px; border-radius: 50%; }
.muted { color: var(--text-faint); font-style: italic; font-size: 13.5px; }

/* ------------------------------------------------------------- tooltip ---- */
#tooltip {
  position: absolute; z-index: 12; pointer-events: none; display: none;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 10px; font-size: 13px; box-shadow: var(--shadow); white-space: nowrap;
}
#tooltip .to { color: var(--text-dim); font-size: 12px; }

/* ------------------------------------------------------------- admin ------ */
.login-overlay {
  position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10,22,38,.7), var(--bg) 70%);
}
.login-card { background: var(--panel-solid); border: 1px solid var(--border); border-radius: 14px; padding: 30px 34px; width: 340px; box-shadow: var(--shadow); text-align: center; }
.login-card h2 { margin: 0 0 6px; color: var(--gold); }
.login-card p { color: var(--text-dim); font-size: 13px; margin: 0 0 18px; }
.login-card .err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 10px; }

.editor { position: absolute; top: 0; right: 0; height: 100%; width: 430px; max-width: 94vw; z-index: 15;
  background: var(--panel); border-left: 1px solid var(--border); box-shadow: -12px 0 40px rgba(0,0,0,.5);
  transform: translateX(100%); transition: transform .2s; display: flex; flex-direction: column; }
.editor.open { transform: translateX(0); }
.editor .ehead { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-dim); }
.editor .ehead h3 { margin: 0; flex: 1; font-size: 16px; }
.editor .ebody { padding: 4px 16px 22px; overflow-y: auto; flex: 1; }
.saved-flash { color: var(--success); font-size: 13px; text-align: center; min-height: 16px; }

.mj-badge { background: var(--gold); color: #1a1400; font-weight: 700; font-size: 11px; padding: 3px 9px; border-radius: 5px; letter-spacing: .05em; }

.hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; line-height: 1.4; }

.cat-search { width: 100%; margin-bottom: 10px; }
.cat-group-h { font-size: 12px; letter-spacing: .1em; color: var(--gold); text-transform: uppercase; margin: 14px 0 6px; }
.cat-card { background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 8px; margin: 6px 0; overflow: hidden; }
.cat-card > .cat-hd { display: flex; align-items: center; gap: 8px; padding: 9px 11px; cursor: pointer; }
.cat-card > .cat-hd:hover { background: var(--panel-alt); }
.cat-card .cat-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 6px currentColor; }
.cat-card .cat-nm { flex: 1; font-weight: 600; font-size: 14px; }
.cat-card .cat-meta { font-size: 11.5px; color: var(--text-dim); }
.cat-ico { font-size: 15px; width: 20px; text-align: center; }
.cat-body { padding: 4px 12px 12px; border-top: 1px solid var(--border-dim); display: none; }
.cat-card.open .cat-body { display: block; }
.cat-actions { display: flex; gap: 8px; margin-top: 10px; }
.cat-actions button { flex: 1; font-size: 13px; }

.slotgrid { display: grid; gap: 6px; margin: 4px 0 6px; }
.slot { display: flex; align-items: center; gap: 8px; background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 7px; padding: 7px 9px; min-height: 40px; }
.slot.empty { border-style: dashed; opacity: .8; }
.slot .s-ico { font-size: 16px; }
.slot .s-nm { flex: 1; font-size: 13.5px; }
.slot .s-nm small { color: var(--text-dim); display: block; font-size: 11px; }
.slot .s-btns { display: flex; gap: 4px; }
.slot .s-btns button { padding: 3px 7px; font-size: 12px; }
.slot-count { font-size: 12px; color: var(--text-dim); float: right; }
.slot-count.full { color: var(--gold); }

.unit-line { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border-dim); }
.unit-line .u-nm { flex: 1; font-size: 13.5px; }
.unit-line .u-nm small { color: var(--text-dim); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 26px; padding: 3px 0; text-align: center; }
.stepper .cnt { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }

.mini-btn { padding: 4px 9px; font-size: 12px; }
.rowflex { display: flex; gap: 8px; align-items: flex-end; }
.rowflex > * { flex: 1; }
.creds { color: var(--gold); font-weight: 700; }

/* modal */
.modal-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 14, .7); backdrop-filter: blur(2px); }
.modal-card { background: var(--panel-solid); border: 1px solid var(--border); border-radius: 14px; width: min(460px, 94vw);
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border-dim); }
.modal-head h3 { margin: 0; flex: 1; font-size: 17px; }
.modal-body { padding: 12px 16px 18px; overflow-y: auto; }
.subtabs { display: flex; gap: 4px; margin-bottom: 10px; }
.subtabs button { flex: 1; border-radius: 6px; opacity: .6; }
.subtabs button.active { opacity: 1; background: var(--panel-alt2); border-color: var(--border); }

/* ------------------------------ fenêtre de flotte (panneau MJ, V.2) ---- */
/* --fc : couleur de la faction de la flotte (posée par fleetModal). */
.modal-card.fleet-ed { width: min(980px, 96vw); height: min(800px, 92vh); max-height: none; overflow: hidden; }
.modal-card.fleet-ed .modal-head { display: none; }
.modal-card.fleet-ed .modal-body { padding: 0; flex: 1; min-height: 0; overflow: hidden; display: flex; }
.fe { --fc: var(--accent); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.fe-head {
  position: relative; display: flex; align-items: center; gap: 18px; padding: 18px 58px 14px 20px; overflow: hidden;
  border-bottom: 1px solid var(--border-dim); border-radius: 14px 14px 0 0;
  background:
    radial-gradient(48% 150% at 10% 100%, color-mix(in srgb, var(--fc) 32%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--fc) 9%, transparent), transparent),
    var(--panel-alt);
}
.fe-head::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(94, 214, 255, .05) 0 1px, transparent 1px 3px);
}
/* maquette sur son socle, comme le pion de la carte */
.fe-art { position: relative; width: 150px; height: 86px; flex: 0 0 auto; display: flex; align-items: flex-end; justify-content: center; }
.fe-art::before {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: 2px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--fc);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--fc) 45%, transparent), color-mix(in srgb, var(--fc) 8%, transparent));
  box-shadow: 0 0 18px color-mix(in srgb, var(--fc) 50%, transparent);
}
.fe-art img {
  position: relative; max-width: 100%; max-height: 78px; margin-bottom: 9px; object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .6)) drop-shadow(0 0 12px color-mix(in srgb, var(--fc) 35%, transparent));
}
.fe-art-ico { position: relative; font-size: 40px; margin-bottom: 12px; }
.fe-id { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.fe-kicker { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--fc); }
input.fe-name {
  width: 100%; margin-left: -8px; padding: 2px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent;
  font-family: "Orbitron", "Segoe UI", sans-serif; font-size: 24px; font-weight: 800; color: var(--text-strong);
  text-shadow: 0 0 20px color-mix(in srgb, var(--fc) 40%, transparent);
}
input.fe-name:hover { border-color: var(--border-dim); }
input.fe-name:focus { border-color: var(--fc); background: rgba(3, 10, 20, .55); }
.fe-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.fe-stat {
  padding: 3px 10px; font-size: 12.5px; border-radius: 12px; font-variant-numeric: tabular-nums;
  background: rgba(3, 12, 22, .55); border: 1px solid var(--border-dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fe-stat.flag { color: var(--gold); border-color: rgba(255, 210, 31, .4); }
.fe-stat.crew { border-color: color-mix(in srgb, var(--fc) 45%, transparent); }
.fe-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 32px; height: 32px; padding: 0; border-radius: 50%; background: rgba(3, 10, 20, .6); }

.fe-tabs { display: flex; gap: 2px; padding: 0 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border-dim); background: var(--panel-solid); flex: 0 0 auto; }
.fe-tabs::-webkit-scrollbar { display: none; }
.fe-tabs button {
  padding: 10px 14px 9px; font-size: 13.5px; white-space: nowrap; color: var(--text-dim);
  background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; box-shadow: none;
}
.fe-tabs button:hover { color: var(--text); background: transparent; box-shadow: none; }
.fe-tabs button.active { color: var(--text-strong); border-bottom-color: var(--fc); }
.fe-main { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 20px 18px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.fe-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border-dim); background: var(--panel-solid); flex: 0 0 auto; border-radius: 0 0 14px 14px; }
.fe-foot .sp { flex: 1; }

/* composition : catalogue par catégorie */
.fe-bar {
  position: sticky; top: -12px; z-index: 2; display: flex; align-items: center; gap: 14px;
  margin: -12px -20px 4px; padding: 10px 20px; background: var(--panel-solid); border-bottom: 1px solid var(--border-dim);
}
.fe-bar input[type="search"] { flex: 1; }
.fe-bar .toggle { margin: 0; white-space: nowrap; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); }
.fe-facs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fe-facs button { --cc: var(--accent); border-color: var(--cc); background: color-mix(in srgb, var(--cc) 12%, transparent); }
.fe-facs button:hover { background: color-mix(in srgb, var(--cc) 24%, transparent); }
.fe-grp-h { display: flex; align-items: center; gap: 10px; margin: 14px 0 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.fe-grp-h::after { content: ""; flex: 1; height: 1px; background: var(--border-dim); }
.fe-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.fe-unit {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px; min-width: 0;
  background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 10px; transition: border-color .15s, background .15s;
}
.fe-unit.on { border-color: color-mix(in srgb, var(--fc) 70%, transparent); background: color-mix(in srgb, var(--fc) 9%, var(--bg-dim)); }
.fe-u-art { width: 64px; height: 40px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.fe-u-art img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5)); }
.fe-u-info { flex: 1; min-width: 0; }
.fe-u-name { font-size: 13.5px; font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-u-meta { font-size: 11.5px; color: var(--text-dim); }
.fe-step { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.fe-step button { width: 28px; height: 28px; padding: 0; font-size: 16px; line-height: 1; }
.fe-step input { width: 52px; padding: 4px 2px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.fe-step input::-webkit-inner-spin-button, .fe-step input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.fe-unit.on .fe-step input { border-color: var(--fc); color: var(--text-strong); }

/* vaisseaux & amiral */
.fe-type-h { display: flex; align-items: center; gap: 10px; margin: 16px 0 7px; }
.fe-type-h img { width: 56px; height: 32px; object-fit: contain; }
.fe-type-h .nm { font-weight: 700; color: var(--text-strong); }
.fe-type-h .cat { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fc); }
.fe-type-h .ct { margin-left: auto; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.fe-ships { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 8px; }
.fe-ship-row { display: flex; align-items: center; gap: 6px; padding: 3px 6px 3px 3px; background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 8px; }
.fe-ship-row.flag { border-color: rgba(255, 210, 31, .55); background: rgba(255, 210, 31, .06); }
.fe-star { width: 30px; height: 30px; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 18px; color: var(--text-faint); }
.fe-star:hover { color: var(--gold); background: transparent; box-shadow: none; }
.fe-ship-row.flag .fe-star { color: var(--gold); text-shadow: 0 0 8px rgba(255, 210, 31, .6); }
.fe-ship-row .no { width: 38px; flex: 0 0 auto; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.fe-ship-row input { flex: 1; min-width: 0; padding: 5px 8px; font-size: 13px; }
.fe-stat.hurt { color: #ffc98a; border-color: rgba(255, 160, 40, .45); }
/* état de chaque vaisseau : carte (nom, jauges coque / bouclier, avaries) */
.fe-type-h .mx { font-size: 12px; color: var(--text-faint); }
.fe-ship {
  display: flex; flex-direction: column; gap: 7px; padding: 4px 9px 8px 3px; min-width: 0;
  background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 10px;
}
.fe-ship.flag { border-color: rgba(255, 210, 31, .55); background: rgba(255, 210, 31, .05); }
.fe-ship.hurt { border-color: rgba(255, 160, 40, .45); }
.fe-ship.down { border-color: rgba(255, 77, 77, .6); background: rgba(255, 77, 77, .05); }
.fe-ship .fe-ship-row { padding: 0; background: none; border: 0; }
.fe-ship-row .fe-fix { width: 30px; height: 30px; flex: 0 0 auto; padding: 0; font-size: 15px; }
.fe-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px 12px; padding-left: 8px; }
.fe-gauge .h { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.fe-gauge .l { min-width: 52px; font-weight: 600; letter-spacing: .04em; }
.fe-gauge input { width: 78px; padding: 3px 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.fe-gauge .mx { color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fe-gauge .bar { height: 4px; margin-top: 4px; border-radius: 2px; background: rgba(94, 214, 255, .1); overflow: hidden; }
.fe-gauge .bar i { display: block; height: 100%; border-radius: 2px; }
.fe-gauge.sh .bar i { background: #5ed6ff; box-shadow: 0 0 6px rgba(94, 214, 255, .6); }
.fe-dmgs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding-left: 8px; }
.fe-dmg {
  display: inline-flex; align-items: center; gap: 2px; padding: 1px 2px 1px 9px; font-size: 12px; border-radius: 11px;
  color: #ffd2a6; background: rgba(255, 150, 40, .1); border: 1px solid rgba(255, 150, 40, .45);
}
.fe-dmg.crit { color: #ffb8b8; background: rgba(255, 77, 77, .12); border-color: rgba(255, 77, 77, .55); }
.fe-dmg button { width: 20px; height: 20px; padding: 0; font-size: 11px; color: inherit; background: transparent; border: 0; box-shadow: none; }
.fe-dmg button:hover { color: #fff; background: rgba(255, 255, 255, .08); box-shadow: none; }
.fe-dmgs .fe-dmg-add { width: auto; max-width: 210px; padding: 3px 8px; font-size: 12px; color: var(--text-dim); }
.fe-dmgbar {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 2px; padding: 7px 10px 7px 12px; border-radius: 10px;
  font-size: 13px; color: #ffd2a6; background: rgba(255, 150, 40, .08); border: 1px solid rgba(255, 150, 40, .35);
}
.fe-dmgbar span { flex: 1; }
.fe-dmgbar.hg { color: #bfe9ff; background: rgba(94, 214, 255, .07); border-color: rgba(94, 214, 255, .35); }
.fe-immo { margin-left: 8px; padding: 3px 9px; font-size: 12px; border-radius: 8px; color: #ffb8b8; background: rgba(255, 77, 77, .1); border: 1px solid rgba(255, 77, 77, .45); }
/* hangar d'un vaisseau (fenêtre de flotte) */
.fe-hangar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-left: 8px; font-size: 12px; }
.fe-hangar .l { color: var(--text-dim); font-weight: 600; }
.fe-hg { display: inline-flex; align-items: center; gap: 5px; margin: 0; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--text); }
.fe-hg input { width: 56px; padding: 2px 5px; font-size: 12px; font-variant-numeric: tabular-nums; }
.fe-hg .mx { color: var(--text-faint); }
.fe-hg.low .nm { color: #ffc98a; }
.fe-acc { display: flex; align-items: center; gap: 6px; padding-left: 8px; }
.fe-acc .l { font-size: 13px; }
.fe-acc .mpick select { font-size: 12px; padding: 2px 6px; }
.fe-acc .mp-chip { font-size: 12px; }
.fe-aboard { padding-left: 8px; font-size: 12px; color: var(--text-dim); }
.fe-char .fe-char-ship { margin-top: 4px; padding: 2px 6px; font-size: 12px; max-width: 100%; }
/* hangar d'un type (fiche d'unité) */
.hg-ed { display: flex; flex-direction: column; gap: 6px; }
.hg-row { display: flex; align-items: center; gap: 8px; }
.hg-row .nm { flex: 1; min-width: 0; color: var(--text-strong); }
.hg-row.gone .nm { color: var(--danger); }
.hg-row input { width: 80px; }
.hg-ed select { width: auto; max-width: 100%; }
/* onglet Joueurs */
.pl-pw { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pl-pw input { flex: 1 1 160px; min-width: 0; }
.pl-st { flex: 1 1 100%; font-size: 12.5px; }
.pl-st.ok { color: #9ff0c0; }
.pl-st.off { color: #ffb8b8; }
.pl-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 8px; }
.pl-assign { display: flex; flex-direction: column; gap: 6px; }
.pl-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pl-add select { flex: 1 1 220px; min-width: 0; width: auto; }

/* équipage : --cc = couleur de la faction du personnage */
.fe-sec-h { margin: 16px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.fe-crew { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.fe-char {
  --cc: var(--accent);
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px;
  background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 10px;
}
.fe-char.pick { cursor: pointer; user-select: none; }
.fe-char.pick:hover { border-color: var(--border); }
.fe-char.pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fe-char.pick.on { border-color: var(--cc); background: color-mix(in srgb, var(--cc) 10%, var(--bg-dim)); }
.fe-av {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; border: 2px solid var(--cc);
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--cc); background: var(--panel-alt);
}
.fe-av.unit { object-fit: contain; padding: 4px; }   /* rendu d'un héros, entier */
.fe-char .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fe-char .t b { font-size: 13.5px; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-char .t small { font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-char .bx { display: flex; gap: 4px; flex: 0 0 auto; }
.fe-check {
  width: 20px; height: 20px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: 5px; font-size: 13px; font-weight: 800; color: transparent;
}
.fe-char.on .fe-check { background: var(--cc); border-color: var(--cc); color: #04121f; }
.fe-crew-q { margin-bottom: 8px; }
.fe-crew-bar { position: sticky; bottom: -18px; display: flex; margin: 10px -20px -18px; padding: 10px 20px; background: var(--panel-solid); border-top: 1px solid var(--border-dim); }
.fe-crew-bar button { flex: 1; }

/* paramètres */
.fe-params { max-width: 560px; }

@media (max-width: 720px) {
  .modal-card.fleet-ed { width: 100vw; height: 100%; border-radius: 0; }
  .fe-head { padding: 14px 50px 12px 14px; gap: 12px; border-radius: 0; }
  .fe-art { width: 96px; height: 60px; }
  .fe-art img { max-height: 52px; }
  input.fe-name { font-size: 19px; }
  .fe-main { padding: 12px 14px 16px; }
  .fe-bar { margin: -12px -14px 4px; padding: 10px 14px; }
  .fe-crew-bar { margin: 10px -14px -16px; padding: 10px 14px; }
  .fe-foot { border-radius: 0; }
}

/* ------------------------- conquête en cours (dossier public) ---------- */
.siege { margin: 2px 0 12px; border: 1px solid var(--border-dim); border-radius: 8px; padding: 8px 11px; background: var(--bg-dim); }
.siege .s-lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--warning); letter-spacing: .06em; text-transform: uppercase; }
.siege .s-lbl .pct { color: var(--text-strong); font-weight: 700; font-variant-numeric: tabular-nums; }
.siege .bar { height: 8px; border-radius: 4px; background: var(--panel-alt2); margin-top: 7px; overflow: hidden; }
.siege .bar > div { height: 100%; border-radius: 4px; transition: width .3s; box-shadow: 0 0 8px currentColor; }
/* contrôle du sol (carte planétaire) */
.ground { margin: 2px 0 12px; border: 1px solid var(--border-dim); border-radius: 8px; padding: 8px 11px; background: var(--bg-dim); }
.ground .g-lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.ground .g-lbl .pct { color: var(--text-strong); font-weight: 700; font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0; }
.ground .g-bar { display: flex; height: 8px; border-radius: 4px; background: var(--panel-alt2); margin-top: 7px; overflow: hidden; }
.ground .g-bar > div { height: 100%; transition: width .3s; }
.ground .g-rows { margin-top: 7px; display: grid; gap: 3px; }
.ground .g-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.ground .g-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ground .g-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ground .g-row .v { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.ground .g-note { margin-top: 6px; font-size: 11px; color: var(--text-dim); }

/* ------------- flottes du dossier public : un clic ouvre la fiche (.fp-*) -- */
.fleet-card { background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 8px; margin: 3px 0; overflow: hidden; width: 100%; }
.fleet-card:hover { border-color: var(--border); }
.fleet-head {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 11px; text-align: left;
  background: transparent; border: 0; border-radius: 0; color: var(--text); user-select: none;
}
.fleet-head:hover { background: var(--panel-alt); }
.fleet-head .cd { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 6px currentColor; }
.fleet-head .f-nm { flex: 1; font-size: 14px; font-weight: 600; }
.fleet-head .f-nm small { display: block; font-weight: 400; font-size: 11.5px; color: var(--gold); margin-top: 1px; }
.fleet-head .f-chev { color: var(--text-dim); font-size: 18px; line-height: 1; transition: transform .15s, color .15s; }
.fleet-head:hover .f-chev { color: var(--accent); transform: translateX(2px); }
/* vaisseaux en image (rendus d'unités sur fond transparent) */
.fleet-head .f-ship { width: 64px; height: 36px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 2px 6px rgba(110,200,255,.25)); }

/* ---------------------------------------------- fiche de flotte (V.2) ---- */
/* --fc : couleur de la faction de la flotte (posée par fleet-page.js).
   Empilement : au-dessus des archives (50), sous la carte planétaire (58). */
.fp-overlay {
  position: fixed; inset: 0; z-index: 56; display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 12, 0.66); animation: fp-fade .18s ease-out;
}
.fp-sheet {
  --fc: var(--accent);
  position: relative; width: min(980px, 94vw); max-height: min(820px, 92vh);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow), 0 0 40px color-mix(in srgb, var(--fc) 18%, transparent);
  animation: fp-rise .22s cubic-bezier(.2,.7,.2,1);
}
.fp-close {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 34px; height: 34px; padding: 0;
  border-radius: 50%; background: rgba(3, 10, 20, .6); font-size: 15px;
}
.fp-body { overflow-y: auto; min-height: 0; padding-bottom: 26px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
@keyframes fp-fade { from { opacity: 0; } }
@keyframes fp-rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }

/* bandeau : identité à gauche, maquette du vaisseau sur son socle à droite */
.fp-hero {
  position: relative; display: flex; align-items: stretch; gap: 18px; min-height: 230px;
  padding: 28px 30px 22px; overflow: hidden; border-bottom: 1px solid var(--border-dim);
  background:
    radial-gradient(55% 95% at 76% 78%, color-mix(in srgb, var(--fc) 34%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--fc) 10%, transparent), transparent 70%),
    var(--panel-alt);
}
/* quadrillage de la table holo + lignes de balayage */
.fp-hero::before, .fp-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.fp-hero::before {
  background:
    repeating-linear-gradient(90deg, rgba(94, 214, 255, .07) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, rgba(94, 214, 255, .07) 0 1px, transparent 1px 34px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%);
          mask-image: linear-gradient(90deg, transparent, #000 45%);
}
.fp-hero::after { background: repeating-linear-gradient(180deg, rgba(94, 214, 255, .05) 0 1px, transparent 1px 3px); }
.fp-id { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.fp-kicker {
  display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--fc);
}
.fp-faclogo { width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--fc) 60%, transparent)); }
.fp-name {
  display: flex; align-items: center; gap: 12px; margin: 0; font-size: 30px; line-height: 1.15;
  color: var(--text-strong); text-shadow: 0 0 24px color-mix(in srgb, var(--fc) 45%, transparent); overflow-wrap: anywhere;
}
.fp-emblem {
  width: 46px; height: 46px; flex: 0 0 auto; object-fit: cover; border-radius: 50%;
  border: 2px solid var(--fc); box-shadow: 0 0 14px color-mix(in srgb, var(--fc) 55%, transparent); background: var(--bg-dim);
}
.fp-locrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fp-loc {
  display: flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 6px 13px 6px 11px; border: 1px solid var(--border-dim); border-radius: 18px;
  background: rgba(3, 12, 22, .55); font-size: 13px;
}
.fp-loc .dot { flex: 0 0 auto; }
.fp-loc .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fc); box-shadow: 0 0 8px var(--fc); }
.fp-loc.jump { border-color: color-mix(in srgb, var(--fc) 55%, transparent); }
.fp-loc.jump .dot { animation: fp-blink 1.2s ease-in-out infinite; }
.fp-loc-t { font-variant-numeric: tabular-nums; }
.fp-go { padding: 5px 12px; font-size: 12.5px; border-radius: 16px; }
@keyframes fp-blink { 50% { opacity: .25; } }
.fp-flag { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 13.5px; }
.fp-flag .star { color: var(--gold); text-shadow: 0 0 8px rgba(255, 210, 31, .6); }
.fp-flag .k { color: var(--text-dim); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.fp-flag .v { color: var(--gold); font-weight: 600; }

/* maquette : même socle cerclé de la couleur de faction que le pion de la carte */
.fp-model { position: relative; z-index: 1; flex: 0 0 42%; display: flex; align-items: flex-end; justify-content: center; min-height: 180px; }
.fp-pedestal {
  position: absolute; left: 50%; bottom: 6px; width: 72%; height: 42px; transform: translateX(-50%);
  border-radius: 50%; border: 2px solid var(--fc);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--fc) 50%, transparent), color-mix(in srgb, var(--fc) 12%, transparent));
  box-shadow: 0 0 28px color-mix(in srgb, var(--fc) 55%, transparent), inset 0 0 18px color-mix(in srgb, var(--fc) 40%, transparent);
}
.fp-ship {
  position: relative; max-width: 100%; max-height: 170px; margin-bottom: 20px; object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .65)) drop-shadow(0 0 18px color-mix(in srgb, var(--fc) 40%, transparent));
  animation: fp-float 6s ease-in-out infinite;
}
.fp-ship.fp-logo { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; border: 2px solid var(--fc); }
/* sans image : silhouette « plan holographique » aux couleurs de la faction */
.fp-sil { width: 62%; }
.fp-sil svg, .u-sil svg {
  display: block; width: 100%; height: auto;
  fill: color-mix(in srgb, var(--fc) 22%, transparent); stroke: var(--fc); stroke-width: .8; stroke-linejoin: round;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--fc) 70%, transparent));
}
@keyframes fp-float { 50% { transform: translateY(-5px); } }

/* onglets : les autres forces au même endroit */
.fp-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 14px 30px 0; }
.fp-tabs-l { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-right: 4px; }
.fp-tab {
  display: flex; align-items: center; gap: 7px; padding: 5px 12px 5px 9px; font-size: 12.5px;
  border-radius: 16px; background: transparent; color: var(--text-dim); border-color: var(--border-dim);
}
.fp-tab .dot { width: 8px; height: 8px; border-radius: 50%; }
.fp-tab .n { font-size: 10.5px; font-weight: 700; color: var(--text-faint); }
.fp-tab.active { color: var(--text-strong); border-color: var(--fc); background: color-mix(in srgb, var(--fc) 14%, transparent); }

/* chiffres clés */
.fp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; padding: 16px 30px 0; }
.fp-stat {
  position: relative; padding: 11px 14px 10px; overflow: hidden;
  background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 10px;
}
.fp-stat::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--fc); border-radius: 2px; }
.fp-stat .v { font-family: "Orbitron", "Segoe UI", sans-serif; font-size: 23px; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.fp-stat .k { margin-top: 2px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.fp-stat .s { font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }

/* composition : une carte par classe d'unité */
.fp-sec { padding: 0 30px; }
.fp-sec-h {
  margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border-dim);
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim);
}
.fp-empty { color: var(--text-faint); font-style: italic; padding: 8px 0; }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; }
.fp-unit {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 12px; transition: border-color .15s, transform .15s;
}
.fp-unit:hover { border-color: var(--border); transform: translateY(-2px); }
.fp-unit .u-art {
  position: relative; height: 118px; display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border-dim);
  background:
    radial-gradient(70% 80% at 50% 70%, color-mix(in srgb, var(--fc) 20%, transparent), transparent 75%),
    repeating-linear-gradient(90deg, rgba(94, 214, 255, .05) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, rgba(94, 214, 255, .05) 0 1px, transparent 1px 22px);
}
.fp-unit .u-img { max-width: 86%; max-height: 96px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .55)); }
.fp-unit .u-sil { width: 58%; }
.fp-unit .u-ico { font-size: 46px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.fp-unit .u-count {
  position: absolute; top: 8px; right: 10px; font-size: 19px; font-weight: 800; color: var(--text-strong);
  text-shadow: 0 0 12px color-mix(in srgb, var(--fc) 70%, transparent), 0 1px 2px rgba(0, 0, 0, .8);
}
.fp-unit .u-flag {
  position: absolute; top: 9px; left: 10px; padding: 1px 8px; font-size: 11px; font-weight: 700;
  color: #1a1300; background: var(--gold); border-radius: 10px;
}
.fp-unit .u-body { padding: 10px 12px 12px; }
.fp-unit .u-name { font-size: 15px; font-weight: 700; color: var(--text-strong); }
.fp-unit .u-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: 12px; color: var(--text-dim); }
.fp-unit .u-share { height: 4px; margin-top: 10px; border-radius: 2px; background: rgba(94, 214, 255, .1); overflow: hidden; }
.fp-unit .u-share > div { height: 100%; border-radius: 2px; background: var(--fc); box-shadow: 0 0 8px var(--fc); }
.fp-unit .u-share-l { margin-top: 4px; font-size: 11px; color: var(--text-faint); }
.fp-unit .u-names { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.fp-unit .u-names span {
  padding: 2px 8px; font-size: 11.5px; border-radius: 10px;
  background: rgba(94, 214, 255, .08); border: 1px solid var(--border-dim); color: var(--text);
}
.fp-unit .u-names span.is-flag { color: var(--gold); border-color: rgba(255, 210, 31, .45); background: rgba(255, 210, 31, .08); }

.fp-unit .u-cat { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--fc); margin-bottom: 1px; }
.fp-unit .u-hurt { color: #ffc98a; }
/* un vaisseau par carte : numéro, nom de baptême, jauges, avaries */
.fp-unit.hurt { border-color: rgba(255, 160, 40, .4); }
.fp-unit.down { border-color: rgba(255, 77, 77, .55); }
.fp-unit.flag { border-color: rgba(255, 210, 31, .55); }
.fp-unit .u-no {
  position: absolute; top: 9px; right: 11px; font-size: 13px; font-weight: 800; letter-spacing: .06em; color: var(--text-dim);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}
.fp-unit .u-type { margin-top: 1px; font-size: 12px; color: var(--text-dim); }
.fp-unit .u-down {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 2px 10px; white-space: nowrap;
  font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #fff;
  background: rgba(200, 30, 30, .88); border-radius: 10px; box-shadow: 0 0 12px rgba(255, 60, 60, .5);
}
.fp-unit.down .u-img { filter: grayscale(.85) brightness(.55) drop-shadow(0 6px 8px rgba(0, 0, 0, .55)); }
.fp-gauge { margin-top: 9px; }
.fp-gauge .h { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-dim); }
.fp-gauge .h b { color: var(--text-strong); font-weight: 700; font-variant-numeric: tabular-nums; }
.fp-gauge .bar { height: 5px; margin-top: 3px; border-radius: 3px; background: rgba(94, 214, 255, .1); overflow: hidden; }
.fp-gauge .bar i { display: block; height: 100%; border-radius: 3px; box-shadow: 0 0 8px currentColor; }
.fp-dmgs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.fp-dmg {
  padding: 2px 8px; font-size: 11.5px; border-radius: 10px;
  color: #ffd2a6; background: rgba(255, 150, 40, .1); border: 1px solid rgba(255, 150, 40, .45);
}
.fp-dmg.crit { color: #ffb8b8; background: rgba(255, 77, 77, .12); border-color: rgba(255, 77, 77, .55); }
.fp-more {
  display: flex; align-items: center; justify-content: center; min-height: 120px; padding: 16px; text-align: center;
  color: var(--text-dim); border: 1px dashed var(--border-dim); border-radius: 12px;
}
/* sommaire par classe de tonnage, sous le titre « Composition » (pastilles
   cliquables vers chaque section), et détail par catégorie dans les titres */
.fp-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 4px; }
.fp-cat {
  padding: 3px 10px; font-size: 12.5px; border-radius: 12px; color: var(--text);
  background: color-mix(in srgb, var(--fc) 10%, transparent); border: 1px solid color-mix(in srgb, var(--fc) 35%, transparent);
}
.fp-cat b { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.fp-cats .fp-jump {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; font-size: 12.5px; border-radius: 14px;
  color: var(--text); background: color-mix(in srgb, var(--fc) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--fc) 35%, transparent); box-shadow: none;
}
.fp-cats .fp-jump:hover { border-color: var(--fc); background: color-mix(in srgb, var(--fc) 20%, transparent); box-shadow: none; }
/* jauge de tonnage : 4 barres croissantes */
.fp-size { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; flex: 0 0 auto; }
.fp-size i { width: 3px; border-radius: 1px; background: color-mix(in srgb, var(--fc) 22%, transparent); }
.fp-size i:nth-child(1) { height: 4px; }
.fp-size i:nth-child(2) { height: 7px; }
.fp-size i:nth-child(3) { height: 10px; }
.fp-size i:nth-child(4) { height: 13px; }
.fp-size i.on { background: var(--fc); box-shadow: 0 0 5px color-mix(in srgb, var(--fc) 70%, transparent); }
/* titre d'une classe : bandeau à la couleur de la faction */
.fp-tier {
  margin: 18px 0 10px; padding: 9px 14px 10px; border-radius: 10px; scroll-margin-top: 10px;
  border-left: 3px solid var(--fc);
  background: linear-gradient(90deg, color-mix(in srgb, var(--fc) 13%, transparent), transparent 75%);
}
.fp-tier-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fp-tier-top .fp-size { height: 16px; }
.fp-tier-top .fp-size i { width: 4px; }
.fp-tier-top .fp-size i:nth-child(1) { height: 5px; }
.fp-tier-top .fp-size i:nth-child(2) { height: 9px; }
.fp-tier-top .fp-size i:nth-child(3) { height: 12px; }
.fp-tier-top .fp-size i:nth-child(4) { height: 16px; }
.fp-tier-t {
  font-family: "Orbitron", "Segoe UI", sans-serif; font-size: 14px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-strong);
}
.fp-tier-n { margin-left: auto; font-size: 12.5px; color: var(--text-dim); }
.fp-tier-n b { color: var(--text-strong); font-variant-numeric: tabular-nums; font-weight: 700; }
.fp-tier-cats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.fp-tier-cats .fp-cat { padding: 2px 9px; font-size: 12px; }

/* fiche d'un secteur (carte planétaire) : même fenêtre, au-dessus de la carte
   planétaire (58) ; image en bandeau, hexagone du secteur, troupes par faction */
.fp-overlay.fs-over-pm { z-index: 59; }
/* carte planétaire ouverte : pas de flou d'arrière-plan (holo.css), donc
   une plaque opaque — sinon le panneau de la carte transparaît */
.fp-overlay.fs-over-pm .fp-sheet { background: #06121f; }
.fs-banner { height: 260px; overflow: hidden; border-bottom: 1px solid var(--border-dim); background: var(--bg-dim); }
.fs-banner-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fs-hero { min-height: 170px; }
.fs-hex { position: relative; z-index: 1; flex: 0 0 170px; align-self: center; height: 148px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.fs-hex svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--fc) 50%, transparent)); }
.fs-hex polygon { fill: color-mix(in srgb, var(--fc) 16%, rgba(3, 12, 22, .7)); stroke: var(--fc); stroke-width: 2; }
.fs-hex-c { position: relative; font-size: 30px; font-weight: 800; letter-spacing: .06em; color: var(--text-strong); }
.fs-hex-s { position: relative; max-width: 120px; text-align: center; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.fs-jam { align-self: flex-start; padding: 7px 11px; font-size: 13px; color: #dcc6ff; border-left: 2px solid #c39bff; background: rgba(195, 155, 255, .09); border-radius: 0 8px 8px 0; }
.fs-tier-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--fc); box-shadow: 0 0 8px var(--fc); }
.fp-unit.fs-jammed .u-art { background: repeating-linear-gradient(45deg, rgba(195, 155, 255, .1) 0 6px, transparent 6px 12px), var(--bg-dim); }
.fp-unit.fs-jammed:hover { transform: none; }
.fs-hash { font-family: Consolas, "Courier New", monospace; letter-spacing: .18em; color: #c39bff; }
.fs-point { --pc: var(--accent); display: flex; align-items: center; gap: 12px; }
.fs-point-logo { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; border: 2px solid var(--pc); }
.fs-point-ico { display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--panel-alt); }
.fs-point-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fs-point-t b { font-size: 15px; color: var(--text-strong); }
.fs-point-t span { font-size: 12.5px; color: var(--text-dim); }
.fs-point + .rep-body { margin-top: 10px; }
@media (max-width: 640px) {
  .fs-banner { height: 160px; }
  .fs-hex { flex-basis: 104px; height: 92px; }
  .fs-hex-c { font-size: 21px; }
  .fs-hex-s { display: none; }
}

/* hangars, équipage, immobilisation (cartes et fiche d'un vaisseau) */
.fp-unit .u-hangar { margin-top: 8px; font-size: 12px; color: var(--text); }
.fp-unit .u-hangar.low { color: #ffc98a; }
.fp-unit .u-crew { margin-top: 5px; font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-unit .u-emb {
  position: absolute; top: 9px; left: 10px; padding: 1px 8px; font-size: 11px; font-weight: 700; border-radius: 10px;
  color: #04121f; background: #5ed6ff;
}
.fp-unit .u-immo {
  position: absolute; top: 34px; left: 10px; padding: 1px 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: rgba(160, 40, 40, .9); border-radius: 10px;
}
.fp-unit.emb { border-style: dashed; }
.fpd-immo { margin-top: 10px; padding: 8px 12px; border-radius: 9px; color: #ffb8b8; background: rgba(255, 77, 77, .1); border: 1px solid rgba(255, 77, 77, .5); }
.fpd-hangar { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.fpd-hg { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--bg-dim); border: 1px solid var(--border-dim); }
.fpd-hg.low { border-color: rgba(255, 160, 40, .45); }
.fpd-hg .a { width: 64px; height: 40px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.fpd-hg .a .i { max-width: 100%; max-height: 100%; object-fit: contain; }
.fpd-hg .a .ico { font-size: 24px; }
.fpd-hg .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fpd-hg .t b { color: var(--text-strong); font-size: 14px; }
.fpd-hg .t .c { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fc); }
.fpd-hg .n { text-align: right; font-size: 12px; color: var(--text-dim); display: flex; flex-direction: column; align-items: flex-end; }
.fpd-hg .n b { font-size: 20px; color: var(--text-strong); }
.fpd-hg .n .lost { color: #ffc98a; }

/* cartes de la composition cliquables → fiche du vaisseau */
.fp-unit.click { cursor: pointer; }
.fp-unit.click:focus-visible { outline: 2px solid var(--fc); outline-offset: 2px; }
/* fiche d'un vaisseau */
.fpd-nav {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 62px 10px 30px;   /* à droite : le ✕ de la fenêtre */
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent); border-bottom: 1px solid var(--border-dim);
}
.fpd-nav .sp { flex: 1; }
.fpd-nav .fpd-back { padding: 5px 12px; font-size: 13px; border-radius: 16px; }
.fpd-nav .fpd-step { width: 32px; height: 30px; padding: 0; font-size: 18px; line-height: 1; border-radius: 8px; }
.fpd-pos { min-width: 54px; text-align: center; font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.fpd-sub { margin-top: 4px; font-size: 13px; color: var(--text-dim); }
.fpd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fpd-tags > span { padding: 3px 11px; font-size: 12.5px; border-radius: 14px; border: 1px solid var(--border-dim); color: var(--text); }
.fpd-status.ok { color: #9ff0c0; border-color: rgba(61, 220, 132, .5); background: rgba(61, 220, 132, .08); }
.fpd-status.hurt { color: #ffc98a; border-color: rgba(255, 160, 40, .5); background: rgba(255, 160, 40, .08); }
.fpd-status.down { color: #fff; border-color: rgba(255, 60, 60, .7); background: rgba(200, 30, 30, .55); }
.fpd-tags .fpd-flag { color: var(--gold); border-color: rgba(255, 210, 31, .5); background: rgba(255, 210, 31, .08); }
.fpd-tags .fpd-where { color: var(--text-dim); }
.fp-ship.fpd-down { filter: grayscale(.85) brightness(.55); }
.fpd-ico { position: relative; z-index: 1; font-size: 84px; margin-bottom: 26px; }
.fpd-state { display: flex; flex-direction: column; gap: 4px; max-width: 640px; }
.fpd-state .fp-gauge .h { font-size: 13px; }
.fpd-state .fp-gauge .bar { height: 8px; border-radius: 4px; }
.fpd-dmgs { margin-top: 14px; }
.fpd-dmgs-h { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.fpd-dmg {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; margin-bottom: 5px; border-radius: 9px;
  color: #ffd2a6; background: rgba(255, 150, 40, .08); border: 1px solid rgba(255, 150, 40, .4);
}
.fpd-dmg.crit { color: #ffb8b8; background: rgba(255, 77, 77, .1); border-color: rgba(255, 77, 77, .55); }
.fpd-dmg .t { flex: 1; font-weight: 600; }
.fpd-dmg .sev { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.fpd-none { color: var(--text-dim); font-size: 13.5px; }
.fpd-desc { white-space: pre-wrap; line-height: 1.6; color: var(--text); max-width: 760px; }
.fpd-next { margin-top: 12px; font-size: 13px; color: var(--text-dim); }
.fpd-stats { margin-top: 0; }

/* personnages à bord : --cc = couleur de leur faction */
.fp-crew { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.fp-char {
  --cc: var(--accent);
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px 9px 9px; text-align: left;
  background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 12px; color: var(--text);
}
.fp-char:hover:not(:disabled) { border-color: var(--cc); background: color-mix(in srgb, var(--cc) 8%, var(--bg-dim)); }
.fp-char:disabled { cursor: default; opacity: 1; }
.fp-char-img {
  width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--cc); box-shadow: 0 0 10px color-mix(in srgb, var(--cc) 45%, transparent); background: var(--panel-alt);
}
.fp-ph { display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: var(--cc); }
/* héros ou vaisseau à bord : le rendu de l'unité, entier */
.fp-char-img.fp-char-unit { object-fit: contain; padding: 5px; }
.fp-char-t { display: flex; flex-direction: column; min-width: 0; }
.fp-char-t .nm { font-size: 14.5px; font-weight: 700; line-height: 1.25; color: var(--text-strong); overflow-wrap: anywhere; }   /* noms longs : à la ligne */
.fp-char-t .sub { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* flotte disparue (détruite, dissoute, masquée) */
.fp-gone { padding: 70px 30px; text-align: center; }
.fp-gone-ico { font-size: 34px; color: var(--text-faint); }
.fp-gone-t { margin-top: 10px; font-size: 18px; font-weight: 700; }
.fp-gone-s { margin-top: 6px; color: var(--text-dim); font-size: 13.5px; }

@media (max-width: 720px) {
  .fp-sheet { width: 100vw; max-height: 100%; height: 100%; border-radius: 0; border: none; }
  .fp-hero { flex-direction: column-reverse; padding: 20px 16px 18px; }
  .fp-model { flex-basis: auto; min-height: 150px; }
  .fp-ship { max-height: 130px; }
  .fp-name { font-size: 23px; }
  .fp-tabs, .fp-stats, .fp-sec { padding-left: 16px; padding-right: 16px; }
  .fpd-nav { padding-left: 16px; }
  .fp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .fp-overlay, .fp-sheet, .fp-ship, .fp-loc.jump .dot { animation: none; }
  .fp-unit, .fleet-head .f-chev { transition: none; }
}
/* personnages (V.2) : ligne du dossier planétaire + fiche. --fac = couleur de
   faction posée en JS. Sélecteurs à deux classes : ils doivent l'emporter sur
   le style générique des boutons (y compris sous le calque holo). */
.dossier .char-row {
  --fac: var(--accent);
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  margin: 6px 0; padding: 7px 10px 7px 8px; background: var(--bg-dim); box-shadow: none;
  border: 1px solid var(--border-dim); border-left: 2px solid var(--fac); border-radius: 8px;
}
.dossier .char-row:hover { background: var(--panel-alt2); border-color: var(--border); border-left-color: var(--fac); box-shadow: none; }
.char-thumb { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--fac, var(--border)); }
.char-ph {
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-alt); color: var(--fac, var(--accent)); font-weight: 700;
}
.char-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.char-name { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.char-sub { font-size: 11.5px; color: var(--text-dim); }
.char-sheet-head { --fac: var(--accent); display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.char-portrait {
  width: 104px; height: 104px; border-radius: 12px; object-fit: cover; flex: 0 0 auto;
  border: 2px solid var(--fac); box-shadow: 0 0 18px color-mix(in srgb, var(--fac) 35%, transparent);
}
.char-portrait.char-ph { font-size: 40px; }
.char-sheet-who { min-width: 0; }
.char-sheet-who .owner-chip { margin: 8px 0 0; }
.char-sheet-name { font-size: 22px; font-weight: 700; color: var(--text-strong); line-height: 1.2; }
.char-sheet-title { font-size: 13px; color: var(--gold); letter-spacing: .04em; margin-top: 3px; }

/* séparateur orbite / sol (dossier + construction + admin) */
.domain-divider {
  display: flex; align-items: center; gap: 8px; margin: 12px 0 6px;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim);
}
.domain-divider:first-child { margin-top: 4px; }
.domain-divider .dd-ico { font-size: 14px; }
.domain-divider .dd-lbl { font-weight: 600; }
.domain-divider .dd-ct { color: var(--text-faint); font-variant-numeric: tabular-nums; }
.domain-divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

/* installations et chantiers du dossier planète (V.2) */
.bld-grid { display: flex; flex-direction: column; gap: 5px; }
.bld-card, .cq-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 7px 10px;
  background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 8px;
}
.bld-card.bld-new { border-style: dashed; }
.bld-ico {
  width: 34px; height: 34px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  font-size: 19px; border-radius: 7px; background: var(--panel-alt); overflow: hidden;
}
.bld-ico img { width: 100%; height: 100%; object-fit: contain; }
.bld-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bld-t b { color: var(--text-strong); font-size: 13.5px; font-weight: 600; }
.bld-t small { color: var(--text-dim); font-size: 12px; }
.bld-up { flex: 1 1 100%; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--gold); }
.cq-prog { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; }
.cq-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--panel-alt2); overflow: hidden; }
.cq-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.cq-left { min-width: 64px; text-align: right; font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
#dBuildBtn { margin-top: 12px; }
/* espace joueur : chantiers de sa faction, astuce de glisser-déposer */
.pl-cq { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 8px 10px; border-radius: 10px; background: var(--bg-dim); border: 1px solid var(--border-dim); }
.pl-cq-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-cq-t b { color: var(--text-strong); font-size: 13px; font-weight: 600; }
.pl-cq-t small { color: var(--text-dim); font-size: 12px; }
.pl-cq-bar { height: 4px; margin-top: 3px; border-radius: 2px; background: var(--panel-alt2); overflow: hidden; }
.pl-cq-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.pl-cq-left { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.pl-cq > button { width: 30px; height: 30px; padding: 0; border-radius: 50%; flex: 0 0 auto; }
.pl-tip { margin: 2px 0 4px; font-size: 12px; color: var(--text-dim); line-height: 1.45; }
.pl-wide { width: 100%; }

/* zone de glisser-déposer d'image (admin) */
.imgdrop {
  position: relative; margin-top: 4px; border: 1.5px dashed var(--border);
  border-radius: 10px; min-height: 90px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: var(--bg-dim); overflow: hidden; transition: border-color .15s, background .15s;
}
.imgdrop:hover { border-color: var(--border-strong); }
.imgdrop.drag { border-color: var(--accent); background: var(--panel-alt); }
.imgdrop-prev { max-width: 100%; max-height: 130px; display: none; object-fit: contain; }
.imgdrop-hint { text-align: center; font-size: 12.5px; color: var(--text-dim); padding: 14px; pointer-events: none; }
.imgdrop-hint small { color: var(--text-faint); }

/* ------------------------------ panneau Opérations (repliable) --------- */
.opspanel {
  position: absolute; left: 14px; bottom: 48px; z-index: 10; width: 280px;
  background: var(--panel); border: 1px solid var(--border-dim); border-radius: 10px;
  padding: 10px 12px; box-shadow: var(--shadow); backdrop-filter: blur(3px);
}
.opspanel.admin { bottom: 14px; }   /* pas de bandeau HoloNews côté MJ */
.opspanel h3 {
  display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px;
  letter-spacing: .12em; color: var(--text-dim); text-transform: uppercase;
  cursor: pointer; user-select: none;
}
.opspanel h3:hover { color: var(--text); }
.opspanel .hud-chev { margin-left: auto; font-size: 10px; transition: transform .15s; }
.opspanel.collapsed .hud-chev { transform: rotate(-90deg); }
.opspanel.collapsed .ops-body { display: none; }
.ops-body { max-height: 250px; overflow-y: auto; margin-top: 7px; }
.ops-line { display: flex; align-items: center; gap: 7px; padding: 4px 2px; font-size: 12.5px; cursor: pointer; border-radius: 6px; }
.ops-line:hover { background: var(--panel-alt); }
.ops-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 5px currentColor; }
.ops-nm { flex: 1; min-width: 0; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; }   /* nom long : sur deux lignes, « ×2 » reste visible */
.ops-nm small { display: block; color: var(--text-dim); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.ops-eta { color: var(--gold); font-variant-numeric: tabular-nums; font-size: 11.5px; flex: 0 0 auto; }
@media (max-width: 640px) { .opspanel { width: 220px; } }

/* --------------------------- boîte de confirmation (confirm() stylé) -- */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 12, 0.55); backdrop-filter: blur(3px);
}
.confirm-card {
  background: var(--panel-solid); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
  padding: 16px 18px; width: min(430px, 92vw);
}
.confirm-title { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--warning); margin-bottom: 10px; }
.confirm-msg { font-size: 14px; line-height: 1.55; white-space: pre-line; color: var(--text); }
.confirm-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
.confirm-actions button { min-width: 108px; }

/* ------------------------------------------- panneau d'administration -- */
/* Coquille : en-tête (titre, recherche globale), menu latéral (icône,
   compteur), en-tête de page (titre, description, action principale), puis
   le contenu. Les catalogues passent en liste + fiche (.md). */
.admin-overlay {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 12, 0.62); backdrop-filter: blur(4px);
}
.admin-card {
  width: min(1180px, 95vw); height: min(820px, 93vh);
  background: var(--panel-solid); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.admin-head {
  display: flex; align-items: center; gap: 14px; flex: 0 0 auto;
  padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--border-dim);
  background: var(--panel-alt);
}
.admin-head h3 { margin: 0; font-size: 15px; letter-spacing: 2px; color: var(--accent); white-space: nowrap; }
.admin-head #adminClose { width: 34px; height: 34px; padding: 0; border-radius: 50%; flex: 0 0 auto; }
.admin-head .saved-flash { white-space: nowrap; }
/* recherche globale */
.adm-search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.adm-search input { width: 100%; padding: 8px 12px; border-radius: 18px; background: rgba(3, 10, 20, .55); }
.adm-sres {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5;
  max-height: 380px; overflow-y: auto; padding: 5px;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.adm-sres.show { display: block; }
.adm-sres-it {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 8px; box-shadow: none;
}
.adm-sres-it:hover, .adm-sres-it.on { background: var(--panel-alt2); border-color: var(--border-dim); box-shadow: none; }
.adm-sres-it .i { width: 22px; text-align: center; flex: 0 0 auto; }
.adm-sres-it .n { font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.adm-sres-it .s { flex: 1; min-width: 0; font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-sres-it .k { flex: 0 0 auto; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.adm-sres-none { padding: 10px; color: var(--text-faint); font-style: italic; font-size: 13px; }

.admin-main { display: flex; flex: 1; min-height: 0; }
.admin-nav {
  width: 214px; flex: 0 0 auto; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 10px; border-right: 1px solid var(--border-dim);
  background: var(--panel-alt); scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.anav-group {
  font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-faint); margin: 14px 10px 5px;
}
.anav-group:first-child { margin-top: 2px; }
.admin-nav button {
  position: relative; display: flex; align-items: center; gap: 10px; text-align: left;
  background: transparent; border: 1px solid transparent; box-shadow: none;
  padding: 8px 10px; border-radius: 9px; font-size: 13.5px; color: var(--text-dim);
}
.admin-nav button:hover { background: var(--panel-alt2); border-color: transparent; color: var(--text); box-shadow: none; }
.admin-nav button.active { background: var(--panel-alt2); border-color: var(--border); color: var(--text-strong); }
.admin-nav button.active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 8px var(--accent);
}
.an-ico { width: 20px; text-align: center; flex: 0 0 auto; font-size: 15px; }
.an-lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-ct {
  flex: 0 0 auto; min-width: 22px; padding: 1px 7px; border-radius: 10px; text-align: center;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text-dim); background: rgba(94, 214, 255, .1);
}
.an-ct:empty { display: none; }
.admin-nav button.active .an-ct { color: var(--bg); background: var(--accent); }

/* page : en-tête puis contenu */
.admin-page { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-ph {
  display: flex; align-items: center; gap: 14px; flex: 0 0 auto;
  padding: 14px 22px 12px; border-bottom: 1px solid var(--border-dim);
  background: linear-gradient(180deg, rgba(94, 214, 255, .05), transparent);
}
.aph-ico {
  width: 42px; height: 42px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  font-size: 22px; border-radius: 12px; border: 1px solid var(--border-dim); background: rgba(94, 214, 255, .07);
}
.aph-tx { flex: 1; min-width: 0; }
.aph-title { margin: 0; font-family: "Orbitron", "Segoe UI", sans-serif; font-size: 19px; font-weight: 800; letter-spacing: .03em; color: var(--text-strong); }
.aph-desc { margin-top: 2px; font-size: 12.5px; color: var(--text-dim); line-height: 1.4; }
.aph-act { flex: 0 0 auto; white-space: nowrap; }
.admin-body {
  flex: 1; min-width: 0; min-height: 0; overflow-y: auto; padding: 16px 22px 26px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.admin-body.is-md { padding: 0; overflow: hidden; display: flex; }

/* liste + fiche (catalogues) */
.md { flex: 1; min-width: 0; display: flex; }
.md-list {
  width: 320px; flex: 0 0 auto; display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
  padding: 12px 10px 16px; border-right: 1px solid var(--border-dim); background: rgba(3, 10, 20, .25);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.md-q { position: sticky; top: -12px; z-index: 1; margin: -12px -10px 6px; padding: 10px 12px; width: calc(100% + 20px); border-radius: 0; border-width: 0 0 1px; background: var(--panel-solid); }
.md-gh {
  margin: 12px 6px 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint);
}
.md-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; margin: 1px 0; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 9px; box-shadow: none; color: var(--text);
}
.md-item:hover { background: var(--panel-alt2); border-color: transparent; box-shadow: none; }
.md-item.active { background: var(--panel-alt2); border-color: var(--border); }
.md-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.md-tx b { font-size: 13.5px; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-tx small { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-empty { padding: 14px 8px; color: var(--text-faint); font-style: italic; font-size: 13px; }
/* vignette : image, emoji ou initiale ; --tc = couleur de faction */
.md-th {
  --tc: var(--border);
  position: relative; width: 38px; height: 38px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1.5px solid var(--tc); background: rgba(3, 10, 20, .55);
  font-size: 18px; font-weight: 800; color: var(--tc); overflow: hidden;
}
.md-th img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.md-th.round { border-radius: 50%; }
.md-th.round img { object-fit: cover; padding: 0; }
.md-th.dot { width: 14px; height: 14px; margin: 0 12px; border-radius: 50%; border: 0; background: var(--tc); box-shadow: 0 0 8px var(--tc); }
.md-th.big { width: 76px; height: 76px; font-size: 34px; border-radius: 14px; }
.md-th.big.round { border-radius: 50%; }
.md-th.big.dot { width: 22px; height: 22px; margin: 0 6px; }
.md-detail { flex: 1; min-width: 0; overflow-y: auto; padding: 18px 24px 28px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.md-dh { display: flex; align-items: center; gap: 16px; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--border-dim); }
.md-dtx { flex: 1; min-width: 0; }
.md-dt { font-family: "Orbitron", "Segoe UI", sans-serif; font-size: 19px; font-weight: 800; line-height: 1.25; color: var(--text-strong); overflow-wrap: break-word; }
.md-dm { margin-top: 3px; font-size: 13px; color: var(--text-dim); }
.md-back { display: none; }
.md-form { max-width: 720px; }
.md-none { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 200px; }
.md-none-t { color: var(--text-faint); font-style: italic; }
.adm-color { width: 56px; height: 36px; padding: 2px; }

/* grille + volet (unités, bâtiments) : onglets de faction, sections par
   type, cartes en rangées de 3, fiche dans un volet refermable à droite */
.gc { flex: 1; min-width: 0; display: flex; }
.gc-main { flex: 1; min-width: 0; overflow-y: auto; padding: 0 20px 26px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.gc-bar {
  position: sticky; top: 0; z-index: 2; display: flex; flex-direction: column; gap: 10px;
  margin: 0 -20px 4px; padding: 12px 20px 10px; background: var(--panel-solid); border-bottom: 1px solid var(--border-dim);
}
.gc-facs { display: flex; flex-wrap: wrap; gap: 6px; }
.gc-fac {
  --fc: var(--accent);
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 5px; border-radius: 20px;
  background: transparent; border: 1px solid var(--border-dim); color: var(--text-dim); box-shadow: none; font-size: 13px;
}
.gc-fac:hover { color: var(--text); border-color: var(--border); background: transparent; box-shadow: none; }
.gc-fac .md-th { width: 24px; height: 24px; border-radius: 50%; font-size: 12px; border-width: 1px; }
.gc-fac .c { min-width: 20px; padding: 0 6px; border-radius: 9px; text-align: center; font-size: 11px; font-weight: 700; background: rgba(94, 214, 255, .1); }
.gc-fac.active { color: var(--text-strong); border-color: var(--fc); background: color-mix(in srgb, var(--fc) 16%, transparent); }
.gc-fac.zero:not(.active) { opacity: .62; }

/* menu de construction : construire / transformer, prérequis, atelier */
.modal-card.build-modal { width: min(820px, 96vw); }
.bm-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; color: var(--text-dim); font-size: 13px; }
.bm-head .creds { font-size: 16px; color: var(--gold); font-variant-numeric: tabular-nums; }
.bm-item {
  display: flex; gap: 12px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--bg-dim); border: 1px solid var(--border-dim); border-radius: 12px;
}
.bm-item.off { opacity: .78; }
.bm-art { width: 86px; height: 58px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.bm-art img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .5)); }
.bm-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.bm-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.bm-top b { font-size: 15px; color: var(--text-strong); }
.bm-top small { font-size: 12px; color: var(--text-dim); }
.bm-reqs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 12px; }
.bm-reqs .l { color: var(--text-faint); }
.bm-req { padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border-dim); }
.bm-req.ok { color: #9ff0c0; border-color: rgba(61, 220, 132, .45); background: rgba(61, 220, 132, .08); }
.bm-req.ko { color: #ffb8b8; border-color: rgba(255, 77, 77, .5); background: rgba(255, 77, 77, .08); }
.bm-shop { padding: 1px 8px; border-radius: 10px; color: var(--text-dim); border: 1px dashed var(--border-dim); }
.bm-shop.full { color: #ffc98a; border-color: rgba(255, 160, 40, .5); }
.bm-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.bm-act {
  flex: 1 1 240px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px;
  border-radius: 10px; border: 1px solid var(--border-dim); background: rgba(3, 12, 22, .4);
}
.bm-act.upgrade { border-color: rgba(94, 214, 255, .35); }
.bm-act button { padding: 6px 12px; font-size: 13px; }
.bm-cost { font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.bm-act .bm-src { flex: 1 1 100%; width: 100%; padding: 4px 8px; font-size: 12.5px; }
.bm-why { flex: 1 1 100%; font-size: 12px; color: #ff9a9a; }
.bm-only { flex: 1 1 100%; font-size: 11.5px; color: var(--text-faint); font-style: italic; }
.gc-fac.active .c { background: var(--fc); color: #04121f; }
.gc-sec {
  display: flex; align-items: center; gap: 10px; margin: 16px 0 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim);
}
.gc-sec::after { content: ""; flex: 1; height: 1px; background: var(--border-dim); }
.gc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gc-card {
  display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; text-align: left;
  border-radius: 12px; background: rgba(3, 10, 20, .4); border: 1px solid var(--border-dim); box-shadow: none; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.gc-card:hover { border-color: var(--border); background: rgba(3, 10, 20, .55); transform: translateY(-1px); box-shadow: none; }
.gc-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(94, 214, 255, .25); }
.gc-art {
  --tc: var(--border);
  height: 96px; display: flex; align-items: center; justify-content: center; font-size: 38px;
  border-bottom: 1px solid var(--border-dim);
  background:
    radial-gradient(70% 90% at 50% 75%, color-mix(in srgb, var(--tc) 18%, transparent), transparent 75%),
    repeating-linear-gradient(90deg, rgba(94, 214, 255, .04) 0 1px, transparent 1px 22px);
}
.gc-art img { max-width: 88%; max-height: 84px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.gc-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px 10px 10px; }
.gc-tx b { font-size: 13.5px; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-tx small { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-drawer {
  width: 440px; flex: 0 0 auto; overflow-y: auto; padding: 16px 20px 26px;
  border-left: 1px solid var(--border); background: var(--panel-alt); box-shadow: -14px 0 30px rgba(0, 0, 0, .35);
  animation: gc-in .16s ease-out; scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
@keyframes gc-in { from { opacity: 0; transform: translateX(14px); } }
.gc-drawer .md-dh { align-items: flex-start; }
.gc-drawer .md-th.big { width: 64px; height: 64px; font-size: 28px; }
.gc-close { width: 32px; height: 32px; flex: 0 0 auto; padding: 0; border-radius: 50%; }
/* volet ouvert sur un écran moyen : 2 cartes par rangée */
@media (max-width: 1240px) { .gc.open .gc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1040px) { .gc-drawer { width: 380px; } }
@media (prefers-reduced-motion: reduce) { .gc-drawer { animation: none; } .gc-card { transition: none; } }

/* sections des pages hors catalogue */
.adm-sec {
  position: relative; max-width: 860px; margin: 0 0 14px; padding: 14px 16px 16px;
  background: rgba(3, 10, 20, .3); border: 1px solid var(--border-dim); border-radius: 12px;
}
.adm-sec-h { margin: 0 0 3px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.adm-sec-d { margin-bottom: 10px; font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.adm-sec > .adm-sec-h:last-child { margin: 0; }
.adm-sec-act { position: absolute; top: 10px; right: 12px; width: auto; }
.adm-sec.danger { border-color: rgba(255, 37, 37, .4); background: rgba(255, 37, 37, .04); }
.adm-sec.danger .adm-sec-h { color: var(--danger); }
.adm-btns { display: flex; flex-wrap: wrap; gap: 8px; }
/* version de base (Réglages) : ce qui est enregistré */
.snap-info { margin-bottom: 10px; font-size: 13px; color: var(--text); line-height: 1.45; }
.snap-info .hint { margin-top: 4px; }
.adm-file { padding: 8px; }
/* interrupteur de réglage */
.adm-sw {
  display: flex; align-items: center; gap: 14px; margin: 0; padding: 10px 2px; cursor: pointer;
  text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--text); border-top: 1px solid var(--border-dim);
}
.adm-sec-d + .adm-sw, .adm-sec-h + .adm-sw { border-top: 0; }
.adm-sw .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.adm-sw .tx b { font-weight: 600; color: var(--text-strong); }
.adm-sw .tx small { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.adm-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.adm-sw .sw {
  position: relative; width: 42px; height: 24px; flex: 0 0 auto; border-radius: 12px;
  background: rgba(127, 155, 178, .25); border: 1px solid var(--border-dim); transition: background .15s, border-color .15s;
}
.adm-sw .sw::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-dim); transition: transform .15s, background .15s;
}
.adm-sw input:checked + .sw { background: color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.adm-sw input:checked + .sw::after { transform: translateX(18px); background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.adm-sw input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
/* statut en boutons (objectifs) */
/* fiche d'un type : section « Construction », listes à choix multiples */
.form-sec {
  margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border-dim);
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.mpick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mp-chip {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px 3px 2px 10px; font-size: 13px; border-radius: 14px;
  color: var(--text-strong); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.mp-chip.gone { color: var(--danger); border-color: rgba(255, 77, 77, .5); background: rgba(255, 77, 77, .08); }
.mpick .mp-chip button { width: 22px; height: 22px; padding: 0; font-size: 11px; color: inherit; background: transparent; border: 0; box-shadow: none; }
.mpick .mp-chip button:hover { background: rgba(255, 255, 255, .1); box-shadow: none; }
.mpick select { width: auto; max-width: 100%; padding: 4px 8px; font-size: 13px; }
.adm-seg { display: flex; gap: 6px; }
.adm-seg button { flex: 1; --sc: var(--accent); }
.adm-seg button.active { color: var(--text-strong); border-color: var(--sc); background: color-mix(in srgb, var(--sc) 18%, transparent); }

/* tableau de bord */
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; max-width: 860px; margin-bottom: 14px; }
.dash-tile {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 10px;
  padding: 12px 14px; text-align: left; border-radius: 12px; overflow: hidden;
  background: rgba(3, 10, 20, .35); border: 1px solid var(--border-dim); color: var(--text); box-shadow: none;
}
button.dash-tile:hover { border-color: var(--border); background: var(--panel-alt2); }
.dash-tile .i { grid-row: 1 / span 3; font-size: 22px; align-self: center; }
.dash-tile .v { font-family: "Orbitron", "Segoe UI", sans-serif; font-size: 22px; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.dash-tile .k { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.dash-tile .s { font-size: 11.5px; color: var(--text-faint); }
.dash-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.dash-act { display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left; border-radius: 10px; }
.dash-act .i { font-size: 18px; }
.dash-facs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.dash-fac {
  --fc: var(--accent);
  display: flex; flex-direction: column; gap: 9px; padding: 12px 14px; text-align: left; border-radius: 12px;
  background: color-mix(in srgb, var(--fc) 6%, rgba(3, 10, 20, .4)); border: 1px solid color-mix(in srgb, var(--fc) 35%, transparent);
  color: var(--text); box-shadow: none;
}
.dash-fac:hover { border-color: var(--fc); background: color-mix(in srgb, var(--fc) 12%, rgba(3, 10, 20, .4)); }
.dash-fac .hd { display: flex; align-items: center; gap: 10px; }
.dash-fac .hd b { font-size: 14.5px; color: var(--text-strong); }
.dash-fac .md-th { width: 32px; height: 32px; font-size: 16px; }
.dash-fac .bar { height: 5px; border-radius: 3px; background: rgba(127, 155, 178, .15); overflow: hidden; }
.dash-fac .bar > div { height: 100%; background: var(--fc); box-shadow: 0 0 8px var(--fc); border-radius: 3px; }
.dash-fac .st { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.dash-fac .st .cr { color: var(--gold); }
.dash-tr { display: grid; gap: 5px; }
.dash-tr-row {
  --fc: var(--accent);
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; text-align: left;
  background: rgba(3, 10, 20, .35); border: 1px solid var(--border-dim); border-radius: 9px; box-shadow: none; color: var(--text);
}
.dash-tr-row:hover { border-color: var(--fc); }
.dash-tr-row .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--fc); box-shadow: 0 0 6px var(--fc); flex: 0 0 auto; }
.dash-tr-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-tr-row .tx small { color: var(--text-dim); font-size: 12px; }
.dash-tr-row .eta { font-variant-numeric: tabular-nums; color: var(--accent); font-size: 12.5px; }

/* économie */
.eco-rows { display: grid; gap: 6px; }
.eco-row { --fc: var(--accent); display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border-dim); border-radius: 10px; background: rgba(3, 10, 20, .3); }
.eco-row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fc); box-shadow: 0 0 6px var(--fc); flex: 0 0 auto; }
.eco-row .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.eco-row .nm small { font-size: 12px; color: var(--text-dim); }
.eco-row input { width: 140px; text-align: right; font-variant-numeric: tabular-nums; }
.eco-row .cr { color: var(--gold); font-size: 12.5px; }

/* événements */
.ev-send { align-items: flex-end; margin-top: 4px; }
.ev-send > button { flex: 0 0 auto; }
.ev-list { display: grid; gap: 4px; max-height: 460px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.ev-row { --fc: var(--text-faint); display: flex; align-items: flex-start; gap: 10px; padding: 7px 10px; border-left: 2px solid var(--fc); background: rgba(3, 10, 20, .3); border-radius: 0 8px 8px 0; }
.ev-row .ico { width: 20px; text-align: center; flex: 0 0 auto; }
.ev-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.ev-row .tx small { margin-top: 2px; font-size: 11.5px; color: var(--text-faint); }

/* cartes planétaires */
/* (préfixe pmap- : .pm-card est déjà la fenêtre plein écran de la carte planétaire) */
.pmap-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.pmap-item { --fc: var(--accent); display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border-dim); border-left: 3px solid var(--fc); border-radius: 10px; background: rgba(3, 10, 20, .3); }
.pmap-item .ico { font-size: 20px; }
.pmap-item .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pmap-item .tx small { font-size: 11.5px; color: var(--text-dim); }
.pmap-item .bx { display: flex; gap: 4px; }

/* édition avancée repliée (panneau planète) */
details.adv { margin-top: 18px; border: 1px solid var(--border-dim); border-radius: 10px; }
details.adv > summary { cursor: pointer; padding: 10px 12px; color: var(--text-dim); font-size: 13px; list-style: none; user-select: none; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary:hover { color: var(--text); }
details.adv[open] > summary { border-bottom: 1px solid var(--border-dim); color: var(--text); }
details.adv > .adv-body { padding: 4px 12px 14px; }

/* ------------------------------------------------------- HoloNews ------ */
.holonews {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: stretch; height: 34px;
  background: linear-gradient(90deg, var(--panel-solid), var(--panel));
  border-top: 1px solid var(--border-dim);
  backdrop-filter: blur(6px);
}
.hn-badge {
  display: flex; align-items: center; padding: 0 14px;
  font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 12px; letter-spacing: 2px;
  color: var(--bg); background: var(--accent);
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  flex: 0 0 auto;
}
.hn-viewport { position: relative; overflow: hidden; flex: 1; }
.hn-track {
  position: absolute; top: 0; left: 0; height: 100%;
  display: flex; align-items: center; white-space: nowrap;
  will-change: transform; animation: hn-scroll linear infinite;
}
.hn-viewport:hover .hn-track { animation-play-state: paused; }
.hn-item { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 13px; color: var(--text); }
.hn-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; box-shadow: 0 0 6px currentColor; }
.hn-sep { color: var(--border-strong); padding: 0 16px; font-size: 9px; }
@keyframes hn-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .topbar h1 { font-size: 15px; }
  .hud { min-width: 160px; padding: 9px 10px; }
  .searchwrap { width: 60vw; }
  .dossier, .editor { width: 100%; }
  .holonews { height: 30px; }
  .hn-badge { font-size: 10px; padding: 0 10px; letter-spacing: 1px; }
}

/* ------------------------------------------------ rapports RP (V.2) ------ */
/* Couleur de type portée par --rep-c (posée en JS), tout le reste vient des
   jetons du thème : rendu correct en V.1 comme sous le calque holo.
   Sélecteurs à deux classes sur les boutons-liens : ils doivent l'emporter
   sur le style générique des boutons (y compris html[data-theme] button). */
.rep-count { font-size: 11px; color: var(--text-faint); letter-spacing: .05em; margin-left: 6px; font-variant-numeric: tabular-nums; text-transform: none; }
.rep-badge {
  --rep-c: var(--accent);
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--rep-c); padding: 2px 8px; border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--rep-c) 45%, transparent);
  background: color-mix(in srgb, var(--rep-c) 12%, transparent);
}
.rep-meta { font-size: 12px; color: var(--text-dim); }
.rep-edited { color: var(--text-faint); font-style: italic; }
.rep-body { font-size: 14px; line-height: 1.6; color: var(--text); margin-top: 8px; overflow-wrap: anywhere; }
.rep-body p { margin: 0 0 .75em; }
.rep-body p:last-child { margin-bottom: 0; }

/* -- dans le dossier planétaire -- */
.rep-card {
  --rep-c: var(--accent);
  background: var(--bg-dim); border: 1px solid var(--border-dim); border-left: 2px solid var(--rep-c);
  border-radius: 8px; padding: 10px 12px; margin: 8px 0;
}
.rep-title { font-size: 15px; font-weight: 600; color: var(--text-strong); margin: 8px 0 2px; line-height: 1.3; }
.rep-card.clamp:not(.open) .rep-body {
  max-height: 6.4em; overflow: hidden;   /* 4 lignes à 1.6 */
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
          mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.rep-card .rep-more {
  margin-top: 6px; padding: 2px 0; background: none; border: 0; box-shadow: none;
  color: var(--accent); font-size: 12.5px;
}
.rep-card .rep-more:hover { background: none; box-shadow: none; text-decoration: underline; }

/* -- archives (vue publique) -- */
.reports-overlay {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 12, 0.62); backdrop-filter: blur(4px);
}
.reports-card {
  width: min(1100px, 94vw); height: min(760px, 90vh);
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.reports-head {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
  padding: 12px 18px; border-bottom: 1px solid var(--border-dim); background: var(--panel-alt);
}
.reports-head h3 { margin: 0; font-size: 15px; letter-spacing: 2px; color: var(--accent); }
.reports-head .spacer { flex: 1; }
.reports-main { display: flex; flex: 1; min-height: 0; }
.reports-side {
  width: 340px; flex: 0 0 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  border-right: 1px solid var(--border-dim); background: var(--panel-alt);
}
.rep-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.rep-filters .rep-filter {
  --rep-c: var(--accent);
  padding: 3px 10px; font-size: 12px; border-radius: 12px;
  background: transparent; border: 1px solid var(--border-dim); box-shadow: none; color: var(--text-dim);
}
.rep-filters .rep-filter:hover { color: var(--text); border-color: var(--border); box-shadow: none; }
.rep-filters .rep-filter.active {
  color: var(--rep-c); border-color: var(--rep-c);
  background: color-mix(in srgb, var(--rep-c) 14%, transparent);
}
.rep-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.rep-list .rep-item {
  --rep-c: var(--accent);
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; background: transparent; box-shadow: none;
  border: 1px solid transparent; border-left: 2px solid transparent; border-radius: 6px;
}
.rep-list .rep-item:hover { background: var(--panel-alt2); border-color: transparent; box-shadow: none; }
.rep-list .rep-item.active { background: var(--panel-alt2); border-color: var(--border-dim); border-left-color: var(--rep-c); }
.rep-ico { font-size: 16px; line-height: 1.25; flex: 0 0 auto; }
.rep-item-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rep-item-title {
  font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rep-item-sub { font-size: 11.5px; color: var(--text-dim); }

.rep-reader { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 34px 44px; }
.rep-reader-title { font-size: 25px; line-height: 1.25; margin: 12px 0 6px; color: var(--text-strong); }
.rep-loc {
  display: flex; align-items: center; gap: 9px; margin: 16px 0 4px; max-width: 68ch;
  padding: 8px 10px 8px 12px; border: 1px solid var(--border-dim); border-radius: 8px;
  background: var(--bg-dim); font-size: 13.5px;
}
.rep-loc .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 8px currentColor; flex: 0 0 auto; }
.rep-loc span:nth-child(2) { flex: 1; }
.rep-loc button { padding: 4px 11px; font-size: 12.5px; }
.rep-reader-body { font-size: 15.5px; line-height: 1.75; max-width: 68ch; margin-top: 20px; }
.rep-reader-empty { color: var(--text-faint); font-style: italic; padding: 40px 0; text-align: center; }

/* -- éditeur MJ -- */
.rep-editor textarea.rep-text { min-height: 340px; font-size: 14.5px; line-height: 1.6; }
.rep-counter { font-size: 11.5px; color: var(--text-faint); text-align: right; margin-top: 3px; font-variant-numeric: tabular-nums; }
.rep-counter.over { color: var(--danger); }
.rep-editor .cat-actions { margin-top: 14px; }

@media (max-width: 760px) {
  .reports-card { width: 100vw; height: 100%; border-radius: 0; border: none; }
  .reports-main { flex-direction: column; }
  .reports-side { width: 100%; max-height: 42%; border-right: none; border-bottom: 1px solid var(--border-dim); }
  .rep-reader { padding: 16px 16px 40px; }
}

/* ------------------------------------------- cartes planétaires (V.2) ---- */
/* vue publique (.pm-*) et éditeur MJ (.pme-*) ; rendu de la carte : hexmap.js.
   Empilement : vue publique 58 (au-dessus des archives), éditeur 70 (au-dessus
   du panneau MJ et des modales), confirmations 80. */
.dossier .pm-open { width: 100%; margin: 0 0 12px; padding: 9px 12px; font-weight: 600; letter-spacing: .03em; }
/* fond sombre OPAQUE, sans flou : la carte couvre l'écran, un flou plein écran
   par-dessus un fond animé coûtait à la carte graphique à chaque image */
.pm-overlay, .pme-overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 12, 0.92);
}
.pm-overlay { z-index: 58; }
.pme-overlay { z-index: 70; }
.pm-card, .pme-card {
  width: min(1500px, 97vw); height: min(940px, 95vh);
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.pm-head, .pme-head {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--border-dim); background: var(--panel-alt);
}
.pm-head h3, .pme-head h3 { margin: 0; font-size: 15px; letter-spacing: 2px; color: var(--accent); }
.pm-planet { color: var(--gold); }
.pm-head .spacer, .pme-head .spacer { flex: 1; }
.pm-main, .pme-main { display: flex; flex: 1; min-height: 0; }
.pm-stage, .pme-stage { position: relative; flex: 1; min-width: 0; }
.pm-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.pm-canvas.panning { cursor: grabbing; }

/* infobulle */
.pm-tip {
  position: absolute; display: none; pointer-events: none; z-index: 3; max-width: 230px;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; font-size: 12.5px; color: var(--text-dim); box-shadow: var(--shadow);
}
.pm-tip .b { color: var(--text-strong); font-weight: 600; font-size: 13.5px; }

/* panneau latéral (vue publique) */
.pm-side { width: 340px; flex: 0 0 auto; overflow-y: auto; padding: 4px 16px 24px; border-left: 1px solid var(--border-dim); background: var(--panel-alt); }
.pm-legend, .pm-plist, .pm-layers { display: flex; flex-direction: column; gap: 5px; }
.pm-leg-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.pm-leg-nm { flex: 1; min-width: 0; }
.pm-leg-ct { color: var(--text-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.pm-fac { width: 14px; height: 14px; border-radius: 3px; flex: 0 0 auto; box-shadow: 0 0 8px rgba(0, 0, 0, .4); }
.pm-swatch { border-radius: 3px; flex: 0 0 auto; border: 1px solid var(--border-dim); }
.pm-plist .pm-pitem {
  --fac: var(--accent);
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px;
  background: transparent; box-shadow: none; border: 1px solid transparent; border-left: 2px solid var(--fac); border-radius: 6px;
}
.pm-plist .pm-pitem:hover, .pm-plist .pm-pitem.active { background: var(--panel-alt2); border-color: var(--border-dim); border-left-color: var(--fac); box-shadow: none; }
.pm-pico { font-size: 16px; width: 22px; text-align: center; }
.pm-pnm { flex: 1; min-width: 0; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-pco { font-family: Consolas, monospace; font-size: 11.5px; color: var(--text-faint); }
.pm-detail { --fac: var(--accent); margin: 12px 0 4px; padding: 12px; border: 1px solid var(--border-dim); border-left: 3px solid var(--fac); border-radius: 10px; background: var(--bg-dim); }
.pm-detail-top { display: flex; align-items: center; gap: 12px; }
.pm-logo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; border: 2px solid var(--fac); }
.pm-logo-ico { display: flex; align-items: center; justify-content: center; font-size: 32px; background: var(--panel-alt); }
.pm-detail-name { font-size: 17px; font-weight: 700; color: var(--text-strong); }
.pm-detail-type { font-size: 12px; color: var(--gold); letter-spacing: .04em; margin-top: 2px; }
.pm-detail .owner-chip { margin: 6px 0 0; }
.pm-detail-meta { font-size: 12.5px; color: var(--text-dim); margin: 10px 0 6px; }
.pm-detail .pm-unsel { margin-top: 10px; width: 100%; font-size: 12.5px; }

/* éditeur MJ */
.pme-status { font-size: 12.5px; color: var(--success); min-width: 120px; }
.pme-status.err { color: var(--danger); }
.pme-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.pme-bar button { padding: 6px 10px; font-size: 13px; }
.pme-bar button:disabled { opacity: .4; cursor: default; }
.pme-left { width: 232px; flex: 0 0 auto; display: flex; flex-direction: column; border-right: 1px solid var(--border-dim); background: var(--panel-alt); min-height: 0; }
.pme-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 10px; border-bottom: 1px solid var(--border-dim); }
.pme-tools .pme-tool { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; font-size: 11px; }
.pme-tools .pme-tool.active { border-color: var(--accent); color: var(--text-strong); background: var(--panel-alt2); box-shadow: 0 0 14px rgba(94, 214, 255, .25); }
.pme-tool-ico { font-size: 19px; line-height: 1.1; }
.pme-palette { flex: 1; overflow-y: auto; padding: 8px 10px 16px; display: flex; flex-direction: column; gap: 5px; }
.pme-pal-h { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); margin: 8px 0 2px; }
.pme-brush { display: flex; gap: 4px; }
.pme-brush button { flex: 1; padding: 5px 0; font-size: 13px; }
.pme-brush button.active, .pme-types button.active { border-color: var(--gold); color: var(--gold); background: var(--panel-alt2); }
.pme-palette .pme-chip { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px; font-size: 13px; }
.pme-palette .pme-chip.active { border-color: var(--gold); background: var(--panel-alt2); color: var(--text-strong); box-shadow: 0 0 12px rgba(255, 210, 31, .18); }
.pme-route-sw { width: 26px; height: 4px; border-radius: 2px; flex: 0 0 auto; }
.pme-route-sw.dashed { -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 10px); mask-image: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 10px); }
.pme-types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.pme-types button { padding: 5px 0; font-size: 18px; line-height: 1.2; }
.pme-type-name { font-size: 12.5px; color: var(--gold); text-align: center; margin-top: 2px; }
.pme-conq { font-size: 12.5px; color: var(--gold); margin: 8px 0 4px; padding: 6px 8px; border-left: 2px solid var(--gold); background: rgba(255,210,31,0.06); }
.pme-palette .pme-link, .pme-insp .pme-link { background: none; border: none; box-shadow: none; color: var(--accent); padding: 4px 0; text-align: left; font-size: 12.5px; }
.pme-stage .pm-canvas { cursor: crosshair; }
.pme-stage[data-tool="select"] .pm-canvas { cursor: default; }
.pme-stage.space .pm-canvas { cursor: grab; }
.pme-hud { position: absolute; left: 10px; bottom: 8px; font-family: Consolas, monospace; font-size: 12px; color: var(--text-dim); pointer-events: none; }
.pme-insp { width: 330px; flex: 0 0 auto; overflow-y: auto; padding: 0 14px 24px; border-left: 1px solid var(--border-dim); background: var(--panel-alt); }
.pme-sec { margin-bottom: 6px; }
.pme-sel-title { font-size: 15px; font-weight: 600; color: var(--text-strong); margin: 4px 0 6px; }
.pme-field label { margin-top: 8px; }
.pme-insp textarea { min-height: 80px; }
.pme-insp .toggle { margin-top: 8px; }
.pme-terrain { display: grid; grid-template-columns: 34px 1fr 38px 92px 28px; gap: 5px; align-items: center; margin-top: 6px; }
.pme-terrain input[type="color"] { padding: 0; height: 30px; }
.pme-terrain select { padding: 6px 4px; font-size: 12.5px; }
.pme-terrain-ct { font-size: 11px; color: var(--text-faint); }
/* sous la ligne du terrain : « Hors contrôle » et nombre de cases */
.pme-terrain-sub { display: flex; align-items: center; gap: 10px; margin: 2px 0 0 39px; }
.pme-terrain-sub .toggle { font-size: 12px; margin: 0; text-transform: none; letter-spacing: 0; color: var(--text-dim); }
.pme-insp .rowflex button { flex: 0 0 auto; }
/* éditeur : troupes au sol (outil 🪖, secteur sélectionné) */
.pme-ufleet { display: flex; align-items: center; gap: 7px; margin: 6px 0 1px; font-size: 12.5px; font-weight: 600; color: var(--text-strong); }
.pme-palette .pme-unit {
  justify-content: space-between; cursor: grab; user-select: none;
  background: var(--panel-alt2); border: 1px solid var(--border-dim); border-radius: 8px; color: var(--text);
}
.pme-palette .pme-unit:hover { border-color: var(--accent); }
.pme-palette .pme-unit:active { cursor: grabbing; }
.pme-palette .pme-unit.empty { opacity: .45; cursor: not-allowed; }
.pme-unit-img { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; pointer-events: none; }
/* noms longs (« Phase 2 | 212th Clone Trooper ») : sur plusieurs lignes, jamais coupés */
.pme-unit-nm { flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.pme-unit-ct { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.pme-sub-h { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); margin: 14px 0 4px; }
.pme-urow { display: grid; grid-template-columns: 14px 1fr 70px 28px; gap: 6px; align-items: center; margin-top: 5px; }
.pme-urow-nm { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.pme-urow-nm b, .pme-urow-nm small { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.pme-urow-nm small { color: var(--text-faint); font-size: 11px; }
.pme-urow input { padding: 5px 6px; }

/* éditeur : bouton Sauvegarder, alerte d'enregistrement, panneau de taille */
.pme-bar .pme-save { min-width: 136px; font-weight: 700; }
.pme-bar .pme-save:disabled { opacity: .75; }
.pme-bar .pme-save.err { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 0 16px rgba(255, 37, 37, .45); }
.pme-alert {
  flex: 0 0 auto; padding: 10px 16px; font-size: 13.5px; line-height: 1.45; font-weight: 600;
  color: #fff; background: rgba(190, 20, 20, .88); border-bottom: 1px solid var(--danger);
}
.pme-sizepanel {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5; width: min(430px, 92%);
  padding: 14px 16px; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow), 0 0 24px rgba(94, 214, 255, .25); backdrop-filter: blur(8px);
}
.pme-size-h { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.pme-size-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 4px; }
.pme-size-row > div { flex: 1; }
.pme-size-row input { font-size: 18px; font-weight: 700; text-align: center; }
.pme-size-x { font-size: 20px; color: var(--text-dim); padding-bottom: 8px; }
.pme-size-presets { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 4px; }
.pme-size-presets button { padding: 4px 9px; font-size: 12.5px; }
.pme-size-presets button.active { border-color: var(--gold); color: var(--gold); }
.pme-size-act { display: flex; gap: 8px; margin-top: 10px; }
.pme-size-act button { flex: 1; }

/* panneau d'administration, largeur moyenne : menu réduit aux icônes
   (compteur en pastille), liste plus étroite, pour laisser la place à la fiche */
@media (max-width: 1040px) and (min-width: 761px) {
  .admin-nav { width: 60px; padding: 10px 7px; align-items: stretch; }
  .anav-group { height: 1px; margin: 8px 4px; font-size: 0; background: var(--border-dim); }
  .anav-group:first-child { display: none; }
  .admin-nav button { justify-content: center; padding: 9px 0; }
  .admin-nav button.active::before { left: -7px; }
  .an-lbl { display: none; }
  .an-ico { width: auto; font-size: 17px; }
  .an-ct { position: absolute; top: 1px; right: 1px; min-width: 16px; padding: 0 4px; font-size: 9.5px; line-height: 15px; }
  .md-list { width: 260px; }
}
/* panneau d'administration, écrans étroits : menu en bandeau défilant,
   catalogues en liste OU fiche (bouton « ← Liste ») */
@media (max-width: 760px) {
  .admin-card { width: 100vw; height: 100%; border-radius: 0; border: none; }
  .admin-head { flex-wrap: wrap; gap: 8px 10px; padding: 8px 10px; }
  .adm-search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .admin-head #adminClose { margin-left: auto; }
  .admin-main { flex-direction: column; }
  .admin-nav { width: 100%; flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: none; border-bottom: 1px solid var(--border-dim); padding: 6px 8px; scrollbar-width: none; flex: 0 0 auto; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .anav-group { display: none; }
  .admin-nav button { flex: 0 0 auto; padding: 7px 10px; }
  .admin-nav button.active::before { display: none; }
  .admin-ph { padding: 10px 14px; gap: 10px; }
  .aph-ico { display: none; }
  .aph-title { font-size: 16px; }
  .aph-desc { display: none; }
  .admin-body { padding: 12px 12px 22px; }
  .md-list { width: 100%; border-right: none; }
  .md.has-sel .md-list { display: none; }
  .md:not(.has-sel) .md-detail { display: none; }
  .md-detail { padding: 14px 14px 24px; }
  .md-back { display: inline-flex; }
  .md-th.big { width: 56px; height: 56px; font-size: 26px; }
  .md-dt { font-size: 18px; }
  .dash-fac .st { grid-template-columns: 1fr; }
  .gc { position: relative; }
  .gc-main { padding: 0 12px 20px; }
  .gc-bar { margin: 0 -12px 4px; padding: 10px 12px; }
  .gc-facs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .gc-grid, .gc.open .gc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gc-drawer { position: absolute; inset: 0; width: auto; z-index: 3; border-left: none; padding: 14px 14px 24px; }
  .eco-row input { width: 100px; }
}

/* ================================================== objectifs (V.2) ===== */
/* --oc : couleur de la faction chargée de l'objectif ; --sc : couleur du statut */
.obj-topbtn { position: relative; }
.obj-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px;
  background: var(--gold); color: #1a1200; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
.obj-sec-h { color: var(--gold); }
#dObj { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.obj-card {
  --oc: var(--gold); --sc: var(--accent);
  position: relative; padding: 11px 13px 10px 16px; border-radius: 11px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--oc) 13%, var(--panel-alt)), var(--bg-dim) 70%);
  border: 1px solid color-mix(in srgb, var(--oc) 55%, var(--border-dim));
  box-shadow: 0 0 16px color-mix(in srgb, var(--oc) 18%, transparent), inset 0 0 0 1px rgba(255,255,255,0.02);
  overflow: hidden;
}
.obj-card::before {   /* liseré vertical aux couleurs de la faction */
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--oc); box-shadow: 0 0 10px var(--oc);
}
.obj-card.main { border-color: color-mix(in srgb, var(--gold) 70%, var(--oc)); box-shadow: 0 0 20px color-mix(in srgb, var(--gold) 28%, transparent); }
.obj-card.st-success, .obj-card.st-failure { opacity: .82; }
.obj-card.st-success::before { background: #4ade80; box-shadow: 0 0 10px #4ade80; }
.obj-card.st-failure::before { background: #ff6b6b; box-shadow: 0 0 10px #ff6b6b; }
.obj-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.obj-ico { font-size: 15px; letter-spacing: 0; }
.obj-kind { color: color-mix(in srgb, var(--oc) 75%, #fff); font-weight: 700; }
.obj-main { color: var(--gold); font-weight: 800; }
.obj-vis { color: var(--text-dim); border: 1px solid var(--border-dim); border-radius: 5px; padding: 0 5px; text-transform: none; letter-spacing: 0; }
.obj-status { margin-left: auto; color: var(--sc); font-weight: 800; }
.obj-name { margin-top: 4px; font-size: 16px; font-weight: 800; color: var(--text-strong); line-height: 1.25; overflow-wrap: anywhere; }
.obj-target { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; color: var(--text-dim); }
.obj-fac { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-weight: 600; }
.obj-fac i { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.obj-desc { margin-top: 6px; font-size: 13px; color: var(--text); line-height: 1.45; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.obj-prog { display: flex; align-items: center; gap: 9px; margin-top: 9px; }
.obj-bar { flex: 1; height: 9px; border-radius: 5px; background: var(--panel-alt2); overflow: hidden; }
.obj-bar i { display: block; height: 100%; border-radius: 5px; background: var(--oc); box-shadow: 0 0 9px var(--oc); transition: width .4s; }
.st-success .obj-bar i { background: #4ade80; box-shadow: 0 0 9px #4ade80; }
.obj-pct { min-width: 42px; text-align: right; font-weight: 800; font-size: 13px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.obj-ptext { margin-top: 4px; font-size: 12px; color: var(--text-dim); }
.obj-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; }
.obj-time { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.obj-time.soon { color: var(--warning); }
.obj-time.urgent { color: #ff7a6b; animation: obj-blink 1.2s ease-in-out infinite; }
.obj-time.done { color: var(--sc); }
.obj-reward { color: var(--gold); }
.obj-outcome { margin-top: 6px; font-size: 12px; color: var(--sc); }
.obj-go { margin-top: 8px; font-size: 12px; padding: 4px 10px; }
.obj-card.compact .obj-name { font-size: 14px; }
@keyframes obj-blink { 50% { opacity: .45; } }
.obj-tip { color: var(--gold) !important; }

/* tableau des objectifs (barre du haut) */
.obj-board-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 12, 0.66); backdrop-filter: blur(4px);
}
.obj-board {
  width: min(1180px, 94vw); height: min(800px, 90vh); display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.obj-board-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border-dim); background: var(--panel-alt); }
.obj-board-head h3 { margin: 0; font-size: 15px; letter-spacing: 2px; color: var(--gold); }
.obj-board-head .spacer { flex: 1; }
.obj-board-filt { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--border-dim); }
.obj-chip { --cc: var(--accent); font-size: 12px; padding: 4px 11px; border-radius: 14px; border: 1px solid var(--border-dim); background: var(--bg-dim); color: var(--text); }
.obj-chip.on { border-color: var(--cc); background: color-mix(in srgb, var(--cc) 18%, var(--bg-dim)); color: var(--text-strong); }
.obj-board-body { flex: 1; overflow-y: auto; padding: 6px 18px 18px; }
.obj-group-h { margin: 14px 0 8px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.obj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.obj-empty { padding: 40px 0; text-align: center; color: var(--text-dim); }
@media (max-width: 720px) {
  .obj-board { width: 100vw; height: 100%; border-radius: 0; border: none; }
  .obj-grid { grid-template-columns: 1fr; }
  .obj-topbtn { font-size: 12px; }
}

/* éditeur d'objectifs (panneau MJ) */
.obj-preview { margin-bottom: 12px; }
.obj-draft {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; padding: 10px 12px;
  border: 1px dashed var(--gold-dim); border-radius: 9px; background: color-mix(in srgb, var(--gold) 7%, transparent); font-size: 13px;
}
.obj-draft > div { flex: 1; min-width: 200px; }
.obj-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.obj-type {
  display: flex; align-items: center; gap: 7px; padding: 7px 9px; text-align: left; font-size: 12.5px;
  border: 1px solid var(--border-dim); border-radius: 8px; background: var(--bg-dim); color: var(--text);
}
.obj-type .i { font-size: 16px; }
.obj-type.active { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--bg-dim)); color: var(--text-strong); box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 25%, transparent); }
.obj-help { margin-top: 6px; }
.obj-quick { gap: 5px; }
.obj-range { display: flex; align-items: center; gap: 10px; }
.obj-range input { flex: 1; }
.obj-range-v { min-width: 48px; text-align: right; }
.obj-kills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.obj-kills b { margin-right: 6px; font-size: 15px; color: var(--text-strong); }
.obj-charst { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.obj-charst select { width: auto; }
.obj-ed-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.obj-card.click { cursor: pointer; }
.obj-card.click:hover { filter: brightness(1.12); }
/* état d'un personnage (fiche publique) */
.char-state { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--border-dim); color: var(--text-dim); }
.char-state.mort { color: #ff8a8a; border-color: #7a2a2a; }
.char-state.capture { color: var(--warning); border-color: #7a5520; }

/* panneau Campagnes & objectifs (vue publique, en haut à droite) : le
   pendant du panneau Factions, replié vers la droite */
.hud.hud-right { left: auto; right: 14px; width: 280px; min-width: 0; max-height: calc(100% - 150px); display: flex; flex-direction: column; }
.stage .hud.hud-right.collapsed { transform: translateX(calc(100% + 14px)); }
.hud.hud-right .hud-tab { left: auto; right: 100%; margin: 0 1px 0 0; border-radius: 9px 0 0 9px; border-left: 1px solid var(--border-dim); border-right: none; }
.trk-body { overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.trk-h { margin: 6px 0 5px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.trk-h:first-child { margin-top: 0; }
.trk-none { font-size: 12px; color: var(--text-faint); padding: 2px 0 6px; }
.trk-row {
  --tc: var(--accent);
  display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 5px; padding: 6px 8px; text-align: left;
  background: color-mix(in srgb, var(--tc) 9%, var(--bg-dim)); border: 1px solid color-mix(in srgb, var(--tc) 40%, var(--border-dim));
  border-radius: 8px; color: var(--text);
}
.trk-row:hover { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 16%, var(--bg-dim)); }
.trk-row.main { border-color: color-mix(in srgb, var(--gold) 70%, var(--tc)); }
.trk-sw { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 2px; background: var(--tc); box-shadow: 0 0 8px var(--tc); transform: rotate(45deg); }
.trk-ico { flex: 0 0 auto; font-size: 15px; }
.trk-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.trk-t .nm { font-size: 13px; font-weight: 700; color: var(--text-strong); overflow-wrap: anywhere; line-height: 1.2; }
.trk-t .sub { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk-bar { display: block; height: 4px; margin-top: 3px; border-radius: 2px; background: var(--panel-alt2); overflow: hidden; }
.trk-bar i { display: block; height: 100%; background: var(--tc); box-shadow: 0 0 6px var(--tc); }
.trk-time { flex: 0 0 auto; font-size: 11.5px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.trk-time.soon { color: var(--warning); }
.trk-time.urgent { color: #ff7a6b; animation: obj-blink 1.2s ease-in-out infinite; }
.trk-all { width: 100%; margin-top: 4px; font-size: 12px; }
@media (max-width: 720px) { .hud.hud-right { width: 240px; } }

/* donneur d'ordre d'un objectif */
.obj-giver { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: var(--text-dim); }
.obj-giver img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1px solid var(--oc); }
.obj-giver b { color: var(--text); }
.obj-giver .t { color: var(--text-faint); }
.obj-giver .t::before { content: '· '; }
.trk-time.free { color: var(--text-faint); font-weight: 600; }
.obj-color { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-file-l { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text); }
