:root {
  color-scheme: light dark;
  --bg: #f6f5f1;
  --card: #ffffff;
  --text: #1c1b19;
  --muted: #6b675f;
  --line: #dedbd2;
  --accent: #1f6f5c;
  --accent-text: #ffffff;
  --bad: #b3261e;
  --good: #1f6f5c;
  --code: #efede7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161614;
    --card: #1f1f1c;
    --text: #ebe8e0;
    --muted: #a09b90;
    --line: #34332e;
    --accent: #5fbfa6;
    --accent-text: #10201b;
    --bad: #f2867f;
    --good: #5fbfa6;
    --code: #2a2a26;
  }
}

* {
  box-sizing: border-box;
}

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

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
}

header p {
  margin: 0.25rem 0 1.5rem;
  color: var(--muted);
}

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

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.num {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.85rem;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1rem;
  /* Scrolls sideways on a narrow screen. The line under the tabs is a shadow,
     not a border, so the active tab's underline can cover it without overflowing. */
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: inset 0 -1px var(--line);
}

.tabs button {
  flex: none;
  white-space: nowrap;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-weight: 600;
}

.tabs button[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

button,
select {
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
}

button {
  cursor: pointer;
}

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

button.small {
  margin-left: auto;
  padding: 0.1rem 0.6rem;
  font-size: 0.8rem;
  font-weight: normal;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.check {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.steps {
  margin: 0;
  padding-left: 1.25rem;
}

code,
pre {
  font: 0.85rem/1.45 ui-monospace, monospace;
  background: var(--code);
  border-radius: 4px;
}

code {
  padding: 0.1rem 0.3rem;
}

pre {
  margin: 0.5rem 0;
  padding: 0.6rem 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

#log {
  min-height: 6rem;
  max-height: 20rem;
  overflow-y: auto;
}

details {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

summary {
  cursor: pointer;
}

table.files {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

table.files th,
table.files td {
  text-align: left;
  padding: 0.25rem 0.5rem 0.25rem 0;
  border-bottom: 1px solid var(--line);
}

table.files th {
  color: var(--muted);
  font-weight: normal;
}

table.files th:not(:first-child),
table.files td.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.files th.l {
  text-align: left;
}

h3 {
  margin: 1.25rem 0 0.25rem;
  font-size: 1rem;
}

table.partitions td {
  vertical-align: top;
}

table.partitions td.name {
  font: 0.85rem/1.6 ui-monospace, monospace;
}

table.partitions td.n {
  white-space: nowrap;
}

table.partitions td.unique {
  font-weight: 600;
}

table.partitions td:last-child {
  width: 7.5rem;
  font-size: 0.85rem;
}

.tag {
  display: inline-block;
  padding: 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.scroll {
  max-height: 22rem;
  overflow-y: auto;
}

.scroll table.files th {
  position: sticky;
  top: 0;
  background: var(--card);
}

.missing {
  color: var(--bad);
}

.good {
  color: var(--good);
  font-weight: 600;
}

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.2rem 1rem;
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

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

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

progress {
  width: 100%;
  height: 0.9rem;
  accent-color: var(--accent);
}

.progress-text {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.notice {
  border-left: 4px solid var(--good);
  padding: 0.5rem 0.75rem;
  background: var(--code);
  border-radius: 4px;
}

.notice.bad {
  border-left-color: var(--bad);
}

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

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

.steps li {
  margin-bottom: 0.35rem;
}

details p,
details ul,
details ol {
  margin: 0.5rem 0;
}

details ul,
details ol {
  padding-left: 1.25rem;
}

details[open] {
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}

details[open] > summary {
  color: var(--text);
  font-weight: 600;
}

/* Once the visitor's system is known (js/os.js), hide instructions for the others. */
html[data-os="windows"] [data-os]:not([data-os~="windows"]),
html[data-os="linux"] [data-os]:not([data-os~="linux"]),
html[data-os="macos"] [data-os]:not([data-os~="macos"]),
html[data-arch] [data-arch-note] {
  display: none;
}

button.link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
}

#os-note {
  margin: -0.75rem 0 1rem;
  font-size: 0.9rem;
}

.video {
  width: 15rem;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  margin: 0.75rem 0 0.25rem;
}

.video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

.needs {
  margin: 0.25rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
