/* Thème Adastra : le blanc glacé des trois étoiles du logo sur un noir d'espace, avec le bleu froid des interfaces EVE. */
:root {
  --bg: #04070c;
  --panel: #0a1018;
  --panel-2: #101a27;
  --line: #1b2a3c;
  --line-strong: #2a4058;
  --text: #e8eef6;
  --muted: #7f91a7;
  --accent: #6fd0ff;
  --accent-2: #b9e6ff;
  --accent-ink: #03202e;
  --warn: #ffb347;
  --bad: #ff5d5d;
  --good: #4fe3a1;
  --radius: 2px;
  --sidebar: 244px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 8%, rgba(255,255,255,.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 44% 63%, rgba(255,255,255,.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 72%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 88%, rgba(255,255,255,.3) 50%, transparent 51%),
    radial-gradient(900px 500px at 8% -10%, rgba(111,208,255,.09), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.3rem; margin: 0 0 .35rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; font-weight: 600; letter-spacing: .04em; }
h3 { font-size: .95rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: .7rem; color: var(--muted); margin: 0 0 .5rem; }

/* --- Structure : barre latérale à gauche, contenu à droite -------------------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.app.solo { grid-template-columns: minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: .5rem;
  padding: 1rem .8rem; background: rgba(10,16,24,.92); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .7rem; padding: .2rem .4rem 1rem; color: var(--text); border-bottom: 1px solid var(--line); margin-bottom: .4rem; }
.brand:hover { text-decoration: none; }
.brand .star { width: 22px; height: 44px; color: var(--accent-2); filter: drop-shadow(0 0 6px rgba(111,208,255,.55)); flex: none; }
.brand b { display: block; letter-spacing: .14em; text-transform: uppercase; font-size: .95rem; }
.brand span { display: block; color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: .15rem; }
.sidebar nav a {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem; color: var(--muted);
  border-radius: var(--radius); border-left: 2px solid transparent;
}
.sidebar nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.sidebar nav a.active { color: var(--accent-2); background: linear-gradient(90deg, rgba(111,208,255,.14), transparent); border-left-color: var(--accent); }
.sidebar .nav-label { margin: 1rem .7rem .2rem; }
.who { margin-top: 0; display: flex; align-items: center; gap: .6rem; padding: .7rem .5rem 0; border-top: 1px solid var(--line); }
.who img { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); }
.icon-only { display: none; }
.who a { color: var(--text); font-weight: 500; display: block; line-height: 1.2; word-break: break-word; }
.who form { margin: .4rem 0 0; }
#menu-toggle { display: none; }

main { padding: 1.5rem 1.75rem 4rem; min-width: 0; }
main.narrow { max-width: 1080px; width: 100%; margin: 0 auto; }
.solo main { max-width: 1080px; width: 100%; margin: 0 auto; }

/* Deux colonnes : réglages (1/3) à gauche, résultats (2/3) à droite */
.split { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 1.25rem; align-items: start; }
.split > .filters { position: sticky; z-index: 20; top: 1rem; max-height: calc(100vh - 2rem); overflow-x: hidden; overflow-y: auto; margin-bottom: 0; }
.split > .filters::-webkit-scrollbar { width: 6px; }
.split > .filters::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.empty-state { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: linear-gradient(180deg, rgba(16,26,39,.55), rgba(10,16,24,.9)); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; margin-bottom: 1rem; position: relative;
}
.card::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 2px; background: var(--accent); opacity: .55; border-radius: 2px; }
.card::after, .run::after {
  content: ""; position: absolute; right: -1px; top: -1px; width: 14px; height: 14px; pointer-events: none;
  border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); opacity: .8;
}
.run { position: relative; }
.grid .card { margin-bottom: 0; }
.stat { font-size: 1.7rem; font-weight: 600; color: var(--accent-2); line-height: 1.2; }

.btn, button {
  display: inline-block; cursor: pointer; border: 1px solid var(--line-strong); background: var(--panel-2);
  color: var(--text); padding: .5rem .95rem; border-radius: var(--radius); font: inherit;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.btn:hover, button:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary, button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover, button.primary:hover { background: var(--accent-2); }
button:disabled { opacity: .55; cursor: progress; }
.btn.danger, button.danger { color: var(--bad); }
.btn.small, button.small { padding: .25rem .6rem; font-size: .85rem; }
button, .btn { white-space: nowrap; }
.run .actions button { white-space: normal; text-align: left; }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.block, button.block { display: block; width: 100%; text-align: center; }

form.stack, div.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
form.stack > *, .row > label, .field { min-width: 0; }
label { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; color: var(--muted); font-size: .88rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }
.row > label { flex: 1; min-width: 130px; }
input[type=text], input[type=number], input[type=search], select, textarea {
  width: 100%; min-width: 0; max-width: 100%; text-overflow: ellipsis; background: #060a10; color: var(--text); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: .55rem .7rem; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { min-height: 160px; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
label.check { display: flex; align-items: center; gap: .5rem; color: var(--text); }
label.check input { width: auto; accent-color: var(--accent); }
.field-head { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .88rem; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
tbody tr:hover { background: rgba(111,208,255,.04); }

.alert { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.alert.error { border-color: var(--bad); background: #2a1216; }
.alert.ok { border-color: var(--good); background: #0f241b; }
.alert.warn { border-color: var(--warn); background: #2a2010; }
.alert.info { border-color: var(--line); background: var(--panel); color: var(--muted); font-size: .88rem; }
.badge { padding: .1rem .5rem; border-radius: 99px; font-size: .78rem; border: 1px solid var(--line-strong); }
.badge.pending { color: var(--warn); border-color: var(--warn); }
.badge.approved, .badge.low { color: var(--good); border-color: var(--good); }
.badge.rejected, .badge.high { color: var(--bad); border-color: var(--bad); }
.badge.medium { color: var(--warn); border-color: var(--warn); }

.run { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; background: var(--panel); }
.run > header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.run .route { font-weight: 600; }
.run .kpis { display: flex; gap: 1.5rem; flex-wrap: wrap; padding: .8rem 1.1rem; }
.run ol.stops { margin: 0; padding: .2rem 1.1rem .8rem 2.6rem; font-size: .9rem; }
.run ol.stops li { margin: .15rem 0; }
.kpi b { display: block; font-size: 1.15rem; color: var(--accent-2); }
.kpi span { color: var(--muted); font-size: .8rem; }
.run .actions { display: flex; gap: .5rem; flex-wrap: wrap; padding: .8rem 1.1rem; border-top: 1px solid var(--line); }
.run table, .card table { font-size: .86rem; }
.run table { margin: 0; }
.run th, .run td, .card th, .card td { padding: .4rem .4rem; }
.run th, .card th { font-size: .7rem; }
.card .badge { font-size: .72rem; white-space: nowrap; }
.run .table-wrap { padding: 0 .5rem; }

.hero { text-align: center; max-width: 440px; margin: 4rem auto; }
.hero .star { width: 36px; height: 72px; color: var(--accent-2); filter: drop-shadow(0 0 10px rgba(111,208,255,.6)); margin-bottom: .6rem; }
.hero .stack { margin-top: 1.5rem; }
.pilot { display: flex; gap: 1.2rem; align-items: center; }
.pilot img { width: 96px; height: 96px; border-radius: var(--radius); border: 1px solid var(--line-strong); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.2rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.who-cell { display: flex; align-items: center; gap: .6rem; }
.who-cell img { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); }

#toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 40;
  background: var(--panel-2); border: 1px solid var(--line-strong); padding: .6rem 1.1rem; border-radius: var(--radius);
  display: none; max-width: 90vw;
}
#toast.ok { border-color: var(--good); }
#toast.bad { border-color: var(--bad); }

small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
label small { font-weight: 400; }
td.item { min-width: 9rem; }
td.item img { vertical-align: middle; margin-right: .5rem; border-radius: 3px; }
.run .secline { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .6rem 1.1rem 0; }

.bar { height: 8px; background: #060a10; border: 1px solid var(--line-strong); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .35s ease; }
#progress { margin-bottom: 1rem; }
#progress p { margin: .5rem 0 0; }

details { margin-top: .9rem; }
summary { cursor: pointer; color: var(--accent); }
details h3 { font-size: .95rem; margin: .9rem 0 .3rem; }
table.breakdown td { padding: .2rem .5rem; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.timing { padding: .4rem 1.1rem 0; font-size: .85rem; }
.watch-banner { margin: .6rem 1.1rem 0; padding: .5rem .8rem; border-radius: var(--radius); border: 1px solid var(--warn); background: #2a2010; }
.watch-banner.bad { border-color: var(--bad); background: #2a1216; }
.alerts .badge { margin-left: .4rem; }
.badge.up { color: var(--good); border-color: var(--good); }
.badge.down, .badge.short { color: var(--bad); border-color: var(--bad); }
.badge.warn { color: var(--warn); border-color: var(--warn); }

.route-detail { margin: .6rem 1.1rem 0; }
.path { line-height: 2; }
.sys { padding: .1rem .45rem; border-radius: var(--radius); border: 1px solid var(--line-strong); white-space: nowrap; font-size: .85rem; }
.sys.high { color: var(--good); border-color: #1f5b44; }
.sys.low { color: var(--warn); border-color: var(--warn); }
.sys.null { color: var(--bad); border-color: var(--bad); }

input[type=range] { width: 100%; padding: 0; accent-color: var(--accent); }
.risk-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); gap: .5rem; }
#risk-label, #qty-label { color: var(--text); font-weight: 500; font-size: .88rem; }

.hazards { margin: .6rem 1.1rem 0; display: grid; gap: .35rem; }
.hazard { padding: .45rem .8rem; border-radius: var(--radius); border: 1px solid var(--warn); background: #2a2010; font-size: .9rem; }
.hazard.avoid { border-color: var(--bad); background: #2a1216; }
.sys.risk-avoid { box-shadow: 0 0 0 2px var(--bad); }
.sys.risk-caution { box-shadow: 0 0 0 2px var(--warn); }

.good { color: var(--good); }
.actions-cell { width: 1%; }
.actions-cell form, .actions-cell .btn { display: block; margin: 0 0 .5rem; }
.actions-cell > :last-child { margin-bottom: 0; }
.actions-cell button, .actions-cell .btn { width: 100%; box-sizing: border-box; text-align: center; }
.hazard .info { margin-left: .35rem; }

button.info-btn, .combo .clear { clip-path: none; }

/* --- Bulle d'aide « i » : survol pour lire, clic pour la garder, clic ailleurs pour la fermer --- */
.info { display: inline-flex; vertical-align: middle; }
.info-btn {
  width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent;
  color: var(--muted); font: italic 600 .72rem/1 Georgia, serif; display: inline-grid; place-items: center; cursor: help;
}
.info-btn:hover, .info.open .info-btn { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.info-pop {
  display: none; position: fixed; z-index: 60; width: min(380px, calc(100vw - 24px)); padding: .75rem .9rem;
  background: #0d1621; border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.6);
  color: var(--text); font-size: .85rem; line-height: 1.5; font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0;
}
.info.show .info-pop, .info.open .info-pop { display: block; }
/* Pont invisible au-dessus et en dessous : la souris peut passer du « i » à la bulle sans la fermer */
.info-pop::before, .info-pop::after { content: ""; position: absolute; left: 0; right: 0; height: 14px; }
.info-pop::before { top: -14px; }
.info-pop::after { bottom: -14px; }

/* --- Recherche d'objet avec suggestions --- */
.combo { position: relative; }
.combo input { padding-right: 2rem; }
.combo .clear { position: absolute; right: .35rem; top: .35rem; padding: .05rem .45rem; border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 30; margin: 0; padding: .25rem 0; list-style: none;
  background: #0d1621; border: 1px solid var(--accent); border-radius: var(--radius); max-height: 320px; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.suggest li { padding: .4rem .75rem; cursor: pointer; display: flex; align-items: center; gap: .6rem; color: var(--text); }
.suggest li img { width: 24px; height: 24px; border-radius: 3px; }
.suggest li.active, .suggest li:hover { background: rgba(111,208,255,.14); }
.suggest li mark { background: transparent; color: var(--accent-2); font-weight: 600; }
.suggest li small { margin-left: auto; }
.chosen { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #060a10; }
.chosen img { width: 32px; height: 32px; border-radius: 3px; }

details.drop { border: 1px solid var(--line-strong); border-radius: var(--radius); background: #060a10; }
details.drop summary { cursor: pointer; padding: .4rem .6rem; font-size: .85rem; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
details.drop summary::-webkit-details-marker { display: none; }
details.drop summary::after { content: "▾"; color: var(--muted); }
details.drop[open] summary::after { content: "▴"; }
details.drop ol { margin: 0; padding: .3rem .6rem .6rem 1.9rem; max-height: 38vh; overflow-y: auto; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); clip-path: none; cursor: pointer; font: inherit; }
button.link:hover { text-decoration: underline; border: 0; }
/* --- Écrans moyens : la barre latérale ne garde que les icônes pour laisser la place aux résultats --- */
@media (max-width: 1300px) and (min-width: 801px) {
  :root { --sidebar: 68px; }
  .sidebar { padding: 1rem .5rem; align-items: center; }
  .sidebar .label { display: none; }
  .brand { padding: .2rem 0 1rem; justify-content: center; width: 100%; }
  .sidebar nav { width: 100%; }
  .sidebar nav a { justify-content: center; padding: .7rem 0; border-left-width: 0; border-bottom: 2px solid transparent; }
  .sidebar nav a.active { border-bottom-color: var(--accent); background: rgba(111,208,255,.12); }
  .who { flex-direction: column; padding: .7rem 0 0; width: 100%; justify-content: center; }
  .who > div { display: flex; flex-direction: column; align-items: center; }
  .icon-only { display: inline; }
  main { padding: 1.25rem 1.1rem 4rem; }
}

/* --- Petits écrans : la barre latérale devient un bandeau repliable, les colonnes s'empilent --- */
@media (max-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > .filters { position: static; max-height: none; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .6rem .8rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { border: 0; padding: 0; margin: 0; }
  #menu-toggle { display: inline-block; margin-left: auto; }
  .sidebar nav, .sidebar .nav-label, .sidebar .who { display: none; width: 100%; }
  .sidebar.open nav { display: grid; }
  .sidebar.open .who { display: flex; }
  main { padding: 1rem .9rem 3rem; }
  .pilot { flex-direction: column; align-items: flex-start; }
}
.role-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .45rem; }

/* L'attribut hidden doit toujours cacher : sans cette règle, un style display: grid/flex le rend inopérant (message « Chargement des kills… » resté affiché). */
[hidden] { display: none !important; }
/* Menus déroulants : même aspect partout (carte, trading) */
details.drop { margin-top: .6rem; }
details.drop > :not(summary) { margin-left: .75rem; margin-right: .75rem; }
details.drop > :last-child { margin-bottom: .75rem; }
details.drop > summary + * { margin-top: .5rem; }
details.drop > ol { margin: 0; }
details.drop details.drop { margin-left: 0; margin-right: 0; }
.run > details.drop { margin: .6rem 1.1rem 0; }
.run details.drop .timing { padding: 0; }
.ship-info { margin: 0 0 1rem; }
.ship-info dl.facts { margin-top: .6rem; }

/* Barres de défilement : fines et discrètes */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Bulle de survol générique (data-tip) */
.tip-pop { display: none; position: fixed; z-index: 70; width: min(320px, calc(100vw - 16px)); padding: .65rem .8rem; background: #0d1621; border: 1px solid var(--accent);
  border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.6); color: var(--text); font-size: .82rem; line-height: 1.5; pointer-events: none; }
.tip-pop.show { display: block; }

/* Pages sans défilement (Achat, Trading) : réglages fixes, seule la liste des résultats défile */
.app:has(main.fit-page) { height: 100vh; overflow: hidden; }
main.fit-page { height: 100vh; overflow: hidden; padding: 1rem 1.25rem; display: flex; flex-direction: column; }
main.fit-page > .split { flex: 1 1 auto; min-height: 0; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
main.fit-page .split > .filters { position: static; max-height: none; height: 100%; overflow-y: auto; margin: 0; gap: .5rem; padding: .75rem 1rem; }
main.fit-page .results-col { min-height: 0; overflow-y: auto; padding-right: .35rem; }
@media (max-width: 1000px) {
  .app:has(main.fit-page) { height: auto; overflow: visible; }
  main.fit-page { height: auto; overflow: visible; }
  main.fit-page .split > .filters { height: auto; }
  main.fit-page .results-col { overflow: visible; }
}

/* Bouton plein écran : coins vers l'extérieur pour entrer, vers l'intérieur pour sortir */
.map-full svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; margin: auto; }
.map-full .ico-exit, .map-full.on .ico-enter { display: none; }
.map-full.on .ico-exit { display: block; }

/* --- Mode simple / avancé --- */
.simple-only { display: none; }
html.simple .simple-only { display: block; }
html.simple [data-adv] { display: none !important; }
html:not(.simple) details.risk-split { border: 0; background: none; margin: 0; }
html:not(.simple) details.risk-split > summary { display: none; }
details.risk-split > .field + .field { margin-top: .6rem; }
html:not(.simple) details.risk-split > :not(summary) { margin-left: 0; margin-right: 0; }
#risk-label { display: none; }
.mode-switch { margin-top: auto; display: flex; align-items: center; gap: .6rem; padding: .6rem .5rem; cursor: pointer; color: var(--muted); font-size: .8rem; letter-spacing: .04em; border-top: 1px solid var(--line); }
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-switch .track { width: 34px; height: 18px; border-radius: 99px; background: #0b1119; border: 1px solid var(--line-strong); position: relative; flex: none; transition: background .15s; }
.mode-switch .knob { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.mode-switch input:checked + .track { background: rgba(111,208,255,.25); border-color: var(--accent); }
.mode-switch input:checked + .track .knob { transform: translateX(16px); background: var(--accent); }
.mode-switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Barre latérale repliable --- */
.sidebar { z-index: 30; }
.side-toggle { position: absolute; top: 1.25rem; right: -12px; width: 24px; height: 24px; padding: 0; border-radius: 50%; display: grid; place-items: center; clip-path: none; background: var(--panel-2); z-index: 31; }
.side-toggle svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
html.side-collapsed .side-toggle svg { transform: rotate(180deg); }
@media (min-width: 1301px) {
  html.side-collapsed { --sidebar: 68px; }
  html.side-collapsed .sidebar { padding: 1rem .5rem; align-items: center; }
  html.side-collapsed .sidebar .label { display: none; }
  html.side-collapsed .brand { padding: .2rem 0 1rem; justify-content: center; width: 100%; }
  html.side-collapsed .sidebar nav { width: 100%; }
  html.side-collapsed .sidebar nav a { justify-content: center; padding: .7rem 0; border-left-width: 0; border-bottom: 2px solid transparent; }
  html.side-collapsed .sidebar nav a.active { border-bottom-color: var(--accent); background: rgba(111,208,255,.12); }
  html.side-collapsed .mode-switch { justify-content: center; padding: .6rem 0; width: 100%; }
  html.side-collapsed .who { flex-direction: column; padding: .7rem 0 0; width: 100%; justify-content: center; }
  html.side-collapsed .who > div { display: flex; flex-direction: column; align-items: center; }
  html.side-collapsed .icon-only { display: inline; }
}
@media (max-width: 1300px) { .side-toggle { display: none; } }
@media (max-width: 1300px) and (min-width: 801px) { .mode-switch { justify-content: center; padding: .6rem 0; width: 100%; } .mode-switch .label { display: none; } }
@media (max-width: 800px) { .mode-switch { display: none; } }

/* --- Avertissement téléphone --- */
#mobile-note { display: none; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem .9rem; background: #2a1d08; color: var(--warn);
  border-bottom: 1px solid var(--warn); font-size: .9rem; }
#mobile-note button { background: none; border: 0; color: inherit; font-size: 1.3rem; line-height: 1; padding: 0 .3rem; clip-path: none; }
@media (max-width: 800px), (pointer: coarse) and (max-width: 1100px) { #mobile-note { display: flex; } }
#mobile-note[hidden] { display: none !important; }

/* --- Pages sans défilement : aucune barre de défilement au niveau de la page --- */
html:has(main.fit-page), html:has(main.map-page) { overflow: hidden; height: 100%; }
body:has(main.fit-page), body:has(main.map-page) { overflow: hidden; height: 100%; }
main.fit-page { min-width: 0; }
main.fit-page .results-col { min-width: 0; }
main.fit-page .split > .filters { align-content: start; }

/* Les bulles d'alerte (variation de prix…) passent à la ligne à l'intérieur de leur cadre */
.card .alerts .badge, .alerts .badge { display: inline-block; white-space: normal; border-radius: 12px; line-height: 1.3; padding: .15rem .6rem; max-width: 100%; vertical-align: middle; }
html.simple .secline.simple-only { display: flex; }

/* --- Liste d'objets à chercher (Achat) et alertes --- */
.wanted { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .3rem; }
.wanted[hidden] { display: none; }
.wanted li { display: flex; align-items: center; gap: .5rem; padding: .25rem .5rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.wanted li img { width: 24px; height: 24px; border-radius: 3px; flex: none; }
.wanted .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.wanted .close { margin-left: auto; font-size: 1.1rem; }
/* --- Tutoriels interactifs : écran assombri, seul l'élément à utiliser reste cliquable --- */
.tour-shield { position: fixed; z-index: 9000; background: rgba(2, 5, 9, .74); display: none; }
.tour-ring { position: fixed; z-index: 9001; display: none; pointer-events: none; border: 2px solid var(--accent); border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(111, 208, 255, .25), 0 0 18px rgba(111, 208, 255, .55); animation: tour-pulse 1.6s ease-in-out infinite; }
@keyframes tour-pulse { 50% { box-shadow: 0 0 0 6px rgba(111, 208, 255, .12), 0 0 26px rgba(111, 208, 255, .7); } }
.tour-card { position: fixed; z-index: 9002; display: none; width: min(360px, calc(100vw - 16px)); padding: .9rem 1rem;
  background: var(--panel); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.tour-card p { margin: .4rem 0 .7rem; font-size: .92rem; }
.tour-head { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.tour-head .muted { font-size: .75rem; white-space: nowrap; }
.tour-foot { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.tour-foot label.check { font-size: .8rem; color: var(--muted); }
.tour-foot .primary { margin-left: auto; }
@media (prefers-reduced-motion: reduce) { .tour-ring { animation: none; } }

/* Onglet Commerce : sous-onglets Achat et Vente */
.subtabs { display: flex; gap: .3rem; margin: 0 0 1rem; border-bottom: 1px solid var(--line); }
.subtabs a { padding: .5rem 1.1rem; color: var(--muted); border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; margin-bottom: -1px; }
.subtabs a:hover { color: var(--text); }
.subtabs a.active { color: var(--accent); border-color: var(--line); background: var(--panel); }
/* Onglets Fitting et Compétences : panneau des paramètres, cartes de fit, plan réordonnable */
.badge.good { color: var(--good); border-color: var(--good); }
.badge.bad { color: var(--bad); border-color: var(--bad); }
td.bad { color: var(--bad); }
.bar.small { height: 6px; }
