* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

/* Floating Bears Background */
.floating-bears {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bear {
  position: absolute;
  will-change: transform;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Blur and opacity based on size class - smaller = more blur, farther */
.bear.bear-xs {
  filter: blur(12px) drop-shadow(0 0 15px rgba(0, 245, 212, 0.3));
  opacity: 0.25;
}

.bear.bear-sm {
  filter: blur(8px) drop-shadow(0 0 20px rgba(0, 245, 212, 0.35));
  opacity: 0.30;
}

.bear.bear-md {
  filter: blur(4px) drop-shadow(0 0 28px rgba(0, 245, 212, 0.45));
  opacity: 0.40;
}

.bear.bear-lg {
  filter: blur(1px) drop-shadow(0 0 40px rgba(0, 245, 212, 0.5));
  opacity: 0.55;
}

/* Hide bears on small screens or when disabled */
@media (max-width:1200px) {
  .floating-bears {
    display: none;
  }
}

.floating-bears.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* Bears toggle button */
/* Install PWA Button */
.btn-install {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(123, 97, 255, 0.4);
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.15), rgba(0, 245, 212, 0.1));
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: pulse-install 2s ease-in-out infinite;
}

.btn-install svg {
  width: 16px;
  height: 16px;
}

.btn-install:hover {
  border-color: rgba(123, 97, 255, 0.7);
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.25), rgba(0, 245, 212, 0.15));
  box-shadow: 0 0 20px rgba(123, 97, 255, 0.3);
  transform: translateY(-2px);
  animation: none;
}

@keyframes pulse-install {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(123, 97, 255, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(123, 97, 255, 0);
  }
}

.btn-bears-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0, 245, 212, 0.3);
  background: rgba(0, 245, 212, 0.08);
  color: #7fffe8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-bears-toggle:hover {
  background: rgba(0, 245, 212, 0.15);
  border-color: rgba(0, 245, 212, 0.5);
}

.btn-bears-toggle svg {
  width: 20px;
  height: 20px;
}

.btn-bears-toggle .bear-icon-off {
  display: none;
}

.btn-bears-toggle.off {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
}

.btn-bears-toggle.off .bear-icon-on {
  display: none;
}

.btn-bears-toggle.off .bear-icon-off {
  display: block;
}

/* Create Landing Trigger */
.create-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.create-trigger {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 20px;
  position: relative;
}

.create-trigger-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 245, 212, 0.15) 0%, transparent 70%);
  animation: pulse-glow 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse-glow {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }

  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

.create-trigger-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 32px;
  border-radius: 16px;
  border: 2px solid rgba(0, 245, 212, 0.5);
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.1), rgba(123, 97, 255, 0.1));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.create-trigger-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.create-trigger-btn:hover {
  transform: scale(1.05);
  border-color: rgba(0, 245, 212, 0.8);
  box-shadow: 0 0 30px rgba(0, 245, 212, 0.3), 0 0 60px rgba(123, 97, 255, 0.2);
}

.create-trigger-btn:hover::before {
  opacity: 1;
}

.create-trigger-icon {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease;
}

.create-trigger-btn:hover .create-trigger-icon {
  transform: rotate(90deg);
}

.create-trigger-icon svg {
  width: 18px;
  height: 18px;
}

.create-trigger-text {
  position: relative;
  z-index: 1;
}

.create-trigger-hint {
  font-size: 13px;
  color: rgba(0, 245, 212, 0.7);
  font-weight: 600;
}

/* Create Form Container */
.create-form-container {
  display: none;
}

.create-card.form-open .create-trigger {
  display: none;
}

.create-card.form-open .create-form-container {
  display: block;
  animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.create-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.create-form-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.create-form-close:hover {
  border-color: rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.1);
  color: #ff6b6b;
}

.create-form-close svg {
  width: 16px;
  height: 16px;
}

:root {
  --bg: #0a0a12;
  --card: #11131f;
  --line: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.6);
  --accent: #00f5d4;
  --accent2: #7b61ff;
  --danger: #ff6b6b;
}

body {
  font-family: 'Unbounded', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.4;
}

.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px 70px;
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.brand {
  font-weight: 900;
  font-size: clamp(24px, 4vw, 36px);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home {
  text-align: center;
  padding: 40px 10px 60px;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-title {
  font-weight: 900;
  font-size: clamp(28px, 6vw, 52px);
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-logo {
  width: min(260px, 60vw);
  margin: 26px auto 10px;
  display: block;
  filter: drop-shadow(0 12px 40px rgba(0, 245, 212, 0.25));
  animation: floaty 4.5s ease-in-out infinite;
}

.home-sub {
  font-size: clamp(16px, 3vw, 20px);
  color: var(--text);
  opacity: 0.85;
  margin-top: 10px;
}

.home-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

@keyframes floaty {
  0% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-10px)
  }

  100% {
    transform: translateY(0)
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2)
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  box-shadow: 0 10px 30px rgba(0, 245, 212, 0.25);
}

.btn-mini {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.share-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.btn-refresh-all {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-refresh-all:hover {
  transform: rotate(180deg);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.btn-refresh-all:active {
  transform: rotate(360deg);
}

.btn-refresh-all.spinning {
  animation: spin 0.8s linear infinite;
  pointer-events: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0d0f1a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.edit-row {
  display: none !important;
  visibility: hidden;
}

.edit-row.open {
  display: table-row !important;
  visibility: visible;
}

.edit-row td {
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.03), rgba(123, 97, 255, 0.03));
  border-top: 1px solid rgba(0, 245, 212, 0.15);
  border-bottom: 1px solid rgba(0, 245, 212, 0.15);
  padding: 16px 12px;
}

.edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.edit-col .label {
  margin-bottom: 6px;
}

.edit-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.edit-toggles .toggle {
  gap: 6px;
}

.edit-toggles .toggle-text {
  font-size: 12px;
}

.edit-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
  font-weight: 700;
}

.color-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-pick {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.color-pick::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-pick::-webkit-color-swatch {
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.color-pick::-moz-color-swatch {
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.input-sm {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
}

.btn-refresh {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(0, 245, 212, 0.4);
  background: rgba(0, 245, 212, 0.1);
  color: #7fffe8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-refresh:hover {
  background: rgba(0, 245, 212, 0.2);
  transform: rotate(45deg);
}

.btn-refresh:active {
  transform: rotate(180deg);
}

.btn-refresh.spinning {
  animation: spin 0.8s linear infinite;
  pointer-events: none;
}

.btn-refresh.spinning svg {
  opacity: 0.6;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.btn-refresh svg {
  width: 16px;
  height: 16px;
}

td[data-stat] {
  transition: color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.stat-value {
  transition: color 0.3s ease;
}

.stats-grid {
  transition: opacity 0.3s ease;
}

.btn-danger {
  border-color: rgba(255, 107, 107, 0.4);
  color: var(--danger)
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0d0f1a;
  color: var(--text);
  font-family: inherit;
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

textarea.input {
  resize: vertical;
  min-height: 44px;
  line-height: 1.5;
}

.postback-textarea {
  min-height: 80px;
  font-size: 14px;
}

/* Secret input with toggle */
.input-secret-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-secret-wrap .input {
  padding-right: 48px;
}

.secret-toggle {
  position: absolute;
  right: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.secret-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.secret-toggle.active {
  background: rgba(0, 245, 212, 0.15);
  border-color: rgba(0, 245, 212, 0.3);
  opacity: 1;
}

select.input {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.7) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.7) 50%, transparent 50%),
    linear-gradient(to right, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 12px) 18px,
    100% 0;
  background-size:
    6px 6px,
    6px 6px,
    42px 100%;
  background-repeat: no-repeat;
  padding-right: 46px;
}

select.input option {
  background: #0d0f1a;
  color: var(--text);
}

.select {
  position: relative;
}

.select-btn {
  width: 100%;
  text-align: left;
  padding: 13px 46px 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0d0f1a;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.select-btn::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
  transform: translateY(-50%) rotate(45deg);
}

.select-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #0d0f1a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  max-height: 220px;
  overflow: auto;
  display: none;
  z-index: 10;
}

.select.open .select-list {
  display: block;
}

.select-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
}

.select-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.input:focus {
  outline: none;
  border-color: rgba(0, 245, 212, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.1);
}

.muted {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px
}

.muted-soft {
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px
}

.hint-text {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  margin-left: 4px;
}

.label-accent {
  color: #7fffe8;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap::-webkit-scrollbar {
  height: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.th-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.icon-logo {
  width: 22px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
}

.icon-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.edit-panel {
  display: none;
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.edit-panel.active {
  display: block;
}

.token-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 245, 212, 0.6);
  color: #7fffe8;
  background: rgba(0, 245, 212, 0.08);
  margin-top: 12px;
  font-weight: 700;
}

.event-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  margin-top: 12px;
}

/* Collapsible postback blocks */
.postback-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  margin-top: 12px;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.postback-block:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.postback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.postback-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.postback-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.postback-icon {
  font-size: 16px;
}

.postback-status {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.postback-status.active {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.postback-arrow {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease;
}

.postback-block.open .postback-arrow {
  transform: rotate(180deg);
}

.postback-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 16px;
}

.postback-block.open .postback-content {
  max-height: 200px;
  padding: 0 16px 16px 16px;
}

/* Collapsible cards */
.collapsible-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding-bottom: 16px;
  margin-bottom: 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.collapsible-card.collapsed .card-header {
  padding-bottom: 0;
  border-bottom: none;
}

.collapsible-card .card-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.collapsible-card .card-header:hover {
  opacity: 0.8;
}

.card-arrow {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease;
}

.collapsible-card.collapsed .card-arrow {
  transform: rotate(-90deg);
}

.collapsible-card .card-body {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
  opacity: 1;
}

.collapsible-card.collapsed .card-body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Stats landing filter dropdown */
.stats-landing-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  min-width: 150px;
}

.stats-landing-select:hover {
  border-color: rgba(127, 255, 232, 0.4);
  background: rgba(255, 255, 255, 0.12);
}

.stats-landing-select:focus {
  border-color: #7fffe8;
  box-shadow: 0 0 0 3px rgba(127, 255, 232, 0.15);
}

.stats-landing-select option {
  background: #1a1a2e;
  color: #fff;
  padding: 8px;
}

.geo-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.device-header .insight-label {
  margin-bottom: 0;
}

.stats-loading {
  text-align: center;
  padding: 30px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.geo-list,
.device-grid {
  transition: opacity 0.2s ease;
  min-height: 80px;
}

.geo-row {
  animation: fadeIn 0.3s ease;
}

.device-card {
  animation: fadeIn 0.3s ease;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.toggle-ui {
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  transition: background 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle input:checked+.toggle-ui {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: var(--accent);
}

.toggle input:checked+.toggle-ui::after {
  transform: translateX(18px);
}

.toggle-text {
  font-weight: 600;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: #7fffe8;
  border: 1px solid rgba(0, 245, 212, 0.6);
  background: rgba(0, 245, 212, 0.08);
  margin-left: 6px;
  position: relative;
  cursor: default;
}

.hint-tooltip {
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%);
  background: #0d0f1a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  white-space: nowrap;
  font-size: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hint:hover .hint-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* Stats settings button */
.btn-stats-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-stats-settings:hover, .btn-stats-settings.active {
  background: rgba(0, 245, 212, 0.1);
  border-color: rgba(0, 245, 212, 0.3);
  color: var(--accent);
}

/* Stats settings panel */
.stats-settings-panel {
  display: none;
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.stats-settings-panel.open {
  display: block;
}

.stats-settings-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.stats-settings-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
  user-select: none;
}

.stats-check:hover {
  border-color: rgba(0, 245, 212, 0.3);
  color: rgba(255, 255, 255, 0.9);
}

.stats-check input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.stat-card {
  position: relative;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  cursor: default;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-card:hover .stat-value {
  transform: scale(1.08);
}

.stat-value {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.8;
  background: radial-gradient(120px 120px at 100% 0%, rgba(0, 245, 212, 0.15), transparent 60%);
  pointer-events: none;
}

.stat-card.purple::after {
  background: radial-gradient(120px 120px at 100% 0%, rgba(123, 97, 255, 0.18), transparent 60%);
}

.stat-card.purple:hover {
  border-color: rgba(123, 97, 255, 0.4);
  box-shadow: 0 20px 40px rgba(123, 97, 255, 0.2);
}

.stat-card.red::after {
  background: radial-gradient(120px 120px at 100% 0%, rgba(255, 107, 107, 0.2), transparent 60%);
}

.stat-card.red:hover {
  border-color: rgba(255, 107, 107, 0.4);
  box-shadow: 0 20px 40px rgba(255, 107, 107, 0.15);
}

.stat-card.orange::after {
  background: radial-gradient(120px 120px at 100% 0%, rgba(255, 165, 0, 0.2), transparent 60%);
}

.stat-card.orange:hover {
  border-color: rgba(255, 165, 0, 0.4);
  box-shadow: 0 20px 40px rgba(255, 165, 0, 0.15);
}

.stat-card.orange .stat-value {
  color: #ffa500;
}

.stat-card.blue::after {
  background: radial-gradient(120px 120px at 100% 0%, rgba(77, 163, 255, 0.2), transparent 60%);
}

.stat-card.blue:hover {
  border-color: rgba(77, 163, 255, 0.4);
  box-shadow: 0 20px 40px rgba(77, 163, 255, 0.15);
}

.stat-card.green::after {
  background: radial-gradient(120px 120px at 100% 0%, rgba(0, 245, 212, 0.18), transparent 60%);
}

.stat-card.green:hover {
  border-color: rgba(0, 245, 212, 0.4);
  box-shadow: 0 20px 40px rgba(0, 245, 212, 0.15);
}

.stat-value {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
}

.pill.ok {
  background: rgba(0, 245, 212, 0.15);
  color: #7fffe8
}

.pill.bad {
  background: rgba(255, 107, 107, 0.2);
  color: #ffb3b3
}

.notice {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.notice.error {
  border-color: rgba(255, 107, 107, 0.5);
  color: #ffb3b3
}

.notice.success {
  border-color: rgba(0, 245, 212, 0.5);
  color: #7fffe8
}

/* Period Tabs */
.period-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.period-tab {
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.period-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.period-tab.active {
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.15), rgba(123, 97, 255, 0.15));
  border-color: rgba(0, 245, 212, 0.4);
  color: #7fffe8;
}

/* Period Tabs Container */
.period-tabs-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Date Picker Wrapper */
.date-picker-wrapper {
  position: relative;
}

.date-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.date-picker-btn svg {
  width: 16px;
  height: 16px;
}

.date-picker-label {
  font-size: 11px;
  white-space: nowrap;
}

/* Calendar Dropdown */
.calendar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: rgba(17, 19, 31, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 245, 212, 0.1);
  padding: 16px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(20px);
}

.calendar-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Calendar Header */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.calendar-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-transform: capitalize;
}

.calendar-nav {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.calendar-nav:hover {
  background: rgba(0, 245, 212, 0.1);
  border-color: rgba(0, 245, 212, 0.3);
  color: #7fffe8;
}

.calendar-nav svg {
  width: 16px;
  height: 16px;
}

/* Calendar Weekdays */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  padding: 4px;
}

/* Calendar Days Grid */
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.calendar-day.other-month {
  color: rgba(255, 255, 255, 0.25);
}

.calendar-day.other-month:hover {
  color: rgba(255, 255, 255, 0.5);
}

.calendar-day.today {
  background: rgba(123, 97, 255, 0.2);
  color: #b3a3ff;
  border: 1px solid rgba(123, 97, 255, 0.4);
}

.calendar-day.selected {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 245, 212, 0.3);
  transform: scale(1.05);
}

.calendar-day.future {
  color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
}

.calendar-day.future:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.2);
}

/* Calendar Footer */
.calendar-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
}

.calendar-today-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(0, 245, 212, 0.3);
  background: rgba(0, 245, 212, 0.1);
  color: #7fffe8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.calendar-today-btn:hover {
  background: rgba(0, 245, 212, 0.2);
  border-color: rgba(0, 245, 212, 0.5);
  box-shadow: 0 4px 12px rgba(0, 245, 212, 0.2);
}

/* Range selection styles */
.calendar-range-hint {
  text-align: center;
  font-size: 12px;
  color: #7fffe8;
  font-weight: 600;
  margin-bottom: 12px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.1), rgba(123, 97, 255, 0.1));
  border: 1px solid rgba(0, 245, 212, 0.2);
  border-radius: 8px;
}

.calendar-day.range-start {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-radius: 8px 0 0 8px;
}

.calendar-day.range-end {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-radius: 0 8px 8px 0;
}

.calendar-day.range-start.range-end {
  border-radius: 8px;
}

.calendar-day.in-range {
  background: rgba(0, 245, 212, 0.15);
  color: #7fffe8;
  border-radius: 0;
}

.calendar-day.in-range:hover {
  background: rgba(0, 245, 212, 0.25);
}

.calendar-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.calendar-clear-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.1);
  color: #ff9999;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.calendar-clear-btn:hover {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.5);
}

.calendar-apply-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.calendar-apply-btn:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(0, 245, 212, 0.3);
  transform: translateY(-1px);
}

.calendar-apply-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Insights Section */
.insights-section {
  padding: 0;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.insight-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.insight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 0% 0%, rgba(0, 245, 212, 0.06), transparent 50%);
  pointer-events: none;
}

.insight-card.best-landing::before {
  background: radial-gradient(ellipse at 0% 0%, rgba(255, 215, 0, 0.08), transparent 50%);
}

.insight-card.top-social::before {
  background: radial-gradient(ellipse at 0% 0%, var(--accent-color, rgba(0, 245, 212, 0.08)), transparent 50%);
  opacity: 0.15;
}

.insight-card.social-breakdown {
  flex-direction: column;
  gap: 0;
}

.insight-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 215, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-icon svg {
  width: 26px;
  height: 26px;
}

.insight-card.best-landing .insight-icon {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 140, 0, 0.15));
}

.insight-card.best-landing .insight-icon svg {
  stroke: #ffd700;
  fill: none;
}

.insight-content {
  flex: 1;
  min-width: 0;
}

.insight-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.insight-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  word-break: break-word;
}

.insight-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Social Breakdown Bars */
.social-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.social-bar-label {
  width: 80px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.social-bar-track {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.social-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

.social-bar-pct {
  width: 40px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: right;
}

/* Geo Stats */
.geo-breakdown {
  flex-direction: column;
  gap: 0;
  grid-column: 1 / -1;
}

.geo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.geo-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 10px;
}

.geo-tab {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.2s ease;
}

.geo-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.geo-tab.active {
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.2), rgba(123, 97, 255, 0.2));
  color: #7fffe8;
}

.geo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.geo-row {
  display: grid;
  grid-template-columns: 28px 1fr 40px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
}

.geo-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(0, 245, 212, 0.1), rgba(123, 97, 255, 0.1));
  pointer-events: none;
  z-index: 0;
}

.geo-flag {
  font-size: 18px;
  position: relative;
  z-index: 1;
}

.geo-location {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.geo-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  position: relative;
  z-index: 1;
}

/* Device Stats */
.device-breakdown {
  flex-direction: column;
  gap: 0;
  grid-column: 1 / -1;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width:700px) {
  .device-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.device-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border-radius: 14px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s ease;
}

.device-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(0, 245, 212, 0.08), transparent 70%);
  pointer-events: none;
}

.device-card:hover {
  border-color: rgba(0, 245, 212, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.device-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.device-icon svg {
  width: 100%;
  height: 100%;
}

.device-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.device-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.device-count {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.device-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* Customize Button */
.btn-customize {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(123, 97, 255, 0.4);
  background: rgba(123, 97, 255, 0.1);
  color: #b8a4ff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-customize:hover {
  background: rgba(123, 97, 255, 0.2);
  border-color: rgba(123, 97, 255, 0.6);
  transform: rotate(-10deg);
}

.btn-customize svg {
  width: 18px;
  height: 18px;
}

/* Customize Sidebar */
.customize-sidebar {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: #0d0f1a;
  border-left: 1px solid var(--line);
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.customize-sidebar.open {
  right: 0;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.sidebar-header h4 {
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-close:hover {
  border-color: rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
}

.sidebar-close svg {
  width: 16px;
  height: 16px;
}

.sidebar-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.sidebar-toggle input[type="checkbox"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sidebar-toggle .toggle-ui {
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  transition: background 0.3s ease;
}

.sidebar-toggle .toggle-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle input:checked+.toggle-ui {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.sidebar-toggle input:checked+.toggle-ui::after {
  transform: translateX(18px);
}

.sidebar-toggle span:last-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Hidden blocks */
[data-block].block-hidden {
  display: none !important;
}

@media (max-width:520px) {
  .hero {
    flex-direction: column;
    align-items: flex-start
  }

  .page {
    padding: 24px 16px 40px;
  }

  .home {
    padding: 24px 8px 30px;
    min-height: 80vh;
  }

  .home-logo {
    width: min(220px, 70vw);
    margin: 18px auto 8px;
  }

  .home-title {
    font-size: clamp(24px, 8vw, 34px);
  }

  .home-actions {
    flex-direction: column;
    align-items: center;
  }

  .home-actions .btn {
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width:760px) {
  .event-row {
    grid-template-columns: 1fr;
  }
}

/* Duplicate button */
.btn-duplicate {
  background: linear-gradient(135deg, #4a90d9, #357abd);
  color: #fff;
  display: inline-flex;
  align-items: center;
}

.btn-duplicate:hover {
  background: linear-gradient(135deg, #5a9fe5, #4090d5);
  transform: translateY(-1px);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: linear-gradient(145deg, #1a1a2e 0%, #0f0f1a 100%);
  border: 1px solid rgba(0, 245, 212, 0.2);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 420px;
  width: 90%;
  position: relative;
  transform: translateY(-30px) scale(0.95);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 245, 212, 0.1);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-title {
  margin: 0 0 8px;
  font-size: 20px;
  color: #fff;
}

.modal-subtitle {
  margin: 0 0 20px;
  color: #888;
  font-size: 14px;
}

.modal-subtitle strong {
  color: #00f5d4;
}

.modal-content .label {
  display: block;
  margin-bottom: 6px;
  color: #aaa;
  font-size: 13px;
}

.modal-content .input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-content .input:focus {
  outline: none;
  border-color: #00f5d4;
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.15);
}

.modal-hint {
  margin: 8px 0 0;
  color: #666;
  font-size: 12px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

.modal-actions .btn {
  padding: 10px 20px;
  font-size: 14px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Slug input with prefix */
.slug-input-row {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.slug-prefix {
  padding: 10px 0 10px 12px;
  color: #666;
  font-size: 13px;
  white-space: nowrap;
  user-select: none;
}

.slug-input-row .input {
  border: none;
  background: transparent;
  padding-left: 2px;
  flex: 1;
}

.slug-input-row .input:focus {
  box-shadow: none;
}

.slug-input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.1);
}

.input-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: #666;
}

.edit-col-wide {
  grid-column: span 2;
}

@media(max-width:700px) {
  .edit-col-wide {
    grid-column: span 1;
  }
}

/* Game Toggle Cards - красивые карточки для выбора игр */
.game-toggle-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

@media(max-width:900px) {
  .game-toggle-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width:500px) {
  .game-toggle-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.game-toggle {
  cursor: pointer;
  display: block;
}

.game-toggle input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.game-toggle-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.game-toggle-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.15), rgba(0, 245, 212, 0.1));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.game-toggle input:checked+.game-toggle-card {
  border-color: var(--accent);
  background: rgba(0, 245, 212, 0.08);
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.15);
}

.game-toggle input:checked+.game-toggle-card::before {
  opacity: 1;
}

.game-toggle:hover .game-toggle-card {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.game-toggle input:checked+.game-toggle-card:hover {
  border-color: var(--accent);
}

.game-toggle-img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  position: relative;
  z-index: 1;
  transition: all 0.25s ease;
  filter: saturate(0.7) opacity(0.7);
}

.game-toggle input:checked+.game-toggle-card .game-toggle-img {
  filter: saturate(1) opacity(1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.game-toggle-name {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  position: relative;
  z-index: 1;
  transition: color 0.25s ease;
}

.game-toggle input:checked+.game-toggle-card .game-toggle-name {
  color: var(--accent);
}

.game-toggle-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a12;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.25s ease;
}

.game-toggle input:checked+.game-toggle-card .game-toggle-check {
  opacity: 1;
  transform: scale(1);
}

/* Когда игра отключена - затемнение */
.game-toggle input:not(:checked)+.game-toggle-card {
  opacity: 0.6;
}

.game-toggle input:not(:checked)+.game-toggle-card .game-toggle-img {
  filter: grayscale(0.5) opacity(0.5);
}

/* Logo Upload Section */
.logo-upload-section {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  align-items: start;
}

@media(max-width:600px) {
  .logo-upload-section {
    grid-template-columns: 1fr;
  }
}

.logo-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-preview {
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.3s ease;
}

.logo-preview img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo-preview.logo-circle {
  border-radius: 50%;
  border-style: solid;
  border-color: var(--accent);
}

.logo-preview.logo-circle img {
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.logo-preview.logo-rounded {
  border-radius: 20px;
  border-style: solid;
  border-color: var(--accent);
}

.logo-preview.logo-rounded img {
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.logo-preview.logo-none {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.15);
}

.logo-preview.logo-none img {
  border: none;
  border-radius: 0;
}

.logo-upload-controls {
  display: flex;
  flex-direction: column;
}

.input-file {
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.input-file:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.input-file::file-selector-button {
  padding: 8px 16px;
  margin-right: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 8px;
  color: #0a0a12;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.input-file::file-selector-button:hover {
  transform: scale(1.02);
}

/* Logo Shape Select */
.logo-shape-select {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.shape-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.shape-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.shape-option input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.shape-preview {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.shape-preview.shape-none {
  border-radius: 4px;
  border-style: dashed;
}

.shape-preview.shape-circle {
  border-radius: 50%;
}

.shape-preview.shape-rounded {
  border-radius: 10px;
}

.shape-option input:checked~.shape-preview {
  border-color: var(--accent);
  background: rgba(0, 245, 212, 0.15);
  box-shadow: 0 0 15px rgba(0, 245, 212, 0.3);
}

.shape-option span:last-child {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.shape-option input:checked~span:last-child {
  color: var(--accent);
}

/* Range Input */
.input-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  margin: 8px 0;
}

.input-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.input-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.input-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

/* Save Button - большая красивая кнопка сохранения */
.btn-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  color: #0a0a12;
  background: linear-gradient(135deg, var(--accent), #00d4aa);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow:
    0 4px 15px rgba(0, 245, 212, 0.4),
    0 0 0 0 rgba(0, 245, 212, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-save::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.btn-save:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 8px 25px rgba(0, 245, 212, 0.5),
    0 0 0 4px rgba(0, 245, 212, 0.15);
}

.btn-save:hover::before {
  transform: translateX(100%);
}

.btn-save:active {
  transform: translateY(-1px) scale(0.98);
}

.btn-save svg {
  flex-shrink: 0;
}

/* Edit Accordion */
.edit-accordion {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
}

.edit-accordion:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.edit-accordion.open {
  border-color: rgba(0, 245, 212, 0.3);
  background: rgba(0, 245, 212, 0.03);
}

.edit-accordion-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.edit-accordion-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.edit-accordion-icon {
  font-size: 18px;
}

.edit-accordion-title {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.edit-accordion-arrow {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease;
}

.edit-accordion.open .edit-accordion-arrow {
  transform: rotate(180deg);
  color: var(--accent);
}

.edit-accordion-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 16px;
  transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
}

.edit-accordion.open .edit-accordion-content {
  max-height: 2000px;
  opacity: 1;
  padding: 16px;
}

/* Edit Save Row */
.edit-save-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
}

/* Update edit-toggles for accordion */
.edit-accordion .edit-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 0;
}

/* ===== Task 3: Mobile edit form optimizations ===== */
@media (max-width: 640px) {
  /* 1-column grid on small screens */
  .edit-grid {
    grid-template-columns: 1fr;
  }
  .edit-col-wide {
    grid-column: span 1;
  }

  /* Larger touch targets for accordion headers */
  .edit-accordion-header {
    padding: 18px 16px;
    min-height: 56px;
  }

  /* Stack color row vertically */
  .color-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .color-row input[type="color"] {
    width: 100%;
    height: 44px;
  }

  /* Prevent iOS Safari zoom on input focus */
  .input, .edit-form input[type="text"],
  .edit-form input[type="url"],
  .edit-form input[type="number"],
  .edit-form select,
  .edit-form textarea {
    font-size: 16px !important;
  }

  /* Sticky save button */
  .edit-save-row {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: rgba(13, 13, 25, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin: 0 -16px -16px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: stretch;
  }
  .edit-save-row .btn-save {
    width: 100%;
    justify-content: center;
  }
}

/* ===== Task 4: Landing list responsive redesign ===== */

/* Desktop: merge source columns, improve visual hierarchy */
.table th .th-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile card list hidden by default (desktop) */
.landing-cards {
  display: none;
}

/* On mobile — card-based view instead of table */
@media (max-width: 768px) {
  .table-wrap .table {
    display: none;
  }

  /* Landing card list */
  .landing-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .landing-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s ease;
  }

  .landing-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
  }

  .landing-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .landing-card-slug {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .landing-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .landing-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 0;
  }

  .landing-card-stat {
    padding: 10px 12px;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .landing-card-stat:nth-child(3n) {
    border-right: none;
  }

  .landing-card-stat:nth-last-child(-n+3) {
    border-bottom: none;
  }

  .landing-card-stat-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
  }

  .landing-card-stat-lbl {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .landing-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
  }

  .landing-card-footer .btn {
    flex: 1;
    min-width: 80px;
    text-align: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
  }

  .landing-card-footer form {
    flex: 1;
    min-width: 80px;
  }
  .landing-card-footer form .btn {
    width: 100%;
  }

  /* Edit row inside card */
  .landing-card .edit-row-content {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px;
    display: none;
  }
  .landing-card .edit-row-content.open {
    display: block;
  }

  /* Share links row */
  .landing-card-share {
    display: flex;
    gap: 6px;
    padding: 0 16px 10px;
    flex-wrap: wrap;
  }
  .landing-card-share .btn {
    flex: 1;
    min-width: 60px;
    justify-content: center;
    font-size: 11px;
    padding: 6px 8px;
  }

  /* Edit panel inside mobile card */
  .landing-card-edit-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px;
  }
}
