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

:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --border:    #2a2d3a;
  --text:      #e2e8f0;
  --muted:     #94a3b8;
  --accent:    #6366f1;
  --accent-fg: #ffffff;
  --green:     #22c55e;
  --radius:    8px;
  --gap:       1.5rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  padding: var(--gap);
}

main {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

header {
  padding-top: 1rem;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

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

.hidden {
  display: none !important;
}

/* Device info */
dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
}

dt {
  color: var(--muted);
  font-size: 0.875rem;
}

dd {
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Run button */
#run-btn {
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity 0.15s;
}

#run-btn:hover  { opacity: 0.9; }
#run-btn:active { opacity: 0.75; }
#run-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Progress */
#progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#progress-text {
  font-size: 0.875rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

progress {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  appearance: none;
  background: var(--border);
  overflow: hidden;
}

progress::-webkit-progress-bar   { background: var(--border); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar      { background: var(--accent); }

/* Results table */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-family: ui-monospace, monospace;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

/* Improvement column — highlight it */
tbody td:last-child {
  color: var(--green);
  font-weight: 600;
}

.na {
  color: var(--muted);
  font-style: italic;
  font-family: system-ui, sans-serif;
}

.note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

/* Footer */
footer {
  padding-bottom: 2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

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

footer a:hover {
  text-decoration: underline;
}
