:root {
  --rfc-bg-1: #f5f7fb;
  --rfc-bg-2: #eef2f8;
  --rfc-accent: #0ea5e9;
  --rfc-accent-strong: #0284c7;
  --rfc-accent-bg: #e9f2ff;
  --rfc-navbar-bg: #ffffff;
  --rfc-navbar-text: #1e293b;
  --rfc-card-bg: #ffffff;
  --rfc-text: #1e293b;
  --rfc-text-secondary: #64748b;
  --rfc-input-bg: #ffffff;
  --rfc-input-border: #d1d5db;
  --rfc-input-text: #1e293b;
  --rfc-border: #e5e7eb;
  --rfc-table-stripe: rgba(0, 0, 0, 0.02);
  --rfc-accent-rgb: 14, 165, 233;
  --rfc-success: #0f9f6e;
  --rfc-success-bg: #e6f8f1;
  --rfc-warning: #d97706;
  --rfc-warning-bg: #fff4db;
  --rfc-danger: #dc2626;
  --rfc-danger-bg: #feeceb;
  --rfc-card-bg-rgb: 255, 255, 255;
}

html[data-theme-tone="dark"] {
  --rfc-bg-1: #0c1220;
  --rfc-bg-2: #111a2d;
  --rfc-accent: #38bdf8;
  --rfc-accent-strong: #0ea5e9;
  --rfc-accent-bg: rgba(56, 189, 248, 0.14);
  --rfc-navbar-bg: rgba(13, 20, 35, 0.86);
  --rfc-navbar-text: #e2e8f0;
  --rfc-card-bg: #101827;
  --rfc-text: #e5edf7;
  --rfc-text-secondary: #94a3b8;
  --rfc-input-bg: #0f172a;
  --rfc-input-border: #243247;
  --rfc-input-text: #e5edf7;
  --rfc-border: #233044;
  --rfc-table-stripe: rgba(148, 163, 184, 0.08);
  --rfc-accent-rgb: 56, 189, 248;
  --rfc-success: #34d399;
  --rfc-success-bg: rgba(52, 211, 153, 0.12);
  --rfc-warning: #fbbf24;
  --rfc-warning-bg: rgba(251, 191, 36, 0.12);
  --rfc-danger: #f87171;
  --rfc-danger-bg: rgba(248, 113, 113, 0.12);
  --rfc-card-bg-rgb: 16, 24, 39;
}

body {
  --tblr-bg-surface: var(--rfc-card-bg);
  --tblr-bg-surface-secondary: var(--rfc-bg-2);
  --tblr-border-color: var(--rfc-border);
  --tblr-body-color: var(--rfc-text);
  --tblr-body-bg: var(--rfc-bg-1);
  --tblr-muted: var(--rfc-text-secondary);
  --tblr-secondary: var(--rfc-text-secondary);
  --tblr-primary: var(--rfc-accent);
  --tblr-card-bg: var(--rfc-card-bg);
  --tblr-card-border-color: var(--rfc-border);
  --tblr-table-border-color: var(--rfc-border);
  background: var(--rfc-bg-1);
  min-height: 100vh;
  color: var(--rfc-text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--rfc-accent-bg) 0%, transparent 60%),
    linear-gradient(180deg, var(--rfc-bg-1) 0%, var(--rfc-bg-2) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.025;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--rfc-text) 0.6px, transparent 0.6px);
  background-size: 24px 24px;
}

.navbar {
  background: var(--rfc-navbar-bg) !important;
  box-shadow: inset 0 -1px 0 0 var(--rfc-border) !important;
}

.navbar .container-xl {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar .container-xl,
.page-header .container-xl,
.page-body > .container-xl {
  width: 100%;
  max-width: 100%;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.navbar .navbar-nav.flex-row.order-md-last {
  margin-left: auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.navbar .nav-link,
.navbar .navbar-brand {
  color: var(--rfc-navbar-text) !important;
}

.navbar .navbar-collapse .navbar-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  column-gap: 0.15rem;
  row-gap: 0.2rem;
}

.navbar .navbar-collapse .nav-link {
  padding-left: 0.55rem !important;
  padding-right: 0.55rem !important;
}

.navbar .nav-link-title {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.navbar .nav-link.active {
  color: var(--rfc-accent) !important;
}

.navbar-brand strong {
  letter-spacing: 0.08em;
}

.rfc-brand {
  position: relative;
  cursor: pointer;
}

.rfc-brand-text {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.14em;
  transition: transform 0.2s ease;
}

.rfc-brand:hover .rfc-brand-text {
  transform: translateY(-1px);
}

html[data-logo-effect="theme"] .rfc-brand-text {
  color: transparent !important;
  background-image: linear-gradient(120deg, var(--rfc-navbar-text) 0%, var(--rfc-accent) 35%, #ffffff 60%, var(--rfc-navbar-text) 100%);
  background-size: 220% auto;
  background-clip: text;
  -webkit-background-clip: text;
  animation: brandFlow 6s linear infinite;
}

@keyframes brandFlow {
  from { background-position: 0% 50%; }
  to { background-position: 220% 50%; }
}

.logo-art-popover {
  position: fixed;
  z-index: 2400;
  width: min(360px, 88vw);
  display: none;
}

.logo-art-popover.is-open {
  display: block;
}

.logo-art-popover-inner {
  position: relative;
  padding: 0.95rem;
  border-radius: 24px;
  border: 1px solid rgba(var(--rfc-accent-rgb), 0.18);
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.04) 100%);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(14px);
}

.logo-art-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 290px;
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, rgba(var(--rfc-accent-rgb), 0.16), transparent 35%);
}

.logo-art-orb {
  position: absolute;
  width: min(56vw, 420px);
  height: min(56vw, 420px);
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.52), transparent 24%),
    radial-gradient(circle at 60% 60%, rgba(var(--rfc-accent-rgb), 0.44), transparent 62%);
}

.logo-art-image {
  position: relative;
  z-index: 1;
  width: min(78vw, 300px);
  max-height: 280px;
  object-fit: contain;
}

.logo-art-image.is-hidden,
.logo-art-placeholder.is-hidden {
  display: none;
}

.logo-art-placeholder {
  position: relative;
  z-index: 1;
  width: min(78vw, 520px);
  text-align: center;
  color: var(--rfc-text);
}

.logo-art-placeholder-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 1rem 1.4rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: rgba(var(--rfc-accent-rgb), 0.16);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.logo-art-placeholder-text {
  max-width: 340px;
  margin: 0 auto;
  color: var(--rfc-text-secondary);
}

.page-body {
  padding: 1.5rem 0 2.5rem;
}

.login-shell {
  margin: 0;
}

.login-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.login-card {
  width: min(100%, 430px);
  padding: 1.6rem;
  border-radius: 1.35rem;
  border: 1px solid var(--rfc-border);
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.96) 0%, var(--rfc-card-bg) 100%);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.14);
}

.login-badge {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  background: rgba(var(--rfc-accent-rgb), 0.12);
  color: var(--rfc-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.7rem;
  margin: 0 0 0.4rem;
}

.login-subtitle {
  margin: 0 0 1.25rem;
  color: var(--rfc-text-secondary);
}

.login-fields {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.panel {
  background: var(--rfc-card-bg);
  border: 1px solid var(--rfc-border);
  border-radius: 1.25rem;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  padding: 1.25rem;
  overflow-x: auto;
}

.panel + .panel {
  margin-top: 1rem;
}

.section-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--rfc-text);
  margin-bottom: 0.35rem;
}

.section-subtitle,
.status-text,
.text-muted,
.text-secondary,
.form-label {
  color: var(--rfc-text-secondary) !important;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.stats-grid {
  display: grid;
  gap: 1rem;
}

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

.page-generator-layout {
  display: block;
  width: 100%;
}

.page-generator-layout--compact {
  display: block;
}

.page-generator-form {
  min-width: 0;
  width: 100%;
}

.template-preview-card {
  border: 1px solid var(--rfc-border);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.04) 100%);
  padding: 1rem;
}

.template-preview-card--bottom {
  width: 100%;
}

.template-preview-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.template-preview-frame-wrap {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--rfc-border);
  background: linear-gradient(180deg, rgba(var(--rfc-accent-rgb), 0.1) 0%, rgba(var(--rfc-card-bg-rgb), 0.92) 100%);
  min-height: 640px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.template-preview-frame {
  width: 100%;
  height: 640px;
  border: 0;
  background: #fff;
  transform-origin: top left;
}

.template-preview-frame-wrap--compact {
  min-height: 0;
}

.template-preview-frame--compact {
  height: 100%;
}

.template-preview-frame-wrap--bottom {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: auto;
  aspect-ratio: 16 / 9;
}

.template-preview-card--bottom .template-preview-frame {
  height: 100%;
}

.section-title--small {
  font-size: 1.05rem;
}

.section-subtitle--tight {
  margin-bottom: 0;
}

.form-note {
  font-size: 0.78rem;
}

.dynamic-field {
  display: grid;
  gap: 0.45rem;
}

.smart-select {
  border: 1px solid var(--rfc-border);
  border-radius: 1rem;
  padding: 0.85rem;
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.035) 100%);
}

.smart-select__label {
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rfc-text-secondary);
}

.smart-select__value {
  margin-top: 0.7rem;
  font-weight: 600;
  color: var(--rfc-text);
}

.smart-select__meta {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--rfc-text-secondary);
}

.smart-select--powershell {
  border-color: rgba(var(--rfc-accent-rgb), 0.25);
}

.smart-select--javascript {
  border-color: color-mix(in srgb, var(--rfc-success) 28%, var(--rfc-border));
}

.smart-select--asset {
  border-color: color-mix(in srgb, var(--rfc-warning) 28%, var(--rfc-border));
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid var(--rfc-border);
  border-radius: 999px;
  background: rgba(var(--rfc-card-bg-rgb), 0.72);
  backdrop-filter: blur(10px);
}

.light-pages-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
  gap: 1.25rem;
  align-items: start;
}

.light-pages-form {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--rfc-border);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.035) 100%);
}

.light-inline-option {
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--rfc-accent) 20%, var(--rfc-border));
  background: rgba(var(--rfc-accent-rgb), 0.08);
}

.light-summary-card {
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--rfc-border);
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.96) 0%, rgba(var(--rfc-accent-rgb), 0.05) 100%);
}

.light-preview-controls {
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--rfc-accent) 20%, var(--rfc-border));
  background:
    linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.08) 100%);
}

.light-preview-controls__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.light-summary-card__title {
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rfc-text-secondary);
}

.theme-presets-row {
  align-items: center;
  padding: 0.1rem 0;
}

.theme-hex {
  font-size: 0.8rem;
  color: var(--rfc-text-secondary);
}

.theme-preset-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--rfc-border);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  padding: 0;
}

.theme-preset-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-preset-btn.active {
  border-color: var(--rfc-accent);
  box-shadow: 0 0 0 2px var(--rfc-accent);
}

.highlight-box {
  border: 1px solid var(--rfc-border);
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.04) 100%);
  border-radius: 1rem;
  padding: 1rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--rfc-text);
}

.table {
  color: var(--rfc-text) !important;
}

.table > :not(caption) > * > td {
  color: var(--rfc-text);
  border-bottom-color: var(--rfc-border) !important;
  background: transparent !important;
}

.pages-table {
  margin-bottom: 0;
  overflow: hidden;
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.03) 100%);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.pages-table tbody tr:nth-child(odd) {
  background-color: var(--rfc-table-stripe);
}

.pages-table tbody tr:hover {
  background-color: rgba(var(--rfc-accent-rgb), 0.06);
}

.pages-table td,
.pages-table th {
  vertical-align: middle;
}

.pages-table .btn {
  white-space: nowrap;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--rfc-card-bg) !important;
  color: var(--rfc-text-secondary) !important;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 1px solid var(--rfc-border) !important;
}

.table th,
.table td {
  padding: 0.65rem 0.9rem;
  vertical-align: middle;
}

.table:not(.pages-table) tbody tr:nth-child(even),
.table-striped:not(.pages-table) tbody tr:nth-child(even) {
  background-color: var(--rfc-table-stripe);
}

.table tbody tr:hover {
  background-color: rgba(var(--rfc-accent-rgb), 0.06);
}

.table-bordered,
.table-bordered th,
.table-bordered td {
  border-color: var(--rfc-border) !important;
}

.table .badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.form-control,
.form-select {
  background-color: var(--rfc-input-bg) !important;
  border-color: var(--rfc-input-border) !important;
  color: var(--rfc-input-text) !important;
}

.form-control::placeholder {
  color: color-mix(in srgb, var(--rfc-input-text) 55%, transparent) !important;
}

.form-select option {
  background: var(--rfc-input-bg);
  color: var(--rfc-input-text);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--rfc-accent);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--rfc-accent) !important;
  box-shadow: 0 0 0 0.25rem rgba(var(--rfc-accent-rgb), 0.15) !important;
}

.input-group-text {
  background: var(--rfc-input-bg) !important;
  border-color: var(--rfc-input-border) !important;
  color: var(--rfc-input-text) !important;
}

.btn-primary,
.btn-accent {
  background-color: var(--rfc-accent);
  border-color: var(--rfc-accent);
  color: #fff;
}

.btn-primary:hover,
.btn-accent:hover {
  filter: brightness(0.94);
  color: #fff;
}

.btn-ghost,
.btn-outline-secondary {
  color: var(--rfc-text-secondary);
  border-color: var(--rfc-input-border);
}

.btn-ghost:hover,
.btn-outline-secondary:hover {
  background-color: var(--rfc-table-stripe);
  color: var(--rfc-text);
}

.code-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  background: rgba(var(--rfc-accent-rgb), 0.1);
  color: var(--rfc-accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.empty-state {
  text-align: center;
  padding: 1rem;
  color: var(--rfc-text-secondary);
}

.panel--nested {
  border: none;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}

.zone-panel {
  position: relative;
  overflow: hidden;
}

.zone-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 999px;
  background: var(--rfc-accent);
}

.zone-panel--workers::before {
  background: var(--rfc-accent);
}

.zone-panel--domains::before {
  background: var(--rfc-success);
}

.zone-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.zone-panel__eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--rfc-text-secondary);
  margin-bottom: 0.35rem;
}

.cloudflare-section-head,
.cloudflare-inline-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--rfc-text);
  cursor: pointer;
}

.cloudflare-domain-input {
  max-width: 560px;
}

.table-wrap {
  overflow-x: auto;
}

.cf-modal-backdrop {
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(6px);
  z-index: 1000;
  padding: 1rem;
}

.cf-modal {
  width: min(100%, 520px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 1.2rem;
  border: 1px solid var(--rfc-border);
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.04) 100%);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
  padding: 1.35rem;
}

.cf-modal--wide {
  width: min(100%, 760px);
}

.cf-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
  color: var(--rfc-text);
}

.cf-modal__close {
  border: none;
  background: transparent;
  color: var(--rfc-text-secondary);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.cf-modal__text {
  margin-bottom: 1rem;
  color: var(--rfc-text-secondary);
}

.cf-modal__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.cf-modal__list code {
  display: block;
  padding: 0.65rem 0.8rem;
  border-radius: 0.8rem;
  background: var(--rfc-table-stripe);
}

.cf-modal__content {
  display: grid;
  gap: 1rem;
}

.cf-modal__actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.email-dns-section {
  border: 1px solid var(--rfc-border);
  border-radius: 1rem;
  padding: 0.9rem;
  background: rgba(var(--rfc-card-bg-rgb), 0.82);
}

.dns-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dns-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.email-dns-rows {
  display: grid;
  gap: 0.45rem;
}

.dns-grid {
  display: grid;
  gap: 0.4rem;
}

.dns-grid--mx {
  grid-template-columns: 1fr 70px 28px;
}

.dns-grid--cname {
  grid-template-columns: 1fr 1fr 90px 28px;
}

.dns-grid-caption {
  padding-bottom: 0.2rem;
}

.dns-hint {
  margin-top: 0.35rem;
  font-size: 0.74rem;
}

.btn-sun {
  background: var(--rfc-warning-bg);
  color: var(--rfc-warning);
  border: 1px solid color-mix(in srgb, var(--rfc-warning) 35%, var(--rfc-border));
}

.shared-badge {
  font-weight: 600;
}

.quick-design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.quick-design-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  border: 1px solid var(--rfc-border);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.035) 100%);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.quick-design-card:hover {
  border-color: color-mix(in srgb, var(--rfc-accent) 45%, var(--rfc-border));
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.quick-design-card:focus-visible {
  outline: none;
  border-color: var(--rfc-accent);
  box-shadow: 0 0 0 3px rgba(var(--rfc-accent-rgb), 0.25);
}

.quick-design-card.quick-design-selected {
  border-color: var(--rfc-accent);
  box-shadow: 0 0 0 3px rgba(var(--rfc-accent-rgb), 0.25), 0 16px 40px rgba(var(--rfc-accent-rgb), 0.16);
}

.quick-design-check {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--rfc-accent);
  color: #fff;
  font-size: 0.8rem;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.quick-design-card.quick-design-selected .quick-design-check {
  opacity: 1;
  transform: scale(1);
}

.quick-design-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 150px;
  background: var(--rfc-bg-2);
  border-bottom: 1px solid var(--rfc-border);
  overflow: hidden;
}

.quick-design-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  background: #fff;
}

.quick-design-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
}

.yyc-wrap,
.yyc-wrap--sm {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.yyc-host {
  display: block;
  line-height: 0;
}

.yyc-frame-loader {
  background: rgba(var(--rfc-card-bg-rgb), 0.86);
  backdrop-filter: blur(4px);
}

#login-cat {
  display: flex;
  justify-content: center;
}

/* ── Help tip ─────────────────────────────────────────────── */

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 0.3rem;
  border-radius: 999px;
  background: rgba(var(--rfc-accent-rgb), 0.14);
  color: var(--rfc-accent);
  font-size: 0.68rem;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  user-select: none;
}

.help-tip i {
  font-size: 0.68rem;
  line-height: 1;
}

.help-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: 260px;
  padding: 0.5rem 0.65rem;
  border-radius: 0.6rem;
  background: #0f172a;
  color: #e5edf7;
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
  z-index: 60;
}

.help-tip:hover::after,
.help-tip:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ── Selection ────────────────────────────────────────────── */

::selection {
  background: rgba(var(--rfc-accent-rgb), 0.28);
  color: var(--rfc-text);
}

/* ── Scrollbar ────────────────────────────────────────────── */

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--rfc-text-secondary) 35%, transparent);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--rfc-text-secondary) 55%, transparent);
}

/* ── Focus visible ────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--rfc-accent);
  outline-offset: 2px;
}

@media (max-width: 991.98px) {
  .grid-two,
  .stats-grid--triple,
  .page-generator-layout,
  .light-pages-grid {
    grid-template-columns: 1fr;
  }

  .template-preview-frame-wrap,
  .template-preview-frame {
    min-height: 620px;
    height: 620px;
  }

  .template-preview-frame-wrap--compact,
  .template-preview-frame--compact {
    min-height: 520px;
    height: 520px;
  }

  .cf-modal__actions,
  .cloudflare-section-head,
  .cloudflare-inline-actions,
  .zone-panel__head {
    align-items: stretch;
  }
}

/* ══ AI Chat (перенесено из panel ai-chat.html, на токенах --rfc-*) ══ */

.ai-chat-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 190px);
  min-height: 460px;
  padding: 0;
  overflow: hidden;
}

.ai-chat-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
}

.ai-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--rfc-border);
  background: var(--rfc-bg-2);
  border-radius: 1.25rem 1.25rem 0 0;
}

.ai-chat-orb {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--rfc-accent), var(--rfc-accent-strong));
  box-shadow: 0 4px 14px rgba(var(--rfc-accent-rgb), 0.35);
}

.ai-chat-head-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 0%;
}

.ai-chat-head-text {
  min-width: 0;
  overflow: hidden;
}

.ai-chat-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--rfc-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50ch;
}

.ai-chat-sub {
  font-size: 11.5px;
  color: var(--rfc-text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50ch;
}

.ai-system-wrap {
  flex-shrink: 0;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--rfc-border);
  background: var(--rfc-bg-1);
}

.ai-chat-body {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
}

.ai-chat-empty {
  margin: auto;
  text-align: center;
  color: var(--rfc-text-secondary);
  font-size: 13.5px;
  max-width: 340px;
}

.ai-chat-empty-icon {
  font-size: 34px;
  color: var(--rfc-accent);
  opacity: 0.55;
  margin-bottom: 0.5rem;
}

/* ── Сообщения ── */

.ai-msg {
  display: flex;
  margin-bottom: 0.75rem;
  animation: aiMsgIn 0.24s ease-out;
}

.ai-msg-user {
  justify-content: flex-end;
}

.ai-msg-assistant {
  justify-content: flex-start;
}

.ai-bubble {
  max-width: 80%;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  min-width: 0;
}

.ai-msg-user .ai-bubble {
  background: rgba(var(--rfc-accent-rgb), 0.12);
  border: 1px solid rgba(var(--rfc-accent-rgb), 0.28);
}

.ai-msg-assistant .ai-bubble {
  background: var(--rfc-bg-2);
  border: 1px solid var(--rfc-border);
}

.ai-bubble--typing {
  color: var(--rfc-text-secondary);
  font-style: italic;
}

.ai-msg-body {
  word-break: break-word;
  min-width: 0;
}

.ai-msg-body p {
  margin-bottom: 0.5rem;
}

.ai-msg-body p:last-child {
  margin-bottom: 0;
}

.ai-msg-body ul {
  margin-bottom: 0.5rem;
  padding-left: 1.2rem;
}

.ai-msg-body ul:last-child {
  margin-bottom: 0;
}

.ai-msg-body h3,
.ai-msg-body h4,
.ai-msg-body h5,
.ai-msg-body h6 {
  margin: 0.5rem 0 0.3rem;
}

.ai-msg-body h3:first-child,
.ai-msg-body h4:first-child,
.ai-msg-body h5:first-child,
.ai-msg-body h6:first-child {
  margin-top: 0;
}

.ai-msg-body a {
  color: var(--rfc-accent);
}

.ai-msg-body code:not(.ai-code) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(var(--rfc-accent-rgb), 0.1);
  color: var(--rfc-text);
  padding: 1px 5px;
  border-radius: 4px;
}

.ai-code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.4rem 0;
  padding: 8px 10px;
  background: var(--rfc-bg-1);
  color: var(--rfc-text);
  border: 1px solid var(--rfc-border);
  border-radius: 6px;
  overflow: auto;
  max-height: 420px;
}

.ai-thinking {
  color: var(--rfc-text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ai-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rfc-text-secondary);
  display: inline-block;
  animation: aiDot 1.2s infinite ease-in-out;
}

.ai-dots span:nth-child(2) { animation-delay: 0.15s; }
.ai-dots span:nth-child(3) { animation-delay: 0.3s; }

.ai-error {
  color: var(--rfc-danger);
}

/* ── Tool-блоки ── */

.ai-tool-call {
  margin-top: 4px;
  animation: aiSlideDown 0.22s ease-out;
}

.ai-tool-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 10px;
  background: var(--rfc-bg-2);
  border: 1px solid var(--rfc-border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--rfc-text);
  cursor: default;
  transition: border-color 0.15s, background 0.15s;
}

.ai-tool-bubble.ai-tool-done {
  cursor: pointer;
}

.ai-tool-bubble.ai-tool-done:hover {
  border-color: var(--rfc-accent);
}

.ai-tool-status {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  color: var(--rfc-accent);
}

.ai-tool-status.pulse > i {
  animation: aiPulse 0.9s infinite ease-in-out;
}

.ai-tool-status.done {
  color: var(--rfc-success);
  background: rgba(52, 211, 153, 0.15);
}

.ai-tool-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-tool-output {
  margin-top: 4px;
  animation: aiSlideDown 0.22s ease-out;
}

.ai-tool-output-pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
  color: var(--rfc-text);
  background: var(--rfc-bg-2);
  border: 1px solid var(--rfc-border);
  border-radius: 6px;
  padding: 8px;
  max-width: 80%;
}

/* ── Чипы-подсказки и композер ── */

.ai-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  padding: 0.6rem 1.1rem;
  border-top: 1px solid var(--rfc-border);
  background: var(--rfc-bg-1);
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--rfc-text);
  background: var(--rfc-bg-2);
  border: 1px solid var(--rfc-border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ai-chip:hover {
  border-color: var(--rfc-accent);
  color: var(--rfc-accent);
  background: rgba(var(--rfc-accent-rgb), 0.08);
}

.ai-chat-composer,
.ai-composer {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  flex-shrink: 0;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--rfc-border);
  background: var(--rfc-bg-2);
  border-radius: 0 0 1.25rem 1.25rem;
}

.ai-chat-composer .form-control,
.ai-composer .form-control {
  resize: none;
  min-height: 44px;
  max-height: 160px;
}

/* ── Анимации ── */

@keyframes aiPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes aiDot {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@keyframes aiSlideDown {
  0% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes aiMsgIn {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ai-msg,
  .ai-tool-call,
  .ai-tool-output {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ai-dots span,
  .ai-tool-status.pulse > i {
    animation: none !important;
  }
}

/* ── Множественные чаты (sidebar) ── */

.ai-chat-layout { display: flex; gap: 0; flex: 1 1 0%; min-height: 0; }

.ai-chat-sidebar {
  width: 250px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--rfc-border);
  background: var(--rfc-bg-1);
  min-height: 0;
}

.ai-chat-sidebar-head {
  padding: 0.85rem 1rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ai-chat-sidebar-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rfc-text-secondary);
}

.ai-chat-sessions { flex: 1 1 0%; overflow-y: auto; padding: 0 0.5rem 0.75rem; display: flex; flex-direction: column; gap: 2px; }

.ai-chat-session {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rfc-text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ai-chat-session:hover { background: var(--rfc-bg-2); }
.ai-chat-session.active { background: rgba(var(--rfc-accent-rgb), 0.12); color: var(--rfc-accent); }

.ai-chat-session-label { flex: 1 1 0%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ai-chat-session-del {
  opacity: 0;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--rfc-text-secondary);
  font-size: 14px;
  padding: 0 2px;
  cursor: pointer;
  line-height: 1;
}
.ai-chat-session:hover .ai-chat-session-del { opacity: 0.7; }
.ai-chat-session-del:hover { color: var(--rfc-danger); opacity: 1; }

/* ── Прикреплённые файлы (код) ── */

.ai-attach-chip.ai-attach-code {
  width: auto;
  max-width: 180px;
  height: auto;
  padding: 4px 8px 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  border: 1px solid var(--rfc-border);
  background: var(--rfc-bg-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  color: var(--rfc-text);
}
.ai-attach-chip.ai-attach-code .ai-attach-code-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.ai-attach-chip.ai-attach-code button { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border-radius: 50%; border: 0; background: #ef4444; color: #fff; font-size: 11px; line-height: 1; cursor: pointer; padding: 0; }

/* ── Карточка готового шаблона (инлайн-превью) ── */

.ai-template-card {
  margin: 0.4rem 0 0.2rem;
  border: 1px solid var(--rfc-border);
  border-radius: 10px;
  background: var(--rfc-bg-1);
  overflow: hidden;
  animation: aiSlideDown 0.24s ease-out;
}

.ai-template-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--rfc-border);
}

.ai-template-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  color: var(--rfc-accent);
  font-weight: 600;
}

.ai-template-tabs { display: flex; gap: 2px; padding: 0.25rem 0.45rem; border-bottom: 1px solid var(--rfc-border); overflow-x: auto; }
.ai-template-tab {
  border: 0; background: transparent; color: var(--rfc-text-secondary);
  font-size: 11.5px; font-weight: 600; padding: 0.3rem 0.6rem; border-radius: 6px; cursor: pointer;
}
.ai-template-tab.active { background: rgba(var(--rfc-accent-rgb), 0.12); color: var(--rfc-accent); }

.ai-template-pane { }
.ai-template-iframe { width: 100%; height: 360px; border: 0; background: #fff; display: block; }
.ai-template-pre {
  margin: 0; padding: 0.6rem 0.7rem; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto;
  color: var(--rfc-text); background: var(--rfc-bg-1);
}

.ai-template-toolbar { display: flex; gap: 0.4rem; padding: 0.4rem 0.7rem 0.6rem; }
.ai-template-toolbar .btn { font-size: 12px; padding: 0.25rem 0.6rem; }

/* ── Quick wizard v2 ── */

.qw-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.qw-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.4rem;
  border: 0;
  background: transparent;
  color: var(--rfc-text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: default;
}

.qw-step--nav {
  cursor: pointer;
}

.qw-step-num {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--rfc-border);
  border-radius: 999px;
  background: var(--rfc-card-bg);
  color: var(--rfc-text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.qw-step--active .qw-step-num {
  border-color: var(--rfc-accent);
  background: var(--rfc-accent);
  color: #fff;
}

.qw-step--active .qw-step-label {
  color: var(--rfc-text);
  font-weight: 600;
}

.qw-step--done .qw-step-num {
  border-color: var(--rfc-success);
  background: var(--rfc-success);
  color: #fff;
}

.qw-step--done .qw-step-label {
  color: var(--rfc-success);
}

.qw-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.qw-type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rfc-border);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.035) 100%);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.qw-type-card:hover {
  border-color: color-mix(in srgb, var(--rfc-accent) 45%, var(--rfc-border));
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.qw-type-card:focus-visible {
  outline: none;
  border-color: var(--rfc-accent);
  box-shadow: 0 0 0 3px rgba(var(--rfc-accent-rgb), 0.25);
}

.qw-type-card.qw-type-selected {
  border-color: var(--rfc-accent);
  box-shadow: 0 0 0 3px rgba(var(--rfc-accent-rgb), 0.25), 0 16px 40px rgba(var(--rfc-accent-rgb), 0.16);
}

.qw-type-card > i {
  font-size: 28px;
  color: var(--rfc-accent);
  line-height: 1;
}

.qw-type-card .qw-type-title {
  color: var(--rfc-text);
  font-weight: 600;
}

.qw-type-card .qw-type-hint {
  color: var(--rfc-text-secondary);
  font-size: 0.8rem;
}

.qw-platform-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.qw-platform-badge--win {
  background: rgba(14, 165, 233, 0.15);
  color: #0284c7;
}

.qw-platform-badge--mac {
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
}

.qw-ai-badge {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(14, 165, 233, 0.9);
  color: #fff;
}

.qw-ai-badge--personal {
  background: rgba(99, 102, 241, 0.9);
}

.qw-dim {
  opacity: 0.35;
  filter: grayscale(0.5);
  pointer-events: none;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.qw-stage-switch {
  display: inline-flex;
  border: 1px solid var(--rfc-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--rfc-input-bg);
}

.qw-stage-switch button {
  border: 0;
  background: transparent;
  padding: 0.45rem 1.1rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--rfc-text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.qw-stage-switch button.active {
  background: var(--rfc-accent);
  color: #fff;
}

.qw-stage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  background: rgba(var(--rfc-card-bg-rgb), 0.25);
  font-size: 0.68rem;
  font-weight: 700;
}

.qw-segment {
  display: inline-flex;
  border: 1px solid var(--rfc-border);
  border-radius: 0.6rem;
  overflow: hidden;
  background: var(--rfc-input-bg);
}

.qw-segment button {
  border: 0;
  background: transparent;
  padding: 0.45rem 1.1rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--rfc-text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.qw-segment button.active {
  background: var(--rfc-accent);
  color: #fff;
}

.qw-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.qw-result-command {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 56px;
  margin: 0;
}

@media (max-width: 640px) {
  .qw-type-grid {
    grid-template-columns: 1fr;
  }
  .qw-steps {
    gap: 0.6rem;
  }
  .qw-step {
    font-size: 0.7rem;
  }
  .qw-step-num {
    width: 24px;
    height: 24px;
  }
}

/* ── Pages table + preview v1.1.3 ── */

.qw-design-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1rem;
  align-items: start;
}

.qw-design-layout__main {
  min-width: 0;
}

.qw-preview-panel {
  position: sticky;
  top: 1rem;
  border: 1px solid var(--rfc-border);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.04) 100%);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  padding: 1rem;
}

.qw-preview-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.qw-preview-panel__head .code-pill {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qw-preview-panel__frame {
  position: relative;
  height: 420px;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--rfc-border);
  background: var(--rfc-bg-2);
}

.qw-preview-panel__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.qw-preview-panel__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--rfc-text-secondary);
  font-size: 0.9rem;
  background: linear-gradient(180deg, rgba(var(--rfc-accent-rgb), 0.05), var(--rfc-bg-2));
}

.qw-preview-panel__placeholder i {
  font-size: 2rem;
  opacity: 0.5;
}

/* pages table rows */
.pg-name-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pg-name-text {
  min-width: 0;
}

.pg-name-text > div {
  font-weight: 600;
  color: var(--rfc-text);
}

.pg-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--rfc-table-stripe);
  color: var(--rfc-text-secondary);
  font-size: 1rem;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.pg-row--open .pg-chevron {
  transform: rotate(180deg);
  background: rgba(var(--rfc-accent-rgb), 0.14);
  color: var(--rfc-accent);
}

.pg-id-pill {
  font-size: 0.7rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-platform-badge,
.pg-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
  white-space: nowrap;
}

.pg-platform-badge--win,
.pg-type-badge--win {
  background: rgba(14, 165, 233, 0.15);
  color: #0284c7;
}

.pg-platform-badge--mac,
.pg-type-badge--mac {
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
}

.pg-type-badge--combo {
  background: rgba(15, 159, 110, 0.15);
  color: var(--rfc-success);
}

.pg-type-badge--p1 {
  background: rgba(100, 116, 139, 0.15);
  color: var(--rfc-text-secondary);
}

.pg-tds-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.pg-tds-pill--on {
  background: rgba(15, 159, 110, 0.14);
  color: var(--rfc-success);
}

.pg-tds-pill--off {
  background: var(--rfc-table-stripe);
  color: var(--rfc-text-secondary);
}

.pg-visits-24h {
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

/* expandable detail row */
.pg-detail-row > td {
  padding: 0.6rem 0.9rem !important;
  background: var(--rfc-bg-1) !important;
}

.pg-detail-cell {
  position: relative;
  border-left: 3px solid var(--rfc-accent);
  background: color-mix(in srgb, var(--rfc-accent) 4%, var(--rfc-card-bg));
  border-radius: 0 0.75rem 0.75rem 0;
  padding: 0.85rem 1rem 0.85rem 1.25rem;
  margin-left: 0.35rem;
}

.pg-connector {
  position: absolute;
  top: -1.05rem;
  left: -1.1rem;
  color: var(--rfc-text-secondary);
  font-size: 0.85rem;
  line-height: 1;
  user-select: none;
}

.pg-detail-body {
  display: grid;
  gap: 0.6rem;
}

.pg-detail-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pg-victim-pill {
  font-size: 0.7rem;
}

.pg-links-table {
  margin-bottom: 0;
  font-size: 0.85rem;
}

.pg-link-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pg-link-pill {
  font-size: 0.72rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-links-empty,
.pg-links-error {
  padding: 0.6rem;
}

.pg-links-error {
  color: var(--rfc-danger);
}

/* refresh button spin */
.pg-refresh-spin i {
  display: inline-block;
  animation: pgRefreshSpin 0.6s linear infinite;
}

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

/* modal TDS section */
.pg-modal-tds {
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--rfc-accent) 22%, var(--rfc-border));
  background: rgba(var(--rfc-accent-rgb), 0.06);
}

@media (max-width: 1099.98px) {
  .qw-design-layout {
    grid-template-columns: 1fr;
  }
  .qw-preview-panel {
    position: static;
    grid-row: 1;
  }
}

@media (max-width: 640px) {
  #pagesSection .table-wrap {
    overflow-x: auto;
  }
  .pg-detail-cell {
    margin-left: 0;
  }
  .pg-connector {
    display: none;
  }
}

/* ── Wizard v1.1.4: dynamic steps ── */

.qw-captcha-logo {
  width: 30px;
  height: 30px;
  display: block;
}

.qw-step {
  transform-origin: left center;
}

.qw-step-num {
  overflow: hidden;
}

.qw-step-num-inner {
  display: inline-block;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .qw-step,
  .qw-step-num-inner {
    transition: none !important;
  }
}

.qw-dlmode {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.5rem;
  max-width: 480px;
  padding: 0.9rem 1rem;
  border: 1px dashed color-mix(in srgb, var(--rfc-accent) 45%, var(--rfc-border));
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.04) 100%);
}

.qw-dlmode .qw-segment {
  width: 100%;
}

.qw-dlmode .qw-segment button {
  flex: 1 1 0%;
}

.qw-ns-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.qw-result-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.qw-result-row .highlight-box {
  height: 100%;
}

@media (max-width: 640px) {
  .qw-result-row {
    grid-template-columns: 1fr;
  }
}

/* ── Toggle & chameleon polish v1.1.5 ── */

/* iOS-style switch (shared: test payload / chameleon) */
.qw-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  cursor: pointer;
}

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

.qw-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--rfc-border);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.qw-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}

.qw-switch input:checked + .qw-switch-track {
  background: var(--rfc-warning);
}

.qw-switch input:checked + .qw-switch-track::after {
  transform: translateX(18px);
}

.qw-switch--accent input:checked + .qw-switch-track {
  background: var(--rfc-accent);
}

.qw-switch input:focus-visible + .qw-switch-track {
  box-shadow: 0 0 0 3px rgba(var(--rfc-accent-rgb), 0.35);
}

/* test payload — compact card, sibling of .highlight-box */
.qw-test-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--rfc-border);
  border-radius: 0.8rem;
  background: var(--rfc-card-bg);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.qw-test-card:hover {
  border-color: color-mix(in srgb, var(--rfc-accent) 45%, var(--rfc-border));
}

.qw-test-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  cursor: pointer;
}

.qw-test-title {
  color: var(--rfc-text);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.qw-test-sub {
  color: var(--rfc-text-secondary);
  font-size: 0.78rem;
}

.qw-test-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--rfc-warning-bg);
  color: var(--rfc-warning);
  font-size: 0.9rem;
  line-height: 1;
}

.qw-test-card:has(input:checked),
.qw-test-card.qw-test-on {
  border-color: color-mix(in srgb, var(--rfc-warning) 40%, var(--rfc-border));
  background: color-mix(in srgb, var(--rfc-warning-bg) 5%, var(--rfc-card-bg));
}

/* chameleon — compact card with collapsible body */
.qw-chameleon-box {
  border: 1px solid var(--rfc-border);
  border-radius: 0.8rem;
  padding: 0.75rem 0.9rem;
  background: var(--rfc-card-bg);
  transition: border-color 0.2s ease;
}

.qw-chameleon-box:hover {
  border-color: color-mix(in srgb, var(--rfc-accent) 45%, var(--rfc-border));
}

.qw-chameleon-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.qw-chameleon-title {
  color: var(--rfc-text);
  font-size: 0.88rem;
  font-weight: 600;
}

.qw-chameleon-head .qw-switch {
  margin-left: auto;
}

.qw-chameleon-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.25s ease, opacity 0.25s ease;
}

.qw-chameleon-body-inner {
  min-height: 0;
  overflow: hidden;
}

.qw-chameleon-box:has(#qwChameleon:checked) .qw-chameleon-body,
.qw-chameleon-box.qw-chameleon-on .qw-chameleon-body {
  grid-template-rows: 1fr;
  opacity: 1;
}

.qw-chameleon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.qw-chameleon-ext {
  max-width: 110px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
}

.qw-chameleon-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.qw-chameleon-hint {
  margin-top: 0.5rem;
  color: var(--rfc-text-secondary);
  font-size: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .qw-switch-track,
  .qw-switch-track::after,
  .qw-chameleon-body {
    transition: none !important;
  }
}


/* Quick-start: ???????? ?????? */
.qw-domain-stage-row {
    border: 1px solid var(--rfc-border, #2a2f3a);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--rfc-card-bg, #151822);
}
.qw-domain-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    border-radius: 20px;
    padding: 2px 10px;
    border: 1px solid transparent;
}
.qw-domain-stage-badge--active { color: #2fb344; border-color: #2fb344; }
.qw-domain-stage-badge--pending { color: #d99a2b; border-color: #d99a2b; }
.qw-domain-stage-badge--other { color: var(--rfc-text-secondary, #8b93a7); border-color: var(--rfc-border, #3a4152); }
.qw-domain-stage-ns { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.qw-ns-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qw-spin { animation: qwSpin 0.9s linear infinite; display: inline-block; }
@keyframes qwSpin { to { transform: rotate(360deg); } }

/* ===== Links page: KPI cards ===== */
.links-kpi {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.links-kpi__card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid var(--rfc-border);
    background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.05) 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.links-kpi__icon {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    font-size: 1.35rem;
    background: rgba(var(--rfc-accent-rgb), 0.12);
    color: var(--rfc-accent);
}
.links-kpi__card--success .links-kpi__icon { background: var(--rfc-success-bg); color: var(--rfc-success); }
.links-kpi__card--warning .links-kpi__icon { background: var(--rfc-warning-bg); color: var(--rfc-warning); }
.links-kpi__body { min-width: 0; }
.links-kpi__label { font-size: 0.78rem; color: var(--rfc-text-secondary); }
.links-kpi__value { font-family: "Space Grotesk", sans-serif; font-size: 1.7rem; font-weight: 700; color: var(--rfc-text); line-height: 1.1; }

/* ===== Links page: charts layout ===== */
.links-charts {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1rem;
}
.links-chart-card {
    border: 1px solid var(--rfc-border);
    border-radius: 1rem;
    background: var(--rfc-card-bg);
    overflow: hidden;
}
.links-chart-card__head {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--rfc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.links-chart-card__title { font-weight: 600; color: var(--rfc-text); font-size: 0.9rem; }
.links-chart-card__body { position: relative; padding: 1rem; }
.links-chart-card__body canvas { max-height: 260px; }

/* ===== World map ===== */
.wm-grid { display: grid; gap: 1px; justify-content: center; }
.wm-row { display: flex; gap: 1px; height: 7px; }
.wm-dot { width: 7px; height: 7px; border-radius: 2px; display: block; }

/* ===== Links table ===== */
.links-table { font-size: 0.85rem; }
.links-table th { white-space: nowrap; }
.links-table__link { word-break: break-all; }
.links-table__name { font-size: 0.75rem; color: var(--rfc-text-secondary); margin-top: 0.15rem; }
.links-table__num { font-variant-numeric: tabular-nums; font-weight: 600; }
.links-table__num--success { color: var(--rfc-success); }
.mono { font-family: "JetBrains Mono", monospace; }
.conversion-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--rfc-table-stripe);
    color: var(--rfc-text-secondary);
}
.conversion-pill--mid { background: var(--rfc-warning-bg); color: var(--rfc-warning); }
.conversion-pill--good { background: var(--rfc-success-bg); color: var(--rfc-success); }
.active-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.active-dot--on { background: var(--rfc-success); box-shadow: 0 0 0 3px var(--rfc-success-bg); }
.active-dot--off { background: var(--rfc-text-secondary); opacity: 0.4; }

/* ===== Links edit modal ===== */
.cf-modal--lg { width: min(100%, 920px); }
.links-edit__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 1.25rem; }
.links-edit__form { display: grid; gap: 0.9rem; align-content: start; }
.links-edit__preview { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.links-edit__preview-head { display: flex; align-items: center; justify-content: space-between; }
.links-edit__preview-frame {
    position: relative;
    border: 1px solid var(--rfc-border);
    border-radius: 0.9rem;
    overflow: hidden;
    background: #fff;
    height: 320px;
}
.links-edit__preview-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.links-edit__preview-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rfc-text-secondary);
    font-size: 0.85rem;
}

@media (max-width: 900px) {
    .links-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .links-charts { grid-template-columns: 1fr; }
    .links-edit__grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .links-kpi { grid-template-columns: 1fr; }
}

/* ===== Pages (Index) KPI cards ===== */
.pg-kpi {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.pg-kpi__card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid var(--rfc-border);
    background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.05) 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.pg-kpi__icon {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    font-size: 1.35rem;
    background: rgba(var(--rfc-accent-rgb), 0.12);
    color: var(--rfc-accent);
}
.pg-kpi__card--success .pg-kpi__icon { background: var(--rfc-success-bg); color: var(--rfc-success); }
.pg-kpi__card--warning .pg-kpi__icon { background: var(--rfc-warning-bg); color: var(--rfc-warning); }
.pg-kpi__body { min-width: 0; }
.pg-kpi__label { font-size: 0.78rem; color: var(--rfc-text-secondary); }
.pg-kpi__value { font-family: "Space Grotesk", sans-serif; font-size: 1.7rem; font-weight: 700; color: var(--rfc-text); line-height: 1.1; }

/* ===== Pages charts ===== */
.pg-charts {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.pg-chart-card {
    border: 1px solid var(--rfc-border);
    border-radius: 1rem;
    background: var(--rfc-card-bg);
    overflow: hidden;
}
.pg-chart-card__head {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--rfc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pg-chart-card__title { font-weight: 600; color: var(--rfc-text); font-size: 0.9rem; }
.pg-chart-card__body { position: relative; padding: 1rem; }
.pg-chart-card__body canvas { max-height: 240px; }

/* ===== Pages edit modal ===== */
.pg-edit-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 1.25rem; }
.pg-edit-form { display: flex; flex-direction: column; gap: 0.9rem; }
.pg-edit-preview { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.pg-edit-preview-head { display: flex; align-items: center; justify-content: space-between; }
.pg-edit-preview-frame {
    position: relative;
    border: 1px solid var(--rfc-border);
    border-radius: 0.9rem;
    overflow: hidden;
    background: #fff;
    height: 320px;
}
.pg-edit-preview-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.pg-edit-preview-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rfc-text-secondary);
    font-size: 0.85rem;
}

/* ===== World map ===== */
.wm-grid { display: grid; gap: 1px; justify-content: center; }
.wm-row { display: flex; gap: 1px; height: 7px; }
.wm-dot { width: 7px; height: 7px; border-radius: 2px; display: block; }

@media (max-width: 900px) {
    .pg-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pg-charts { grid-template-columns: 1fr; }
    .pg-edit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .pg-kpi { grid-template-columns: 1fr; }
}

/* ===== Pages stats modal (P1 → P2 conversion) ===== */
.pg-stats-victim {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.pg-stats-kpi {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.1rem;
}
.pg-stats-kpi__card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--rfc-border);
    background: var(--rfc-card-bg);
}
.pg-stats-kpi__icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    font-size: 1.3rem;
    background: rgba(var(--rfc-accent-rgb), 0.12);
    color: var(--rfc-accent);
}
.pg-stats-kpi__card--p2 .pg-stats-kpi__icon { background: var(--rfc-success-bg); color: var(--rfc-success); }
.pg-stats-kpi__card--conv .pg-stats-kpi__icon { background: var(--rfc-warning-bg); color: var(--rfc-warning); }
.pg-stats-kpi__body { min-width: 0; }
.pg-stats-kpi__label { font-size: 0.72rem; color: var(--rfc-text-secondary); }
.pg-stats-kpi__value { font-family: "Space Grotesk", sans-serif; font-size: 1.45rem; font-weight: 700; color: var(--rfc-text); line-height: 1.1; }

.pg-stats-funnel {
    border: 1px solid var(--rfc-border);
    border-radius: 1rem;
    padding: 1.1rem;
    background: linear-gradient(180deg, rgba(var(--rfc-card-bg-rgb), 0.98) 0%, rgba(var(--rfc-accent-rgb), 0.04) 100%);
}
.funnel-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.4rem; }
.funnel-label { width: 230px; flex: 0 0 auto; min-width: 0; }
.funnel-name { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; color: var(--rfc-text); font-size: 0.85rem; }
.funnel-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.funnel-sub { font-size: 0.72rem; color: var(--rfc-text-secondary); }
.funnel-bar-wrap { flex: 1; min-width: 0; }
.funnel-bar {
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.7rem;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    transition: width 0.35s ease;
    min-width: 40px;
}
.funnel-drop { text-align: center; padding: 0.15rem 0 0.4rem; }
.funnel-drop-text { font-size: 0.75rem; color: var(--rfc-text-secondary); }
.funnel-rate { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.6rem; flex-wrap: wrap; }
.funnel-rate-badge { font-weight: 700; font-size: 0.95rem; }
.funnel-rate-note { font-size: 0.75rem; color: var(--rfc-text-secondary); }

@media (max-width: 600px) {
    .pg-stats-kpi { grid-template-columns: 1fr; }
    .funnel-row { flex-direction: column; align-items: stretch; gap: 0.4rem; }
    .funnel-label { width: auto; }
}
