/* Светло-серый UI */
:root {
  --bg-soft: #ebecee;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.92);
  --text: #2c3340;
  --text-muted: #5c6b7a;
  --text-subtle: #8b96a3;
  --border: rgba(100, 130, 160, 0.12);
  --border-hover: rgba(100, 130, 160, 0.2);
  --accent: #4a6fa5;
  --accent-hover: #3d5d8a;
  --accent-glow: rgba(74, 111, 165, 0.1);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 3px rgba(80, 110, 150, 0.06);
  --shadow: 0 4px 14px -2px rgba(80, 110, 150, 0.08), 0 12px 28px -6px rgba(80, 110, 130, 0.07);
  --shadow-hover: 0 8px 22px -4px rgba(80, 110, 150, 0.12), 0 18px 36px -10px rgba(80, 110, 130, 0.1);
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Syne", var(--font-sans);
  --font-hand: "Syne", var(--font-sans);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --stack-gap: clamp(1.25rem, 3vw, 1.75rem);
  --card-pad: clamp(0.95rem, 2vw, 1.25rem);
}

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

html {
  scroll-behavior: smooth;
}

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

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

}

/* Ровный светло-серый фон, без полос и текстур */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
}

.site-header,
main {
  position: relative;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.18s var(--ease-out);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wrap {
  width: min(880px, 100% - 2rem);
  margin-inline: auto;
}

@media (min-width: 640px) {
  .wrap {
    width: min(880px, 100% - 3rem);
  }
}

/* Header / hero */
.site-header {
  padding: clamp(1rem, 2.5vw, 1.5rem) 0 clamp(1.15rem, 3vw, 1.65rem);
  position: relative;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
  opacity: 0.85;
  pointer-events: none;
}

/* Шапка: слева колонка (герой + карточка «Сейчас пользователей»), справа трафик — одна высота */
.header-split {
  display: grid;
  gap: var(--stack-gap);
  align-items: stretch;
}

@media (min-width: 768px) {
  .header-split {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

.header-split__left {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

@media (min-width: 768px) {
  .header-split__left {
    min-height: 0;
    height: 100%;
  }
}

.traffic-section--aside {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255, 254, 250, 0.98);
  border: 1px solid rgba(180, 195, 215, 0.3);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow-xs);
}

.traffic-section--aside .section-title {
  font-size: clamp(0.95rem, 1.7vw, 1.1rem);
  margin: 0 0 0.45rem;
  gap: 0.35rem;
}

.traffic-section--aside .section-title::before {
  width: 3px;
  height: 0.95em;
  border-radius: 4px;
}

.traffic-flow--aside.traffic-flow--chips {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0.35rem;
  margin: 0 0 0.45rem;
  width: 100%;
  min-width: 0;
}

.traffic-flow--chips .traffic-node--chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  min-width: 0;
  width: 100%;
  min-height: 100%;
  padding: 0.56rem 0.45rem;
  border-radius: 16px;
  box-sizing: border-box;
}

.traffic-flow--chips .traffic-node__label {
  font-size: 1rem;
  padding: 0.12rem 0.44rem;
  margin-bottom: 0;
  min-width: 0;
}

.traffic-flow--chips .traffic-node__title {
  font-size: clamp(0.75rem, 2.2vw, 1.3rem);
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  text-align: center;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.traffic-flow--chips .traffic-arrow {
  width: auto;
  align-self: center;
  transform: none;
  padding: 0;
  font-size: 1.3rem;
  opacity: 0.65;
}

.traffic-section--aside .traffic-footnote {
  font-size: 0.72rem;
  line-height: 1.35;
  padding-left: 0;
  margin-top: auto;
}

.hero-shell {
  position: relative;
  padding: clamp(1.1rem, 2.5vw, 1.5rem) clamp(1.1rem, 3vw, 1.65rem);
  border-radius: var(--radius-lg);
  background: #fffef9;
  border: 1px solid rgba(180, 195, 215, 0.35);
  box-shadow: var(--shadow-xs), 0 2px 0 rgba(255, 255, 255, 0.8) inset;
  overflow: hidden;
  box-sizing: border-box;
  flex: 0 0 auto;
}

@media (min-width: 768px) {
  .hero-shell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 0;
  }
}

.hero-side-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: clamp(0.85rem, 2vw, 1.15rem) clamp(1.05rem, 2.5vw, 1.4rem);
  border-radius: var(--radius-lg);
  background: #fffef9;
  border: 1px solid rgba(180, 195, 215, 0.35);
  box-shadow: var(--shadow-xs), 0 2px 0 rgba(255, 255, 255, 0.8) inset;
  box-sizing: border-box;
  min-height: 0;
}

@media (min-width: 768px) {
  .hero-side-card {
    flex: 1 1 auto;
    min-height: 0;
  }
}

.hero-side-card__row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}

.hero-side-card__main {
  flex: 1 1 auto;
  min-width: 0;
}

.hero-side-card__hint {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--text-subtle);
  font-weight: 500;
  max-width: 42ch;
}

.hero-side-card__hint .mono {
  font-size: 0.62rem;
}

.hero-side-card__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(0.92rem, 1.6vw, 1.05rem);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
}

.hero-side-card__metric-name {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.88em;
}

.hero-side-card__count {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: var(--accent);
  letter-spacing: -0.03em;
}

.hero-side-card__row .btn--hero-stats {
  flex-shrink: 0;
}

.hero-shell::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: min(55%, 280px);
  height: 90px;
  background: radial-gradient(ellipse at 100% 0%, rgba(147, 180, 220, 0.12), transparent 72%);
  pointer-events: none;
}

.hero-title {
  position: relative;
  margin: 0 0 0.4rem;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(1.65rem, 4.5vw, 2.35rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--text);
}

.hero-lead {
  position: relative;
  margin: 0;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  font-weight: 500;
  color: var(--text-muted);
  max-width: 36ch;
}

.btn--hero-stats {
  font-size: 0.8125rem;
  padding: 0.42rem 1rem;
  font-weight: 600;
}

.hero-hint {
  position: relative;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-subtle);
  line-height: 1.45;
}

.hero-hint + .hero-hint {
  margin-top: 0.25rem;
}

.hero-hint a {
  font-weight: 600;
}

/* Main stack */
.main-stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
}

main {
  flex: 1 0 auto;
  padding: 0 0 clamp(1.75rem, 4vw, 2.75rem);
}

.data-source-section {
  padding: clamp(1.25rem, 3vw, 2rem) 0 clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid rgba(180, 195, 215, 0.22);
  background: rgba(248, 250, 253, 0.65);
}

.data-source-section__body {
  max-width: 65ch;
}

.data-source-section__body p {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
  line-height: 1.58;
  color: var(--text-muted);
}

.data-source-section__body p:last-child {
  margin-bottom: 0;
}

.data-source-updated {
  margin-top: 0.35rem !important;
  font-size: 0.8125rem !important;
  color: var(--text-subtle) !important;
}

.stats-data-about {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(180, 195, 215, 0.25);
  max-width: 65ch;
}

.stats-data-about__text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.58;
  color: var(--text-muted);
}

.footer-meta {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.site-footer {
  flex-shrink: 0;
  padding: 1.1rem 0 1.6rem;
  border-top: 1px solid rgba(180, 195, 215, 0.28);
  background: transparent;
}

.site-footer .meta-updated {
  text-align: center;
  margin-inline: auto;
  max-width: 42ch;
}

.section-title {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.65rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 6px;
  background: linear-gradient(180deg, #f472b6 0%, #60a5fa 50%, #93c5fd 100%);
  flex-shrink: 0;
  opacity: 0.85;
}


.traffic-section {
  margin: 0;
}

.traffic-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.55rem;
  margin: 0 0 0.65rem;
}

.traffic-node {
  flex: 1 1 140px;
  position: relative;
  background: rgba(255, 254, 250, 0.98);
  border: 1px solid rgba(180, 195, 215, 0.3);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  box-shadow: var(--shadow-xs);
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out), border-color 0.22s var(--ease-out);
}

.traffic-node:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-hover);
}

.traffic-node__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: rgba(241, 245, 249, 0.9);
  border-radius: 6px;
  margin-bottom: 0.35rem;
}

.traffic-node__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.3rem;
  letter-spacing: -0.02em;
}

.traffic-node p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.traffic-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  font-size: 1.1rem;
  font-weight: 300;
  flex: 0 0 auto;
  padding: 0 0.2rem;
  opacity: 0.85;
}

.traffic-footnote {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.45;
  padding-left: 0.1rem;
}

.intro {
  margin: 0;
}

.intro-card {
  background: rgba(255, 254, 248, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(180, 195, 215, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.intro-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.intro-card p {
  margin: 0 0 0.6rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.intro-card p:last-child {
  margin-bottom: 0;
}

.intro-card ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.intro-card li {
  margin-bottom: 0.35rem;
  padding-left: 0.1rem;
}

.intro-card li:last-child {
  margin-bottom: 0;
}

.connection-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.connection-steps li {
  margin-bottom: 0.35rem;
}

.connection-steps li:last-child {
  margin-bottom: 0;
}

.connect-block + .connect-block {
  margin-top: 0.85rem;
}

.connect-mode-label {
  margin: 0 0 0.4rem;
  color: var(--text);
  font-size: 0.875rem;
}

.callout {
  margin-top: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(241, 245, 249, 0.55);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.callout--below-intro {
  margin-top: 0.85rem;
  margin-bottom: 0;
}

/* Notice banner */
.banner-notice {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  border-radius: var(--radius);
  border: 1px dashed var(--border-hover);
  background: rgba(255, 255, 255, 0.55);
}

.meta-updated {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-subtle);
  font-weight: 500;
}

/* Proxy grid */
.proxy-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 560px) {
  .proxy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.proxy-card {
  position: relative;
  background: #fffef9;
  border: 1px solid rgba(180, 195, 215, 0.35);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  box-shadow: var(--shadow-xs);
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out), border-color 0.22s var(--ease-out);
}

.proxy-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), transparent 40%, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

.proxy-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.proxy-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.proxy-card__name {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.45rem;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge--ok {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: #475569;
}

.field {
  font-size: 0.8125rem;
}

.field label {
  display: block;
  color: var(--text-subtle);
  margin-bottom: 0.25rem;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--text);
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(180, 195, 215, 0.35);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.2rem;
}

.proxy-card .actions {
  flex-wrap: nowrap;
  gap: 0.35rem;
}

.proxy-card .actions .btn {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.68rem;
  padding: 0.38rem 0.32rem;
  line-height: 1.25;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring), background 0.18s var(--ease-out), border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}

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

.btn--primary {
  background: linear-gradient(180deg, #5a7eb8 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(74, 111, 165, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn--primary:hover {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
  box-shadow: 0 4px 16px rgba(74, 111, 165, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.65);
  border-color: var(--border);
  color: var(--text);
  backdrop-filter: blur(8px);
}

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

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

a.btn:hover {
  text-decoration: none;
  color: inherit;
}

a.btn.btn--primary:hover {
  color: #fff;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 1.5rem 1.1rem;
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* Страница статистики */
.stats-page-header {
  padding-bottom: 0.5rem;
}

.stats-page-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stats-back-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  align-self: flex-start;
}

.stats-back-link:hover {
  color: var(--accent-hover);
}

.stats-page-title {
  font-family: var(--font-hand);
  font-weight: 800;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--text);
}

.stats-page-lead {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.stats-main {
  padding: 0 0 clamp(2rem, 4vw, 3rem);
}

.stats-status {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.stats-updated {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--text-subtle);
}

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

@media (min-width: 720px) {
  .stats-charts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .stats-charts {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stats-chart-card {
  background: #fffef9;
  border: 1px solid rgba(180, 195, 215, 0.35);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.stats-chart-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.stats-chart-card__name {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.02em;
}

.stats-chart-card__ext {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  color: var(--text);
}

.stats-chart-card__ext-num {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--accent);
}

.stats-chart-card__live {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.stats-chart-card__live-num {
  color: var(--text);
  font-size: 1rem;
}

.stats-chart-card__err {
  margin: 0;
  font-size: 0.75rem;
  color: #b45309;
}

.stats-chart-card__stale {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.stats-chart-wrap {
  position: relative;
  height: 220px;
  width: 100%;
}

.stats-chart-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
