:root {
  --bg: #0d1117;
  --panel: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --ok: #3fb950;
  --danger: #f85149;
  --accent: #1f6feb;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
h1 { margin: 0; font-size: 18px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px; }
h3 { margin: 0 0 6px; font-size: 16px; }

.actions, .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

main { padding: 16px; max-width: 900px; margin: 0 auto; }

.btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #21262d;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.small { padding: 2px 8px; font-size: 12px; color: var(--danger); }

input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.notice {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
}

.status { margin-bottom: 12px; }
.plain { color: inherit; text-decoration: none; }
.link { color: #58a6ff; }
.fleet-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.fleet-link:last-child { border-bottom: none; }

.filters { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* Map panel title row, with the countdown to the right of the title. */
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }

.countdown {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1.6s linear infinite;
}
.spinner.busy { animation-duration: 0.5s; border-top-color: var(--ok); }

@keyframes spin { to { transform: rotate(360deg); } }
.ok { color: var(--ok); }
.muted { color: var(--muted); font-size: 12px; }

.system {
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}
.count { color: var(--muted); font-size: 12px; font-weight: normal; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.list li:last-child { border-bottom: none; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
}
.docked .dot { background: var(--muted); }
.docked .name { color: var(--muted); }

.name { font-weight: 600; }
.state { font-size: 12px; color: var(--muted); }
/* Ship type is secondary to the name and location. */
.ship { margin-left: auto; font-size: 11px; color: var(--muted); }

.sub { font-size: 12px; color: var(--muted); }

.sec {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}
.sec-blue { color: #58a6ff; border: 1px solid #58a6ff; }
.sec-green { color: #3fb950; border: 1px solid #3fb950; }
.sec-orange { color: #f0883e; border: 1px solid #f0883e; }
.sec-red { color: #f85149; border: 1px solid #f85149; }
.sec-j { color: #a371f7; border: 1px solid #a371f7; }

/* Ship-class icons: 16px PNGs from the EVE University wiki (Bracket set), in icons/bracket/. */
.class-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: middle;
  background-repeat: no-repeat;
  background-size: 16px 16px;
}
.icon-rookie { background-image: url("/icons/bracket/rookie.png"); }
.icon-shuttle { background-image: url("/icons/bracket/shuttle.png"); }
.icon-frigate { background-image: url("/icons/bracket/frigate.png"); }
.icon-destroyer { background-image: url("/icons/bracket/destroyer.png"); }
.icon-cruiser { background-image: url("/icons/bracket/cruiser.png"); }
.icon-battlecruiser { background-image: url("/icons/bracket/battlecruiser.png"); }
.icon-battleship { background-image: url("/icons/bracket/battleship.png"); }
.icon-carrier { background-image: url("/icons/bracket/carrier.png"); }
.icon-dreadnought { background-image: url("/icons/bracket/dreadnought.png"); }
.icon-titan { background-image: url("/icons/bracket/titan.png"); }
.icon-mining-frigate { background-image: url("/icons/bracket/mining-frigate.png"); }
.icon-mining-barge { background-image: url("/icons/bracket/mining-barge.png"); }
.icon-industrial { background-image: url("/icons/bracket/industrial.png"); }
.icon-capital-industrial { background-image: url("/icons/bracket/capital-industrial.png"); }
.icon-capsule { background-image: url("/icons/bracket/capsule.png"); }

.attribution {
  margin-top: 24px;
  font-size: 11px;
  color: var(--muted);
}

#map {
  height: 420px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.panel {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

@media (max-width: 600px) {
  main { padding: 10px; }
  .ship { display: none; }
}

.fleet-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fleet-title { font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0; }
.start-row input, #renameBox input { flex: 1; min-width: 180px; }

/* Links were the browser default (dark blue on the dark background). */
a { color: #58a6ff; }
a:hover { text-decoration: underline; }

/* Map legend under the map. */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--muted); align-items: center; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 16px; height: 10px; border-radius: 2px; border: 1px solid #30363d; }
.sw-occupied { border: 2px solid #f0883e; background: #21262d; }
.sw-wh { background: #2a1f40; border-color: #a371f7; }
.sw-gate { border: 1px dashed #6e7681; background: transparent; }
.sw-used { border: 1px solid #6e7681; background: transparent; }

/* Fleet totals above the list. */
.summary { margin-bottom: 12px; font-size: 13px; color: var(--text); }
.summary .muted { margin-top: 2px; }

/* Text label for a ship class with no icon (Freighter). */
.class-icon-txt { display: inline-block; min-width: 16px; font-size: 10px; font-weight: 600; color: var(--muted); flex-shrink: 0; }

input[type="checkbox"] { accent-color: var(--accent); }
