:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #F76F59;
  --accent-text: #1a1a1a;
  --border: #ddd;
  --error: #c0392b;
  --success: #1e8e3e;
  --warning: #a35b00;
  --warning-bg: #fff6e5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15161a;
    --text: #e8e8e8;
    --muted: #9a9a9a;
    --accent: #F76F59;
    --accent-text: #1a1a1a;
    --border: #333;
    --error: #ff6b5e;
    --success: #4fd17a;
    --warning: #f2b450;
    --warning-bg: #2a2110;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem 1rem;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

main {
  max-width: 560px;
  margin: 0 auto;
}

.logo-band {
  /* Full-bleed dark band regardless of page theme - the logo is a fixed
     white asset (fill: #f1f0f0, no dark-mode counterpart provided), so it
     needs a background that doesn't depend on --bg to stay legible. */
  background: #0b0b0c;
  margin: -2rem -1rem 2rem;
  padding: 1.25rem 1rem;
  display: flex;
  justify-content: center;
}

.logo {
  width: 180px;
  height: auto;
  display: block;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.intro {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.version {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.browser-warning {
  display: none;
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.step {
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  margin-bottom: 0;
}

/* Connect the three numbered steps into one continuous block - overlap
   borders by 1px between consecutive steps instead of a doubled-up line. */
.step + .step {
  margin-top: -1px;
}

.step h2 {
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step ol {
  padding-left: 1.25rem;
  margin: 0.5rem 0 0;
}

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

button {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  cursor: pointer;
}

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

.device-info {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

progress {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  height: 10px;
}

.warning {
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.log-section {
  margin-top: 1.5rem;
}

.log-section h2,
.notes-section h2 {
  font-size: 1.05rem;
}

.notes-section {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
}

.notes-section h2 {
  margin-top: 0;
}

/* Older releases listed below the latest one */
.notes-section h2:not(:first-child) {
  margin-top: 1.25rem;
}

.notes-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 1rem 0 0.35rem;
}

.notes-section ul {
  padding-left: 1.25rem;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.25em;
}

.notes-section li {
  margin-bottom: 0.35rem;
}

/* Desktop: steps on the left, status + version notes in a second column.
   Below this width everything stacks in the original single-column order
   (steps, status, notes). */
@media (min-width: 900px) {
  main {
    max-width: 1040px;
  }

  .layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
  }

  /* Status is the first thing in the side column - line it up with the
     top of the steps instead of keeping the stacked-layout gap. */
  .col-side .log-section {
    margin-top: 0;
  }

  .col-side .log-section h2 {
    margin-top: 0;
  }

  #log {
    min-height: 160px;
  }
}

#log {
  background: #000;
  color: #c8f0c8;
  padding: 0.75rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.log-error { color: #ff8a80; }
.log-success { color: #b9f6ca; }

/* Collapsible list of older releases under the latest notes */
.previous-versions {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.previous-versions summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.9rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}

.previous-versions summary::-webkit-details-marker {
  display: none;
}

.previous-versions summary::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.previous-versions[open] summary::before {
  transform: rotate(45deg);
}

.previous-versions summary:hover,
.previous-versions summary:focus-visible {
  color: var(--text);
}

.previous-versions h2:first-of-type {
  margin-top: 1rem;
}
