:root {
  --font-ui: "Nunito", "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg: #edf4f7;
  --bg-soft: #f8fbfc;
  --paper: rgba(255, 255, 255, 0.86);
  --paper-strong: rgba(255, 255, 255, 0.98);
  --ink: #263247;
  --ink-soft: #7b8898;
  --line: rgba(140, 155, 176, 0.16);
  --shadow: 0 14px 36px rgba(135, 150, 170, 0.18);
  --coral: #c27384;
  --blue: #222d45;
  --teal: #769687;
  --gold: #c9a773;
  --slate: #667489;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shell-pad: 20px;
  --shell-gap: 20px;
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 88px;
  --sidebar-current-width: var(--sidebar-width);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  min-height: 100%;
  background:
    radial-gradient(circle at 3% 40%, rgba(189, 210, 224, 0.72), transparent 26%),
    radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.9), transparent 18%),
    linear-gradient(180deg, #eaf1f4 0%, #f2f6f8 48%, #f8fbfc 100%);
  background-color: #f3f7f9;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(circle at 3% 40%, rgba(189, 210, 224, 0.72), transparent 26%),
    radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.9), transparent 18%),
    linear-gradient(180deg, #eaf1f4 0%, #f2f6f8 48%, #f8fbfc 100%);
  background-color: #f3f7f9;
  transition: background 0.25s ease, color 0.25s ease;
  overscroll-behavior-y: none;
}

body.sidebar-collapsed {
  --sidebar-current-width: var(--sidebar-collapsed-width);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background: none;
}

body::after {
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.82), transparent 16%),
    radial-gradient(circle at 84% 18%, rgba(220, 233, 242, 0.54), transparent 16%),
    radial-gradient(circle at 54% 74%, rgba(255, 255, 255, 0.3), transparent 24%);
}

body.theme-dark {
  --bg: #0b1022;
  --bg-soft: #131937;
  --paper: rgba(18, 23, 46, 0.9);
  --paper-strong: rgba(24, 29, 56, 0.96);
  --ink: #f3f5ff;
  --ink-soft: #9eabd2;
  --line: rgba(128, 140, 198, 0.18);
  --shadow: 0 34px 88px rgba(4, 8, 26, 0.48);
  background:
    radial-gradient(circle at 16% 12%, rgba(34, 45, 69, 0.24), transparent 26%),
    radial-gradient(circle at 84% 14%, rgba(68, 124, 255, 0.16), transparent 22%),
    radial-gradient(circle at 58% 100%, rgba(53, 201, 157, 0.08), transparent 24%),
    linear-gradient(180deg, #090d1d 0%, #0f1430 48%, #151b3d 100%);
  background-color: #151b3d;
}

html.theme-dark {
  background:
    radial-gradient(circle at 16% 12%, rgba(34, 45, 69, 0.24), transparent 26%),
    radial-gradient(circle at 84% 14%, rgba(68, 124, 255, 0.16), transparent 22%),
    radial-gradient(circle at 58% 100%, rgba(53, 201, 157, 0.08), transparent 24%),
    linear-gradient(180deg, #090d1d 0%, #0f1430 48%, #151b3d 100%);
  background-color: #151b3d;
}

body.theme-dark::before {
  background-image:
    linear-gradient(rgba(146, 165, 191, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(146, 165, 191, 0.04) 1px, transparent 1px);
}

body.theme-dark::after {
  background:
    radial-gradient(circle at 18% 18%, rgba(34, 45, 69, 0.16), transparent 18%),
    radial-gradient(circle at 78% 26%, rgba(68, 124, 255, 0.12), transparent 18%),
    radial-gradient(circle at 52% 78%, rgba(53, 201, 157, 0.06), transparent 22%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.app-shell {
  display: block;
  padding: var(--shell-pad);
}

.sidebar,
.panel,
.kpi-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(228, 235, 241, 0.96);
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-strong) 100%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sidebar {
  position: fixed;
  top: var(--shell-pad);
  left: var(--shell-pad);
  bottom: var(--shell-pad);
  width: var(--sidebar-current-width);
  padding: 16px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  z-index: 30;
  overflow: hidden;
  transition: width 0.2s ease, padding 0.2s ease;
}

.workspace {
  min-width: 0;
  margin-left: calc(var(--sidebar-current-width) + var(--shell-gap));
  transition: margin-left 0.2s ease;
}

.sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: white;
  background: linear-gradient(180deg, #232e47 0%, #2e3c59 100%);
  box-shadow: 0 10px 20px rgba(34, 45, 69, 0.18);
}

.brand-block h1,
.hero h2,
.panel h3 {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-block h1 {
  font-size: 1.08rem;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.66rem;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.side-nav {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.nav-pill {
  appearance: none;
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 7px 8px;
  border-radius: 12px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  box-shadow: none;
  transition: 0.2s ease;
  cursor: pointer;
  position: relative;
}

.nav-pill::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background-color: currentColor;
  opacity: 0.84;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.nav-pill[data-view-switch="form-om"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16'/%3E%3Cpath d='M4 10h16'/%3E%3Cpath d='M4 15h16'/%3E%3Cpath d='M4 20h10'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16'/%3E%3Cpath d='M4 10h16'/%3E%3Cpath d='M4 15h16'/%3E%3Cpath d='M4 20h10'/%3E%3C/svg%3E");
}

.nav-pill[data-view-switch="dashboard"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='8' height='8' rx='1.5'/%3E%3Crect x='13' y='3' width='8' height='5' rx='1.5'/%3E%3Crect x='13' y='10' width='8' height='11' rx='1.5'/%3E%3Crect x='3' y='13' width='8' height='8' rx='1.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='8' height='8' rx='1.5'/%3E%3Crect x='13' y='3' width='8' height='5' rx='1.5'/%3E%3Crect x='13' y='10' width='8' height='11' rx='1.5'/%3E%3Crect x='3' y='13' width='8' height='8' rx='1.5'/%3E%3C/svg%3E");
}

.nav-pill[data-view-switch="cohort"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V5'/%3E%3Cpath d='M10 19V9'/%3E%3Cpath d='M16 19V12'/%3E%3Cpath d='M22 19V7'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V5'/%3E%3Cpath d='M10 19V9'/%3E%3Cpath d='M16 19V12'/%3E%3Cpath d='M22 19V7'/%3E%3C/svg%3E");
}

.nav-pill[data-view-switch="rnp"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 18h16'/%3E%3Cpath d='M6 18V8'/%3E%3Cpath d='M12 18V4'/%3E%3Cpath d='M18 18v-6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 18h16'/%3E%3Cpath d='M6 18V8'/%3E%3Cpath d='M12 18V4'/%3E%3Cpath d='M18 18v-6'/%3E%3C/svg%3E");
}

.nav-pill[data-view-switch="media-plan"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='14' rx='2'/%3E%3Cpath d='M8 9h8'/%3E%3Cpath d='M8 13h5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='14' rx='2'/%3E%3Cpath d='M8 9h8'/%3E%3Cpath d='M8 13h5'/%3E%3C/svg%3E");
}

.nav-pill[data-view-switch="monthly-report"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cpath d='M8 7h8'/%3E%3Cpath d='M8 11h8'/%3E%3Cpath d='M8 15h5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cpath d='M8 7h8'/%3E%3Cpath d='M8 11h8'/%3E%3Cpath d='M8 15h5'/%3E%3C/svg%3E");
}

.nav-pill[data-view-switch="ya-direct"]::before {
  display: none;
}

.nav-pill-logo {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
}

body.sidebar-collapsed .nav-pill[data-view-switch="ya-direct"] .nav-pill-logo {
  width: 22px;
  height: 22px;
}

.nav-pill:hover {
  color: var(--ink);
  background: rgba(36, 50, 71, 0.05);
}

.nav-pill.active {
  color: var(--ink);
  border-color: transparent;
  background: rgba(36, 50, 71, 0.09);
  box-shadow: none;
}

.nav-pill-short {
  display: none !important;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(235, 240, 244, 0.94);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.nav-pill-label {
  white-space: nowrap;
  font-size: 0.8rem;
  line-height: 1.15;
  font-weight: 600;
}

.sidebar-collapse-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(226, 233, 238, 0.96);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.sidebar-collapse-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
}

.sidebar-collapse-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.sidebar-card {
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(229, 235, 240, 0.94);
  background: rgba(248, 250, 251, 0.94);
}

.sidebar-note p:last-child {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 8px;
}

.theme-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(226, 233, 238, 0.96);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(248, 250, 251, 0.96);
  box-shadow: 0 10px 22px rgba(143, 158, 176, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
}

.theme-toggle-copy {
  display: grid;
  gap: 4px;
  text-align: left;
}

.theme-toggle-mini {
  display: none;
  font-size: 1.08rem;
  line-height: 1;
}

.theme-toggle-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.theme-toggle-value {
  font-size: 0.92rem;
  font-weight: 700;
}

.theme-toggle-track {
  width: 52px;
  height: 28px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(225, 232, 238, 0.96);
}

.theme-toggle-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #f0f4f7 100%);
  box-shadow: 0 6px 12px rgba(143, 158, 176, 0.18);
  transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle.is-dark .theme-toggle-track {
  background: linear-gradient(135deg, rgba(34, 45, 69, 0.42) 0%, rgba(118, 150, 135, 0.32) 100%);
}

.theme-toggle.is-dark .theme-toggle-thumb {
  transform: translateX(22px);
  background: linear-gradient(135deg, #b8acff 0%, #ffffff 100%);
}

body.sidebar-collapsed .sidebar {
  padding: 16px 12px;
}

body.sidebar-collapsed .sidebar-top {
  flex-direction: column;
  align-items: center;
}

body.sidebar-collapsed .brand-block {
  justify-content: center;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-pill-label,
body.sidebar-collapsed .theme-toggle-copy {
  display: none;
}

body.sidebar-collapsed .side-nav {
  justify-items: center;
}

body.sidebar-collapsed .nav-pill {
  justify-content: center;
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
}

body.sidebar-collapsed .theme-toggle {
  justify-content: center;
  padding-inline: 10px;
}

body.sidebar-collapsed .theme-toggle-mini {
  display: inline-flex;
}

.snapshot-list,
.sidebar-highlights {
  display: grid;
  gap: 12px;
}

.snapshot-item,
.highlight-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(246, 249, 251, 0.96);
}

.snapshot-label,
.highlight-title {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.snapshot-value,
.highlight-value {
  font-size: 0.92rem;
  font-weight: 700;
}

body.theme-dark .sidebar,
body.theme-dark .panel,
body.theme-dark .kpi-card {
  border-color: rgba(128, 140, 198, 0.18);
  background: linear-gradient(180deg, rgba(17, 22, 45, 0.92) 0%, rgba(23, 29, 57, 0.96) 100%);
}

body.theme-dark .sidebar-card,
body.theme-dark .hero-chip,
body.theme-dark .form-om-summary-card,
body.theme-dark .filter-card,
body.theme-dark .dashboard-summary-card {
  border-color: rgba(128, 140, 198, 0.18);
  background: rgba(128, 140, 198, 0.1);
}

body.theme-dark .snapshot-item,
body.theme-dark .highlight-item,
body.theme-dark .mix-row,
body.theme-dark .funnel-step,
body.theme-dark .insight-item,
body.theme-dark .stage-card,
body.theme-dark .dashboard-signal-card {
  background: rgba(128, 140, 198, 0.1);
}

body.theme-dark .mix-row.active {
  background: rgba(146, 165, 191, 0.13);
  outline-color: rgba(146, 165, 191, 0.16);
}

body.theme-dark .nav-pill,
body.theme-dark .switch-btn,
body.theme-dark .filter-pill,
body.theme-dark .metric-chip,
body.theme-dark .theme-toggle,
body.theme-dark .sidebar-collapse-btn {
  border-color: rgba(128, 140, 198, 0.16);
  color: var(--ink-soft);
  background: rgba(128, 140, 198, 0.1);
}

body.theme-dark .nav-pill {
  border-color: transparent;
  background: transparent;
}

body.theme-dark .nav-pill-short {
  background: rgba(128, 140, 198, 0.18);
}

body.theme-dark .nav-pill:hover,
body.theme-dark .theme-toggle:hover {
  color: var(--ink);
  border-color: rgba(128, 140, 198, 0.24);
  background: rgba(128, 140, 198, 0.14);
}

body.theme-dark .nav-pill.active {
  color: #ffffff;
  border-color: transparent;
  background: rgba(128, 140, 198, 0.18);
  box-shadow: none;
}

body.theme-dark .switch-btn:hover,
body.theme-dark .filter-pill:hover,
body.theme-dark .metric-chip:hover {
  color: var(--ink);
}

body.theme-dark .switch-btn.active,
body.theme-dark .filter-pill.active,
body.theme-dark .metric-chip.active {
  color: #ffffff;
  background: linear-gradient(180deg, #222d45 0%, #2f3a54 100%);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.34);
}

body.theme-dark .switch-btn.channel-btn.active {
  background: linear-gradient(180deg, var(--channel-color, var(--blue)) 0%, color-mix(in srgb, var(--channel-color, var(--blue)) 72%, #ffffff) 100%);
}

body.theme-dark .theme-toggle-label,
body.theme-dark .theme-toggle-value {
  color: inherit;
}

body.theme-dark .theme-toggle-track {
  background: rgba(255, 255, 255, 0.12);
}

body.theme-dark .theme-toggle-thumb {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

body.theme-dark .dashboard-date-input,
body.theme-dark .dashboard-select,
body.theme-dark .action-chip,
body.theme-dark .compact-control-card,
body.theme-dark .dashboard-tag-card,
body.theme-dark .dashboard-compare-config,
body.theme-dark .compare-config-card,
body.theme-dark .filter-dropdown,
body.theme-dark .filter-dropdown-menu,
body.theme-dark .metric-group-card,
body.theme-dark .metric-group-toggle,
body.theme-dark .metric-subchip,
body.theme-dark .metric-option-card,
body.theme-dark .filter-clear-btn,
body.theme-dark .filter-check {
  border-color: rgba(128, 140, 198, 0.18);
  background: rgba(128, 140, 198, 0.1);
  color: var(--ink);
}

body.theme-dark .action-chip.active,
body.theme-dark .metric-group-toggle.active,
body.theme-dark .metric-subchip.active,
body.theme-dark .metric-option-card.active {
  color: #ffffff;
  border-color: transparent;
}

body.theme-dark .filter-dropdown[open] {
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.28);
}

body.theme-dark .filter-dropdown {
  background: #171d3b;
}

body.theme-dark .filter-dropdown-menu {
  border-color: rgba(128, 140, 198, 0.22);
  background: #141a34;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.44);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.theme-dark .filter-check-all {
  background: rgba(33, 42, 76, 0.98);
  box-shadow: 0 1px 0 rgba(128, 140, 198, 0.14);
}

body.theme-dark .filter-check-all.is-active {
  border-color: rgba(141, 125, 255, 0.34);
  background: rgba(74, 63, 132, 0.46);
}

body.theme-dark .metric-option-card.active {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--metric-color, var(--blue)) 30%, #0b1420) 0%, color-mix(in srgb, var(--metric-color, var(--blue)) 18%, #0b1420) 100%);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--metric-color, var(--blue)) 66%, transparent),
    0 18px 30px rgba(0, 0, 0, 0.28);
}

body.theme-dark .chart-grid-line {
  stroke: rgba(146, 165, 191, 0.14);
}

body.theme-dark .chart-point {
  stroke: #08111d;
}

body.theme-dark .chart-callout {
  fill: rgba(15, 24, 38, 0.95);
  stroke: rgba(146, 165, 191, 0.16);
}

body.theme-dark .mix-track,
body.theme-dark .funnel-bar,
body.theme-dark .compare-bar-track {
  background: rgba(128, 140, 198, 0.14);
}

body.theme-dark .compare-bar-fill.previous {
  background: linear-gradient(90deg, rgba(128, 140, 198, 0.2), rgba(128, 140, 198, 0.42));
}

body.theme-dark .campaign-table thead th,
body.theme-dark .slice-table thead th {
  background: rgba(16, 22, 44, 0.96);
  border-bottom-color: rgba(128, 140, 198, 0.18);
}

body.theme-dark .dashboard-table-panel .slice-table thead th + th,
body.theme-dark .dashboard-table-panel .slice-table tbody td + td {
  border-left: 1px solid rgba(128, 140, 198, 0.14);
}

body.theme-dark .dashboard-table-panel .slice-col-metric-split.is-compare-column,
body.theme-dark .dashboard-table-panel .slice-metric-cell-split.is-compare-column {
  background:
    linear-gradient(0deg, rgba(141, 125, 255, 0.2), rgba(141, 125, 255, 0.2)),
    rgba(24, 32, 61, 0.96);
  box-shadow: inset 1px 0 0 rgba(141, 125, 255, 0.34);
}

body.theme-dark .campaign-table tbody td,
body.theme-dark .slice-table tbody td {
  background: rgba(20, 27, 52, 0.9);
  border-top-color: rgba(128, 140, 198, 0.12);
}

body.theme-dark .slice-total-row td {
  background: rgba(255, 111, 136, 0.14);
}

body.theme-dark .dashboard-visual-shell,
body.theme-dark .dashboard-heatmap-corner,
body.theme-dark .dashboard-heatmap-col,
body.theme-dark .dashboard-heatmap-row-label,
body.theme-dark .dashboard-zin-row,
body.theme-dark .dashboard-zin-track-card,
body.theme-dark .dashboard-zin-key-item,
body.theme-dark .dashboard-zin-legend-item,
body.theme-dark .dashboard-pipeline-track {
  border-color: rgba(128, 140, 198, 0.18);
  background: rgba(18, 25, 48, 0.9);
}

body.theme-dark .dashboard-heatmap-row.is-highlight .dashboard-heatmap-row-label,
body.theme-dark .dashboard-zin-row.is-highlight {
  background:
    radial-gradient(circle at top left, rgba(52, 66, 94, 0.18), transparent 58%),
    rgba(20, 28, 54, 0.96);
}

body.theme-dark .dashboard-heatmap-cell {
  border-color: rgba(146, 165, 191, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-dark .dashboard-heatmap-table thead th {
  color: #a8bbd8;
}

body.theme-dark .dashboard-heatmap-value-wrap {
  border-color: rgba(146, 165, 191, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-dark .dashboard-zin-track,
body.theme-dark .dashboard-visual-empty {
  background: rgba(128, 140, 198, 0.14);
}

body.theme-dark .dashboard-zin-track-card.is-compare {
  background: rgba(128, 140, 198, 0.1);
}

body.theme-dark .dashboard-day-tab,
body.theme-dark .dashboard-graph-tab,
body.theme-dark .dashboard-graph-mode-btn,
body.theme-dark .dashboard-line-card,
body.theme-dark .dashboard-daily-focus-card,
body.theme-dark .dashboard-daily-bar-card,
body.theme-dark .dashboard-daily-track-card,
body.theme-dark .dashboard-daily-stat,
body.theme-dark .dashboard-line-stat,
body.theme-dark .dashboard-pipeline-mini-pill {
  border-color: rgba(128, 140, 198, 0.18);
  background: rgba(18, 25, 48, 0.92);
}

body.theme-dark .dashboard-day-tab.is-active,
body.theme-dark .dashboard-graph-tab.is-active,
body.theme-dark .dashboard-graph-mode-btn.is-active,
body.theme-dark .dashboard-daily-bar-card.is-active,
body.theme-dark .dashboard-daily-track-card.is-active {
  border-color: rgba(141, 125, 255, 0.32);
  background:
    radial-gradient(circle at top center, rgba(52, 66, 94, 0.18), transparent 54%),
    rgba(20, 28, 54, 0.98);
}

body.theme-dark .dashboard-line-card.is-highlight {
  border-color: rgba(141, 125, 255, 0.22);
  background:
    radial-gradient(circle at top left, rgba(52, 66, 94, 0.22), transparent 48%),
    rgba(18, 25, 48, 0.96);
}

body.theme-dark .dashboard-line-tooltip {
  border-color: rgba(128, 140, 198, 0.2);
  background: rgba(10, 16, 30, 0.96);
  box-shadow: 0 20px 36px rgba(3, 8, 18, 0.42);
}

body.theme-dark .dashboard-line-dot {
  stroke: rgba(10, 16, 30, 0.98);
}

body.theme-dark .dashboard-line-tooltip-date,
body.theme-dark .dashboard-line-tooltip-row strong,
body.theme-dark .dashboard-line-card-title {
  color: #edf3fd;
}

body.theme-dark .dashboard-line-card-subtext,
body.theme-dark .dashboard-line-tooltip-row,
body.theme-dark .dashboard-line-scale-note,
body.theme-dark .dashboard-line-x-label,
body.theme-dark .dashboard-line-y-label {
  color: #90a4bd;
  fill: #90a4bd;
}

body.theme-dark .dashboard-line-grid-line {
  stroke: rgba(128, 140, 198, 0.16);
}

body.theme-dark .dashboard-line-guide {
  stroke: rgba(196, 204, 255, 0.24);
}

body.theme-dark .dashboard-line-point {
  stroke: rgba(10, 16, 30, 0.98);
}

body.theme-dark .dashboard-compact-track {
  background: rgba(128, 140, 198, 0.14);
}

body.theme-dark .dashboard-zin-tooltip {
  border-color: rgba(146, 165, 191, 0.18);
  background: rgba(12, 22, 35, 0.96);
  box-shadow: 0 18px 40px rgba(4, 8, 26, 0.46);
}

body.theme-dark .dashboard-zin-tooltip::after {
  border-color: rgba(146, 165, 191, 0.18);
}

body.theme-dark .dashboard-pipeline-stage-name,
body.theme-dark .dashboard-pipeline-stage-meta,
body.theme-dark .dashboard-pipeline-track-label {
  color: #a8bbd8;
}

body.theme-dark .dashboard-pipeline-track.is-compare {
  opacity: 0.72;
}

body.theme-dark .metric-delta.flat {
  color: #b6c4d8;
  background: rgba(128, 140, 198, 0.16);
}

body.theme-dark .metric-compare-badge.up {
  color: #8ff0cf;
  background: rgba(15, 140, 120, 0.2);
}

body.theme-dark .metric-compare-badge.down {
  color: #ffb7a5;
  background: rgba(242, 106, 75, 0.22);
}

body.theme-dark .metric-compare-badge.flat {
  color: #d6e1ef;
  background: rgba(146, 165, 191, 0.16);
}

body.theme-dark .dashboard-controls {
  background: linear-gradient(180deg, rgba(15, 24, 40, 0.94) 0%, rgba(18, 27, 46, 0.92) 100%);
  border-color: rgba(128, 140, 198, 0.18);
  box-shadow: 0 16px 36px rgba(4, 8, 26, 0.28);
}

body.theme-dark .dashboard-toolbar .action-chip-secondary {
  background: rgba(128, 140, 198, 0.14);
}

body.theme-dark .compare-period-badge,
body.theme-dark .compare-period-vs,
body.theme-dark .compare-config-card-compact {
  border-color: rgba(128, 140, 198, 0.18);
  background: rgba(128, 140, 198, 0.12);
}

body.theme-dark .slice-focus-row td {
  background: rgba(36, 51, 88, 0.96);
}

.workspace {
  display: grid;
  gap: 16px;
}

.dashboard-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
  position: relative;
  isolation: isolate;
}

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

.panel {
  border-radius: var(--radius-xl);
  padding: 18px;
}

.dashboard-controls {
  overflow: visible;
  z-index: 20;
  position: sticky;
  top: var(--shell-pad);
  z-index: 110;
  isolation: isolate;
  padding: 8px 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(251, 253, 254, 0.98) 100%);
  border-color: rgba(230, 236, 241, 0.96);
  box-shadow: 0 10px 24px rgba(143, 158, 176, 0.12);
}

.dashboard-controls-body {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 2;
  overflow: visible;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.hero h2 {
  font-size: clamp(1.48rem, 2.9vw, 2.24rem);
  max-width: 820px;
}

.hero-text {
  max-width: 780px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
  font-size: 0.92rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: start;
}

.hero-chip {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--ink);
  border: 1px solid rgba(228, 235, 240, 0.94);
  background: rgba(248, 250, 251, 0.96);
}

.toolbar {
  display: grid;
  gap: 16px;
}

.control-block {
  display: grid;
  gap: 8px;
}

.dashboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  position: relative;
  z-index: 4;
}

.dashboard-period-block,
.dashboard-breakdown-block {
  min-width: 0;
}

.dashboard-toolbar .control-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-toolbar .dashboard-period-block {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
}

.dashboard-toolbar .dashboard-toolbar-actions {
  margin-left: auto;
}

.dashboard-period-block,
.dashboard-display-mode-block {
  flex-wrap: wrap;
}

.dashboard-period-block .control-label,
.dashboard-display-mode-block .control-label {
  margin: 0;
  flex: 0 0 auto;
}

.dashboard-toolbar .control-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-toolbar .control-label::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  background-color: currentColor;
  opacity: 0.76;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.dashboard-period-block .control-label::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.dashboard-display-mode-block .control-label::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M4 12h16'/%3E%3Cpath d='M4 17h16'/%3E%3Ccircle cx='8' cy='7' r='2' fill='black' stroke='none'/%3E%3Ccircle cx='15' cy='12' r='2' fill='black' stroke='none'/%3E%3Ccircle cx='11' cy='17' r='2' fill='black' stroke='none'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M4 12h16'/%3E%3Cpath d='M4 17h16'/%3E%3Ccircle cx='8' cy='7' r='2' fill='black' stroke='none'/%3E%3Ccircle cx='15' cy='12' r='2' fill='black' stroke='none'/%3E%3Ccircle cx='11' cy='17' r='2' fill='black' stroke='none'/%3E%3C/svg%3E");
}

.date-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.date-field {
  display: grid;
  gap: 8px;
}

.date-field span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.dashboard-toolbar .date-range-fields {
  grid-template-columns: repeat(2, minmax(136px, 136px));
  gap: 6px;
  justify-content: flex-start;
}

.dashboard-toolbar .date-field {
  gap: 0;
}

.dashboard-toolbar .date-field span {
  display: none;
}

.dashboard-date-input,
.dashboard-select {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(226, 233, 238, 0.96);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  font: inherit;
}

.dashboard-toolbar .dashboard-date-input,
.dashboard-toolbar .dashboard-select {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  font-size: 0.84rem;
}

.dashboard-select-wrap {
  display: block;
}

.dashboard-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: end;
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-display-mode-block {
  min-width: 0;
}

.dashboard-display-mode-block .segmented {
  justify-content: flex-start;
  gap: 5px;
}

.dashboard-toolbar .switch-btn,
.dashboard-display-mode-block .switch-btn {
  white-space: nowrap;
}

.dashboard-toolbar .switch-btn.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: none;
}

.dashboard-toolbar .switch-btn.active {
  box-shadow: 0 8px 16px rgba(34, 45, 69, 0.14);
}

.action-chip {
  min-height: 40px;
  padding: 10px 13px;
  border: 1px solid rgba(226, 233, 238, 0.96);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(248, 250, 251, 0.98);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.action-chip:hover {
  transform: translateY(-1px);
}

.action-chip.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(180deg, #222d45 0%, #2f3a54 100%);
  box-shadow: 0 10px 20px rgba(34, 45, 69, 0.16);
}

.action-chip-mode {
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.dashboard-toolbar .action-chip {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dashboard-toolbar .action-chip::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  background-color: currentColor;
  opacity: 0.86;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

#dashboardCompareToggle::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 1 0-7l1-1a5 5 0 0 1 7 7l-1 1'/%3E%3Cpath d='M14 11a5 5 0 0 1 0 7l-1 1a5 5 0 0 1-7-7l1-1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 1 0-7l1-1a5 5 0 0 1 7 7l-1 1'/%3E%3Cpath d='M14 11a5 5 0 0 1 0 7l-1 1a5 5 0 0 1-7-7l1-1'/%3E%3C/svg%3E");
}

#dashboardDailyToggle::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 14 8 10 12 13 18 7 20 9'/%3E%3Cpath d='M4 19h16'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 14 8 10 12 13 18 7 20 9'/%3E%3Cpath d='M4 19h16'/%3E%3C/svg%3E");
}

#dashboardResetFilters::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M6 6l1 14h10l1-14'/%3E%3Cpath d='M10 10v6'/%3E%3Cpath d='M14 10v6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M6 6l1 14h10l1-14'/%3E%3Cpath d='M10 10v6'/%3E%3Cpath d='M14 10v6'/%3E%3C/svg%3E");
}

#dtCompareToggle::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 1 0-7l1-1a5 5 0 0 1 7 7l-1 1'/%3E%3Cpath d='M14 11a5 5 0 0 1 0 7l-1 1a5 5 0 0 1-7-7l1-1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 1 0-7l1-1a5 5 0 0 1 7 7l-1 1'/%3E%3Cpath d='M14 11a5 5 0 0 1 0 7l-1 1a5 5 0 0 1-7-7l1-1'/%3E%3C/svg%3E");
}
#dtDailyToggle::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 14 8 10 12 13 18 7 20 9'/%3E%3Cpath d='M4 19h16'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 14 8 10 12 13 18 7 20 9'/%3E%3Cpath d='M4 19h16'/%3E%3C/svg%3E");
}
#dtResetFilters::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M6 6l1 14h10l1-14'/%3E%3Cpath d='M10 10v6'/%3E%3Cpath d='M14 10v6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M6 6l1 14h10l1-14'/%3E%3Cpath d='M10 10v6'/%3E%3Cpath d='M14 10v6'/%3E%3C/svg%3E");
}

#cohortRefreshButton::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 2v6h-6'/%3E%3Cpath d='M3 12a9 9 0 0 1 15.3-6.36L21 8'/%3E%3Cpath d='M3 22v-6h6'/%3E%3Cpath d='M21 12a9 9 0 0 1-15.3 6.36L3 16'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 2v6h-6'/%3E%3Cpath d='M3 12a9 9 0 0 1 15.3-6.36L21 8'/%3E%3Cpath d='M3 22v-6h6'/%3E%3Cpath d='M21 12a9 9 0 0 1-15.3 6.36L3 16'/%3E%3C/svg%3E");
}

.dashboard-toolbar .action-chip.active {
  background: linear-gradient(180deg, #222d45 0%, #2f3a54 100%);
  box-shadow: 0 8px 16px rgba(34, 45, 69, 0.14);
}

.dashboard-toolbar .action-chip-secondary {
  background: rgba(246, 249, 251, 0.98);
}

.action-chip-secondary {
  color: var(--ink-soft);
}

.dashboard-compact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.dashboard-filters-card {
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.compact-control-card,
.dashboard-compare-config {
  padding: 14px;
  border-radius: 24px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.62);
  overflow: visible;
}

.dashboard-compare-config {
  width: 100%;
  padding: 10px 12px;
}

.dashboard-compare-config .panel-head {
  margin-bottom: 8px;
  gap: 12px;
  align-items: center;
}

.dashboard-compare-config .table-head h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.15;
}

.dashboard-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.dropdown-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filter-head-compact {
  margin-bottom: 8px;
}

.dashboard-tag-card {
  padding: 12px;
  border-radius: 18px;
}

.dashboard-tag-card .filter-title {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.dashboard-tag-card .filter-helper {
  font-size: 0.76rem;
}

.dashboard-tag-options {
  max-height: 98px;
  overflow: auto;
  align-content: flex-start;
  padding-right: 2px;
  scrollbar-width: thin;
}

.dashboard-tag-options::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.dashboard-tag-card .filter-pill {
  padding: 7px 10px;
  font-size: 0.82rem;
  line-height: 1.1;
  box-shadow: none;
}

.dashboard-tag-card .filter-pill.active {
  box-shadow: 0 10px 18px rgba(24, 36, 51, 0.12);
}

.filter-dropdown {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.78);
  overflow: visible;
}

.dashboard-filter-grid .filter-dropdown {
  min-width: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
}

.filter-dropdown[open] {
  z-index: 120;
  box-shadow: 0 18px 30px rgba(24, 36, 51, 0.08);
}

.filter-dropdown-summary {
  position: relative;
  list-style: none;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  cursor: pointer;
}

.dashboard-filter-grid .filter-dropdown-summary {
  gap: 3px;
  min-height: 50px;
  padding: 8px 11px;
}

.filter-dropdown-summary::-webkit-details-marker {
  display: none;
}

.filter-dropdown-summary::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  opacity: 0.42;
  pointer-events: none;
}

.filter-dropdown-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.dashboard-filter-grid .filter-dropdown-title {
  font-size: 0.67rem;
  letter-spacing: 0.14em;
}

.filter-dropdown-value {
  font-weight: 700;
  min-width: 0;
  padding-right: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dashboard-filter-grid .filter-dropdown-value {
  font-size: 0.84rem;
  line-height: 1.2;
}

.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 121;
  display: grid;
  gap: 8px;
  padding: 14px;
  max-height: 260px;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 34px rgba(24, 36, 51, 0.12);
}

.dashboard-filter-grid .filter-dropdown-menu {
  gap: 6px;
  padding: 10px;
  max-height: 280px;
}

.filter-clear-btn {
  justify-self: start;
  padding: 7px 10px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  border-radius: 999px;
  background: rgba(24, 36, 51, 0.045);
  color: var(--ink-soft);
  cursor: pointer;
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(24, 36, 51, 0.04);
  color: var(--ink);
}

.dashboard-filter-grid .filter-check {
  gap: 9px;
  padding: 8px 10px;
  font-size: 0.84rem;
  line-height: 1.2;
}

.filter-check-all {
  position: sticky;
  top: -10px;
  z-index: 1;
  background: rgba(240, 244, 248, 0.98);
  box-shadow: 0 1px 0 rgba(24, 36, 51, 0.06);
}

.filter-check-all.is-active {
  border: 1px solid rgba(45, 103, 245, 0.14);
  background: rgba(225, 233, 252, 0.98);
}

.filter-check input {
  margin: 0;
}

.filter-empty-note {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(24, 36, 51, 0.04);
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}

.metric-group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-option-card {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.metric-option-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--metric-color, var(--blue)) 38%, rgba(24, 36, 51, 0.08));
}

.metric-option-card.active {
  border-color: transparent;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--metric-color, var(--blue)) 14%, #ffffff) 0%, color-mix(in srgb, var(--metric-color, var(--blue)) 7%, #ffffff) 100%);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--metric-color, var(--blue)) 72%, transparent),
    0 10px 18px rgba(24, 36, 51, 0.1);
}

.metric-option-title {
  font-weight: 700;
  text-align: left;
  line-height: 1.2;
  font-size: 0.94rem;
}

.metric-group-card {
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.metric-group-card.active {
  border-color: rgba(24, 36, 51, 0.12);
}

.metric-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  border-radius: 18px;
  background: rgba(24, 36, 51, 0.04);
  color: var(--ink);
  cursor: pointer;
}

.metric-group-toggle.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #182433 0%, #425770 100%);
}

.metric-group-title,
.metric-group-meta {
  display: block;
}

.metric-group-title {
  font-weight: 700;
  text-align: left;
}

.metric-group-meta {
  font-size: 0.84rem;
  color: inherit;
  opacity: 0.8;
  text-align: right;
}

.metric-suboptions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-subchip {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink-soft);
  cursor: pointer;
}

.metric-subchip.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal) 0%, var(--blue) 100%);
}

.compare-fields-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.compare-config-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.72);
  overflow: visible;
}

.compare-config-card-compact {
  padding: 10px 12px;
  border-radius: 16px;
}

.compare-config-card > p {
  margin: 0;
}

.compare-config-label {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.compare-config-value {
  margin-top: 10px !important;
  font-size: 1.1rem;
  font-weight: 800;
}

.compare-config-note {
  margin-top: 10px !important;
  color: var(--ink-soft);
  line-height: 1.45;
}

.compare-period-strip {
  display: grid;
  grid-template-columns: minmax(220px, auto) auto minmax(320px, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
}

.compare-period-badge {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.68);
}

.compare-period-range {
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.15;
}

.compare-period-vs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(24, 36, 51, 0.04);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.compare-period-editor {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.compare-period-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.compare-period-hint {
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.2;
  text-align: right;
}

.compare-date-inline {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
}

.dashboard-compare-config .date-field {
  gap: 4px;
}

.dashboard-compare-config .date-field span {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
}

.dashboard-compare-config .dashboard-date-input {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
}

.control-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.segmented,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.switch-btn {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(226, 233, 238, 0.96);
  border-radius: 12px;
  color: var(--ink-soft);
  background: rgba(248, 250, 251, 0.98);
  transition: 0.2s ease;
  cursor: pointer;
}

.switch-btn:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.switch-btn.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(180deg, #222d45 0%, #2f3a54 100%);
  box-shadow: 0 10px 20px rgba(34, 45, 69, 0.16);
}

.switch-btn.compact {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 0.84rem;
}

.switch-btn.channel-btn.active {
  background: linear-gradient(180deg, var(--channel-color, var(--blue)) 0%, color-mix(in srgb, var(--channel-color, var(--blue)) 78%, #ffffff) 100%);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  padding: 14px;
  border-radius: var(--radius-lg);
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: -34px;
  right: -24px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.75) 0%, transparent 62%);
}

.kpi-label {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kpi-value {
  margin: 0;
  font-size: clamp(1.16rem, 1.6vw, 1.56rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.kpi-foot {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 0.78rem;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.delta.up {
  color: var(--teal);
}

.delta.down {
  color: var(--coral);
}

.delta.flat {
  color: var(--ink-soft);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr);
  gap: 18px;
}

.chart-panel {
  min-height: 420px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.legend-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.chart-wrap {
  min-height: 320px;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-grid-line {
  stroke: rgba(24, 36, 51, 0.09);
  stroke-width: 1;
}

.chart-area {
  opacity: 0.18;
}

.chart-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  stroke: white;
  stroke-width: 3;
}

.chart-axis-label,
.chart-value-label {
  fill: var(--ink-soft);
  font-size: 12px;
}

.chart-callout {
  fill: rgba(255, 255, 255, 0.92);
  stroke: rgba(24, 36, 51, 0.08);
}

.mix-list,
.funnel-list,
.insight-list {
  display: grid;
  gap: 14px;
}

.mix-row,
.funnel-step,
.insight-item {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(24, 36, 51, 0.05);
}

.mix-row.active {
  background: rgba(24, 36, 51, 0.08);
  outline: 1px solid rgba(24, 36, 51, 0.06);
}

.mix-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.mix-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--swatch) 18%, transparent);
}

.mix-meta {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.mix-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(24, 36, 51, 0.08);
}

.mix-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.mix-foot {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.funnel-step {
  display: grid;
  gap: 10px;
}

.funnel-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.funnel-name {
  font-weight: 700;
}

.funnel-value {
  font-size: 1.1rem;
  font-weight: 800;
}

.funnel-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(24, 36, 51, 0.08);
}

.funnel-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #7f90a5);
}

.funnel-meta {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.insight-item {
  display: grid;
  gap: 8px;
}

.insight-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
}

.insight-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.insight-body {
  color: var(--ink-soft);
  line-height: 1.55;
}

.table-head {
  align-items: center;
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: end;
}

.table-meta {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.table-wrap {
  overflow: auto;
}

.campaign-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.campaign-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 14px 12px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(246, 240, 232, 0.92);
}

.campaign-table tbody td {
  padding: 16px 12px;
  border-top: 1px solid rgba(24, 36, 51, 0.08);
  vertical-align: top;
}

.campaign-name {
  display: grid;
  gap: 5px;
}

.campaign-title {
  font-weight: 700;
}

.campaign-meta {
  color: var(--ink-soft);
  font-size: 0.87rem;
}

.cell-strong {
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-pill.growth {
  color: #085f50;
  background: rgba(15, 140, 120, 0.14);
}

.status-pill.stable {
  color: #7c5313;
  background: rgba(202, 139, 44, 0.15);
}

.status-pill.risk {
  color: #b63c66;
  background: rgba(255, 111, 136, 0.14);
}

.form-om-screen {
  --form-om-header-offset: 68px;
  display: grid;
  gap: 10px;
  min-width: 0;
  align-items: start;
}

.form-om-controls {
  position: sticky;
  top: var(--shell-pad);
  z-index: 44;
  padding: 8px 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(251, 253, 254, 0.98) 100%);
  border: 1px solid rgba(230, 236, 241, 0.96);
  box-shadow: 0 10px 24px rgba(143, 158, 176, 0.12);
  overflow: visible;
}

.form-om-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.form-om-overview-panel {
  align-items: start;
  position: relative;
  z-index: 2;
}

.form-om-table-panel {
  display: flex;
  align-items: stretch;
  padding: 10px;
  min-height: calc(100dvh - (var(--shell-pad) * 2) - var(--form-om-header-offset));
  height: calc(100dvh - (var(--shell-pad) * 2) - var(--form-om-header-offset));
  position: sticky;
  top: calc(var(--shell-pad) + var(--form-om-header-offset));
  align-self: start;
  z-index: 1;
}

.form-om-panel-head {
  margin-bottom: 0;
  align-items: start;
  justify-content: flex-start;
}

.form-om-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: visible;
}

.form-om-toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
}

.form-om-month-filter,
.form-om-source-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.form-om-toolbar-label {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.form-om-region-switch {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.form-om-region-switch::-webkit-scrollbar {
  display: none;
}

.form-om-region-switch {
  flex: 0 1 auto;
}

.form-om-month-select,
.form-om-source-select {
  min-height: 34px;
  padding: 7px 36px 7px 12px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  min-width: 164px;
}

.form-om-month-select:focus,
.form-om-source-select:focus {
  border-color: rgba(66, 87, 112, 0.28);
  box-shadow: 0 0 0 3px rgba(102, 122, 154, 0.12);
}

.form-om-region-btn {
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.form-om-region-btn:hover {
  transform: translateY(-1px);
}

.form-om-region-btn.is-active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #182433 0%, #425770 100%);
}

.form-om-chart-head {
  margin-bottom: 0;
}

.form-om-chart-panel {
  position: relative;
  z-index: 3;
}

.form-om-chart-head h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.form-om-intro {
  max-width: 840px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.form-om-header-meta {
  justify-content: end;
}

.form-om-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.form-om-summary-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.form-om-summary-card-quals {
  overflow: hidden;
}

.form-om-summary-card-quals.is-wide {
  grid-column: span 2;
}

.form-om-summary-card p {
  margin: 0;
}

.form-om-summary-label {
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-om-summary-stack {
  display: grid;
  gap: 6px;
}

.form-om-summary-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.form-om-summary-line strong {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 800;
}

.form-om-summary-line-accent strong {
  color: #2b7a56;
}

.form-om-summary-multi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.form-om-summary-mini {
  min-width: 0;
  padding: 0;
}

.form-om-summary-mini + .form-om-summary-mini {
  padding-left: 14px;
  border-left: 1px solid rgba(24, 36, 51, 0.08);
}

.form-om-summary-mini-label {
  margin: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-om-summary-mini-stack {
  display: grid;
  gap: 6px;
}

.form-om-summary-mini-stack span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.form-om-summary-mini-stack strong {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 800;
}

.form-om-summary-mini-stack .is-accent strong {
  color: #2b7a56;
}

.form-om-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-height: 0;
  max-height: none;
  border-radius: 20px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: #ffffff;
  scrollbar-gutter: stable both-edges;
}

.form-om-chart-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  z-index: 2;
}

.form-om-chart-wrap .dashboard-line-shell {
  min-width: 0;
  width: 100%;
}

.form-om-chart-wrap .dashboard-line-grid {
  gap: 0;
}

.form-om-chart-wrap .dashboard-line-card {
  padding: 10px 12px 12px;
  border-radius: 20px;
}

.form-om-chart-wrap .dashboard-line-chart-frame {
  min-width: 1100px;
}

.form-om-chart-wrap .dashboard-line-svg {
  width: 1100px;
  max-width: none;
}

.form-om-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 10.5px;
  line-height: 1.02;
  color: #1d2733;
  font-variant-numeric: tabular-nums;
}

.form-om-table th,
.form-om-table td {
  padding: 4px 6px;
  white-space: nowrap;
  border-right: 1px solid #d7d7d7;
  border-bottom: 1px solid #d7d7d7;
  text-align: center;
}

.form-om-table thead th {
  position: sticky;
  z-index: 4;
}

.form-om-table thead .sticky-col {
  left: 0;
  z-index: 10;
  box-shadow: 10px 0 18px -16px rgba(24, 36, 51, 0.36);
}

.form-om-groupline th {
  top: 0;
  height: 28px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 800;
  border-top: 2px solid #10171f;
  border-bottom: 2px solid #10171f;
}

.form-om-subline th {
  top: 28px;
  height: 26px;
  background: #f7f7f4;
  font-size: 9.5px;
  color: #778390;
}

.form-om-groupline .sticky-col {
  background: #ffffff;
}

.form-om-subline .sticky-col {
  background: #f7f7f4;
}

.form-om-corner {
  left: 0;
  z-index: 7 !important;
  min-width: 140px;
  background: #dce5de !important;
  color: #132331;
  font-weight: 700;
}

.form-om-city {
  left: 0;
  z-index: 7 !important;
  min-width: 140px;
  font-size: 1rem;
  font-weight: 800;
  background: #eef1f4 !important;
}

.form-om-mode {
  font-size: 1rem;
  font-weight: 800;
  background: #bfcfe9 !important;
}

.group-header {
  background: #ffffff;
}

.subhead-cell {
  min-width: 62px;
}

.subhead-cell.metric-realization {
  min-width: 72px;
}

.form-om-realization-head {
  background: #f4f7fb;
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 6;
  background: #f6f2e8;
  box-shadow: 10px 0 18px -16px rgba(24, 36, 51, 0.38);
}

.day-label {
  min-width: 112px;
  text-align: right !important;
  font-size: 11px;
  font-weight: 700;
  color: #5b6672;
}

.day-label.weekend {
  color: #d62b24;
}

.group-end {
  border-right: 2px solid #242c35 !important;
}

.form-om-table tbody tr:hover td {
  background-image: linear-gradient(0deg, rgba(24, 36, 51, 0.03), rgba(24, 36, 51, 0.03));
}

.form-om-table tbody tr:hover .sticky-col {
  background: #f0eadf;
}

.form-om-table tbody td {
  background: #ffffff;
}

.form-om-table tbody td.plan-cell {
  color: #b9c0c7;
  background: #fbfbfb;
}

.form-om-table tbody td.empty-cell {
  color: #d1d5db;
  background: #fcfbf8;
}

.form-om-table tbody td.heat-neutral {
  color: #a6afb8;
  background: #f6f6f6;
}

.form-om-table tbody td.heat-strong {
  color: #ffffff;
  background: #0d7c10;
}

.form-om-table tbody td.heat-good {
  color: #ffffff;
  background: #5fad44;
}

.form-om-table tbody td.heat-mid {
  color: #2a3037;
  background: #d7ceb0;
}

.form-om-table tbody td.heat-soft {
  color: #6e4e44;
  background: #edd4ce;
}

.form-om-table tbody td.heat-low {
  color: #8e2b1a;
  background: #f0b8af;
}

.form-om-table tbody td.share-cell,
.form-om-table tbody td.realization-cell {
  font-weight: 700;
}

.form-om-realization-stack {
  min-width: 60px;
  display: grid;
  gap: 4px;
  justify-items: stretch;
}

.form-om-realization-value {
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.form-om-realization-bar {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(24, 36, 51, 0.14);
  overflow: hidden;
}

.form-om-realization-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

.future-row td {
  opacity: 0.88;
}

body.theme-dark .form-om-table-wrap {
  border-color: rgba(146, 165, 191, 0.16);
  background: #0c1320;
}

body.theme-dark .form-om-table {
  color: #edf3fd;
}

body.theme-dark .form-om-table th,
body.theme-dark .form-om-table td {
  border-right-color: rgba(146, 165, 191, 0.16);
  border-bottom-color: rgba(146, 165, 191, 0.16);
}

body.theme-dark .form-om-topline th {
  background: #0f1826;
}

body.theme-dark .form-om-cityline th {
  background: #132132;
}

body.theme-dark .form-om-groupline th {
  background: #0b121d;
  border-top-color: #34475d;
  border-bottom-color: #34475d;
}

body.theme-dark .form-om-subline th {
  background: #131d2c;
  color: #90a4bd;
}

body.theme-dark .form-om-corner {
  background: #182737 !important;
  color: #edf3fd;
}

body.theme-dark .form-om-city {
  background: #152231 !important;
}

body.theme-dark .form-om-mode {
  background: #223756 !important;
}

body.theme-dark .group-header {
  background: #0b121d;
}

body.theme-dark .sticky-col {
  background: #121c2a;
  box-shadow: 10px 0 18px -16px rgba(2, 8, 18, 0.78);
}

body.theme-dark .day-label {
  color: #a1b4cb;
}

body.theme-dark .day-label.weekend {
  color: #ff8d7d;
}

body.theme-dark .group-end {
  border-right-color: #31445a !important;
}

body.theme-dark .form-om-table tbody tr:hover td {
  background-image: linear-gradient(0deg, rgba(146, 165, 191, 0.08), rgba(146, 165, 191, 0.08));
}

body.theme-dark .form-om-table tbody tr:hover .sticky-col {
  background: #172434;
}

body.theme-dark .form-om-table tbody td {
  background: #0d1420;
}

body.theme-dark .form-om-table tbody td.plan-cell {
  color: #687c96;
  background: #0d141f;
}

body.theme-dark .form-om-table tbody td.empty-cell {
  color: #56677d;
  background: #0a111a;
}

body.theme-dark .form-om-table tbody td.heat-neutral {
  color: #95a9c1;
  background: #182232;
}

body.theme-dark .form-om-table tbody td.heat-strong {
  background: #0d7c10;
}

body.theme-dark .form-om-table tbody td.heat-good {
  background: #3f9652;
}

body.theme-dark .form-om-table tbody td.heat-mid {
  color: #f1e5c1;
  background: #65583e;
}

body.theme-dark .form-om-table tbody td.heat-soft {
  color: #ffd9ce;
  background: #65443f;
}

body.theme-dark .form-om-table tbody td.heat-low {
  color: #ffd7ce;
  background: #7a3d33;
}

body.theme-dark .form-om-realization-bar {
  background: rgba(146, 165, 191, 0.18);
}

body.theme-dark .form-om-summary-mini {
  background: transparent;
}

body.theme-dark .form-om-summary-mini + .form-om-summary-mini {
  border-left-color: rgba(146, 165, 191, 0.18);
}

body.theme-dark .form-om-region-btn {
  border-color: rgba(146, 165, 191, 0.16);
  background: rgba(13, 20, 32, 0.92);
  color: #9eb1cb;
}

body.theme-dark .form-om-source-label {
  color: #91a3ba;
}

body.theme-dark .form-om-source-select {
  border-color: rgba(146, 165, 191, 0.16);
  background: rgba(13, 20, 32, 0.92);
  color: #edf3fd;
}

body.theme-dark .form-om-source-select:focus {
  border-color: rgba(121, 144, 176, 0.32);
  box-shadow: 0 0 0 3px rgba(96, 117, 148, 0.18);
}

body.theme-dark .form-om-region-btn.is-active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #22324a 0%, #4f6a8a 100%);
}

body.theme-dark .form-om-realization-head {
  background: #121d2d;
}

.dashboard-controls,
.dashboard-metric-panel,
.dashboard-table-panel,
.dashboard-compare-panel,
.dashboard-stage-panel,
.dashboard-signals-panel {
  display: grid;
  gap: 16px;
}

.dashboard-controls {
  overflow: visible;
}

.dashboard-table-panel {
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.dashboard-control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.slice-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filter-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(228, 235, 240, 0.96);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(143, 158, 176, 0.08);
}

.filter-card.filter-card-disabled {
  opacity: 0.72;
}

.filter-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}

.filter-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
}

.filter-helper {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill,
.metric-chip {
  appearance: none;
  border: 1px solid rgba(24, 36, 51, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink-soft);
  padding: 9px 12px;
  font: inherit;
  cursor: pointer;
  transition: 0.2s ease;
}

.filter-pill:hover,
.metric-chip:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.filter-pill.active,
.metric-chip.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #182433 0%, #425770 100%);
  box-shadow: 0 16px 28px rgba(24, 36, 51, 0.16);
}

.metric-chip.active {
  background: linear-gradient(135deg, var(--metric-color, #182433) 0%, #182433 100%);
}

.metric-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-summary-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
}

.dashboard-summary-card p {
  margin: 0;
}

.dashboard-summary-label {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 10px;
}

.dashboard-summary-value {
  font-size: clamp(1.35rem, 2vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.dashboard-summary-compare {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.dashboard-side-column {
  display: grid;
  gap: 18px;
}

.dashboard-visual-shell {
  margin-bottom: 18px;
  padding: 16px 18px 18px;
  border-radius: 24px;
  border: 1px solid rgba(228, 235, 240, 0.96);
  background: rgba(255, 255, 255, 0.96);
}

.dashboard-visual-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.dashboard-visual-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.dashboard-visual-empty {
  padding: 18px;
  border-radius: 18px;
  background: rgba(243, 247, 249, 0.98);
  color: var(--ink-soft);
}

.dashboard-heatmap-surface,
.dashboard-daily-visual,
.dashboard-zin-visual,
.dashboard-pipeline-visual {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.dashboard-heatmap-frame {
  width: max-content;
  min-width: 100%;
}

.dashboard-daily-shell {
  width: max(100%, 920px);
  min-width: 920px;
  display: grid;
  gap: 14px;
}

.dashboard-line-shell {
  width: max(100%, 920px);
  min-width: 920px;
  display: grid;
  gap: 10px;
}

.dashboard-line-toolbar {
  display: grid;
  gap: 8px;
}

.dashboard-graph-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dashboard-graph-mode-btn {
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.dashboard-graph-mode-btn:hover {
  transform: translateY(-1px);
}

.dashboard-graph-mode-btn.is-active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #182433 0%, #425770 100%);
}

.dashboard-graph-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dashboard-graph-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-graph-tab:hover {
  transform: translateY(-1px);
}

.dashboard-graph-tab.is-active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, color-mix(in srgb, var(--graph-color, var(--blue)) 82%, #ffffff 0%) 0%, color-mix(in srgb, var(--graph-color, var(--blue)) 56%, #0f1830 44%) 100%);
  box-shadow: 0 16px 28px color-mix(in srgb, var(--graph-color, var(--blue)) 22%, transparent);
}

.dashboard-graph-tab-swatch {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--graph-color, var(--blue));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--graph-color, var(--blue)) 18%, transparent);
}

.dashboard-line-scale-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.dashboard-line-grid {
  display: grid;
  gap: 14px;
}

.dashboard-line-card {
  display: grid;
  gap: 12px;
  padding: 12px 14px 14px;
  border-radius: 22px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background:
    radial-gradient(circle at top left, rgba(45, 103, 245, 0.06), transparent 48%),
    rgba(255, 255, 255, 0.84);
}

.dashboard-line-card.is-highlight {
  border-color: rgba(45, 103, 245, 0.16);
  background:
    radial-gradient(circle at top left, rgba(45, 103, 245, 0.12), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 255, 0.88) 100%);
}

.dashboard-line-card.is-empty {
  background: rgba(255, 255, 255, 0.78);
}

.dashboard-line-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.dashboard-line-card-copy {
  display: grid;
  gap: 2px;
}

.dashboard-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.dashboard-line-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.dashboard-line-legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--legend-color, var(--blue)) 16%, transparent);
}

.dashboard-line-card-title {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}

.dashboard-line-card-subtext {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.dashboard-line-chart-frame {
  position: relative;
  min-height: 214px;
  padding-top: 2px;
}

.dashboard-line-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.dashboard-line-grid-line {
  stroke: rgba(24, 36, 51, 0.08);
  stroke-width: 1;
  stroke-dasharray: 4 8;
}

.dashboard-line-path {
  fill: none;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.94;
}

.dashboard-line-dot {
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 5px color-mix(in srgb, currentColor 26%, transparent));
  opacity: 0.98;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.16s ease;
}

.dashboard-line-dot.is-active {
  transform: scale(1.24);
}

.dashboard-line-guide {
  stroke: rgba(24, 36, 51, 0.2);
  stroke-width: 1;
  stroke-dasharray: 4 5;
  opacity: 0;
  transition: opacity 0.16s ease;
  pointer-events: none;
}

.dashboard-line-guide.is-visible {
  opacity: 1;
}

.dashboard-line-hit {
  fill: transparent;
  cursor: crosshair;
}

.dashboard-line-hit:focus {
  outline: none;
  fill: rgba(45, 103, 245, 0.035);
}

.dashboard-line-x-label,
.dashboard-line-y-label {
  fill: var(--ink-soft);
  font-size: 10px;
}

.dashboard-line-tooltip {
  position: absolute;
  top: 12px;
  z-index: 2;
  min-width: 170px;
  max-width: 220px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 34px rgba(24, 36, 51, 0.14);
  backdrop-filter: blur(14px);
}

.dashboard-line-tooltip-date {
  margin-bottom: 8px;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ink);
}

.dashboard-line-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.dashboard-line-tooltip-row + .dashboard-line-tooltip-row {
  margin-top: 6px;
}

.dashboard-line-tooltip-row strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.dashboard-line-tooltip-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dashboard-line-tooltip-swatch {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.dashboard-line-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-line-stat {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.dashboard-line-stat span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.dashboard-line-stat strong {
  font-size: 0.94rem;
  color: var(--ink);
  line-height: 1.3;
}

.dashboard-line-stat-trend.up strong {
  color: #0b745c;
}

.dashboard-line-stat-trend.down strong {
  color: #b63c66;
}

.dashboard-line-chart-shell {
  min-height: 320px;
  padding: 8px 0 0;
}

.dashboard-day-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.dashboard-day-tab {
  flex: 0 0 auto;
  min-width: 84px;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-day-tab span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.dashboard-day-tab strong {
  font-size: 0.88rem;
  color: var(--ink);
}

.dashboard-day-tab:hover {
  transform: translateY(-1px);
}

.dashboard-day-tab.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(45, 103, 245, 0.14) 0%, rgba(242, 106, 75, 0.16) 100%);
  box-shadow: 0 16px 26px rgba(24, 36, 51, 0.12);
}

.dashboard-daily-layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.dashboard-daily-focus-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background:
    radial-gradient(circle at top left, rgba(45, 103, 245, 0.08), transparent 56%),
    rgba(255, 255, 255, 0.82);
}

.dashboard-daily-focus-card.up {
  border-color: rgba(15, 140, 120, 0.22);
}

.dashboard-daily-focus-card.down {
  border-color: rgba(242, 106, 75, 0.2);
}

.dashboard-daily-focus-card.flat {
  border-color: rgba(24, 36, 51, 0.08);
}

.dashboard-daily-focus-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.dashboard-daily-kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.dashboard-daily-focus-card h4 {
  margin: 0;
  font-size: 1.18rem;
}

.dashboard-daily-focus-card p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.4;
}

.dashboard-daily-focus-metric {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex-shrink: 0;
}

.dashboard-daily-focus-value {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.dashboard-daily-stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-daily-stat {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(24, 36, 51, 0.05);
}

.dashboard-daily-stat span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.dashboard-daily-stat strong {
  font-size: 0.9rem;
  color: var(--ink);
}

.dashboard-daily-chart-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(76px, 1fr);
  gap: 10px;
  align-items: end;
}

.dashboard-daily-bar-card,
.dashboard-daily-track-card {
  height: 100%;
  min-height: 192px;
  display: grid;
  gap: 10px;
  align-content: end;
  padding: 12px 10px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.dashboard-daily-bar-card:hover,
.dashboard-daily-track-card:hover {
  transform: translateY(-2px);
}

.dashboard-daily-bar-card.is-active,
.dashboard-daily-track-card.is-active {
  border-color: rgba(45, 103, 245, 0.26);
  box-shadow: 0 18px 32px rgba(24, 36, 51, 0.12);
  background:
    radial-gradient(circle at top center, rgba(45, 103, 245, 0.08), transparent 52%),
    rgba(255, 255, 255, 0.9);
}

.dashboard-daily-bar-value {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
}

.dashboard-daily-bar-track {
  height: 112px;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 8px 0 0;
}

.dashboard-daily-bar-fill {
  width: 34px;
  min-height: 14px;
  border-radius: 14px 14px 6px 6px;
  background: rgba(68, 83, 101, 0.32);
}

.dashboard-daily-bar-fill.up {
  background: linear-gradient(180deg, rgba(15, 140, 120, 0.34) 0%, rgba(15, 140, 120, 0.9) 100%);
}

.dashboard-daily-bar-fill.down {
  background: linear-gradient(180deg, rgba(242, 106, 75, 0.28) 0%, rgba(242, 106, 75, 0.92) 100%);
}

.dashboard-daily-bar-fill.flat {
  background: linear-gradient(180deg, rgba(68, 83, 101, 0.2) 0%, rgba(68, 83, 101, 0.72) 100%);
}

.dashboard-daily-bar-caption {
  font-size: 0.76rem;
  color: var(--ink-soft);
  text-align: center;
}

.dashboard-compact-track {
  height: 16px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 36, 51, 0.08);
}

.dashboard-compact-track-mini {
  height: 12px;
}

.dashboard-compact-track-segment {
  display: block;
  height: 100%;
  flex: 0 0 auto;
}

.dashboard-compact-track-empty {
  display: block;
  width: 100%;
  height: 100%;
}

.dashboard-daily-track-card {
  min-height: 172px;
}

.dashboard-daily-track-badge {
  width: fit-content;
  margin: 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.dashboard-daily-track-badge.up {
  color: #0b745c;
  background: rgba(15, 140, 120, 0.14);
}

.dashboard-daily-track-badge.down {
  color: #b63c66;
  background: rgba(255, 111, 136, 0.14);
}

.dashboard-daily-track-badge.flat {
  color: #6f7c8b;
  background: rgba(68, 83, 101, 0.12);
}

.dashboard-pipeline-mini-track {
  height: 18px;
}

.dashboard-pipeline-mini-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-pipeline-mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(24, 36, 51, 0.05);
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.dashboard-heatmap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 10px;
}

.dashboard-heatmap-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.dashboard-heatmap-row,
.dashboard-zin-row,
.dashboard-funnel-card {
  animation: dashboardVisualIn 0.34s ease both;
}

.dashboard-heatmap-row-heading {
  min-width: 220px;
  padding: 0;
  border: 0;
  background: transparent !important;
}

.dashboard-heatmap-row-label {
  min-height: 100%;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(243, 247, 249, 0.98);
}

.dashboard-heatmap-row.is-highlight .dashboard-heatmap-row-label,
.dashboard-zin-row.is-highlight {
  background:
    radial-gradient(circle at top left, rgba(224, 232, 238, 0.96), transparent 58%),
    rgba(243, 247, 249, 0.98);
}

.dashboard-heatmap-row-label strong {
  font-size: 0.98rem;
}

.dashboard-heatmap-row-label span {
  color: var(--ink-soft);
  font-size: 0.83rem;
}

.dashboard-heatmap-cell-top,
.dashboard-heatmap-cell-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.dashboard-heatmap-value-wrap {
  min-height: 92px;
  display: grid;
  gap: 10px;
  align-content: space-between;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.dashboard-heatmap-data-cell {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.dashboard-heatmap-value-wrap strong {
  font-size: 1rem;
}

.dashboard-heatmap-cell-bottom {
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.dashboard-zin-shell {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 16px;
}

.dashboard-zin-list {
  display: grid;
  gap: 14px;
}

.dashboard-zin-row {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 24px;
  background: rgba(24, 36, 51, 0.05);
}

.dashboard-zin-row-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.dashboard-zin-row-head strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.dashboard-zin-row-head span,
.dashboard-zin-track-label,
.dashboard-zin-track-total,
.dashboard-zin-total-label,
.dashboard-zin-key-item span,
.dashboard-zin-legend-stats {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.dashboard-zin-total-stack {
  display: grid;
  justify-items: end;
  gap: 4px;
  flex-shrink: 0;
}

.dashboard-zin-total-label,
.dashboard-zin-key-rank {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.dashboard-zin-row-total {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.dashboard-zin-track-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.34);
}

.dashboard-zin-track-card.is-compare {
  background: rgba(24, 36, 51, 0.03);
}

.dashboard-zin-track-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.dashboard-zin-track-heading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dashboard-zin-track-hint {
  color: var(--ink-soft);
  font-size: 0.76rem;
  white-space: nowrap;
}

.dashboard-zin-hoverzone {
  position: relative;
  min-width: 0;
  padding-top: 2px;
}

.dashboard-zin-track {
  height: 14px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 36, 51, 0.08);
}

.dashboard-zin-track.is-compare {
  opacity: 0.78;
}

.dashboard-zin-segment {
  flex: 0 0 auto;
  height: 100%;
  display: block;
  padding: 0;
  border: 0;
  appearance: none;
  cursor: pointer;
  transform-origin: left center;
  animation: dashboardSegmentGrow 0.42s ease both;
}

.dashboard-zin-segment:hover,
.dashboard-zin-segment:focus-visible {
  filter: brightness(1.08);
}

.dashboard-zin-segment + .dashboard-zin-segment {
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.24);
}

.dashboard-zin-track-empty {
  display: block;
  width: 100%;
  height: 100%;
}

.dashboard-zin-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 4;
  width: min(220px, calc(100vw - 48px));
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(24, 36, 51, 0.1);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(24, 36, 51, 0.18);
  transform: translateX(-50%);
  pointer-events: none;
}

.dashboard-zin-tooltip[hidden] {
  display: none;
}

.dashboard-zin-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid rgba(24, 36, 51, 0.1);
  border-bottom: 1px solid rgba(24, 36, 51, 0.1);
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}

.dashboard-zin-tooltip-head,
.dashboard-zin-tooltip-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-zin-tooltip-head {
  margin-bottom: 6px;
}

.dashboard-zin-tooltip-head strong {
  min-width: 0;
  font-size: 0.86rem;
  line-height: 1.35;
}

.dashboard-zin-tooltip-meta {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.dashboard-funnel-flow {
  width: 100%;
  min-width: 100%;
  display: grid;
  gap: 16px;
}

.dashboard-pipeline-track-stack {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 0 0 12px;
}

.dashboard-pipeline-track-row {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.dashboard-pipeline-track-label {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.dashboard-pipeline-track {
  height: 18px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 36, 51, 0.08);
}

.dashboard-pipeline-track.is-compare {
  opacity: 0.82;
}

.dashboard-pipeline-segment {
  flex: 0 0 auto;
  height: 100%;
  display: block;
  transform-origin: left center;
  animation: dashboardSegmentGrow 0.42s ease both;
}

.dashboard-track-stack {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 10px;
}

.dashboard-segment-labels {
  position: relative;
  min-width: 0;
}

.dashboard-segment-note {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
  padding: 0 4px;
}

.dashboard-segment-note.is-compare {
  opacity: 0.8;
}

.dashboard-segment-note-title,
.dashboard-segment-note-value,
.dashboard-segment-note-share {
  display: block;
  line-height: 1.15;
}

.dashboard-segment-note-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-pipeline-visual-shell .dashboard-pipeline-track-stack {
  gap: 8px;
  padding-bottom: 4px;
}

.dashboard-pipeline-visual-shell .dashboard-pipeline-track-row {
  grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
  gap: 10px;
}

.dashboard-pipeline-visual-shell .dashboard-track-stack {
  gap: 6px;
}

.dashboard-pipeline-visual-shell .dashboard-pipeline-track-label {
  font-size: 0.72rem;
  line-height: 1.1;
  padding-top: 1px;
}

.dashboard-pipeline-visual-shell .dashboard-pipeline-track {
  height: 14px;
}

.dashboard-pipeline-visual-shell .dashboard-segment-note {
  gap: 1px;
  padding: 0 2px;
}

.dashboard-pipeline-visual-shell .dashboard-segment-note-title {
  font-size: 0.63rem;
  line-height: 1.05;
  letter-spacing: 0.03em;
}

.dashboard-pipeline-visual .dashboard-line-card {
  gap: 10px;
  padding: 10px 12px 12px;
}

.dashboard-pipeline-visual .dashboard-line-chart-shell {
  min-height: 240px;
  padding-top: 4px;
}

.dashboard-pipeline-visual .dashboard-line-chart-frame {
  min-height: 178px;
}

.dashboard-segment-note-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}

.dashboard-segment-note-share {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.funnel-bar > span,
.compare-bar-fill,
.dashboard-zin-segment,
.dashboard-pipeline-segment {
  transition: width 0.35s ease;
}

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

@keyframes dashboardSegmentGrow {
  from {
    transform: scaleX(0.8);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

.slice-table-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.slice-table-frame {
  width: max-content;
  min-width: 100%;
}

.dashboard-table-panel-wide {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.slice-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: auto;
}

.slice-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 13px 12px;
  text-align: left;
  background: rgba(244, 245, 255, 0.96);
  border-bottom: 1px solid rgba(24, 36, 51, 0.12);
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  white-space: nowrap;
  min-width: 128px;
}

.dashboard-table-panel .slice-table thead th + th,
.dashboard-table-panel .slice-table tbody td + td {
  border-left: 1px solid rgba(24, 36, 51, 0.08);
}

.dashboard-table-panel .slice-table {
  width: max-content;
  min-width: max-content;
}

.dashboard-table-panel .slice-table thead th {
  padding: 8px 6px;
  font-size: 0.64rem;
  letter-spacing: 0.07em;
  white-space: normal;
  line-height: 1.15;
  word-break: break-word;
  overflow-wrap: anywhere;
  background: #f4f8fa;
  color: #627083;
}

.slice-table tbody td {
  padding: 12px 10px;
  border-top: 1px solid rgba(228, 235, 240, 0.96);
  vertical-align: top;
  background: rgba(255, 255, 255, 0.98);
  white-space: nowrap;
  min-width: 116px;
}

.dashboard-table-panel .slice-table tbody td {
  padding: 8px 6px;
  white-space: normal;
}

.slice-total-row td {
  background: rgba(244, 247, 249, 0.98);
}

.slice-focus-row td {
  background: rgba(238, 244, 248, 0.98);
}

.slice-total-row .slice-name strong,
.slice-total-row .metric-primary {
  font-weight: 800;
}

.slice-name-cell {
  min-width: 180px;
}

.dashboard-table-panel .slice-name-cell {
  min-width: 144px;
}

.dashboard-table-panel .slice-col-name,
.dashboard-table-panel .slice-name-cell {
  width: 144px;
  min-width: 144px;
  max-width: 144px;
}

.dashboard-table-panel .slice-col-metric-group {
  min-width: 132px;
  text-align: center;
}

.dashboard-table-panel .slice-col-metric,
.dashboard-table-panel .slice-metric-cell {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
}

.dashboard-table-panel .slice-col-metric.metric-budget,
.dashboard-table-panel .slice-metric-cell.metric-budget {
  width: 104px;
  min-width: 104px;
  max-width: 104px;
}

.dashboard-table-panel .slice-col-metric-split,
.dashboard-table-panel .slice-metric-cell-split {
  width: 66px;
  min-width: 66px;
  max-width: 66px;
}

.dashboard-table-panel .slice-col-metric-split.metric-budget,
.dashboard-table-panel .slice-metric-cell-split.metric-budget {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}

.dashboard-table-panel .slice-col-metric-group.metric-budget {
  min-width: 160px;
}

.dashboard-table-panel .slice-compare-head-row th {
  top: 0;
  z-index: 4;
  padding: 5px 4px;
  font-size: 0.58rem;
  line-height: 1.05;
}

.dashboard-table-panel .slice-compare-subhead-row th {
  top: 34px;
  z-index: 3;
  padding: 5px 3px;
  font-size: 0.46rem;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.dashboard-table-panel .slice-compare-subhead-row .slice-col-metric-split {
  background: rgba(246, 249, 251, 0.98);
}

.dashboard-table-panel .slice-col-metric-split.is-compare-column,
.dashboard-table-panel .slice-metric-cell-split.is-compare-column {
  background:
    linear-gradient(0deg, rgba(230, 237, 242, 0.94), rgba(230, 237, 242, 0.94)),
    rgba(255, 255, 255, 0.98);
  box-shadow: inset 1px 0 0 rgba(208, 217, 225, 0.96);
}

.slice-name {
  display: grid;
  gap: 6px;
  white-space: normal;
}

.slice-name strong {
  font-size: 1rem;
}

.dashboard-table-panel .slice-name {
  gap: 4px;
}

.dashboard-table-panel .slice-name strong {
  font-size: 0.88rem;
}

.slice-subtext {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.dashboard-table-panel .slice-subtext {
  font-size: 0.72rem;
}

.metric-cell {
  display: grid;
  gap: 6px;
}

.dashboard-table-panel .metric-cell {
  gap: 4px;
}

.metric-cell-split {
  gap: 1px;
}

.dashboard-table-panel .metric-cell-split .metric-primary {
  font-size: 0.78rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.dashboard-table-panel .metric-cell-split .metric-secondary {
  font-size: 0.62rem;
  line-height: 1.18;
}

.dashboard-table-panel .metric-cell-split .metric-tertiary {
  font-size: 0.58rem;
  line-height: 1.15;
}

.dashboard-table-panel .slice-metric-cell-split {
  padding: 7px 4px;
}

.metric-cell-inline-compare {
  min-width: 132px;
}

.dashboard-table-panel .metric-cell-inline-compare {
  min-width: 100%;
}

.metric-inline-head,
.metric-inline-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric-inline-head {
  align-items: flex-start;
}

.dashboard-table-panel .metric-inline-head,
.dashboard-table-panel .metric-inline-foot {
  gap: 6px;
}

.metric-primary {
  font-size: 1rem;
  font-weight: 700;
}

.dashboard-table-panel .metric-primary {
  font-size: 0.86rem;
  line-height: 1.05;
}

.metric-compare-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-table-panel .metric-compare-badge {
  padding: 3px 6px;
  border-radius: 9px;
  font-size: 0.68rem;
}

.metric-compare-badge.up {
  color: #0b745c;
  background: rgba(15, 140, 120, 0.14);
}

.metric-compare-badge.down {
  color: #b63c66;
  background: rgba(255, 111, 136, 0.14);
}

.metric-compare-badge.flat {
  color: #6f7c8b;
  background: rgba(68, 83, 101, 0.12);
}

.metric-secondary {
  color: var(--ink-soft);
  font-size: 0.83rem;
}

.dashboard-pipeline-visual-shell {
  padding: 12px 14px 12px;
}

.dashboard-pipeline-visual-shell .dashboard-visual-head {
  align-items: center;
  margin-bottom: 10px;
}

.dashboard-pipeline-visual-shell .dashboard-visual-title {
  font-size: 0.82rem;
}

.dashboard-table-panel .metric-secondary {
  font-size: 0.68rem;
  line-height: 1.2;
}

.dashboard-table-panel .table-head .eyebrow {
  display: none;
}

.dashboard-table-panel .table-head h3 {
  font-size: 1.22rem;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.dashboard-zin-panel .slice-name strong,
.dashboard-pipeline-panel .slice-name strong {
  font-size: 0.88rem;
}

.dashboard-zin-panel .slice-subtext,
.dashboard-pipeline-panel .slice-subtext {
  font-size: 0.72rem;
}

.dashboard-zin-panel .metric-cell-split .metric-primary,
.dashboard-pipeline-panel .metric-cell-split .metric-primary {
  font-size: 0.8rem;
}

.dashboard-zin-panel .metric-cell-split .metric-secondary,
.dashboard-pipeline-panel .metric-cell-split .metric-secondary {
  font-size: 0.62rem;
}

.dashboard-zin-panel .metric-cell-split .metric-tertiary,
.dashboard-pipeline-panel .metric-cell-split .metric-tertiary {
  font-size: 0.66rem;
}

.metric-tertiary {
  color: var(--ink);
  opacity: 0.72;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: normal;
}

.metric-secondary-meta {
  color: var(--ink-soft);
}

.metric-share {
  font-weight: 700;
}

.metric-share-good {
  color: var(--teal);
}

.metric-share-warn {
  color: #b88726;
}

.metric-share-bad {
  color: #c84d71;
}

.cohort-stack {
  display: grid;
  gap: 18px;
}

.cohort-controls {
  top: var(--shell-pad);
  z-index: 38;
}

.cohort-header-note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.cohort-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  justify-content: flex-start;
}

.cohort-period-block,
.cohort-region-block,
.cohort-slice-block {
  min-width: 0;
}

.cohort-toolbar .cohort-period-block,
.cohort-toolbar .cohort-region-block,
.cohort-toolbar .cohort-slice-block {
  position: relative;
}

.cohort-toolbar .cohort-region-block::before,
.cohort-toolbar .cohort-slice-block::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: rgba(220, 228, 234, 0.96);
}

.cohort-region-block .control-label::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s6-4.35 6-10a6 6 0 1 0-12 0c0 5.65 6 10 6 10Z'/%3E%3Ccircle cx='12' cy='11' r='2.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s6-4.35 6-10a6 6 0 1 0-12 0c0 5.65 6 10 6 10Z'/%3E%3Ccircle cx='12' cy='11' r='2.5'/%3E%3C/svg%3E");
}

.cohort-slice-block .control-label::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M4 12h12'/%3E%3Cpath d='M4 17h9'/%3E%3Ccircle cx='18' cy='7' r='2' fill='black' stroke='none'/%3E%3Ccircle cx='14' cy='12' r='2' fill='black' stroke='none'/%3E%3Ccircle cx='11' cy='17' r='2' fill='black' stroke='none'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M4 12h12'/%3E%3Cpath d='M4 17h9'/%3E%3Ccircle cx='18' cy='7' r='2' fill='black' stroke='none'/%3E%3Ccircle cx='14' cy='12' r='2' fill='black' stroke='none'/%3E%3Ccircle cx='11' cy='17' r='2' fill='black' stroke='none'/%3E%3C/svg%3E");
}

.cohort-slice-control {
  min-width: 0;
}

.cohort-toolbar-actions {
  margin-left: auto;
  flex: 0 0 auto;
  justify-content: end;
}

.cohort-stage-grid {
  display: block;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.cohort-config-card {
  display: grid;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(228, 235, 240, 0.96);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.cohort-config-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.cohort-config-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink);
}

.cohort-config-note {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.cohort-config-grid {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.cohort-display-mode-block .segmented {
  justify-content: flex-start;
  gap: 6px;
}

.cohort-metric-control.is-muted {
  opacity: 0.68;
}

.cohort-metric-selector {
  gap: 8px;
}

.cohort-metric-selector .metric-chip {
  padding: 8px 11px;
  font-size: 0.82rem;
  font-weight: 700;
}

.cohort-stage-card {
  min-height: 112px;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 14px 14px;
  border: 0;
  border-right: 1px solid rgba(228, 235, 240, 0.96);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cohort-stage-card:last-child {
  border-right: 0;
}

.cohort-stage-card:hover {
  transform: translateY(-1px);
}

.cohort-stage-card-static {
  cursor: default;
}

.cohort-stage-card-static:hover {
  transform: none;
}

.cohort-stage-card.active {
  background:
    radial-gradient(circle at top left, rgba(219, 228, 235, 0.92), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 248, 250, 0.98) 100%);
}

.cohort-stage-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6a7890;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cohort-stage-value {
  font-size: 1.56rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.cohort-stage-meta {
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.cohort-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.cohort-insight-card {
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(228, 235, 240, 0.96);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.cohort-insight-label {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7f8ca0;
}

.cohort-insight-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.cohort-insight-note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.cohort-week-panel {
  padding-top: 14px;
  padding-bottom: 14px;
}

.cohort-week-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cohort-week-tab {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(228, 235, 240, 0.96);
  border-radius: 999px;
  background: rgba(248, 250, 251, 0.98);
  color: var(--ink-soft);
  cursor: pointer;
}

.cohort-week-tab.active {
  color: var(--ink);
  border-color: rgba(214, 223, 229, 0.96);
  background: rgba(239, 244, 247, 0.98);
}

.cohort-week-short {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(137, 171, 255, 0.16);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.cohort-week-range {
  font-size: 0.9rem;
}

.cohort-table {
  width: max-content;
  min-width: 1540px;
}

.cohort-table-stack {
  display: grid;
  gap: 14px;
}

.cohort-table-all {
  width: max-content;
  min-width: max-content;
}

.cohort-table .slice-name-cell {
  width: 414px;
  min-width: 414px;
  max-width: 414px;
}

.cohort-landing-cell {
  vertical-align: top;
}

.cohort-table .cohort-form-cell {
  width: 286px;
  min-width: 286px;
  max-width: 286px;
}

.cohort-table-all .slice-name-cell {
  width: 384px;
  min-width: 384px;
  max-width: 384px;
}

.cohort-table-all .cohort-form-cell {
  width: 236px;
  min-width: 236px;
  max-width: 236px;
}

.cohort-col-metric-all,
.cohort-metric-cell-all {
  width: 138px;
  min-width: 138px;
  max-width: 138px;
}

.cohort-col-metric-all {
  text-align: center;
}

.cohort-col-metric-all.is-active {
  background: rgba(232, 238, 244, 0.98);
  color: var(--ink) !important;
}

.cohort-metric-cell-all {
  padding: 8px 6px !important;
}

.cohort-base-metric-cell {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

.cohort-fixed-divider {
  border-right: 3px solid rgba(198, 208, 217, 0.96) !important;
}

.cohort-metric-cell-split {
  display: grid;
  gap: 4px;
}

.cohort-metric-cell-split.is-active {
  padding: 6px 5px;
  border-radius: 12px;
  background: rgba(45, 103, 245, 0.05);
}

.cohort-metric-cell-split .metric-primary {
  font-size: 0.8rem;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.cohort-metric-cell-split .metric-secondary {
  font-size: 0.64rem;
  line-height: 1.18;
  color: var(--ink-soft);
}

.cohort-metric-cell-split .metric-tertiary {
  font-size: 0.62rem;
  line-height: 1.16;
}

.cohort-base-cell .metric-primary {
  font-size: 0.86rem;
  line-height: 1.08;
}

.cohort-base-cell .metric-secondary {
  font-size: 0.66rem;
  line-height: 1.18;
}

.cohort-table-block {
  display: grid;
  gap: 10px;
}

.cohort-table-block-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
}

.cohort-table-block-head h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.cohort-table-block-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: right;
}

.cohort-table-wrap {
  border-radius: 24px;
  border: 1px solid rgba(24, 36, 51, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

.cohort-table .metric-cell {
  gap: 4px;
}

.cohort-metric-cell.is-active {
  padding: 8px 9px;
  border-radius: 14px;
  background: rgba(45, 103, 245, 0.06);
}

.cohort-week-col-active {
  background: rgba(222, 231, 255, 0.82) !important;
}

.cohort-group-row td {
  background: rgba(225, 233, 252, 0.62);
}

.cohort-child-row td {
  background: rgba(255, 255, 255, 0.88);
}

.cohort-child-name {
  padding-left: 18px;
  position: relative;
}

.cohort-landing-stack {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.cohort-landing-toggle,
.cohort-landing-toggle-placeholder {
  width: 28px;
  height: 28px;
  margin-top: 2px;
}

.cohort-landing-toggle {
  border: 1px solid rgba(164, 183, 228, 0.58);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.cohort-landing-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(90, 119, 218, 0.52);
  background: rgba(232, 239, 255, 0.98);
}

.cohort-landing-toggle.is-merged {
  background: rgba(225, 233, 252, 0.98);
}

.cohort-landing-toggle-placeholder {
  display: block;
}

.cohort-form-cell {
  min-width: 190px;
}

.cohort-form-name {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cohort-attached-row td {
  background: rgba(249, 251, 255, 0.96);
}

.cohort-form-name strong {
  font-size: 0.94rem;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.cohort-landing-label {
  display: block;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cohort-form-name-lines {
  display: grid;
  gap: 2px;
}

.cohort-form-line {
  display: block;
}

.cohort-table .slice-name strong,
.cohort-table .cohort-form-name strong,
.cohort-table-all .slice-name strong,
.cohort-table-all .cohort-form-name strong {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.cohort-child-name::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(90, 119, 218, 0.32);
}

.cohort-week-badge {
  min-width: 58px;
  display: inline-grid;
  justify-items: center;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(164, 183, 228, 0.48);
  background: rgba(255, 255, 255, 0.92);
}

.cohort-week-badge strong {
  font-size: 1rem;
}

.cohort-week-badge span {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.cohort-week-badge.active {
  border-color: rgba(116, 154, 240, 0.54);
  background: linear-gradient(180deg, rgba(227, 244, 235, 0.96) 0%, rgba(206, 237, 219, 0.96) 100%);
}

.cohort-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: lowercase;
}

.cohort-status-chip.top {
  color: #1f7c56;
  background: rgba(191, 238, 217, 0.96);
}

.cohort-status-chip.normal {
  color: #3b5da2;
  background: rgba(211, 222, 255, 0.96);
}

.cohort-status-chip.weak {
  color: #9a6f20;
  background: rgba(247, 233, 198, 0.96);
}

.cohort-status-chip.total {
  color: var(--ink);
  background: rgba(24, 36, 51, 0.08);
}

body.theme-dark .cohort-stage-grid,
body.theme-dark .cohort-insight-card,
body.theme-dark .cohort-stage-card,
body.theme-dark .cohort-week-panel {
  border-color: rgba(146, 165, 191, 0.16);
}

body.theme-dark .cohort-config-card,
body.theme-dark .cohort-stage-grid,
body.theme-dark .cohort-insight-card {
  background: rgba(12, 22, 35, 0.9);
}

body.theme-dark .cohort-stage-grid {
  background: transparent;
}

body.theme-dark .cohort-stage-card {
  background: rgba(10, 18, 29, 0.88);
  border-right-color: rgba(146, 165, 191, 0.12);
}

body.theme-dark .cohort-stage-card.active {
  background:
    radial-gradient(circle at top left, rgba(86, 112, 255, 0.28), transparent 46%),
    linear-gradient(180deg, rgba(17, 28, 45, 0.98) 0%, rgba(12, 36, 54, 0.98) 100%);
}

body.theme-dark .cohort-table-wrap {
  background: rgba(8, 14, 24, 0.94);
  border-color: rgba(146, 165, 191, 0.16);
}

body.theme-dark .cohort-fixed-divider {
  border-right-color: rgba(92, 110, 136, 0.94) !important;
}

body.theme-dark .cohort-metric-cell.is-active {
  background: rgba(32, 47, 78, 0.92);
}

body.theme-dark .cohort-col-metric-all.is-active {
  background: rgba(27, 40, 61, 0.96);
  color: #edf3fd !important;
}

body.theme-dark .cohort-metric-cell-split.is-active {
  background: rgba(32, 47, 78, 0.92);
}

body.theme-dark .cohort-stage-label {
  color: #a8bbf2;
}

body.theme-dark .cohort-week-tab,
body.theme-dark .cohort-week-badge,
body.theme-dark .cohort-toolbar .dashboard-date-input,
body.theme-dark .cohort-toolbar .dashboard-select {
  background: rgba(12, 22, 35, 0.96);
  border-color: rgba(146, 165, 191, 0.16);
}

body.theme-dark .cohort-week-tab.active,
body.theme-dark .cohort-week-col-active {
  background: rgba(32, 47, 78, 0.96) !important;
}

body.theme-dark .cohort-group-row td {
  background: rgba(27, 40, 61, 0.88);
}

body.theme-dark .cohort-child-row td {
  background: rgba(12, 22, 35, 0.9);
}

body.theme-dark .cohort-attached-row td {
  background: rgba(15, 27, 43, 0.96);
}

body.theme-dark .cohort-landing-toggle {
  background: rgba(12, 22, 35, 0.96);
  border-color: rgba(146, 165, 191, 0.22);
  color: #edf3fd;
}

body.theme-dark .cohort-landing-toggle:hover {
  background: rgba(27, 40, 61, 0.96);
  border-color: rgba(116, 154, 240, 0.44);
}

body.theme-dark .cohort-landing-toggle.is-merged {
  background: rgba(32, 47, 78, 0.96);
}

body.theme-dark .cohort-status-chip.total {
  color: #edf3fd;
  background: rgba(146, 165, 191, 0.18);
}

.metric-delta {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.dashboard-table-panel .metric-delta {
  padding: 4px 7px;
  font-size: 0.74rem;
}

.metric-delta.up {
  color: #0b745c;
  background: rgba(15, 140, 120, 0.14);
}

.metric-delta.down {
  color: #b63c66;
  background: rgba(255, 111, 136, 0.14);
}

.metric-delta.flat {
  color: #6f7c8b;
  background: rgba(68, 83, 101, 0.12);
}

.dashboard-compare-chart {
  display: grid;
  gap: 14px;
}

.compare-row {
  display: grid;
  gap: 8px;
}

.compare-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.compare-row-name {
  font-weight: 700;
}

.compare-row-meta {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.compare-bars {
  display: grid;
  gap: 7px;
}

.compare-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 36, 51, 0.08);
}

.compare-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.compare-bar-fill.current {
  background: linear-gradient(90deg, var(--blue), #7f90a5);
}

.compare-bar-fill.previous {
  background: linear-gradient(90deg, rgba(24, 36, 51, 0.22), rgba(24, 36, 51, 0.42));
}

.stage-grid {
  display: grid;
  gap: 12px;
}

.stage-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(24, 36, 51, 0.05);
}

.stage-card p {
  margin: 0;
}

.stage-label {
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stage-value {
  margin-top: 8px;
  font-size: 1.22rem;
  font-weight: 800;
}

.stage-meta {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.dashboard-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-signal-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(24, 36, 51, 0.05);
}

.dashboard-signal-card p {
  margin: 0;
}

.dashboard-signal-kicker {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.dashboard-signal-title {
  margin-top: 8px;
  font-size: 1.04rem;
  font-weight: 700;
}

.dashboard-signal-body {
  margin-top: 8px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.zin-stack {
  display: grid;
  gap: 18px;
}

.zin-control-note {
  min-height: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(24, 36, 51, 0.04);
  color: var(--ink-soft);
  line-height: 1.6;
}

.zin-control-note p {
  margin: 0;
}

.zin-visual-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
}

.zin-reason-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.zin-donut {
  width: min(100%, 240px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(24, 36, 51, 0.05);
}

.zin-donut-hole {
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 22px rgba(24, 36, 51, 0.12);
}

.zin-donut-value {
  font-size: clamp(1.4rem, 2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.zin-donut-label {
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.zin-legend {
  display: grid;
  gap: 10px;
}

.zin-legend-row {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(24, 36, 51, 0.04);
}

.zin-legend-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.zin-legend-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.zin-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.zin-legend-meta {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.zin-empty-state {
  padding: 18px;
  border-radius: 18px;
  background: rgba(24, 36, 51, 0.04);
  color: var(--ink-soft);
}

.roadmap-panel {
  min-height: 220px;
  display: grid;
  align-content: start;
}

.roadmap-note {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.media-plan-stack {
  display: grid;
  gap: 20px;
}

.media-plan-hero {
  overflow: visible;
  padding: 14px 16px;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(143, 158, 176, 0.1);
}

.media-plan-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  align-items: start;
  margin-bottom: 8px;
}

.media-plan-head > div:first-child {
  min-width: 0;
}

.media-plan-head .eyebrow {
  margin-bottom: 4px;
}

.media-plan-head h3 {
  font-size: 1.42rem;
}

.media-plan-head .roadmap-note {
  margin-top: 4px;
  max-width: 980px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.media-plan-head .table-meta {
  padding-top: 2px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.media-plan-toolbar {
  margin-top: 6px;
}

.media-plan-toolbar .control-block {
  gap: 6px;
}

.media-plan-toolbar .control-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.media-plan-toolbar .segmented.compact {
  gap: 8px;
}

.media-plan-toolbar .switch-btn.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.media-plan-region-stack {
  display: grid;
  gap: 18px;
}

.media-plan-region-card {
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(143, 158, 176, 0.1);
}

.media-plan-region-shell {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
}

.media-plan-region-accent {
  background: #5f7284;
}

.media-plan-region-content {
  padding: 12px 12px 14px;
}

.media-plan-region-head h3 {
  margin: 0;
  color: #314255;
  font-size: 1.34rem;
  letter-spacing: -0.02em;
}

.media-plan-top-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(268px, 1.02fr) minmax(230px, 0.78fr) minmax(230px, 0.88fr);
  gap: 10px;
}

.media-plan-top-card {
  border: 1px solid rgba(218, 226, 232, 0.96);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
  padding: 10px 12px;
}

.media-plan-summary-card {
  display: grid;
  gap: 7px;
}

.media-plan-mini-row {
  display: grid;
  grid-template-columns: minmax(106px, 1fr) minmax(96px, auto) 48px;
  gap: 7px;
  align-items: center;
}

.media-plan-mini-label,
.media-plan-target-label,
.media-plan-request-item > span,
.media-plan-request-percent > span {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.84rem;
}

.media-plan-mini-share {
  justify-self: end;
  color: #7b8797;
  font-weight: 700;
  font-size: 0.78rem;
}

.media-plan-target-card {
  display: grid;
  gap: 7px;
  align-content: center;
}

.media-plan-target-row {
  display: grid;
  grid-template-columns: 62px minmax(92px, auto) auto;
  gap: 7px;
  align-items: center;
}

.media-plan-target-sub {
  justify-self: end;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.8rem;
}

.media-plan-request-card {
  background: #f7fafb;
  border-color: rgba(214, 223, 229, 0.96);
}

.media-plan-request-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.media-plan-request-money {
  min-width: 138px;
}

.media-plan-request-percent {
  display: grid;
  gap: 5px;
  justify-items: end;
}

.media-plan-request-grid {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.media-plan-request-item {
  display: grid;
  gap: 4px;
}

.media-plan-request-item strong {
  color: #5d6f82;
  font-size: 0.82rem;
}

.media-plan-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(214, 223, 229, 0.96);
  border-radius: 8px;
  background: #ffffff;
  min-height: 32px;
  padding: 5px 8px;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.15;
}

.media-plan-input.is-numeric {
  text-align: right;
}

.media-plan-input:focus {
  outline: none;
  border-color: rgba(95, 114, 132, 0.72);
  box-shadow: 0 0 0 2px rgba(95, 114, 132, 0.12);
}

.media-plan-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(220, 228, 234, 0.96);
  border-radius: 14px;
  background: #ffffff;
}

.media-plan-table {
  width: 100%;
  min-width: 1560px;
  border-collapse: collapse;
  line-height: 1.12;
}

.media-plan-table th,
.media-plan-table td {
  padding: 7px 7px;
  border: 1px solid rgba(228, 235, 240, 0.96);
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
  font-size: 0.82rem;
}

.media-plan-table th:first-child,
.media-plan-table td:first-child {
  text-align: left;
}

.media-plan-table thead th {
  background: #eff3f5;
  color: #627083;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.media-plan-channel-cell {
  min-width: 148px;
  color: #3f4d60;
  font-weight: 700;
  font-size: 0.84rem;
}

.media-plan-section-row td {
  background: #f2f5f7;
  color: #5d6d7d;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  font-size: 0.78rem;
}

.media-plan-section-row.is-discovery td {
  background: #f6f8f9;
}

.media-plan-total-row td {
  background: #f8fafb;
  color: #445468;
  font-weight: 800;
}

.media-plan-derived {
  color: #5b6c80;
  font-weight: 600;
  font-size: 0.8rem;
}

.media-plan-table td .media-plan-input {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
  margin-left: auto;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 0.8rem;
}

.monthly-report-stack {
  display: grid;
  gap: 20px;
}

.monthly-report-hero {
  overflow: visible;
  padding: 14px 16px;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(143, 158, 176, 0.1);
}

.monthly-report-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  align-items: start;
}

.monthly-report-head h3 {
  font-size: 1.42rem;
}

.monthly-report-head .roadmap-note {
  margin-top: 4px;
  max-width: 980px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.monthly-report-head .table-meta {
  padding-top: 2px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.monthly-report-toolbar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.monthly-report-region-stack {
  display: grid;
  gap: 0;
}

.monthly-report-region-card {
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(143, 158, 176, 0.1);
}

.monthly-report-region-shell {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
}

.monthly-report-region-accent {
  background: #5f7284;
}

.monthly-report-region-content {
  padding: 14px 14px 16px;
}

.monthly-report-region-head {
  display: flex;
  justify-content: space-between;
  gap: 14px 18px;
  align-items: start;
  margin-bottom: 10px;
}

.monthly-report-region-head h3 {
  margin: 0;
  color: #314255;
  font-size: 1.34rem;
  letter-spacing: -0.02em;
}

.monthly-report-region-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.monthly-report-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid rgba(220, 228, 234, 0.96);
  background: #ffffff;
}

.monthly-report-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
}

.monthly-report-table th,
.monthly-report-table td {
  padding: 8px 9px;
  border: 1px solid rgba(228, 235, 240, 0.96);
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
  font-size: 0.82rem;
}

.monthly-report-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eff3f5;
  color: #627083;
}

.monthly-report-corner,
.monthly-report-label-cell {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left !important;
}

.monthly-report-corner {
  min-width: 270px;
  background: #eff3f5 !important;
  font-size: 0.76rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.monthly-report-month-head {
  text-align: left !important;
  font-size: 0.88rem !important;
  font-weight: 800;
}

.monthly-report-month-divider,
.monthly-report-month-divider-head {
  border-right-width: 3px !important;
  border-right-color: rgba(198, 208, 217, 0.96) !important;
}

.monthly-report-subhead-row th {
  font-size: 0.68rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7b8797;
}

.monthly-report-label-cell {
  min-width: 270px;
  color: #1e2a39;
  font-weight: 700;
  background: #fbfcfd;
}

.monthly-report-cell-plan {
  color: #8f9aa6;
  background: #fbfcfd;
}

.monthly-report-cell-fact,
.monthly-report-cell-delta {
  font-weight: 700;
}

.monthly-report-cell-fact.up,
.monthly-report-cell-delta.up {
  color: #19a05d;
}

.monthly-report-cell-fact.down,
.monthly-report-cell-delta.down {
  color: #e05656;
}

.monthly-report-cell-fact.flat,
.monthly-report-cell-delta.flat {
  color: #66758a;
}

.monthly-report-section-row td {
  text-align: left;
  background: #f2f5f7;
  color: #5d6d7d;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.monthly-report-row.tone-violet .monthly-report-label-cell {
  background: #f7f9fa;
}

.monthly-report-row.tone-sand .monthly-report-label-cell {
  background: #f7f9fa;
}

.monthly-report-row.tone-rose .monthly-report-label-cell {
  background: #f7f9fa;
}

.monthly-report-row.tone-gold .monthly-report-label-cell {
  background: #f7f9fa;
}

.monthly-report-row.tone-green .monthly-report-label-cell {
  background: #f7f9fa;
}

.monthly-report-row.tone-blue .monthly-report-label-cell {
  background: #f7f9fa;
}

body.theme-dark .zin-control-note,
body.theme-dark .zin-legend-row,
body.theme-dark .zin-empty-state,
body.theme-dark .filter-empty-note {
  background: rgba(146, 165, 191, 0.08);
}

body.theme-dark .roadmap-note {
  color: #a8bbd8;
}

body.theme-dark .media-plan-region-accent {
  background: #506175;
}

body.theme-dark .media-plan-region-head h3 {
  color: #c8d8ef;
}

body.theme-dark .monthly-report-region-accent {
  background: #506175;
}

body.theme-dark .monthly-report-region-head h3 {
  color: #d9e6fa;
}

body.theme-dark .monthly-report-table-wrap {
  border-color: rgba(146, 165, 191, 0.16);
}

body.theme-dark .monthly-report-table th,
body.theme-dark .monthly-report-table td {
  border-color: rgba(146, 165, 191, 0.16);
}

body.theme-dark .monthly-report-table thead th,
body.theme-dark .monthly-report-corner {
  background: #121d2d !important;
  color: #a9bdd8;
}

body.theme-dark .monthly-report-month-divider,
body.theme-dark .monthly-report-month-divider-head {
  border-right-color: rgba(92, 110, 136, 0.94) !important;
}

body.theme-dark .monthly-report-label-cell {
  color: #edf3fd;
  background: #101926;
}

body.theme-dark .monthly-report-cell-plan {
  background: rgba(13, 20, 32, 0.94);
  color: #687c96;
}

body.theme-dark .monthly-report-section-row td {
  background: rgba(28, 39, 55, 0.96);
}

body.theme-dark .monthly-report-row.tone-violet .monthly-report-label-cell {
  background: rgba(18, 27, 38, 0.96);
}

body.theme-dark .monthly-report-row.tone-sand .monthly-report-label-cell {
  background: rgba(18, 27, 38, 0.96);
}

body.theme-dark .monthly-report-row.tone-rose .monthly-report-label-cell {
  background: rgba(18, 27, 38, 0.96);
}

body.theme-dark .monthly-report-row.tone-gold .monthly-report-label-cell {
  background: rgba(18, 27, 38, 0.96);
}

body.theme-dark .monthly-report-row.tone-green .monthly-report-label-cell {
  background: rgba(18, 27, 38, 0.96);
}

body.theme-dark .monthly-report-row.tone-blue .monthly-report-label-cell {
  background: rgba(18, 27, 38, 0.96);
}

body.theme-dark .media-plan-top-card,
body.theme-dark .media-plan-input,
body.theme-dark .media-plan-table thead th,
body.theme-dark .media-plan-total-row td,
body.theme-dark .media-plan-section-row td {
  border-color: rgba(146, 165, 191, 0.16);
}

body.theme-dark .media-plan-top-card,
body.theme-dark .media-plan-input {
  background: rgba(12, 22, 35, 0.92);
}

body.theme-dark .media-plan-request-card {
  background: rgba(14, 24, 36, 0.96);
  border-color: rgba(146, 165, 191, 0.18);
}

body.theme-dark .media-plan-table th,
body.theme-dark .media-plan-table td {
  border-color: rgba(146, 165, 191, 0.12);
}

body.theme-dark .media-plan-table thead th {
  background: rgba(27, 40, 61, 0.95);
  color: #a8bbd8;
}

body.theme-dark .media-plan-section-row td,
body.theme-dark .media-plan-section-row.is-discovery td {
  background: rgba(25, 40, 56, 0.96);
  color: #d7e8f9;
}

body.theme-dark .media-plan-total-row td {
  background: rgba(15, 27, 43, 0.96);
  color: #d7e8f9;
}

body.theme-dark .media-plan-derived,
body.theme-dark .media-plan-target-sub,
body.theme-dark .media-plan-mini-share {
  color: #9fc2db;
}

body.theme-dark .media-plan-mini-label,
body.theme-dark .media-plan-target-label,
body.theme-dark .media-plan-request-item > span,
body.theme-dark .media-plan-request-percent > span {
  color: #edf3fd;
}

body.theme-dark .media-plan-channel-cell {
  color: #f0ac48;
}

body.theme-dark .zin-donut-hole {
  background: #0f1826;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
}

@media (max-height: 960px) and (min-width: 900px) {
  .media-plan-hero {
    padding: 14px 16px;
  }

  .media-plan-head {
    gap: 12px 18px;
    margin-bottom: 8px;
  }

  .media-plan-head h3 {
    font-size: 1.34rem;
  }

  .media-plan-head .roadmap-note {
    margin-top: 4px;
    font-size: 0.92rem;
  }

  .media-plan-head .table-meta {
    font-size: 0.82rem;
  }

  .media-plan-toolbar {
    margin-top: 4px;
  }

  .media-plan-toolbar .control-block {
    gap: 4px;
  }

  .media-plan-toolbar .switch-btn.compact {
    min-height: 32px;
    padding: 6px 11px;
    font-size: 0.82rem;
  }

  .media-plan-region-stack {
    gap: 14px;
  }

  .media-plan-region-card {
    padding: 14px;
    border-radius: 18px;
  }

  .media-plan-region-shell {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .media-plan-region-content {
    padding: 12px 12px 14px;
  }

  .media-plan-region-head h3 {
    font-size: 1.48rem;
  }

  .media-plan-top-grid {
    margin-top: 8px;
    gap: 8px;
  }

  .media-plan-top-card {
    border-radius: 14px;
    padding: 10px 12px;
  }

  .media-plan-summary-card,
  .media-plan-target-card {
    gap: 6px;
  }

  .media-plan-mini-row {
    grid-template-columns: minmax(102px, 1fr) minmax(96px, auto) 46px;
    gap: 6px;
  }

  .media-plan-target-row {
    grid-template-columns: 58px minmax(92px, auto) auto;
    gap: 6px;
  }

  .media-plan-request-top {
    gap: 12px;
  }

  .media-plan-request-money {
    min-width: 128px;
  }

  .media-plan-request-percent {
    gap: 6px;
  }

  .media-plan-request-grid {
    margin-top: 10px;
    gap: 10px;
  }

  .media-plan-request-item {
    gap: 4px;
  }

  .media-plan-input {
    min-height: 30px;
    border-radius: 8px;
    padding: 5px 7px;
    font-size: 0.82rem;
  }

  .media-plan-table-wrap {
    margin-top: 10px;
  }

  .media-plan-table th,
  .media-plan-table td {
    padding: 6px 6px;
    font-size: 0.78rem;
  }

  .media-plan-table thead th {
    font-size: 0.68rem;
  }

  .media-plan-channel-cell {
    min-width: 136px;
  }

  .media-plan-table td .media-plan-input {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    min-height: 26px;
    padding: 3px 6px;
    font-size: 0.76rem;
  }
}

@media (max-height: 840px) and (min-width: 900px) {
  .media-plan-hero {
    padding: 14px 16px;
  }

  .media-plan-head {
    gap: 10px 16px;
    margin-bottom: 6px;
  }

  .media-plan-head h3 {
    font-size: 1.28rem;
  }

  .media-plan-head .roadmap-note {
    margin-top: 3px;
    font-size: 0.88rem;
    line-height: 1.38;
  }

  .media-plan-head .table-meta {
    font-size: 0.78rem;
  }

  .media-plan-toolbar {
    margin-top: 2px;
  }

  .media-plan-toolbar .switch-btn.compact {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.8rem;
  }

  .media-plan-region-stack {
    gap: 10px;
  }

  .media-plan-region-card {
    padding: 14px;
    border-radius: 18px;
  }

  .media-plan-region-shell {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .media-plan-region-content {
    padding: 10px 10px 12px;
  }

  .media-plan-region-head h3 {
    font-size: 1.34rem;
  }

  .media-plan-top-grid {
    margin-top: 8px;
    gap: 8px;
  }

  .media-plan-top-card {
    border-radius: 14px;
    padding: 8px 10px;
  }

  .media-plan-summary-card,
  .media-plan-target-card {
    gap: 6px;
  }

  .media-plan-mini-row {
    grid-template-columns: minmax(96px, 1fr) minmax(88px, auto) 42px;
    gap: 5px;
  }

  .media-plan-target-row {
    grid-template-columns: 54px minmax(88px, auto) auto;
    gap: 5px;
  }

  .media-plan-request-top {
    gap: 10px;
  }

  .media-plan-request-money {
    min-width: 120px;
  }

  .media-plan-request-percent,
  .media-plan-request-grid,
  .media-plan-request-item {
    gap: 4px;
  }

  .media-plan-request-grid {
    margin-top: 8px;
  }

  .media-plan-input {
    border-radius: 8px;
    min-height: 28px;
    padding: 4px 6px;
    font-size: 0.78rem;
  }

  .media-plan-table-wrap {
    margin-top: 8px;
  }

  .media-plan-table th,
  .media-plan-table td {
    padding: 5px 5px;
    font-size: 0.74rem;
  }

  .media-plan-table thead th {
    font-size: 0.64rem;
    letter-spacing: 0.05em;
  }

  .media-plan-channel-cell {
    min-width: 126px;
  }

  .media-plan-table td .media-plan-input {
    width: 82px;
    min-width: 82px;
    max-width: 82px;
    min-height: 24px;
    padding: 3px 5px;
    font-size: 0.72rem;
  }
}

.reveal {
  animation: rise-in 0.6s ease both;
}

.reveal:nth-child(2) {
  animation-delay: 0.06s;
}

.reveal:nth-child(3) {
  animation-delay: 0.12s;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1360px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-om-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cohort-stage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cohort-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zin-visual-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-om-toolbar {
    align-items: center;
    flex-wrap: nowrap;
  }
}

@media (max-width: 1180px) {
  body {
    --shell-pad: 18px;
    --shell-gap: 18px;
    --sidebar-width: 248px;
    --sidebar-collapsed-width: 80px;
  }

  .sidebar {
    display: flex;
    top: var(--shell-pad);
    left: var(--shell-pad);
    bottom: var(--shell-pad);
    min-height: 0;
  }

  .workspace {
    margin-left: calc(var(--sidebar-current-width) + var(--shell-gap));
  }

  .sidebar-footer {
    margin-top: auto;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .form-om-table-panel {
    min-height: calc(100dvh - (var(--shell-pad) * 2) - var(--form-om-header-offset));
    height: calc(100dvh - (var(--shell-pad) * 2) - var(--form-om-header-offset));
  }

  .form-om-source-filter {
    width: 100%;
    max-width: 240px;
  }

  .dashboard-control-grid,
  .cohort-toolbar,
  .dashboard-compact-grid,
  .compare-fields-grid,
  .dashboard-main-grid,
  .slice-filter-grid,
  .dashboard-signal-grid,
  .zin-reason-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .cohort-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
  }

  .dashboard-compare-config .panel-head {
    align-items: start;
  }

  .compare-period-strip {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .compare-period-vs {
    justify-self: start;
  }

  .compare-date-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-period-title-row {
    flex-direction: column;
    align-items: start;
  }

  .dashboard-toolbar-actions {
    justify-content: start;
    width: 100%;
    justify-self: auto;
  }

  .dashboard-display-mode-block {
    min-width: 0;
  }

  .dashboard-period-block,
  .dashboard-display-mode-block {
    width: 100%;
  }

  .dashboard-toolbar .dashboard-period-block,
  .dashboard-toolbar .dashboard-toolbar-actions,
  .cohort-toolbar .cohort-period-block,
  .cohort-toolbar .cohort-region-block,
  .cohort-toolbar .cohort-slice-block,
  .cohort-toolbar .cohort-toolbar-actions {
    grid-column: auto;
    justify-self: auto;
  }

  .cohort-toolbar .cohort-region-block::before,
  .cohort-toolbar .cohort-slice-block::before {
    display: none;
  }

  .dashboard-period-block .date-range-fields {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-display-mode-block .segmented {
    justify-content: start;
  }

  .dropdown-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-visual-head {
    flex-direction: column;
    align-items: start;
  }

  .dashboard-daily-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-line-card-head {
    flex-direction: column;
    align-items: start;
  }

  .dashboard-line-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cohort-config-grid {
    grid-template-columns: 1fr;
  }

  .monthly-report-head {
    grid-template-columns: 1fr;
  }

  .monthly-report-head .table-meta {
    padding-top: 0;
  }

  .monthly-report-toolbar {
    margin-top: 10px;
  }

  .monthly-report-region-head {
    flex-direction: column;
    align-items: start;
  }

  .monthly-report-table {
    min-width: 1160px;
  }
}

@media (max-width: 820px) {
  body {
    --shell-pad: 12px;
    --shell-gap: 12px;
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 72px;
  }

  .sidebar {
    top: var(--shell-pad);
    left: var(--shell-pad);
    bottom: var(--shell-pad);
  }

  .workspace {
    margin-left: calc(var(--sidebar-current-width) + var(--shell-gap));
  }

  .hero {
    flex-direction: column;
    align-items: start;
  }

  .hero h2 {
    font-size: 2.2rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-om-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-om-toolbar {
    flex-wrap: wrap;
    align-items: center;
  }

  .form-om-source-filter {
    max-width: none;
    margin-left: 0;
  }

  .dashboard-summary-grid {
    grid-template-columns: 1fr;
  }

  .cohort-stage-grid,
  .cohort-insight-grid {
    grid-template-columns: 1fr;
  }

  .cohort-table-block-head {
    flex-direction: column;
    align-items: start;
  }

  .date-range-fields,
  .metric-group-grid,
  .dropdown-filter-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-filter-grid {
    grid-template-columns: 1fr;
  }

  .media-plan-top-grid,
  .media-plan-request-grid {
    grid-template-columns: 1fr;
  }

  .media-plan-region-head h3 {
    font-size: 1.22rem;
  }

  .dashboard-zin-track-card-head {
    align-items: start;
    flex-direction: column;
  }

  .dashboard-zin-track-heading {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-zin-total-stack {
    justify-items: start;
  }

  .zin-legend-top {
    align-items: start;
    flex-direction: column;
  }

  .dashboard-daily-shell {
    width: max(100%, 760px);
    min-width: 760px;
  }

  .dashboard-line-shell {
    width: max(100%, 760px);
    min-width: 760px;
  }

  .dashboard-line-card {
    padding: 14px 14px 16px;
  }

  .dashboard-daily-focus-head {
    flex-direction: column;
  }

  .dashboard-daily-bar-card,
  .dashboard-daily-track-card {
    min-height: 176px;
  }

  .monthly-report-hero {
    padding: 14px 16px;
  }

  .monthly-report-head h3 {
    font-size: 1.26rem;
  }

  .monthly-report-head .roadmap-note {
    font-size: 0.9rem;
  }

  .monthly-report-region-shell {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .monthly-report-region-content {
    padding: 14px 14px 16px;
  }

  .monthly-report-region-head h3 {
    font-size: 1.18rem;
  }

  .monthly-report-table {
    min-width: 1040px;
  }

  .monthly-report-table th,
  .monthly-report-table td {
    padding: 8px 9px;
    font-size: 0.82rem;
  }

  .monthly-report-corner,
  .monthly-report-label-cell {
    min-width: 220px;
  }
}

@media (max-width: 560px) {
  .panel,
  .sidebar {
    padding: 18px;
    border-radius: 24px;
  }

  body.sidebar-collapsed .sidebar {
    padding: 14px 10px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .table-tools {
    justify-content: start;
  }

  .form-om-summary {
    grid-template-columns: 1fr;
  }

  .cohort-week-tab {
    width: 100%;
    justify-content: space-between;
  }

  .media-plan-region-content {
    padding: 14px 14px 16px;
  }

  .media-plan-mini-row,
  .media-plan-target-row {
    grid-template-columns: 1fr;
  }

  .dashboard-daily-shell {
    width: max(100%, 640px);
    min-width: 640px;
  }

  .dashboard-line-shell {
    width: max(100%, 640px);
    min-width: 640px;
  }

  .dashboard-line-tooltip {
    min-width: 170px;
    max-width: 220px;
    padding: 10px 12px;
  }

  .dashboard-day-tab {
    min-width: 76px;
    padding: 9px 10px;
  }

  .dashboard-daily-focus-card {
    padding: 14px;
  }

  .dashboard-line-summary {
    grid-template-columns: 1fr;
  }

  .monthly-report-head h3 {
    font-size: 1.16rem;
  }

  .monthly-report-region-head h3 {
    font-size: 1.08rem;
  }

  .monthly-report-table {
    min-width: 920px;
  }

  .monthly-report-corner,
  .monthly-report-label-cell {
    min-width: 190px;
  }
}

/* ── Я.Директ ─────────────────────────────────────────── */

.ya-direct-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.ya-direct-hero {
  padding: 16px 20px;
}

.yd-loading,
.yd-error,
.yd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.yd-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--surface-raised);
  border-top-color: #315BEA;
  border-radius: 50%;
  animation: yd-spin 0.7s linear infinite;
}

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

.yd-error-title {
  font-weight: 700;
  color: var(--ink);
}

.yd-error-msg {
  font-size: 0.8rem;
  color: var(--ink-soft);
  max-width: 420px;
  text-align: center;
}

.yd-load-btn,
.yd-retry-btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: #315BEA;
  color: #fff;
  transition: opacity 0.15s;
}

.yd-load-btn:hover,
.yd-retry-btn:hover {
  opacity: 0.85;
}

.yd-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.yd-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.yd-summary-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.yd-summary-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.yd-table-wrap {
  overflow: hidden;
}

.yd-table-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
}

.yd-table-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.yd-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.yd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.yd-table th {
  padding: 8px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.yd-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  white-space: nowrap;
}

.yd-table tbody tr:last-child td {
  border-bottom: 0;
}

.yd-table tbody tr:hover td {
  background: var(--surface-raised);
}

.yd-name {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yd-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

/* ── Я.Директ chart & structure ────────────────────────── */

.yd-chart-wrap {
    overflow: hidden;
    margin-bottom: 0;
}

.yd-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
}

.yd-chart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
}

.yd-chart-legend {
    display: flex;
    align-items: center;
    gap: 16px;
}

.yd-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    flex-shrink: 0;
}

.yd-legend-label {
    font-size: 0.78rem;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
}

.yd-chart-svg {
    display: block;
    width: 100%;
    height: 200px;
}

.yd-chart-tick {
    font-size: 20px;
    fill: var(--ink-soft);
    font-family: inherit;
}

/* Table structure */
.yd-col-header {
    display: grid;
    grid-template-columns: 1fr 90px 80px 70px 90px 100px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.yd-campaign-row,
.yd-group-row {
    display: grid;
    grid-template-columns: 1fr 90px 80px 70px 90px 100px;
    align-items: center;
    padding: 9px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.8rem;
}

.yd-campaign-row:hover {
    background: var(--surface-raised);
}

.yd-campaign-row.is-expanded {
    background: rgba(49, 91, 234, 0.04);
}

.yd-group-row {
    padding-left: 36px;
    background: var(--surface-raised);
    font-size: 0.78rem;
}

.yd-group-row:hover {
    background: rgba(49, 91, 234, 0.05);
}

.yd-group-row.is-expanded {
    background: rgba(49, 91, 234, 0.07);
}

.yd-groups-block {
    border-bottom: 1px solid var(--border);
}

.yd-ads-block {
    padding: 8px 16px 8px 52px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yd-col-name {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.yd-expand-arrow {
    font-size: 0.85rem;
    color: var(--ink-soft);
    flex-shrink: 0;
    width: 14px;
    transition: color 0.12s;
}

.yd-campaign-row:hover .yd-expand-arrow,
.yd-group-row:hover .yd-expand-arrow {
    color: var(--ink);
}

.yd-campaign-name,
.yd-group-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
}

.yd-status-badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.yd-status-on,
.yd-status-serving {
    background: rgba(15, 140, 120, 0.12);
    color: #0f8c78;
}

.yd-status-draft,
.yd-status-stopped,
.yd-status-suspended {
    background: rgba(100, 100, 120, 0.1);
    color: var(--ink-soft);
}

.yd-status-moderation {
    background: rgba(202, 139, 44, 0.12);
    color: #ca8b2c;
}

.yd-status-архив {
    background: rgba(100, 100, 120, 0.08);
    color: var(--ink-soft);
    opacity: 0.7;
}

/* Ad row */
.yd-ad-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    background: var(--surface-raised);
    font-size: 0.78rem;
}

.yd-ad-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--border);
}

.yd-ad-thumb-empty {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
}

.yd-ad-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.yd-ad-title {
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yd-ad-text {
    color: var(--ink-soft);
    font-size: 0.74rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.yd-ad-url {
    font-size: 0.72rem;
    color: #315BEA;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yd-sub-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 36px;
    font-size: 0.78rem;
    color: var(--ink-soft);
    background: var(--surface-raised);
}

.yd-sub-empty {
    padding: 10px 36px;
    font-size: 0.78rem;
    color: var(--ink-soft);
    background: var(--surface-raised);
}

.yd-spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: #315BEA;
    border-radius: 50%;
    animation: yd-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.yd-footer-row {
    display: flex;
    justify-content: flex-end;
    padding: 12px 0;
}

/* ── Direct Test: campaign tree ── */

.dt-tree-table .dt-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1.5px solid var(--line);
    border-radius: 5px;
    background: var(--paper);
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    margin-right: 8px;
    vertical-align: middle;
    user-select: none;
}
.dt-tree-table .dt-toggle:hover {
    border-color: var(--accent, #4a7cff);
    color: var(--accent, #4a7cff);
}
.dt-tree-table .dt-toggle.open {
    background: var(--accent, #4a7cff);
    border-color: var(--accent, #4a7cff);
    color: #fff;
}

.dashboard-table-panel .dt-col-name-wide,
.dt-tree-table .dt-col-name-wide {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    white-space: nowrap;
}
.dt-tree-table .dt-row-campaign td {
    border-top: 2.5px solid var(--line);
}
.dt-tree-table .dt-row-campaign td:first-child {
    font-weight: 600;
}
.dt-tree-table .dt-row-group td:first-child {
    padding-left: 36px;
    font-weight: 500;
}
.dt-tree-table .dt-row-ad td:first-child {
    padding-left: 64px;
    font-weight: 400;
    color: var(--ink-soft);
}
.dt-level-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    margin-right: 6px;
    vertical-align: middle;
}
.dt-tree-table .dt-name-cell {
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
}
/* ── DT: name cell with dot inline ── */
.dt-tree-table .slice-name {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}
.dt-tree-table .slice-name strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dt-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: 6px;
  flex-shrink: 0;
}

/* ── DT name column ── */
.dt-col-name-wide { min-width: 420px; }

/* ── DT ad inline card (inside name cell, position:absolute so it never widens the column) ── */
.dt-ad-name-cell { position: relative; padding-left: 4px; padding-bottom: 110px; }
.dt-ad-card {
  position: absolute;
  left: 4px; bottom: 6px;
  width: 230px;
  display: flex; align-items: flex-start; gap: 8px;
  padding: 5px 8px; border-radius: 6px;
  background: rgba(0,0,0,0.025); border: 1px solid rgba(0,0,0,0.05);
  overflow: hidden; pointer-events: auto;
}
body.theme-dark .dt-ad-card { background: rgba(255,255,255,0.035); border-color: rgba(255,255,255,0.06); }
.dt-ad-card-img {
  width: 44px; height: 44px; border-radius: 5px; flex-shrink: 0;
  background: linear-gradient(135deg, #4a90d9 0%, #67b8f0 60%, #a8d8ea 100%);
  position: relative; overflow: hidden; cursor: pointer; transition: transform 0.12s;
}
.dt-ad-card-img:hover { transform: scale(1.06); }
.dt-ad-card-img::before { content: ""; position: absolute; bottom: 3px; left: 3px; width: 16px; height: 10px; background: rgba(255,255,255,0.85); border-radius: 2px; }
.dt-ad-card-img::after { content: ""; position: absolute; bottom: 3px; left: 22px; width: 12px; height: 16px; background: rgba(255,255,255,0.7); border-radius: 2px; }
.dt-ad-card-text { min-width: 0; flex: 1; overflow: hidden; }
.dt-ad-card-title { font-size: 11px; font-weight: 600; color: var(--ink, #1a1a1a); line-height: 1.3; white-space: normal; word-break: break-word; }
body.theme-dark .dt-ad-card-title { color: #ddd; }
.dt-ad-card-desc { font-size: 10px; color: var(--ink-soft, #888); line-height: 1.35; margin-top: 2px; white-space: normal; word-break: break-word; }
.dt-ad-card-url { font-size: 9px; color: var(--accent, #00d9a3); margin-top: 1px; }

/* ── DT gear button ── */
.dt-gear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border: none; background: none;
  color: var(--ink-soft, #999);
  cursor: pointer; padding: 0;
  margin-left: 4px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
  vertical-align: middle;
  flex-shrink: 0;
}
.dt-gear-btn:hover { color: var(--accent, #00d9a3); background: rgba(0,217,163,0.08); }
.dt-gear-btn svg { pointer-events: none; }

/* ── DT YD settings overlay ── */
.dt-yd-overlay {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  overflow-y: auto; padding: 24px;
}
.dt-yd-popup-inner {
  background: var(--bg, #fff);
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
  max-width: 640px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  cursor: default;
  animation: dtPopIn 0.15s ease-out;
}
body.theme-dark .dt-yd-popup-inner {
  background: #1a1a24;
  border-color: rgba(255,255,255,0.08);
}
.dt-yd-popup-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border, #e5e5e5);
  display: flex; align-items: center; gap: 12px;
}
body.theme-dark .dt-yd-popup-header { border-color: rgba(255,255,255,0.06); }
.dt-yd-popup-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 10px; border-radius: 6px;
  background: #2d67f5; color: #fff;
}
.dt-yd-badge-group { background: #0f8c78; }
.dt-yd-badge-ad { background: #8f6dff; }
.dt-yd-popup-title { font-size: 18px; font-weight: 700; color: var(--ink, #1a1a1a); }
body.theme-dark .dt-yd-popup-title { color: #f0f0f0; }
.dt-yd-sections { padding: 8px 28px 24px; }
.dt-yd-section { margin-top: 20px; }
.dt-yd-section:first-child { margin-top: 12px; }
.dt-yd-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-soft, #888); margin-bottom: 8px;
  padding-bottom: 4px; border-bottom: 1px solid var(--border, #eee);
}
body.theme-dark .dt-yd-section-title { border-color: rgba(255,255,255,0.06); }
.dt-yd-row {
  display: flex; gap: 12px; padding: 5px 0;
  font-size: 13px; line-height: 1.4;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
body.theme-dark .dt-yd-row { border-color: rgba(255,255,255,0.03); }
.dt-yd-label { flex: 0 0 180px; color: var(--ink-soft, #888); font-weight: 500; }
.dt-yd-value { flex: 1; color: var(--ink, #1a1a1a); word-break: break-word; }
body.theme-dark .dt-yd-value { color: #e0e0e0; }
.dt-yd-value code {
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: rgba(0,0,0,0.04); font-family: var(--mono, monospace);
}
body.theme-dark .dt-yd-value code { background: rgba(255,255,255,0.06); }
.dt-yd-value a { color: var(--accent, #00d9a3); text-decoration: none; }
.dt-yd-value a:hover { text-decoration: underline; }
.dt-yd-tag {
  display: inline-block; font-size: 11px; padding: 1px 6px;
  border-radius: 4px; background: rgba(239,68,68,0.08); color: #c0392b;
  margin: 1px 2px;
}
body.theme-dark .dt-yd-tag { background: rgba(239,68,68,0.15); color: #f07070; }

/* ── DT image full-screen overlay ── */
.dt-img-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}
.dt-img-overlay-placeholder {
  width: 400px; height: 400px; border-radius: 16px;
  background: linear-gradient(135deg, #4a90d9 0%, #67b8f0 40%, #a8d8ea 100%);
  position: relative; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.dt-img-overlay-placeholder::before { content: ""; position: absolute; bottom: 24px; left: 24px; width: 140px; height: 90px; background: rgba(255,255,255,0.85); border-radius: 8px; }
.dt-img-overlay-placeholder::after { content: ""; position: absolute; bottom: 24px; left: 180px; width: 110px; height: 130px; background: rgba(255,255,255,0.7); border-radius: 8px; }
.dt-status-dot-active { background: #1a8a4a; }
.dt-status-dot-paused { background: #d4910a; }
.dt-status-dot-stopped { background: #c0392b; }
body.theme-dark .dt-status-dot-active { background: #5dda8e; }
body.theme-dark .dt-status-dot-paused { background: #f0c860; }
body.theme-dark .dt-status-dot-stopped { background: #f07070; }

/* ── DT directologist row colors ── */
.dt-dir-1 { background: rgba(45, 103, 245, 0.04) !important; }
.dt-dir-2 { background: rgba(15, 140, 120, 0.04) !important; }
.dt-dir-3 { background: rgba(143, 109, 255, 0.04) !important; }
body.theme-dark .dt-dir-1 { background: rgba(45, 103, 245, 0.07) !important; }
body.theme-dark .dt-dir-2 { background: rgba(15, 140, 120, 0.07) !important; }
body.theme-dark .dt-dir-3 { background: rgba(143, 109, 255, 0.07) !important; }
.dt-dir-1 td:first-child { border-left: 3px solid rgba(45, 103, 245, 0.5); }
.dt-dir-2 td:first-child { border-left: 3px solid rgba(15, 140, 120, 0.5); }
.dt-dir-3 td:first-child { border-left: 3px solid rgba(143, 109, 255, 0.5); }

/* ── DT compare type tabs ── */
.dt-compare-type-switch {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.dt-compare-tab {
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1.5px solid var(--border, #e5e5e5);
  background: transparent;
  color: var(--ink-soft, #888);
  transition: all 0.15s;
  font-family: inherit;
}
.dt-compare-tab:hover:not(.active) {
  border-color: var(--ink-soft, #888);
  color: var(--ink, #1a1a1a);
}
.dt-compare-tab.active {
  background: var(--ink, #1a1a1a);
  color: #fff;
  border-color: var(--ink, #1a1a1a);
}
body.theme-dark .dt-compare-tab.active {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}
.dt-compare-slice-row {
  display: flex;
  flex-direction: column;
}
.dt-compare-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
}
.dt-compare-checks .filter-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
}
.dt-compare-checks .filter-check input { margin: 0; }
.dt-compare-checks .filter-check span { white-space: nowrap; }

/* legacy text status — hidden, replaced by dots */
.dt-tree-table .dt-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 4px;
    margin-left: 8px;
    white-space: nowrap;
}
.dt-status-active { background: #e6f9ed; color: #1a8a4a; }
.dt-status-paused { background: #fff4e0; color: #b07c10; }
.dt-status-stopped { background: #fce8e8; color: #c0392b; }
body.theme-dark .dt-status-active { background: rgba(26,138,74,0.18); color: #5dda8e; }
body.theme-dark .dt-status-paused { background: rgba(176,124,16,0.18); color: #f0c860; }
body.theme-dark .dt-status-stopped { background: rgba(192,57,43,0.18); color: #f07070; }

.dt-tree-table .dt-row-group {
    background: var(--bg-soft);
}
.dt-tree-table .dt-row-ad {
    background: var(--bg);
}
body.theme-dark .dt-tree-table .dt-row-group {
    background: rgba(255,255,255,0.03);
}
body.theme-dark .dt-tree-table .dt-row-ad {
    background: rgba(255,255,255,0.015);
}

.dt-compare-row {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}
.dt-compare-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 6px;
}

/* ── CRM Marketing Dashboard ── */

.crm-stack { display: flex; flex-direction: column; gap: 16px; }
.crm-toolbar { flex-wrap: wrap; gap: 12px 20px; }

/* L1: Health */
.crm-top-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
.crm-health-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.crm-health-card {
    background: var(--paper-strong); border-radius: 14px; padding: 20px 24px;
    box-shadow: var(--shadow); text-align: center;
}
.crm-health-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.crm-health-value { font-size: 32px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.crm-health-delta { font-size: 13px; font-weight: 600; margin-top: 4px; }
.crm-tone-good { color: #1a8a4a; }
.crm-tone-bad { color: #c0392b; }
body.theme-dark .crm-tone-good { color: #5dda8e; }
body.theme-dark .crm-tone-bad { color: #f07070; }
body.theme-dark .crm-health-card { background: var(--paper); }
.crm-health-live { position: relative; }
.crm-live-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: #1a8a4a; margin-left: 4px; vertical-align: middle;
    animation: crm-pulse 1.5s ease-in-out infinite;
}
@keyframes crm-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
body.theme-dark .crm-live-dot { background: #5dda8e; }

/* L2: Funnel + Top leads */
.crm-funnel-layout { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.crm-funnel-table { display: flex; flex-direction: column; gap: 2px; }
.crm-funnel-table .crm-funnel-row { display: grid; grid-template-columns: 180px 1fr 80px 56px 64px 48px 56px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.crm-funnel-row:last-child { border-bottom: none; }
.crm-funnel-stage { font-weight: 600; white-space: nowrap; }
.crm-funnel-bar-wrap { height: 18px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.crm-funnel-bar { height: 100%; background: var(--accent, #4a7cff); border-radius: 4px; transition: width 0.3s; }
.crm-funnel-bottleneck .crm-funnel-bar { background: #c0392b; }
.crm-funnel-bottleneck .crm-funnel-conv { color: #c0392b; font-weight: 700; }
.crm-funnel-count { font-weight: 700; text-align: right; }
.crm-funnel-pct { color: var(--ink-soft); text-align: right; }
.crm-funnel-conv { color: var(--ink-soft); text-align: center; font-size: 12px; }
.crm-funnel-loss { color: var(--ink-soft); font-size: 12px; text-align: right; }
.crm-funnel-delta { font-size: 12px; font-weight: 600; text-align: right; }

.crm-ndz-branch { padding: 10px 0 4px 20px; border-left: 2px dashed var(--line); margin: 6px 0 6px 90px; font-size: 13px; }
.crm-ndz-branch-title { font-weight: 700; font-size: 12px; text-transform: uppercase; color: var(--ink-soft); letter-spacing: 0.03em; margin-bottom: 4px; }
.crm-ndz-branch-row { padding: 2px 0; }

.crm-top-leads-panel { max-height: 520px; overflow-y: auto; }
.crm-lead-row { display: grid; grid-template-columns: 28px 42px 1fr 24px 56px 50px 64px 72px 80px; gap: 5px; align-items: center; padding: 5px 14px; font-size: 12px; border-bottom: 1px solid var(--line); }
.crm-lead-status { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.crm-lead-rank { font-weight: 700; color: var(--ink-soft); }
.crm-lead-score { font-weight: 800; font-size: 13px; }
.crm-lead-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-lead-temp { font-size: 14px; }
.crm-lead-region, .crm-lead-budget, .crm-lead-seg { color: var(--ink-soft); white-space: nowrap; }
.crm-lead-broker { font-weight: 600; white-space: nowrap; font-size: 11px; }

/* L3: Slices */
.crm-slices-header { grid-column: 1 / -1; margin-bottom: -8px; }
.crm-slices-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.crm-slice-panel { padding-bottom: 18px; }
.crm-slice-chart { display: flex; flex-direction: column; gap: 6px; padding: 0 18px 4px; }

.crm-bar-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.crm-bar-label { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-bar-track { height: 16px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.crm-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.crm-bar-value { font-weight: 600; white-space: nowrap; min-width: 80px; text-align: right; }
.crm-bar-extra { font-weight: 400; color: var(--ink-soft); font-size: 12px; }

/* L4: Cohort */
.crm-cohort-wrap { overflow-x: auto; }
.crm-cohort-grid th, .crm-cohort-grid td { text-align: center; padding: 6px 12px; font-size: 13px; }
.crm-cohort-date { font-weight: 600; text-align: left !important; white-space: nowrap; }
.crm-cohort-cell { font-weight: 700; border-radius: 4px; }
.crm-cohort-empty { color: var(--ink-soft); font-weight: 400; }

/* NDZ Monitor */
.crm-ndz-content { padding: 0 18px 18px; }
.crm-ndz-stats { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.crm-ndz-stat { text-align: center; }
.crm-ndz-stat-value { display: block; font-size: 24px; font-weight: 800; }
.crm-ndz-stat-value small { font-size: 14px; font-weight: 600; }
.crm-ndz-stat-label { font-size: 11px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
.crm-ndz-types { margin-top: 8px; }
.crm-ndz-types-title { font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; margin-bottom: 8px; }

/* Cohort tabs */
.crm-cohort-tabs { display: flex; gap: 4px; padding: 0 18px 12px; flex-wrap: wrap; }
.crm-cohort-tab {
    padding: 5px 14px; border-radius: 8px; border: 1.5px solid var(--line);
    background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-soft);
    cursor: pointer; transition: all 0.15s;
}
.crm-cohort-tab.active { background: var(--accent, #4a7cff); color: #fff; border-color: var(--accent, #4a7cff); }
.crm-cohort-tab:hover:not(.active) { border-color: var(--accent, #4a7cff); color: var(--ink); }

/* Scoring layout */
.crm-scoring-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Bottom row */
.crm-bottom-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
.crm-todo-panel-wide { }
.crm-todo-group { margin-bottom: 12px; }
.crm-todo-group-title { font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 4px; padding: 0; }
.crm-scoring-chart { display: flex; flex-direction: column; gap: 6px; padding: 0 18px 18px; }
.crm-todo-list { display: flex; flex-direction: column; gap: 4px; padding: 0 18px 18px; }
.crm-todo-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.crm-todo-item:last-child { border-bottom: none; }
.crm-todo-prio { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 4px; white-space: nowrap; letter-spacing: 0.03em; }
.crm-todo-text { font-weight: 500; }

@media (max-width: 1100px) {
    .crm-health-cards { grid-template-columns: repeat(2, 1fr); }
    .crm-funnel-layout { grid-template-columns: 1fr; }
    .crm-slices-row { grid-template-columns: 1fr; }
    .crm-scoring-layout { grid-template-columns: 1fr; }
    .cv2-two-col { grid-template-columns: 1fr; }
    .cv2-levels-grid { grid-template-columns: 1fr; }
    .cv2-rules-grid { grid-template-columns: 1fr; }
}

/* ── CRMv2 Analytics ── */
.crmv2-stack { display: flex; flex-direction: column; gap: 16px; }
.cv2-section { padding: 28px 28px 24px; }
.cv2-num { font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.cv2-meta { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.cv2-title { font-size: 28px; font-weight: 800; margin-bottom: 12px; line-height: 1.2; }
.cv2-title em, .cv2-subhead em { font-style: italic; font-family: "Instrument Serif", Georgia, serif; font-weight: 400; }
.cv2-lead { font-size: 14px; color: var(--ink-soft); line-height: 1.6; max-width: 720px; }
.cv2-subhead { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.cv2-note { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-top: 12px; }

.cv2-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.cv2-col-card { background: var(--bg-soft); border-radius: 12px; padding: 18px 20px; }
.cv2-col-card h4 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; color: var(--ink); }
.cv2-col-card ul { list-style: none; padding: 0; margin: 0; }
.cv2-col-card li { font-size: 13px; padding: 4px 0; color: var(--ink-soft); }
.cv2-col-card li::before { content: "\u2022 "; color: var(--accent, #4a7cff); }
body.theme-dark .cv2-col-card { background: rgba(255,255,255,0.03); }

.cv2-callout { border-left: 3px solid #00d9a3; margin: 0; padding: 14px 20px; font-size: 14px; font-weight: 500; color: var(--ink); background: rgba(0,217,163,0.06); border-radius: 0 8px 8px 0; line-height: 1.5; }
body.theme-dark .cv2-callout { background: rgba(0,217,163,0.08); }

.cv2-flow { display: flex; flex-direction: column; align-items: center; gap: 0; margin: 20px 0; }
.cv2-flow-step { text-align: center; padding: 14px 28px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 13px; min-width: 280px; background: var(--paper); }
.cv2-flow-step strong { display: block; font-size: 15px; margin: 4px 0 2px; }
.cv2-flow-who { font-size: 11px; color: var(--ink-soft); }
.cv2-flow-arrow { font-size: 20px; color: var(--ink-soft); line-height: 1; padding: 4px 0; }
.cv2-flow-aside { margin-top: 16px; padding: 12px 20px; border: 1.5px dashed #00d9a3; border-radius: 10px; font-size: 13px; text-align: center; color: #00d9a3; }

.cv2-levels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cv2-level-card { background: var(--bg-soft); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
body.theme-dark .cv2-level-card { background: rgba(255,255,255,0.03); }
.cv2-level-head { display: flex; justify-content: space-between; align-items: center; }
.cv2-level-num { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.cv2-level-prio { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.cv2-prio-critical { background: rgba(239,68,68,0.15); color: #ef4444; }
.cv2-prio-high { background: rgba(0,217,163,0.15); color: #00d9a3; }
.cv2-prio-medium { background: rgba(138,138,146,0.15); color: #8a8a92; }
.cv2-level-title { font-size: 17px; font-weight: 700; }
.cv2-level-q { font-size: 13px; font-style: italic; color: var(--ink-soft); }
.cv2-level-metrics { list-style: none; padding: 0; margin: 4px 0 0; font-size: 12px; }
.cv2-level-metrics li { padding: 2px 0; color: var(--ink-soft); }
.cv2-level-metrics li::before { content: "\u2022 "; color: #00d9a3; }
.cv2-level-owner { font-size: 11px; color: var(--ink-soft); margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); }

.cv2-lvl-badge { display: inline-block; font-size: 10px; font-weight: 800; padding: 1px 6px; border: 1.5px solid; border-radius: 4px; margin-left: 6px; vertical-align: middle; }

.cv2-detail-table td:first-child { font-weight: 700; color: var(--ink-soft); width: 36px; }
.cv2-funnel-table .num-danger { color: #ef4444; font-weight: 700; }
.cv2-funnel-table .num-warn { color: #f5a623; font-weight: 600; }

.cv2-rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cv2-rule-card { background: var(--bg-soft); border-radius: 12px; padding: 18px 20px; }
body.theme-dark .cv2-rule-card { background: rgba(255,255,255,0.03); }
.cv2-rule-num { display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; background: #00d9a3; color: #0a0a0b; font-weight: 800; font-size: 13px; margin-bottom: 8px; }
.cv2-rule-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.cv2-rule-card p { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

/* ── Яндекс Метрика: столбцы в Direct Test ── */
.ym-group-separator {
  width: 3px !important;
  min-width: 3px !important;
  max-width: 3px !important;
  padding: 0 !important;
  background: var(--accent, #00d9a3);
  opacity: 0.35;
  border: none !important;
}
.ym-group-header {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent, #00d9a3);
  padding: 6px 8px 2px;
  border-bottom: 1.5px solid var(--accent, #00d9a3);
  white-space: nowrap;
  background: rgba(0, 217, 163, 0.04);
}
body.theme-dark .ym-group-header {
  background: rgba(0, 217, 163, 0.06);
}
.ym-col {
  background: rgba(0, 217, 163, 0.02);
  font-size: 12px;
}
body.theme-dark .ym-col {
  background: rgba(0, 217, 163, 0.03);
}
th.ym-col {
  font-size: 11px;
  color: var(--ink-soft, #888);
  text-align: center;
  padding: 4px 6px;
}
td.ym-col .metric-cell {
  justify-content: center;
}
td.ym-col .metric-primary {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
