:root {
  --bg: #f6f7fb;
  --bg-soft: #eef1f7;
  --card: #ffffff;
  --ink: #111827;
  --ink-soft: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e5e7ef;
  --line-strong: #d4d8e3;
  --brand: #fe2c55;
  --brand-deep: #d91f45;
  --brand-soft: #fff0f3;
  --teal: #0f9f8f;
  --teal-soft: #e8faf6;
  --amber: #b45309;
  --amber-soft: #fff7e6;
  --red: #b42318;
  --red-soft: #fff1f0;
  --blue: #175cd3;
  --blue-soft: #eff8ff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 64px rgba(16, 24, 40, 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1180px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 88% -12%, rgba(254, 44, 85, 0.12), transparent 62%),
    radial-gradient(900px 540px at -12% 16%, rgba(15, 159, 143, 0.1), transparent 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(17, 24, 39, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 72%);
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

p,
h1,
h2,
h3,
h4 {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.icon svg {
  width: 1em;
  height: 1em;
  display: block;
}

/* ---------- public shell ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(246, 247, 251, 0.82);
  border-bottom: 1px solid rgba(229, 231, 239, 0.9);
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #1f2937, #0b1220);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.04em;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.22);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid var(--bg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-text span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: 0.18s ease;
}

.nav-link:hover {
  background: rgba(17, 24, 39, 0.05);
  color: var(--ink);
}

.nav-link.active {
  background: var(--ink);
  color: #fff;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.mode-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.14);
}

.mode-pill.mock .dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.14);
}

.public-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 58px 24px 40px;
}

/* ---------- self-service (separate surface) ---------- */

.bind-top {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.bind-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
}

.bind-secure .icon {
  color: var(--teal);
  font-size: 13px;
}

.bind-main {
  min-height: calc(100vh - 150px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px 20px 54px;
}

.bind-inner {
  width: 100%;
  max-width: 560px;
}

.bind-intro {
  text-align: center;
  margin-bottom: 22px;
}

.bind-title {
  margin-top: 14px;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.bind-sub {
  margin: 12px auto 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.bind-warning {
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(180, 83, 9, 0.18);
  border-radius: 9px;
  background: var(--amber-soft);
  color: #92400e;
  font-size: 11.5px;
  line-height: 1.6;
}

.bind-warning strong {
  font-weight: 800;
}

.bind-inner .wizard-card {
  width: 100%;
  margin: 0 auto;
  padding: 26px;
}

.bind-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px 28px;
  border-top: 1px solid rgba(229, 231, 239, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.bind-footer a {
  color: var(--muted);
  font-weight: 600;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  gap: 58px;
  align-items: start;
}

.hero {
  padding-top: 20px;
  animation: rise 0.55s ease both;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border: 1px solid rgba(254, 44, 85, 0.14);
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title {
  margin-top: 22px;
  font-size: clamp(34px, 3.5vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.hero-title .title-line {
  display: block;
  white-space: nowrap;
}

.hero-title .accent {
  color: var(--brand);
  position: relative;
  white-space: nowrap;
}

.hero-title .accent::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 4px;
  height: 10px;
  background: rgba(254, 44, 85, 0.12);
  border-radius: 4px;
  z-index: -1;
}

.hero-sub {
  margin-top: 22px;
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero-points {
  margin-top: 32px;
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.point {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.6;
}

.point .icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--teal);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.point strong {
  color: var(--ink);
  font-weight: 700;
}

.hero-meta {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
}

.meta-chip .icon {
  font-size: 12px;
  color: var(--teal);
}

/* ---------- wizard ---------- */

.wizard-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(229, 231, 239, 0.96);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 30px;
  position: relative;
  overflow: hidden;
  animation: rise 0.65s 0.08s ease both;
}

.wizard-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #ff7a45 55%, var(--teal));
}

.card-head {
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card-head h2 {
  margin-top: 8px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.card-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > label,
.field-label {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-label .optional {
  color: var(--muted-2);
  font-weight: 500;
  font-size: 11px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(254, 44, 85, 0.62);
  box-shadow: 0 0 0 4px rgba(254, 44, 85, 0.09);
}

.textarea {
  min-height: 120px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.segmented button {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 9px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: 0.16s ease;
}

.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.hint {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.hint strong {
  color: var(--ink-soft);
}

.preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 13px;
  border-radius: 13px;
  border: 1px dashed var(--line-strong);
  background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
}

.preview-item {
  min-width: 0;
}

.preview-item span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.preview-item strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.preview-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 7px;
  padding: 5px 8px;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  max-width: 100%;
}

.chip.teal {
  background: var(--teal-soft);
  border-color: rgba(15, 159, 143, 0.16);
  color: #0b7a6e;
}

.chip.amber {
  background: var(--amber-soft);
  border-color: rgba(180, 83, 9, 0.16);
  color: #92400e;
}

.consent {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
  padding: 12px;
  border-radius: 11px;
  background: #fbfcfe;
  border: 1px solid var(--line);
}

.consent input {
  margin-top: 2px;
  accent-color: var(--brand);
  width: 15px;
  height: 15px;
  flex: none;
}

.consent a {
  color: var(--brand-deep);
  font-weight: 700;
}

.field > label.consent {
  justify-content: flex-start;
  align-items: flex-start;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(180deg, #ff3d63, var(--brand));
  color: #fff;
  box-shadow: 0 10px 22px rgba(254, 44, 85, 0.24);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 13px 28px rgba(254, 44, 85, 0.3);
}

.btn-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.18);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--muted-2);
  background: #fbfcfe;
}

.btn-danger {
  background: var(--red-soft);
  border-color: rgba(180, 35, 24, 0.18);
  color: var(--red);
}

.btn-sm {
  padding: 7px 10px;
  font-size: 11.5px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.btn .icon {
  font-size: 15px;
}

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ---------- status / stepper ---------- */

.status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.status-head h2 {
  font-size: 23px;
  letter-spacing: -0.03em;
}

.status-head p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.stepper {
  margin: 26px 0 4px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: relative;
}

.stepper::before {
  content: "";
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: 13px;
  height: 2px;
  background: var(--line);
}

.step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: #fff;
  color: var(--muted-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.step.done .step-dot {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.step.current .step-dot {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(254, 44, 85, 0.1);
}

.step-label {
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 700;
}

.step.done .step-label,
.step.current .step-label {
  color: var(--ink-soft);
}

.status-card .stepper {
  margin-bottom: 24px;
}

.status-body {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.code-panel {
  display: grid;
  gap: 16px;
}

.code-target {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.code-target .icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--brand);
  font-size: 17px;
}

.code-target strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.code-target span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.code-input {
  text-align: center;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.35em;
  padding: 14px;
  font-variant-numeric: tabular-nums;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11.5px;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--brand-deep);
  font-size: 11.5px;
  font-weight: 700;
  padding: 0;
}

.link-btn:disabled {
  color: var(--muted-2);
}

.dev-hint {
  border: 1px dashed rgba(180, 83, 9, 0.28);
  background: var(--amber-soft);
  color: #92400e;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 11.5px;
  line-height: 1.55;
}

.processing {
  display: grid;
  place-items: center;
  padding: 34px 10px 28px;
  text-align: center;
}

.orbit {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--line);
  position: relative;
  margin-bottom: 18px;
}

.orbit::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--brand);
  animation: spin 1s linear infinite;
}

.orbit::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 8px rgba(254, 44, 85, 0.08);
}

.processing h3 {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.processing p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.success-panel {
  text-align: center;
  padding: 8px 0 4px;
}

.success-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 12px;
  box-shadow: 0 0 0 8px rgba(15, 159, 143, 0.07);
}

.success-panel h3 {
  font-size: 21px;
  letter-spacing: -0.03em;
}

.success-panel p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.5px;
}

.account-name {
  margin: 20px 0 16px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #101828, #1f2937);
  color: #fff;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.account-name::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -40px;
  top: -60px;
  border-radius: 50%;
  background: rgba(254, 44, 85, 0.28);
  filter: blur(2px);
}

.account-name span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.account-name strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
}

.success-expiry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.success-expiry strong {
  color: var(--ink-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.wechat-cta {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.wechat-guide-image {
  width: 100%;
  max-width: 390px;
  display: block;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.wechat-cta-text {
  max-width: 430px;
  margin: 14px auto 0;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid rgba(254, 44, 85, 0.14);
  background: var(--brand-soft);
  color: #9f1c3d;
  font-size: 12px;
  line-height: 1.75;
  text-align: center;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  text-align: left;
}

.meta-grid > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  background: #fbfcfe;
}

.meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.meta-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  word-break: break-all;
}

.timeline {
  display: grid;
  gap: 0;
  margin-top: 4px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  position: relative;
  padding-bottom: 15px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 15px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line-strong);
  margin-top: 2px;
}

.timeline-item:first-child .timeline-dot {
  background: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}

.timeline-item strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
}

.timeline-item span {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
  margin-top: 2px;
}

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: 11px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid transparent;
}

.alert .icon {
  font-size: 16px;
  margin-top: 1px;
}

.alert strong {
  display: block;
  margin-bottom: 2px;
}

.alert-error {
  background: var(--red-soft);
  border-color: rgba(180, 35, 24, 0.14);
  color: #8a1c13;
}

.alert-warn {
  background: var(--amber-soft);
  border-color: rgba(180, 83, 9, 0.16);
  color: #92400e;
}

.alert-info {
  background: var(--blue-soft);
  border-color: rgba(23, 92, 211, 0.14);
  color: #1849a9;
}

.alert-success {
  background: var(--teal-soft);
  border-color: rgba(15, 159, 143, 0.16);
  color: #0b7a6e;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

/* ---------- features / footer ---------- */

.feature-grid {
  margin-top: 58px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  transition: 0.18s ease;
}

.feature-card:hover {
  background: #fff;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.feature-num {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--brand);
}

.feature-card h3 {
  margin-top: 10px;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

.feature-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.notice-strip {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1px solid rgba(23, 92, 211, 0.12);
  background: rgba(239, 248, 255, 0.66);
  color: #1849a9;
  font-size: 11.5px;
  line-height: 1.65;
}

.notice-strip .icon {
  font-size: 16px;
  margin-top: 1px;
}

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 40px;
  color: var(--muted-2);
  font-size: 10.5px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(229, 231, 239, 0.8);
}

.footer a {
  color: var(--muted);
  font-weight: 600;
}

/* ---------- admin ---------- */

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  background: #0f172a;
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
}

.side-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #fe2c55, #ff7a45);
  font-size: 15px;
  box-shadow: none;
}

.side-brand .brand-mark::after {
  border-color: #0f172a;
  width: 8px;
  height: 8px;
}

.side-brand strong {
  display: block;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.side-brand span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: 0.16s ease;
}

.side-link .icon {
  font-size: 16px;
  opacity: 0.8;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.side-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: inset 2px 0 0 var(--brand);
}

.side-foot {
  margin-top: auto;
  display: grid;
  gap: 9px;
}

.side-health {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.04);
}

.side-health span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.side-health strong {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.5;
  color: #fff;
  font-weight: 600;
}

.side-health .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.side-health .dot.bad {
  background: var(--brand);
}

.side-health .dot.issue {
  background: var(--brand);
}

.side-health .dot.idle {
  background: #98a2b3;
  box-shadow: none;
}

.side-logout {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.42);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  padding: 7px 10px;
  border-radius: 8px;
}

.side-logout:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  padding: 24px 32px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.admin-topbar h1 {
  font-size: 25px;
  letter-spacing: -0.035em;
}

.admin-topbar p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.admin-topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-content {
  padding: 24px 32px 48px;
  animation: fade 0.28s ease both;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  right: 14px;
  top: 14px;
  background: var(--teal);
  opacity: 0.65;
}

.stat-card.warn::after {
  background: var(--brand);
}

.stat-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.stat-value {
  margin-top: 8px;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stat-note {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
}

.two-col {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-head {
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2,
.panel-head h3 {
  font-size: 13.5px;
  letter-spacing: -0.01em;
}

.panel-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.panel-body {
  padding: 17px;
}

.panel-body.flush {
  padding: 0;
}

.health-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.health-row .health-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 159, 143, 0.12);
  flex: none;
}

.health-row.bad .health-dot {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(254, 44, 85, 0.1);
}

.health-row strong {
  display: block;
  font-size: 11.5px;
}

.health-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.kv {
  display: grid;
  gap: 9px;
}

.kv-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  font-size: 11.5px;
}

.kv-row span {
  color: var(--muted);
  flex: none;
}

.kv-row strong {
  text-align: right;
  font-weight: 600;
  word-break: break-all;
}

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

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search {
  position: relative;
}

.search .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 14px;
}

.search input {
  padding-left: 31px;
  min-width: 220px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

th {
  text-align: left;
  color: var(--muted);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  padding: 10px 14px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f2f6;
  vertical-align: middle;
  color: var(--ink-soft);
}

tr:last-child td {
  border-bottom: 0;
}

.row-click {
  cursor: pointer;
  transition: background 0.14s ease;
}

.row-click:hover {
  background: #fbfcff;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10.5px;
  color: var(--muted);
  word-break: break-all;
}

.cell-main {
  font-weight: 700;
  color: var(--ink);
}

.cell-sub {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
}

.code-value {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.badge-active {
  background: var(--teal-soft);
  color: #0b7a6e;
}

.badge-wait {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-fail {
  background: var(--red-soft);
  color: var(--red);
}

.badge-muted {
  background: var(--bg-soft);
  color: var(--muted);
}

.empty {
  padding: 38px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.empty strong {
  display: block;
  color: var(--ink-soft);
  font-size: 13px;
  margin-bottom: 5px;
}

/* ---------- drawer / modal ---------- */

.drawer-overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(9, 14, 26, 0.42);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
  animation: fade 0.18s ease both;
}

.drawer {
  width: min(620px, 100vw);
  height: 100vh;
  background: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slide-in 0.26s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.drawer-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.drawer-head h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.drawer-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.drawer-body {
  padding: 20px;
  overflow: auto;
  display: grid;
  gap: 18px;
}

.drawer-section {
  display: grid;
  gap: 9px;
}

.drawer-section h3 {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.drawer-close {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.drawer-close:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.modal-overlay {
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal {
  width: min(760px, 100%);
  max-height: 84vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: rise 0.24s ease both;
}

.modal-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-head h2 {
  font-size: 15px;
}

.modal-body {
  padding: 16px 18px;
  overflow: auto;
}

pre.json {
  margin: 0;
  padding: 14px;
  background: #0f172a;
  color: #d7e0f4;
  border-radius: 10px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- login ---------- */

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

.login-card {
  width: min(400px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 30px;
  animation: rise 0.4s ease both;
}

.login-card .brand {
  margin-bottom: 24px;
}

.login-card h1 {
  font-size: 23px;
  letter-spacing: -0.03em;
}

.login-card > p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.login-card form {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

.login-foot {
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- toast ---------- */

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: grid;
  gap: 8px;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 11px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  line-height: 1.55;
  animation: toast-in 0.22s ease both;
}

.toast.success {
  background: #0b7a6e;
}

.toast.error {
  background: #9f1c13;
}

.toast.warn {
  background: #92400e;
}

.toast .icon {
  font-size: 15px;
  margin-top: 1px;
}

/* ---------- utility ---------- */

.muted {
  color: var(--muted);
}

.small {
  font-size: 11px;
}

.nowrap {
  white-space: nowrap;
}

.stack {
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill-note {
  color: var(--muted);
  font-size: 10.5px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 5px 8px;
  border-radius: 999px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.skeleton {
  background: linear-gradient(90deg, #f1f3f8 25%, #f8f9fc 50%, #f1f3f8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 8px;
}

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

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-in {
  from {
    transform: translateX(24px);
    opacity: 0.6;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

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

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .hero {
    padding-top: 0;
  }

  .hero-title {
    max-width: 720px;
  }

  .wizard-card {
    max-width: 680px;
  }

  .admin-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    height: 64px;
    padding: 0 16px;
  }

  .brand-text span {
    display: none;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 12px;
  }

  .mode-pill {
    display: none;
  }

  .public-main {
    padding: 30px 16px 24px;
  }

  .bind-top {
    padding: 16px;
  }

  .bind-main {
    min-height: calc(100vh - 130px);
    padding: 20px 16px 40px;
  }

  .bind-inner .wizard-card {
    padding: 21px;
    border-radius: 18px;
  }

  .bind-title {
    font-size: 30px;
  }

  .bind-footer {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-sub {
    font-size: 14px;
  }

  .wizard-card {
    padding: 21px;
    border-radius: 18px;
  }

  .preview {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    margin-top: 34px;
  }

  .footer {
    padding: 22px 16px 30px;
    flex-direction: column;
    gap: 8px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px 14px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
  }

  .side-brand {
    padding: 0;
    flex: none;
  }

  .side-brand > div:last-child {
    display: none;
  }

  .side-nav {
    display: flex;
    gap: 3px;
  }

  .side-link {
    padding: 8px 9px;
    font-size: 11px;
    white-space: nowrap;
  }

  .side-link .icon {
    display: none;
  }

  .side-foot {
    margin-top: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
  }

  .side-health {
    display: none;
  }

  .side-logout {
    white-space: nowrap;
  }

  .admin-topbar {
    padding: 18px 16px 0;
    flex-direction: column;
    gap: 12px;
  }

  .admin-content {
    padding: 16px 16px 36px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-value {
    font-size: 24px;
  }

  .drawer {
    width: 100vw;
  }

  .drawer-body {
    padding: 16px;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .topbar-inner {
    gap: 8px;
  }

  .brand-text strong {
    font-size: 13px;
  }

  .nav {
    gap: 2px;
  }

  .nav-link {
    padding: 7px 8px;
    font-size: 11px;
  }

  .hero-title {
    font-size: 31px;
  }

  .hero-title .title-line {
    white-space: normal;
  }

  .hero-eyebrow {
    font-size: 10px;
  }

  .stepper::before {
    left: 12%;
    right: 12%;
  }

  .step-label {
    font-size: 9px;
  }

  .code-input {
    font-size: 21px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}
