@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@500;600;700&family=Orbitron:wght@600;700;800&display=swap');

:root {
  --bg: #0f1115;
  --card-bg: #171a21;
  --shell-bg: rgba(23, 26, 33, 0.62);
  --shell-border: rgba(255, 255, 255, 0.08);
  --shell-radius: 28px;
  --accent: #6c5ce7;
  --accent2: #00cec9;
  --text: #f2f2f5;
  --text-dim: #9a9db0;
  --border: #262a35;
  --danger: #ff6b6b;
  --ok: #55efc4;
  --radius: 16px;
}

:root[data-theme="light"] {
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --shell-bg: rgba(255, 255, 255, 0.75);
  --shell-border: rgba(15, 17, 21, 0.08);
  --text: #14161c;
  --text-dim: #6b6f7d;
  --border: #e3e5ec;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 12% -10%, rgba(108, 92, 231, 0.28), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(0, 206, 201, 0.16), transparent 50%),
    radial-gradient(circle at 50% 110%, rgba(108, 92, 231, 0.14), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent2); text-decoration: none; }

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.center { text-align: center; }

/* --- Home --- */
.hero {
  padding: 48px 0 24px;
  text-align: center;
}

.hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.hero p {
  color: var(--text-dim);
  margin: 0 0 32px;
}

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 12px 26px -12px var(--accent);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover { opacity: 0.97; transform: translateY(-2px); box-shadow: 0 16px 32px -10px var(--accent); }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.btn-outline:hover { border-color: var(--accent); transform: translateY(-2px); }

.features {
  margin-top: 40px;
  display: grid;
  gap: 12px;
}

.feature {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
}

.feature b { display: block; margin-bottom: 4px; }
.feature span { color: var(--text-dim); font-size: 14px; }

/* --- Forms --- */
.form-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.form-card h2 { margin-top: 0; }

label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin: 16px 0 6px;
}

label:first-of-type { margin-top: 0; }

input[type=text], input[type=tel], input[type=email], input[type=password], input[type=file], textarea {
  width: 100%;
  background: #0f1115;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

input[type=file] { padding: 8px; color: var(--text-dim); }

textarea { resize: vertical; min-height: 90px; }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.4;
}

.media-preview {
  margin-bottom: 8px;
}

.media-preview-thumb-wrap {
  position: relative;
  display: inline-block;
}

.media-preview-thumb-wrap:has(input:checked) img,
.media-preview-thumb-wrap:has(input:checked) video {
  opacity: 0.35;
  filter: grayscale(1);
}

.media-preview-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #0f1115;
  display: block;
}

.media-preview-video-thumb {
  width: 96px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #0f1115;
  display: block;
}

.media-remove-x {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ff5c5c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--bg, #14161c);
  line-height: 1;
}

.media-remove-x::after { content: "✕"; }
.media-remove-x:has(input:checked) { background: #6b6b6b; }
.media-remove-x:has(input:checked)::after { content: "↺"; }

.media-remove-x input[type=checkbox] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.portfolio-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.portfolio-preview-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #0f1115;
  border: 1px solid var(--border);
}

.portfolio-preview-item img, .portfolio-preview-item video {
  width: 100%;
  height: 88px;
  object-fit: cover;
  display: block;
}

.portfolio-preview-item:has(input:checked) img,
.portfolio-preview-item:has(input:checked) video {
  opacity: 0.35;
  filter: grayscale(1);
}

.portfolio-remove-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 92, 92, 0.92);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.portfolio-remove-x::after { content: "✕"; }
.portfolio-remove-x:has(input:checked) { background: rgba(107, 107, 107, 0.92); }
.portfolio-remove-x:has(input:checked)::after { content: "↺"; }

.portfolio-remove-x input[type=checkbox] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.actions { margin-top: 24px; }

.banner {
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
}

.banner-ok { background: rgba(85, 239, 196, 0.12); color: var(--ok); border: 1px solid rgba(85,239,196,0.3); }
.banner-error { background: rgba(255, 107, 107, 0.12); color: var(--danger); border: 1px solid rgba(255,107,107,0.3); }

.topnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 4px 0 0;
  font-size: 14px;
}

.nav-account { color: var(--text-dim); margin-right: auto; }
.nav-link { color: var(--text); font-weight: 500; }
.nav-link:hover { color: var(--accent2); }

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0 0;
  flex-wrap: nowrap;
}

.profile-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 1;
  text-decoration: none;
  color: inherit;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
  background: var(--card-bg);
}

.profile-avatar-fallback {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.profile-name {
  display: block;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-sub {
  display: block;
  color: var(--text-dim);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border-radius: 999px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.nav-icon-btn:hover { color: var(--accent); }

.profile-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.profile-stat-chip {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  flex-shrink: 1;
}

.profile-stat-chip-urgent {
  background: rgba(255, 107, 107, 0.15);
  border-color: rgba(255, 107, 107, 0.3);
  color: var(--danger);
}

.nav-icon-glyph {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}

.burger-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  margin: -2px 0 16px;
}

.burger-menu.open { display: flex; }

.burger-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.burger-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }

.burger-item.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

.burger-item-danger { color: var(--danger); }
.burger-item-danger:hover { background: rgba(255, 107, 107, 0.1); color: var(--danger); }

.btn-danger {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.btn-danger:hover { opacity: 0.9; transform: translateY(-2px); }

.btn-outline-danger { color: var(--danger); border-color: rgba(255, 107, 107, 0.35); }
.btn-outline-danger:hover { border-color: var(--danger); background: rgba(255, 107, 107, 0.08); }

.site-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 2;
}

.site-footer a { color: var(--text-dim); margin: 0 8px; }
.site-footer a:hover { color: var(--accent2); }

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-row + .settings-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-dim);
}

.auth-divider {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  margin: 18px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.btn-vk {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  background: #0077ff;
  color: #fff;
  font-weight: 600;
  padding: 13px 20px;
  border-radius: 999px;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-vk:hover { opacity: 0.92; transform: translateY(-2px); }

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 32px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.dashboard-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.dashboard-list .hero-card { margin-top: 0; }

.dash-greeting { margin-top: 18px; }
.dash-greeting h1 { font-size: 20px; margin: 0 0 4px; }
.dash-greeting-sub { color: var(--text-dim); font-size: 14px; margin: 0; }

.hero-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-card-links { display: flex; gap: 8px; }
.hero-card-links .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 12px;
  font-size: 13px;
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-card-links .btn-icon { font-size: 14px; line-height: 1; flex-shrink: 0; }

@media (max-width: 420px) {
  .hero-card-links { gap: 4px; }
  .hero-card-links .btn-outline { padding: 8px 4px; font-size: 10.3px; gap: 3px; flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hero-card-links .btn-icon { font-size: 10.8px; }
}

@media (max-width: 375px) {
  .hero-card-links { gap: 3px; }
  .hero-card-links .btn-outline { padding: 8px 3px; font-size: 9.4px; gap: 2px; }
  .hero-card-links .btn-icon { font-size: 10px; }
}

@media (max-width: 340px) {
  .hero-card-links .btn-outline { padding: 8px 2px; font-size: 8.4px; gap: 2px; }
  .hero-card-links .btn-icon { font-size: 9px; }
}

.publish-toggle-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.publish-toggle-status { color: var(--text-dim); font-size: 12px; font-weight: 600; }
.publish-toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.publish-toggle-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.publish-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background .2s;
}
.publish-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.publish-toggle-input:checked ~ .publish-toggle-track { background: #2ecc71; }
.publish-toggle-input:checked ~ .publish-toggle-track .publish-toggle-thumb { transform: translateX(16px); }
.publish-toggle-input:disabled { cursor: default; }

.stats-section { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.stats-period-toggle { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.stats-period-btn { border: 1px solid var(--border); background: var(--card-bg); color: var(--text-dim); font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; font-family: inherit; }
.stats-period-btn.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; }

@media (max-width: 420px) {
  .stats-period-toggle { flex-wrap: nowrap; gap: 4px; }
  .stats-period-btn { flex: 1 1 0; min-width: 0; padding: 5px 4px; font-size: 10.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
}

@media (max-width: 375px) {
  .stats-period-toggle { gap: 3px; }
  .stats-period-btn { padding: 5px 3px; font-size: 9.4px; }
}

@media (max-width: 340px) {
  .stats-period-btn { padding: 5px 2px; font-size: 8.4px; }
}

.stats-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-tile { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 22px; font-weight: 700; }
.stat-label { color: var(--text-dim); font-size: 11px; margin-top: 2px; min-height: 28px; display: flex; align-items: center; justify-content: center; line-height: 1.3; }

.completion-card {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.completion-head { font-size: 14px; }

.completion-bar {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.completion-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  transition: width 0.3s ease;
}

.completion-next { margin-top: 10px; font-size: 13px; color: var(--text-dim); }

.completion-done-card { text-align: center; }
.completion-done-card b { font-size: 15px; }
.completion-done-sub { color: var(--text-dim); font-size: 13px; margin: 6px 0 0; }

.completion-cta {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 14px;
  padding: 10px 16px;
  font-size: 13px;
}

.hero-cta-primary { display: block; width: 100%; text-align: center; margin: 2px 0 6px; box-shadow: 0 6px 14px -9px var(--accent); }

.mini-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.mini-preview-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--card-bg);
}

.mini-preview-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.mini-preview-avatar-wrap { position: relative; flex-shrink: 0; }
.mini-preview-avatar-wrap[data-photo-src] { cursor: pointer; }

.mini-preview-info { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; }
.mini-preview-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-preview-role { color: var(--text-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-preview-btn { flex-shrink: 0; padding: 8px 14px; font-size: 12px; }

.stat-delta { min-height: 14px; font-size: 11px; font-weight: 700; margin-top: 3px; white-space: nowrap; }
.stat-delta-up { color: #2ecc71; }
.stat-delta-down { color: #ff6b6b; }

.completion-v2 .completion-pitch { color: var(--text-dim); font-size: 13px; margin: 10px 0 0; }
.completion-v2 .completion-cta { margin-top: 12px; }
.completion-more { margin-top: 10px; }
.completion-more summary { padding: 10px 14px; font-size: 10px; }
.completion-more .reveal-content { padding: 0 14px 14px; }
.completion-missing-list { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }

.wrap-bottom-nav { padding-bottom: 88px; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1 1 0;
  padding: 6px 4px;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  transition: color 0.2s ease;
}

.bottom-nav-item:hover { color: var(--accent); }
.bottom-nav-icon { font-size: 19px; }

.burger-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

.editor-topbar {
  margin-bottom: 14px;
}

.editor-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.editor-back:hover { color: var(--accent2); }

.link-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 220px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.link-chip:hover { border-color: var(--accent); transform: translateY(-2px); }

.section-title {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  color: var(--text-dim);
  margin: 28px 0 10px;
}

/* --- Public card --- */
.card-page { text-align: center; padding-top: 12px; }

.card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 20px;
}

.card-topbar .avatar,
.card-topbar .avatar-fallback {
  margin: 0;
  flex-shrink: 0;
}

.avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.avatar-crown {
  position: absolute;
  top: -10px;
  right: -6px;
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

.icon-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.icon-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.icon-toggle svg {
  width: 18px;
  height: 18px;
}

/* --- Alternate light/dark surface toggle (independent of chosen theme) --- */
/* Each theme gets its own explicit light/dark pair, so accent glows and
   hardcoded shadow colors stay coherent instead of leaking between themes. */
body.tpl-classic.mode-alt {
  --bg: #f4f5f8;
  --card-bg: #ffffff;
  --shell-bg: rgba(255, 255, 255, 0.78);
  --shell-border: rgba(0, 0, 0, 0.07);
  --text: #16171c;
  --text-dim: #5b5f70;
  --border: #e3e5ea;
}

/* Neon default is dark ("HUD on black"); mode-alt flips to "neon on white" —
   same signature accent hues, softened glow intensity, readable dark text. */
body.tpl-neon.mode-alt {
  --bg: #f5f6fb;
  --card-bg: #ffffff;
  --shell-bg: rgba(255, 255, 255, 0.86);
  --shell-border: rgba(255, 47, 208, 0.22);
  --text: #14151f;
  --text-dim: #565a72;
  --border: #e7e2f5;
  --glow-a: rgba(255, 47, 208, 0.3);
  --glow-b: rgba(0, 255, 242, 0.3);
  --glow-a-soft: rgba(255, 47, 208, 0.12);
  --glow-b-soft: rgba(0, 255, 242, 0.12);
  --grid-line: rgba(108, 92, 231, 0.07);
}

body.tpl-neon.mode-alt .avatar-fallback { background: #ffffff; color: var(--accent); }

/* Minimal default is light ("cream editorial"); mode-alt flips to a warm
   "dark academia" library-card palette — same gold accent, deep espresso base. */
body.tpl-minimal.mode-alt {
  --bg: #17140f;
  --card-bg: #1f1b16;
  --shell-bg: rgba(23, 20, 15, 0.74);
  --shell-border: rgba(255, 255, 255, 0.08);
  --text: #f2ede4;
  --text-dim: #b8ae9d;
  --border: #332e27;
}

body.tpl-minimal.mode-alt .avatar-fallback { background: var(--accent); color: #1f1b16; }

/* --- Modals (QR / save-contact) --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay.open { display: flex; }

.modal-box {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px 22px;
  color: var(--text);
  text-align: center;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.modal-box label { text-align: left; }
.modal-box input[type=text] { margin-bottom: 4px; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
}

.modal-close:hover { color: var(--text); border-color: var(--accent); }

.modal-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 16px;
}

.modal-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
  line-height: 1.4;
}

.qr-img {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  display: block;
  margin: 0 auto;
}

.modal-box-photo { max-width: 320px; padding: 22px; }

.qr-share-btn { display: block; width: 100%; margin-top: 16px; }

.qr-change-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}
.qr-change-btn:hover { color: var(--accent2); }

.modal-box-picker { max-width: 320px; }

.contact-picker-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.contact-picker-item:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.contact-picker-item .mini-tile {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex-shrink: 0;
}

.contact-picker-item .mini-tile svg { width: 19px; height: 19px; }
.contact-picker-item .mini-tile-txt { font-size: 14px; }

.mini-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mini-tile-txt {
  color: #fff;
  font-weight: 800;
  font-family: Arial, sans-serif;
  line-height: 1;
}

.mini-tile-tg { background: #29a9ea; }
.mini-tile-wa { background: #25d366; }
.mini-tile-max { background: #5b6eff; }
.mini-tile-vk { background: #0077ff; }
.mini-tile-ok { background: #f2720c; }
.mini-tile-ig { background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7); }

.folder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  width: 34px;
  height: 34px;
}

.folder-grid .mini-tile { border-radius: 7px; }
.folder-grid .mini-tile svg { width: 12px; height: 12px; }
.folder-grid .mini-tile-txt { font-size: 9px; }

.photo-preview-img {
  width: 100%;
  max-height: 70vh;
  border-radius: var(--radius);
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.card-shell {
  position: relative;
  background: var(--shell-bg);
  border: 1px solid var(--shell-border);
  border-radius: var(--shell-radius);
  padding: 40px 26px 30px;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  isolation: isolate;
}

.card-shell::before {
  content: "";
  position: absolute;
  top: -55%;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.22;
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}

.card-shell > * {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 0.8, 0.24, 1) both;
}

.card-shell > *:nth-child(1) { animation-delay: 0.02s; }
.card-shell > *:nth-child(2) { animation-delay: 0.08s; }
.card-shell > *:nth-child(3) { animation-delay: 0.14s; }
.card-shell > *:nth-child(4) { animation-delay: 0.2s; }
.card-shell > *:nth-child(5) { animation-delay: 0.26s; }
.card-shell > *:nth-child(6) { animation-delay: 0.32s; }
.card-shell > *:nth-child(7) { animation-delay: 0.38s; }
.card-shell > *:nth-child(8) { animation-delay: 0.44s; }
.card-shell > *:nth-child(9) { animation-delay: 0.5s; }

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

.avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  margin: 0 auto 18px;
  display: block;
  background: var(--card-bg);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04), 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 0 44px -12px var(--accent);
  cursor: zoom-in;
}

.avatar-fallback {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04), 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 0 44px -12px var(--accent);
}

.card-page h1 {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent2) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Verified badge (BUSINESS) --- */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ok, #55efc4);
  color: #05060a;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

/* --- Role badge (static) --- */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  margin: 0 0 14px;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.45);
}

.role-text {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
}

@keyframes role-blink {
  50% { border-color: transparent; }
}

/* --- Value proposition: cycling typewriter directly under role --- */
.value-prop {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0 0 24px;
  padding: 0 12px;
}

.value-prop .tw-text {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
}

video {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 24px;
  background: #000;
  box-shadow: 0 20px 40px -22px rgba(0, 0, 0, 0.7);
}

.save-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  font-size: 16px;
  border-radius: 16px;
}

.contact-row {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 18px 0 8px;
}

.icon-btn {
  flex: 0 1 50px;
  min-width: 0;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 26px -12px var(--accent);
}

.icon-btn svg {
  width: 21px;
  height: 21px;
  overflow: visible;
}

button.icon-btn {
  padding: 0;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.icon-btn.icon-web { color: var(--text-dim); }
.icon-btn.icon-mail { color: var(--text-dim); }

.legal-note {
  text-align: left;
  font-size: 10px;
  color: var(--text-dim);
  opacity: 0.7;
  line-height: 1.4;
  margin: 0 0 10px;
}

.reveal-section + .legal-note {
  margin-top: 14px;
}

.auto-save-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 60;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  transform: translateY(140%);
  transition: transform 0.35s ease;
  max-width: 420px;
  margin: 0 auto;
}
.auto-save-banner.open { transform: translateY(0); }
.auto-save-banner-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.auto-save-banner-text {
  font-size: 13px;
  color: var(--text);
  margin: 0 22px 10px 0;
  line-height: 1.4;
}
.auto-save-banner .btn {
  width: 100%;
  text-align: center;
  padding: 12px 16px;
  font-size: 14px;
}

/* --- Contact-icon reorder list (editor) --- */
.reorder-list {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reorder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #0f1115;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
}

.reorder-btns { display: flex; gap: 6px; flex-shrink: 0; }

.reorder-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.reorder-btn:hover { border-color: var(--accent); background: rgba(108, 92, 231, 0.12); }

/* --- Embed-code widget (editor) --- */
.embed-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.embed-preview {
  background: #0f1115;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.card-page .section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  margin: 0 0 12px;
}

.card-page .section-title::before,
.card-page .section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.about {
  text-align: left;
  color: var(--text-dim);
  white-space: pre-wrap;
  line-height: 1.6;
}

.tw-text {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.tw-cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--accent2);
  font-weight: 400;
  animation: role-blink 0.8s step-end infinite;
}

/* --- "Ещё обо мне" — collapsible accordion (native <details>) --- */
.reveal-section {
  text-align: left;
  margin: 24px 0 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.reveal-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  user-select: none;
}

.reveal-section summary::-webkit-details-marker,
.reveal-section summary::marker {
  display: none;
  content: "";
}

.reveal-section .chevron {
  transition: transform 0.25s ease;
  color: var(--accent2);
  font-size: 13px;
}

.reveal-section[open] .chevron { transform: rotate(180deg); }

.reveal-section summary:hover { color: var(--text); }

.reveal-content {
  padding: 0 18px 18px;
}

.reveal-content .about { padding-top: 2px; }

/* --- Portfolio: tap-through / swipeable gallery --- */
.portfolio-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  margin-top: 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.portfolio-scroll::-webkit-scrollbar { height: 6px; }
.portfolio-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.portfolio-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 130px;
  height: 175px;
  border-radius: 12px;
  overflow: hidden;
  display: block;
  background: #000;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.6);
}

button.portfolio-item {
  border: none;
  padding: 0;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}

.portfolio-item img,
.portfolio-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.footer-note {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.85;
}

.footer-note a { color: var(--text-dim); }

/* --- Template picker (in editor) --- */
.tpl-picker {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 4px;
}

.tpl-option {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  cursor: pointer;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px 12px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.tpl-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tpl-option:has(input:checked) { border-color: var(--accent); }

.tpl-option-locked { cursor: not-allowed; opacity: 0.5; }

.tpl-preview-box {
  display: block;
  border-radius: 8px;
  padding: 10px 8px;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.tpl-preview-avatar {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin: 0 auto 6px;
}

.tpl-preview-line {
  display: block;
  height: 5px;
  border-radius: 3px;
  margin: 0 auto 4px;
  width: 70%;
}

.tpl-preview-line.short { width: 45%; }

.tpl-preview-btn {
  display: block;
  height: 8px;
  border-radius: 4px;
  width: 80%;
  margin: 8px auto 0;
}

.tpl-name {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
}

.tpl-preview-classic .tpl-preview-box { background: linear-gradient(135deg, #6c5ce7, #00cec9); }
.tpl-preview-classic .tpl-preview-avatar { background: #fff; }
.tpl-preview-classic .tpl-preview-line { background: rgba(255, 255, 255, 0.85); }
.tpl-preview-classic .tpl-preview-btn { background: #fff; }

.tpl-preview-neon .tpl-preview-box { background: #030308; border: 1px solid #00fff2; box-shadow: 0 0 10px rgba(0, 255, 242, 0.4); background-image: linear-gradient(120deg, rgba(255,47,208,0.15), rgba(0,255,242,0.15)); }
.tpl-preview-neon .tpl-preview-avatar { background: transparent; border: 1px solid #ff2fd0; box-shadow: 0 0 6px rgba(0, 255, 242, 0.5); }
.tpl-preview-neon .tpl-preview-line { background: #8b8fae; }
.tpl-preview-neon .tpl-preview-btn { background: transparent; border: 1px solid #00fff2; box-shadow: 0 0 6px rgba(0, 255, 242, 0.35); }

.tpl-preview-minimal .tpl-preview-box { background: #f6f3ec; border: 1px solid #e6ddcf; }
.tpl-preview-minimal .tpl-preview-avatar { background: #201f1c; box-shadow: 0 0 0 1px #a9824f; }
.tpl-preview-minimal .tpl-preview-line { background: #cbc3b4; }
.tpl-preview-minimal .tpl-preview-btn { background: #201f1c; border: 1px solid #a9824f; }

/* ================================================
   Public card themes — selected via body.tpl-<name>
   ================================================ */

/* --- Neon: cyberpunk HUD --- */
body.tpl-neon {
  --bg: #030308;
  --card-bg: #0a0c16;
  --shell-bg: rgba(8, 10, 20, 0.6);
  --shell-border: rgba(0, 255, 242, 0.18);
  --shell-radius: 20px;
  --accent: #ff2fd0;
  --accent2: #00fff2;
  --text: #f5f5ff;
  --text-dim: #8b8fae;
  --border: #22263a;
  --ok: #00fff2;
  --radius: 8px;
  --glow-a: rgba(255, 47, 208, 0.45);
  --glow-b: rgba(0, 255, 242, 0.45);
  --glow-a-soft: rgba(255, 47, 208, 0.18);
  --glow-b-soft: rgba(0, 255, 242, 0.18);
  --grid-line: rgba(0, 255, 242, 0.055);
}

/* Drifting grid floor + soft twin glow, layered under the base radial glow */
body.tpl-neon {
  background:
    repeating-linear-gradient(0deg, var(--grid-line) 0px, var(--grid-line) 1px, transparent 1px, transparent 42px),
    repeating-linear-gradient(90deg, var(--grid-line) 0px, var(--grid-line) 1px, transparent 1px, transparent 42px),
    radial-gradient(circle at 15% -10%, var(--glow-a-soft), transparent 45%),
    radial-gradient(circle at 90% 8%, var(--glow-b-soft), transparent 50%),
    radial-gradient(circle at 50% 115%, var(--glow-a-soft), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  animation: neon-grid-drift 16s linear infinite;
}

@keyframes neon-grid-drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 0 84px, 84px 0, 0 0, 0 0, 0 0, 0 0; }
}

/* Flowing gradient border ring (double-background-clip trick — no Houdini needed) */
body.tpl-neon .card-shell {
  border: 1px solid transparent;
  background-image:
    linear-gradient(var(--shell-bg), var(--shell-bg)),
    linear-gradient(120deg, var(--accent), var(--accent2), var(--accent), var(--accent2));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-size: auto, 300% 300%;
  box-shadow: 0 0 0 1px rgba(0, 255, 242, 0.08), 0 30px 70px -24px var(--glow-a-soft), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  animation: neon-border-flow 9s ease infinite;
  position: relative;
}

@keyframes neon-border-flow {
  0% { background-position: 0 0, 0% 50%; }
  50% { background-position: 0 0, 100% 50%; }
  100% { background-position: 0 0, 0% 50%; }
}

body.tpl-neon .card-shell::before {
  background: radial-gradient(circle, var(--accent2) 0%, transparent 70%);
  opacity: 0.28;
}

/* Faint CRT scanlines painted over the whole shell, purely decorative */
body.tpl-neon .card-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
  opacity: 0.5;
  pointer-events: none;
  z-index: 2;
}

body.tpl-neon .avatar,
body.tpl-neon .avatar-fallback {
  animation: neon-pulse 2.6s ease-in-out infinite;
}

@keyframes neon-pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--accent), 0 0 22px var(--glow-b), 0 0 38px var(--glow-a-soft); }
  50% { box-shadow: 0 0 0 1px var(--accent2), 0 0 34px var(--glow-b), 0 0 54px var(--glow-a); }
}

body.tpl-neon .avatar { border-color: var(--accent2); }

body.tpl-neon .avatar-fallback {
  background: #05060a;
  border: 2px solid var(--accent2);
  color: var(--accent2);
}

body.tpl-neon .card-page h1 {
  font-family: 'Orbitron', 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-shadow: 0 0 16px var(--glow-a);
  background: linear-gradient(90deg, var(--accent2), var(--text) 35%, var(--accent) 70%, var(--accent2));
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: neon-text-shift 7s linear infinite;
}

@keyframes neon-text-shift {
  to { background-position: -250% 0; }
}

body.tpl-neon .role-badge {
  background: var(--glow-b-soft);
  border: 1px solid rgba(0, 255, 242, 0.3);
  box-shadow: 0 0 18px var(--glow-b-soft);
  position: relative;
}

body.tpl-neon .role-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 8px var(--accent2), 0 0 14px var(--accent2);
  animation: neon-dot-blink 1.6s ease-in-out infinite;
}

@keyframes neon-dot-blink { 50% { opacity: 0.35; } }

body.tpl-neon .role-text {
  font-family: 'Orbitron', monospace;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
}

body.tpl-neon .value-prop .tw-text {
  font-family: 'Orbitron', monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

body.tpl-neon .reveal-section {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(0, 255, 242, 0.16);
  position: relative;
}

body.tpl-neon .reveal-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

body.tpl-neon .reveal-section summary { font-family: 'Orbitron', monospace; text-transform: uppercase; }
body.tpl-neon .reveal-section .chevron { color: var(--accent2); text-shadow: 0 0 8px var(--accent2); }

body.tpl-neon .portfolio-item {
  box-shadow: 0 0 0 1px rgba(0, 255, 242, 0.18), 0 10px 24px -14px var(--glow-a-soft);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

body.tpl-neon .portfolio-item:hover {
  box-shadow: 0 0 0 1px var(--accent2), 0 0 22px var(--glow-b);
  transform: translateY(-3px);
}

body.tpl-neon .btn.save-btn {
  background: transparent;
  border: 1px solid var(--accent2);
  color: var(--accent2);
  box-shadow: 0 0 16px var(--glow-b-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'Orbitron', sans-serif;
  position: relative;
  overflow: hidden;
}

body.tpl-neon .btn.save-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: neon-shine 3.4s ease-in-out infinite;
}

@keyframes neon-shine {
  0% { left: -60%; }
  55%, 100% { left: 130%; }
}

body.tpl-neon .btn.save-btn:hover {
  box-shadow: 0 0 26px var(--glow-b);
}

body.tpl-neon .icon-btn { background: rgba(255, 255, 255, 0.02); }

body.tpl-neon .icon-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--glow-a-soft);
}

body.tpl-neon .about { color: var(--text-dim); }

body.tpl-neon .icon-toggle { background: rgba(255, 255, 255, 0.02); }

body.tpl-neon .icon-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--glow-a-soft);
}

body.tpl-neon .modal-box {
  border-color: rgba(0, 255, 242, 0.16);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7), 0 0 40px var(--glow-b-soft);
}

@media (prefers-reduced-motion: reduce) {
  body.tpl-neon,
  body.tpl-neon .card-shell,
  body.tpl-neon .avatar,
  body.tpl-neon .avatar-fallback,
  body.tpl-neon .card-page h1,
  body.tpl-neon .role-badge::before,
  body.tpl-neon .btn.save-btn::before {
    animation: none !important;
  }
}

/* --- Minimal: editorial luxury --- */
body.tpl-minimal {
  --bg: #f6f3ec;
  --card-bg: #fffdfa;
  --shell-bg: rgba(255, 253, 250, 0.88);
  --shell-border: rgba(32, 31, 28, 0.08);
  --shell-radius: 10px;
  --accent: #a9824f;
  --accent2: #201f1c;
  --text: #201f1c;
  --text-dim: #8a8579;
  --border: #e6ddcf;
  --ok: #6b8f6b;
  --radius: 3px;
}

/* Clean sans as the default voice; serif is reserved for the name/role/about
   (a deliberate editorial pairing, rather than serif-everywhere). */
body.tpl-minimal { font-family: 'Inter', -apple-system, sans-serif; }

body.tpl-minimal .card-shell {
  box-shadow: 0 24px 55px -30px rgba(32, 31, 28, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  position: relative;
}

body.tpl-minimal .card-shell::before { opacity: 0.12; }

/* Thin inset frame line — a nod to invitation/stationery card borders */
body.tpl-minimal .card-shell::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--border);
  pointer-events: none;
  z-index: 3;
}

body.tpl-minimal .avatar {
  border: 1px solid var(--card-bg);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 26px -14px rgba(32, 31, 28, 0.35);
}

body.tpl-minimal .avatar-fallback {
  background: var(--accent2);
  color: var(--card-bg);
  font-family: 'Playfair Display', Georgia, serif;
  box-shadow: 0 0 0 1px var(--accent), 0 10px 26px -14px rgba(32, 31, 28, 0.35);
}

body.tpl-minimal .card-page h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--text);
}

body.tpl-minimal .card-page h1::after {
  content: "❖";
  display: block;
  margin: 12px auto 0;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--accent);
}

body.tpl-minimal .role-badge {
  background: transparent;
  border: 1px solid var(--accent);
}

body.tpl-minimal .role-text { font-style: italic; font-family: 'Playfair Display', Georgia, serif; }

body.tpl-minimal .value-prop .tw-text { font-style: italic; font-family: 'Playfair Display', Georgia, serif; }
body.tpl-minimal .value-prop .tw-cursor { color: var(--accent); }

body.tpl-minimal .reveal-section {
  border-radius: 2px;
  box-shadow: none;
}

body.tpl-minimal .reveal-section summary { letter-spacing: 0.1em; }
body.tpl-minimal .reveal-section .chevron { color: var(--accent); }

body.tpl-minimal .portfolio-item { border-radius: 2px; box-shadow: none; border: 1px solid var(--border); }

body.tpl-minimal .btn.save-btn {
  background: linear-gradient(135deg, #2c2a26, var(--accent2) 55%, #2c2a26);
  border: 1px solid rgba(169, 130, 79, 0.5);
  border-radius: 2px;
  letter-spacing: 0.05em;
  box-shadow: 0 12px 26px -14px rgba(32, 31, 28, 0.5);
}

body.tpl-minimal .icon-btn {
  border-radius: 2px;
  box-shadow: none;
}

body.tpl-minimal .icon-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 20px -12px rgba(169, 130, 79, 0.55);
}

body.tpl-minimal .about {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
}

body.tpl-minimal .icon-toggle { border-radius: 2px; }
body.tpl-minimal .icon-toggle:hover { box-shadow: 0 8px 16px -10px rgba(169, 130, 79, 0.5); }

body.tpl-minimal .modal-box { border-radius: 2px; box-shadow: none; }
body.tpl-minimal .modal-close { border-radius: 2px; }
body.tpl-minimal .qr-img { border-radius: 2px; }

/* --- Onboarding chat wizard --- */
.chat-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}

.chat-header-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-header-name { font-size: 16px; font-weight: 700; }
.chat-header-status {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 5px;
}
.chat-header-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  flex-shrink: 0;
  animation: chat-dot-pulse 2s infinite;
}
@keyframes chat-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding-bottom: 16px;
}

.chat-bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-bot {
  align-self: flex-start;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble-skip {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: 13px;
}

.chat-bubble-image {
  padding: 10px;
  display: flex;
  justify-content: center;
}

.chat-bubble-link a {
  color: var(--accent2);
  font-weight: 700;
  word-break: break-all;
  text-decoration: underline;
}

.chat-avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.chat-bubble-demo {
  text-align: center;
  padding: 16px;
}

.chat-demo-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.chat-demo-name {
  font-weight: 700;
  font-size: 15px;
}

.chat-demo-role {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 2px;
}

.chat-bubble-demo .value-prop { margin: 10px 0 0; padding: 0; }

.chat-typing {
  display: none;
  align-self: flex-start;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.chat-typing.show { display: flex; }

.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: chat-typing-bounce 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* --- Sticky reply bar: always visible at the bottom, styled like a real messenger's input tray --- */
.chat-controls {
  flex-shrink: 0;
  width: 100%;
  min-height: 64px;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  background: var(--card-bg);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

@keyframes chat-controls-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-controls-anim { animation: chat-controls-in 0.28s ease; }

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 100%;
}

/* Many-option lists (e.g. role picker) look ragged right-aligned — use a neat 2-col grid instead */
.chat-quick-replies-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.chat-quick-replies-grid .chat-chip { width: 100%; text-align: center; }
/* Odd item count leaves the last chip alone on its row — span it full-width and centre the label instead of hugging the left column */
.chat-quick-replies-grid .chat-chip:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Template picker: full-width stacked list instead of squeezed side-by-side chips */
.chat-quick-replies-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.chat-quick-replies-stack .chat-chip { width: 100%; text-align: left; padding: 12px 16px; }

.chat-chip {
  padding: 9px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.chat-chip:hover { border-color: var(--accent); background: rgba(108, 92, 231, 0.12); }

.chat-chip-file { position: relative; overflow: hidden; }
.chat-chip-file input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.chat-chip-skip {
  background: transparent;
  border-style: dashed;
  color: var(--text-dim);
  font-weight: 500;
}

.chat-chip-toggle.chat-chip-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chat-chip-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  width: 100%;
  text-align: center;
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input-row input {
  flex: 1;
  background: #0f1115;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 16px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.chat-input-row input:focus { outline: none; border-color: var(--accent); }

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

/* --- Pricing page --- */
.wrap-pricing { max-width: 1080px; }

.pricing-hero { text-align: center; padding: 12px 0 8px; }
.pricing-hero h1 { font-size: 26px; font-weight: 800; margin: 0 0 8px; }
.pricing-hero p { color: var(--text-dim); margin: 0; }
.pricing-hero-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.period-toggle {
  display: flex;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  width: fit-content;
  margin: 24px auto 32px;
}
.period-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}
.period-toggle-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.period-toggle-badge {
  font-size: 10px;
  background: rgba(85, 239, 196, 0.15);
  color: var(--ok);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  font-weight: 700;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

.plan-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.plan-card-highlight {
  border-color: var(--accent);
  box-shadow: 0 20px 40px -20px var(--accent);
}

.plan-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.plan-card-name { font-size: 15px; font-weight: 700; letter-spacing: 0.03em; color: var(--text-dim); margin-top: 6px; }

.price-block.price-monthly { display: none; }
.pricing-grid.period-month .price-monthly { display: block; }
.pricing-grid.period-month .price-yearly { display: none; }

.checkout-price-block { margin: 18px 0; }
.plan-price-old { color: var(--text-dim); font-size: 15px; text-decoration: line-through; margin-top: 14px; }
.plan-price { font-size: 30px; font-weight: 800; margin-top: 6px; }
.plan-price-period { font-size: 14px; font-weight: 500; color: var(--text-dim); }
.plan-price-sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.plan-launch-badge {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #ffb454;
  background: rgba(255, 180, 84, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
}

.plan-tagline { color: var(--text-dim); font-size: 14px; margin-top: 14px; flex-grow: 1; }
.price-block + .plan-tagline, .price-block ~ .plan-cta { margin-top: 0; }

.plan-card .plan-cta { margin-top: 22px; }
.plan-cta-note {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 10px;
  line-height: 1.4;
  min-height: 34px;
}
.plan-cta-note-warn { color: #ffb454; font-weight: 600; }

.plan-highlights {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  text-align: left;
  flex-grow: 1;
}

.plan-highlights li {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
  padding-left: 22px;
  position: relative;
  margin-top: 6px;
}

.plan-highlights li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent2);
  font-weight: 700;
}

.plan-details { margin-top: 16px; text-align: left; }
.plan-details summary { padding: 10px 14px; font-size: 10px; }
.plan-details-group + .plan-details-group { margin-top: 14px; }
.plan-details-label { font-size: 12px; font-weight: 700; color: var(--text-dim); }
.plan-details-group ul { list-style: none; margin: 8px 0 0; padding: 0; }
.plan-details-group li { font-size: 13px; line-height: 1.5; margin-top: 6px; }
.plan-details-excluded li { color: var(--text-dim); }

.pricing-footnote {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
  max-width: 560px;
  margin: 26px auto 0;
}

@media (max-width: 860px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .profile-avatar, .profile-avatar-fallback { width: 40px; height: 40px; }
  .profile-header-left { gap: 8px; }
  .profile-header { gap: 6px; }
  .profile-stat-chip { padding: 5px 8px; font-size: 10px; }
}

/* Admin panel: shared table/layout styles used across
   admin_broadcasts, admin_broadcast_detail, admin_promocodes, admin_stats */
@media (min-width: 700px) {
  .wrap-wide { max-width: 960px; }
}

.admin-table { width:100%; border-collapse:collapse; font-size:14px; }
.admin-table th, .admin-table td { text-align:left; padding:10px 12px; border-bottom:1px solid rgba(255,255,255,0.08); vertical-align:top; }
.admin-table th { color:var(--text-dim); font-weight:600; }
.admin-badge { display:inline-block; padding:2px 10px; border-radius:999px; font-size:12px; font-weight:600; }
.admin-badge-pro { background:rgba(85,239,196,0.15); color:var(--ok); }
.admin-badge-expired { background:rgba(255,107,107,0.15); color:var(--danger); }
.admin-badge-free { background:rgba(255,255,255,0.08); color:var(--text-dim); }
.admin-badge-trial { background:rgba(0,206,201,0.15); color:var(--accent2); }

@media (max-width: 640px) {
  .admin-table thead { display:none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display:block; width:100%; }
  .admin-table { overflow:visible; }
  .admin-table tr { border-bottom:1px solid rgba(255,255,255,0.08); padding:10px 0; }
  .admin-table td { border-bottom:none; padding:4px 0; }
  .admin-table td:empty { display:none; }
  .admin-table td[data-label]::before {
    content: attr(data-label);
    display:block;
    color:var(--text-dim);
    font-size:11px;
    margin-bottom:2px;
  }
}

/* --- Landing page (redesign) --- */
.wrap-landing { max-width: 1180px; padding-top: 0; }

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 21, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.landing-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.landing-logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 17px; margin-right: auto; }
.landing-logo:hover { color: var(--text); }
.landing-logo-icon { width: 24px; height: 24px; display: block; }
.landing-logo-accent { color: var(--accent); }

.landing-nav-links { display: flex; gap: 22px; }
.landing-nav-links a { color: var(--text-dim); font-size: 14px; font-weight: 500; }
.landing-nav-links a:hover { color: var(--text); }

.landing-nav-auth { display: flex; align-items: center; gap: 14px; }
.landing-nav-cta { padding: 9px 20px; font-size: 14px; }

.landing-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
  padding: 64px 24px 32px;
}

.landing-hero-text { text-align: left; }

.landing-badge {
  display: inline-block;
  background: rgba(85, 239, 196, 0.12);
  color: var(--ok);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.landing-hero-text h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 16px;
}

.landing-hero-text p {
  color: var(--text-dim);
  font-size: 17px;
  margin: 0 0 28px;
  max-width: 520px;
}

.landing-hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.landing-hero-btn { font-size: 15px; }

.maintenance-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 12px 26px -12px var(--accent);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.maintenance-email-btn:hover { opacity: 0.97; transform: translateY(-2px); box-shadow: 0 16px 32px -10px var(--accent); }
.maintenance-email-icon { width: 18px; height: 18px; flex-shrink: 0; }

@media (max-width: 480px) {
  .maintenance-email-btn { font-size: 14px; padding: 12px 20px; }
}

.landing-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  font-size: 12.5px;
}

.landing-trust-row span {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.landing-hero { position: relative; }

.landing-hero-text, .landing-hero-visual { position: relative; z-index: 1; }

.landing-hero-visual { display: flex; justify-content: center; position: relative; padding: 24px 0; }

.landing-hero-mobile-cta { display: none; }

.landing-hero-visual::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent), var(--accent2) 60%, transparent 72%);
  filter: blur(50px);
  opacity: 0.35;
  animation: landingGlowPulse 5s ease-in-out infinite;
  z-index: 0;
}

.landing-hero-annotate {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 150px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.35;
  z-index: 2;
  transform: rotate(-3deg) translateY(-10%);
  pointer-events: none;
}
.landing-hero-annotate svg { width: 48px; height: 32px; display: block; margin-top: 4px; opacity: 0.55; }

@media (max-width: 900px) {
  .landing-hero-annotate { display: none; }
}

.landing-mockup {
  width: 260px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  text-align: center;
  position: relative;
  z-index: 1;
  animation: landingMockupFloat 6s ease-in-out infinite;
}

/* Тема мокапа переключается только внутри его собственной рамки — не всей страницы */
.landing-mockup.mockup-alt {
  --card-bg: #ffffff;
  --text: #16171c;
  --text-dim: #5b5f70;
  --border: #e3e5ea;
}

@keyframes landingGlowPulse {
  0%, 100% { opacity: 0.25; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.45; transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes landingMockupFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero-visual::before,
  .landing-mockup { animation: none; }
}

.landing-mockup-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.lm-topbar-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  appearance: none;
  font-size: 11px; line-height: 1; font-family: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
}

.landing-mockup-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04), 0 0 30px -8px var(--accent);
}
.landing-mockup-avatar img { width: 34px; height: 34px; display: block; }

.landing-mockup-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.landing-mockup-name b { color: var(--accent); font-weight: 700; }

.lm-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ok, #55efc4);
  color: #05060a;
  font-size: 9px;
  font-weight: 800;
  flex-shrink: 0;
}

.landing-mockup-role {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  margin-bottom: 10px;
}

.landing-mockup-tagline { min-height: 20px; margin-bottom: 18px; }
.landing-mockup-tagline .tw-text { font-size: 12.5px; }

.landing-mockup-icons { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; }
.lm-icon {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  appearance: none;
  font: inherit;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.lm-icon svg { width: 13px; height: 13px; }
.lm-icon-web { color: var(--text-dim); }
.lm-icon-mail { color: var(--text-dim); }

.lm-folder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 22px;
  height: 22px;
}
.lm-mini-tile { display: flex; align-items: center; justify-content: center; border-radius: 6px; overflow: hidden; }
.lm-mini-tile svg { width: 9px; height: 9px; }
.lm-mini-txt { color: #fff; font-weight: 800; font-family: Arial, sans-serif; font-size: 8px; line-height: 1; }
.lm-mini-tg { background: #29a9ea; }
.lm-mini-wa { background: #25d366; }
.lm-mini-vk { background: #0077ff; }
.lm-mini-ig { background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7); }

.landing-mockup-qr {
  width: 72px; height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}
.landing-mockup-qr div { background: var(--text-dim); border-radius: 2px; opacity: 0.5; }
.landing-mockup-qr div:nth-child(2) { opacity: 0.85; }
.landing-mockup-qr div:nth-child(3) { opacity: 0.3; }

/* Модалки мокапа живут внутри .landing-mockup (position:relative, фикс. ширина 260px на любом экране),
   поэтому position:absolute даёт одинаковое «окошко в мокапе» и на телефоне, и на ПК без медиа-запросов */
.lm-modal-overlay {
  position: absolute;
  inset: 0;
  padding: 14px;
  border-radius: 24px;
  z-index: 20;
}
.lm-modal-overlay .modal-box {
  max-width: 100%;
  padding: 18px 14px 14px;
  border-radius: 16px;
  box-shadow: 0 16px 30px -14px rgba(0, 0, 0, 0.6);
}
.lm-modal-overlay .modal-close { width: 22px; height: 22px; top: 8px; right: 8px; font-size: 10px; }
.lm-modal-overlay .modal-title { font-size: 13px; margin-bottom: 10px; }
.lm-modal-overlay .modal-hint { font-size: 10px; margin-top: 8px; }
.lm-modal-overlay .qr-img { width: 120px; height: 120px; padding: 6px; border-radius: 10px; }
.lm-modal-overlay .contact-picker-list { gap: 6px; }
.lm-modal-overlay .contact-picker-item { padding: 8px 10px; gap: 8px; font-size: 11px; border-radius: 10px; }
.lm-modal-overlay .contact-picker-item .mini-tile { width: 24px; height: 24px; border-radius: 7px; }
.lm-modal-overlay .contact-picker-item .mini-tile svg { width: 13px; height: 13px; }
.lm-modal-overlay .contact-picker-item .mini-tile-txt { font-size: 10px; }
.lm-modal-overlay .legal-note { font-size: 7px; line-height: 1.3; }

.landing-mockup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
  text-decoration: none;
  cursor: pointer;
}

/* --- Consent hero (первый экран VK-приложения / согласие) --- */
.wrap-consent { max-width: 760px; }

.consent-hero { position: relative; text-align: center; padding: 4px 0 0; }

.consent-hero-brand { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-bottom: 18px; }
.consent-hero-brand-name { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 17px; color: var(--text); }
.consent-hero-brand-name img { width: 22px; height: 22px; display: block; }
.consent-hero-brand-name span { color: var(--accent); }
.consent-hero-brand-tag { font-size: 12px; color: var(--text-dim); }

.consent-hero-grid { display: grid; grid-template-columns: 1fr; gap: 4px; }
.consent-hero-visual { order: 1; position: relative; display: flex; justify-content: center; padding: 22px 0 10px; }

@media (min-width: 720px) {
  .consent-hero-grid { grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; text-align: left; }
  .consent-hero-visual { order: 1; padding: 0; }
  .consent-hero-col-text { order: 0; text-align: left; }
  .consent-hero-badge { margin-left: 0; }
  .consent-hero-heading h1, .consent-hero-heading p { text-align: left; }
  .consent-features-compact { text-align: left; }
}

.consent-hero-visual::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent), var(--accent2) 60%, transparent 72%);
  filter: blur(46px);
  opacity: 0.35;
  transform: translate(-50%, -50%);
  animation: landingGlowPulse 5s ease-in-out infinite;
  z-index: 0;
}

.consent-hero-annotate {
  position: absolute;
  top: -4px;
  left: 0;
  max-width: 118px;
  font-size: 11.5px;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.3;
  text-align: left;
  z-index: 2;
  transform: rotate(-3deg) translateY(-10%);
  pointer-events: none;
}
.consent-hero-annotate svg { width: 40px; height: 28px; display: block; margin-top: 4px; opacity: 0.55; }

@media (prefers-reduced-motion: reduce) {
  .consent-hero-visual::before { animation: none; }
}

.consent-hero-badge {
  display: inline-block;
  background: rgba(85, 239, 196, 0.12);
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.consent-hero-heading h1 { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; margin: 0 0 8px; }
.consent-hero-heading p { color: var(--text-dim); font-size: 13.5px; margin: 0 0 18px; }

.consent-features-compact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
.consent-feature-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  text-align: center;
}
.consent-feature-chip .cfc-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 15px;
  background: rgba(108, 92, 231, 0.14);
  flex-shrink: 0;
}

.landing-section { padding: 56px 24px; }
.landing-section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.landing-eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 10px;
}
.landing-section-head h2 { font-size: clamp(22px, 3vw, 30px); margin: 0; }

.landing-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.landing-step {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
}
.landing-step-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.landing-step b { display: block; margin-bottom: 6px; }
.landing-step span { color: var(--text-dim); font-size: 14px; }

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.landing-feature {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.landing-feature b { display: block; margin-bottom: 6px; }
.landing-feature span { color: var(--text-dim); font-size: 14px; }

.landing-templates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.landing-template {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.landing-template b { display: block; margin: 4px 0 6px; }
.landing-template span { color: var(--text-dim); font-size: 13px; }
.landing-template-preview {
  height: 110px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.landing-template-classic .landing-template-preview { background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent); }
.landing-template-neon .landing-template-preview { background: linear-gradient(135deg, rgba(108,92,231,0.35), rgba(0,206,201,0.35)); box-shadow: inset 0 0 30px rgba(0,206,201,0.25); }
.landing-template-minimal .landing-template-preview { background: rgba(255,255,255,0.02); }

.landing-price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.landing-price-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}
.landing-price-card-highlight { border-color: var(--accent); box-shadow: 0 20px 40px -22px var(--accent); }
.landing-price-value { font-size: 26px; font-weight: 800; margin: 10px 0 8px; }
.landing-price-card span { color: var(--text-dim); font-size: 13px; }
.landing-pricing-link { display: block; width: fit-content; margin: 0 auto; }

.landing-faq { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.landing-faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.landing-faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.landing-faq-item summary::-webkit-details-marker { display: none; }
.landing-faq-item summary::after { content: "+"; float: right; color: var(--accent2); font-weight: 700; }
.landing-faq-item[open] summary::after { content: "−"; }
.landing-faq-item p { color: var(--text-dim); font-size: 14px; margin: 12px 0 0; }

.landing-final-cta {
  text-align: center;
  padding: 56px 24px;
  margin: 24px 24px 0;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(108,92,231,0.18), rgba(0,206,201,0.12));
  border: 1px solid var(--border);
}
.landing-final-cta h2 { margin: 0 0 10px; font-size: clamp(22px, 3vw, 28px); }
.landing-final-cta p { color: var(--text-dim); margin: 0 0 24px; }

@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; padding: 40px 20px 16px; text-align: center; }
  .landing-hero-text { text-align: center; }
  .landing-hero-text p { max-width: none; margin-left: auto; margin-right: auto; }
  .landing-hero-ctas, .landing-trust-row { justify-content: center; }
  .landing-hero-visual { margin-top: 8px; }
  .landing-hero-visual::before { width: 220px; height: 220px; }
  .landing-hero-mobile-cta { display: flex; justify-content: center; margin-top: 10px; }
  .landing-steps, .landing-features-grid, .landing-templates, .landing-price-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 780px) {
  .landing-nav-links { display: none; }
}

@media (max-width: 560px) {
  .landing-steps, .landing-features-grid, .landing-templates, .landing-price-grid {
    grid-template-columns: 1fr;
  }
  .landing-section { padding: 40px 16px; }
  .landing-final-cta { margin: 16px 16px 0; padding: 40px 20px; }
}

/* --- Team feature (BUSINESS) --- */
.team-slots-count {
  font-size: 12px;
  color: var(--text-dim);
  margin: 16px 0 10px;
}

.team-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.team-add-form input { flex: 1 1 140px; min-width: 140px; }
.team-add-form .btn-outline { flex-shrink: 0; padding: 11px 18px; white-space: nowrap; }

.team-roster {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: opacity 0.2s ease;
}

.team-row-disabled { opacity: 0.55; }

.team-row-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

a.team-row-link:hover .team-row-name { color: var(--accent2); }

.team-row-avatar,
.team-row-avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.team-row-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.team-row-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.team-row-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.team-row-role {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-row-status {
  font-size: 11px;
  font-weight: 600;
}

.team-row-status-pending { color: #f0b83c; }
.team-row-status-active { color: var(--ok); }
.team-row-status-disabled { color: var(--text-dim); }

.team-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.team-row-actions form { display: inline-flex; }

.team-row-actions .btn-outline,
.team-row-actions .btn-outline-danger {
  padding: 7px 12px;
  font-size: 12px;
  white-space: nowrap;
}

/* --- Team members grid (public card) --- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 14px;
  padding-top: 2px;
}

.team-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.team-tile:hover { transform: translateY(-3px); }
.team-tile:hover .team-tile-name { color: var(--accent2); }

.team-tile-avatar-wrap {
  position: relative;
  display: inline-flex;
}

.team-tile-avatar,
.team-tile-avatar-fallback {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.team-tile-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
  font-size: 20px;
}

.team-tile-leader .team-tile-avatar,
.team-tile-leader .team-tile-avatar-fallback {
  border-color: var(--accent2);
}

.team-tile-crown {
  position: absolute;
  top: -8px;
  right: -4px;
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.team-tile-name {
  font-size: 12px;
  font-weight: 600;
  max-width: 84px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.team-tile-role {
  font-size: 11px;
  color: var(--text-dim);
  max-width: 84px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkout-autorenew {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-dim);
  margin: 4px 0 2px;
}
.checkout-autorenew input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }

.autorenew-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(46, 204, 113, 0.08);
  border: 1px solid rgba(46, 204, 113, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.autorenew-cancel-btn {
  background: none;
  border: 1px solid var(--text-dim);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}
.autorenew-cancel-btn:hover { border-color: var(--danger, #e74c3c); color: var(--danger, #e74c3c); }
