/* Mission Control: dark theme, WCAG AA contrast, readable at 390px and up. */

@font-face {
  font-family: "Work Sans";
  src: url("/static/fonts/work-sans-variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono-variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0e1015;
  --bg-raised: #171a22;
  --bg-card: #1b1f29;
  --border: #323847;
  --text: #eef0f6;
  --text-muted: #b7bccb;
  --accent: #7fd9c4;
  --accent-strong: #4fc3a1;
  --warn: #f3b17a;
  --danger: #f29b9b;
  --ok: #8fd19e;
  --focus: #9ad7ff;
  --font-body: "Work Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-strong);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}

header.topbar h1 {
  font-size: 20px;
  margin: 0;
}

nav.primary {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

nav.primary a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
}

nav.primary a[aria-current="page"],
nav.primary a:hover {
  background: var(--bg-card);
  color: var(--text);
}

main {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.25;
}

h2 {
  font-size: 22px;
  margin-top: 32px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #10131a;
  background: var(--text-muted);
}

.pill.found { background: #d9d3c5; }
.pill.applying { background: #f3cf6f; }
.pill.submitted { background: #7fc1e6; }
.pill.confirmed { background: #8fd19e; }
.pill.interview { background: #c6a0f6; }
.pill.rejected { background: #e39a9a; }
.pill.offer { background: #6fcf97; }
.pill.skipped { background: #9aa0ae; }
.pill.needs-edward { background: #f0a37a; }
.pill.working { background: #7fc1e6; }
.pill.waiting-on-edward { background: #f0a37a; }
.pill.done { background: #8fd19e; }
.pill.failed { background: #e39a9a; }

.guest-banner {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
  flex-basis: 100%;
}

.step {
  font-weight: 500;
}

.muted {
  color: var(--text-muted);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 10px;
  font-size: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

caption {
  text-align: left;
  color: var(--text-muted);
  margin-bottom: 8px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--bg);
}

tbody tr:hover {
  background: var(--bg-raised);
}

.table-scroll {
  overflow-x: auto;
}

form.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

form.filters input,
form.filters select {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 16px;
  font-family: var(--font-body);
}

button, .btn {
  background: var(--accent);
  color: #0a1612;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

button:hover, .btn:hover {
  background: var(--accent-strong);
}

.login-wrap {
  max-width: 360px;
  margin: 15vh auto;
  padding: 24px;
}

.login-wrap label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.login-wrap input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 16px;
}

.error {
  color: var(--danger);
  margin-bottom: 12px;
}

.screenshot {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.field-table td.blank {
  color: var(--text-muted);
  font-style: italic;
}

.chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 24px;
}

.chart-wrap canvas {
  max-height: 320px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.stat .n {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
}

.stat .label {
  color: var(--text-muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.data-text {
  margin-top: 12px;
}

.data-text summary {
  cursor: pointer;
  color: var(--text-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #0a1612;
  padding: 10px 16px;
  z-index: 10;
}

.skip-link:focus {
  left: 10px;
  top: 10px;
}

.colony-stage {
  position: relative;
  width: 100%;
  height: 65vh;
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #0e1015;
  margin-bottom: 16px;
}

.colony-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.colony-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(300px, calc(100% - 24px));
  margin: 0;
}

.colony-panel dl {
  margin: 8px 0;
}

.colony-panel dt {
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.colony-panel dd {
  margin: 0 0 8px 0;
}

#colony-agent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.colony-agent-button {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.colony-agent-button:hover {
  background: var(--bg-raised);
}

@media (max-width: 480px) {
  .colony-stage { height: 50vh; min-height: 280px; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  main { padding: 14px; }
  header.topbar { padding: 12px 14px; }
  .stat .n { font-size: 24px; }
}
