:root {
  color-scheme: light;
  scrollbar-gutter: stable both-edges;

  /* Warm Architectural Minimalism Palette */
  --canvas: #f3f2ee;
  --surface: #ffffff;
  --surface-subtle: #f7f6f3;
  --surface-hover: #efeee9;

  --ink: #121316;
  --ink-soft: #4c515c;
  --muted: #7e8490;

  --line: #e5e4df;
  --line-strong: #d1d0c9;

  --accent: #1d5bff;
  --accent-soft: rgba(29, 91, 255, 0.1);
  --success: #0d9668;
  --success-bg: #ecfdf5;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-line: #fde68a;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-line: #fecaca;

  --radius-sheet: 24px;
  --radius-control: 12px;
  --radius-sm: 8px;

  --shadow-sheet:
    0 1px 2px rgba(18, 19, 22, 0.04),
    0 20px 50px -20px rgba(18, 19, 22, 0.1);
  --shadow-popup:
    0 4px 12px rgba(18, 19, 22, 0.06),
    0 20px 44px -12px rgba(18, 19, 22, 0.14);

  font-family: "SF Pro Display", "Segoe UI Variable", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -10%, #ffffff 0%, var(--canvas) 62%, #eceae3 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, dl, dd, ul { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
::selection { background: rgba(29, 91, 255, 0.16); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

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

.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Page Frame */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  padding: 0 20px 24px;
}

/* Minimal Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
}

.brand-mark {
  flex: none;
}

.brand-name {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

/* Center Sheet */
.main {
  display: flex;
  flex: 1;
  align-items: center;
  padding-block: 4px 20px;
}

.sheet {
  width: 100%;
  padding: 36px 36px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sheet);
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
}

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

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

.step-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.step-bars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.step-bars i {
  display: block;
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

.step-bars i.is-active {
  background: var(--ink);
}

.step-bars i.is-done {
  background: var(--success);
}

.step-num {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.verified-info {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-subtle);
  overflow: hidden;
}

.verified-info > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 42px;
  padding: 8px 14px;
}

.verified-info > div + div {
  border-top: 1px solid var(--line);
}

.verified-info dt {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
}

.verified-info dd {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-align: end;
  overflow-wrap: anywhere;
}

.verified-email-val {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.verified-check {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
}

.verified-check .icon {
  width: 10px;
  height: 10px;
  stroke-width: 2.8;
}

.sheet-head h1,
.result-head h1 {
  font-size: 26px;
  font-weight: 760;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--ink);
}

.sheet-desc {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

/* Form Fields */
.fields {
  display: grid;
  gap: 16px;
}

.field { min-width: 0; }

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.field-label-row label {
  margin-bottom: 0;
}

.btn-random {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s, transform 0.12s;
}

.btn-random .icon {
  width: 13px;
  height: 13px;
}

.btn-random:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: #f4f7ff;
  color: var(--accent);
}

.btn-random:active {
  transform: scale(0.97);
}

.req { color: var(--accent); }

.field input,
.field select,
.region-trigger {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-size: 14.5px;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.field input::placeholder { color: #a3a8b3; }

.field input:hover,
.region-trigger:hover {
  border-color: #b4b3aa;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field [aria-invalid="true"] {
  border-color: var(--danger);
}

.field [aria-invalid="true"]:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.field input:disabled {
  background: var(--surface-subtle);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.field input:disabled:hover {
  border-color: var(--line);
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
}

.verified-badge .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}

.avail-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 2px 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.avail-status[data-state="checking"] {
  color: var(--muted);
}

.avail-status[data-state="available"] {
  color: var(--success);
}

.avail-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.avail-status[data-state="checking"] .avail-dot {
  width: 11px;
  height: 11px;
  border: 1.8px solid rgba(18, 19, 22, 0.14);
  border-top-color: var(--accent);
  background: transparent;
  animation: spin 0.72s linear infinite;
}

.field-error {
  margin: 6px 2px 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.username-error {
  padding: 8px 11px;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  font-weight: 600;
}

/* Password Field with Toggle */
.input-wrap { position: relative; }
.input-wrap input { padding-inline-end: 44px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transition: background-color 0.14s, color 0.14s;
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.input-wrap .icon-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
}

/* Region Picker */
.region-picker { position: relative; }

.region-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: start;
}

.region-value {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.region-value > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-subtle);
  color: var(--muted);
  font: 600 11px/1.2 ui-monospace, "Cascadia Code", monospace;
  flex: none;
}

.region-chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.18s;
}

.region-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.region-trigger[aria-expanded="true"] .region-chevron {
  transform: rotate(180deg);
}

.region-popup {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  height: min(300px, calc(48dvh - 30px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-popup);
}

.region-picker.opens-up .region-popup {
  top: auto;
  bottom: calc(100% + 6px);
}

.region-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.region-search-box .icon {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.region-search-box input {
  min-height: 38px;
  padding: 7px 12px 7px 34px;
  border-color: var(--line);
  background: var(--surface-subtle);
  font-size: 13.5px;
}

.region-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #d4d3cc transparent;
  list-style: none;
}

.region-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: none;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}

.region-list li .opt-code {
  color: var(--muted);
  font: 500 11px/1 ui-monospace, monospace;
}

.region-list li[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

.region-list li[aria-selected="true"] .opt-code {
  color: var(--accent);
}

.region-list li.is-active {
  background: var(--surface-hover);
}

@media (hover: hover) {
  .region-list li:hover {
    background: var(--surface-hover);
  }
}

.region-empty {
  padding: 16px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Buttons */
.actions {
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 14.5px;
  font-weight: 650;
  transition: transform 0.14s, background-color 0.16s, box-shadow 0.16s, color 0.16s;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 2px 6px rgba(18, 19, 22, 0.14);
}

.btn-primary:hover {
  background: #23262d;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(18, 19, 22, 0.28);
}

.btn-primary:active { transform: none; }

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

.btn-ghost:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.btn-danger-ghost {
  border-color: var(--danger-line);
  background: var(--surface);
  color: var(--danger);
}

.btn-danger-ghost:hover {
  border-color: #fca5a5;
  background: var(--danger-bg);
}

.btn-danger-ghost.is-armed {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.btn-danger-ghost.is-armed:hover {
  background: #b91c1c;
}

/* Result View */
.result-head {
  text-align: center;
  margin-bottom: 24px;
}

.check-badge {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
}

.check-badge .icon { width: 24px; height: 24px; stroke-width: 2.2; }

.revoked-head {
  margin-bottom: 0;
  padding-block: 10px 6px;
}

.revoked-badge {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--danger-bg);
  color: var(--danger);
}

.revoked-badge .icon { width: 22px; height: 22px; stroke-width: 2.2; }

.ticket {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-subtle);
  overflow: hidden;
  margin-bottom: 22px;
}

.ticket > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 8px 16px;
}

.ticket > div + div {
  border-top: 1px solid var(--line);
}

.ticket dt {
  color: var(--muted);
  font-size: 13px;
}

.ticket dd {
  min-width: 0;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  text-align: end;
  overflow-wrap: anywhere;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", monospace;
  letter-spacing: 0.01em;
}

.ticket-password {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.password-value {
  display: grid;
  width: min(100%, 175px);
  min-width: 0;
}

.password-value > * { grid-area: 1 / 1; }

.password-value input {
  width: 100%;
  min-width: 0;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: end;
  font: 600 13.5px ui-monospace, "Cascadia Code", monospace;
}

.password-value input[type="password"] { visibility: hidden; }
.password-value input[type="text"] + .password-mask { display: none; }

.password-mask {
  align-self: center;
  justify-self: end;
  width: 88px;
  max-width: 100%;
  height: 8px;
  background: radial-gradient(circle, var(--ink) 0 2px, transparent 2.5px) 0 0 / 9px 8px repeat-x;
}

.result-actions {
  display: grid;
  gap: 10px;
}

#copy-account .icon-done { display: none; }
#copy-account.is-copied {
  background: var(--success);
  box-shadow: none;
}
#copy-account.is-copied .icon-copy { display: none; }
#copy-account.is-copied .icon-done { display: block; }

/* Minimal Toast */
.toast {
  position: fixed;
  inset-inline: 0;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 32px);
  margin-inline: auto;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 30px rgba(18, 19, 22, 0.24);
  font-size: 13px;
  font-weight: 600;
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.toast.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
}

.toast.is-error .toast-dot {
  background: #fbbf24;
}

/* Verification & Progress Modal */
body:has(dialog[open]) { overflow: hidden; }

.modal {
  --tone-bg: #f4f7ff;
  --tone-line: #dbe6ff;
  --tone-text: #163063;
  --tone-accent: var(--accent);

  width: min(448px, calc(100% - 28px));
  max-height: calc(100dvh - 32px);
  padding: 28px 28px 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  text-align: start;
  overflow-y: auto;
  box-shadow: 0 28px 80px rgba(18, 19, 22, 0.2);
}

.modal[data-stage="confirming"],
.modal[data-stage="retrying"] {
  --tone-bg: var(--warning-bg);
  --tone-line: var(--warning-line);
  --tone-text: var(--warning);
  --tone-accent: #d97706;
}

.modal[data-stage="failed"] {
  --tone-bg: var(--danger-bg);
  --tone-line: var(--danger-line);
  --tone-text: var(--danger);
  --tone-accent: var(--danger);
}

.modal[data-stage="email-bound"],
.modal[data-stage="username-taken"] {
  --tone-bg: var(--warning-bg);
  --tone-line: var(--warning-line);
  --tone-text: var(--warning);
  --tone-accent: #d97706;
}

.modal-icon .icon-alert { display: none; }
.modal[data-stage="failed"] .modal-icon .icon-mail,
.modal[data-stage="email-bound"] .modal-icon .icon-mail,
.modal[data-stage="username-taken"] .modal-icon .icon-mail { display: none; }
.modal[data-stage="failed"] .modal-icon .icon-alert,
.modal[data-stage="email-bound"] .modal-icon .icon-alert,
.modal[data-stage="username-taken"] .modal-icon .icon-alert { display: block; }
.modal[data-stage="failed"] .modal-ring,
.modal[data-stage="failed"] .spinner,
.modal[data-stage="failed"] .progress-fill::after,
.modal[data-stage="email-bound"] .modal-ring,
.modal[data-stage="email-bound"] .spinner,
.modal[data-stage="email-bound"] .progress-fill::after,
.modal[data-stage="username-taken"] .modal-ring,
.modal[data-stage="username-taken"] .spinner,
.modal[data-stage="username-taken"] .progress-fill::after { display: none; }

.modal[data-stage="failed"] .milestone.is-active .milestone-dot {
  animation: none;
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.modal[data-stage="email-bound"] .milestone.is-active .milestone-dot,
.modal[data-stage="username-taken"] .milestone.is-active .milestone-dot {
  animation: none;
  border-color: #d97706;
  background: #d97706;
  color: #fff;
}

.modal[data-stage="failed"] .milestone.is-active .milestone-dot .icon-x,
.modal[data-stage="email-bound"] .milestone.is-active .milestone-dot .icon-x,
.modal[data-stage="username-taken"] .milestone.is-active .milestone-dot .icon-x {
  display: block;
}

.modal[data-stage="failed"] .tip-card {
  border-color: var(--danger-line);
  background: #fff8f8;
}

.modal[data-stage="failed"] .tip-tag {
  color: var(--danger);
}

.modal[data-stage="email-bound"] .tip-card,
.modal[data-stage="username-taken"] .tip-card {
  border-color: var(--warning-line);
  background: #fffdf5;
}

.modal[data-stage="email-bound"] .tip-tag,
.modal[data-stage="username-taken"] .tip-tag {
  color: var(--warning);
}

.modal-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.modal[open] { animation: modal-in 0.24s cubic-bezier(0.22, 1, 0.36, 1); }
.modal::backdrop {
  background: rgba(18, 19, 22, 0.34);
  backdrop-filter: blur(6px);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  border: 1px solid var(--tone-line);
  background: var(--tone-bg);
  color: var(--tone-accent);
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}

.modal-icon .icon { width: 22px; height: 22px; }

.modal-ring {
  position: absolute;
  inset: -4px;
  border-radius: 17px;
  border: 1.5px solid var(--tone-accent);
  opacity: 0;
  animation: pulse-ring 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.94); opacity: 0.45; }
  100% { transform: scale(1.14); opacity: 0; }
}

.modal-title-group { min-width: 0; }

.modal h2 {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
}

.modal-recipient {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Smooth Progress Bar */
.progress-block {
  margin-top: 22px;
}

.progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12.5px;
}

.progress-label {
  color: var(--ink-soft);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.progress-elapsed {
  color: var(--muted);
  font: 500 12px/1 ui-monospace, "Cascadia Code", monospace;
}

.progress-sep { color: var(--line-strong); }

.progress-percent {
  color: var(--ink);
  font: 700 12.5px/1 ui-monospace, "Cascadia Code", monospace;
  min-width: 34px;
  text-align: end;
}

.progress-track {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-hover);
  overflow: hidden;
}

.progress-fill {
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--tone-accent);
  transition: width 0.35s ease-out, background-color 0.3s;
  overflow: hidden;
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.42) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: progress-shimmer 1.6s ease-in-out infinite;
}

@keyframes progress-shimmer {
  to { transform: translateX(100%); }
}

/* 3-Step User-Facing Milestones */
.milestones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.milestone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.milestone-dot {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: transparent;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.milestone-dot .icon {
  display: none;
  width: 10px;
  height: 10px;
  stroke-width: 2.8;
}

.milestone.is-active {
  border-color: var(--tone-line);
  background: var(--tone-bg);
  color: var(--tone-text);
  font-weight: 700;
}

.milestone.is-active .milestone-dot {
  border-width: 2px;
  border-color: color-mix(in srgb, var(--tone-accent) 22%, transparent);
  border-top-color: var(--tone-accent);
  background: transparent;
  animation: spin 0.78s linear infinite;
}

.milestone.is-done {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.milestone.is-done .milestone-dot {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.milestone.is-done .milestone-dot .icon-check {
  display: block;
}

/* Friendly Rotating Tip Card */
.tip-card {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  transition: border-color 0.25s, background-color 0.25s;
}

.modal[data-stage="confirming"] .tip-card {
  border-color: var(--warning-line);
  background: #fffdf5;
}

.tip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tip-tag {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.modal[data-stage="confirming"] .tip-tag {
  color: var(--warning);
}

.tip-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tip-dots span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: width 0.25s, background-color 0.25s;
}

.tip-dots span.is-current {
  width: 14px;
  background: var(--tone-accent);
}

.tip-text {
  min-height: calc(1.55em * 2);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
  animation: fade-soft 0.3s ease-out;
}

@keyframes fade-soft {
  from { opacity: 0; transform: translateY(3px); }
}

/* Bottom Live Status Banner */
.modal-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid var(--tone-line);
  border-radius: var(--radius-control);
  background: var(--tone-bg);
  color: var(--tone-text);
  font-size: 13px;
  font-weight: 650;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}

.spinner {
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(18, 19, 22, 0.14);
  border-top-color: var(--tone-accent);
  border-radius: 50%;
  animation: spin 0.72s linear infinite;
}

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

/* Manual Email Verification Link Panel */
.verify-link-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--tone-line);
  border-radius: var(--radius-control);
  background: var(--tone-bg);
}

.verify-link-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  color: var(--tone-text);
  font-size: 12.5px;
  font-weight: 700;
}

.verify-link-label .icon {
  width: 15px;
  height: 15px;
}

.verify-link-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.verify-link-input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.verify-link-input::placeholder {
  color: #a3a8b3;
}

.verify-link-input:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.verify-link-input[aria-invalid="true"] {
  border-color: var(--danger);
}

.verify-link-input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.verify-link-btn {
  width: auto;
  flex: none;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  white-space: nowrap;
}

.verify-link-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.verify-link-error {
  margin: 10px 0 0;
  padding: 8px 11px;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

/* Footer */
.footer {
  display: grid;
  place-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 12px;
}

.footer small { font-size: inherit; }

@media (max-width: 520px) {
  .page { padding: 0 14px 18px; }
  .topbar { min-height: 64px; }
  .sheet { padding: 26px 20px 24px; border-radius: 20px; }
  .field input, .field select, .region-trigger { font-size: 16px; }
  .region-list li { min-height: 44px; }
  .modal { padding: 24px 20px 22px; }
  .tip-text { min-height: calc(1.55em * 3); }
  .verify-link-row { flex-direction: column; }
  .verify-link-input { font-size: 16px; }
  .verify-link-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
