:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --panel-soft: #f2f5fb;
  --text: #0b0f1a;
  --muted: #5a667f;
  --accent: #31a6ff;
  --accent-2: #ffd34d;
  --border: #e3e8f2;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

.is-hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body[data-auth-pending="1"] .container,
body[data-auth-pending="1"] .side-menu,
body[data-auth-pending="1"] .menu-toggle-global,
body[data-auth-pending="1"] .bg {
  visibility: hidden;
}

.menu-toggle-global {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(227, 232, 242, 0.95);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 1;
  color: var(--text);
  flex: 0 0 auto;
}

.menu-toggle-global:hover {
  filter: none;
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
}

.burger {
  width: 18px;
  height: 14px;
  display: grid;
  grid-template-rows: repeat(3, 2px);
  gap: 4px;
  align-items: center;
}

.burger > span {
  width: 18px;
  height: 2px;
  background: rgba(11, 15, 26, 0.72);
  border-radius: 999px;
  transition: transform 0.16s ease, opacity 0.16s ease, width 0.16s ease;
}

/* Burger -> X when menu is open */
.menu-toggle-global.open .burger > span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle-global.open .burger > span:nth-child(2) {
  opacity: 0;
  width: 0;
}

.menu-toggle-global.open .burger > span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 26, 0.34);
  z-index: 900;
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: min(210px, 84vw);
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid rgba(227, 232, 242, 0.95);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  padding: 16px 14px 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(-102%);
  transition: transform 0.2s ease;
  z-index: 950;
}

.side-menu.open {
  transform: translateX(0);
}

.side-menu-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0 0 14px;
}

.side-menu-title {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(90, 102, 127, 0.9);
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  margin: 0 0 8px;
  border-radius: 12px;
  border: 1px solid rgba(49, 166, 255, 0.14);
  background: rgba(49, 166, 255, 0.07);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  text-align: left;
}

.side-link:hover {
  background: rgba(49, 166, 255, 0.12);
}

.bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 15%, rgba(49, 166, 255, 0.18) 0%, transparent 50%),
              radial-gradient(circle at 85% 0%, rgba(255, 211, 77, 0.2) 0%, transparent 45%),
              linear-gradient(120deg, #ffffff 0%, #f0f5ff 60%, #ffffff 100%);
  opacity: 1;
  pointer-events: none;
}

.auth-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 8% 20%, rgba(49, 166, 255, 0.35) 0%, transparent 32%),
              radial-gradient(circle at 82% 8%, rgba(255, 211, 77, 0.35) 0%, transparent 28%),
              radial-gradient(circle at 75% 78%, rgba(49, 166, 255, 0.2) 0%, transparent 30%),
              linear-gradient(145deg, rgba(255, 255, 255, 0.94) 0%, rgba(241, 246, 255, 0.98) 100%);
  z-index: 0;
}

.auth-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image: radial-gradient(circle, rgba(11, 15, 26, 0.28) 0.6px, transparent 0.7px);
  background-size: 28px 28px;
  z-index: 0;
}

.auth-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(49, 166, 255, 0.32);
  z-index: 0;
  pointer-events: none;
  animation: orbitSpin 24s linear infinite;
}

.auth-orbit-a {
  width: 540px;
  height: 540px;
}

.auth-orbit-b {
  width: 710px;
  height: 710px;
  border-color: rgba(255, 211, 77, 0.28);
  animation-duration: 35s;
  animation-direction: reverse;
}

.auth-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.auth-glow-a {
  left: 10%;
  top: 20%;
  background: rgba(49, 166, 255, 0.45);
}

.auth-glow-b {
  right: 10%;
  bottom: 14%;
  background: rgba(255, 211, 77, 0.35);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  border-radius: 20px;
  padding: 30px 28px 24px;
  border: 1px solid rgba(227, 232, 242, 0.95);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 28px 56px rgba(15, 23, 42, 0.16);
}

.auth-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-size: 11px;
}

.auth-card h2 {
  margin: 0 0 8px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: clamp(24px, 4vw, 30px);
}

.auth-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.auth-field input {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font: inherit;
}

.auth-field input:focus {
  outline: 2px solid rgba(49, 166, 255, 0.35);
  outline-offset: 0;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  width: 100%;
  padding-right: 100px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  box-shadow: none;
}

.password-toggle:hover {
  background: #f4f7ff;
  color: var(--text);
  filter: none;
}

.auth-error {
  margin: 10px 0 0;
  min-height: 19px;
  color: #b42318;
  font-size: 13px;
}

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

.container {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.header {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 220;
  background: var(--bg);
  backdrop-filter: none;
  border: 1px solid rgba(227, 232, 242, 0.9);
  border-radius: 16px;
  padding: 14px 14px 12px;
  margin-bottom: 28px;
}

.page-vadim .header {
  position: static;
  top: auto;
}

.header-left {
  flex: 1 1 auto;
  min-width: 240px;
}

.eyebrow {
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  margin-bottom: 8px;
}

.eyebrow-link {
  color: inherit;
  text-decoration: none;
}

.eyebrow-link:hover {
  text-decoration: underline;
}

h1 {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 36px;
  margin: 0 0 6px;
}

.sub {
  color: var(--muted);
  margin: 0;
}

.filters {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filters.filters-with-shortcuts {
  display: grid;
  grid-template-columns: max-content max-content max-content max-content max-content;
  grid-template-areas:
    "segment from to apply logout"
    ". shortcuts shortcuts log .";
  column-gap: 6px;
  row-gap: 8px;
  align-items: end;
  justify-content: end;
}

.filters-segment {
  grid-area: segment;
}

.filters-from {
  grid-area: from;
}

.filters-to {
  grid-area: to;
}

.filters-apply {
  grid-area: apply;
  justify-self: center;
}

.filters-logout {
  grid-area: logout;
}

.filters-date-shortcuts {
  grid-area: shortcuts;
  justify-self: stretch;
  align-self: start;
  padding-left: 8px;
}

.filters-log-link {
  grid-area: log;
  justify-self: center;
  align-self: start;
}

.date-shortcuts {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filters .date-shortcut-btn {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  color: rgba(90, 102, 127, 0.88);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.filters .date-shortcut-btn:hover {
  color: rgba(90, 102, 127, 1);
}

.filters-log-link {
  font-size: 10px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  color: var(--text);
  opacity: 1;
}

.segment-switch {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  position: relative;
}

.retention-wrap {
  position: relative;
  display: inline-flex;
}

.retention-btn {
  padding: 5px 8px;
}

.retention-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(227, 232, 242, 0.95);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  padding: 10px;
  z-index: 2300;
}

.retention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: rgba(11, 15, 26, 0.86);
  cursor: pointer;
  user-select: none;
}

.retention-item:hover {
  background: rgba(49, 166, 255, 0.08);
}

.retention-item input {
  width: 16px;
  height: 16px;
}

.header-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.apply-stack {
  position: relative;
  display: flex;
  align-items: flex-end;
}

.log-link {
  font-size: 12px;
  color: rgba(90, 102, 127, 0.7);
  text-decoration: none;
}

.log-link:hover {
  color: rgba(90, 102, 127, 1);
}

.log-link.log-under {
  font-size: 10px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  opacity: 0.7;
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  flex: 0 1 auto;
}

.filters input[type="date"] {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 6px;
  border-radius: 8px;
  width: 112px;
  font-size: 12px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.filters button {
  padding: 6px 8px;
  font-size: 11px;
}

@media (min-width: 981px) {
  .filters {
    flex-wrap: nowrap;
  }

  .filters label {
    flex: 0 1 auto;
    min-width: 0;
  }

  .apply-stack {
    flex: 0 0 auto;
  }

  .ghost-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 980px) {
  .header {
    flex-wrap: wrap;
    position: static;
    top: auto;
  }

  .filters.filters-with-shortcuts {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-end;
  }

  .date-shortcuts {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
  }

  .filters-date-shortcuts {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .filters-log-link {
    flex-basis: 100%;
    text-align: right;
  }

  .header-left {
    min-width: 0;
  }

  .filters input[type="date"] {
    width: auto;
  }
}

button {
  background: var(--accent);
  color: #0b0f1a;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
}

button:hover {
  filter: brightness(1.05);
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: none;
}

.ghost-btn:hover {
  color: var(--text);
  background: rgba(49, 166, 255, 0.08);
  filter: none;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(11, 15, 26, 0.2);
  border-top-color: #0b0f1a;
  display: none;
  animation: spin 0.8s linear infinite;
}

button.loading .spinner {
  display: inline-block;
}

button.loading .btn-text {
  opacity: 0.7;
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.seg-btn {
  background: rgba(49, 166, 255, 0.12);
  color: rgba(11, 15, 26, 0.82);
  border: 1px solid rgba(49, 166, 255, 0.18);
  box-shadow: none;
  padding: 5px 8px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 11px;
}

.seg-btn:hover {
  color: var(--text);
  background: rgba(49, 166, 255, 0.16);
  filter: none;
}

.seg-btn.active {
  background: #0b2b5e;
  color: #ffffff;
  border-color: rgba(11, 43, 94, 0.4);
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.kpi-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.kpi-value {
  font-size: 24px;
  font-weight: 600;
  white-space: nowrap;
}

.kpi-value.is-editable {
  cursor: text;
  border-bottom: 1px dashed rgba(49, 166, 255, 0.45);
  display: inline-block;
}

.kpi-edit-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(49, 166, 255, 0.45);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  padding: 3px 6px;
}

.kpi-edit-input:focus {
  outline: 2px solid rgba(49, 166, 255, 0.25);
  outline-offset: 0;
}

.campaign-kpi-grid {
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  grid-template-columns: none;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.campaign-kpi-grid .kpi-card {
  min-width: 120px;
  padding: 12px 10px;
  border-radius: 12px;
}

.campaign-kpi-grid .kpi-label {
  font-size: 10px;
  margin-bottom: 6px;
  letter-spacing: 0.09em;
}

.campaign-kpi-grid .kpi-value {
  font-size: 18px;
}

.campaign-rate-editable {
  cursor: text;
  border-bottom: 1px dashed rgba(49, 166, 255, 0.45);
  display: inline-block;
}

.campaign-rates-table .kpi-edit-input {
  max-width: 120px;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 4px;
  text-align: right;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.panel:last-of-type {
  margin-bottom: 0;
}

.private-bootstrap-error {
  max-width: 560px;
  margin: 72px auto 0;
  text-align: center;
}

.private-bootstrap-error h2 {
  margin: 0 0 10px;
  font-size: 26px;
}

.private-bootstrap-error .panel-note {
  max-width: 420px;
  margin: 0 auto 18px;
}

.private-bootstrap-error-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bar-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: end;
  gap: 6px;
  height: 200px;
  padding: 24px 6px 10px;
  overflow: hidden;
}

.bar-item {
  display: grid;
  grid-template-rows: 1fr 20px;
  align-items: end;
  justify-items: center;
  height: 100%;
  gap: 6px;
}

.bar-slot {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
}

.bar {
  flex: 0 0 auto;
  min-width: 0;
  background: var(--accent);
  border-radius: 8px 8px 4px 4px;
  position: relative;
  width: 100%;
}

.bar.bar-total {
  background: #6b7280;
  border: 1px solid rgba(75, 85, 99, 0.45);
}

.bar-label {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  max-width: 56px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
  height: 20px;
  display: flex;
  align-items: center;
}

.bar-label.bar-label-total {
  color: #4b5563;
  font-weight: 700;
}

.bar-label.hidden {
  visibility: hidden;
}

.bar-label.small {
  font-size: 10px;
}

.bar-label.rotate {
  transform: none;
  transform-origin: center;
}

.bar-value {
  position: absolute;
  top: 6px;
  width: 100%;
  text-align: center;
  font-size: 10px;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.bar-value.hidden {
  display: none;
}

.bar.short .bar-value {
  top: -18px;
  color: var(--text);
  text-shadow: none;
}

.bar-chart.channels .bar-label {
  max-width: 96px;
}

@media (max-width: 720px) {
  .side-menu {
    width: min(300px, 84vw);
  }

  .auth-orbit-a {
    width: 360px;
    height: 360px;
  }

  .auth-orbit-b {
    width: 500px;
    height: 500px;
  }

  .auth-card {
    padding: 24px 18px 18px;
  }

  .bar-chart {
    height: 160px;
    padding: 22px 4px 8px;
  }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.chart-group-switch {
  align-items: center;
}

.chart-group-switch .seg-btn {
  padding: 4px 10px;
}

.log-tabs {
  margin-bottom: 16px;
}

.panel-header h2 {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 20px;
  margin: 0;
}

.panel-collapse-toggle {
  border: 1px solid rgba(49, 166, 255, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: #344058;
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.panel-collapse-toggle:hover {
  background: #f4f7ff;
  border-color: rgba(49, 166, 255, 0.4);
}

.panel-collapse-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(49, 166, 255, 0.18);
}

.panel-collapse-toggle.is-collapsed {
  color: var(--muted);
  background: rgba(241, 244, 251, 0.95);
}

.panel-collapsible-body {
  display: grid;
  gap: 16px;
}

.panel-collapsible-body.is-collapsed {
  display: none !important;
}

.panel-collapsible-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.geo-source-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.geo-source-filter select {
  appearance: none;
  border: 1px solid rgba(49, 166, 255, 0.22);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  color: #1f2f46;
  font: inherit;
  font-size: 12px;
  padding: 5px 28px 5px 9px;
  min-width: 156px;
  background-image: linear-gradient(45deg, transparent 50%, #3f577e 50%),
    linear-gradient(135deg, #3f577e 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.geo-source-filter select:focus {
  outline: none;
  border-color: rgba(49, 166, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(49, 166, 255, 0.15);
}

.panel-note {
  color: var(--muted);
  font-size: 13px;
}

.panel-note.badge {
  background: #f1f4fb;
  color: #344058;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  max-width: 260px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1024px) {
  .panel-note.badge {
    max-width: 200px;
  }
}

@media (max-width: 768px) {
  .panel-note.badge {
    max-width: 160px;
  }
}

.chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.funnel-line-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.funnel-line-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.funnel-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.funnel-line-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(49, 166, 255, 0.2);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #33435f;
  cursor: pointer;
  transition: opacity 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.funnel-line-chip:hover {
  border-color: rgba(37, 99, 235, 0.45);
}

.funnel-line-chip.is-inactive {
  opacity: 0.42;
  border-color: rgba(100, 116, 139, 0.2);
  background: rgba(248, 250, 252, 0.92);
}

.funnel-line-chip-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.funnel-line-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.funnel-line-svg {
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(49, 166, 255, 0.18);
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.9) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.funnel-line-grid {
  stroke: rgba(100, 116, 139, 0.28);
  stroke-width: 1;
}

.funnel-line-y-label,
.funnel-line-x-label {
  font-size: 11px;
  fill: rgba(71, 85, 105, 0.9);
}

.funnel-line-x-label {
  dominant-baseline: middle;
}


.chart-row {
  display: grid;
  grid-template-columns: 180px 1fr 80px;
  gap: 10px;
  align-items: center;
}

.chart-label {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar {
  position: relative;
  background: #e9eef7;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.chart-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.chart-value {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .chart-row {
    grid-template-columns: 1fr;
  }

  .chart-value {
    text-align: left;
  }

  .funnel-line-chip {
    font-size: 11px;
    padding: 4px 8px;
  }

  .funnel-line-y-label,
  .funnel-line-x-label {
    font-size: 10px;
  }
}

.tooltip {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -120%);
  background: #0b0f1a;
  color: #ffffff;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 1000;
}

.tooltip.visible {
  opacity: 1;
}

.vadim-panel {
  padding: 22px;
}

.vadim-inner {
  width: 100%;
  max-width: 980px;
  margin: 0;
}

.vadim-hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  text-align: left;
}

.vadim-hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.vadim-media {
  flex: 0 0 auto;
  max-width: 442px;
}

.vadim-title {
  color: rgba(90, 102, 127, 0.95);
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vadim-line {
  line-height: 1.05;
  color: rgba(11, 15, 26, 0.82);
}

.vadim-first {
  font-weight: 800;
  font-size: calc(1em + 1px);
  color: rgba(11, 15, 26, 0.95);
}

.vadim-image {
  width: 100%;
  max-width: 442px;
  height: auto;
  align-self: flex-start;
  border-radius: 18px;
  border: 1px solid rgba(227, 232, 242, 0.95);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
}

.vadim-hello {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.vadim-help {
  flex: 1 1 280px;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 14px;
  color: rgba(11, 15, 26, 0.9);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(227, 232, 242, 0.95);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
  position: relative;
}

.vadim-help::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 22px;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.96);
  border-left: 1px solid rgba(227, 232, 242, 0.95);
  border-bottom: 1px solid rgba(227, 232, 242, 0.95);
  transform: rotate(45deg);
  border-bottom-left-radius: 3px;
}

.vadim-help-lead,
.vadim-help-foot {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(11, 15, 26, 0.82);
}

.vadim-help-head {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: none;
  color: rgba(11, 15, 26, 0.88);
}

.vadim-help-list {
  margin: 8px 0 10px 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(11, 15, 26, 0.84);
  list-style: none;
}

.vadim-help-list li {
  margin: 6px 0;
  padding-left: 14px;
  position: relative;
}

.vadim-help-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: rgba(11, 15, 26, 0.55);
}

.vadim-chat {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(227, 232, 242, 0.95);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vadim-answer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px;
}

.vadim-answer[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .vadim-hero-row {
    flex-direction: column;
    gap: 14px;
  }

  .vadim-help {
    max-width: none;
  }
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(227, 232, 242, 0.95);
  background: rgba(242, 245, 251, 0.85);
  min-height: 220px;
  max-height: 46vh;
  overflow: auto;
}

.chat-msg {
  width: fit-content;
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(227, 232, 242, 0.95);
  background: rgba(255, 255, 255, 0.95);
  color: rgba(11, 15, 26, 0.92);
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.chat-msg.user {
  align-self: flex-end;
  background: rgba(49, 166, 255, 0.14);
  border-color: rgba(49, 166, 255, 0.22);
}

.chat-msg.assistant {
  align-self: flex-start;
  background: rgba(255, 211, 77, 0.18);
  border-color: rgba(255, 211, 77, 0.28);
}

.chat-meta {
  font-size: 11px;
  color: rgba(90, 102, 127, 0.9);
  margin-top: 6px;
}

.chat-meta.top {
  margin-top: 0;
  margin-bottom: 6px;
}

.chat-text {
  white-space: pre-wrap;
}

.chat-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(227, 232, 242, 0.95);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.chat-input:focus {
  outline: 2px solid rgba(49, 166, 255, 0.35);
  outline-offset: 0;
}

.chat-send {
  padding: 10px 14px;
  font-size: 12px;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.funnel-table {
  --funnel-source-col-width: minmax(160px, 1fr);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.funnel-row {
  display: grid;
  grid-template-columns:
    var(--funnel-source-col-width)
    minmax(54px, 70px)
    minmax(72px, 90px)
    minmax(64px, 80px)
    minmax(64px, 80px)
    minmax(70px, 90px)
    minmax(88px, 118px)
    minmax(90px, 120px)
    minmax(70px, 90px);
  gap: 12px;
  padding: 12px 14px;
  align-items: center;
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 13px;
}

.funnel-row.funnel-head {
  background: transparent;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding-top: 4px;
  padding-bottom: 10px;
}

.funnel-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.funnel-sort-btn.align-right {
  justify-content: flex-end;
  text-align: right;
}

.funnel-sort-btn:hover {
  color: var(--text);
}

.funnel-sort-btn.is-active {
  color: var(--text);
  font-weight: 700;
}

.funnel-sort-arrow {
  min-width: 10px;
  font-size: 10px;
  line-height: 1;
}

.funnel-col {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.funnel-source {
  font-weight: 600;
}

.funnel-source-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.funnel-col-resize-handle {
  flex: 0 0 auto;
  align-self: stretch;
  width: 10px;
  margin-left: auto;
  border-radius: 999px;
  cursor: col-resize;
  position: relative;
  touch-action: none;
}

.funnel-col-resize-handle::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(90, 102, 127, 0.28);
  transition: background 0.15s ease;
}

.funnel-col-resize-handle:hover::before,
.funnel-col-resize-handle:active::before {
  background: rgba(49, 166, 255, 0.72);
}

body.is-column-resizing {
  cursor: col-resize;
  user-select: none;
}

.funnel-num {
  text-align: right;
}

.funnel-pct {
  color: rgba(90, 102, 127, 0.8);
  font-size: 11px;
  margin-left: 6px;
}

.funnel-row.funnel-total {
  background: rgba(49, 166, 255, 0.08);
  border: 1px solid rgba(49, 166, 255, 0.18);
  font-weight: 700;
}

.funnel-row.funnel-expandable {
  cursor: pointer;
}

.funnel-row.funnel-expandable:hover {
  background: rgba(49, 166, 255, 0.06);
}

.funnel-row.funnel-expandable.is-expanded {
  background: rgba(49, 166, 255, 0.08);
}

.funnel-caret {
  display: inline-block;
  width: 14px;
  margin-right: 6px;
  color: var(--muted);
}

.funnel-row.funnel-subrow {
  background: rgba(15, 23, 42, 0.03);
}

.funnel-row.funnel-subrow .funnel-source {
  padding-left: 18px;
}

.funnel-row.funnel-subrow.funnel-subrow-link {
  cursor: pointer;
}

.funnel-row.funnel-subrow.funnel-subrow-link:hover {
  background: rgba(49, 166, 255, 0.08);
}

.funnel-campaign-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.funnel-campaign-search-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.funnel-campaign-search-input {
  width: min(260px, 54vw);
  border: 1px solid rgba(49, 166, 255, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  padding: 6px 10px;
  font-size: 13px;
}

.funnel-campaign-search-input:focus {
  outline: 2px solid rgba(49, 166, 255, 0.3);
  border-color: rgba(49, 166, 255, 0.5);
}

.panel-toggle-btn {
  border: 1px solid rgba(49, 166, 255, 0.28);
  background: #eef5ff;
  color: #2b4c82;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  width: fit-content;
}

.panel-toggle-btn:hover {
  background: #e2eeff;
}

.funnel-table.invoice-table .funnel-row,
.funnel-table.invoice-table .funnel-row.funnel-head {
  grid-template-columns: minmax(140px, 1fr) 90px 140px;
}

.undefined-source-report {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.undefined-source-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.funnel-table.recovery-summary .funnel-row,
.funnel-table.recovery-summary .funnel-row.funnel-head {
  grid-template-columns: minmax(160px, 1fr) 100px 120px;
}

.funnel-table.campaign-rates-table .funnel-row,
.funnel-table.campaign-rates-table .funnel-row.funnel-head {
  grid-template-columns: minmax(180px, 1fr) 120px;
}

.trustpilot-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.trustpilot-kpi-updated {
  font-size: 15px;
  line-height: 1.2;
  white-space: normal;
}

.funnel-table.trustpilot-table .funnel-row,
.funnel-table.trustpilot-table .funnel-row.funnel-head {
  grid-template-columns: minmax(120px, 1fr) repeat(5, minmax(56px, 78px)) minmax(72px, 92px);
}

.trustpilot-star-5 {
  color: #0a8f3d;
}

.trustpilot-star-4 {
  color: #2b7abf;
}

.trustpilot-star-3 {
  color: #8b6a00;
}

.trustpilot-star-2 {
  color: #ba5c00;
}

.trustpilot-star-1 {
  color: #b42318;
}

.geo-toggle-row {
  background: rgba(49, 166, 255, 0.04);
}

.geo-toggle-btn {
  border: 1px solid rgba(49, 166, 255, 0.28);
  background: #eef5ff;
  color: #2b4c82;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.geo-toggle-btn:hover {
  background: #e2eeff;
}

.geo-hidden-row {
  opacity: 0.92;
}

@media (max-width: 720px) {
  .funnel-table {
    overflow-x: auto;
    gap: 6px;
  }

  .funnel-row,
  .funnel-row.funnel-head {
    min-width: 960px;
    grid-template-columns:
      var(--funnel-source-col-width)
      minmax(54px, 70px)
      minmax(72px, 90px)
      minmax(64px, 80px)
      minmax(64px, 80px)
      minmax(70px, 90px)
      minmax(88px, 118px)
      minmax(90px, 120px)
      minmax(70px, 90px);
    gap: 12px;
  }

  .funnel-num {
    text-align: right;
  }

  .funnel-sort-btn.align-right {
    justify-content: flex-end;
    text-align: right;
  }

  .funnel-table.trustpilot-table {
    overflow-x: auto;
    gap: 6px;
  }

  .funnel-table.trustpilot-table .funnel-row,
  .funnel-table.trustpilot-table .funnel-row.funnel-head {
    min-width: 640px;
    grid-template-columns: minmax(120px, 1fr) repeat(5, minmax(56px, 78px)) minmax(72px, 92px);
  }

  .funnel-table.trustpilot-table .funnel-num {
    text-align: right;
  }
}

.log-header,
.log-row {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 120px 120px 120px minmax(180px, 1fr);
  gap: 16px;
  padding: 12px 14px;
  align-items: center;
}

.log-header.log-grid-facebook,
.log-row.log-grid-facebook {
  grid-template-columns:
    minmax(180px, 220px)
    90px
    100px
    minmax(140px, 1fr)
    90px
    minmax(160px, 1fr)
    minmax(180px, 1.2fr);
}

.log-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding-top: 4px;
  padding-bottom: 10px;
}

.log-col {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-col-range {
  white-space: pre-line;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.35;
}

.log-head {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.log-row {
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 13px;
}

.log-ts {
  color: var(--muted);
}

.log-action {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 12px;
  color: var(--text);
}

.log-meta {
  color: var(--muted);
}

.log-col-rows {
  text-align: left;
}

.log-col-delta {
  text-align: left;
}

.log-delta-plus {
  color: #0f8f3d;
  font-weight: 600;
}

.log-delta-minus {
  color: #c62828;
  font-weight: 600;
}

.log-delta-zero {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 720px) {
  .log-header {
    display: none;
  }

  .log-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
  }

  .log-row.log-grid-facebook {
    grid-template-columns: 1fr 1fr;
  }

  .log-col-rows {
    text-align: left;
  }
}

.tasks-create-form {
  display: grid;
  gap: 10px;
}

.tasks-field {
  display: grid;
  gap: 6px;
}

.tasks-field span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.tasks-field input,
.tasks-field textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}

.tasks-field input:focus,
.tasks-field textarea:focus {
  outline: none;
  border-color: rgba(49, 166, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(49, 166, 255, 0.18);
}

.tasks-field textarea {
  resize: vertical;
  min-height: 84px;
}

.tasks-create-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tasks-hint {
  color: var(--muted);
  font-size: 13px;
  min-height: 18px;
}

.tasks-hint.is-success {
  color: #0f8f3d;
}

.tasks-hint.is-error {
  color: #c62828;
}

.tasks-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 30px;
  align-items: stretch;
}

.tasks-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  margin-bottom: 0;
}

.tasks-column-head .badge {
  min-width: 34px;
  text-align: center;
}

.tasks-column-cards {
  display: grid;
  gap: 8px;
  min-height: 0;
  border-radius: 12px;
  padding: 2px;
  transition: background 0.12s ease, box-shadow 0.12s ease;
  align-content: start;
  flex: 1 1 auto;
}

.tasks-column-cards.is-drop-target {
  background: rgba(49, 166, 255, 0.11);
  box-shadow: inset 0 0 0 1px rgba(49, 166, 255, 0.45);
}

.tasks-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  min-height: 88px;
  padding: 10px 12px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.56);
}

.task-card {
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 10px;
  display: grid;
  gap: 8px;
  cursor: grab;
}

.task-card:active {
  cursor: grabbing;
}

.task-card.is-dragging {
  opacity: 0.66;
}

.task-card--ideas {
  background: #e7eaf0;
}

.task-card--in_progress {
  background: #d9ebff;
}

.task-card--done {
  background: #ddf3e4;
}

.task-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.task-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  color: #10203a;
}

.task-title--done {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.task-description {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #33435f;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-description.is-hidden {
  display: none;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.task-btn {
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border-radius: 8px;
  min-width: 28px;
  height: 26px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.task-btn:hover:not(:disabled) {
  background: #fff;
}

.task-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.task-btn.task-btn-eye {
  padding-inline: 6px;
}

.task-btn.task-btn-eye svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: #25334d;
}

.task-btn.task-btn-danger {
  color: #ab1e1e;
}

@media (max-width: 1080px) {
  .tasks-board {
    grid-template-columns: 1fr;
  }
}

.flow-month-wrap {
  width: 100%;
  overflow: visible;
}

.flow-segment-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.flow-segment-block {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  padding: 16px;
  box-shadow: none;
}

.flow-segment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(125, 142, 173, 0.24);
}

.flow-segment-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(17, 24, 39, 0.88);
}

.flow-metric-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.flow-metric-block {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.flow-metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
}

.flow-metric-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(90, 102, 127, 0.95);
}

.flow-month-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(209, 217, 229, 0.9);
  border-radius: 12px;
  background: #fff;
}

.flow-month-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: #fff;
}

.flow-month-table th,
.flow-month-table td {
  border: 1px solid rgba(221, 227, 237, 0.85);
  padding: 9px 10px;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.flow-month-table thead th {
  background: var(--panel-soft);
  font-weight: 700;
  color: rgba(17, 24, 39, 0.92);
}

.flow-month-head-sub {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(90, 102, 127, 0.92);
}

.flow-month-head-plan {
  background: var(--panel-soft) !important;
  color: inherit;
}

.flow-month-table tbody th {
  text-align: left;
  min-width: 148px;
  background: #fbfcfe;
  font-weight: 600;
  color: rgba(17, 24, 39, 0.92);
}

.flow-month-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fbfcfe;
}

.flow-month-table thead th:first-child {
  z-index: 4;
  background: var(--panel-soft);
}

.flow-month-table-block th:first-child {
  min-width: 110px;
}

.flow-month-group-row th,
.flow-month-group-row td {
  background: #eceff3;
  font-weight: 700;
  color: rgba(17, 24, 39, 0.94);
}

.flow-month-group {
  padding-left: 12px;
}

.flow-month-sub-row th {
  background: #fbfcfe;
}

.flow-month-sub-row td {
  background: #ffffff;
}

.flow-month-sub {
  padding-left: 12px;
}

.flow-month-num {
  font-variant-numeric: tabular-nums;
}

.flow-fact-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.flow-fact-value {
  font-weight: 600;
}

.flow-fact-pct {
  font-size: 11px;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
}

.flow-fact-pct-plain {
  font-size: 11px;
  line-height: 1.1;
  opacity: 1;
}

.flow-fact-pct.is-low {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.22);
  color: #991b1b;
}

.flow-fact-pct.is-mid {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.22);
  color: #1d4ed8;
}

.flow-fact-pct.is-high {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.22);
  color: #166534;
}

.flow-month-fact {
  background: #ffffff;
}

.flow-month-plan {
  background: #fafbfd;
  color: rgba(90, 102, 127, 0.95);
}

.flow-week-even {
  background: rgba(49, 166, 255, 0.05);
}

.flow-week-odd {
  background: rgba(17, 24, 39, 0.02);
}

.flow-month-fact.flow-week-even,
.flow-month-plan.flow-week-even {
  background: rgba(49, 166, 255, 0.05);
}

.flow-month-fact.flow-week-odd,
.flow-month-plan.flow-week-odd {
  background: rgba(17, 24, 39, 0.02);
}

.flow-month-table th.flow-week-head-current {
  background: rgba(49, 166, 255, 0.28) !important;
  color: rgba(17, 24, 39, 0.98);
}

.flow-week-sep {
  border-right: 2px solid #c7d4ea !important;
}

.flow-month-group-row td.flow-month-fact {
  background: #eceff3;
}

.flow-month-group-row td.flow-month-plan {
  background: #eceff3;
}

.flow-month-total {
  color: inherit;
  font-weight: 700;
}

.flow-stream-badge {
  display: inline;
  min-height: 0;
  border-radius: 0;
  padding: 0;
  border: none;
  font-size: 12px;
  font-weight: 600;
  background: none;
  color: rgba(17, 24, 39, 0.92);
}

.flow-stream-new {
  background: none;
  border-color: transparent;
  color: rgba(17, 24, 39, 0.92);
}

.flow-stream-reactivated {
  background: none;
  border-color: transparent;
  color: rgba(17, 24, 39, 0.92);
}

.flow-stream-repeated {
  background: none;
  border-color: transparent;
  color: rgba(17, 24, 39, 0.92);
}

.funnel-metric-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.funnel-metric-link:hover {
  color: var(--accent);
}

.funnel-links-popup-open {
  overflow: hidden;
}

.funnel-links-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  background: rgba(11, 15, 26, 0.46);
  display: grid;
  place-items: center;
  padding: 24px;
}

.funnel-links-popup {
  width: min(760px, 100%);
  max-height: min(78vh, 760px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid rgba(227, 232, 242, 0.95);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.26);
}

.funnel-links-popup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(227, 232, 242, 0.95);
}

.funnel-links-popup-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.funnel-links-popup-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.funnel-links-popup-close {
  appearance: none;
  border: 1px solid rgba(227, 232, 242, 0.95);
  background: rgba(242, 245, 251, 0.92);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}

.funnel-links-popup-close:hover {
  background: rgba(49, 166, 255, 0.1);
}

.funnel-links-popup-list {
  padding: 8px 20px 20px;
  overflow: auto;
}

.funnel-links-popup-empty {
  padding: 20px;
  color: var(--muted);
}

.funnel-links-popup-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(227, 232, 242, 0.72);
}

.funnel-links-popup-item:last-child {
  border-bottom: 0;
}

.funnel-links-popup-anchor {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.funnel-links-popup-anchor:hover {
  text-decoration: underline;
}

.funnel-links-popup-url {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}
