:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #102033;
  --muted: #64748b;
  --line: #d8e0ec;
  --soft: #eef4fb;
  --primary: #1e293b;
  --primary-2: #334155;
  --accent: #16a34a;
  --accent-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --focus: #2563eb;
  --shadow: 0 20px 60px rgb(15 23 42 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  accent-color: var(--accent);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgb(34 197 94 / 12%), transparent 32rem),
    linear-gradient(135deg, #f8fafc 0%, var(--bg) 58%, #e8eef7 100%);
}

button,
input {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
}

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

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

.skip-link {
  position: absolute;
  inset-block-start: 1rem;
  inset-inline-start: 1rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell-header,
.app-grid {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.shell-header {
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-end;
  padding-block: 2rem 1.2rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  letter-spacing: -0.035em;
}

.lead {
  max-width: 46rem;
  margin-block-start: 0.9rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.55;
}

.eyebrow {
  margin-block-end: 0.45rem;
  color: var(--accent);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.health-card,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  color: var(--primary);
  background: rgb(255 255 255 / 78%);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgb(15 23 42 / 6%);
  white-space: nowrap;
}

.dot {
  width: 0.65rem;
  height: 0.65rem;
  background: var(--warning);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgb(180 83 9 / 12%);
}

.dot.ok {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgb(22 163 74 / 14%);
}

.dot.fail {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgb(220 38 38 / 14%);
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  gap: 1rem;
  padding-block-end: 2rem;
}

.panel {
  background: rgb(255 255 255 / 88%);
  border: 1px solid rgb(216 224 236 / 90%);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.launch-panel,
.progress-panel,
.result-panel,
.history-panel {
  padding: clamp(1rem, 2.5vw, 1.45rem);
}

.launch-panel,
.result-panel {
  grid-column: 1;
}

.progress-panel,
.history-panel {
  grid-column: 2;
}

.progress-panel {
  align-self: start;
}

.history-panel {
  align-self: start;
}

.section-head {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-block-end: 1.15rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-block-end: 1rem;
}

label {
  font-weight: 760;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
}

input::placeholder {
  color: #94a3b8;
}

input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgb(220 38 38 / 9%);
}

.hint,
.error-text,
.current-step,
.empty-state {
  color: var(--muted);
  line-height: 1.5;
}

.error-text {
  min-height: 1.35rem;
  color: var(--danger);
}

.advanced {
  margin-block: 0.4rem 1rem;
  padding: 0.85rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.advanced summary {
  min-height: 42px;
  font-weight: 800;
  cursor: pointer;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-block-start: 0.8rem;
}

.form-actions,
.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.primary-button,
.secondary-button,
.ghost-button,
.download-button {
  padding-inline: 1rem;
  font-weight: 850;
}

.primary-button {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 14px 30px rgb(15 23 42 / 20%);
}

.primary-button:hover {
  background: var(--primary-2);
}

.secondary-button,
.ghost-button,
.download-button {
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--line);
}

.ghost-button {
  min-height: 40px;
  padding-inline: 0.85rem;
}

.download-button.primary {
  color: #064e3b;
  background: var(--accent-soft);
  border-color: #86efac;
}

.disclaimer {
  margin-block-start: 1rem;
  padding: 0.9rem 1rem;
  color: #475569;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 18px;
  line-height: 1.5;
}

progress {
  width: 100%;
  height: 0.8rem;
  border: 0;
  border-radius: 999px;
}

progress::-webkit-progress-bar {
  background: #dbe4ef;
  border-radius: 999px;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
}

.current-step {
  margin-block: 0.9rem 0.3rem;
  font-weight: 760;
}

.activity-line {
  min-height: 1.2rem;
  margin-block-end: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.4;
}

.activity-feed {
  display: grid;
  gap: 0.2rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  color: #94a3b8;
  font-size: 0.8rem;
  line-height: 1.4;
}

.activity-feed li {
  opacity: 0.75;
}

.steps {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.72rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.step-marker {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  color: #fff;
  background: #94a3b8;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.step.done .step-marker {
  background: var(--accent);
}

.step.current {
  border-color: #86efac;
  box-shadow: 0 0 0 4px rgb(22 163 74 / 10%);
}

.step.error {
  border-color: #fecaca;
  background: var(--danger-soft);
}

.step-title {
  display: block;
  font-weight: 850;
}

.step-desc {
  display: block;
  margin-block-start: 0.15rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.42;
}

.status-pill.idle {
  color: #475569;
}

.status-pill.ok {
  color: #166534;
  background: var(--accent-soft);
  border-color: #86efac;
}

.status-pill.warn {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #fcd34d;
}

.status-pill.fail {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fecaca;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.metric {
  min-height: 7rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.metric strong {
  display: block;
  margin-block-end: 0.5rem;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.metric span {
  color: var(--muted);
  line-height: 1.42;
}

.result-notes {
  display: grid;
  gap: 0.55rem;
  margin-block: 1rem;
}

.note {
  padding: 0.8rem 0.9rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  line-height: 1.45;
}

.downloads {
  margin-block-start: 1rem;
}

.history-list {
  display: grid;
  gap: 0.65rem;
}

.history-item {
  width: 100%;
  min-height: auto;
  padding: 0.85rem;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.history-item strong {
  display: block;
  margin-block-end: 0.25rem;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 920px) {
  .shell-header,
  .app-grid {
    width: min(100% - 20px, 720px);
  }

  .shell-header,
  .app-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .launch-panel,
  .progress-panel,
  .result-panel,
  .history-panel {
    grid-column: 1;
  }

  .health-card {
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .shell-header {
    padding-block-start: 1.2rem;
  }

  .advanced-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .form-actions {
    align-items: stretch;
  }

  .section-head {
    flex-direction: column;
  }

  .form-actions > button,
  .downloads > button {
    width: 100%;
  }
}
