:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --text: #18201c;
  --muted: #5d685f;
  --line: #d8ded8;
  --accent: #0b6f63;
  --accent-strong: #07584e;
  --accent-soft: #e5f3ef;
  --warning: #b15d12;
  --danger: #a73535;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(11, 111, 99, 0.08), rgba(177, 93, 18, 0.06)),
    var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.panel {
  width: min(100%, 520px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(24, 32, 28, 0.12);
  padding: clamp(24px, 5vw, 40px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.12;
}

.lead {
  margin: 16px 0 28px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.wake-form.is-hidden {
  display: none;
}

button {
  height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0 18px;
}

button:focus-visible {
  outline: 3px solid rgba(11, 111, 99, 0.24);
  outline-offset: 2px;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.loading-view {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 4px;
  padding-top: 4px;
}

.loader {
  width: 44px;
  height: 44px;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

.loading-view h2 {
  margin: 0 0 6px;
  font-size: 1.12rem;
  line-height: 1.35;
}

.loading-view p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.progress-list {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.progress-list li {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  padding: 6px 8px;
  text-align: center;
}

.progress-list li.is-current {
  border-color: var(--warning);
  color: var(--warning);
  background: rgba(177, 93, 18, 0.08);
}

.progress-list li.is-done {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.status-block {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  margin-top: 26px;
  color: var(--muted);
}

.status-block p {
  margin: 0;
  line-height: 1.55;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--line);
}

.status-indicator.is-working {
  background: var(--warning);
}

.status-indicator.is-ready {
  background: var(--accent);
}

.status-indicator.is-error {
  background: var(--danger);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader {
    animation: none;
  }
}

@media (max-width: 520px) {
  button {
    width: 100%;
  }

  .loading-view {
    grid-template-columns: 1fr;
  }

  .loader {
    justify-self: start;
  }

  .progress-list {
    grid-template-columns: 1fr;
  }
}
