:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --border: #2f4058;
  --text: #e8edf4;
  --muted: #8fa3bf;
  --accent: #4da3ff;
  --accent-dim: #2d6db5;
  --ok: #3ecf8e;
  --warn: #f5a623;
  --danger: #ff6b6b;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem;
}

header.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

header.site-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

nav.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

nav.site-nav a {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
}

nav.site-nav a:hover,
nav.site-nav a.active {
  background: var(--surface-2);
  border-color: var(--accent-dim);
  color: var(--accent);
  text-decoration: none;
}

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

.card h2,
.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat {
  text-align: center;
}

.stat .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat .label {
  color: var(--muted);
  font-size: 0.875rem;
}

label {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 120px;
  font-family: var(--mono);
  font-size: 0.8125rem;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

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

button.secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

button.secondary:hover {
  border-color: var(--accent-dim);
  background: var(--surface);
}

button.danger {
  background: #8b2e2e;
  border-color: #8b2e2e;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 1rem;
}

.toolbar .field {
  flex: 1;
  min-width: 140px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table.data th,
table.data td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

table.data th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

table.data tbody tr {
  cursor: pointer;
}

table.data tbody tr:hover {
  background: var(--surface-2);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.high,
.badge.medium {
  background: rgba(245, 166, 35, 0.2);
  color: var(--warn);
}

.badge.low {
  background: rgba(62, 207, 142, 0.15);
  color: var(--ok);
}

.badge.new {
  background: rgba(77, 163, 255, 0.15);
  color: var(--accent);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8125rem;
}

.status-pill.ok {
  background: rgba(62, 207, 142, 0.15);
  color: var(--ok);
}

.status-pill.err {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert.error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffb4b4;
}

.alert.info {
  background: rgba(77, 163, 255, 0.12);
  border: 1px solid rgba(77, 163, 255, 0.35);
  color: #b8d9ff;
}

pre.json {
  margin: 0;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.heatmap-wrap {
  overflow: auto;
}

.heatmap-table {
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 0.75rem;
}

.heatmap-table th,
.heatmap-table td {
  padding: 0.35rem 0.45rem;
  min-width: 2.5rem;
  text-align: center;
  border-radius: 3px;
}

.heatmap-table th {
  color: var(--muted);
  font-weight: 500;
  background: transparent;
}

.heatmap-table td.student {
  text-align: left;
  min-width: 160px;
  background: var(--surface-2);
  position: sticky;
  left: 0;
  z-index: 1;
}

.detail-panel {
  margin-top: 1rem;
}

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

.small {
  font-size: 0.8125rem;
}

.hero-card {
  background: linear-gradient(135deg, #1a2332 0%, #1e3a5f 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.hero-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.steps > li {
  position: relative;
  padding: 1rem 1rem 1rem 3.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 0.75rem;
}

.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 1rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
}

.steps > li.done::before {
  background: var(--ok);
  content: '✓';
}

.steps > li h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.steps > li p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.step-result {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.fake-lms {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: var(--bg);
}

.fake-lms h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.fake-lms .lms-meta {
  color: var(--muted);
  font-size: 0.8125rem;
  margin-bottom: 0.75rem;
}

.network-log {
  max-height: 280px;
  overflow: auto;
}

.network-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  font-family: var(--mono);
}

.network-item .ok {
  color: var(--ok);
}

.network-item .err {
  color: var(--danger);
}

.guide-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.guide-list li {
  margin-bottom: 0.35rem;
}

.scenario-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.scenario-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  background: var(--bg);
}

.scenario-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.scenario-card p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.8125rem;
  min-height: 2.6em;
}

.config-compact {
  display: none;
}

.config-compact.open {
  display: block;
}

.config-toggle {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0;
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: underline;
}

.config-toggle:hover {
  color: var(--accent);
  background: transparent;
  border: none;
}

.split {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .split.has-detail {
    grid-template-columns: 1.2fr 0.8fr;
  }
}
