:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #18202a;
  --muted: #64717f;
  --line: #d9dee5;
  --accent: #1769aa;
  --accent-strong: #0b4f83;
  --signal: #e84c3d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: stretch;
  min-height: 520px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 64px);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--signal);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.status {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.status strong {
  color: var(--ink);
}

.installer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 28px;
  min-height: 48px;
}

.install-button {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.install-button:hover {
  background: var(--accent-strong);
}

.install-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.erase-note {
  max-width: 28ch;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.flash-panel {
  margin-top: 18px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

#flash-status[data-state="busy"] {
  color: var(--accent-strong);
}

#flash-status[data-state="success"] {
  color: #14784f;
}

#flash-status[data-state="error"] {
  color: var(--signal);
}

progress {
  width: 100%;
  height: 12px;
  margin-top: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e3e8ee;
}

progress::-webkit-progress-bar {
  background: #e3e8ee;
}

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

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

.flash-log {
  width: 100%;
  max-height: 150px;
  margin: 14px 0 0;
  padding: 12px 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
  color: #d6e2ee;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.note {
  max-width: 46ch;
  margin: 24px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.release-link {
  width: fit-content;
  margin-top: 20px;
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.release-link:hover {
  text-decoration: underline;
}

.module-photo {
  min-height: 100%;
  margin: 0;
  background: #dde6ee;
}

.module-photo img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.details div {
  min-width: 0;
  padding: 18px 20px;
  background: var(--surface);
}

.details span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.details strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.96rem;
}

@media (max-width: 780px) {
  .shell {
    width: min(100% - 20px, 560px);
    padding: 16px 0;
  }

  .tool,
  .details {
    grid-template-columns: 1fr;
  }

  .tool {
    min-height: 0;
  }

  .copy {
    padding: 28px;
  }

  h1 {
    max-width: 10ch;
    font-size: clamp(2.2rem, 13vw, 3.7rem);
  }

  .module-photo {
    min-height: 260px;
  }

  .install-button {
    width: 100%;
  }

  .erase-note {
    width: 100%;
  }
}
