/* =====================================================================
   EDDB Community Revival - design system
   Dark, dense, data-focused. Modern but unmistakably EDDB.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces - GitHub-ish tiered dark */
  --bg-0: #0b0e13;
  --bg-1: #11151c;
  --bg-2: #161b22;
  --bg-3: #1c222b;
  --bg-4: #232a35;

  /* Borders */
  --border-subtle: #1f2630;
  --border:        #2a323d;
  --border-strong: #3a4453;
  --border-focus:  #ff8800;

  /* Text */
  --text:        #e6edf3;
  --text-muted:  #9ba3ad;
  --text-faint:  #6c757d;
  --text-strong: #ffffff;

  /* Brand - EDDB orange */
  --orange-100: #ffe6c7;
  --orange-300: #ffba66;
  --orange-500: #ff8800;
  --orange-600: #e67700;
  --orange-700: #cc6600;
  --orange-glow: rgba(255, 136, 0, 0.18);

  --accent: var(--orange-500);
  --link: #79b8ff;
  --link-hover: #a3cdff;

  /* Semantic */
  --green:  #3fb950;
  --green-bg: rgba(63, 185, 80, 0.12);
  --red:    #f85149;
  --red-bg: rgba(248, 81, 73, 0.12);
  --yellow: #d29922;
  --blue:   #58a6ff;

  /* Pad colors */
  --pad-l: #3fb950;
  --pad-m: #d29922;
  --pad-s: #f85149;

  /* Spacing scale (4-based) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
  --glow:      0 0 0 1px rgba(255, 136, 0, 0.25), 0 0 24px rgba(255, 136, 0, 0.12);

  /* Transitions */
  --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 180ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Type */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }

html, body {
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

body {
  padding-top: 56px;
  padding-bottom: 60px;
  background:
    radial-gradient(ellipse 1200px 600px at 50% -10%, rgba(255, 136, 0, 0.04), transparent 60%),
    var(--bg-0);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Trade-route clickable card / row */
.route-card-link { display: block; color: inherit; text-decoration: none; }
.route-card-link:hover .loop-card,
.route-card-clickable:hover { border-color: rgba(255, 136, 0, 0.6); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); }
.route-card-clickable { transition: border-color 120ms, box-shadow 120ms; }
tr.route-row:hover { background: rgba(255, 136, 0, 0.06); }

/* Route detail page */
.route-summary { margin-bottom: var(--sp-4); padding: var(--sp-4); }
.route-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-4); }
/* Cells: label anchored to the top, value to the bottom, both horizontally
   centered - keeps the summary tile bündig auch wenn ein Label umbricht. */
.route-summary-grid > div { display: flex; flex-direction: column; gap: 8px; min-height: 56px; justify-content: space-between; align-items: center; text-align: center; }
.route-summary-grid .label { color: var(--text-muted); font: 700 10px/1.3 "JetBrains Mono", monospace; letter-spacing: 1.5px; text-transform: uppercase; }
.route-summary-grid .value { font-size: 22px; font-weight: 700; line-height: 1; margin-top: auto; }

.hop-detail { margin-bottom: var(--sp-4); padding: var(--sp-4); }
.hop-detail h3 { margin-top: 0; margin-bottom: var(--sp-3); font-size: 14px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }
.hop-detail-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--sp-3); align-items: start; }
.hop-side { padding: var(--sp-3); border-radius: var(--r-md); }
.hop-side-buy  { background: rgba(63, 185, 80, 0.06); border: 1px solid rgba(63, 185, 80, 0.25); }
.hop-side-sell { background: rgba(255, 136, 0, 0.06); border: 1px solid rgba(255, 136, 0, 0.25); }
.hop-station-name { font-size: 18px; font-weight: 700; margin-top: 6px; }
.hop-sys { font-size: 13px; margin-bottom: var(--sp-2); }
.hop-arrow-vert { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding-top: 36px; min-width: 80px; }
.hop-arrow-vert .hop-distance { font: 700 11px/1 "JetBrains Mono", monospace; color: var(--text-muted); }
.hop-summary { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.hop-total { font-size: 16px; margin-left: auto; }
.data-age { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--text-muted); }

.breakdown-panel { padding: var(--sp-4); margin-top: var(--sp-4); }
.breakdown-panel h3 { margin-top: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); }
.breakdown-panel p { margin: 6px 0; }

@media (max-width: 720px) {
  .hop-detail-grid { grid-template-columns: 1fr; }
  .hop-arrow-vert { padding: var(--sp-2) 0; flex-direction: row; }
}

/* Casual asset protection: deny image drag and selection. Combined with
   the JS contextmenu blocker in base.html this hides assets from the
   normal save-as / drag-to-folder paths. F12 + Network still works. */
img, canvas {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

a { color: var(--link); text-decoration: none; transition: color var(--t-fast); }
a:hover, a:focus { color: var(--link-hover); text-decoration: none; }

code, pre, .mono, .num {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "zero" 1;
}
code {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  padding: 1px 6px;
  border-radius: var(--r-sm);
  font-size: 0.9em;
  color: var(--orange-300);
}

::selection { background: var(--orange-500); color: #000; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 5px; border: 2px solid var(--bg-1); }
::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

/* ---------- Navbar ---------- */
.eddb-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1030;
  background: rgba(11, 14, 19, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  margin: 0;
  min-height: 56px;
  height: 56px;
}
.eddb-navbar .navbar-header { float: left; }
.eddb-navbar .navbar-brand {
  padding: 0 var(--sp-5);
  height: 56px;
  line-height: 56px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand-eddb {
  background: linear-gradient(135deg, var(--orange-500), #ffb347);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
.brand-sub {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 1px;
}
.eddb-navbar .navbar-nav { margin: 0; }
.eddb-navbar .navbar-nav > li > a {
  color: var(--text-muted);
  padding: 0 var(--sp-4);
  height: 56px;
  line-height: 56px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}
.eddb-navbar .navbar-nav > li > a:hover,
.eddb-navbar .navbar-nav > li > a:focus {
  color: var(--text-strong);
  background: transparent;
  border-bottom-color: var(--border-strong);
}
.eddb-navbar .navbar-nav > li.active > a,
.eddb-navbar .navbar-nav > li.active > a:hover,
.eddb-navbar .navbar-nav > li.active > a:focus {
  color: var(--orange-500);
  background: transparent;
  border-bottom-color: var(--orange-500);
}
.eddb-navbar .navbar-nav .icon { width: 16px; height: 16px; }

/* Custom widget items (account dropdown, language switcher) don't have the
   <li><a> structure of the rest of the navbar, so they don't inherit the
   56px height. Force the li itself to be a flex container that centers
   whatever button sits inside, then the pill keeps its compact look but
   sits aligned with the link rows. */
.eddb-navbar .navbar-nav > li.eddb-account,
.eddb-navbar .navbar-nav > li.eddb-lang-switch {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 var(--sp-2);
}

/* ---------- Mobile nav toggle ---------- */
/* On desktop the toggle is hidden and the wrapper is transparent to layout
   (display:contents) so the two <ul>s behave exactly as before. Below the
   breakpoint the toggle appears and the wrapper becomes a drop-down panel. */
.eddb-nav-toggle { display: none; }
.eddb-nav-collapse { display: contents; }

@media (max-width: 860px) {
  .eddb-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 8px var(--sp-4) 0 0;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--t-fast), border-color var(--t-fast);
  }
  .eddb-nav-toggle:hover,
  .eddb-nav-toggle:focus {
    color: var(--text-strong);
    border-color: var(--border-strong);
  }
  .eddb-nav-toggle svg { width: 22px; height: 22px; }
  .eddb-nav-toggle .eddb-nav-toggle-close { display: none; }
  .eddb-nav-toggle[aria-expanded="true"] .eddb-nav-toggle-open { display: none; }
  .eddb-nav-toggle[aria-expanded="true"] .eddb-nav-toggle-close { display: inline; }

  /* Collapsed panel: drops down below the fixed 56px navbar. */
  .eddb-nav-collapse {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(11, 14, 19, 0.97);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }
  .eddb-nav-collapse.is-open { display: block; }

  .eddb-nav-collapse .navbar-nav { float: none; margin: 0; }
  .eddb-nav-collapse .navbar-nav > li { float: none; }
  .eddb-nav-collapse .navbar-nav > li > a {
    height: auto;
    line-height: 1.3;
    padding: 14px var(--sp-5);
    font-size: 14px;
    border-bottom: 1px solid var(--border-subtle);
    border-left: 3px solid transparent;
  }
  .eddb-nav-collapse .navbar-nav > li.active > a,
  .eddb-nav-collapse .navbar-nav > li.active > a:hover,
  .eddb-nav-collapse .navbar-nav > li.active > a:focus {
    border-left-color: var(--orange-500);
  }
  .eddb-nav-collapse .navbar-nav .icon { width: 18px; height: 18px; }

  /* Custom widget rows (account, language) stack instead of being the
     56px flex pills they are on desktop. */
  .eddb-nav-collapse .navbar-nav > li.eddb-account,
  .eddb-nav-collapse .navbar-nav > li.eddb-lang-switch {
    display: block;
    height: auto;
    padding: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  .eddb-nav-collapse .eddb-account-trigger {
    display: flex;
    padding: 14px var(--sp-5);
    font-size: 14px;
    background: transparent;
    border: none;
    border-radius: 0;
  }

  /* Language: show both options as plain rows, drop the dropdown trigger. */
  .eddb-nav-collapse .eddb-lang-trigger { display: none; }
  .eddb-nav-collapse .eddb-lang-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  .eddb-nav-collapse .eddb-lang-item { padding: 13px var(--sp-5); border-radius: 0; }
}

/* ---------- Layout ---------- */
.eddb-content {
  padding: var(--sp-6) var(--sp-6) var(--sp-10);
  max-width: 1800px;
  margin: 0 auto;
}
.eddb-page {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--sp-5);
  align-items: flex-start;
}
.eddb-sidebar {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  position: sticky;
  top: calc(56px + var(--sp-5));
  max-height: calc(100vh - 56px - var(--sp-10));
  overflow-y: auto;
}
.eddb-main { min-width: 0; }

/* ---------- Page title ---------- */
.eddb-page-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-strong);
  margin: 0 0 var(--sp-5);
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.eddb-page-title small {
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}

/* ---------- Sidebar form ---------- */
.eddb-sidebar h4 {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--orange-500);
  letter-spacing: 1.2px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--sp-2);
  margin: 0 0 var(--sp-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.eddb-sidebar .form-group { margin-bottom: var(--sp-3); }
.eddb-sidebar label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  margin-bottom: 4px;
  font-weight: 600;
  display: block;
}
.eddb-sidebar label small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--text-faint);
  margin-left: 4px;
}
.eddb-sidebar .form-control,
.eddb-sidebar select.form-control {
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  height: 32px;
  padding: 4px 10px;
  font-size: 13px;
  font-family: var(--font-ui);
  box-shadow: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.eddb-sidebar .form-control:hover { border-color: var(--border-strong); }
.eddb-sidebar .form-control:focus {
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px var(--orange-glow);
  background: var(--bg-2);
  outline: none;
}
.eddb-sidebar select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%239ba3ad' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5L6 7.5L9 4.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}
.eddb-sidebar input[type="number"].form-control { font-family: var(--font-mono); }

.eddb-sidebar .checkbox,
.eddb-sidebar .radio { margin: 4px 0; }
.eddb-sidebar .checkbox label,
.eddb-sidebar .radio label {
  font-size: 12.5px;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  padding-left: 22px;
  position: relative;
  cursor: pointer;
}
.eddb-sidebar input[type="checkbox"],
.eddb-sidebar input[type="radio"] {
  position: absolute;
  left: 0; top: 3px;
  accent-color: var(--orange-500);
  width: 14px; height: 14px;
}

.eddb-sidebar .btn-block { margin-top: var(--sp-3); width: 100%; }

/* ---------- Buttons ---------- */
.btn {
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 7px 14px;
  border: 1px solid transparent;
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:focus, .btn:active:focus { outline: none; box-shadow: 0 0 0 3px var(--orange-glow); }
.btn-default {
  background: var(--bg-3);
  color: var(--text);
  border-color: var(--border);
}
.btn-default:hover, .btn-default:focus {
  background: var(--bg-4);
  color: var(--text-strong);
  border-color: var(--border-strong);
}
.btn-primary {
  background: linear-gradient(180deg, #2b6cb0, #1e4d80);
  border-color: #1d4673;
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(180deg, #357abd, #235792);
  border-color: #235792;
  color: #fff;
}
.btn-orange {
  background: linear-gradient(180deg, var(--orange-500), var(--orange-700));
  border-color: var(--orange-700);
  color: #1a0e00;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-sm);
}
.btn-orange:hover, .btn-orange:focus {
  background: linear-gradient(180deg, #ff9933, var(--orange-600));
  color: #1a0e00;
  box-shadow: var(--shadow-md), 0 0 0 1px var(--orange-500);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--bg-2);
  border-color: var(--border-strong);
}

/* ---------- Tables ---------- */
.table {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.table > thead > tr > th {
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  border-top: 0;
  color: var(--text-muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  padding: 10px 12px;
  vertical-align: middle;
}
.table > tbody > tr > td {
  border-top: 1px solid var(--border-subtle);
  padding: 9px 12px;
  vertical-align: middle;
  font-size: 13px;
  transition: background var(--t-fast);
}
.table > tbody > tr:first-child > td { border-top: 0; }
.table-striped > tbody > tr:nth-of-type(odd) { background: rgba(255, 255, 255, 0.012); }
.table-hover > tbody > tr:hover { background: rgba(255, 136, 0, 0.05); }
.table .num,
.table > tbody > tr > td.num,
.table > thead > tr > th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
  font-size: 12.5px;
}
.table-condensed > tbody > tr > td,
.table-condensed > thead > tr > th { padding: 6px 10px; }

/* Wrap tables in a card-style frame */
.table-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-wrap .table {
  border: 0;
  border-radius: 0;
}
.table-wrap .table-toolbar {
  background: var(--bg-3);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Cards / Panels ---------- */
.eddb-panel {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.eddb-panel h3 {
  margin: 0 0 var(--sp-3);
  font-size: 14px;
  color: var(--orange-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.eddb-panel.is-error {
  border-color: rgba(248, 81, 73, 0.4);
  background: linear-gradient(180deg, rgba(248, 81, 73, 0.06), var(--bg-2));
}
.eddb-panel.is-error p { color: var(--orange-300); margin: 0; }

.eddb-banner-import {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-3) var(--sp-4) var(--sp-2);
  color: var(--orange-300);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  line-height: 1.45;
}
.eddb-banner-import strong { color: var(--orange-500); margin-right: 4px; }
.eddb-banner-import .icon { color: var(--orange-500); flex-shrink: 0; }

/* ---------- Language switcher (navbar) ---------- */
.eddb-lang-switch {
  position: relative;
}
.eddb-lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.eddb-lang-trigger:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  border-radius: var(--r-sm);
}
.eddb-flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  display: inline-block;
  vertical-align: middle;
}
.eddb-lang-code {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.eddb-lang-caret {
  font-size: 9px;
  color: var(--text-faint);
  margin-left: 2px;
}
.eddb-lang-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  padding: 4px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
}
.eddb-lang-switch:hover .eddb-lang-menu,
.eddb-lang-switch:focus-within .eddb-lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s;
}
.eddb-lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  transition: background-color 0.1s ease;
}
.eddb-lang-item:hover {
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: var(--text);
}
.eddb-lang-item.is-active {
  background: rgba(245, 158, 11, 0.10);
  color: var(--orange-300);
  font-weight: 500;
}
.eddb-lang-item.is-active::after {
  content: "\2713";
  margin-left: auto;
  color: var(--orange-500);
  font-size: 12px;
}

/* ---------- Click-to-copy (route detail) ---------- */
.copyable {
  cursor: copy;
  position: relative;
  border-radius: 3px;
  padding: 1px 4px;
  margin: 0 -2px;
  transition: background-color 0.15s ease;
}
.copyable:hover {
  background: rgba(245, 158, 11, 0.10);
  outline: 1px dashed rgba(245, 158, 11, 0.45);
}
.copyable::after {
  content: "\1F4CB"; /* clipboard glyph */
  font-size: 10px;
  margin-left: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
  vertical-align: 1px;
}
.copyable:hover::after {
  opacity: 0.55;
}
.copyable.is-copied {
  background: rgba(34, 197, 94, 0.18);
  outline: 1px solid rgba(34, 197, 94, 0.5);
}
.copyable.is-copied::after {
  content: "\2713 kopiert";
  font-size: 11px;
  font-weight: 600;
  color: #4ade80;
  opacity: 1;
  margin-left: 6px;
}
html[lang="en"] .copyable.is-copied::after {
  content: "\2713 copied";
}
.hop-sys-detail {
  display: inline-block;
  margin-left: 4px;
  color: var(--text-faint);
  text-decoration: none;
  font-size: 12px;
  vertical-align: 1px;
  padding: 0 4px;
  border-radius: 3px;
}
.hop-sys-detail:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
}

/* ---------- Source-radius dropdown: visually disabled when no src_system ---------- */
.eddb-radius-group.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.eddb-radius-group.is-disabled .eddb-radius-hint::before {
  content: "\26A0 "; /* warning sign */
  color: var(--orange-500);
  font-weight: 700;
  margin-right: 3px;
}
.eddb-radius-group .eddb-radius-hint {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--text-faint);
}
.eddb-radius-group.is-disabled .eddb-radius-hint {
  color: var(--orange-300);
}

/* ---------- System-name autocomplete (trade forms) ---------- */
.eddb-ac-wrap {
  position: relative;
}
.eddb-ac-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
}
.eddb-ac-item {
  padding: 7px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text);
  line-height: 1.2;
}
.eddb-ac-item.is-active {
  background: rgba(245, 158, 11, 0.14);
  color: var(--orange-300);
}
.eddb-ac-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.eddb-ac-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eddb-ac-pop {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.eddb-ac-item.is-active .eddb-ac-pop {
  color: var(--orange-300);
  opacity: 0.85;
}

/* ---------- Stats grid (Home) ---------- */
.eddb-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-5);
}
.eddb-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-4);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
.eddb-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 200px 80px at 70% 0%, var(--orange-glow), transparent 70%);
  opacity: 0;
  transition: opacity var(--t-base);
  pointer-events: none;
}
.eddb-card:hover {
  border-color: var(--orange-500);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 136, 0, 0.2);
}
.eddb-card:hover::before { opacity: 1; }
.eddb-card .label {
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.eddb-card .num {
  font-family: var(--font-mono);
  font-size: 32px;
  color: var(--text-strong);
  font-weight: 600;
  letter-spacing: -0.5px;
  display: block;
  font-feature-settings: "tnum" 1;
  line-height: 1.1;
}
.eddb-card .icon { color: var(--orange-500); width: 14px; height: 14px; }

/* Hero block on homepage */
.eddb-hero {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-6) var(--sp-8);
  margin-bottom: var(--sp-5);
  position: relative;
  overflow: hidden;
}
.eddb-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 300px at 90% 0%, var(--orange-glow), transparent 60%),
    radial-gradient(ellipse 400px 200px at 0% 100%, rgba(88, 166, 255, 0.08), transparent 60%);
  pointer-events: none;
}
.eddb-hero h1 {
  margin: 0 0 var(--sp-2);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-strong);
  position: relative;
}
.eddb-hero p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  max-width: 720px;
  position: relative;
}

/* ---------- Sub-Nav (Tabs inside a section) ---------- */
.eddb-subnav {
  display: flex;
  gap: 4px;
  margin: 0 0 var(--sp-4);
  padding: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-2);
  border-radius: var(--r-lg);
  list-style: none;
  width: fit-content;
}
.eddb-subnav > li { margin: 0; }
.eddb-subnav > li > a {
  display: block;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
  border: 0;
  background: transparent;
}
.eddb-subnav > li > a:hover {
  color: var(--text);
  background: var(--bg-3);
  text-decoration: none;
}
.eddb-subnav > li.active > a,
.eddb-subnav > li.active > a:hover,
.eddb-subnav > li.active > a:focus {
  background: linear-gradient(180deg, var(--orange-500), var(--orange-700));
  color: #1a0e00;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ---------- Pills / Badges ---------- */
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.pill-success { background: var(--green-bg); color: var(--green); border-color: rgba(63, 185, 80, 0.3); }
.pill-info    { background: rgba(88, 166, 255, 0.12); color: var(--blue); border-color: rgba(88, 166, 255, 0.3); }
.pill-warning { background: rgba(210, 153, 34, 0.12); color: var(--yellow); border-color: rgba(210, 153, 34, 0.3); }
.pill-danger  { background: var(--red-bg); color: var(--red); border-color: rgba(248, 81, 73, 0.3); }
.pill-orange  { background: rgba(255, 136, 0, 0.12); color: var(--orange-300); border-color: rgba(255, 136, 0, 0.3); }
.pill-mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

/* Pad badges (large/medium/small landing pads) */
.pad-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: var(--r-md);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}
.pad-L { background: var(--pad-l); }
.pad-M { background: var(--pad-m); }
.pad-S { background: var(--pad-s); }
/* Legacy aliases for existing templates */
.badge-pad-L { background: var(--pad-l); }
.badge-pad-M { background: var(--pad-m); }
.badge-pad-S { background: var(--pad-s); }
.badge-pad-L, .badge-pad-M, .badge-pad-S {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: var(--r-md);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
}

.svc-yes { color: var(--green); }
.svc-no  { color: var(--text-faint); opacity: 0.4; }

.text-success { color: var(--green) !important; }
.text-danger  { color: var(--red) !important; }
.text-warning { color: var(--yellow) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-faint   { color: var(--text-faint) !important; }

/* ---------- Pagination ---------- */
.pagination {
  display: inline-flex;
  margin: var(--sp-4) 0 0;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.pagination > li > a,
.pagination > li > span {
  background: var(--bg-2);
  border-color: var(--border-subtle);
  color: var(--text);
  padding: 6px 14px;
  font-size: 12px;
  border-width: 0 1px 0 0;
  transition: background var(--t-fast);
}
.pagination > li:last-child > a,
.pagination > li:last-child > span { border-right: 0; }
.pagination > li > a:hover { background: var(--bg-3); color: var(--text-strong); }
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover {
  background: var(--orange-500);
  border-color: var(--orange-500);
  color: #1a0e00;
}

/* ---------- DataTables tweaks ---------- */
.dataTables_wrapper { color: var(--text-muted); }
.dataTables_wrapper .dataTables_filter { float: right; margin-bottom: var(--sp-3); }
.dataTables_wrapper .dataTables_length { float: left; margin-bottom: var(--sp-3); }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-md);
  padding: 6px 10px;
  height: 32px;
  font-size: 13px;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px var(--orange-glow);
  outline: none;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { color: var(--text-muted); margin-top: var(--sp-3); }
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after { color: var(--orange-500); }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted) !important;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  margin: 0 2px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--bg-3) !important;
  border-color: var(--border-strong) !important;
  color: var(--text) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--orange-500) !important;
  border-color: var(--orange-500) !important;
  color: #1a0e00 !important;
}

/* ---------- Detail Page Grid (e.g. system detail) ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: var(--sp-5);
  align-items: flex-start;
}
@media (max-width: 980px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* ---------- Key-Value list (definition list) ---------- */
.kv-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px var(--sp-4);
  margin: 0;
  font-size: 12.5px;
}
.kv-list dt {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  padding-top: 3px;
  border-bottom: 0;
}
.kv-list dd {
  margin: 0;
  color: var(--text);
  text-align: right;
  word-break: break-word;
}

/* ---------- Service-icon row (e.g. system detail station list) ---------- */
.svc-icons {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.svc-icons .svc-yes { color: var(--green); }
.svc-icons .svc-no  { color: var(--text-faint); opacity: 0.35; }

/* ---------- Trade Loop visualisation ---------- */
.loop-card { padding: var(--sp-5); }
.loop-card h3 {
  font-size: 16px;
  color: var(--text-strong);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--sp-3);
  text-transform: none;
  letter-spacing: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}
.loop-card h3 .loop-no {
  color: var(--text-faint);
  font-weight: 500;
  font-size: 13px;
}
.loop-card h3 .total-profit {
  margin-left: auto;
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
  font-size: 20px;
  color: var(--green);
  font-weight: 700;
}

.hop-flow {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.hop-row {
  display: grid;
  grid-template-columns: 36px minmax(160px, 1fr) auto minmax(160px, 1fr) 1.3fr 110px;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3);
  background: var(--bg-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  transition: background var(--t-fast);
}
.hop-row:hover { background: var(--bg-4); }
.hop-num {
  width: 28px; height: 28px;
  border-radius: var(--r-pill);
  background: var(--bg-1);
  border: 1px solid var(--orange-500);
  color: var(--orange-500);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hop-station {
  font-size: 12.5px;
  position: relative;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.015);
}
.hop-station .name { color: var(--text); font-weight: 600; display: block; }
.hop-station .sys  { color: var(--text-faint); font-size: 11px; }
.hop-station.hop-buy {
  border-left: 3px solid var(--orange-500);
  background: linear-gradient(90deg, rgba(255, 136, 0, 0.06), transparent 70%);
}
.hop-station.hop-sell {
  border-left: 3px solid var(--green);
  background: linear-gradient(90deg, rgba(63, 185, 80, 0.06), transparent 70%);
}
.hop-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  margin-bottom: 4px;
}
.hop-tag .icon { width: 10px; height: 10px; }
.tag-buy {
  background: rgba(255, 136, 0, 0.15);
  color: var(--orange-300);
  border: 1px solid rgba(255, 136, 0, 0.3);
}
.tag-sell {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
  border: 1px solid rgba(63, 185, 80, 0.3);
}
.hop-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  color: var(--orange-500);
}
.hop-arrow .hop-distance {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-1);
  padding: 1px 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.hop-arrow .icon { width: 16px; height: 16px; }
.hop-commodity {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}
.hop-commodity .meta {
  display: block;
  color: var(--text-faint);
  font-size: 11px;
  font-family: var(--font-mono);
  margin-top: 2px;
}
.hop-prices {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
  color: var(--text-muted);
}
.hop-prices strong { color: var(--text); }
.hop-subtotal {
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
  color: var(--green);
  font-weight: 600;
}

/* ---------- Loading Overlay - nerdy scan-style progress ---------- */
#eddb-loader {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 16, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.18s ease-out;
}
#eddb-loader.visible {
  display: flex;
  opacity: 1;
}
.loader-card {
  width: min(560px, 92vw);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--orange-500);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  box-shadow:
    0 0 0 1px rgba(255, 136, 0, 0.25),
    0 24px 64px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(255, 136, 0, 0.15);
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
}
.loader-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.loader-led {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--orange-500);
  box-shadow: 0 0 12px var(--orange-500);
  animation: led-pulse 0.9s ease-in-out infinite;
}
@keyframes led-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 12px var(--orange-500); }
  50%      { opacity: 0.4; box-shadow: 0 0 4px var(--orange-500); }
}
.loader-title {
  flex: 1;
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--orange-300);
  text-transform: uppercase;
}
.loader-elapsed {
  font-size: 12px;
  color: var(--text-muted);
}
.loader-progress {
  height: 4px;
  background: var(--bg-1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--sp-3);
  position: relative;
}
.loader-progress-fill {
  position: absolute;
  inset: 0;
  width: 33%;
  background: linear-gradient(90deg,
    transparent,
    var(--orange-300),
    var(--orange-500),
    var(--orange-300),
    transparent);
  border-radius: 2px;
  animation: scan-bar 1.1s linear infinite;
}
@keyframes scan-bar {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.loader-log {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.55;
  min-height: 140px;
  max-height: 200px;
  overflow: hidden;
  position: relative;
}
.loader-log::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 24px;
  background: linear-gradient(180deg, var(--bg-2), transparent);
  pointer-events: none;
  z-index: 1;
}
.loader-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: log-in 0.2s ease-out;
}
.loader-line .lg-act    { color: var(--text); }
.loader-line .lg-sys    { color: var(--blue); }
.loader-line .lg-com    { color: var(--orange-300); }
.loader-line .lg-profit { color: var(--green); }
@keyframes log-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Footer ---------- */
.eddb-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(11, 14, 19, 0.85);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-2) var(--sp-4);
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  z-index: 100;
}
.eddb-footer a { color: var(--text-muted); }
.eddb-footer a:hover { color: var(--text); }
.eddb-footer p { margin: 0; }

/* ---------- Forms inline (search bars) ---------- */
.form-inline-eddb {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  align-items: center;
}
.form-inline-eddb .form-control {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-md);
  height: 36px;
  padding: 6px 12px;
  font-size: 13px;
  min-width: 240px;
}
.form-inline-eddb .form-control:focus {
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px var(--orange-glow);
  outline: none;
}

/* Standard Bootstrap form-control (when not in sidebar) */
.form-control {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-size: 13px;
  height: 34px;
  box-shadow: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-control:focus {
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px var(--orange-glow);
  outline: none;
}

/* ---------- Utilities ---------- */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.muted { color: var(--text-muted); }

.icon {
  display: inline-block;
  vertical-align: -2px;
  flex-shrink: 0;
}
.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 18px; height: 18px; }
.icon-lg { width: 22px; height: 22px; }

/* Dot status indicator */
.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 4px;
}
.dot-ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-warn { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.dot-err { background: var(--red); box-shadow: 0 0 8px var(--red); }

/* ---------- Ships: toolbar, sort bar, card grid ---------- */
.ships-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  align-items: stretch;
}
.toolbar-search {
  position: relative;
  display: flex;
  align-items: center;
}
.toolbar-search > svg.icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
.toolbar-search .form-control {
  padding-left: 36px;
  height: 36px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-md);
  width: 100%;
}
.toolbar-search .form-control:focus {
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px var(--orange-glow);
  outline: none;
}
.toolbar-pads {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 4px;
}
.pad-filter {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all var(--t-fast);
}
.pad-filter:hover { color: var(--text); background: var(--bg-3); text-decoration: none; }
.pad-filter.is-active {
  background: var(--bg-3);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.toolbar-mfg .form-control {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-md);
  height: 36px;
  font-size: 13px;
  padding: 4px 30px 4px 12px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%239ba3ad' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5L6 7.5L9 4.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 200px;
}

.sort-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: var(--sp-4);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.sort-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  font-weight: 600;
  margin-right: 4px;
}
.sort-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: all var(--t-fast);
  border: 1px solid transparent;
}
.sort-chip:hover {
  color: var(--text);
  background: var(--bg-3);
  text-decoration: none;
}
.sort-chip.is-active {
  background: var(--orange-500);
  color: #1a0e00;
  font-weight: 600;
}
.sort-arrow { font-size: 9px; }

/* Manufacturer pill bar - color-coded, mirrors card colors */
.mfg-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 var(--sp-4);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.mfg-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: var(--r-sm);
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  background: var(--bg-3);
  color: var(--text-muted);
  transition: all var(--t-fast);
  --mfg-rgb: 154, 163, 173;
  position: relative;
}
.mfg-chip:before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgb(var(--mfg-rgb));
  margin-right: 4px;
}
.mfg-chip:not([data-mfg-color]):before { display: none; }

/* If a logo PNG is present, the chip switches to image-only mode:
   the wordmark replaces the text label so the brand reads correctly. */
.mfg-chip.has-logo {
  padding: 4px 16px;
  min-width: 200px;
  height: 66px;
  font-size: 0;            /* hides the text node, image-only */
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mfg-chip.has-logo:before { display: none; }
.mfg-chip .mfg-logo {
  height: 48px;
  max-width: 200px;
  width: auto;
  object-fit: contain;
  margin: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
.mfg-chip.has-logo.is-active .mfg-logo {
  filter: drop-shadow(0 0 6px rgba(var(--mfg-rgb), 0.6));
}

/* Card mfg-pill: wordmark replaces the text entirely so it reads at a glance */
.mfg-pill.has-logo {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 0;
  display: inline-flex;
  align-items: center;
}
.mfg-pill .mfg-logo-tiny {
  height: 60px;
  max-width: 260px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.75));
}
.mfg-chip:hover {
  color: var(--text);
  border-color: rgba(var(--mfg-rgb), 0.5);
  background: var(--bg-4);
  text-decoration: none;
}
.mfg-chip.is-active {
  background: rgba(var(--mfg-rgb), 0.18);
  border-color: rgba(var(--mfg-rgb), 0.7);
  color: rgb(var(--mfg-rgb));
}
.mfg-chip.is-active:not([data-mfg-color]) {
  background: var(--orange-500);
  border-color: var(--orange-500);
  color: #1a0e00;
}
/* Pre-computed manufacturer colors (must match those in routes/ships.py) */
.mfg-chip[data-mfg-color="blue"]    { --mfg-rgb: 88, 166, 255; }
.mfg-chip[data-mfg-color="red"]     { --mfg-rgb: 248, 81, 73; }
.mfg-chip[data-mfg-color="green"]   { --mfg-rgb: 63, 185, 80; }
.mfg-chip[data-mfg-color="purple"]  { --mfg-rgb: 188, 140, 255; }
.mfg-chip[data-mfg-color="gold"]    { --mfg-rgb: 232, 192, 80; }
.mfg-chip[data-mfg-color="orange"]  { --mfg-rgb: 255, 136, 0; }

/* Ship cards */
.ship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}
.ship-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 0 var(--sp-4) var(--sp-4);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: all var(--t-base);
  --mfg-rgb: 154, 163, 173;
}
.ship-card-image {
  margin: 0 calc(var(--sp-4) * -1) var(--sp-2);
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(var(--mfg-rgb), 0.15), transparent 70%), var(--bg-0);
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  padding: 0;
}
.ship-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.7));
  transition: transform var(--t-base);
}
.ship-card:hover .ship-card-image img {
  transform: scale(1.06);
}
.ship-card-head {
  padding-top: var(--sp-3);
}
.ship-card[data-mfg-color="blue"]    { --mfg-rgb: 88, 166, 255; }
.ship-card[data-mfg-color="red"]     { --mfg-rgb: 248, 81, 73; }
.ship-card[data-mfg-color="green"]   { --mfg-rgb: 63, 185, 80; }
.ship-card[data-mfg-color="purple"]  { --mfg-rgb: 188, 140, 255; }
.ship-card[data-mfg-color="gold"]    { --mfg-rgb: 232, 192, 80; }
.ship-card[data-mfg-color="orange"]  { --mfg-rgb: 255, 136, 0; }
.ship-card[data-mfg-color="gray"]    { --mfg-rgb: 154, 163, 173; }
.ship-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--mfg-rgb), 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}
/* Hide the cover-watermark inside cards: wordmark logos look noisy when
   used as a faint background. Cover only appears on the detail page banner
   where it has the size to read properly. */
.ship-card-cover { display: none; }
.ship-card > * { position: relative; }
.ship-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--mfg-rgb), 0.5);
  text-decoration: none;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(var(--mfg-rgb), 0.3);
}
.ship-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  position: relative;
}
.ship-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.3px;
  position: relative;
}
.ship-card-cost {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--orange-300);
  position: relative;
}
.ship-card-cost .num { font-weight: 600; }
.ship-card-cost .unit { color: var(--text-muted); font-size: 11px; }

.ship-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border-subtle);
  position: relative;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.stat-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  font-weight: 600;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  font-feature-settings: "tnum" 1;
}
.stat-value .unit { color: var(--text-faint); font-size: 10px; font-family: var(--font-ui); margin-left: 1px; }

.ship-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border-subtle);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  position: relative;
}
.hp-bar { display: inline-flex; gap: 3px; }
.hp-pip {
  width: 8px; height: 8px;
  background: rgba(var(--mfg-rgb), 0.7);
  border-radius: 1px;
}

/* Manufacturer pills */
.mfg-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  background: rgba(var(--mfg-rgb), 0.15);
  color: rgb(var(--mfg-rgb));
  border: 1px solid rgba(var(--mfg-rgb), 0.4);
}
.mfg-pill-lg { padding: 4px 12px; font-size: 11.5px; }
.mfg-blue   { --mfg-rgb: 88, 166, 255; }
.mfg-red    { --mfg-rgb: 248, 81, 73; }
.mfg-green  { --mfg-rgb: 63, 185, 80; }
.mfg-purple { --mfg-rgb: 188, 140, 255; }
.mfg-gold   { --mfg-rgb: 232, 192, 80; }
.mfg-orange { --mfg-rgb: 255, 136, 0; }
.mfg-gray   { --mfg-rgb: 154, 163, 173; }

.pad-badge-lg { width: 32px; height: 32px; font-size: 14px; }

/* Manufacturer banner above the ship detail header */
.mfg-banner {
  position: relative;
  height: 260px;
  margin: calc(var(--sp-6) * -1) calc(var(--sp-6) * -1) var(--sp-5);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}
.mfg-banner-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, var(--bg-0) 100%),
              linear-gradient(90deg, var(--bg-0) 0%, transparent 30%, transparent 70%, var(--bg-0) 100%);
}
.mfg-banner-logo {
  position: absolute;
  bottom: var(--sp-4);
  right: var(--sp-6);
  height: 210px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.8));
}

/* Ship detail page */
.ship-detail-grid {
  display: grid;
  grid-template-columns: minmax(360px, 520px) 1fr;
  gap: var(--sp-5);
  align-items: flex-start;
}
@media (max-width: 1100px) {
  .ship-detail-grid { grid-template-columns: 1fr; }
  .ships-toolbar { grid-template-columns: 1fr; }
}

.ship-hero {
  background: linear-gradient(135deg, rgba(var(--mfg-rgb), 0.12), var(--bg-2) 60%);
  border: 1px solid rgba(var(--mfg-rgb), 0.3);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  --mfg-rgb: 154, 163, 173;
}
.ship-hero[data-mfg-color="blue"]    { --mfg-rgb: 88, 166, 255; }
.ship-hero[data-mfg-color="red"]     { --mfg-rgb: 248, 81, 73; }
.ship-hero[data-mfg-color="green"]   { --mfg-rgb: 63, 185, 80; }
.ship-hero[data-mfg-color="purple"]  { --mfg-rgb: 188, 140, 255; }
.ship-hero[data-mfg-color="gold"]    { --mfg-rgb: 232, 192, 80; }
.ship-hero[data-mfg-color="orange"]  { --mfg-rgb: 255, 136, 0; }
.ship-hero-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.ship-hero-mfg-logo {
  height: 72px;
  max-width: 320px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
  /* Bigger than the header row, but pulled into negative margin so it
     does not push the header height around. */
  margin: -18px 0;
}
.ship-hero-image {
  margin: var(--sp-2) calc(var(--sp-5) * -1) var(--sp-3);
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(var(--mfg-rgb), 0.2), transparent 70%);
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-top: 1px solid rgba(var(--mfg-rgb), 0.2);
  border-bottom: 1px solid rgba(var(--mfg-rgb), 0.2);
}
.ship-hero-image img {
  max-width: 92%;
  max-height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.7));
}

/* ---- Media (single viewport, image or 3D wireframe) ---- */
.ship-media {
  margin: var(--sp-3) calc(var(--sp-5) * -1) var(--sp-3);
  border-top: 1px solid rgba(var(--mfg-rgb), 0.2);
  border-bottom: 1px solid rgba(var(--mfg-rgb), 0.2);
}
.ship-media-viewport {
  position: relative;
  height: 360px;
  overflow: hidden;
}
.ship-media-image,
.ship-media-3d {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ship-media-image[hidden],
.ship-media-3d[hidden] { display: none; }
.ship-media-image {
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(var(--mfg-rgb), 0.20), transparent 70%);
}
.ship-media-image img {
  max-width: 96%;
  max-height: 340px;
  object-fit: contain;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.7));
}

/* "Shielded" wrapper: a transparent 1x1 GIF is stretched over the
   element so right-click "Save image" hits the placeholder, not the
   real asset. Combined with the JS contextmenu / dragstart blockers
   in base.html. F12 + Network still works for anyone determined. */
.shielded { position: relative; }
.shielded::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7") repeat;
  z-index: 2;
  /* The overlay catches right-click but lets normal pointer events
     (drag, scroll) through to the asset underneath. */
  pointer-events: none;
}
.shielded::after { /* split into two rules so we can target context only */ }
/* Only block right-click on the overlay; everything else falls through. */
.shielded { -webkit-touch-callout: none; }
.shielded > img,
.shielded > canvas,
.shielded > video {
  position: relative;
  z-index: 1;
  pointer-events: none;
}
/* 3D canvas needs pointer events to allow OrbitControls drag/scroll;
   the JS contextmenu blocker still prevents save-image-as. */
.ship-media-3d > canvas { pointer-events: auto; }
.ship-media-ai-tag {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 4;  /* above shielded overlay (z=2) and canvas (z=1) */
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.7);
  font: 700 9px/1 "JetBrains Mono", monospace;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
.ship-media-3d {
  background:
    linear-gradient(180deg, rgba(255,122,26,0.04) 0%, rgba(0,0,0,0) 60%),
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(255,122,26,0.10), transparent 70%),
    #05080d;
  cursor: grab;
}
.ship-media-3d:active { cursor: grabbing; }
.ship-media-toggle {
  display: flex;
  gap: 1px;
  background: rgba(var(--mfg-rgb), 0.15);
  padding: 1px;
  border-top: 1px solid rgba(var(--mfg-rgb), 0.2);
}
.ship-media-btn {
  flex: 1;
  border: 0;
  background: var(--bg-2);
  color: var(--text-muted);
  padding: 8px 14px;
  font: 700 11px/1.2 "JetBrains Mono", monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ship-media-btn:hover { color: var(--text); }
.ship-media-btn.is-active {
  background: rgba(var(--mfg-rgb), 0.18);
  color: rgba(var(--mfg-rgb), 1);
  box-shadow: inset 0 -2px 0 rgba(var(--mfg-rgb), 0.6);
}
.ship-media-3d-icon {
  display: inline-block;
  width: 12px; height: 12px;
  border: 1.5px solid currentColor;
  transform: rotate(45deg) skew(10deg, 10deg);
}
.ship-3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.ship-3d-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(255,122,26,0.85);
  font: 700 11px/1 "JetBrains Mono", monospace;
  letter-spacing: 2px;
  pointer-events: none;
  background: rgba(5,8,13,0.6);
}
.ship-3d-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,122,26,0.25);
  border-top-color: rgba(255,122,26,0.85);
  border-radius: 50%;
  animation: ship-3d-spin 0.8s linear infinite;
}
@keyframes ship-3d-spin { to { transform: rotate(360deg); } }
.ship-3d-help {
  position: absolute;
  left: 12px;
  bottom: 10px;
  color: rgba(255,122,26,0.55);
  font: 700 10px/1 "JetBrains Mono", monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(0,0,0,0.9);
}
.ship-hero-name {
  margin: var(--sp-3) 0 var(--sp-2);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.5px;
}
.ship-hero-cost {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--orange-300);
  margin-bottom: var(--sp-4);
}
.ship-hero-cost small {
  display: block;
  font-family: var(--font-ui);
  font-size: 11px;
  margin-top: 2px;
}
.ship-hero-stats { margin-top: var(--sp-3); }

.ship-specs {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.ship-specs .eddb-panel { margin-bottom: 0; }
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
}
.spec-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.spec-value {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--text-strong);
  font-weight: 600;
  letter-spacing: -0.3px;
  font-feature-settings: "tnum" 1;
  margin-bottom: 6px;
}
.spec-value .unit {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 400;
  margin-left: 3px;
}
.bar {
  height: 4px;
  background: var(--bg-1);
  border-radius: 2px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange-700), var(--orange-500));
  border-radius: 2px;
  min-width: 4px;
}
.bar-shield { background: linear-gradient(90deg, #2c5e8e, var(--blue)); }
.bar-armour { background: linear-gradient(90deg, #6e3a30, #d29922); }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: var(--sp-10) var(--sp-6);
  color: var(--text-faint);
  font-size: 13px;
}
.empty-state svg {
  width: 36px; height: 36px;
  color: var(--text-faint);
  opacity: 0.4;
  margin-bottom: var(--sp-2);
}

/* Animations - subtle */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.eddb-panel,
.eddb-card,
.table-wrap {
  animation: fadeInUp 220ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* No extra position context on .table-wrap - lets header sit normally */

/* Service icons better visual rhythm */
td.svc-icons,
.svc-icons {
  white-space: nowrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .eddb-page { grid-template-columns: 240px 1fr; gap: var(--sp-4); }
  .eddb-sidebar { padding: var(--sp-3); }
}
@media (max-width: 980px) {
  .eddb-page { grid-template-columns: 1fr; }
  .eddb-sidebar { position: static; max-height: none; }
  .hop-row {
    grid-template-columns: 28px 1fr;
    grid-template-rows: auto auto auto auto auto;
    gap: var(--sp-2) var(--sp-3);
    padding: var(--sp-3);
  }
  .hop-num { grid-row: 1 / 3; }
  .hop-station.hop-buy  { grid-column: 2; grid-row: 1; }
  .hop-arrow {
    grid-column: 2; grid-row: 2;
    flex-direction: row;
    justify-content: flex-start;
    padding-left: var(--sp-2);
  }
  .hop-station.hop-sell { grid-column: 2; grid-row: 3; }
  .hop-commodity { grid-column: 1 / 3; grid-row: 4; padding-top: var(--sp-2); border-top: 1px dashed var(--border-subtle); }
  .hop-row > div:last-child { grid-column: 1 / 3; grid-row: 5; }
  .hop-prices, .hop-subtotal { text-align: left; }
}
@media (max-width: 640px) {
  .eddb-content { padding: var(--sp-3); }
  .eddb-page-title { font-size: 20px; }
  .eddb-hero { padding: var(--sp-5); }
  .eddb-hero h1 { font-size: 22px; }
  .loop-card h3 .total-profit { font-size: 16px; margin-left: 0; width: 100%; }
}

/* ---------- Station detail page ---------- */
.station-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
@media (max-width: 800px) {
  .station-detail-grid { grid-template-columns: 1fr; }
}

.station-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
}
.station-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}
.station-tab:hover { color: var(--text); }
.station-tab.is-active {
  color: var(--orange-500);
  border-bottom-color: var(--orange-500);
}
.station-tab .pill { font-size: 10px; padding: 1px 7px; }
.station-tab-panel[hidden] { display: none; }

/* ---------- Auth pages (login/register/profile) ---------- */
.eddb-auth-card {
  max-width: 440px;
  margin: var(--sp-5) auto;
  padding: var(--sp-5);
}
.eddb-auth-card h2 {
  margin: 0 0 var(--sp-4);
  font-size: 20px;
  color: var(--text-strong);
}
.eddb-auth-card .form-group { margin-bottom: var(--sp-3); }
.eddb-auth-card label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}
.eddb-auth-card .auth-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin: var(--sp-3) 0 0;
  text-align: center;
}
.eddb-auth-card .auth-hint a { color: var(--orange-500); text-decoration: none; }
.eddb-auth-card .auth-hint a:hover { text-decoration: underline; }

.eddb-flash { margin-bottom: var(--sp-3); padding: 10px 14px; border-radius: var(--r-md); font-size: 13px; }
.eddb-flash.success { background: rgba(63, 185, 80, 0.10); border: 1px solid rgba(63, 185, 80, 0.30); color: #b8f0c4; }
.eddb-flash.error   { background: rgba(248, 81, 73, 0.10); border: 1px solid rgba(248, 81, 73, 0.30); color: #ffb8b3; }
.eddb-flash.info    { background: rgba(56, 139, 253, 0.10); border: 1px solid rgba(56, 139, 253, 0.30); color: #a8c8ff; }

/* ---------- TOTP setup: app store helper ---------- */
.register-totp-notice {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
  background: rgba(255, 140, 40, 0.06);
  border: 1px solid rgba(255, 140, 40, 0.30);
  border-radius: var(--r-md);
}
.register-totp-notice > svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--orange-500); margin-top: 2px; }
.register-totp-notice strong {
  display: block;
  font-size: 13px;
  color: var(--text-strong);
  margin-bottom: 2px;
}
.register-totp-notice p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.totp-app-help {
  margin: var(--sp-3) 0;
  padding: 0;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
}
.totp-app-help summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  font: 600 13px/1 "Inter", sans-serif;
  color: var(--text-strong);
  transition: background 120ms;
  list-style: none;
}
.totp-app-help summary::-webkit-details-marker { display: none; }
.totp-app-help summary::before {
  content: "+";
  font: 700 16px/1 "JetBrains Mono", monospace;
  width: 16px;
  text-align: center;
  color: var(--orange-500);
}
.totp-app-help[open] summary::before { content: "−"; }
.totp-app-help summary svg { color: var(--orange-500); }
.totp-app-help summary:hover { background: rgba(255,255,255,0.04); }
.totp-app-help-text {
  margin: 0;
  padding: 4px 14px 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.totp-app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  padding: 0 14px 10px;
}
.totp-app-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.totp-app-card strong { font-size: 12.5px; color: var(--text-strong); }
.totp-app-card small { font-size: 11px; color: var(--text-faint); line-height: 1.4; }
.totp-app-links {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.totp-store-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.40);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text);
  font: 600 10.5px/1 "Inter", sans-serif;
  text-decoration: none;
  transition: background 120ms, border-color 120ms;
}
.totp-store-btn:hover {
  background: rgba(255, 140, 40, 0.10);
  border-color: rgba(255, 140, 40, 0.40);
  color: var(--text-strong);
  text-decoration: none;
}
.totp-store-btn svg { width: 13px; height: 13px; flex: 0 0 13px; }
.totp-app-other {
  margin: 0;
  padding: 8px 14px 12px;
  font-size: 11px;
  color: var(--text-faint);
  border-top: 1px solid var(--border-subtle);
  background: rgba(0,0,0,0.15);
}
@media (max-width: 600px) {
  .totp-app-grid { grid-template-columns: 1fr; }
}

/* ---------- TOTP setup ---------- */
.totp-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.totp-qr img { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 4px; }
.totp-qr code {
  display: block;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 13px;
  letter-spacing: 1px;
  user-select: all;
}

/* ---------- Profile hero (top of profile page) ---------- */
.profile-hero {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, rgba(255, 136, 0, 0.08), rgba(255, 136, 0, 0.01) 60%, transparent);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--orange-500);
  border-radius: var(--r-md);
}
.profile-hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-500), #d56400);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 32px/1 "Inter", sans-serif;
  color: #1a0e02;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3), 0 4px 12px rgba(255, 136, 0, 0.25);
  flex-shrink: 0;
}
.profile-hero-body { flex: 1; min-width: 0; }
.profile-hero-name {
  margin: 0 0 8px;
  font: 600 26px/1.1 "Inter", sans-serif;
  letter-spacing: -0.3px;
  color: var(--text-strong);
}
.profile-hero-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-hero-actions { display: flex; gap: var(--sp-2); }

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-muted);
}
.meta-pill svg { opacity: 0.7; }
.meta-pill.pill-good { background: rgba(63, 185, 80, 0.10); border-color: rgba(63, 185, 80, 0.30); color: #b8f0c4; }
.meta-pill.pill-bad  { background: rgba(248, 81, 73, 0.10); border-color: rgba(248, 81, 73, 0.30); color: #ffb8b3; }

@media (max-width: 700px) {
  .profile-hero { flex-direction: column; text-align: center; align-items: stretch; }
  .profile-hero-avatar { margin: 0 auto; }
  .profile-hero-meta { justify-content: center; }
  .profile-hero-actions { justify-content: center; }
}

/* ---------- Profile sections ---------- */
.profile-section { margin-bottom: var(--sp-5); }
.profile-section-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border-subtle);
}
.profile-section-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: 600 18px/1 "Inter", sans-serif;
  color: var(--text-strong);
}
.profile-section-head h2 svg { color: var(--orange-500); }
.profile-section-meta {
  margin-left: auto;
  font: 600 11px/1 "JetBrains Mono", monospace;
  color: var(--text-faint);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------- Empty state placeholder ---------- */
.empty-state {
  text-align: center;
  padding: var(--sp-6);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: var(--sp-2); opacity: 0.4; }
.empty-state p { margin: 0; font-size: 13px; }

/* ---------- Plugin download (profile) ---------- */
.plugin-dl-card {
  display: flex;
  align-items: stretch;
  gap: var(--sp-4);
  padding: var(--sp-4);
  margin-bottom: var(--sp-5);
  background:
    radial-gradient(ellipse at top right, rgba(255,140,40,0.10), transparent 60%),
    linear-gradient(135deg, rgba(255,140,40,0.07), rgba(255,140,40,0.02));
  border: 1px solid rgba(255,140,40,0.35);
  border-radius: var(--r-md);
  box-shadow: 0 4px 24px rgba(255,140,40,0.06);
}
.plugin-dl-icon {
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,140,40,0.25), rgba(255,140,40,0.10));
  color: var(--orange-500);
  align-self: flex-start;
}
.plugin-dl-icon .icon { width: 32px; height: 32px; }
.plugin-dl-body { flex: 1; min-width: 0; }
.plugin-dl-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.plugin-dl-head h2 {
  margin: 0;
  font: 700 18px/1.2 "Inter", sans-serif;
  color: var(--text-strong);
}
.plugin-dl-version {
  font: 600 11px/1 "JetBrains Mono", monospace;
  padding: 3px 8px;
  background: rgba(255,140,40,0.18);
  color: var(--orange-300, #ffd0a8);
  border-radius: 999px;
  letter-spacing: 0.5px;
}
.plugin-dl-text {
  margin: 0 0 var(--sp-3) 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}
.plugin-dl-prereq,
.plugin-dl-step {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.plugin-dl-step { margin-bottom: var(--sp-3); }
.plugin-dl-prereq-num {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,140,40,0.30), rgba(255,140,40,0.10));
  color: var(--orange-300, #ffd0a8);
  font: 700 13px/1 "JetBrains Mono", monospace;
  border: 1px solid rgba(255,140,40,0.40);
}
.plugin-dl-prereq-body { flex: 1; min-width: 0; }
.plugin-dl-prereq-body strong {
  display: block;
  font-size: 13px;
  color: var(--text-strong);
  margin-bottom: 2px;
}
.plugin-dl-prereq-body p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.plugin-dl-prereq-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.plugin-dl-prereq-btn .icon { width: 14px; height: 14px; }

.plugin-dl-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.plugin-dl-btn {
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.plugin-dl-btn .icon { width: 18px; height: 18px; }
.plugin-dl-size {
  margin-left: 4px;
  font-weight: 500;
  font-size: 12px;
  opacity: 0.80;
}
.plugin-dl-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.plugin-dl-meta summary {
  cursor: pointer;
  user-select: none;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  transition: background 0.15s;
}
.plugin-dl-meta summary:hover { background: rgba(255,255,255,0.06); }
.plugin-dl-meta[open] summary { margin-bottom: 8px; }
.plugin-dl-hash {
  display: block;
  padding: 8px 10px;
  background: rgba(0,0,0,0.30);
  border-radius: 6px;
  font: 500 11.5px/1.4 "JetBrains Mono", monospace;
  color: var(--text);
  word-break: break-all;
  user-select: all;
  margin-bottom: 4px;
}
.plugin-dl-meta small { display: block; font-size: 11px; }
.plugin-dl-meta small code {
  padding: 1px 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  font: 500 11px/1.4 "JetBrains Mono", monospace;
}
.plugin-dl-hint {
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  background: rgba(255,255,255,0.02);
  border-left: 3px solid rgba(255,140,40,0.40);
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.plugin-dl-hint .icon { flex: 0 0 14px; margin-top: 2px; color: var(--orange-500); }
@media (max-width: 700px) {
  .plugin-dl-card { flex-direction: column; }
  .plugin-dl-icon { align-self: center; }
  .plugin-dl-actions { flex-direction: column; align-items: stretch; }
  .plugin-dl-btn { justify-content: center; }
  .plugin-dl-prereq,
  .plugin-dl-step { flex-wrap: wrap; }
  .plugin-dl-prereq-btn { width: 100%; justify-content: center; }
}

/* ---------- Pairing tokens section ---------- */
.token-display {
  background: linear-gradient(135deg, rgba(63, 185, 80, 0.12), rgba(63, 185, 80, 0.04));
  border: 1px solid rgba(63, 185, 80, 0.40);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.token-display-head { margin-bottom: 6px; color: #b8f0c4; font-size: 12px; }
.token-display-value {
  display: block;
  padding: 10px 12px;
  background: rgba(0,0,0,0.35);
  border-radius: 6px;
  font: 600 13px/1.4 "JetBrains Mono", monospace;
  color: #fff;
  user-select: all;
  word-break: break-all;
}

.pairing-form {
  display: flex;
  align-items: end;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.pairing-form .form-group { margin: 0; flex: 1; }

.tokens-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--sp-3);
}
.token-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.token-row-label strong { display: block; font-size: 13px; }
.token-row-label small { display: block; margin-top: 2px; font-size: 10.5px; }
.token-row-seen {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.token-row-seen strong { color: var(--text); font-family: "JetBrains Mono", monospace; }
.token-row-seen small { font-size: 10.5px; }
.token-revoke { color: var(--red) !important; }
.token-revoke:hover { background: rgba(248, 81, 73, 0.10) !important; }
@media (max-width: 700px) {
  .token-row { grid-template-columns: 1fr; gap: var(--sp-2); }
  .pairing-form { flex-direction: column; align-items: stretch; }
}

.pairing-hint {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pairing-hint code {
  padding: 3px 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  font: 500 12px/1 "JetBrains Mono", monospace;
  color: var(--orange-300);
  user-select: all;
}

/* ---------- Navbar account widget ---------- */
.eddb-account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text);
  font: 600 12px/1 "Inter", sans-serif;
  text-decoration: none;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.eddb-account-trigger:hover,
.eddb-account-trigger:focus {
  background: rgba(255, 136, 0, 0.08);
  border-color: rgba(255, 136, 0, 0.30);
  color: var(--text-strong);
  text-decoration: none;
}
.eddb-account-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-500), #d56400);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 12px/1 "Inter", sans-serif;
  color: #1a0e02;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.eddb-account-name { letter-spacing: 0.2px; }

/* ---------- Commander cards (profile dashboard) ---------- */
.cmdr-card {
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  transition: border-color 120ms;
}
.cmdr-card:hover { border-color: var(--border); }

.cmdr-card-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
}
.cmdr-card-title { flex: 1; min-width: 0; }
.cmdr-card-title h3 {
  margin: 0;
  font: 600 17px/1.1 "Inter", sans-serif;
  color: var(--text-strong);
}
.cmdr-card-title .meta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-faint);
}
.cmdr-forget { color: var(--text-faint); }
.cmdr-forget:hover { color: var(--red); background: rgba(248, 81, 73, 0.08); }

.cmdr-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  margin-bottom: var(--sp-3);
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
}
.cmdr-kpis .kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg-2);
}
.cmdr-kpis .kpi-label {
  font: 700 9px/1 "JetBrains Mono", monospace;
  letter-spacing: 1.5px;
  color: var(--text-faint);
  text-transform: uppercase;
}
.cmdr-kpis .kpi-value {
  font: 700 18px/1 "Inter", sans-serif;
  color: var(--text-strong);
}
.cmdr-kpis .kpi-value small {
  font: 500 12px/1 "Inter", sans-serif;
  color: var(--text-muted);
  margin-left: 2px;
}
.cmdr-kpis .kpi-text { font-size: 14px; }

.cmdr-ship-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--sp-3);
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(255, 136, 0, 0.08), rgba(255, 136, 0, 0.02));
  border: 1px solid rgba(255, 136, 0, 0.20);
  border-radius: var(--r-md);
}
.cmdr-ship-strip .ship-type {
  font: 600 14px/1 "Inter", sans-serif;
  color: var(--text-strong);
}
.cmdr-ship-strip .ship-name {
  margin-left: 8px;
  font: 400 13px/1 "Inter", sans-serif;
  color: var(--text-muted);
}
.cmdr-ship-strip .ship-ident {
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 11px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  color: var(--text-faint);
}

.cmdr-details-grid { display: flex; flex-direction: column; gap: 6px; }
.cmdr-detail {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.015);
  overflow: hidden;
}
.cmdr-detail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 10px 14px;
  font: 600 12.5px/1 "Inter", sans-serif;
  color: var(--text-muted);
  user-select: none;
  transition: background 100ms, color 100ms;
}
.cmdr-detail summary > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.cmdr-detail summary svg { opacity: 0.7; }
.cmdr-detail summary:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.cmdr-detail[open] summary {
  color: var(--orange-500);
  border-bottom: 1px solid var(--border-subtle);
}
.cmdr-detail[open] summary svg { opacity: 1; }
.cmdr-detail > *:not(summary) { padding: var(--sp-3) var(--sp-4); }

.rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 6px;
}
.rank-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
}
.rank-chip .label { font: 700 9px/1 "JetBrains Mono", monospace; color: var(--text-faint); letter-spacing: 1px; }
.rank-chip .value { font: 700 16px/1 "Inter", sans-serif; color: var(--text-strong); margin-top: 6px; }

.engineer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
}
.engineer-list li {
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--border-subtle);
}
.engineer-list strong { display: block; margin-bottom: 2px; }

.table-condensed td, .table-condensed th {
  padding: 6px 8px;
  font-size: 12px;
}

/* ---------- Trade-search live session card ---------- */
.session-card {
  margin-bottom: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(180deg, rgba(255,136,0,0.04), rgba(255,255,255,0.01));
  border-left: 3px solid var(--orange-500);
}
.session-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--sp-2);
  font-size: 13px;
}
.session-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-3);
  padding-top: var(--sp-2);
}
.session-card-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}
.session-card-grid .label {
  font: 700 9px/1 "JetBrains Mono", monospace;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.session-card-grid .value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-strong);
}
.session-card-grid .value small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px;
}
.session-card-foot { text-align: center; }

/* Plugin-locked inputs in the trade form: visually clearly read-only,
   but still styled as 'data' rather than a disabled grey hole. */
.is-plugin-locked {
  background: rgba(255, 136, 0, 0.06) !important;
  border-color: rgba(255, 136, 0, 0.25) !important;
  color: var(--text-strong) !important;
  cursor: not-allowed;
  pointer-events: none;          /* really can't focus / select / edit */
  font-weight: 600;
}
.is-plugin-locked:focus { outline: none; }
.session-card-foot {
  margin: var(--sp-2) 0 0;
  font-size: 11px;
}

/* === Sell-cargo search === */
.sell-card h3 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.sell-card h3 .sell-name { font-size: 15px; color: var(--text); font-weight: 600; }
.sell-card h3 .sell-sys { font-size: 12px; color: var(--text-faint); }
.sell-card h3 .sell-total {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 20px; font-weight: 700; color: var(--green);
}
.sell-breakdown {
  display: flex; flex-direction: column; gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.sell-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.6fr) repeat(3, minmax(78px, 1fr)) minmax(118px, 1.3fr);
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.sell-row .sell-commodity { font-weight: 600; color: var(--text); font-size: 13px; }
.sell-row .sell-commodity small {
  display: block; color: var(--text-faint); font-weight: 400; font-size: 11px;
}
.sell-col {
  font-family: var(--font-mono); font-size: 12px;
  text-align: right; color: var(--text-muted);
}
.sell-col small {
  display: block; font-family: var(--font-ui);
  color: var(--text-faint); font-size: 10px; letter-spacing: .02em;
}
.sell-col.is-margin { color: var(--text); }
.sell-row .sell-profit {
  font-family: var(--font-mono); font-size: 14px;
  text-align: right; color: var(--green); font-weight: 700;
}
.sell-partial {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: var(--r-pill); font-size: 10px;
  background: var(--red-bg); color: var(--red);
}
.sell-paid-auto { color: var(--text-faint); font-size: 10px; }

/* === Mining === */
/* Material picker: hidden native checkbox, the <span> renders as a toggle
   pill that matches the site's .pill chips (orange when selected). */
.mining-materials {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
}
.mining-mat { cursor: pointer; }
.mining-mat input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.mining-mat span {
  display: inline-block; padding: 5px 11px; line-height: 1.3;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--bg-3); color: var(--text-muted);
  font-size: 12px;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.mining-mat:hover span { border-color: var(--border-strong); color: var(--text); }
.mining-mat input:checked + span {
  background: var(--orange-500); border-color: var(--orange-500);
  color: var(--bg-0); font-weight: 600;
}
.mining-mat input:focus-visible + span {
  outline: 2px solid var(--orange-300); outline-offset: 1px;
}
.mining-result h3 small {
  font-weight: 400; color: var(--text-faint); font-size: 12px; margin-left: 6px;
}
.mining-table { width: 100%; border-collapse: collapse; margin-top: var(--sp-2); font-size: 12.5px; }
.mining-table th {
  text-align: left; color: var(--text-faint); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  padding: var(--sp-1) var(--sp-2); border-bottom: 1px solid var(--border-subtle);
}
.mining-table th.num { text-align: right; }
.mining-table td {
  padding: var(--sp-2); border-bottom: 1px solid var(--border-subtle); color: var(--text);
}
.mining-table tr:last-child td { border-bottom: 0; }
.mining-table tbody tr:hover td { background: var(--bg-3); }
.mining-table .num { text-align: right; font-family: var(--font-mono); }
.mining-table td small { display: block; font-size: 10.5px; }
