/* Self-hosted fonts (latin subset) — no third-party requests. */
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/chakra-petch-500.woff2") format("woff2");
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/chakra-petch-600.woff2") format("woff2");
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/chakra-petch-700.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
}

:root {
  --bg: #101419;
  --panel: #161C23;
  --panel-2: #1B222B;
  --line: #2A333D;
  --text: #D8DEE4;
  --muted: #7E8A96;
  --caldari: #6B93BD;
  /* Lightened from Warzone Companion's #C4574A — that shade fails WCAG AA
     (3.9:1) at normal text size against --panel/--panel-2; this passes
     4.5:1+ against both. */
  --danger: #D6695C;
  --good: #3FA98C;
  --font-display: "Chakra Petch", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 24px 64px; }

/* ---------- Header ---------- */
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px 0 16px;
}
.brand h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.brand h1 span { color: var(--muted); font-weight: 500; }
.brand p { color: var(--muted); font-size: 13px; margin-top: 2px; }

.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn.active-mode { border-color: var(--caldari); color: var(--caldari); }

button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--caldari);
  outline-offset: 2px;
}

.timestamp { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ---------- Board switcher (New Eden / Exordium — no route between them) ---------- */
.board-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.board-nav a {
  display: inline-block;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
}
.board-nav a:hover { color: var(--text); }
.board-nav a.active { color: var(--text); border-bottom-color: var(--caldari); }

/* ---------- Section title ---------- */
.section-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 32px 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title:first-child { margin-top: 0; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
/* Each label+control pair wraps as one unit — never splits the label onto
   one line and its input onto the next. */
.field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.toolbar label { font-size: 13px; color: var(--muted); }
.toolbar select,
.toolbar input[type="text"],
.toolbar input[type="number"] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 10px;
}
.toolbar input[type="text"] { width: 180px; }
.toolbar input[type="number"] { width: 90px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] { accent-color: var(--caldari); cursor: pointer; }
.jobs-count { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ---------- Table ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 620px; }

/* On narrow screens the table is wider than the viewport (Reward/Value/State
   sit off-screen) and there's otherwise no hint that it scrolls sideways —
   mobile browsers auto-hide scrollbars, so without this the columns are
   effectively invisible. */
.scroll-hint { display: none; }
@media (max-width: 700px) {
  .scroll-hint {
    display: block;
    font-size: 11px;
    color: var(--muted);
    text-align: right;
    margin: -6px 0 8px;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
thead th {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
tbody td { padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }

td.mono { font-family: var(--font-mono); font-size: 13px; }
td .sub { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }

.vp-bar {
  position: relative;
  height: 10px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
  min-width: 120px;
}
.vp-bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 2px; }

.status-pill { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.status-pill.hot { color: var(--danger); }
.status-pill.good { color: var(--good); }
/* De-emphasized state, without opacity — --muted is already at the WCAG AA
   contrast floor against --panel-2, so dimming it further would fail. */
.status-pill.dim { font-style: italic; }

/* ---------- Freelance job rows ---------- */
.job-row { cursor: pointer; }
.job-detail td {
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 24px;
  font-size: 13px;
  margin-bottom: 8px;
}
.dlabel { color: var(--muted); margin-right: 6px; }
.job-desc { font-size: 13px; color: var(--text); white-space: pre-line; }

/* ---------- States ---------- */
.loading, .error-box {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}
.error-box { color: var(--danger); }
.hidden { display: none !important; }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.faq-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 16px;
}
.faq-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.faq-item summary:hover { color: #fff; }
.faq-item p {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

/* ---------- Legal ---------- */
.legal { max-width: 760px; }
.legal h2 {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 32px 0 10px;
}
.legal h2:first-child { margin-top: 0; }
.legal h3 { font-size: 15px; margin: 18px 0 6px; }
.legal p, .legal li { font-size: 14px; line-height: 1.7; }
.legal ul { margin: 6px 0 6px 20px; }
.legal a { color: var(--caldari); }

/* ---------- Footer ---------- */
footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
footer .mono { font-family: var(--font-mono); }
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }
.footer-family a { margin-right: 12px; }

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
  .wrap { padding: 0 12px 48px; }
  header { padding: 18px 0 12px; }
  .brand h1 { font-size: 20px; }
  thead th { padding: 8px 8px; font-size: 11px; }
  tbody td { padding: 7px 8px; font-size: 12.5px; }
  td.mono { font-size: 11.5px; }
  .vp-bar { min-width: 70px; }
  .toolbar input[type="text"] { width: 140px; }
}
