/* ===== Логотип ===== */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; white-space: nowrap; flex: none; }
.logo-mark { width: 40px; height: 40px; flex: none; display: block; }
.logo-text { font-size: 22px; font-weight: 300; letter-spacing: .34em; line-height: 1; margin-right: -.34em; }
.logo-tag {
  font-size: 10px; font-weight: 800; letter-spacing: .16em; padding: 4px 8px; border-radius: 7px;
  background: var(--primary-soft); color: var(--primary-soft-text);
}
.logo-light { color: #fff; }
.logo-light .logo-tag { background: rgba(255, 255, 255, .16); color: #fff; }
@media (max-width: 640px) { .logo-text { font-size: 20px; } .logo-mark { width: 36px; height: 36px; } .logo-tag { display: none; } }

.main:focus { outline: none; }

/* ===== Общие блоки страниц ===== */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.toolbar .grow { flex: 1 1 280px; min-width: 220px; }
.toolbar .fixed { flex: 0 1 280px; min-width: 200px; }
.filters-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.filters-grid.second { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: center; margin-bottom: 24px; }
.filters-reset { padding: 0 8px; white-space: nowrap; }
.period-select { min-width: 230px; background: var(--bg-soft); }

.section + .section { margin-top: 28px; }
.section-title { font-size: 22px; font-weight: 750; letter-spacing: -.01em; margin-bottom: 14px; }

/* ===== Дашборд ===== */
.chart-card { margin-top: 16px; }
.chart-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.chart { position: relative; width: 100%; }
.chart-svg { display: block; width: 100%; overflow: visible; }
.chart-grid line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-axis text { fill: var(--text-3); font-size: 13px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-cross { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.chart-dot { stroke: var(--bg-elev); stroke-width: 2.5; }
.chart-tip {
  position: absolute; z-index: 5; min-width: 200px; pointer-events: none;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 10px 14px; font-size: 14px;
}
.chart-tip-title { font-weight: 700; margin-bottom: 6px; }
.chart-tip-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.chart-tip-name { flex: 1; color: var(--text-2); }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.dash-grid .span-2 { grid-column: 1 / -1; }

.dash-grid > .card { display: flex; flex-direction: column; }
.dash-grid > .card > .funnel { flex: 1; }
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-summary { margin-top: auto; padding-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.funnel-summary > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 14px; font-size: 13.5px; color: var(--text-2); }
.funnel-summary b { font-size: 20px; color: var(--text); letter-spacing: -.01em; }
.funnel-step {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-radius: 14px; background: var(--bg-soft);
}
.funnel-step::before {
  content: ''; position: absolute; inset: 0; z-index: -1; width: var(--w, 100%);
  background: color-mix(in srgb, var(--c, var(--primary)) 22%, transparent); border-radius: 14px;
  transition: width .7s var(--ease);
}
.funnel-name { font-weight: 600; }
.funnel-val { font-weight: 750; font-size: 18px; }
.funnel-conv { display: flex; align-items: center; gap: 6px; padding: 0 8px; color: var(--text-3); font-size: 13px; font-weight: 650; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.feed-item:first-child { border-top: 0; padding-top: 0; }
.feed-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--bg-soft); color: var(--text-2); }
.feed-ic.reg { background: var(--info-soft); color: var(--info); }
.feed-ic.purchase { background: var(--success-soft); color: var(--success); }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-weight: 650; font-size: 15.5px; }
.feed-sub { color: var(--text-3); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-amount { font-weight: 750; color: var(--success); white-space: nowrap; }

.toplist { display: flex; flex-direction: column; }
.toprow {
  display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(52px, .55fr)) minmax(110px, .9fr);
  gap: 12px; align-items: center; padding: 13px 0; border-top: 1px solid var(--border); color: var(--text);
}
a.toprow:hover { text-decoration: none; background: var(--bg-soft); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 12px; border-top-color: transparent; }
.toprow-head { border-top: 0; padding-top: 0; color: var(--text-3); font-size: 13px; }
.toprow .num { text-align: right; }
.toprow-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.toprow-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.toprow-name small { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; }
.toprow-rev { position: relative; font-weight: 700; }
.toprow-rev i { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--brand-gradient); width: var(--w, 0); margin-left: auto; opacity: .9; }

.level { display: flex; flex-direction: column; gap: 18px; }
.level-head { display: flex; align-items: center; gap: 16px; }
.level-moon { width: 60px; height: 60px; border-radius: 19px; background: var(--brand-gradient); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 32%, transparent); flex: none; }
.level-name { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.level-progress-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 15px; }
.level-hint { margin-top: 10px; font-size: 14px; }
.level-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.level-step { display: flex; flex-direction: column; gap: 1px; padding: 12px 14px; border-radius: 14px; background: var(--bg-soft); font-size: 13.5px; color: var(--text-2); }
.level-step b { font-size: 20px; color: var(--text); }
.level-step small { color: var(--text-3); }
.level-step.on { background: var(--primary-soft); color: var(--primary-soft-text); }
.level-step.on b { color: var(--primary-soft-text); }

.calc { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.calc-inputs { display: flex; flex-direction: column; gap: 26px; justify-content: center; }
.calc-row-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.calc-row-head b { font-size: 21px; }
.calc-note { font-size: 13.5px; line-height: 1.55; }
.calc-result {
  position: relative; overflow: hidden; border-radius: 22px; padding: 26px; color: #fff;
  background: var(--brand-gradient); display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
}
.calc-cap { color: rgba(255, 255, 255, .82); font-size: 15px; margin-bottom: 8px; }
.calc-big { font-size: clamp(34px, 4.4vw, 54px); font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.calc-lines { display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.calc-lines > div { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .2); font-size: 15px; }
.calc-lines span { color: rgba(255, 255, 255, .82); }
.calc-moon { position: absolute; right: -26px; bottom: -34px; color: rgba(255, 255, 255, .12); pointer-events: none; width: 190px; height: 190px; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-grid.second { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .chart-filters { grid-template-columns: minmax(0, 1fr); }
  .toprow { grid-template-columns: minmax(0, 1.6fr) minmax(70px, .8fr); }
  .toprow > .num:not(.toprow-rev) { display: none; }
  .level-steps { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px; }
  .filters-grid, .filters-grid.second { grid-template-columns: minmax(0, 1fr); }
  .period-select { min-width: 0; width: 100%; }
}
