:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1b2130;
  --muted: #5a6376;
  --border: #d8dce4;
  --accent: #2355d0;
  --accent-text: #ffffff;
  --danger: #b42318;
  --note-bg: #fff6df;
  --note-border: #e9bf55;
  --radius: 10px;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101319;
    --surface: #191e27;
    --text: #e6e9ef;
    --muted: #9aa3b5;
    --border: #2d3441;
    --accent: #7095ff;
    --accent-text: #0b1020;
    --danger: #ff8b7b;
    --note-bg: #2a2314;
    --note-border: #7a6225;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.fixer {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 16px 64px;
}

.fixer__title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  line-height: 1.2;
}

.fixer__intro {
  margin: 0 0 24px;
  max-width: 65ch;
  color: var(--muted);
}

.upload,
.results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.upload {
  display: grid;
  gap: 20px;
}

.upload__label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.upload__input {
  font: inherit;
  color: inherit;
  max-width: 100%;
}

.upload__input::file-selector-button {
  margin-right: 12px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.upload__hint {
  margin: 6px 0 0;
  max-width: 65ch;
  color: var(--muted);
  font-size: 0.875rem;
}

.upload__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.upload__status {
  margin: 0;
  color: var(--muted);
}

.upload__status--error {
  color: var(--danger);
  font-weight: 600;
}

.button {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

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

.results {
  margin-top: 24px;
}

.results__heading {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.results__summary {
  margin: 0 0 16px;
}

.results__download {
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.results__notes {
  margin: 0 0 16px;
  padding: 12px 16px 12px 32px;
  border: 1px solid var(--note-border);
  border-radius: 6px;
  background: var(--note-bg);
}

.results__notes li + li {
  margin-top: 6px;
}

.results__table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
}

.results__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.results__caption {
  margin-bottom: 8px;
  text-align: left;
  font-weight: 600;
}

.results__table th,
.results__table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.results__table thead th {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.results__table tbody th {
  font-weight: 400;
}

.results__table .results__col--numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.results__mac,
.results__macs {
  font-family: var(--mono);
  font-size: 0.875rem;
}

.results__hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.results__uncorrected summary {
  cursor: pointer;
}

.results__macs {
  margin: 8px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}
