:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --line-strong: #b9c4d3;
  --accent: #0f8f70;
  --accent-strong: #08765c;
  --accent-soft: #e3f5ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  width: min(760px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 18px;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.section-subtitle {
  margin-top: 18px;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}

.panel {
  min-width: 0;
  margin: 12px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.progress {
  min-width: 0;
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.progress-head span {
  color: var(--muted);
  font-size: 13px;
}

.progress-head strong {
  font-size: 15px;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #edf1f6;
}

.progress-fill {
  width: 16.666%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.progress.busy .progress-fill {
  background-image: linear-gradient(
    90deg,
    var(--accent) 0,
    var(--accent) 35%,
    #22b08d 50%,
    var(--accent) 65%,
    var(--accent) 100%
  );
  background-size: 220% 100%;
  animation: progress-pulse 900ms linear infinite;
}

.step-panel.busy {
  border-color: var(--accent);
}

.step-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

.step-list li::before {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto 5px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  content: "";
}

.step-list li.done,
.step-list li.active {
  color: var(--accent-strong);
  font-weight: 700;
}

.step-list li.done::before {
  border-color: var(--accent);
  background: var(--accent);
}

.step-list li.active::before {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 5px #fff;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input[type="text"],
input:not([type]) {
  min-width: 0;
}

input {
  min-width: 0;
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
}

button,
.link {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  overflow-wrap: anywhere;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:disabled,
input:disabled {
  opacity: 0.65;
  cursor: progress;
}

button.primary {
  width: 100%;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

button.primary:active {
  background: var(--accent-strong);
}

button.secondary {
  width: 100%;
  margin-top: 10px;
  margin-bottom: 8px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.segmented .active {
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 700;
}

.domain-preview {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfe;
  color: var(--muted);
  font: 14px/1.35 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}

.check {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 500;
}

.check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.check.error {
  border-color: #d92d20;
  background: #fff1f0;
  color: #b42318;
}

.check.error input {
  outline: 2px solid #d92d20;
  outline-offset: 2px;
}

.legal-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
}

.legal-summary p {
  margin: 0;
}

.legal-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.legal-links a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  text-align: center;
  text-decoration: none;
}

.legal-links a:active {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.files {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  gap: 8px;
  margin-bottom: 10px;
}

.file-card {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfe;
}

.file-title {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 700;
}

.file-label {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.file-content {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font: 13px/1.35 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.file-actions {
  display: grid;
  grid-template-columns: 1fr;
  min-width: 0;
  gap: 8px;
}

.instruction {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
}

.instruction p {
  margin-bottom: 0;
}

.instruction code {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfe;
  color: var(--text);
  font: 14px/1.35 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}

.file-link,
.link {
  display: inline-flex;
  min-width: 0;
  min-height: 68px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  line-height: 1.25;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.message {
  min-height: 0;
  min-width: 0;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hint {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.hidden {
  display: none;
}

@keyframes progress-pulse {
  from {
    background-position: 0 0;
  }

  to {
    background-position: -220% 0;
  }
}

@media (max-width: 520px) {
  .row,
  .file-actions,
  .files,
  .grid,
  .legal-links {
    grid-template-columns: 1fr;
  }

  .step-list {
    gap: 3px;
  }

  .step-list li {
    font-size: 10px;
  }
}
