/* ============================================================
   云帆 · Google AI Pro 自助开通中心
   Pure CSS3 — tokens, layout, components, responsive
   ============================================================ */

:root {
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas,
    "Liberation Mono", monospace;

  --bg: #f4f6fc;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-muted: #f6f8ff;
  --surface-deep: #0b1020;

  --ink: #10142a;
  --ink-2: #3e4663;
  --ink-3: #747c99;
  --ink-4: #9aa1ba;

  --line: rgba(16, 20, 42, 0.08);
  --line-strong: rgba(16, 20, 42, 0.14);

  --brand: #3b6ef6;
  --brand-deep: #2952d9;
  --brand-soft: #edf2ff;
  --cyan: #22c8e6;
  --violet: #7c5cff;
  --success: #12b981;
  --warning: #e89b0c;
  --danger: #e93f5b;

  --grad-brand: linear-gradient(118deg, #3b6ef6 0%, #5c6bff 46%, #22c8e6 100%);
  --grad-sail: linear-gradient(118deg, #4f7cff, #1fc8e3);
  --grad-success: linear-gradient(135deg, #10b981, #22c8e6);

  --radius-xl: 30px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-card: 0 30px 90px -32px rgba(37, 56, 128, 0.35), 0 2px 10px rgba(37, 56, 128, 0.05);
  --shadow-soft: 0 12px 34px -18px rgba(37, 56, 128, 0.35);
  --shadow-pop: 0 30px 80px -20px rgba(8, 14, 38, 0.5);
  --ring: 0 0 0 4px rgba(59, 110, 246, 0.14);

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--brand);
}

code {
  font-family: var(--font-mono);
}

::selection {
  background: rgba(59, 110, 246, 0.2);
}

:focus-visible {
  outline: 2px solid rgba(59, 110, 246, 0.75);
  outline-offset: 2px;
}

/* ---------------- background decoration ---------------- */

.bg-orb {
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  opacity: 0.75;
}

.bg-orb-a {
  top: -180px;
  left: -140px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle at 35% 35%, rgba(79, 124, 255, 0.55), rgba(79, 124, 255, 0) 70%);
  animation: orbFloat 18s ease-in-out infinite alternate;
}

.bg-orb-b {
  top: -120px;
  right: -160px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle at 55% 45%, rgba(34, 200, 230, 0.42), rgba(34, 200, 230, 0) 70%);
  animation: orbFloat 22s ease-in-out infinite alternate-reverse;
}

.bg-orb-c {
  bottom: -260px;
  left: 30%;
  width: 640px;
  height: 560px;
  background: radial-gradient(circle at 50% 50%, rgba(124, 92, 255, 0.22), rgba(124, 92, 255, 0) 70%);
  animation: orbFloat 26s ease-in-out infinite alternate;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(59, 110, 246, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 110, 246, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 78%);
}

@keyframes orbFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(30px, 40px, 0) scale(1.08); }
}

/* ---------------- utilities ---------------- */

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

.mono {
  font-family: var(--font-mono);
}

.only-desktop {
  display: inline;
}

.only-mobile {
  display: none;
}

.grad-text {
  background: linear-gradient(110deg, #2952d9 0%, #3b6ef6 34%, #22c8e6 70%, #7c5cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

/* ---------------- header ---------------- */

.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 30px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: 0 12px 28px -12px rgba(59, 110, 246, 0.75);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.brand-sub {
  margin-top: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--ink-4);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(59, 110, 246, 0.16);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.header-tag svg {
  color: var(--brand);
}

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c3c9da;
  box-shadow: 0 0 0 0 rgba(18, 185, 129, 0.4);
}

.health-pill[data-state="ok"] {
  color: #0b8f66;
  border-color: rgba(18, 185, 129, 0.22);
  background: rgba(233, 251, 243, 0.85);
}

.health-pill[data-state="ok"] .health-dot {
  background: var(--success);
  animation: dotPulse 2.4s ease-out infinite;
}

.health-pill[data-state="error"] {
  color: #b62b44;
  border-color: rgba(233, 63, 91, 0.22);
  background: rgba(255, 240, 243, 0.9);
}

.health-pill[data-state="error"] .health-dot {
  background: var(--danger);
}

@keyframes dotPulse {
  0% { box-shadow: 0 0 0 0 rgba(18, 185, 129, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(18, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 185, 129, 0); }
}

/* ---------------- hero ---------------- */

.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 46px 24px 38px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(59, 110, 246, 0.18);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px -18px rgba(37, 56, 128, 0.4);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  backdrop-filter: blur(12px);
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad-sail);
  box-shadow: 0 0 0 4px rgba(59, 110, 246, 0.12);
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(2.15rem, 4.8vw, 3.55rem);
  line-height: 1.14;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.hero-sub {
  margin-top: 18px;
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  line-height: 1.75;
  color: var(--ink-3);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin-top: 22px;
}

.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.hero-points svg {
  color: var(--success);
}

/* ---------------- order shell ---------------- */

.order-shell {
  position: relative;
  max-width: 1080px;
  margin: 0 auto 90px;
  padding: 28px 38px 38px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.85);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(24px);
}

.order-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(59, 110, 246, 0.28), rgba(255, 255, 255, 0) 35%, rgba(34, 200, 230, 0.24));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.shell-top {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 26px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

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

.stepper-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-4);
  transition: color 0.25s ease;
}

.stepper-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 17px;
  left: calc(50% + 26px);
  right: calc(-50% + 26px);
  height: 2px;
  border-radius: 2px;
  background: rgba(16, 20, 42, 0.09);
  transition: background 0.3s ease;
}

.stepper-item.is-done::after {
  background: linear-gradient(90deg, rgba(59, 110, 246, 0.7), rgba(34, 200, 230, 0.7));
}

.step-dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(16, 20, 42, 0.1);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-4);
  box-shadow: 0 3px 8px rgba(16, 20, 42, 0.04);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.stepper-item.is-active {
  color: var(--ink);
}

.stepper-item.is-active .step-dot {
  border-color: transparent;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 10px 22px -8px rgba(59, 110, 246, 0.8), 0 0 0 5px rgba(59, 110, 246, 0.1);
}

.stepper-item.is-done {
  color: var(--ink-2);
}

.stepper-item.is-done .step-dot {
  border-color: transparent;
  background: var(--grad-success);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(18, 185, 129, 0.8);
}

.shell-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.shell-secure svg {
  color: var(--success);
}

/* ---------------- panels + headings ---------------- */

.panels {
  position: relative;
}

.step-panel:not([hidden]) {
  animation: panelIn 0.32s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

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

.panel-heading {
  margin-bottom: 26px;
}

.step-panel {
  scroll-margin-top: 22px;
}

.panel-heading h2 {
  margin-top: 8px;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.panel-heading p {
  margin-top: 8px;
  max-width: 620px;
  font-size: 13.5px;
  color: var(--ink-3);
}

.panel-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

/* ---------------- forms ---------------- */

.order-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field > label,
.field > span:first-child,
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell input {
  width: 100%;
  padding-left: 46px;
  padding-right: 84px;
}

.input-icon {
  position: absolute;
  left: 15px;
  display: grid;
  place-items: center;
  color: var(--ink-4);
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-shell:focus-within .input-icon {
  color: var(--brand);
}

.input-shell .mini-btn {
  position: absolute;
  right: 8px;
}

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

input::placeholder,
textarea::placeholder {
  color: var(--ink-4);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(59, 110, 246, 0.55);
  box-shadow: var(--ring);
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23747c99' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}

#cdk-input {
  font-family: var(--font-mono);
  font-size: 14.5px;
  letter-spacing: 0.03em;
}

#cookies-json,
#profile-bulk-text,
#proxy-bulk-text,
#cdk-generated-text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
}

.field-hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-4);
}

.field-hint code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(59, 110, 246, 0.08);
  color: var(--brand-deep);
  font-size: 11.5px;
}

.input-shell-lg input {
  height: 56px;
  font-size: 15px;
}

.mini-btn {
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 7px 11px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.mini-btn:hover {
  border-color: rgba(59, 110, 246, 0.4);
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.mini-btn.is-danger:hover {
  border-color: rgba(233, 63, 91, 0.4);
  color: #c22643;
  background: #fff0f3;
}

.mini-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------------- mode selector ---------------- */

.mode-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-field legend {
  grid-column: 1 / -1;
  padding: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.mode-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-card:hover {
  border-color: rgba(59, 110, 246, 0.35);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.mode-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--surface-muted);
  color: var(--ink-3);
  transition: all 0.2s ease;
}

.mode-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mode-body strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.mode-body > span {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
}

.pill-reco {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(59, 110, 246, 0.12);
  color: var(--brand-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.mode-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: transparent;
  background: #fff;
  transition: all 0.2s ease;
}

.mode-card.is-selected {
  border-color: rgba(59, 110, 246, 0.55);
  background: linear-gradient(160deg, rgba(59, 110, 246, 0.07), rgba(34, 200, 230, 0.035));
  box-shadow: 0 14px 36px -22px rgba(59, 110, 246, 0.75);
}

.mode-card.is-selected .mode-icon {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(59, 110, 246, 0.8);
}

.mode-card.is-selected .mode-check {
  border-color: transparent;
  background: var(--grad-brand);
  color: #fff;
}

/* ---------------- cookie zone ---------------- */

.cookie-zone {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(59, 110, 246, 0.28);
  background: rgba(246, 248, 255, 0.8);
  animation: panelIn 0.25s ease both;
}

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

.cookie-zone-head label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.cookie-zone-head span {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-deep);
  background: rgba(59, 110, 246, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
}

.cookie-zone textarea {
  background: #fff;
}

.cookie-zone .field-hint {
  margin-top: 8px;
}

/* ---------------- alerts + actions ---------------- */

.form-alert {
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid rgba(233, 63, 91, 0.22);
  background: #fff2f4;
  color: #b62b44;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.55;
  animation: panelIn 0.2s ease both;
}

.form-alert.is-info {
  border-color: rgba(59, 110, 246, 0.22);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 2px;
}

.privacy-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
}

.privacy-line svg {
  color: var(--success);
  flex: none;
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.22s ease, background 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
}

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

.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 16px 34px -16px rgba(59, 110, 246, 0.85);
}

.btn-primary:hover {
  box-shadow: 0 20px 40px -16px rgba(59, 110, 246, 0.9);
  transform: translateY(-1px);
}

.btn-soft {
  background: #eef2ff;
  color: #3a51b4;
  border-color: rgba(59, 110, 246, 0.1);
}

.btn-soft:hover {
  background: #e5ebff;
  border-color: rgba(59, 110, 246, 0.25);
}

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

.btn-ghost:hover {
  border-color: rgba(59, 110, 246, 0.35);
  color: var(--brand-deep);
}

.btn-danger {
  background: linear-gradient(135deg, #f04d67, #db2f4d);
  color: #fff;
  box-shadow: 0 14px 30px -16px rgba(225, 45, 75, 0.8);
}

.btn-danger-ghost {
  background: #fff5f7;
  border-color: rgba(233, 63, 91, 0.22);
  color: #c22643;
}

.btn-danger-ghost:hover {
  background: #ffecef;
  border-color: rgba(233, 63, 91, 0.38);
}

.btn-lg {
  padding: 15px 26px;
  font-size: 15px;
  border-radius: 16px;
}

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

.btn-block {
  width: 100%;
}

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

.btn.is-loading {
  color: transparent !important;
}

.btn.is-loading svg {
  opacity: 0;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: spin 0.75s linear infinite;
}

.btn-soft.is-loading::after,
.btn-ghost.is-loading::after {
  border-color: rgba(59, 79, 160, 0.25);
  border-top-color: #3a51b4;
}

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

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-3);
  transition: all 0.18s ease;
}

.icon-btn:hover {
  background: var(--surface-muted);
  color: var(--brand-deep);
}

.icon-btn-lg {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.secret-toggle .icon-eye-off {
  display: none;
}

.secret-toggle[aria-pressed="true"] .icon-eye {
  display: none;
}

.secret-toggle[aria-pressed="true"] .icon-eye-off {
  display: block;
}

/* ---------------- step 2 ---------------- */

.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c3c9da;
}

.conn-pill[data-state="connecting"] {
  color: #9a6a05;
  background: #fff9ec;
  border-color: rgba(232, 155, 12, 0.25);
}

.conn-pill[data-state="connecting"] .conn-dot {
  background: var(--warning);
  animation: blink 1.2s ease-in-out infinite;
}

.conn-pill[data-state="online"] {
  color: #0b8f66;
  background: #ecfbf5;
  border-color: rgba(18, 185, 129, 0.25);
}

.conn-pill[data-state="online"] .conn-dot {
  background: var(--success);
  animation: dotPulse 2.4s ease-out infinite;
}

.conn-pill[data-state="offline"] {
  color: #b62b44;
  background: #fff1f4;
  border-color: rgba(233, 63, 91, 0.22);
}

.conn-pill[data-state="offline"] .conn-dot {
  background: var(--danger);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid rgba(59, 110, 246, 0.12);
  background: linear-gradient(100deg, rgba(238, 242, 255, 0.9), rgba(236, 251, 250, 0.72));
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.session-meta > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(59, 110, 246, 0.12);
  animation: blink 1.6s ease-in-out infinite;
  flex: none;
}

.session-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-chip.is-expired {
  color: #b62b44;
  background: #fff1f4;
  border-color: rgba(233, 63, 91, 0.2);
}

.reauth-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 16px;
  border-radius: 15px;
  border: 1px solid rgba(232, 155, 12, 0.28);
  background: linear-gradient(100deg, #fff9ec, #fffdf7);
  color: #7a5405;
  animation: panelIn 0.28s ease both;
}

.reauth-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(232, 155, 12, 0.14);
  color: #b47408;
  flex: none;
}

.reauth-banner strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #6d4a03;
}

.reauth-banner span {
  font-size: 12px;
  line-height: 1.55;
}

.screen-wrap {
  position: relative;
}

.screen-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 680;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-deep);
  border: 1px solid rgba(13, 20, 44, 0.85);
  box-shadow:
    0 26px 60px -28px rgba(8, 15, 42, 0.75),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

#remote-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--surface-deep);
  touch-action: none;
  cursor: crosshair;
  outline: none;
}

#remote-canvas:focus-visible {
  outline: 3px solid rgba(59, 110, 246, 0.9);
  outline-offset: -3px;
}

.screen-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: #93a6d4;
  background:
    radial-gradient(circle at 50% 38%, rgba(59, 110, 246, 0.2), transparent 58%),
    var(--surface-deep);
  pointer-events: none;
}

.screen-placeholder p {
  margin-top: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #c3d2f2;
}

.screen-placeholder > span:last-child {
  font-size: 11.5px;
  color: #6d7fa8;
}

.screen-loader {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: #5ac8ff;
  animation: spin 0.9s linear infinite;
}

.screen-corner {
  position: absolute;
  right: 13px;
  bottom: 10px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.34);
  pointer-events: none;
}

.screen-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 11px;
  font-size: 11.5px;
  color: var(--ink-4);
}

.screen-tip svg {
  color: var(--brand);
}

.screen-frame.is-highlight {
  animation: frameGlow 1.1s ease 2;
}

@keyframes frameGlow {
  0% { box-shadow: 0 0 0 0 rgba(59, 110, 246, 0.55), 0 26px 60px -28px rgba(8, 15, 42, 0.75); }
  50% { box-shadow: 0 0 0 8px rgba(59, 110, 246, 0.16), 0 26px 60px -28px rgba(8, 15, 42, 0.75); }
  100% { box-shadow: 0 0 0 0 rgba(59, 110, 246, 0), 0 26px 60px -28px rgba(8, 15, 42, 0.75); }
}

/* ---------------- toolbar ---------------- */

.tools-card {
  margin-top: 20px;
  padding: 18px 20px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcff, #f6f8ff);
}

.tools-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.tools-head h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tools-head span {
  font-size: 11.5px;
  color: var(--ink-4);
}

.tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.text-input-shell {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  min-width: 0;
}

.text-input-shell input {
  padding-right: 48px;
  background: #fff;
}

.text-input-shell .icon-btn {
  position: absolute;
  right: 5px;
  width: 32px;
  height: 32px;
}

.tools-row .btn {
  padding: 11px 15px;
  font-size: 12.5px;
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink-2);
  font-weight: 600;
}

.tools-row .btn:hover {
  border-color: rgba(59, 110, 246, 0.4);
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.tools-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.tools-hint {
  min-height: 18px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--ink-4);
  transition: color 0.2s ease;
}

.tools-hint.is-error {
  color: #bf2b46;
}

.tools-hint.is-success {
  color: #0b8f66;
}

/* ---------------- step 3 shield ---------------- */

.shield-stage {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shield-hero {
  display: flex;
  align-items: center;
  gap: 20px;
}

.shield-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  flex: none;
  border-radius: 24px;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 20px 40px -16px rgba(59, 110, 246, 0.85);
}

.shield-ring {
  position: absolute;
  inset: -7px;
  border-radius: 30px;
  border: 1.5px solid rgba(59, 110, 246, 0.35);
  animation: shieldPulse 2.6s ease-out infinite;
  pointer-events: none;
}

@keyframes shieldPulse {
  0% { transform: scale(0.94); opacity: 0.8; }
  70% { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(1.12); opacity: 0; }
}

.shield-copy h2 {
  margin-top: 6px;
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  letter-spacing: -0.02em;
  font-weight: 800;
}

.shield-copy p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-3);
}

.fulfill-steps {
  display: grid;
  gap: 9px;
}

.fulfill-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-3);
  transition: all 0.3s ease;
}

.fs-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: #eef1fa;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  transition: all 0.3s ease;
}

.fs-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.fs-copy strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  transition: color 0.2s ease;
}

.fs-copy > span {
  font-size: 11.5px;
  color: var(--ink-4);
}

.fs-check {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  transition: all 0.3s ease;
}

.fulfill-step.is-active {
  border-color: rgba(59, 110, 246, 0.42);
  background: linear-gradient(100deg, rgba(59, 110, 246, 0.08), rgba(34, 200, 230, 0.05));
  box-shadow: 0 14px 34px -22px rgba(59, 110, 246, 0.9);
  color: var(--ink);
}

.fulfill-step.is-active .fs-dot {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(59, 110, 246, 0.9);
  animation: dotPulse 2s ease-out infinite;
}

.fulfill-step.is-active .fs-copy strong {
  color: var(--ink);
}

.fulfill-step.is-done .fs-dot {
  background: #e3faf1;
  color: var(--success);
}

.fulfill-step.is-done .fs-copy strong {
  color: var(--ink-2);
}

.fulfill-step.is-done .fs-check {
  background: var(--grad-success);
  color: #fff;
}

.fulfill-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(16, 20, 42, 0.07);
  overflow: hidden;
}

.fulfill-progress span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: var(--grad-brand);
  transition: width 0.6s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.detected-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.detected-card {
  padding: 13px 16px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: #fff;
  min-width: 0;
}

.detected-card-price {
  background: linear-gradient(150deg, rgba(59, 110, 246, 0.07), rgba(34, 200, 230, 0.06));
  border-color: rgba(59, 110, 246, 0.18);
}

.detected-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-4);
}

.detected-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.detected-card-price strong {
  background: linear-gradient(100deg, #2952d9, #1a9fc4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.shield-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.shield-foot p {
  font-size: 11.5px;
  color: var(--ink-4);
}

.shield-foot .btn {
  padding: 10px 16px;
  font-size: 12.5px;
}

/* ---------------- step 4 result ---------------- */

.result-card {
  max-width: 640px;
  margin: 8px auto 10px;
  padding: 40px 34px 34px;
  text-align: center;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 0%, rgba(59, 110, 246, 0.09), transparent 55%),
    #fff;
  animation: panelIn 0.4s ease both;
}

.result-card.is-success {
  background:
    radial-gradient(circle at 50% 0%, rgba(18, 185, 129, 0.12), transparent 58%),
    #fff;
  border-color: rgba(18, 185, 129, 0.22);
}

.result-card.is-failure {
  background:
    radial-gradient(circle at 50% 0%, rgba(233, 63, 91, 0.09), transparent 58%),
    #fff;
  border-color: rgba(233, 63, 91, 0.16);
}

.result-icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 auto 20px;
  border-radius: 26px;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 22px 44px -18px rgba(59, 110, 246, 0.85);
}

.result-card.is-success .result-icon {
  background: var(--grad-success);
  box-shadow: 0 22px 44px -18px rgba(18, 185, 129, 0.85);
}

.result-card.is-failure .result-icon {
  background: linear-gradient(135deg, #f4677c, #dd2f4e);
  box-shadow: 0 22px 44px -18px rgba(233, 63, 91, 0.7);
}

.result-icon svg {
  width: 38px;
  height: 38px;
}

.result-card h2 {
  margin-top: 7px;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  letter-spacing: -0.025em;
  font-weight: 800;
}

.result-card > p {
  margin: 10px auto 0;
  max-width: 480px;
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.7;
}

.result-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 24px 0 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  text-align: left;
}

.result-details > div {
  padding: 12px 16px;
  background: #fbfcff;
  min-width: 0;
}

.result-details dt {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-4);
}

.result-details dd {
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.result-details dd code {
  font-size: 11.5px;
  color: var(--brand-deep);
}

.result-note {
  margin-top: 18px;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px dashed var(--line-strong);
  font-size: 12px !important;
  color: var(--ink-3) !important;
}

.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

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

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 24px 46px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-4);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: background 0.2s ease, color 0.2s ease;
  user-select: none;
}

.footer-brand:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.footer-brand img {
  border-radius: 8px;
  opacity: 0.85;
}

.footer-note {
  color: var(--ink-4);
  opacity: 0.85;
}

/* ============================================================
   ADMIN CONSOLE
   ============================================================ */

.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 30, 0.58);
  backdrop-filter: blur(9px);
  animation: fadeIn 0.25s ease both;
}

.admin-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1280px, 100%);
  height: min(900px, calc(100vh - 40px));
  border-radius: 26px;
  overflow: hidden;
  background: #f6f7fc;
  box-shadow: var(--shadow-pop);
  animation: shellIn 0.32s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

@keyframes shellIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.admin-title-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
}

.admin-title-wrap img {
  border-radius: 10px;
}

.admin-title-wrap h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.admin-title-wrap p {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-4);
}

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

.admin-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #ecfbf5;
  border: 1px solid rgba(18, 185, 129, 0.2);
  color: #0b8f66;
  font-size: 11px;
  font-weight: 700;
}

.admin-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: blink 2s ease-in-out infinite;
}

/* gate */

.admin-gate {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(59, 110, 246, 0.12), transparent 50%),
    radial-gradient(circle at 85% 88%, rgba(34, 200, 230, 0.12), transparent 55%),
    #f6f7fc;
  overflow: auto;
}

.gate-card {
  width: min(420px, 100%);
  padding: 34px 32px 26px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.gate-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 16px 34px -14px rgba(59, 110, 246, 0.8);
}

.gate-card h3 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gate-card > p {
  margin: 7px 0 20px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.gate-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gate-card .form-alert {
  text-align: left;
}

.gate-note {
  margin-top: 16px !important;
  margin-bottom: 0 !important;
  font-size: 11px !important;
  color: var(--ink-4) !important;
}

/* console layout */

.admin-console {
  flex: 1;
  min-height: 0;
  display: flex;
}

.admin-tabs {
  width: 218px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  background: #fff;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: all 0.18s ease;
}

.admin-tab:hover {
  background: var(--surface-muted);
  color: var(--ink-2);
}

.admin-tab.is-active {
  background: linear-gradient(100deg, rgba(59, 110, 246, 0.11), rgba(34, 200, 230, 0.07));
  color: var(--brand-deep);
  box-shadow: inset 0 0 0 1px rgba(59, 110, 246, 0.14);
}

.admin-tab svg {
  flex: none;
}

.admin-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 22px 24px 40px;
  scroll-behavior: smooth;
}

.admin-panel {
  animation: panelIn 0.26s ease both;
}

.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-panel-head h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-panel-head p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-3);
}

/* stat cards */

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

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

.stat-card::after {
  content: "";
  position: absolute;
  top: -28px;
  right: -28px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(59, 110, 246, 0.06);
}

.stat-card span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-4);
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.stat-card.is-good {
  background: linear-gradient(150deg, rgba(18, 185, 129, 0.08), #fff 65%);
  border-color: rgba(18, 185, 129, 0.2);
}

.stat-card.is-good strong {
  color: #0b8f66;
}

.stat-card.is-muted strong {
  color: var(--ink-3);
}

/* admin cards + grids */

.admin-card {
  padding: 18px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.admin-grid {
  display: grid;
  gap: 13px;
}

.admin-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-grid .field input,
.admin-grid .field select,
.admin-grid .field textarea {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 13px;
  border-radius: 11px;
}

.admin-grid .field > span {
  font-size: 12px;
}

.admin-form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 15px;
}

.form-note {
  font-size: 11.5px;
  color: var(--ink-4);
  line-height: 1.5;
}

.switch-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  align-self: end;
  min-height: 41px;
  padding: 9px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.switch {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 23px;
  flex: none;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d6dcea;
  transition: background 0.2s ease;
  pointer-events: none;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 20, 42, 0.25);
  transition: transform 0.2s ease;
}

.switch input:checked + i {
  background: var(--brand);
}

.switch input:checked + i::after {
  transform: translateX(17px);
}

.switch input:focus-visible + i {
  outline: 2px solid rgba(59, 110, 246, 0.6);
  outline-offset: 2px;
}

/* segmented control */

.segmented {
  display: inline-flex;
  padding: 3px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.seg-btn {
  border: 0;
  padding: 8px 15px;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.seg-btn:hover {
  color: var(--ink-2);
}

.seg-btn.is-active {
  background: #fff;
  color: var(--brand-deep);
  box-shadow: 0 3px 10px -4px rgba(16, 20, 42, 0.25);
}

.bulk-fields {
  display: flex;
  flex-direction: column;
  gap: 13px;
  animation: panelIn 0.22s ease both;
}

.bulk-fields .field {
  max-width: 100%;
}

.proxy-format-note {
  align-self: end;
  padding-bottom: 10px;
}

/* generated box */

.generated-box {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(18, 185, 129, 0.25);
  background: linear-gradient(150deg, rgba(18, 185, 129, 0.06), #fff 60%);
  animation: panelIn 0.25s ease both;
}

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

.generated-head strong {
  font-size: 12.5px;
  font-weight: 700;
  color: #0b8f66;
}

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

.generated-box textarea {
  background: #fff;
  min-height: 90px;
}

/* list toolbar */

.list-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 2px 0 13px;
}

.list-toolbar select,
.list-toolbar input {
  width: auto;
  height: 38px;
  padding: 8px 13px;
  font-size: 12.5px;
  border-radius: 10px;
}

.list-toolbar select {
  padding-right: 36px;
  background-position: right 12px center;
}

.list-toolbar input[type="search"] {
  width: 220px;
}

.toolbar-spacer {
  flex: 1;
}

.list-toolbar .btn {
  padding: 9px 13px;
  font-size: 12px;
}

.list-foot {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink-4);
}

/* data tables */

.table-wrap {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th {
  padding: 10px 13px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-4);
  background: #f9fafd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink-2);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: #fafbff;
}

.data-table .col-actions {
  text-align: right;
}

.data-table td.col-actions {
  text-align: right;
}

.code-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}

.code-cell code {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-muted);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-cell .mini-btn {
  padding: 3px 8px;
  font-size: 10.5px;
  border-radius: 7px;
}

.cell-sub {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--ink-4);
}

.cell-mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.cell-note {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-3);
}

.cell-time {
  font-size: 11px;
  color: var(--ink-4);
  white-space: nowrap;
}

.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.row-actions .mini-btn {
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef1f8;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

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

.badge.is-ok {
  background: #e7fbf3;
  color: #0b8f66;
}

.badge.is-info {
  background: #eaf0ff;
  color: #3457c9;
}

.badge.is-warn {
  background: #fff6e5;
  color: #b47408;
}

.badge.is-danger {
  background: #ffecef;
  color: #c22643;
}

.badge.is-muted {
  background: #eef1f8;
  color: #798199;
}

.badge.is-plain {
  background: #f1f4fb;
  color: var(--ink-2);
}

.table-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 34px 18px;
  color: var(--ink-4);
  font-size: 12px;
  text-align: center;
}

.table-empty.is-error {
  color: #bf2b46;
}

.inline-spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(59, 110, 246, 0.2);
  border-top-color: var(--brand);
  animation: spin 0.75s linear infinite;
  flex: none;
}

/* settings */

.settings-card {
  margin-top: 22px;
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.settings-head h4 {
  font-size: 14.5px;
  font-weight: 800;
}

.settings-head p {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ============================================================
   MODAL
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 30, 0.55);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.2s ease both;
}

.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(780px, 100%);
  max-height: calc(100vh - 36px);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: shellIn 0.24s ease both;
}

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

.modal-head h3 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--ink-2);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: #fafbff;
}

.modal-footer:empty {
  display: none;
}

.confirm-text {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

.assist-hint {
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.65;
}

.assist-label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.diagnostic-shot {
  display: block;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-deep);
}

.shot-meta {
  margin-top: 10px;
  font-size: 11px;
  color: var(--ink-4);
  text-align: center;
}

.shot-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 46px 20px;
  color: var(--ink-4);
  font-size: 12.5px;
}

.log-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-muted);
  font-size: 11.5px;
  color: var(--ink-3);
}

.log-summary strong {
  color: var(--ink-2);
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbfcff;
  max-height: 52vh;
  overflow-y: auto;
}

.log-item {
  display: flex;
  gap: 12px;
  padding: 8px 13px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.55;
}

.log-item:last-child {
  border-bottom: 0;
}

.log-time {
  flex: none;
  width: 128px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
}

.log-message {
  flex: 1;
  min-width: 0;
  color: var(--ink-2);
  word-break: break-word;
  white-space: pre-wrap;
}

/* ============================================================
   TOASTS
   ============================================================ */

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  background: #fff;
  box-shadow: var(--shadow-soft);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
  animation: toastIn 0.26s cubic-bezier(0.22, 0.8, 0.3, 1) both;
  pointer-events: auto;
}

.toast.is-success { border-left-color: var(--success); }
.toast.is-error { border-left-color: var(--danger); }
.toast.is-warn { border-left-color: var(--warning); }

.toast.is-leaving {
  animation: toastOut 0.24s ease forwards;
}

.toast-dot {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--brand);
  flex: none;
}

.toast.is-success .toast-dot { background: var(--success); }
.toast.is-error .toast-dot { background: var(--danger); }
.toast.is-warn .toast-dot { background: var(--warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

.noscript-banner {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 300;
  padding: 14px 18px;
  border-radius: 12px;
  background: #b62b44;
  color: #fff;
  text-align: center;
  font-size: 13px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1080px) {
  .admin-tabs {
    width: 190px;
  }

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

@media (max-width: 900px) {
  .header-tag {
    display: none;
  }

  .order-shell {
    margin-left: 18px;
    margin-right: 18px;
    padding: 24px 24px 30px;
  }

  .admin-tabs {
    width: 168px;
    padding: 12px 8px;
  }

  .admin-tab {
    padding: 10px 11px;
    font-size: 12.5px;
  }

  .admin-content {
    padding: 18px 18px 34px;
  }

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

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .site-header {
    padding: 18px 18px 4px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand-name {
    font-size: 18px;
  }

  .health-pill {
    padding: 7px 11px;
    font-size: 11px;
  }

  .hero {
    padding: 32px 20px 28px;
  }

  .hero h1 {
    margin-top: 18px;
  }

  .hero-sub {
    margin-top: 14px;
  }

  .only-desktop {
    display: none;
  }

  .hero-points {
    gap: 8px 14px;
    margin-top: 18px;
  }

  .order-shell {
    margin: 0 12px 60px;
    padding: 20px 16px 24px;
    border-radius: 24px;
  }

  .shell-top {
    gap: 12px;
    padding-bottom: 20px;
    margin-bottom: 22px;
  }

  .shell-secure {
    display: none;
  }

  .stepper-item {
    font-size: 11px;
    gap: 7px;
  }

  .stepper-item:not(:last-child)::after {
    top: 15px;
    left: calc(50% + 21px);
    right: calc(-50% + 21px);
  }

  .step-dot {
    width: 31px;
    height: 31px;
    font-size: 12px;
  }

  .panel-heading {
    margin-bottom: 20px;
  }

  .panel-heading p {
    font-size: 12.5px;
  }

  .panel-heading-row {
    flex-direction: column;
    gap: 10px;
  }

  .conn-pill {
    margin-top: 0;
  }

  .mode-field {
    grid-template-columns: 1fr;
  }

  .mode-card {
    padding: 13px 14px;
    gap: 11px;
  }

  .mode-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .cookie-zone {
    padding: 14px;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .form-actions .btn-lg {
    width: 100%;
  }

  .privacy-line {
    justify-content: center;
  }

  .session-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }

  .session-tags {
    justify-content: flex-start;
  }

  .screen-frame {
    border-radius: 15px;
  }

  .screen-tip {
    font-size: 10.5px;
  }

  .tools-card {
    padding: 15px 14px 13px;
    border-radius: 16px;
  }

  .tools-row {
    gap: 8px;
  }

  .text-input-shell {
    flex: 1 1 100%;
  }

  .tools-row .btn {
    flex: 1 1 calc(50% - 4px);
    padding: 10px 8px;
    font-size: 11.5px;
  }

  .tools-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tools-actions .btn {
    width: 100%;
  }

  .shield-hero {
    align-items: flex-start;
    gap: 14px;
  }

  .shield-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .shield-mark svg {
    width: 27px;
    height: 27px;
  }

  .shield-ring {
    inset: -5px;
    border-radius: 22px;
  }

  .fulfill-step {
    padding: 11px 13px;
    gap: 11px;
  }

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

  .shield-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .shield-foot .btn {
    width: 100%;
  }

  .result-card {
    padding: 30px 18px 26px;
  }

  .result-details {
    grid-template-columns: 1fr;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions .btn {
    width: 100%;
  }

  .site-footer {
    padding-bottom: 36px;
  }

  /* admin mobile */
  .admin-overlay {
    padding: 0;
  }

  .admin-shell {
    width: 100%;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
  }

  .admin-header {
    padding: 11px 14px;
  }

  .admin-title-wrap h2 {
    font-size: 14.5px;
  }

  .admin-live {
    display: none;
  }

  .admin-console {
    flex-direction: column;
  }

  .admin-tabs {
    width: 100%;
    flex-direction: row;
    gap: 4px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
    flex: none;
  }

  .admin-tab {
    width: auto;
    flex: none;
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .admin-content {
    padding: 16px 12px 30px;
  }

  .admin-panel-head {
    align-items: center;
  }

  .admin-panel-head h3 {
    font-size: 16px;
  }

  .admin-grid.cols-3,
  .admin-grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 12px 14px;
  }

  .stat-card strong {
    font-size: 21px;
  }

  .list-toolbar {
    gap: 7px;
  }

  .list-toolbar input[type="search"] {
    width: 100%;
    flex: 1 1 100%;
  }

  .list-toolbar .toolbar-spacer {
    display: none;
  }

  .admin-card {
    padding: 14px;
  }

  .gate-card {
    padding: 28px 20px 22px;
  }

  .modal {
    padding: 10px;
  }

  .modal-card {
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }

  .modal-body {
    padding: 15px;
  }

  .log-item {
    flex-direction: column;
    gap: 2px;
  }

  .log-time {
    width: auto;
  }

  .toast-stack {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

@media (max-width: 480px) {
  .only-mobile {
    display: inline;
  }
}

@media (max-width: 420px) {
  .stepper-item {
    font-size: 10px;
  }

  .step-label {
    letter-spacing: -0.02em;
  }

  .eyebrow {
    font-size: 10.5px;
  }

  .tools-row .btn {
    flex: 1 1 100%;
  }

  .hero-badge {
    font-size: 11px;
    padding: 7px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
