:root {
  --brand: #7c5cff;
  --brand-dark: #6a4bea;
  --brand-glow: rgba(124, 92, 255, 0.32);
  --bg: #17171d;
  --card: #1e1e24;
  --text: #f0ede8;
  --text-muted: #9a9aa4;
  --border: #2d2d36;
  --soft: #202028;
  --amber-bg: #2a1d0d;
  --amber-border: #5c4218;
  --amber-fg: #ffc46b;
  --blue-bg: #151331;
  --blue-border: #312a63;
  --blue-fg: #b9aaff;
  --green: #4dd0a1;
  --red: #ff6b6b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 44px rgba(0, 0, 0, 0.55);
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 460px at 90% -10%, rgba(124, 92, 255, 0.16), transparent 60%),
    radial-gradient(700px 380px at 0% 0%, rgba(77, 208, 161, 0.08), transparent 55%);
  color: var(--text);
  margin: 0;
  padding: 52px 24px 80px;
  line-height: 1.5;
  overflow-x: hidden;
}
.wrap { max-width: 920px; margin: 0 auto; }

.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.brand img { width: 46px; height: 46px; border-radius: 12px; box-shadow: var(--shadow); }
.brand-text { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand h1 { font-family: var(--font-display); font-size: 1.55rem; margin: 0; letter-spacing: -0.02em; font-weight: 700; }
.version {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-glow);
  border-radius: 999px;
  padding: 3px 9px;
}
.tagline { color: var(--text-muted); margin: 0 0 26px; font-size: 0.95rem; max-width: 64ch; }

.notice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; margin-bottom: 20px; }
@media (max-width: 760px) {
  .notice-row { grid-template-columns: 1fr; }
}

.notice {
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.87rem;
  margin-bottom: 14px;
  border: 1px solid;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: rise 0.4s ease both;
}
.notice-icon { flex-shrink: 0; margin-top: 2px; }
.notice.amber { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-fg); }
.notice.blue { background: var(--blue-bg); border-color: var(--blue-border); color: var(--blue-fg); }
.notice strong { display: block; margin-bottom: 4px; color: var(--text); font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.notice p { margin: 0; color: var(--text-muted); }
.notice code { background: rgba(127, 127, 127, 0.18); padding: 1px 6px; border-radius: 5px; font-size: 0.85em; font-family: var(--font-mono); color: var(--text); }

label, .label { display: block; font-weight: 600; font-size: 0.9rem; margin: 0 0 8px; font-family: var(--font-display); }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.hint { color: var(--text-muted); font-size: 0.8rem; margin-top: 6px; }
.hint code, .steps code { background: rgba(127, 127, 127, 0.18); padding: 1px 6px; border-radius: 5px; font-size: 0.9em; color: var(--text); font-family: var(--font-mono); }

input[type="password"], input[type="text"], select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-glow);
}

details.advanced {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0;
  overflow: hidden;
  margin-top: 14px;
  background: rgba(127, 127, 127, 0.03);
}
details.advanced summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 12px 14px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  color: var(--text-muted);
}
details.advanced summary:hover { color: var(--text); }
details.advanced summary::-webkit-details-marker { display: none; }
.chev { flex-shrink: 0; color: var(--text-muted); transition: transform 0.18s ease; }
details.advanced[open] .chev { transform: rotate(90deg); }
details.advanced .inner { padding: 2px 14px 16px; }
details.advanced + details.advanced { margin-top: 10px; }

.steps { margin: 4px 0 0; padding-left: 20px; font-size: 0.87rem; color: var(--text-muted); }
.steps li + li { margin-top: 8px; }
.steps a { color: var(--brand); }
.steps strong { color: var(--text); }

.actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; align-items: center; }
button, .btn-primary, .btn-secondary {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 11px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}
button:active:not(:disabled) { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 6px 16px var(--brand-glow); text-decoration: none; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 10px 24px var(--brand-glow); transform: translateY(-1px); }
.btn-secondary { background: rgba(127, 127, 127, 0.12); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: rgba(127, 127, 127, 0.2); }

.link-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 0.83rem;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.link-btn:hover { text-decoration: underline; }

.status { margin-top: 14px; font-size: 0.85rem; display: none; align-items: center; gap: 7px; }
.status.show { display: flex; animation: rise 0.25s ease both; }
.status.ok { color: var(--green); }
.status.err { color: var(--red); }
.status.pending { color: var(--brand); }
.status span:last-child { color: var(--text); }

.resolved {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 11px;
  background: rgba(127, 127, 127, 0.04);
}
.resolved-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.resolved-value { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text); direction: ltr; text-align: left; overflow-wrap: anywhere; }

.stepper { display: flex; flex-direction: column; margin-top: 6px; }
.step { animation: rise 0.4s ease both; }
.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px 26px;
  margin-bottom: 20px;
  min-width: 0;
}
.step-head { margin-bottom: 18px; }
.step-head h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 3px; letter-spacing: -0.01em; }
.card-sub { color: var(--text-muted); font-size: 0.82rem; margin: 0; }
.step-last .step-card { margin-bottom: 0; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .grid { grid-template-columns: 1fr; } }
.mini {
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px;
  min-width: 0;
}
.mini-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mini .k { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; margin-bottom: 6px; }
.mini .v { font-size: 1rem; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.mini .v.small { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #6b7280; box-shadow: 0 0 0 4px rgba(107, 114, 128, 0.15); flex: 0 0 auto; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 4px rgba(77, 208, 161, 0.18); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.18); }

.result {
  padding-top: 4px;
  animation: rise 0.3s ease both;
}
.result-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; font-family: var(--font-display); }
.url-row { display: flex; gap: 8px; align-items: stretch; }
.url-box {
  flex: 1;
  min-width: 0;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow-x: auto;
  color: var(--text);
  direction: ltr;
  text-align: left;
}
.copy-btn.copied { background: var(--green); color: #101014; }
.install-link { width: 100%; margin-top: 14px; text-decoration: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

footer { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin-top: 16px; }
footer a { color: var(--brand); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 520px) {
  body { padding: 28px 14px 56px; }
  .brand img { width: 38px; height: 38px; }
  .brand h1 { font-size: 1.3rem; }
  .step-card { padding: 18px 16px 20px; border-radius: 13px; }
  .step-head { margin-bottom: 14px; }
  .step-head h2 { font-size: 1rem; }
  .notice { padding: 12px 14px; font-size: 0.83rem; }
  input[type="password"], input[type="text"], select { padding: 11px 13px; font-size: 1rem; }
  .url-row { flex-direction: column; }
  .url-box { font-size: 0.76rem; padding: 11px 12px; }
  .copy-btn { width: 100%; }
  .actions button { width: 100%; }
  .link-btn { width: auto; }
}
