* { box-sizing: border-box; }

:root {
  --bg:        #08101c;
  --panel:     #101a2c;
  --panel-2:   #0c1526;
  --line:      #243554;
  --line-soft: #2b4066;
  --text:      #ebf3ff;
  --muted:     #9eb0d2;
  --accent:    #6dd6ff;
  --accent-2:  #44bff2;
  --ok:        #65d7a7;
  --warn:      #ffb347;
  --err:       #ff8b8b;
  --shadow:    0 14px 30px rgba(0,0,0,0.28);
  --navbar-h:  56px;
}

/* ── Reset ── */
body   { margin:0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
h1,h2,h3,p { margin-top:0; }
input,select,textarea,button { font:inherit; }
code { background:rgba(255,255,255,.08); padding:2px 6px; border-radius:6px; font-size:12px; }

/* ── Crédit auteur ── */
.author-credit {
  position: absolute;
  bottom: calc(var(--bottom-bar-h) + 6px);
  right: 10px;
  font-size: 10px;
  color: rgba(255,255,255,.2);
  pointer-events: none;
  z-index: 50;
  letter-spacing: .3px;
}
.author-credit strong { color: rgba(109,214,255,.35); }

/* ── Toast compte ── */
.account-toast {
  position: fixed;
  bottom: calc(var(--bottom-bar-h) + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,18,32,0.97);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  max-width: calc(100vw - 32px);
  animation: slideUp .3s ease;
}
.account-toast-text { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text); }
.account-toast-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity:0; }
  to   { transform: translateX(-50%) translateY(0);    opacity:1; }
}

/* ── Bannière WIP ── */
.wip-banner {
  position: fixed;
  top: var(--navbar-h);
  left: 0; right: 0;
  z-index: 99;
  background: linear-gradient(90deg, #2a1a00, #3a2200);
  border-bottom: 1px solid #6b4c00;
  color: #ffe580;
  font-size: 13px;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.wip-close {
  background: none; border: none; color: #ffe580;
  cursor: pointer; font-size: 16px; padding: 0; line-height: 1; margin-left: auto;
}
.wip-close:hover { color: #fff; }

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: rgba(10,18,32,0.97);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.navbar-brand  { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.navbar-logo   { font-size:22px; }
.navbar-title  { font-size:16px; font-weight:bold; color:var(--accent); white-space:nowrap; }
.navbar-center { flex:1; max-width:460px; }
.navbar-search { width:100%; }
.navbar-auth   { display:flex; align-items:center; gap:10px; margin-left:auto; flex-shrink:0; }
.navbar-user   { font-size:13px; color:var(--muted); }
.navbar-user strong { color:var(--text); }

/* ── App layout (plein écran) ── */
:root { --bottom-bar-h: 64px; }

.app {
  position: relative;
  height: calc(100vh - var(--navbar-h));
  margin-top: var(--navbar-h);
  overflow: hidden;
}

/* ── Hint overlay ── */
.map-hint-overlay {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(8,16,28,.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 12px; color: var(--muted);
  pointer-events: none; white-space: nowrap;
  backdrop-filter: blur(6px);
}

/* ── Floating panels ── */
.float-panel {
  position: absolute;
  top: 12px;
  width: 340px;
  max-height: calc(100% - var(--bottom-bar-h) - 24px);
  background: rgba(12,20,34,0.97);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  z-index: 50;
  backdrop-filter: blur(10px);
}
.float-left  { left: 12px; }
.float-right { right: 12px; }

.float-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.float-panel-title { font-size: 14px; font-weight: bold; color: var(--accent); }
.float-panel-body  { overflow-y: auto; padding: 14px; flex: 1; min-height: 0; }
.panel-section     { min-height: 0; }

/* ── Bottom tab bar ── */
.bottom-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-bar-h);
  background: rgba(8,14,24,0.97);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 4px;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.bottom-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; padding: 8px 24px; border-radius: 12px;
  transition: background .15s, color .15s;
}
.bottom-tab:hover  { background: rgba(109,214,255,.08); color: var(--text); }
.bottom-tab.active { background: rgba(109,214,255,.14); color: var(--accent); }
.tab-icon  { font-size: 18px; line-height: 1; }
.tab-label { font-size: 11px; font-weight: bold; letter-spacing: .3px; }
.tab-start-badge {
  position: absolute;
  top: -10px;
  background: var(--accent);
  color: #071016;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  animation: pulse-badge 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(109,214,255,.5); }
  50%       { box-shadow: 0 0 0 6px rgba(109,214,255,0); }
}
#tabMyShip { position: relative; padding-top: 16px; }

/* ── Modal Bienvenue ── */
.welcome-modal {
  max-width: 460px;
  text-align: center;
  padding: 32px 28px 24px;
}
.welcome-header { margin-bottom: 24px; }
.welcome-logo   { font-size: 40px; display: block; margin-bottom: 10px; }
.welcome-title  { font-size: 20px; font-weight: bold; color: var(--accent); margin: 0 0 6px; }
.welcome-sub    { font-size: 13px; color: var(--muted); margin: 0; }
.welcome-steps  { display: grid; gap: 16px; margin-bottom: 24px; text-align: left; }
.welcome-step   {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 14px;
}
.welcome-step-icon  { font-size: 26px; flex-shrink: 0; line-height: 1; }
.welcome-step-title { font-size: 14px; font-weight: bold; color: var(--text); margin-bottom: 4px; }
.welcome-step-desc  { font-size: 12px; color: var(--muted); line-height: 1.5; }
.welcome-btn { width: 100%; padding: 13px; font-size: 15px; }

/* ── Utilities ── */
.stack     { display:grid; gap:12px; }
.row       { display:flex; gap:10px; align-items:center; }
.row.wrap  { flex-wrap:wrap; }
.two-cols  { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.space-between { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.subtitle,.small { color:var(--muted); line-height:1.5; }
.small     { font-size:13px; }
.muted     { color:var(--muted); }
.hidden    { display:none !important; }
.hr        { height:1px; background:#20304f; margin:6px 0; }

/* ── Fields ── */
label { display:block; font-size:13px; color:var(--muted); margin-bottom:5px; }
.pw-wrap { position:relative; display:flex; align-items:center; }
.pw-wrap .field { flex:1; padding-right:38px; }
.pw-eye {
  position:absolute; right:10px; background:none; border:none;
  cursor:pointer; font-size:15px; color:var(--muted); padding:0; line-height:1;
  transition:color .15s;
}
.pw-eye:hover { color:var(--text); }
.field,.select,.textarea {
  width:100%; background:var(--panel-2); border:1px solid var(--line-soft);
  color:var(--text); border-radius:10px; padding:10px 12px; outline:none;
}
.field:focus,.select:focus,.textarea:focus {
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(109,214,255,.12);
}
.textarea { min-height:160px; resize:vertical; font-family:Consolas,monospace; font-size:12px; }

/* ── Buttons ── */
.btn {
  background:var(--accent-2); color:#07111f; border:none; border-radius:10px;
  padding:10px 14px; cursor:pointer; font-weight:bold;
  transition:transform .12s, opacity .12s;
}
.btn:hover { opacity:.9; transform:translateY(-1px); }
.btn.secondary { background:#1b2944; color:var(--text); border:1px solid var(--line-soft); }
.btn.ghost     { background:transparent; color:var(--muted); border:1px solid var(--line-soft); }
.btn.danger    { background:#5c1a1a; color:#ffd2d2; border:1px solid rgba(255,139,139,.4); }
.btn.danger:hover { background:#7a2020; }
.btn.success   { background:#1a4a32; color:#c8ffe5; border:1px solid rgba(101,215,167,.4); }
.btn:disabled  { opacity:.4; cursor:not-allowed; transform:none; }
.small-btn     { padding:4px 8px; font-size:12px; border-radius:7px; }
.btn-close     {
  background:transparent; border:none; color:var(--muted); font-size:18px;
  cursor:pointer; padding:4px 8px; border-radius:6px;
}
.btn-close:hover { color:var(--text); background:rgba(255,255,255,.08); }

/* ── Cards ── */
.card {
  background:var(--panel-2); border:1px solid var(--line-soft);
  border-radius:12px; padding:14px;
}

/* ── Tags / Status ── */
.tag {
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 9px; border-radius:999px;
  background:#15243d; border:1px solid #28406a; font-size:12px;
}
.status {
  font-size:12px; padding:5px 9px; border-radius:999px;
  border:1px solid var(--line-soft); color:var(--muted); background:#122035; white-space:nowrap;
}
.status.ok   { color:#d6ffe9; border-color:rgba(101,215,167,.4); }
.status.warn { color:#ffe1c4; border-color:rgba(255,179,71,.4); }
.status.err  { color:#ffd2d2; border-color:rgba(255,139,139,.4); }
.legend-dot  { width:10px; height:10px; border-radius:999px; display:inline-block; }
.badge       { font-size:11px; padding:2px 7px; border-radius:999px; font-weight:normal; }
.badge.green { background:rgba(101,215,167,.18); color:#c8ffe5; }
.badge.red   { background:rgba(255,107,138,.18); color:#ffd2d2; }

/* ── Map ── */
.map-viewport {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: var(--bottom-bar-h);
  background: #09111d; cursor: grab; overflow: hidden;
}
.map-viewport.dragging { cursor:grabbing; }
.map-stage {
  position:absolute; left:0; top:0;
  transform-origin:top left; will-change:transform;
}
.map {
  position:relative; width:1863px; height:1551px;
  background:
    radial-gradient(circle at 20% 28%, rgba(255,255,255,.08), transparent 17%),
    radial-gradient(circle at 74% 42%, rgba(255,255,255,.06), transparent 18%),
    linear-gradient(180deg,#173653,#10253a 40%,#0d1c2d 100%);
  background-size:cover; background-position:center; background-repeat:no-repeat;
}
.map.has-image { background-size:cover; background-position:center; background-repeat:no-repeat; }
.map.route-mode { cursor:crosshair; }
.map-overlay {
  position:absolute; inset:0; pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.04) 1px,transparent 1px);
  background-size:52px 52px;
}
.map-shade {
  position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(180deg,rgba(5,10,18,.06),rgba(5,10,18,.16));
}

/* ── Zone PVP ── */
.pvp-zone {
  position: absolute;
  border-radius: 50%;
  border: 3px dashed rgba(255, 80, 80, 0.75);
  background: rgba(200, 40, 40, 0.08);
  pointer-events: none;
  z-index: 2;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 60px rgba(255, 50, 50, 0.12), inset 0 0 80px rgba(255, 50, 50, 0.06);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.pvp-zone-icon  { font-size: 52px; opacity: 0.35; user-select: none; line-height: 1; }
.pvp-zone-label {
  font-size: 13px; font-weight: bold; letter-spacing: 3px; text-transform: uppercase;
  color: rgba(255, 140, 140, 0.6); user-select: none;
}

/* ── Ports ── */
.port {
  position:absolute; transform:translate(-50%,-50%);
  cursor:pointer; text-align:center; z-index:3;
}
/* .port-inner scale inversely to the map → labels always same visual size */
.port-inner {
  display:inline-flex; flex-direction:column; align-items:center;
  transform: scale(var(--inv-scale, 1));
  transform-origin: center top;
}
.port-dot {
  width:14px; height:14px; border-radius:50%; margin:0 auto;
  border:2.5px solid rgba(255,255,255,.95);
  box-shadow:0 0 0 4px rgba(255,255,255,.12), 0 2px 8px rgba(0,0,0,.6);
  transition:transform .15s;
}
.port:hover .port-inner .port-dot, .port.active .port-inner .port-dot,
.port.route-stop .port-inner .port-dot { transform:scale(1.35); }
.port.route-stop .port-inner .port-dot { box-shadow:0 0 0 6px rgba(109,214,255,.35); }
.port-label {
  margin-top:5px; display:inline-block; padding:4px 9px;
  background:rgba(5,9,18,.92);
  border:1px solid rgba(255,255,255,.15);
  border-radius:6px;
  font-family:'Cinzel', 'Palatino Linotype', Georgia, serif;
  font-size:13px; font-weight:600;
  white-space:nowrap; color:#e8f0ff;
  text-shadow:0 1px 4px rgba(0,0,0,.9);
  letter-spacing:.4px;
  box-shadow:0 2px 8px rgba(0,0,0,.5);
}
.port:hover .port-inner .port-label      { color:#fff; border-color:rgba(109,214,255,.7); background:rgba(10,20,40,.97); }
.port.active .port-inner .port-label     { color:var(--accent); border-color:var(--accent); background:rgba(10,20,40,.97); }
.port.route-stop .port-inner .port-label { color:#ffb347; border-color:rgba(255,179,71,.7); }

/* ── Zone / class lock ── */
.port.locked { opacity: 0.28; filter: grayscale(0.9); pointer-events: none; }

/* ── Route lines ── */
.route-line {
  position:absolute; height:2px; transform-origin:left center;
  pointer-events:none; z-index:1; opacity:.8; border-radius:999px;
}
.route-line.highlight { height:3px; opacity:1; box-shadow:0 0 14px rgba(109,214,255,.35); }

/* ── Tooltip ── */
.port-tooltip {
  position:absolute; z-index:10;
  background:rgba(8,16,28,.97); border:1px solid var(--accent);
  border-radius:12px; padding:11px 14px; font-size:13px; color:var(--text);
  pointer-events:none;
  box-shadow:0 4px 24px rgba(0,0,0,.6);
  display:flex; flex-direction:column; gap:7px;
  min-width:200px; max-width:280px;
}
.tooltip-nation  { font-size:11px; color:var(--muted); }
.tooltip-section { display:flex; flex-direction:column; gap:4px; }
.tooltip-label   { display:inline-block; padding:2px 7px; border-radius:5px; font-size:11px; font-weight:bold; margin-bottom:2px; }
.tooltip-label.buy  { background:rgba(109,214,255,.15); color:#d7f6ff; }
.tooltip-label.sell { background:rgba(101,215,167,.15); color:#c8ffe5; }
.tooltip-items  { display:flex; flex-wrap:wrap; gap:4px; }
.tooltip-res    { font-size:12px; color:var(--muted); background:rgba(255,255,255,.05); border:1px solid var(--line); border-radius:6px; padding:3px 8px; white-space:nowrap; }
.tooltip-res strong { color:var(--text); }
.tooltip-best   { border-color:rgba(255,215,0,.5); color:#ffe87a; }
.tooltip-best strong { color:#ffd700; }

/* ── Ports list ── */
.ports-card    { flex-shrink:0; }
.ports-header  { align-items:flex-start; }
.ports-list    { display:flex; flex-wrap:wrap; gap:6px; max-height:120px; overflow-y:auto; }
.ports-list button {
  background:#17263f; color:var(--text); border:1px solid var(--line-soft);
  border-radius:10px; padding:7px 11px; cursor:pointer; font-size:13px;
  transition:border-color .12s, color .12s;
}
.ports-list button.active, .ports-list button:hover { border-color:var(--accent); color:var(--accent); }

/* ── Resources ── */
.resource-list { display:flex; flex-wrap:wrap; gap:7px; }
.resource {
  background:#17263f; border:1px solid #2a4169;
  border-radius:999px; padding:6px 11px; font-size:12px;
}
.resource.buy       { border-color:rgba(101,215,167,.5); color:#c8ffe5; }
.resource.sell      { border-color:rgba(109,214,255,.4); color:#d7f6ff; }
.resource.best-price { border-color:#ffd700; box-shadow:0 0 6px rgba(255,215,0,.3); }

/* ── Route planner ── */
.planner-hint {
  background: rgba(109,214,255,.06);
  border: 1px solid rgba(109,214,255,.2);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.planner-hint-row { font-size: 12px; color: var(--muted); line-height: 1.4; }
.planner-hint-row.warn { color: #ffe580; }
.route-stops-list { display:flex; flex-direction:column; gap:8px; }
.route-stop-item {
  background:#0d1a2d; border:1px solid var(--line-soft);
  border-radius:10px; padding:10px;
  display:grid; grid-template-columns:1fr auto; gap:8px; align-items:start;
}
.route-stop-port { font-size:13px; font-weight:bold; color:var(--accent); margin-bottom:6px; display:flex; align-items:center; gap:6px; }
.stop-num {
  display:inline-flex; align-items:center; justify-content:center;
  width:18px; height:18px; border-radius:50%; flex-shrink:0;
  background:var(--accent); color:#07111f; font-size:11px; font-weight:bold;
}
.route-stop-selects { display:flex; gap:6px; flex-wrap:wrap; }
.route-stop-selects .select { padding:6px 8px; font-size:12px; border-radius:8px; }

/* ── Cargo tracker ── */
.cargo-tracker {
  background:#0a1628; border:1px solid var(--line-soft);
  border-radius:10px; padding:10px 12px;
  display:flex; flex-direction:column; gap:6px;
}
.cargo-tracker.cargo-overloaded { border-color:rgba(255,139,139,.5); }
.cargo-tracker-label { display:flex; justify-content:space-between; align-items:center; font-size:12px; color:var(--muted); }
.cargo-tracker-bar {
  height:10px; border-radius:999px; background:#1a2d47;
  display:flex; overflow:hidden;
}
.cargo-seg { height:100%; transition:width .2s; }
.cargo-bar-empty { height:100%; background:transparent; }

/* ── Quantité par étape ── */
.stop-cargo-row { margin-top:8px; display:flex; flex-direction:column; gap:6px; }
.fill-checkbox-label {
  display:flex; align-items:center; gap:7px; cursor:pointer;
  font-size:12px; color:var(--muted); margin:0;
}
.fill-checkbox-label input[type="checkbox"] { width:14px; height:14px; cursor:pointer; accent-color:var(--accent); }
.qty-row { display:flex; align-items:center; gap:8px; }
.qty-row .field { padding:5px 8px; font-size:12px; border-radius:8px; width:90px; }
.qty-info {
  font-size:11px; color:var(--muted); padding:3px 8px;
  border:1px solid var(--line-soft); border-radius:6px; white-space:nowrap;
  border-left-width:3px;
}
.qty-info strong { color:var(--text); }
.route-results {
  background:#0d1a2d; border:1px solid var(--line-soft);
  border-radius:10px; padding:14px;
}
.result-row { display:flex; justify-content:space-between; align-items:center; padding:6px 0; }
.result-row + .result-row { border-top:1px solid var(--line); }
.result-label { font-size:13px; color:var(--muted); }
.result-value { font-size:15px; font-weight:bold; color:var(--accent); }
.result-value.gold  { color:#ffb347; }
.result-value.time  { color:#6dd6ff; }

/* ── Modals ── */
.modal-overlay {
  position:fixed; inset:0; z-index:200;
  background:rgba(4,9,17,.8); backdrop-filter:blur(4px);
  display:flex; align-items:center; justify-content:center;
}
.modal {
  background:var(--panel); border:1px solid var(--line-soft);
  border-radius:18px; width:100%; max-width:420px;
  box-shadow:0 24px 60px rgba(0,0,0,.6);
  overflow:hidden;
}
.modal-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:16px 20px; border-bottom:1px solid var(--line);
}
.modal-body { padding:20px; display:grid; gap:14px; }
.tab-btn {
  background:transparent; border:none; color:var(--muted);
  font-size:14px; padding:6px 14px; cursor:pointer; border-radius:8px;
  font-weight:bold;
}
.tab-btn.active { color:var(--accent); background:rgba(109,214,255,.1); }
.error-msg {
  background:rgba(255,139,139,.12); border:1px solid rgba(255,139,139,.3);
  color:#ffd2d2; border-radius:8px; padding:10px 12px; font-size:13px;
}
.success-msg {
  background:rgba(200,255,229,.1); border:1px solid rgba(200,255,229,.3);
  color:#c8ffe5; border-radius:8px; padding:10px 12px; font-size:13px;
}

/* ── Share code ── */
.share-code {
  background:#0d1a2d; border:2px solid var(--accent);
  border-radius:12px; padding:18px;
  text-align:center; font-size:32px; font-weight:bold;
  letter-spacing:.3em; color:var(--accent);
  font-family: Consolas, monospace;
}

/* ── Navbar auth dropdown ── */
.user-menu    { position:relative; }
.user-menu-btn {
  background:var(--panel-2); border:1px solid var(--line-soft);
  color:var(--text); border-radius:10px; padding:8px 14px;
  cursor:pointer; font-size:13px; display:flex; align-items:center; gap:8px;
}
.user-dropdown {
  position:absolute; right:0; top:calc(100% + 6px);
  background:var(--panel); border:1px solid var(--line-soft);
  border-radius:12px; padding:8px; min-width:180px;
  box-shadow:var(--shadow); z-index:300;
}
.user-dropdown a, .user-dropdown button {
  display:block; width:100%; text-align:left;
  background:transparent; border:none; color:var(--text);
  padding:9px 12px; border-radius:8px; cursor:pointer;
  font-size:13px; text-decoration:none;
}
.user-dropdown a:hover, .user-dropdown button:hover {
  background:rgba(109,214,255,.08); color:var(--accent);
}
.user-dropdown .divider { height:1px; background:var(--line); margin:6px 0; }

/* ── Ship settings card ── */
.ship-settings-card { background: rgba(10,22,40,.85); border-color: var(--accent); }
.ship-settings-title {
  font-size: 13px; font-weight: bold; color: var(--accent);
  letter-spacing: .3px;
}

/* ── Zone badges on route items ── */
.zone-req-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: bold; padding: 1px 6px;
  border-radius: 999px; border: 1px solid rgba(109,214,255,.4);
  background: rgba(109,214,255,.08); color: var(--accent);
  vertical-align: middle; margin-left: 4px;
}
.zone-req-badge.zone-warn {
  border-color: rgba(255,179,71,.5); background: rgba(255,179,71,.1);
  color: var(--warn);
}

/* ── Top routes ── */
.top-route-item {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 8px; background: #0d1a2d;
  border: 1px solid var(--line-soft); border-radius: 9px;
}
.top-route-rank {
  font-size: 11px; font-weight: bold; color: var(--muted);
  min-width: 16px; text-align: center; flex-shrink: 0;
}
.top-route-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.top-route-resource { font-size: 12px; font-weight: bold; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-route-ports {
  font-size: 11px; display: flex; align-items: center; gap: 3px;
  flex-wrap: wrap; color: var(--muted);
}
.top-route-ports .buy-tag  { color: #c8ffe5; }
.top-route-ports .sell-tag { color: #d7f6ff; }
.top-route-profit { font-size: 11px; color: var(--warn); }
.nearby-header  { padding: 4px 2px; }
.nearby-port-block { display: flex; flex-direction: column; gap: 3px; }
.nearby-port-name {
  font-size: 12px; font-weight: bold; color: var(--accent);
  display: flex; align-items: center; gap: 6px; padding: 2px 4px;
}
.nearby-dist {
  font-size: 11px; font-weight: normal; color: var(--muted);
  background: #0d1a2d; border: 1px solid var(--line-soft);
  border-radius: 999px; padding: 1px 7px;
}

/* ── Saved routes ── */
.saved-route-item {
  background:#0d1a2d; border:1px solid var(--line-soft);
  border-radius:10px; padding:10px 12px;
  display:flex; justify-content:space-between; align-items:center; gap:8px;
}
.route-name-input {
  font-size:13px; font-weight:bold; padding:3px 6px;
  background:transparent; border:1px solid transparent;
  border-radius:6px; color:var(--text); width:100%; margin-bottom:2px;
}
.route-name-input:hover { border-color:var(--line-soft); background:rgba(255,255,255,.04); }
.route-name-input:focus { border-color:var(--accent); background:rgba(109,214,255,.06); outline:none; }
.saved-route-meta { font-size:12px; color:var(--muted); padding:0 6px; }

/* ── Resources tab ── */
.float-left.panel-wide {
  width: min(620px, calc(100vw - 24px));
}
#resourceSearchInput {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
}

.res-margin {
  font-size: 11px; font-weight: bold; padding: 2px 9px;
  border-radius: 999px; white-space: nowrap;
}
.res-margin.pos { background: rgba(101,215,167,.12); color: #c8ffe5; border: 1px solid rgba(101,215,167,.3); }
.res-margin.neg { background: rgba(255,139,139,.1);  color: #ffd2d2; border: 1px solid rgba(255,139,139,.25); }

.res-card {
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 12px; overflow: hidden;
}
.res-card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.res-card-name   { font-size: 14px; font-weight: bold; color: var(--text); flex: 1; }
.res-card-weight { font-size: 12px; color: var(--muted); flex-shrink: 0; }

.res-card-cols {
  display: grid; grid-template-columns: 1fr 1fr;
}
.res-card-col {
  display: flex; flex-direction: column;
}
.res-card-col + .res-card-col {
  border-left: 1px solid var(--line);
}
.res-col-title {
  font-size: 11px; font-weight: bold; padding: 6px 12px;
  border-bottom: 1px solid var(--line); letter-spacing: .3px;
}
.res-col-title.buy  { color: #9dd8ff; background: rgba(109,214,255,.05); }
.res-col-title.sell { color: #9ee8c4; background: rgba(101,215,167,.05); }

.res-col-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; cursor: pointer;
  border-bottom: 1px solid rgba(36,53,84,.4);
  transition: background .1s;
}
.res-col-item:last-child   { border-bottom: none; }
.res-col-item:hover        { background: rgba(109,214,255,.06); }
.res-col-item.best         { background: rgba(109,214,255,.05); }
.res-col-item.sell.best    { background: rgba(101,215,167,.05); }
.res-col-port  { font-size: 12px; color: var(--text); }
.res-col-price { font-size: 12px; font-weight: bold; color: var(--muted); flex-shrink: 0; margin-left: 8px; }
.res-col-item.best      .res-col-price { color: #9dd8ff; }
.res-col-item.sell.best .res-col-price { color: #9ee8c4; }
.res-col-empty { padding: 8px 12px; font-size: 12px; color: var(--muted); font-style: italic; }

/* ── Community routes ── */
.community-route-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: var(--panel-2);
  border: 1px solid var(--line-soft); border-radius: 12px;
}
.community-rank {
  font-size: 16px; font-weight: bold; color: var(--accent);
  min-width: 28px; text-align: center; padding-top: 2px;
}
.community-route-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.community-route-meta { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .float-panel { width: calc(100vw - 24px); }
  .bottom-tab  { padding: 8px 14px; }
}
