:root {
  --bg: #0d0f14;
  --panel: #141821;
  --panel-2: #1b2130;
  --line: #262d3d;
  --text: #e7ecf5;
  --muted: #8b94a7;
  --accent: #ffd166;
  --accent-2: #4ea1ff;
  --danger: #ff7a7a;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(78, 161, 255, 0.12), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(255, 209, 102, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

.site-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font: 700 1.4rem/1 Georgia, "Times New Roman", serif;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand span { color: var(--accent); }

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

.app {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.step-head { margin-bottom: 1.5rem; }
.step-count {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.step-head h1 { margin: 0 0 0.25rem; font-size: 1.6rem; font-weight: 700; }
.step-subtitle { margin: 0; color: var(--muted); }

.step-body { min-height: 120px; }

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.mode-card {
  display: block;
  cursor: pointer;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}
.mode-card input { position: absolute; opacity: 0; }
.mode-card .mode-title { font-weight: 600; }
.mode-card .mode-desc { color: var(--muted); font-size: 0.85rem; margin: 0.25rem 0 0; }
.mode-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

label.field-label { display: block; font-weight: 600; margin: 0 0 0.4rem; }
textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 0.75rem;
  font: inherit;
}
textarea:focus { outline: none; border-color: var(--accent-2); }

.hint { color: var(--muted); font-size: 0.85rem; margin-top: 0.4rem; }
.error { color: var(--danger); font-size: 0.85rem; margin-top: 0.4rem; }

.review dl { display: grid; gap: 0.75rem; margin: 0; }
.review dt { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.review dd { margin: 0; white-space: pre-wrap; }

.step-nav { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 1.75rem; }
.step-nav.spacer { justify-content: flex-end; }

.btn {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 600;
  background: var(--panel-2);
  color: var(--text);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: #141003; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.result-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.9rem;
  background: var(--panel-2);
}
.result-block h2 { margin: 0 0 0.4rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-2); }
.result-block p { margin: 0; white-space: pre-wrap; }
.result-block ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }

.notice {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 1rem;
  color: var(--muted);
  background: var(--panel-2);
}

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,0.35);
  border-top-color: #141003;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 0.4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.site-footer p { margin: 0; }
.noscript { max-width: 720px; margin: 2rem auto; padding: 0 1.25rem; }

@media (max-width: 520px) {
  .mode-grid { grid-template-columns: 1fr; }
  .step-nav { flex-direction: column-reverse; }
}
