@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("/static/fonts/nunito-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("/static/fonts/nunito-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --sidebar: #653a54;
  --sidebar-strong: #32152f;
  --sidebar-soft: #806276;
  --text-on-dark: #fffaf6;
  --bg: #fffaf6;
  --panel: #fffefd;
  --panel-elevated: #ffffff;
  --panel-soft: #fff4ec;
  --panel-hover: #fff0ea;
  --line: #ecd8c9;
  --line-strong: #d7b9ab;
  --text: #32152f;
  --muted: #806276;
  --accent: #ff7964;
  --accent-strong: #bd4338;
  --accent-soft: #ffe1d8;
  --accent-secondary: #a963ca;
  --ok: #287457;
  --warn: #9a6a22;
  --danger: #aa4545;
  --shadow: 0 10px 28px rgba(80, 40, 55, 0.075);
  --shadow-raised: 0 18px 46px rgba(80, 40, 55, 0.16);
  --sidebar-expanded-width: 164px;
  --sidebar-collapsed-width: 54px;
}

[hidden] {
  display: none !important;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  font: 15.667px/1.42 "Nunito", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.shell {
  width: 100vw;
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-expanded-width) minmax(0, 1fr);
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.shell--sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.sidebar {
  position: relative;
  width: 100%;
  height: 100dvh;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-strong));
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  gap: 10px;
}

.sidebar--collapsed {
  width: 100%;
  padding-inline: 7px;
}

.sidebar--collapsed .brand-copy,
.sidebar--collapsed .nav-label {
  display: none;
}

.sidebar--collapsed .brand-row,
.sidebar--collapsed .nav-item {
  justify-content: center;
  padding-inline: 0;
}

.sidebar-top {
  display: grid;
  gap: 8px;
}

.brand-stack {
  display: grid;
  justify-items: start;
  gap: 5px;
  padding-left: 4px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 4px;
}

.brand-mark {
  width: 30px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.brand-copy {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.app-footer,
.access-footer {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.app-footer {
  position: fixed;
  z-index: 20;
  right: 8px;
  bottom: 3px;
}

.app-footer a,
.access-footer a {
  color: inherit;
  text-decoration: none;
}

.app-footer a:hover,
.access-footer a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.sidebar-toggle {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: var(--text-on-dark);
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.sidebar-toggle svg,
.nav-icon svg,
.sidebar-tool-button svg,
.icon-button svg,
.ui-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon {
  display: inline-block;
  vertical-align: -0.18em;
}

.sidebar-toggle-icon {
  transition: transform 180ms ease;
}

.sidebar--collapsed .sidebar-toggle-icon {
  transform: rotate(180deg);
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 0 10px;
  background: transparent;
  color: rgba(246, 251, 255, 0.88);
}

.nav-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.nav-label { min-width: 0; }

.nav-item.is-active,
.nav-item:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.sidebar-user {
  position: absolute;
  left: 9px;
  bottom: 8px;
  display: grid;
  justify-items: start;
  gap: 6px;
}

.avatar-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.16);
  color: var(--text-on-dark);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.workspace {
  min-width: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr);
}

.workspace > * {
  min-width: 0;
  max-width: 100%;
}

.workspace--without-topbar {
  grid-template-rows: minmax(0, 1fr);
}

.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--bg);
  backdrop-filter: blur(10px);
}

.boot-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.35;
  pointer-events: none;
}

.boot-overlay.is-leaving {
  animation: bootFadeOut 280ms ease forwards;
}

.boot-screen {
  position: relative;
  width: min(720px, calc(100vw - 36px));
  border: 1px solid rgba(215, 232, 248, 0.24);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(23, 55, 86, 0.92), rgba(15, 41, 67, 0.96));
  box-shadow:
    0 28px 70px rgba(5, 17, 31, 0.42),
    inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 18px;
  color: #f5fbff;
  overflow: hidden;
}

.boot-screen::after {
  content: "";
  position: absolute;
  inset: -20% auto auto -10%;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(111, 181, 247, 0.22), transparent 68%);
  animation: bootFloat 5.4s ease-in-out infinite;
  pointer-events: none;
}

.boot-screen__topline,
.boot-status-head,
.boot-status-body,
.boot-brand,
.boot-ticker {
  display: flex;
  align-items: center;
}

.boot-screen__topline,
.boot-status-head,
.boot-status-body {
  justify-content: space-between;
  gap: 14px;
}

.boot-screen__topline {
  margin-bottom: 14px;
}

.boot-brand {
  gap: 12px;
}

.boot-brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(130, 196, 255, 0.34), rgba(80, 139, 194, 0.26));
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 16px;
  font-weight: 700;
}

.boot-brand__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.boot-brand__caption,
.boot-clock,
.boot-panel__label {
  color: rgba(225, 240, 252, 0.72);
}

.boot-brand__caption,
.boot-clock {
  font-size: 11px;
}

.boot-clock {
  min-width: 54px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.boot-visuals {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 12px;
  margin-bottom: 14px;
}

.boot-panel,
.boot-status-card {
  position: relative;
  border: 1px solid rgba(209, 229, 247, 0.12);
  border-radius: 18px;
  background: rgba(245, 251, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.boot-panel {
  min-height: 168px;
  padding: 14px;
}

.boot-panel__label {
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.boot-bars {
  height: 106px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.boot-bars span {
  flex: 1 1 0;
  min-width: 16px;
  height: var(--bar-height);
  border-radius: 999px 999px 5px 5px;
  background: linear-gradient(180deg, rgba(136, 204, 255, 0.96), rgba(70, 132, 192, 0.4));
  box-shadow: 0 8px 22px rgba(104, 173, 236, 0.18);
  animation: bootBarPulse 1.7s ease-in-out infinite;
  animation-delay: var(--bar-delay);
}

.boot-chart-line {
  position: relative;
  height: 18px;
  margin-top: 12px;
  border-top: 1px solid rgba(218, 236, 251, 0.16);
}

.boot-chart-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 2px;
  background:
    linear-gradient(90deg, rgba(96, 170, 231, 0.18), rgba(152, 217, 255, 0.95), rgba(96, 170, 231, 0.18));
  transform-origin: left center;
  animation: bootWave 2.2s ease-in-out infinite;
}

.boot-chart-line__dot {
  position: absolute;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ecf8ff;
  box-shadow: 0 0 0 5px rgba(152, 217, 255, 0.15);
  animation: bootDotBlink 1.9s ease-in-out infinite;
}

.boot-chart-line__dot--1 { left: 12%; animation-delay: 0s; }
.boot-chart-line__dot--2 { left: 36%; animation-delay: 0.3s; }
.boot-chart-line__dot--3 { left: 61%; animation-delay: 0.6s; }
.boot-chart-line__dot--4 { left: 84%; animation-delay: 0.9s; }

.boot-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.boot-signal-chip {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(222, 239, 251, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  color: rgba(246, 252, 255, 0.94);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  animation: bootChipFloat 3.4s ease-in-out infinite;
}

.boot-signal-chip:nth-child(2) { animation-delay: 0.35s; }
.boot-signal-chip:nth-child(3) { animation-delay: 0.7s; }
.boot-signal-chip:nth-child(4) { animation-delay: 1.05s; }
.boot-signal-chip:nth-child(5) { animation-delay: 1.4s; }
.boot-signal-chip:nth-child(6) { animation-delay: 1.75s; }

.boot-ticker {
  gap: 8px;
  flex-wrap: wrap;
}

.boot-ticker span {
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(220, 237, 251, 0.12);
  font-size: 11px;
  color: rgba(244, 251, 255, 0.82);
  animation: bootTickerDrift 5s linear infinite;
}

.boot-status-card {
  padding: 14px;
}

.boot-status-title {
  font-size: 24px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.boot-status-note {
  color: rgba(228, 241, 252, 0.82);
  font-size: 12px;
}

.boot-status-body {
  margin-top: 12px;
}

.boot-status-hint {
  color: rgba(198, 222, 244, 0.94);
  font-size: 12px;
}

.boot-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.boot-progress__step {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(220, 237, 251, 0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(225, 240, 252, 0.74);
  font-size: 11px;
}

.boot-progress__step.is-active {
  background: rgba(143, 205, 255, 0.18);
  border-color: rgba(143, 205, 255, 0.42);
  color: #f6fcff;
}

.boot-progress__step.is-done {
  background: rgba(86, 146, 205, 0.18);
  border-color: rgba(86, 146, 205, 0.3);
  color: rgba(233, 245, 255, 0.88);
}

.boot-overlay.is-error .boot-status-title {
  color: #fff2f2;
}

.boot-overlay.is-error .boot-status-note {
  color: rgba(255, 227, 227, 0.84);
}

@keyframes bootBarPulse {
  0%, 100% { transform: translateY(0) scaleY(0.94); opacity: 0.84; }
  50% { transform: translateY(-3px) scaleY(1.04); opacity: 1; }
}

@keyframes bootWave {
  0%, 100% { transform: scaleX(0.9); opacity: 0.52; }
  50% { transform: scaleX(1); opacity: 1; }
}

@keyframes bootDotBlink {
  0%, 100% { transform: scale(0.85); opacity: 0.55; }
  45% { transform: scale(1.05); opacity: 1; }
}

@keyframes bootChipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes bootTickerDrift {
  0% { transform: translateX(0); }
  50% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

@keyframes bootFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(18px, 10px, 0); }
}

@keyframes bootFadeOut {
  from { opacity: 1; }
  to { opacity: 0; visibility: hidden; }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--sidebar);
  color: var(--text-on-dark);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 6px 10px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.filter-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  overflow: hidden;
  width: 100%;
  min-width: 0;
}

.filter-row > * { flex: 0 0 auto; }

.filter-row--primary {
  align-items: stretch;
}

.filter-row--period {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.filter-row__divider {
  width: 1px;
  min-height: 24px;
  margin: 1px 2px;
  background: var(--line);
}

.compact-filter-select {
  width: auto;
  max-width: 238px;
  padding-right: 26px;
  cursor: pointer;
}

.inline-filter-field {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
}

.inline-filter-field > span {
  padding: 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.inline-filter-field select,
.inline-filter-field input {
  min-height: 28px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
}

.inline-filter-field--period select { min-width: 150px; }
.inline-filter-field--date input { width: 174px; padding: 0 7px; }

.quick-period-chip.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 44%, transparent);
  font-weight: 750;
}

.active-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
  padding-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.active-filter-summary__tags,
.active-filter-summary__actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.active-filter-tag {
  padding-right: 6px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

.active-filter-tag:last-child { border-right: 0; }
.active-filter-summary__actions { margin-left: auto; }

.active-filter-summary__action {
  appearance: none;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.active-filter-summary__action:hover,
.active-filter-summary__action:focus-visible {
  color: var(--text-on-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.active-filter-summary__action:disabled {
  cursor: default;
  opacity: .45;
  text-decoration: none;
}

.chip, .button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
}

.chip--title {
  background: transparent;
  border-color: transparent;
  color: var(--text-on-dark);
  padding-left: 0;
  font-size: 12px;
  text-transform: lowercase;
}

.chip--ghost,
.button--ghost {
  background: rgba(255,255,255,0.08);
  color: var(--text-on-dark);
  border-color: rgba(255,255,255,0.18);
}

.button--ghost {
  background: #fff;
  color: var(--accent);
  border-color: var(--line-strong);
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 150px;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.permission-row select { min-height: 32px; }

.permission-editor--disabled { opacity: .62; }
.permission-editor--disabled .checkbox-grid { pointer-events: none; }

.avatar-crop-overlay,
.access-success-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
  background: rgba(20, 52, 82, .45);
}

.avatar-crop-card,
.access-success-card {
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(20, 52, 82, .3);
}

.avatar-crop-card canvas {
  display: block;
  width: min(280px, 100%);
  aspect-ratio: 1;
  margin: 8px auto;
  border-radius: 10px;
  background: var(--panel-soft);
}

.crop-control { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; margin: 6px 0; }
.access-success-card { text-align: center; }
.access-success-card .button { display: inline-flex; text-decoration: none; }
.access-success-mark { width: 48px; height: 48px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; background: #dff3e7; color: #19713a; font-size: 28px; }

.view {
  display: none;
  padding: 10px;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  overflow: auto;
}

.view.is-active {
  display: grid;
  align-content: start;
  gap: 10px;
}

#analysisView.is-active {
  overflow: auto;
}

.dashboard-view.is-active { display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; align-content: stretch; }
.dashboard-toolbar { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-x: auto; padding: 2px 0 5px; scrollbar-width: thin; }
.dashboard-toolbar .compact-select { min-width: 190px; max-width: 320px; }
.dashboard-toolbar .button,.dashboard-toolbar .icon-button,.dashboard-save-state { flex: 0 0 auto; white-space: nowrap; }
.dashboard-toolbar__group { display: flex; align-items: center; gap: 5px; padding-right: 8px; border-right: 1px solid #c8d9e7; }
.dashboard-toolbar__group--editing { border-right: 0; }
.dashboard-toolbar__end { margin-left: auto; }
.dashboard-quick-filters { min-height: 0; display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 5px 1px; scrollbar-width: thin; }
.dashboard-quick-filters:empty { display: none; }
.dashboard-quick-filter { flex: 0 0 auto; border: 1px solid #bad0e3; border-radius: 999px; background: #fff; color: #285d88; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.dashboard-quick-filter.is-active { border-color: #246b9f; background: #cde7f8; color: #123f63; box-shadow: inset 0 0 0 1px #4c91c3; font-weight: 750; }
.dashboard-quick-filter--manage { border-style: dashed; }
.dashboard-quick-filter-period { flex: 0 0 auto; padding: 4px 9px; border-left: 1px solid #c8d9e7; color: #587790; font-size: 11px; white-space: nowrap; }
.dashboard-save-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dashboard-save-state[data-tone="ok"] { color: #19713a; }
.dashboard-save-state[data-tone="error"] { color: var(--danger); }
.dashboard-grid { --grid-gap: 8px; display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); grid-auto-rows: 36px; gap: var(--grid-gap); align-content: start; overflow: auto; padding: 2px 2px 28px; background-color: rgba(237,246,252,.62); background-image: radial-gradient(circle at 1px 1px, rgba(57,103,146,.14) 1px, transparent 0); background-size: calc((100% - 23 * var(--grid-gap)) / 24 + var(--grid-gap)) 44px; }
.dashboard-widget { --widget-scale: 1; container-type: size; grid-column: calc(var(--x) + 1) / span var(--w); grid-row: calc(var(--y) + 1) / span var(--h); min-width: 0; min-height: 0; border: 1px solid #c4d8eb; border-radius: calc(13px * var(--widget-scale)); background: #fff; box-shadow: 0 8px 24px rgba(35,75,114,.08); overflow: hidden; display: grid; grid-template-rows: max(28px, calc(42px * var(--widget-scale))) minmax(0,1fr); transition: transform .18s, box-shadow .18s, outline-color .18s; }
.dashboard-widget.is-selected { outline: 2px solid #4d91c6; outline-offset: -2px; box-shadow: 0 10px 28px rgba(35,75,114,.17); }
.dashboard-widget.is-moving { z-index: 10; transform: scale(1.015); box-shadow: 0 16px 38px rgba(35,75,114,.22); outline: 2px solid #6aace2; }
.dashboard-widget.dashboard-swap-target { transform: scale(.985); outline: 3px solid #e1a42f; outline-offset: -3px; box-shadow: inset 0 0 0 4px rgba(255,199,81,.24), 0 12px 30px rgba(35,75,114,.16); }
.dashboard-drop-preview { grid-column: calc(var(--x) + 1) / span var(--w); grid-row: calc(var(--y) + 1) / span var(--h); z-index: 9; border: 2px dashed #2f7eb9; border-radius: 13px; background: rgba(91,170,224,.18); box-shadow: inset 0 0 0 3px rgba(255,255,255,.55); pointer-events: none; animation: dashboard-drop-pulse .8s ease-in-out infinite alternate; }
@keyframes dashboard-drop-pulse { to { background: rgba(91,170,224,.32); } }
.dashboard-widget__head { display: flex; align-items: center; justify-content: space-between; padding: 0 max(3px, calc(9px * var(--widget-scale))); border-bottom: 1px solid #dbe7f2; background: linear-gradient(90deg,#f4f9fd,#eaf3fa); font-size: max(7px, calc(13px * var(--widget-scale))); font-weight: 700; }
.dashboard-widget__drag { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.12; overflow-wrap: anywhere; }
.dashboard-widget__filter-mark { margin-left: auto; padding: calc(2px * var(--widget-scale)) calc(6px * var(--widget-scale)); border-radius: 999px; background: #d8ebf8; color: #2c6595; font-size: clamp(8px, calc(10px * var(--widget-scale)), 14px); font-weight: 650; }
.dashboard-grid.is-editing .dashboard-widget__head { cursor: grab; touch-action: none; }
.dashboard-grid.is-editing .dashboard-widget__menu { cursor: pointer; }
.dashboard-widget__menu { border: 0; background: none; color: #356a9b; font-weight: 800; cursor: pointer; }
.dashboard-widget__body { min-height: 0; overflow: auto; padding: max(3px, calc(9px * var(--widget-scale))) max(3px, calc(9px * var(--widget-scale))) max(8px, calc(24px * var(--widget-scale))); }
.dashboard-widget__meta { position: absolute; left: calc(7px * var(--widget-scale)); bottom: calc(3px * var(--widget-scale)); z-index: 4; max-width: calc(100% - 90px); color: #66839c; font-size: clamp(7px, calc(9px * var(--widget-scale)), 13px); }
.dashboard-widget__meta summary { cursor: pointer; white-space: nowrap; }
.dashboard-widget__meta[open] { width: min(340px,calc(100% - 14px)); max-width: none; max-height: calc(100% - 42px); overflow: auto; padding: 8px; border: 1px solid #bcd3e6; border-radius: 9px; background: #f8fbfe; box-shadow: 0 8px 24px rgba(30,73,110,.18); font-size: 11px; }
.dashboard-widget__meta dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 7px; margin: 6px 0 0; }
.dashboard-widget__meta dt { color: #708aa1; }
.dashboard-widget__meta dd { margin: 0; color: #244d70; overflow-wrap: anywhere; }
.dashboard-widget__loading,.dashboard-no-data { color: var(--muted); font-size: clamp(9px, calc(12px * var(--widget-scale)), 17px); }
.dashboard-widget__resize { position: absolute; z-index: 6; width: 23px; height: 23px; right: 2px; bottom: 2px; cursor: nwse-resize; border-right: 3px solid #5992c4; border-bottom: 3px solid #5992c4; border-radius: 0 0 7px 0; opacity: 0; pointer-events: none; transition: opacity .14s; }
.dashboard-widget:hover .dashboard-widget__resize,.dashboard-widget.is-selected .dashboard-widget__resize,.dashboard-widget.is-moving .dashboard-widget__resize { opacity: 1; pointer-events: auto; }
.dashboard-widget { position: relative; }
.dashboard-kpi { height: 100%; display: grid; place-content: center; text-align: center; gap: calc(4px * var(--widget-scale)); }
.dashboard-kpi strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: max(8px, min(calc(42px * var(--widget-scale)), 12cqw)); color: #1e4f7c; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dashboard-kpi strong.is-positive { color: #19713a; }
.dashboard-kpi strong.is-negative { color: #b23f39; }
.dashboard-kpi span { max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; color: var(--muted); font-size: max(7px, calc(12px * var(--widget-scale))); line-height: 1.2; overflow-wrap: anywhere; }
.dashboard-kpi__target { font-size: clamp(8px, calc(11px * var(--widget-scale)), 16px); color: var(--muted); }
.dashboard-kpi__target.is-positive { color: #19713a; }
.dashboard-kpi__target.is-negative { color: #a43d38; }
.dashboard-kpi__previous { display: grid; gap: 1px; font-size: clamp(8px, calc(11px * var(--widget-scale)), 16px); color: #496b88; }
.dashboard-kpi__previous span { font-size: clamp(8px, calc(10px * var(--widget-scale)), 15px); color: #7891a7; }
.dashboard-kpi__previous.is-positive { color: #19713a; }
.dashboard-kpi__previous.is-negative { color: #a43d38; }
.dashboard-kpi__sparkline { width: min(180px,90%); height: 36px; justify-self: center; overflow: visible; }
.dashboard-kpi__sparkline polyline { fill: none; stroke: #3478ad; stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-kpi__sparkline-empty { color: #7891a7; font-size: clamp(8px, calc(10px * var(--widget-scale)), 15px); }
.dashboard-content-text { height: 100%; overflow: auto; color: var(--text); font-size: clamp(9px, calc(13px * var(--widget-scale)), 19px); line-height: 1.55; white-space: normal; }
.dashboard-content-divider { height: 100%; display: flex; align-items: center; gap: calc(10px * var(--widget-scale)); color: #356a9b; font-size: clamp(9px, calc(13px * var(--widget-scale)), 19px); font-weight: 750; }
.dashboard-content-divider::before,.dashboard-content-divider::after { content: ""; height: 1px; flex: 1; background: #9fbfd9; }
.dashboard-chart { height: 100%; display: flex; align-items: end; gap: 5px; }
.dashboard-chart__item { min-width: 18px; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 3px; }
.dashboard-chart__bar { width: 100%; height: var(--value); min-height: 3px; background: linear-gradient(180deg,#73b7e9,#2f6fa8); border-radius: 5px 5px 1px 1px; }
.dashboard-chart__item small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(7px, calc(9px * var(--widget-scale)), 13px); }
.dashboard-chart--horizontal { flex-direction: column; align-items: stretch; }
.dashboard-chart--horizontal .dashboard-chart__item { width: 100%; height: auto; flex-direction: row-reverse; justify-content: flex-end; }
.dashboard-chart--horizontal .dashboard-chart__bar { width: var(--value); height: 16px; }
.dashboard-block-chart { height: 100%; display: flex; flex-wrap: wrap; gap: 4px; align-content: stretch; }
.dashboard-block-chart > div { flex: var(--share) 1 70px; min-height: 48px; padding: 7px; border-radius: 8px; color: #183b5d; background: hsl(var(--tone) 58% 84%); display: grid; align-content: center; }
.dashboard-block-chart span { font-size: clamp(8px, calc(10px * var(--widget-scale)), 15px); overflow: hidden; text-overflow: ellipsis; }
.dashboard-block-chart strong { font-size: clamp(9px, calc(13px * var(--widget-scale)), 20px); }
.dashboard-echart { width: 100%; height: 100%; min-height: 0; }
.dashboard-manager-list,.dashboard-quick-filter-list { display: grid; gap: 7px; }
.dashboard-manager-row { display: grid; grid-template-columns: auto minmax(0,1fr) repeat(4,auto); align-items: center; gap: 7px; padding: 8px; border: 1px solid #d2e1ed; border-radius: 10px; background: #f8fbfe; }
.dashboard-quick-filter-row { display: grid; grid-template-columns: auto minmax(0,1fr) repeat(3,auto); align-items: center; gap: 7px; padding: 8px; border: 1px solid #d2e1ed; border-radius: 10px; background: #f8fbfe; }
.dashboard-manager-row.is-active { border-color: #5a94c1; background: #eaf4fb; }
.dashboard-manager-handle { cursor: grab; color: #6688a5; font-size: 18px; }
.dashboard-mini-table { width: max-content; min-width: 0; border-collapse: collapse; font-size: clamp(8px, calc(11px * var(--widget-scale)), 16px); }
.dashboard-mini-table th,.dashboard-mini-table td { padding: 5px 7px; border-bottom: 1px solid #e0e9f2; text-align: right; white-space: nowrap; }
.dashboard-mini-table th:first-child,.dashboard-mini-table td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; }
.dashboard-widget__error { height: 100%; display: grid; place-content: center; gap: 5px; color: #a43d38; text-align: center; }
.dashboard-empty { margin: auto; width: min(520px,90%); padding: 42px; border: 1px dashed #8eb5d5; border-radius: 18px; display: grid; gap: 8px; text-align: center; background: rgba(255,255,255,.65); }
.dashboard-modal-layer { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; padding: 16px; background: rgba(23,51,76,.42); }
.dashboard-modal { width: min(760px,100%); max-height: calc(100dvh - 32px); overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); border-radius: 15px; background: #fff; box-shadow: 0 24px 70px rgba(20,50,77,.3); }
.dashboard-modal > header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; padding: 13px 16px; background: #f1f7fc; border-bottom: 1px solid #d3e2ef; cursor: grab; touch-action: none; }
.dashboard-modal > header:active { cursor: grabbing; }
.dashboard-modal > header button { border: 0; background: transparent; font-size: 24px; cursor: pointer; }
.dashboard-modal__body { padding: 14px; overflow-y: auto; overscroll-behavior: contain; }
.dashboard-editor-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.dashboard-editor-form label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.dashboard-editor-form input,.dashboard-editor-form select,.dashboard-editor-form textarea { min-width: 0; padding: 9px; border: 1px solid #c5d7e7; border-radius: 9px; background: #fff; color: var(--text); }
.dashboard-editor-form select[size] { min-height: 180px; }
.dashboard-editor-form label > small { color: #65839d; line-height: 1.35; }
.dashboard-editor-metric { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.dashboard-editor-metric input,.dashboard-editor-metric select { min-width: 0; padding: 9px; border: 1px solid #c5d7e7; border-radius: 9px; background: #fff; color: var(--text); }
.dashboard-editor-metric select { min-height: 180px; }
.dashboard-editor-metric > small { color: #65839d; line-height: 1.35; }
.dashboard-editor-metric__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dashboard-editor-metric__head button { padding: 2px 6px; border: 0; background: transparent; color: #2e6c9f; cursor: pointer; font-size: 11px; }
.dashboard-editor-check { align-content: center; grid-template-columns: auto 1fr; justify-content: start; }
.dashboard-editor-check input { width: 17px; height: 17px; padding: 0; }
.dashboard-editor-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 8px; }
.dashboard-widget-preview { grid-column: 1/-1; min-height: 42px; padding: 8px 10px; border: 1px dashed #a9c4dc; border-radius: 9px; background: #f5fafe; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dashboard-widget-preview strong { color: #1e4f7c; font-size: 18px; }
.dashboard-editor-wide,.dashboard-editor-form > details { grid-column: 1/-1; border: 1px solid #cedfeb; border-radius: 9px; padding: 8px; }
.dashboard-advanced-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding-top: 10px; }
.dashboard-conflict { display: grid; gap: 14px; color: var(--text); }
.dashboard-conflict p { margin: 0; line-height: 1.45; }
.dashboard-filter-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.dashboard-filter-form { display: grid; gap: 10px; }
.dashboard-filter-form > fieldset { border: 1px solid #cedfeb; border-radius: 9px; }
.dashboard-period-row { display: grid; grid-template-columns: minmax(150px,1fr) repeat(2,minmax(140px,1fr)); gap: 8px; }
.dashboard-period-row select,.dashboard-period-row input { min-width: 0; padding: 9px; border: 1px solid #c5d7e7; border-radius: 9px; }
.dashboard-filter-grid fieldset { min-width: 0; max-height: 230px; overflow: auto; border: 1px solid #cedfeb; border-radius: 9px; display: grid; align-content: start; gap: 4px; padding: 8px; }
.dashboard-filter-tools { position: sticky; top: -8px; z-index: 1; display: grid; grid-template-columns: minmax(70px,1fr) auto auto; gap: 4px; padding: 3px 0 6px; background: #fff; }
.dashboard-filter-tools input { min-width: 0; padding: 6px 7px; border: 1px solid #c5d7e7; border-radius: 7px; }
.dashboard-filter-tools button { border: 0; background: transparent; color: #2e6c9f; cursor: pointer; font-size: 11px; }
.dashboard-check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 8px; }
.dashboard-check-grid label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.dashboard-series-grid { grid-template-columns: repeat(3,minmax(0,1fr)); max-height: 220px; overflow: auto; }
.dashboard-name-form { display: grid; gap: 10px; }
.dashboard-name-form label { display: grid; gap: 5px; }
.dashboard-name-form input { padding: 10px; border: 1px solid #c5d7e7; border-radius: 9px; }
.dashboard-library { display: grid; grid-template-columns: repeat(4,minmax(120px,1fr)); gap: 9px; }
.dashboard-library > button { min-height: 116px; padding: 10px; border: 1px solid #c6daeb; border-radius: 12px; background: linear-gradient(145deg,#fff,#eef6fc); color: #173b5d; cursor: pointer; display: grid; grid-template-rows: minmax(62px,1fr) auto; gap: 7px; transition: border-color .16s,transform .16s,box-shadow .16s; }
.dashboard-library > button:hover,.dashboard-library > button:focus-visible { border-color: #4e91c6; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(44,97,140,.15); }
.dashboard-library > button > strong { font-size: 12px; }
.dashboard-library-kpi { align-self: center; color: #2f71a8; font-size: 34px; font-weight: 800; }
.dashboard-library-bars { align-self: end; height: 58px; display: flex; align-items: end; justify-content: center; gap: 5px; }
.dashboard-library-bars i { width: 14px; height: 35%; border-radius: 4px 4px 1px 1px; background: #4c91c7; }
.dashboard-library-bars i:nth-child(2) { height: 78%; background: #6bafd9; }.dashboard-library-bars i:nth-child(3) { height: 52%; background: #4fa69d; }.dashboard-library-bars i:nth-child(4) { height: 92%; background: #d0a64d; }
.dashboard-library-bars.bar_horizontal { transform: rotate(90deg) scale(.8); }.dashboard-library-bars.funnel i { width: 42px; height: 9px; border-radius: 2px; }.dashboard-library-bars.funnel { flex-direction: column; align-items: center; justify-content: center; }.dashboard-library-bars.funnel i:nth-child(2) { width: 34px; }.dashboard-library-bars.funnel i:nth-child(3) { width: 25px; }.dashboard-library-bars.funnel i:nth-child(4) { width: 16px; }
.dashboard-library-pie { align-self: center; justify-self: center; width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(#3478ad 0 38%,#63a9d6 38% 68%,#51a49b 68% 86%,#d3a54b 86%); }.dashboard-library-pie.donut { position: relative; }.dashboard-library-pie.donut::after { content:""; position:absolute; inset:15px; border-radius:50%; background:#f5fafe; }
.dashboard-library-line { position: relative; align-self: center; height: 55px; border-bottom: 1px solid #b9d2e6; }.dashboard-library-line::before { content:""; position:absolute; inset:8px 4px 7px; clip-path: polygon(0 76%,28% 38%,52% 62%,76% 12%,100% 30%,100% 39%,76% 22%,52% 72%,28% 48%,0 87%); background:#397fb6; }.dashboard-library-line.area::after { content:""; position:absolute; inset:8px 4px 7px; clip-path: polygon(0 76%,28% 38%,52% 62%,76% 12%,100% 30%,100% 100%,0 100%); background:rgba(83,157,210,.2); }.dashboard-library-line.scatter::before { clip-path:none; background:radial-gradient(circle at 12% 70%,#397fb6 0 4px,transparent 5px),radial-gradient(circle at 38% 32%,#57a99f 0 5px,transparent 6px),radial-gradient(circle at 63% 64%,#d0a64d 0 6px,transparent 7px),radial-gradient(circle at 87% 19%,#397fb6 0 4px,transparent 5px); }
.dashboard-library-table { align-self:center; height:54px; border:1px solid #8fb4d0; border-radius:4px; display:grid; grid-template-rows:repeat(3,1fr); overflow:hidden; }.dashboard-library-table i { border-bottom:1px solid #c9dce9; background:linear-gradient(90deg,#e8f2f9 0 35%,#fff 35% 68%,#f3f8fc 68%); }
.dashboard-library-content { align-self: center; justify-self: center; color: #3478ad; font-size: 32px; font-weight: 800; line-height: .8; }
.dashboard-library-content small { font-size: 10px; font-weight: 500; }
.dashboard-library-divider { align-self: center; display: flex; align-items: center; gap: 5px; font-size: 10px; color: #356a9b; }
.dashboard-library-divider i { width: 26px; height: 1px; background: #6b9fc8; }
.dashboard-data-table-wrap { width: 100%; max-height: 70dvh; overflow: auto; }
.dashboard-data-table { width: max-content; min-width: 0; border-collapse: collapse; font-size: 12px; }
.dashboard-data-table th,.dashboard-data-table td { padding: 7px 9px; border: 1px solid #d6e3ee; text-align: right; white-space: nowrap; }
.dashboard-data-table th:first-child,.dashboard-data-table td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; }
.dashboard-data-table th { position: sticky; top: 0; z-index: 2; background: #edf5fb; }
.dashboard-template-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.dashboard-template-grid > button { min-height: 118px; padding: 14px; border: 1px solid #c6daeb; border-radius: 13px; background: linear-gradient(145deg,#fff,#eef6fc); color: var(--text); text-align: left; cursor: pointer; display: grid; align-content: start; gap: 7px; }
.dashboard-template-grid > button:hover,.dashboard-template-grid > button:focus-visible { border-color: #4e91c6; box-shadow: 0 8px 20px rgba(44,97,140,.14); }
.dashboard-template-grid span,.dashboard-template-grid small { color: var(--muted); line-height: 1.35; }
.dashboard-template-unavailable { margin-top: 12px; padding: 10px; border: 1px solid #d7e4ef; border-radius: 10px; color: var(--muted); font-size: 12px; }
.dashboard-template-unavailable p { margin: 8px 0 0; }
@media (max-width: 760px) { .dashboard-toolbar { flex-wrap: wrap; } .dashboard-toolbar__end { margin-left: 0; } .dashboard-grid { display: block; overflow: auto; } .dashboard-widget { min-height: 240px; margin-bottom: 8px; } .dashboard-editor-form,.dashboard-filter-grid,.dashboard-advanced-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .dashboard-period-row,.dashboard-series-grid,.dashboard-template-grid { grid-template-columns: 1fr; } .dashboard-library { grid-template-columns: repeat(2,minmax(110px,1fr)); } .dashboard-modal-layer { padding: 6px; } .dashboard-modal { max-height: calc(100dvh - 12px); } }

.analysis-list {
  display: grid;
  gap: 7px;
  width: min(1120px, 100%);
}

.analysis-entry {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(25, 68, 108, 0.05);
}

.analysis-entry__summary {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 18px;
  align-items: center;
  min-height: 38px;
  padding: 0 11px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  list-style: none;
}

.analysis-entry__summary::-webkit-details-marker {
  display: none;
}

.analysis-entry__summary:hover {
  background: #f3f8fc;
}

.analysis-entry__summary time {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.analysis-entry__chevron {
  color: var(--accent);
  text-align: center;
  transition: transform 160ms ease;
}

.analysis-entry[open] .analysis-entry__chevron {
  transform: rotate(180deg);
}

.analysis-entry__content {
  padding: 10px 12px 13px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  line-height: 1.48;
}

.analysis-lead {
  margin: 0 0 10px;
  font-weight: 650;
}

.analysis-section + .analysis-section {
  margin-top: 13px;
}

.analysis-section h3 {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
}

.analysis-section p {
  margin: 5px 0;
}

.analysis-section ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.analysis-section li + li {
  margin-top: 3px;
}

.analysis-note,
.analysis-empty {
  padding: 8px 10px;
  border: 1px solid #bed4e8;
  border-radius: 7px;
  background: #eef6fc;
  color: #244e73;
}

@media (max-width: 720px) {
  .analysis-entry__summary {
    grid-template-columns: 72px minmax(0, 1fr) 16px;
    padding: 5px 8px;
  }

}

#streamsView.is-active {
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  overflow: hidden;
}

#conversionsView.is-active {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  overflow: hidden;
}

.table-frame,
.summary-panel,
.modal-card,
.info-banner,
.list-box,
.timeline-box,
.access-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.access-footer {
  width: min(560px, calc(100vw - 24px));
  margin: 3px auto 0;
}

.table-frame {
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.table-frame--simple {
  padding: 8px;
}

.table-top-scroll {
  display: none !important;
}

.table-top-scroll:not(.has-overflow) {
  display: none;
}

.table-top-scroll > div {
  height: 1px;
}

.table-scroll {
  overflow: auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: none;
  overscroll-behavior: contain;
}

.streams-table,
.simple-table {
  width: max-content;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  --sticky-header-height: 40px;
}

.auto-fit-data-table {
  width: max-content !important;
  min-width: 0 !important;
  table-layout: auto !important;
}

.streams-table th,
.streams-table td,
.simple-table th,
.simple-table td {
  padding: 5px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  text-align: right;
  font-size: 12px;
}

.streams-table thead th,
.simple-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #f7fbff;
  text-align: center;
}

.streams-table .virtual-spacer-row td {
  padding: 0;
  border: 0;
  background: #fff;
}

.sticky-left {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fcfeff;
}

.streams-table thead .sticky-left,
.simple-table thead .sticky-left {
  z-index: 8;
}

.streams-table thead .sticky-left.time-col,
.simple-table thead .sticky-left.time-col {
  box-shadow: 1px 0 0 var(--line-strong);
}

.sticky-left-2 { left: var(--sticky-left-2, 38px); }
.sticky-left-3 { left: var(--sticky-left-3, 106px); }
.sticky-left-4 { left: var(--sticky-left-4, 170px); }
.sticky-left-5 { left: var(--sticky-left-5, 232px); }

.left-col {
  text-align: left !important;
}

.select-col { text-align: center !important; }
.time-col { border-right: 2px solid var(--line-strong) !important; }

.metric-divider {
  border-left: 2px solid var(--line-strong) !important;
}

.conversion-divider {
  border-left: 2px solid var(--line-strong) !important;
  box-shadow: inset 1px 0 0 rgba(47, 95, 144, 0.18);
}

.total-row td {
  position: sticky;
  top: calc(var(--sticky-header-height, 40px) - 1px);
  z-index: 2;
  background: #e9f3fc;
  font-weight: 700;
  border-bottom: 2px solid var(--line-strong);
}

.total-row .sticky-left { z-index: 5; background: #e9f3fc; }

.calendar-summary-row { font-weight: 700; }
.calendar-summary-row--week > * { background: #fff4bd !important; }
.calendar-summary-row--month > * { background: #ffd8a8 !important; }

[data-stream-column-color="blue"], [data-conversion-color="blue"], tr[data-stream-row-color="blue"] { --stream-highlight-color: #d8ebff; }
[data-stream-column-color="cyan"], [data-conversion-color="cyan"], tr[data-stream-row-color="cyan"] { --stream-highlight-color: #d5f4f2; }
[data-stream-column-color="green"], [data-conversion-color="green"], tr[data-stream-row-color="green"] { --stream-highlight-color: #dff1df; }
[data-stream-column-color="yellow"], [data-conversion-color="yellow"], tr[data-stream-row-color="yellow"] { --stream-highlight-color: #fff1b8; }
[data-stream-column-color="orange"], [data-conversion-color="orange"], tr[data-stream-row-color="orange"] { --stream-highlight-color: #ffe0bd; }
[data-stream-column-color="red"], [data-conversion-color="red"], tr[data-stream-row-color="red"] { --stream-highlight-color: #fbd9dc; }
[data-stream-column-color="violet"], [data-conversion-color="violet"], tr[data-stream-row-color="violet"] { --stream-highlight-color: #e9def8; }
[data-stream-column-color="gray"], [data-conversion-color="gray"], tr[data-stream-row-color="gray"] { --stream-highlight-color: #e5eaf0; }

.streams-table [data-stream-column-color] {
  --stream-column-highlight: var(--stream-highlight-color);
  background: var(--stream-column-highlight) !important;
}

.conversion-table [data-conversion-color] {
  background: var(--stream-highlight-color) !important;
}

.streams-table tr[data-stream-row-color] {
  --stream-row-highlight: var(--stream-highlight-color);
}

.streams-table tr[data-stream-row-color] > td {
  background: var(--stream-row-highlight) !important;
}

.streams-table tr[data-stream-row-color] > td[data-stream-column-color] {
  background: color-mix(in srgb, var(--stream-row-highlight) 52%, var(--stream-column-highlight)) !important;
}

.stream-row-menu-target { cursor: context-menu; }

.streams-table [data-stream-column-key] {
  transition: box-shadow .16s ease, transform .16s ease, filter .16s ease;
}

.streams-table .stream-drag-source {
  filter: saturate(.72);
  opacity: .72;
}

.streams-table .stream-drop-before {
  box-shadow: inset 4px 0 0 #2384d6, -5px 0 12px rgba(35, 132, 214, .2);
  transform: translateX(3px);
}

.streams-table .stream-drop-after {
  box-shadow: inset -4px 0 0 #2384d6, 5px 0 12px rgba(35, 132, 214, .2);
  transform: translateX(-3px);
}

.column-header { position: relative; }

.section-utility {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 28px;
}

.conversion-table-frame { width: 100%; height: 100%; }
.conversion-table-frame .table-scroll { width: 100%; }

.conversion-stream-cell { text-align: left !important; }

.stream-status-pending {
  color: var(--muted);
  background: #f4f8fc;
}

.maturity-label {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reconciliation-summary {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.reconciliation-table-wrap {
  display: block;
  overflow: auto;
  max-height: 44vh;
}

.streams-utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.streams-meta,
.utility-actions,
.compare-actions,
.disputed-filter-row,
.disputed-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.display-level-checks {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 3px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.inline-check input { margin: 0; accent-color: var(--accent); }

.shared-funnel-dashboard {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.shared-funnel-dashboard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shared-funnel-dashboard__head > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.shared-funnel-dashboard__head strong {
  font-size: 12px;
}

.shared-funnel-dashboard__head span,
.shared-funnel-dashboard__scope,
.shared-funnel-dashboard__pending {
  color: var(--muted);
  font-size: 10px;
}

.shared-funnel-dashboard__scope {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  white-space: nowrap;
}

.shared-funnel-dashboard__scroll {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.shared-funnel-dashboard__rail {
  display: flex;
  align-items: center;
  width: max-content;
  min-width: 100%;
  padding: 2px 0 4px;
}

.shared-funnel-node {
  display: grid;
  place-content: center;
  flex: 0 0 104px;
  width: 104px;
  height: 104px;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 72%, transparent);
  border-radius: 50%;
  text-align: center;
  background: var(--panel-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 7px 18px rgba(41, 79, 112, .08);
}

.shared-funnel-node span,
.shared-funnel-node small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
}

.shared-funnel-node strong {
  margin: 3px 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.shared-funnel-node--finance { background: #e8f1fb; }
.shared-funnel-node--traffic { background: #e5f4f2; }
.shared-funnel-node--funnel { background: #edf3fb; }
.shared-funnel-node--sales { background: #fff1dc; }
.shared-funnel-node--positive { background: #e2f4e8; }
.shared-funnel-node--negative { background: #fbe8e8; }

.shared-funnel-connector {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 52px;
}

.shared-funnel-connector i {
  width: 34px;
  height: 1px;
  background: var(--line-strong);
}

.shared-funnel-connector i::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 auto;
  border-top: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  transform: rotate(45deg);
}

.shared-funnel-connector span {
  position: absolute;
  top: 3px;
  padding: 1px 4px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.shared-funnel-dashboard__pending {
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}

:root[data-theme="dark"] .shared-funnel-dashboard {
  border-color: var(--line);
  background: #122027;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .018);
}

:root[data-theme="dark"] .shared-funnel-node {
  border-color: rgba(177, 210, 219, .17);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 8px 20px rgba(0, 0, 0, .18);
}

:root[data-theme="dark"] .shared-funnel-node--finance { background: #193144; }
:root[data-theme="dark"] .shared-funnel-node--traffic { background: #173a3a; }
:root[data-theme="dark"] .shared-funnel-node--funnel { background: #1a303b; }
:root[data-theme="dark"] .shared-funnel-node--sales { background: #3a3020; }
:root[data-theme="dark"] .shared-funnel-node--positive { background: #1c392c; }
:root[data-theme="dark"] .shared-funnel-node--negative { background: #3e272c; }

@media (max-width: 720px) {
  .shared-funnel-dashboard__scope { display: none; }
  .shared-funnel-node { flex-basis: 92px; width: 92px; height: 92px; }
  .shared-funnel-node strong { font-size: 14px; }
}

.meta-badge,
.mini-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
}

.details-status-strip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  width: max-content;
  min-width: 0;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  z-index: 0;
  isolation: isolate;
}

.all-filters-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  max-height: min(62vh, 560px);
  align-items: start;
  overflow-y: auto;
  padding-right: 4px;
}

.all-filter-group {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  max-height: 220px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.all-filter-group legend,
.popover-section-title {
  padding: 0 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.all-filter-group .popover-list {
  min-height: 0;
  max-height: 176px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.all-filter-group .checkbox-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.all-filter-group--campaigns {
  grid-column: span 4;
  max-height: 250px;
}

.all-filter-group--campaigns .popover-list { max-height: 206px; }
.all-filter-group--times,
.all-filter-group--sources,
.all-filter-group--horizon,
.all-filter-group--ltv { grid-column: span 2; }
.all-filter-group--weekdays { grid-column: span 4; max-height: none; }
.all-filter-group--weekdays .popover-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 10px;
  max-height: none;
  overflow: visible;
}
.all-filter-group--media,
.all-filter-group--contents,
.all-filter-group--terms { grid-column: span 2; }

.all-filter-group--horizon,
.all-filter-group--ltv {
  grid-template-rows: auto auto auto;
  align-content: start;
  max-height: none;
}

.all-filter-group--ltv .checkbox-row span {
  overflow-wrap: normal;
}

.custom-horizon-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.custom-horizon-field input {
  min-width: 0;
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
}

.custom-horizon-field.hidden { display: none; }

@media (max-width: 760px) {
  .active-filter-summary { align-items: flex-start; flex-direction: column; }
  .active-filter-summary__actions { margin-left: 0; }
  .all-filters-grid { grid-template-columns: 1fr; }
  .all-filter-group--times,
  .all-filter-group--sources,
  .all-filter-group--horizon,
  .all-filter-group--ltv,
  .all-filter-group--weekdays,
  .all-filter-group--campaigns,
  .all-filter-group--media,
  .all-filter-group--contents,
  .all-filter-group--terms { grid-column: auto; }
  .all-filter-group--weekdays .popover-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-filter-select { max-width: 100%; }
  .filter-row--period { align-items: stretch; }
  .inline-filter-field--date { flex: 1 1 190px; }
  .inline-filter-field--date input { width: 100%; }
}

.details-status-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.92;
  z-index: -1;
}

.details-status-strip.is-loading {
  color: #1f4d78;
}

.details-status-strip.is-loading::before {
  background: linear-gradient(90deg, #d8ebfb 0%, #9fcaef 50%, #d8ebfb 100%);
  background-size: 220% 100%;
  animation: detailsStatusSweep 1.8s linear infinite;
}

.details-status-strip.is-ready {
  color: #215e3b;
}

.details-status-strip.is-ready::before {
  background: linear-gradient(90deg, #dff4e8 0%, #c8ebd8 100%);
}

@keyframes detailsStatusSweep {
  0% { background-position: 200% 0; }
  100% { background-position: -20% 0; }
}

.summary-title,
.section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.summary-grid {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  gap: 6px;
}

.summary-card {
  flex: 0 0 118px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  background: var(--panel-soft);
}

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

.client-campaign-asset {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 12px;
}

.client-campaign-asset span,
.client-campaign-asset small {
  color: var(--muted);
}

.summary-card-button {
  width: 100%;
  text-align: left;
}

.summary-card-button:hover {
  border-color: var(--line-strong);
  background: #eef5fb;
}

.summary-card strong,
.summary-card span {
  display: block;
}

.shared-funnel-node[data-summary-payback] {
  appearance: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.shared-funnel-node[data-summary-payback]:hover,
.shared-funnel-node[data-summary-payback]:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
  outline: none;
}

.payback-detail {
  display: grid;
  gap: 10px;
}

.payback-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.payback-summary .meta-badge {
  background: var(--panel-soft);
}

.payback-chart {
  width: 100%;
  height: min(440px, 54dvh);
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

@media (max-width: 720px) {
  .payback-chart { height: 360px; min-height: 260px; }
}

.summary-card span {
  color: var(--muted);
  font-size: 11px;
}

.compare-head {
  display: grid;
  gap: 10px;
}

.menu {
  position: absolute;
  left: 0;
  bottom: 44px;
  width: 190px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 60;
}

.menu-item {
  min-height: 30px;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  color: var(--text);
}

.menu-item:hover {
  background: var(--panel-soft);
}

.menu-item.danger {
  color: var(--danger);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 41, 62, 0.36);
  z-index: 80;
}

.modal-card {
  position: fixed;
  z-index: 90;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(960px, calc(100vw - 24px));
  padding: 10px;
  max-height: calc(100dvh - 24px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.modal-card--center,
.modal-card--small {
  width: min(560px, calc(100vw - 24px));
}

.modal-card--wide {
  width: min(1160px, calc(100vw - 24px));
}

.hidden {
  display: none !important;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 6px;
  background: var(--panel);
  cursor: move;
}

.modal-head button,
.modal-head input,
.modal-head select,
.modal-head textarea,
.modal-head a,
.modal-head label { cursor: auto; }

.modal-card--dragging {
  user-select: none;
  cursor: move;
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  gap: 6px;
}

.icon-button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.form-stack {
  display: grid;
  gap: 8px;
}

.field {
  display: grid;
  gap: 4px;
}

.field span {
  font-size: 11px;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
}

.form-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.form-error {
  color: var(--danger);
}

.form-note {
  color: var(--muted);
  font-size: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.list-box,
.timeline-box,
.log-list {
  max-height: 60vh;
  overflow: auto;
  padding: 6px;
}

.list-item,
.timeline-item,
.log-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  padding: 7px 8px;
  margin-bottom: 6px;
}

.list-item button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
}

.list-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.user-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-item--compact {
  padding: 6px 8px;
}

.service-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
}

.service-user-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
}

.service-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  flex: 0 0 48px;
  background: #dce7f3;
}

.service-user-avatar .avatar-image,
.service-user-avatar .avatar-fallback {
  width: 100%;
  height: 100%;
}

.service-user-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.service-user-copy strong,
.service-user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-user-copy span {
  color: var(--muted);
  font-size: 12px;
}

.service-user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.list-box--tall {
  max-height: 72vh;
}

.client-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.client-links-box {
  grid-column: 1 / -1;
}

.client-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.client-link-pill {
  text-decoration: none;
}

.client-summary-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  background: var(--panel-soft);
}

.client-summary-card strong,
.client-summary-card span {
  display: block;
}

.client-summary-card span {
  color: var(--muted);
  font-size: 11px;
}

.timeline-item--disputed {
  border-color: rgba(163, 62, 62, 0.35);
  background: #fff7f7;
}

.details-grid {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.details-grid > div {
  display: grid;
  gap: 2px;
}

.detail-key {
  color: var(--muted);
  font-size: 11px;
}

.detail-value {
  color: var(--text);
  font-size: 12px;
}

.popover {
  position: fixed;
  z-index: 70;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
}

.popover-list {
  display: grid;
  gap: 6px;
}

.saved-view-form {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 6px;
  margin-bottom: 7px;
}

.saved-view-form input { min-width: 0; }
.saved-view-list { gap: 3px; }
.saved-view-row { display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: center; gap: 4px; }
.saved-view-row .text-button { min-width: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.saved-view-row .icon-button { width: 26px; height: 26px; color: var(--danger); }

.utm-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 7px; }
.utm-filter-group { min-width: 0; max-height: 280px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 7px; }
.utm-filter-group legend { padding: 0 4px; color: var(--muted); font-size: 11px; font-weight: 700; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkbox-row input {
  margin: 0;
}

.popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.info-banner {
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--accent-soft);
}

.metric-cell-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  min-width: 100%;
  text-align: inherit;
}

.metric-cell-button:hover {
  color: var(--accent);
}

.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.avatar-preview--large {
  width: 88px;
  height: 88px;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #4b78aa, #325f90);
  color: #fff;
  font-weight: 700;
}

.checkbox-grid {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: var(--panel-soft);
}

.issue-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4fa;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.disputed-summary {
  display: grid;
  gap: 8px;
}

.disputed-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.field--compact {
  min-width: 120px;
  gap: 4px;
}

.field--compact span {
  font-size: 11px;
  color: var(--muted);
}

.field--compact input,
.field--compact select {
  min-height: 28px;
}

.disputed-filter-button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.disputed-filter-button.is-active,
.disputed-filter-button:hover {
  border-color: var(--line-strong);
  background: #eef5fb;
}

.disputed-assignment {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.disputed-client-cell {
  display: grid;
  gap: 4px;
}

.disputed-related-people {
  display: grid;
  gap: 4px;
}

.tiny-link {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  text-align: left;
}

.tiny-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.disputed-reason {
  margin-top: 4px;
}

.disputed-stream-select {
  min-height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0 8px;
}

.disputed-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tiny-button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tiny-button:hover {
  background: #cfe2f5;
}

.tiny-button--ghost {
  border-color: var(--line);
  background: var(--panel);
  color: var(--muted);
}

.subject-resolution-controls,
.resolution-journal {
  margin-top: 6px;
  border-top: 1px solid var(--line-soft);
  padding-top: 6px;
}

.subject-resolution-controls summary,
.resolution-journal summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.subject-resolution-controls[open] {
  display: grid;
  gap: 6px;
}

.subject-resolution-controls select,
.subject-resolution-controls input {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 8px;
  color: var(--text);
  font-size: 12px;
}

.resolution-journal-list {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  max-height: 180px;
  overflow: auto;
}

.resolution-journal-item,
.identity-search-result {
  display: grid;
  grid-template-columns: auto auto minmax(160px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.identity-search-result {
  grid-template-columns: minmax(0, 1fr) auto;
}

.comparison-segment-form {
  display: grid;
  gap: 10px;
}

.comparison-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
}

.comparison-filter-groups {
  display: contents;
}

.comparison-segment-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 8px;
  align-items: start;
}

.comparison-segment-filter-group {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  max-height: 220px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  overflow: hidden;
}

.comparison-segment-filter-group legend {
  padding: 0 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.comparison-filter-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comparison-segment-period-group {
  grid-column: span 2;
  max-height: none;
}

.comparison-segment-period-group .period-range {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comparison-segment-period-group .period-range .field,
.comparison-segment-period-group .period-range input {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.comparison-segment-filter-group--times,
.comparison-segment-filter-group--sources,
.comparison-segment-filter-group--qualities,
.comparison-segment-filter-group--media,
.comparison-segment-filter-group--contents,
.comparison-segment-filter-group--terms,
.comparison-segment-horizon-group,
.comparison-segment-ltv-group { grid-column: span 2; }

.comparison-segment-filter-group--weekdays,
.comparison-segment-filter-group--campaigns { grid-column: span 4; }

.comparison-segment-filter-group--weekdays { max-height: none; }

.comparison-segment-filter-group--weekdays .comparison-filter-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-height: none;
  overflow: visible;
}

.comparison-segment-filter-group--campaigns {
  max-height: 250px;
}

.comparison-segment-filter-group--campaigns .comparison-filter-options {
  max-height: 188px;
}

#comparisonSegmentModal {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

.comparison-filter-options {
  display: grid;
  gap: 2px;
  max-height: 168px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

#comparisonSegmentModal .form-actions {
  position: sticky;
  bottom: -10px;
  z-index: 3;
  padding: 8px 0 0;
  background: var(--panel);
}

.access-body {
  min-height: 100vh;
  display: block;
  overflow: auto;
  padding: 12px;
  background: linear-gradient(180deg, #dfeaf6, #edf4fb);
}

.access-card {
  width: min(560px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 10px;
}

@media (max-width: 960px) {
  .sidebar {
    padding: 8px 6px;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .comparison-editor-grid,
  .comparison-filter-groups {
    grid-template-columns: 1fr 1fr;
  }
  .boot-visuals {
    grid-template-columns: 1fr;
  }
  .boot-status-head,
  .boot-status-body {
    align-items: flex-start;
    flex-direction: column;
  }
  .boot-progress {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .comparison-editor-grid,
  .comparison-filter-groups {
    grid-template-columns: 1fr;
  }
  .boot-screen {
    padding: 14px;
    border-radius: 20px;
  }
  .boot-status-title {
    font-size: 20px;
  }
  .boot-panel {
    min-height: 146px;
  }
  .boot-signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .comparison-segment-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison-segment-period-group,
  .comparison-segment-filter-group--times,
  .comparison-segment-filter-group--sources,
  .comparison-segment-filter-group--qualities,
  .comparison-segment-filter-group--weekdays,
  .comparison-segment-filter-group--campaigns,
  .comparison-segment-filter-group--media,
  .comparison-segment-filter-group--contents,
  .comparison-segment-filter-group--terms { grid-column: auto; }
  .comparison-segment-horizon-group,
  .comparison-segment-ltv-group { grid-column: auto; }
}

@media (max-width: 640px) {
  .comparison-segment-filter-grid { grid-template-columns: 1fr; }
  .comparison-segment-filter-group--weekdays .comparison-filter-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* V26 dense workbench surfaces */
.sidebar-user {
  display: grid;
  justify-items: start;
  gap: 6px;
}

.sidebar-tool-button {
  position: relative;
  width: 32px;
  height: 30px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,.08);
  display: grid;
  place-items: center;
}

.sidebar-tool-count {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: #fff;
  color: var(--sidebar-strong);
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
}

.button--danger,
.context-menu__item.danger { color: var(--danger); }

.trash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}

.trash-item > div:first-child { display: grid; gap: 2px; }
.trash-item span { color: var(--muted); font-size: 12px; }
.trash-item__actions { display: flex; gap: 6px; }

.context-menu {
  position: fixed;
  z-index: 220;
  min-width: 176px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 52, 82, .2);
}

.context-menu__item {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 4px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.context-menu__item:hover { background: var(--accent-soft); }
.context-menu__item:disabled { color: var(--muted); cursor: not-allowed; opacity: .55; }

.context-menu--palette { min-width: 176px; }

.stream-color-palette {
  display: grid;
  grid-template-columns: repeat(4, 30px);
  justify-content: center;
  gap: 7px;
  padding: 7px;
}

.stream-color-swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(26, 67, 105, .2);
  border-radius: 7px;
  background: var(--stream-highlight-color);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.stream-color-swatch:hover { transform: translateY(-2px); }
.stream-color-swatch.is-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.stream-color-swatch[data-stream-color="blue"] { --stream-highlight-color: #d8ebff; }
.stream-color-swatch[data-stream-color="cyan"] { --stream-highlight-color: #d5f4f2; }
.stream-color-swatch[data-stream-color="green"] { --stream-highlight-color: #dff1df; }
.stream-color-swatch[data-stream-color="yellow"] { --stream-highlight-color: #fff1b8; }
.stream-color-swatch[data-stream-color="orange"] { --stream-highlight-color: #ffe0bd; }
.stream-color-swatch[data-stream-color="red"] { --stream-highlight-color: #fbd9dc; }
.stream-color-swatch[data-stream-color="violet"] { --stream-highlight-color: #e9def8; }
.stream-color-swatch[data-stream-color="gray"] { --stream-highlight-color: #e5eaf0; }
.stream-color-reset { margin-top: 2px; border-top: 1px solid var(--line); }

#conversionsView,
#compareView,
#reconciliationView,
#disputedView {
  min-height: 0;
  height: 100%;
}

.conversion-table-frame { justify-content: stretch; }
.conversion-table { width: max-content; min-width: 0; table-layout: auto; }

.compare-toolbar { justify-content: flex-start; min-height: 38px; }
.comparison-table-frame { height: calc(100% - 42px); min-height: 0; padding: 0; }
.comparison-column-groups {
  display: flex;
  align-items: stretch;
  width: max-content;
  min-width: 0;
  height: 25px;
  border-bottom: 1px solid var(--line-strong);
  background: #e8f1f9;
}
.comparison-column-groups__segment { border-right: 1px solid var(--line); }
.comparison-column-groups__segment { display: flex; align-items: center; padding: 2px 5px; }
.comparison-column-group {
  min-width: 0;
  padding: 1px 8px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #dceaf6;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}
.comparison-column-groups__conversions {
  flex: 0 0 auto;
  min-width: 0;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.comparison-table-scroll { height: calc(100% - 25px); overflow: auto; }
.comparison-table { width: max-content; min-width: 0; table-layout: auto; }
.comparison-table thead { position: sticky; top: 0; z-index: 5; }
.comparison-segment-cell { left: 0; z-index: 4; }
.comparison-segment-cell .form-note { display: block; }
.comparison-divider-row td {
  position: static !important;
  height: 30px;
  padding: 5px 10px !important;
  background: #284f76 !important;
  color: #fff;
  font-weight: 700;
  text-align: left;
}
.comparison-empty { display: flex; align-items: center; gap: 8px; padding: 8px; color: var(--muted); }

.period-editor {
  min-width: 0;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.period-editor legend { padding: 0 4px; color: var(--muted); font-size: 11px; }
.period-presets { display: flex; flex-wrap: wrap; gap: 5px 10px; }
.period-presets label { white-space: nowrap; }
.period-range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }

.section-tabs {
  display: flex;
  gap: 2px;
  height: 36px;
  padding: 4px 4px 0;
  border-bottom: 1px solid var(--line-strong);
}
.section-tab {
  min-width: 118px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: transparent;
  color: var(--muted);
}
.section-tab.is-active { border-color: var(--line-strong); background: #fff; color: var(--text); font-weight: 700; }
.reconciliation-summary { min-height: 34px; padding: 4px 8px; }
.reconciliation-table-wrap { height: calc(100% - 70px); overflow: auto; }
.reconciliation-table-wrap .simple-table thead { position: sticky; top: 0; z-index: 2; }

.disputed-summary--compact {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 8px;
  overflow: visible;
}
.disputed-summary-spacer { flex: 1; }
.compact-select { min-width: 250px; max-width: 420px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.compact-select.compact-select--disputed-issue { min-width: 170px; max-width: 260px; }
#disputedView { display: none; grid-template-rows: auto minmax(0, 1fr); }
#disputedView.is-active { display: grid; }
#disputedTableWrap { min-height: 0; height: 100%; overflow: auto; }
#disputedTableWrap .simple-table thead { position: sticky; top: 0; z-index: 4; }
.popover--wide { width: min(760px, calc(100vw - 24px)); }
.disputed-filter-modal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }

.analysis-entry__content { font-size: 13px; line-height: 1.5; max-width: 980px; }
.analysis-section + .analysis-section { margin-top: 8px; }
.analysis-section p { margin: 5px 0; }

@media (max-width: 760px) {
  .comparison-utm-groups {
    grid-template-columns: 1fr;
  }
  .disputed-filter-modal-grid { grid-template-columns: 1fr; }
  .compact-select { min-width: 140px; }
}

/* V27 unified workbench layout */
.service-view.is-active {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  overflow: hidden;
}

#usersView.is-active {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.service-toolbar {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.service-title {
  font-size: 13px;
  font-weight: 700;
}

.service-grid {
  min-height: 0;
  display: grid;
  gap: 8px;
}

.service-grid--users {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.service-panel {
  min-width: 0;
  min-height: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.service-panel--form {
  width: min(720px, 100%);
  overflow-x: hidden;
  overflow-y: auto;
}

.settings-list {
  display: grid;
  gap: 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.settings-row--toggle {
  align-items: center;
}

.settings-row.hidden {
  display: none;
}

.settings-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-copy__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.settings-copy__note {
  font-size: 12px;
  color: var(--muted);
}

#stageRefreshResult.is-success {
  color: var(--ok);
}

#stageRefreshResult.is-error {
  color: var(--danger);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch__track {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #c3d3e4;
  border: 1px solid #97aec7;
  transition: background-color .18s ease, border-color .18s ease;
}

.switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(27, 55, 82, 0.18);
  transition: transform .18s ease;
}

.switch input:checked + .switch__track {
  background: #4f86b8;
  border-color: #3e74a5;
}

.switch input:checked + .switch__track .switch__thumb {
  transform: translateX(22px);
}

.switch input:disabled + .switch__track {
  opacity: 0.65;
}

.service-list {
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: auto;
  box-shadow: none;
}

.service-list .button {
  min-height: 28px;
}

.log-item[data-level="success"],
.log-item[data-level="info"] {
  border-left: 3px solid var(--ok);
}

.log-item[data-level="error"] {
  border-left: 3px solid var(--danger);
  background: #fff7f7;
}

.log-status {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.log-status--success { color: var(--ok); background: #e8f5ed; }
.log-status--error { color: var(--danger); background: #fdecec; }

.source-status-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}

#logsView.is-active {
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

#logsView.is-active.logs-view--status-hidden { grid-template-rows: auto minmax(0, 1fr); }

#logsView .service-toolbar { position: relative; z-index: 2; }
#logCategorySelect { width: min(280px, 45vw); min-height: 32px; }

.source-status-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 7px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 7px;
  background: var(--panel);
  font-size: 11px;
}

.source-status-card small { grid-column: 1 / -1; color: var(--muted); }
.source-status-card--fresh { border-left-color: var(--ok); }
.source-status-card--stale,
.source-status-card--missing { border-left-color: var(--danger); }

#compareView.is-active {
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  overflow: hidden;
}

.compare-toolbar {
  display: none;
}

.comparison-table-frame {
  height: 100%;
  min-height: 0;
  align-self: stretch;
}

.comparison-table,
.conversion-table,
.reconciliation-table-wrap .simple-table,
#disputedTableWrap .simple-table {
  width: max-content;
  min-width: 0;
  table-layout: auto;
}

#reconciliationView.is-active {
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  overflow: hidden;
}

.reconciliation-table-wrap {
  height: 100%;
  max-height: none;
  min-height: 0;
}

.client-modal-layout {
  width: min(1480px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  display: grid;
  grid-template-rows: auto auto auto;
  overflow-x: hidden;
  overflow-y: auto;
}

.client-summary {
  min-width: 0;
  min-height: 0;
  display: block;
  overflow: visible;
}

.client-passport-grid {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 7px;
}

.client-passport-card {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
}

.client-passport-card h3 {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
}

.client-passport-card__title {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.client-passport-pairs {
  margin: 0;
  font-size: 11px;
}

.client-passport-pairs > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; }
.client-passport-pairs dt { color: var(--muted); }
.client-passport-pairs dd { margin: 0; overflow: hidden; text-overflow: ellipsis; }

.client-summary .client-links-box { grid-column: auto; padding: 0; border: 0; background: transparent; }
.client-summary .section-label { display: none; }
.client-summary .client-link-pill { min-height: 23px; }
.client-campaign-assets { margin-top: 6px; display: grid; gap: 5px; }
.client-campaign-asset { padding: 5px; }

.client-utm-episodes {
  display: grid;
  gap: 4px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.client-utm-episode {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 6px;
  padding: 4px 5px;
  border-radius: 6px;
  background: var(--panel);
  font-size: 10px;
}

.client-utm-episode span,
.client-utm-episode small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-utm-episode small {
  grid-column: 1 / -1;
  color: var(--muted);
  white-space: normal;
}

.client-history-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

#clientTimeline {
  min-height: 0;
  max-height: none;
  display: block;
  gap: 7px;
  overflow: visible;
  box-shadow: none;
}

.client-history-table {
  width: max-content;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.client-history-table th,
.client-history-table td {
  padding: 5px 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.client-history-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f8fc;
}

.client-history-table__details {
  max-width: 520px;
  white-space: normal;
}

.client-resolution-workspace {
  margin-bottom: 7px;
  padding: 6px 8px;
  border: 1px solid #e7c8c8;
  border-radius: 9px;
  background: #fff8f8;
}

.client-resolution-item {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
  gap: 7px;
  align-items: center;
  padding: 5px 0;
  border-top: 1px solid #edd6d6;
}

.client-resolution-item > div:first-child { display: grid; }
.client-resolution-item p { margin: 0; font-size: 11px; }

.auto-fit-data-table th { position: relative; }

@media (max-width: 1040px) {
  .client-passport-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-grid--users { grid-template-columns: 1fr; }
}

.environment-badge {
  position: fixed;
  z-index: 10000;
  top: 8px;
  right: 12px;
  padding: 4px 9px;
  border: 1px solid #9dc3ea;
  border-radius: 999px;
  background: #d9ecff;
  color: #174b78;
  box-shadow: 0 2px 9px rgb(30 76 116 / 12%);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

/* Contemporary workbench skin. The layout stays dense; only hierarchy and tactility change. */
body,
.workspace,
.sidebar,
.topbar,
.table-frame,
.modal-card,
.dashboard-widget,
.service-panel,
.settings-row,
.chip,
.button,
.icon-button {
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.sidebar {
  background:
    radial-gradient(circle at 25% -10%, rgba(110, 196, 205, 0.28), transparent 34%),
    linear-gradient(180deg, var(--sidebar), var(--sidebar-strong));
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  background: linear-gradient(145deg, rgba(255,255,255,.28), rgba(255,255,255,.1));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 5px 16px rgba(5,31,45,.16);
}

.nav-item { border: 1px solid transparent; }
.nav-item.is-active {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.09);
  box-shadow: inset 3px 0 0 #77d3ca;
}

.sidebar-user { gap: 7px; }
.sidebar-tool-button,
.avatar-button {
  box-shadow: 0 5px 16px rgba(8,35,50,.14);
}

.theme-toggle { position: relative; }
.theme-icon--sun { display: none; }
:root[data-theme="dark"] .theme-icon--moon { display: none; }
:root[data-theme="dark"] .theme-icon--sun { display: block; }

.topbar {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.15);
}

.chip,
.button,
.icon-button,
.compact-select {
  border-color: var(--line);
  background: var(--panel-elevated);
  color: var(--text);
  box-shadow: 0 2px 7px rgba(31,70,81,.05);
}

.chip:hover,
.button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-hover);
  transform: translateY(-1px);
}

.chip.is-active,
.section-tab.is-active {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.table-frame,
.summary-panel,
.modal-card,
.info-banner,
.list-box,
.timeline-box,
.access-card,
.service-panel {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.modal-card { box-shadow: var(--shadow-raised); }
.modal-backdrop { background: rgba(15, 34, 43, .42); backdrop-filter: blur(4px); }
.modal-head { background: var(--panel); }

.streams-table,
.simple-table,
.streams-table .virtual-spacer-row td {
  background: var(--panel-elevated);
  color: var(--text);
}

.streams-table thead th,
.simple-table thead th {
  background: color-mix(in srgb, var(--panel-soft) 86%, var(--accent-soft));
}

.sticky-left { background: var(--panel-elevated); }
.streams-table tbody tr:hover > td:not([data-stream-column-color]) {
  background: var(--panel-hover);
}

.dashboard-grid {
  background-color: color-mix(in srgb, var(--bg) 84%, var(--panel));
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--accent) 18%, transparent) 1px, transparent 0);
}

.dashboard-widget {
  border-color: var(--line);
  background: var(--panel-elevated);
  box-shadow: var(--shadow);
}

.dashboard-widget__head {
  border-color: var(--line);
  background: linear-gradient(90deg, var(--panel-soft), color-mix(in srgb, var(--accent-soft) 44%, var(--panel-soft)));
}

.dashboard-widget__menu { color: var(--accent); }
.dashboard-widget__meta[open],
.dashboard-widget-preview,
.dashboard-empty {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

.field input,
.field textarea,
.field select,
input,
textarea,
select {
  background: var(--panel-elevated);
  color: var(--text);
  border-color: var(--line);
}

.menu,
.popover,
.context-menu {
  background: var(--panel-elevated);
  border-color: var(--line);
  color: var(--text);
  box-shadow: var(--shadow-raised);
}

.menu-item:hover,
.context-menu__item:hover { background: var(--panel-hover); }
.settings-row { background: var(--panel-soft); }

:root[data-theme="dark"] {
  color-scheme: dark;
  --sidebar: #123344;
  --sidebar-strong: #0b2533;
  --sidebar-soft: #1b4558;
  --text-on-dark: #edf7f7;
  --bg: #0b1217;
  --panel: #101a20;
  --panel-elevated: #152229;
  --panel-soft: #1a2931;
  --panel-hover: #20343d;
  --line: rgba(173, 204, 215, .13);
  --line-strong: rgba(173, 211, 220, .29);
  --text: #e7eff1;
  --muted: #91a6ad;
  --accent: #58c8bd;
  --accent-strong: #7de0d4;
  --accent-soft: #173b3b;
  --accent-secondary: #6eb4d2;
  --ok: #73d2a3;
  --warn: #e5bd68;
  --danger: #f18b8b;
  --shadow: 0 10px 28px rgba(0, 0, 0, .2);
  --shadow-raised: 0 22px 58px rgba(0, 0, 0, .48);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 82% -8%, rgba(47, 133, 140, .13), transparent 34%),
    linear-gradient(135deg, rgba(17, 38, 47, .24), transparent 46%),
    var(--bg);
}

:root[data-theme="dark"] .sidebar {
  background:
    radial-gradient(circle at 18% -8%, rgba(91, 204, 194, .2), transparent 30%),
    linear-gradient(180deg, var(--sidebar), var(--sidebar-strong));
  border-right-color: rgba(141, 208, 207, .13);
  box-shadow: 10px 0 30px rgba(0, 0, 0, .14);
}

:root[data-theme="dark"] .brand-mark {
  background: linear-gradient(145deg, rgba(116, 221, 210, .3), rgba(255, 255, 255, .08));
  color: #f4ffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 8px 20px rgba(0, 0, 0, .18);
}

:root[data-theme="dark"] .nav-item {
  color: rgba(232, 244, 245, .8);
}

:root[data-theme="dark"] .nav-item:hover {
  background: rgba(255, 255, 255, .055);
  color: #f5ffff;
}

:root[data-theme="dark"] .nav-item.is-active {
  border-color: rgba(116, 221, 210, .11);
  background: linear-gradient(90deg, rgba(87, 200, 189, .22), rgba(255, 255, 255, .07));
  color: #f6ffff;
  box-shadow: inset 3px 0 0 #72d9ce, 0 7px 18px rgba(0, 0, 0, .11);
}

/* Daily cohort explorer */
.cohort-workspace {
  min-height: 0;
  padding: 14px 16px 20px;
  overflow: auto;
}

.cohort-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.cohort-toolbar__title {
  margin-right: 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong, #35162f);
}

.cohort-toolbar__funnel {
  cursor: default;
}

.cohort-toggle,
.cohort-whole-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  color: var(--text, #4d3047);
}

.cohort-toggle {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border, #ead0c0);
  border-radius: 10px;
  background: var(--surface, #fffaf6);
}

.cohort-chart-panel {
  position: relative;
  min-height: 600px;
  padding: 42px 12px 10px;
  border: 1px solid var(--border, #ead0c0);
  border-radius: 16px;
  background: var(--surface, #fffdfb);
  box-shadow: 0 8px 26px rgba(66, 32, 52, .06);
}

.cohort-axis-guide {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 52px 2px;
  color: var(--muted, #8c7282);
  font-size: 12px;
}

.cohort-whole-toggle {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 16px;
  min-height: 28px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-soft, #fff2ea);
}

.cohort-trend-chart {
  width: 100%;
  height: 490px;
  outline: none;
  touch-action: pan-y;
}

.cohort-anomaly-panel {
  margin-top: 10px;
  border: 1px solid var(--border, #ead0c0);
  border-radius: 14px;
  background: var(--surface, #fffdfb);
  overflow: hidden;
}

.cohort-anomaly-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border, #ead0c0);
}

.cohort-anomaly-title {
  color: var(--text-strong, #35162f);
  font-weight: 700;
}

.cohort-anomaly-note {
  max-width: 820px;
  margin-top: 3px;
  color: var(--muted, #8c7282);
  font-size: 12px;
}

.cohort-anomaly-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.cohort-anomaly-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 2px 8px;
  border: 1px solid var(--border, #ead0c0);
  border-radius: 999px;
  background: var(--surface-soft, #fff7f2);
  color: var(--text, #4d3047);
  font-size: 12px;
  white-space: nowrap;
}

.cohort-anomaly-badge--positive {
  border-color: rgba(18, 164, 122, .34);
  background: rgba(18, 164, 122, .1);
  color: #087554;
}

.cohort-anomaly-badge--warning {
  border-color: rgba(224, 138, 30, .38);
  background: rgba(224, 138, 30, .11);
  color: #9b5808;
}

.cohort-anomaly-badge--negative {
  border-color: rgba(211, 79, 79, .34);
  background: rgba(211, 79, 79, .1);
  color: #a32f2f;
}

.cohort-anomaly-table {
  max-height: 330px;
  overflow: auto;
}

.cohort-anomaly-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) 80px minmax(170px, 1.3fr) 92px 108px 110px minmax(150px, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 880px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--border-soft, #f1dfd4);
  background: transparent;
  color: var(--text, #4d3047);
  text-align: left;
  cursor: pointer;
}

.cohort-anomaly-row:hover,
.cohort-anomaly-row:focus-visible {
  background: var(--surface-soft, #fff7f2);
  outline: none;
}

.cohort-anomaly-row:last-child {
  border-bottom: 0;
}

.cohort-anomaly-row__series,
.cohort-anomaly-row__signal {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cohort-anomaly-row__signal {
  font-weight: 700;
}

.cohort-anomaly-row[data-signal="positive_anomaly"] .cohort-anomaly-row__signal { color: #087554; }
.cohort-anomaly-row[data-signal="positive_candidate"] .cohort-anomaly-row__signal { color: #9b5808; }
.cohort-anomaly-row[data-signal="negative_anomaly"] .cohort-anomaly-row__signal { color: #a32f2f; }

.cohort-anomaly-empty {
  padding: 14px;
  color: var(--muted, #8c7282);
}

.cohort-trend-chart:focus-visible {
  border-radius: 10px;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .25);
}

.cohort-chart-empty {
  position: absolute;
  inset: 45% 16px auto;
  z-index: 2;
  text-align: center;
  color: var(--muted, #8c7282);
}

.cohort-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-height: 28px;
  padding: 8px 4px 0;
  border-top: 1px dashed var(--border, #ead0c0);
}

.cohort-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  color: var(--text, #4d3047);
}

.cohort-legend-swatch {
  width: 22px;
  height: 3px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--series-color);
}

.cohort-legend-label {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cohort-legend-loss {
  color: var(--muted, #8c7282);
  white-space: nowrap;
}

.cohort-gesture-hint {
  margin: 8px 2px 0;
  color: var(--muted, #8c7282);
  font-size: 13px;
}

.cohort-series-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: min(66vh, 680px);
  padding: 2px 3px 12px;
  overflow: auto;
}

.cohort-series-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border, #ead0c0);
  border-radius: 12px;
  background: var(--surface-soft, #fff7f2);
}

.cohort-series-group__title {
  margin-bottom: 7px;
  font-weight: 700;
  color: var(--text-strong, #35162f);
}

.cohort-series-group__actions {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.cohort-series-group__actions button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent, #d1594d);
  cursor: pointer;
}

.cohort-series-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  max-height: 190px;
  overflow: auto;
}

.cohort-series-list .checkbox-row {
  align-items: flex-start;
  min-width: 0;
}

.cohort-series-list .checkbox-row span {
  overflow-wrap: anywhere;
}

.cohort-gap-marker {
  pointer-events: auto;
}

.cohort-detail-chart {
  min-height: 440px;
}

@media (max-width: 820px) {
  .cohort-workspace { padding: 10px 8px 16px; }
  .cohort-toolbar__title { width: 100%; font-size: 16px; }
  .cohort-toolbar .inline-filter-field--date { flex: 1 1 145px; }
  .cohort-toolbar .button { flex: 1 1 auto; }
  .cohort-chart-panel { min-height: 525px; padding-inline: 4px; }
  .cohort-axis-guide { padding-inline: 42px 8px; font-size: 11px; }
  .cohort-trend-chart { height: 420px; }
  .cohort-anomaly-head { display: block; }
  .cohort-anomaly-summary { justify-content: flex-start; margin-top: 8px; }
  .cohort-series-options { grid-template-columns: 1fr; }
  .cohort-series-list { grid-template-columns: 1fr; }
  .cohort-legend-label { max-width: 180px; }
}

:root[data-theme="dark"] .cohort-chart-panel,
:root[data-theme="dark"] .cohort-anomaly-panel,
:root[data-theme="dark"] .cohort-toggle,
:root[data-theme="dark"] .cohort-series-group {
  border-color: #5d4c48;
  background: #211c1a;
}

:root[data-theme="dark"] .cohort-whole-toggle {
  background: #302723;
}

:root[data-theme="dark"] .cohort-anomaly-badge,
:root[data-theme="dark"] .cohort-anomaly-row:hover,
:root[data-theme="dark"] .cohort-anomaly-row:focus-visible {
  background: #302723;
}

:root[data-theme="dark"] .cohort-toolbar__title,
:root[data-theme="dark"] .cohort-anomaly-title {
  color: #f3fbfb;
}

:root[data-theme="dark"] .cohort-axis-guide,
:root[data-theme="dark"] .cohort-anomaly-note,
:root[data-theme="dark"] .cohort-gesture-hint,
:root[data-theme="dark"] .cohort-legend-loss {
  color: #aebec1;
}

:root[data-theme="dark"] .cohort-anomaly-row,
:root[data-theme="dark"] .cohort-legend-item {
  color: #dbe7e9;
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .service-toolbar,
:root[data-theme="dark"] .dashboard-toolbar {
  background: rgba(13, 24, 30, .91);
  border-color: var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  backdrop-filter: blur(18px) saturate(1.18);
}

:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .button,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .compact-select {
  border-color: var(--line);
  background: #152229;
  color: #dbe7e9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

:root[data-theme="dark"] .chip:hover,
:root[data-theme="dark"] .button:hover,
:root[data-theme="dark"] .icon-button:hover {
  border-color: rgba(105, 210, 199, .34);
  background: #1c3037;
  color: #f3fbfb;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .14);
}

:root[data-theme="dark"] .chip.is-active,
:root[data-theme="dark"] .section-tab.is-active {
  border-color: rgba(94, 214, 201, .42);
  background: #173b3b;
  color: #8be3da;
  box-shadow: inset 0 0 0 1px rgba(100, 222, 209, .05);
}

:root[data-theme="dark"] .streams-table,
:root[data-theme="dark"] .simple-table,
:root[data-theme="dark"] .streams-table .virtual-spacer-row td,
:root[data-theme="dark"] .sticky-left,
:root[data-theme="dark"] .section-tab.is-active,
:root[data-theme="dark"] .dashboard-widget {
  background: var(--panel-elevated);
  color: var(--text);
}

:root[data-theme="dark"] .table-frame,
:root[data-theme="dark"] .summary-panel,
:root[data-theme="dark"] .service-panel,
:root[data-theme="dark"] .settings-row,
:root[data-theme="dark"] .dashboard-widget {
  border-color: var(--line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .018);
}

:root[data-theme="dark"] .table-frame {
  background: #0f191f;
}

:root[data-theme="dark"] .streams-table th,
:root[data-theme="dark"] .streams-table td,
:root[data-theme="dark"] .simple-table th,
:root[data-theme="dark"] .simple-table td {
  border-right-color: rgba(173, 204, 215, .085);
  border-bottom-color: rgba(173, 204, 215, .115);
  font-variant-numeric: tabular-nums;
}

:root[data-theme="dark"] .streams-table thead th,
:root[data-theme="dark"] .simple-table thead th {
  background: #1a2931;
  color: #dbe8ea;
  border-bottom-color: rgba(162, 207, 214, .22);
  font-weight: 650;
  box-shadow: inset 0 -1px 0 rgba(112, 211, 201, .06);
}

:root[data-theme="dark"] .streams-table tbody tr:nth-child(even) > td:not([data-stream-column-color]),
:root[data-theme="dark"] .simple-table tbody tr:nth-child(even) > td {
  background: #17252c;
}

:root[data-theme="dark"] .streams-table tbody tr:hover > td:not([data-stream-column-color]),
:root[data-theme="dark"] .simple-table tbody tr:hover > td {
  background: #20343d;
}

:root[data-theme="dark"] .stream-status-pending {
  background: #16262d;
  color: #7f969e;
}

:root[data-theme="dark"] .total-row > td,
:root[data-theme="dark"] .total-row .sticky-left {
  background: #1a3038 !important;
  color: #f0f7f8;
  border-bottom-color: rgba(102, 207, 197, .34);
  box-shadow: inset 0 1px 0 rgba(125, 224, 212, .08);
}

:root[data-theme="dark"] [data-stream-column-color="blue"],
:root[data-theme="dark"] [data-conversion-color="blue"],
:root[data-theme="dark"] tr[data-stream-row-color="blue"] { --stream-highlight-color: #19384a; }
:root[data-theme="dark"] [data-stream-column-color="cyan"],
:root[data-theme="dark"] [data-conversion-color="cyan"],
:root[data-theme="dark"] tr[data-stream-row-color="cyan"] { --stream-highlight-color: #183d3d; }
:root[data-theme="dark"] [data-stream-column-color="green"],
:root[data-theme="dark"] [data-conversion-color="green"],
:root[data-theme="dark"] tr[data-stream-row-color="green"] { --stream-highlight-color: #203a2d; }
:root[data-theme="dark"] [data-stream-column-color="yellow"],
:root[data-theme="dark"] [data-conversion-color="yellow"],
:root[data-theme="dark"] tr[data-stream-row-color="yellow"] { --stream-highlight-color: #40371f; }
:root[data-theme="dark"] [data-stream-column-color="orange"],
:root[data-theme="dark"] [data-conversion-color="orange"],
:root[data-theme="dark"] tr[data-stream-row-color="orange"] { --stream-highlight-color: #442f22; }
:root[data-theme="dark"] [data-stream-column-color="red"],
:root[data-theme="dark"] [data-conversion-color="red"],
:root[data-theme="dark"] tr[data-stream-row-color="red"] { --stream-highlight-color: #43262b; }
:root[data-theme="dark"] [data-stream-column-color="violet"],
:root[data-theme="dark"] [data-conversion-color="violet"],
:root[data-theme="dark"] tr[data-stream-row-color="violet"] { --stream-highlight-color: #332b46; }
:root[data-theme="dark"] [data-stream-column-color="gray"],
:root[data-theme="dark"] [data-conversion-color="gray"],
:root[data-theme="dark"] tr[data-stream-row-color="gray"] { --stream-highlight-color: #29343a; }

:root[data-theme="dark"] .streams-table [data-stream-column-color],
:root[data-theme="dark"] .conversion-table [data-conversion-color],
:root[data-theme="dark"] .streams-table tr[data-stream-row-color] > td {
  color: #e7f0f1 !important;
}

:root[data-theme="dark"] .calendar-summary-row--week > td,
:root[data-theme="dark"] .calendar-summary-row--week > th {
  background: #3a3422 !important;
  color: #f0d889;
}

:root[data-theme="dark"] .calendar-summary-row--month > td,
:root[data-theme="dark"] .calendar-summary-row--month > th {
  background: #402c22 !important;
  color: #efbb91;
}

:root[data-theme="dark"] .analysis-entry,
:root[data-theme="dark"] .analysis-empty,
:root[data-theme="dark"] .comparison-card,
:root[data-theme="dark"] .client-passport-card,
:root[data-theme="dark"] .log-card,
:root[data-theme="dark"] .source-status-card,
:root[data-theme="dark"] .user-card,
:root[data-theme="dark"] .request-card,
:root[data-theme="dark"] .trash-row {
  background: var(--panel-elevated);
  border-color: var(--line);
  color: var(--text);
}

:root[data-theme="dark"] .info-banner,
:root[data-theme="dark"] .form-note,
:root[data-theme="dark"] .dashboard-widget__meta,
:root[data-theme="dark"] .dashboard-widget__meta dt,
:root[data-theme="dark"] .dashboard-save-state { color: var(--muted); }

:root[data-theme="dark"] .dashboard-widget__meta dd,
:root[data-theme="dark"] .dashboard-widget-preview strong { color: var(--text); }

:root[data-theme="dark"] .dashboard-kpi strong {
  color: #7ec7e7;
  text-shadow: 0 0 24px rgba(86, 177, 215, .12);
}

:root[data-theme="dark"] .dashboard-kpi strong.is-positive,
:root[data-theme="dark"] .dashboard-kpi__target.is-positive,
:root[data-theme="dark"] .dashboard-kpi__previous.is-positive { color: #72d6aa; }

:root[data-theme="dark"] .dashboard-kpi strong.is-negative,
:root[data-theme="dark"] .dashboard-kpi__target.is-negative,
:root[data-theme="dark"] .dashboard-kpi__previous.is-negative { color: #ef8f8b; }

:root[data-theme="dark"] .dashboard-kpi__sparkline polyline { stroke: #55b7e4; }

:root[data-theme="dark"] .dashboard-echart,
:root[data-theme="dark"] .avatar-crop-canvas { filter: none; }

:root[data-theme="dark"] .dashboard-grid {
  background-color: #0d171c;
  background-image: radial-gradient(circle at 1px 1px, rgba(104, 196, 188, .1) 1px, transparent 0);
}

:root[data-theme="dark"] .dashboard-widget__head {
  background: linear-gradient(90deg, #1b2b32, #18272e);
  border-color: var(--line);
}

:root[data-theme="dark"] .dashboard-modal-layer {
  background: rgba(3, 9, 12, .76);
  backdrop-filter: blur(8px) saturate(.82);
}

:root[data-theme="dark"] .dashboard-modal {
  border: 1px solid var(--line-strong);
  background: var(--panel-elevated);
  color: var(--text);
  box-shadow: var(--shadow-raised);
}

:root[data-theme="dark"] .dashboard-modal > header {
  border-bottom-color: var(--line);
  background: linear-gradient(90deg, #1c2d35, #17272e);
  color: var(--text);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .16);
}

:root[data-theme="dark"] .dashboard-modal > header button {
  color: var(--muted);
}

:root[data-theme="dark"] .dashboard-modal > header button:hover {
  color: var(--text);
}

:root[data-theme="dark"] .dashboard-editor-form label,
:root[data-theme="dark"] .dashboard-editor-metric,
:root[data-theme="dark"] .dashboard-editor-form label > small,
:root[data-theme="dark"] .dashboard-editor-metric > small,
:root[data-theme="dark"] .dashboard-template-grid span,
:root[data-theme="dark"] .dashboard-template-grid small {
  color: var(--muted);
}

:root[data-theme="dark"] .dashboard-editor-metric__head button,
:root[data-theme="dark"] .dashboard-filter-tools button {
  color: var(--accent-secondary);
}

:root[data-theme="dark"] .dashboard-widget-preview,
:root[data-theme="dark"] .dashboard-editor-wide,
:root[data-theme="dark"] .dashboard-editor-form > details,
:root[data-theme="dark"] .dashboard-filter-form > fieldset,
:root[data-theme="dark"] .dashboard-filter-grid fieldset,
:root[data-theme="dark"] .dashboard-template-unavailable {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--text);
}

:root[data-theme="dark"] .dashboard-filter-tools {
  background: var(--panel-soft);
}

:root[data-theme="dark"] .dashboard-manager-row,
:root[data-theme="dark"] .dashboard-quick-filter-row {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--text);
}

:root[data-theme="dark"] .dashboard-manager-row.is-active {
  border-color: rgba(94, 214, 201, .42);
  background: var(--accent-soft);
}

:root[data-theme="dark"] .dashboard-library > button,
:root[data-theme="dark"] .dashboard-template-grid > button {
  border-color: var(--line);
  background: linear-gradient(145deg, #1b2b33, #142229);
  color: var(--text);
}

:root[data-theme="dark"] .dashboard-library > button:hover,
:root[data-theme="dark"] .dashboard-library > button:focus-visible,
:root[data-theme="dark"] .dashboard-template-grid > button:hover,
:root[data-theme="dark"] .dashboard-template-grid > button:focus-visible {
  border-color: rgba(105, 210, 199, .38);
  background: linear-gradient(145deg, #21363e, #192b32);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .26);
}

:root[data-theme="dark"] .dashboard-library-pie.donut::after {
  background: var(--panel-soft);
}

:root[data-theme="dark"] .dashboard-data-table th,
:root[data-theme="dark"] .dashboard-data-table td {
  border-color: var(--line);
}

:root[data-theme="dark"] .dashboard-data-table th,
:root[data-theme="dark"] .dashboard-data-table th:first-child,
:root[data-theme="dark"] .dashboard-data-table td:first-child,
:root[data-theme="dark"] .dashboard-mini-table th:first-child,
:root[data-theme="dark"] .dashboard-mini-table td:first-child {
  background: var(--panel-soft);
  color: var(--text);
}

:root[data-theme="dark"] .menu,
:root[data-theme="dark"] .popover,
:root[data-theme="dark"] .context-menu,
:root[data-theme="dark"] .modal-card {
  background: #17262d;
  border-color: rgba(177, 210, 219, .18);
}

:root[data-theme="dark"] .modal-backdrop {
  background: rgba(3, 9, 12, .7);
  backdrop-filter: blur(7px) saturate(.8);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
  background: #111d23;
  border-color: rgba(173, 204, 215, .17);
  color: var(--text);
}

:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] textarea:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] button:focus-visible,
:root[data-theme="dark"] [tabindex]:focus-visible {
  outline: 2px solid rgba(112, 218, 207, .72);
  outline-offset: 2px;
}

:root[data-theme="dark"] .boot-overlay {
  background: var(--bg);
}

:root[data-theme="dark"] .environment-badge {
  border-color: #406f87;
  background: #1c3b4b;
  color: #b9e3f1;
}

/* 2026 warm workbench refresh: one page scroll, responsive cards and readable controls. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --sidebar: #251b19;
  --sidebar-strong: #140f0e;
  --sidebar-soft: #3a2a26;
  --text-on-dark: #fff7ee;
  --bg: #171312;
  --panel: #211a18;
  --panel-elevated: #2b211e;
  --panel-soft: #342824;
  --panel-hover: #40302a;
  --line: rgba(255, 226, 197, .13);
  --line-strong: rgba(255, 218, 178, .28);
  --text: #f7ece2;
  --muted: #c0a99b;
  --accent: #f2aa52;
  --accent-strong: #ffd07b;
  --accent-soft: #4a3522;
  --accent-secondary: #e77a77;
  --ok: #82c99a;
  --warn: #f1c66f;
  --danger: #ef8a83;
  --shadow: 0 12px 30px rgba(8, 5, 4, .24);
  --shadow-raised: 0 24px 64px rgba(8, 5, 4, .52);
}

:root[data-accent-palette="coral"] { --accent: #ff7964; --accent-strong: #bd4338; --accent-soft: #ffe1d8; }
:root[data-accent-palette="mint"] { --accent: #47a980; --accent-strong: #287457; --accent-soft: #ddf4e8; }
:root[data-accent-palette="sky"] { --accent: #4c9fd0; --accent-strong: #286f9c; --accent-soft: #dff0fb; }
:root[data-theme="dark"][data-accent-palette="coral"] { --accent: #ef8375; --accent-strong: #ffb2a3; --accent-soft: #4b2925; }
:root[data-theme="dark"][data-accent-palette="mint"] { --accent: #72c99f; --accent-strong: #a4e6c2; --accent-soft: #233b30; }
:root[data-theme="dark"][data-accent-palette="sky"] { --accent: #76bde4; --accent-strong: #a9dcf4; --accent-soft: #243745; }

:root[data-font-scale="90"] body { font-size: 14px; }
:root[data-font-scale="100"] body { font-size: 15.667px; }
:root[data-font-scale="110"] body { font-size: 17.2px; }
:root[data-font-scale="120"] body { font-size: 18.8px; }
:root {
  --font-table: 14.667px;
  --font-small: 12.667px;
  --font-dashboard-title: 15.667px;
}
:root[data-font-scale="90"] { --font-table: 13.2px; --font-small: 11.4px; --font-dashboard-title: 14px; }
:root[data-font-scale="110"] { --font-table: 16.1px; --font-small: 13.9px; --font-dashboard-title: 17.2px; }
:root[data-font-scale="120"] { --font-table: 17.6px; --font-small: 15.2px; --font-dashboard-title: 18.8px; }

html,
body { overflow: hidden; }

.workspace {
  display: block;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background:
    radial-gradient(circle at 80% -12%, color-mix(in srgb, var(--accent-soft) 54%, transparent), transparent 34rem),
    var(--bg);
}

.workspace > .topbar { min-height: 44px; }

.view,
.view.is-active,
#streamsView.is-active,
#conversionsView.is-active,
.dashboard-view.is-active {
  min-height: 0;
  overflow: visible;
}

.view.is-active,
#streamsView.is-active,
#conversionsView.is-active,
.dashboard-view.is-active { display: grid; }

#streamsView.is-active,
#conversionsView.is-active,
.dashboard-view.is-active {
  grid-template-rows: none;
  align-content: start;
}

.dashboard-toolbar,
.dashboard-quick-filters {
  flex-wrap: wrap;
  overflow: visible;
  scrollbar-width: none;
}

.dashboard-grid {
  width: 100%;
  min-height: 420px;
  overflow-x: clip;
  overflow-y: visible;
}

.dashboard-widget__body { overflow: hidden; }
.dashboard-widget__head { font-size: max(9px, calc(var(--font-dashboard-title) * var(--widget-scale))); }
.dashboard-kpi span { font-size: max(9px, calc(var(--font-table) * var(--widget-scale))); }
.dashboard-widget__meta { font-size: clamp(9px, calc(11.667px * var(--widget-scale)), 16px); }

.table-frame {
  display: block;
  min-height: 0;
  overflow: visible;
}

.table-scroll {
  width: 100%;
  min-height: 0;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  scrollbar-width: none;
}

.table-scroll::-webkit-scrollbar {
  height: 0;
}

.table-sticky-scroll {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 38;
  width: 0;
  height: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: var(--panel-elevated);
  box-shadow: 0 -5px 14px rgba(61, 38, 24, .14);
  scrollbar-width: auto;
}

.table-sticky-scroll > div {
  height: 1px;
}

.table-sticky-scroll.hidden {
  display: none;
}

.streams-table th,
.streams-table td,
.simple-table th,
.simple-table td { font-size: var(--font-table); }

.column-sort {
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  white-space: nowrap;
}

.column-sort i {
  color: var(--muted);
  font-size: .86em;
  font-style: normal;
}

.column-sort.is-active { color: var(--accent-strong); }
.column-sort.is-active i { color: var(--accent); }
.column-sort:disabled { cursor: not-allowed; opacity: .52; }

.shared-funnel-dashboard { gap: 10px; padding: 12px; }
.shared-funnel-dashboard__head strong { font-size: 14.667px; }
.shared-funnel-dashboard__head span,
.shared-funnel-dashboard__scope,
.shared-funnel-dashboard__pending { font-size: var(--font-small); }

.shared-funnel-dashboard__scroll {
  min-width: 0;
  overflow-x: visible;
}

.shared-funnel-dashboard__rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  align-items: stretch;
  gap: 9px;
  width: 100%;
  min-width: 0;
  padding: 0;
}

.shared-funnel-node {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  place-content: initial;
  align-items: center;
  min-width: 0;
  width: auto;
  height: auto;
  min-height: 132px;
  padding: 13px;
  border-radius: 16px;
  text-align: left;
  overflow: hidden;
}

.shared-funnel-node::after {
  content: "";
  position: absolute;
  right: -32px;
  bottom: -42px;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: rgba(255,255,255,.24);
  pointer-events: none;
}

.shared-funnel-node span,
.shared-funnel-node small { font-size: var(--font-small); }
.shared-funnel-node > span:first-child {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
}
.shared-funnel-node strong { margin: 6px 0; font-size: 19px; }
.shared-funnel-node--finance { background: linear-gradient(145deg, #fff0bd, #ffd991); }
.shared-funnel-node--traffic { background: linear-gradient(145deg, #dff0fb, #bde3f5); }
.shared-funnel-node--funnel { background: linear-gradient(145deg, #eee1f7, #dcc6ec); }
.shared-funnel-node--sales { background: linear-gradient(145deg, #ffe1c0, #ffc995); }
.shared-funnel-node--positive { background: linear-gradient(145deg, #ddf4e8, #bfe7d1); }
.shared-funnel-node--negative { background: linear-gradient(145deg, #ffe0dc, #ffc2ba); }

.shared-funnel-node__conversion {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 7px -5px -5px;
  padding: 7px 8px;
  border-top: 1px solid color-mix(in srgb, var(--text) 13%, transparent);
  border-radius: 8px;
  background: rgba(255,255,255,.32);
}

.shared-funnel-node__conversion span { color: color-mix(in srgb, var(--text) 72%, transparent); }
.shared-funnel-node__conversion b { font-size: 13px; font-variant-numeric: tabular-nums; }

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 84% -12%, rgba(242, 170, 82, .18), transparent 34rem),
    radial-gradient(circle at 16% 108%, rgba(198, 91, 81, .1), transparent 28rem),
    var(--bg);
}

:root[data-theme="dark"] .sidebar {
  background:
    radial-gradient(circle at 15% -8%, rgba(242, 170, 82, .17), transparent 30%),
    linear-gradient(180deg, var(--sidebar), var(--sidebar-strong));
  border-right-color: rgba(255, 218, 178, .11);
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .service-toolbar,
:root[data-theme="dark"] .dashboard-toolbar { background: rgba(28, 21, 19, .93); }

:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .button,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .compact-select,
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select { background: #2b211e; color: var(--text); }

:root[data-theme="dark"] .table-frame { background: #211a18; }
:root[data-theme="dark"] .streams-table thead th,
:root[data-theme="dark"] .simple-table thead th { background: #342824; }
:root[data-theme="dark"] .streams-table tbody tr:nth-child(even) > td:not([data-stream-column-color]),
:root[data-theme="dark"] .simple-table tbody tr:nth-child(even) > td { background: #2a211e; }
:root[data-theme="dark"] .streams-table tbody tr:hover > td:not([data-stream-column-color]),
:root[data-theme="dark"] .simple-table tbody tr:hover > td { background: #40302a; }
:root[data-theme="dark"] .total-row > td,
:root[data-theme="dark"] .total-row .sticky-left { background: #342821 !important; }

:root[data-theme="dark"] [data-stream-column-color="blue"],
:root[data-theme="dark"] [data-conversion-color="blue"],
:root[data-theme="dark"] tr[data-stream-row-color="blue"] { --stream-highlight-color: #283a4c; }
:root[data-theme="dark"] [data-stream-column-color="yellow"],
:root[data-theme="dark"] [data-conversion-color="yellow"],
:root[data-theme="dark"] tr[data-stream-row-color="yellow"] { --stream-highlight-color: #493b23; }

:root[data-theme="dark"] .dashboard-grid {
  background-color: #1b1614;
  background-image: radial-gradient(circle at 1px 1px, rgba(242, 170, 82, .12) 1px, transparent 0);
}

:root[data-theme="dark"] .dashboard-widget__head {
  background: linear-gradient(90deg, #382a25, #2b211e);
}

:root[data-theme="dark"] .shared-funnel-node { color: #fff7ee; }
:root[data-theme="dark"] .shared-funnel-node span,
:root[data-theme="dark"] .shared-funnel-node small { color: rgba(255,247,238,.74); }
:root[data-theme="dark"] .shared-funnel-node strong { color: #fffaf5; }
:root[data-theme="dark"] .shared-funnel-node--finance { background: linear-gradient(145deg, #6b4b24, #4d3420); }
:root[data-theme="dark"] .shared-funnel-node--traffic { background: linear-gradient(145deg, #28465b, #253744); }
:root[data-theme="dark"] .shared-funnel-node--funnel { background: linear-gradient(145deg, #513a60, #392c44); }
:root[data-theme="dark"] .shared-funnel-node--sales { background: linear-gradient(145deg, #70412e, #503126); }
:root[data-theme="dark"] .shared-funnel-node--positive { background: linear-gradient(145deg, #315440, #263c32); }
:root[data-theme="dark"] .shared-funnel-node--negative { background: linear-gradient(145deg, #653535, #472929); }

.settings-row--interface {
  display: grid;
  grid-template-columns: minmax(170px, .9fr) minmax(0, 1.6fr);
  align-items: start;
}
.interface-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.interface-settings label { display: grid; min-width: 0; gap: 5px; color: var(--muted); font-size: var(--font-small); }
.interface-settings .compact-select { width: 100%; min-width: 0; max-width: 100%; }

@media (max-width: 1180px) {
  .shared-funnel-dashboard__rail { grid-template-columns: repeat(5, minmax(120px, 1fr)); }
}

@media (max-width: 760px) {
  .dashboard-grid { display: block; overflow: visible; }
  .dashboard-widget { width: 100%; min-height: 250px; }
  .shared-funnel-dashboard__rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shared-funnel-node { min-height: 124px; }
  .settings-row--interface { grid-template-columns: 1fr; }
  .interface-settings { grid-template-columns: 1fr; }
  .streams-table th,
  .streams-table td,
  .simple-table th,
  .simple-table td { font-size: var(--font-table); }
}

@media (prefers-reduced-motion: reduce) {
  body, .workspace, .sidebar, .topbar, .table-frame, .modal-card, .dashboard-widget,
  .service-panel, .settings-row, .chip, .button, .icon-button { transition: none; }
}

/* Shared application-owned dialogs. Native browser dialogs are never used. */
.app-dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(43, 31, 27, .42);
  backdrop-filter: blur(8px) saturate(.86);
}

.app-dialog-layer.hidden { display: none; }

.app-dialog {
  position: relative;
  width: min(480px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-elevated, var(--panel));
  color: var(--text);
  box-shadow: var(--shadow-raised);
  animation: appDialogEnter 180ms ease-out;
}

.app-dialog__accent {
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary), #e88968);
}

.app-dialog__header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding: 18px 18px 12px;
}

.app-dialog__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong, var(--accent));
  font-size: 20px;
  font-weight: 800;
}

.app-dialog[data-tone="danger"] .app-dialog__accent { background: linear-gradient(90deg, #c95748, #ef8e70); }
.app-dialog[data-tone="danger"] .app-dialog__icon { background: rgba(201, 87, 72, .14); color: #b74337; }
.app-dialog[data-tone="danger"] #appDialogConfirm {
  border-color: #b94b3f;
  background: #c95748;
  color: #fff;
}
.app-dialog[data-tone="danger"] #appDialogConfirm:hover { background: #b94b3f; }
.app-dialog[data-tone="success"] .app-dialog__accent { background: linear-gradient(90deg, #3c8d72, #70b99d); }
.app-dialog[data-tone="success"] .app-dialog__icon { background: rgba(60, 141, 114, .14); color: #2d775e; }

.app-dialog h2 {
  margin: 1px 0 6px;
  color: var(--text);
  font-size: calc(19px * var(--font-scale));
  line-height: 1.15;
}

.app-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-body);
  line-height: 1.45;
  white-space: pre-line;
}

.app-dialog__form { padding: 0 18px 18px; }
.app-dialog__form .field { margin: 2px 0 14px; }
.app-dialog__actions { display: flex; justify-content: flex-end; gap: 9px; }

:root[data-theme="dark"] .app-dialog-layer { background: rgba(7, 5, 5, .72); }
:root[data-theme="dark"] .app-dialog {
  border-color: rgba(255, 226, 202, .14);
  background: var(--panel-elevated);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .48);
}
:root[data-theme="dark"] .app-dialog[data-tone="danger"] .app-dialog__icon { color: #ffad97; }
:root[data-theme="dark"] .app-dialog[data-tone="success"] .app-dialog__icon { color: #8dd5b8; }

/* Current-theme boot surface, intentionally shared with the application design system. */
.boot-overlay {
  background: var(--bg);
  backdrop-filter: none;
}

.boot-overlay::before {
  background:
    radial-gradient(circle at 18% 16%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 34%),
    radial-gradient(circle at 82% 82%, color-mix(in srgb, var(--accent-secondary) 16%, transparent), transparent 32%);
  opacity: 1;
}

.boot-screen {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-elevated, var(--panel));
  box-shadow: var(--shadow-raised);
  padding: 20px;
  color: var(--text);
}

.boot-screen::after { display: none; }
.boot-screen__topline { margin-bottom: 6px; }
.boot-brand__mark,
.boot-loader__mark {
  background: linear-gradient(145deg, var(--accent), var(--accent-secondary));
  border: 0;
  color: #fffaf5;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 26%, transparent);
}
.boot-brand__mark { border-radius: 11px; }
.boot-brand__caption,
.boot-clock { color: var(--muted); }

.boot-loader {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 10px auto 14px;
  display: grid;
  place-items: center;
}
.boot-loader__halo {
  position: absolute;
  inset: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 50%;
  animation: bootHalo 1.8s ease-in-out infinite;
}
.boot-loader__mark {
  position: relative;
  z-index: 2;
  width: 58px;
  height: 58px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  font-size: 23px;
  font-weight: 800;
}
.boot-loader__dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-secondary);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-secondary) 13%, transparent);
  animation: bootOrbit 2.4s linear infinite;
}
.boot-loader__dot--two { animation-delay: -.8s; }
.boot-loader__dot--three { animation-delay: -1.6s; }
.boot-status-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  box-shadow: none;
  padding: 16px;
}
.boot-status-head { align-items: flex-start; }
.boot-status-kicker {
  margin-bottom: 5px;
  color: var(--accent-strong, var(--accent));
  font-size: var(--font-small);
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.boot-status-title { color: var(--text); font-size: calc(21px * var(--font-scale)); }
.boot-status-note,
.boot-status-hint { color: var(--muted); }
.boot-progress {
  justify-content: flex-start;
  margin-top: 14px;
  gap: 7px;
}
.boot-progress__step {
  flex: 1 1 0;
  min-height: 7px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--line);
  color: transparent;
  font-size: 0;
}
.boot-progress__step.is-active { background: linear-gradient(90deg, var(--accent), var(--accent-secondary)); }
.boot-progress__step.is-done { background: var(--accent-secondary); }
.boot-overlay.is-error .boot-status-title { color: var(--danger, #b74337); }
.boot-overlay.is-error .boot-status-note { color: var(--muted); }

:root[data-theme="dark"] .boot-screen {
  border-color: rgba(255, 226, 202, .13);
  background: var(--panel-elevated);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
}

@keyframes appDialogEnter {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes bootHalo {
  0%, 100% { transform: scale(.94); opacity: .45; }
  50% { transform: scale(1.04); opacity: 1; }
}
@keyframes bootOrbit {
  from { transform: rotate(0deg) translateX(56px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(56px) rotate(-360deg); }
}

@media (max-width: 560px) {
  .app-dialog__header { grid-template-columns: 36px minmax(0, 1fr); padding: 15px 14px 10px; }
  .app-dialog__icon { width: 36px; height: 36px; border-radius: 10px; }
  .app-dialog__form { padding: 0 14px 14px; }
  .app-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .boot-screen { padding: 16px; }
  .boot-loader { width: 108px; height: 108px; }
  .boot-loader__dot { animation-name: bootOrbitMobile; }
}

@keyframes bootOrbitMobile {
  from { transform: rotate(0deg) translateX(46px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(46px) rotate(-360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .app-dialog,
  .boot-loader__halo,
  .boot-loader__dot { animation: none; }
}

/* Comparison scopes and per-user column visibility */
.inline-settings-button {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-elevated);
  color: var(--accent-strong);
  cursor: pointer;
}

.inline-settings-button:hover,
.inline-settings-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.inline-settings-button .ui-icon { width: 16px; height: 16px; }
.display-level-checks .inline-settings-button { margin-left: 2px; }
.column-visibility-list { max-height: min(420px, calc(100dvh - 180px)); overflow-y: auto; }

.comparison-scope-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.comparison-scope-picker legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: var(--font-small);
  font-weight: 700;
}

.comparison-scope-picker label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-elevated);
}

#compareView.is-active {
  display: block;
  height: auto;
  overflow: visible;
}

.comparison-table-frame {
  height: auto;
  overflow: visible;
}

.comparison-tables {
  display: grid;
  gap: 12px;
}

#compareView .compare-toolbar {
  display: flex;
  justify-content: flex-end;
  min-height: 34px;
  padding: 0 0 6px;
}

.comparison-table-section {
  min-width: 0;
  overflow: visible;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
}

.comparison-table-section__head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.comparison-table-section .comparison-table-scroll {
  height: auto;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-color: var(--line-strong) var(--panel-soft);
  scrollbar-width: auto;
}

.comparison-table-section .comparison-table-scroll::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.comparison-table-section .comparison-table-scroll::-webkit-scrollbar-track {
  background: var(--panel-soft);
}

.comparison-table-section .comparison-table-scroll::-webkit-scrollbar-thumb {
  border: 2px solid var(--panel-soft);
  border-radius: 999px;
  background: var(--line-strong);
}

.reconciliation-table-wrap {
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: var(--line-strong) var(--panel-soft);
  scrollbar-width: auto;
}

.reconciliation-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.reconciliation-table-wrap::-webkit-scrollbar-track {
  background: var(--panel-soft);
}

.reconciliation-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid var(--panel-soft);
  border-radius: 999px;
  background: var(--line-strong);
}

.comparison-segment-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.comparison-segment-heading .inline-settings-button {
  width: 25px;
  height: 25px;
  flex-basis: 25px;
}

.stream-fixed-last { border-right: 2px solid var(--line-strong) !important; }

@media (max-width: 640px) {
  .comparison-scope-picker { display: grid; grid-template-columns: 1fr; }
  .comparison-table-section__head { position: sticky; left: 0; }
}

/* Dark global filter surface */
/* Unified blue workbench navigation */
:root {
  --filterbar-blue: #245f8d;
  --filterbar-blue-strong: #173f63;
  --sidebar: var(--filterbar-blue);
  --sidebar-strong: var(--filterbar-blue-strong);
  --sidebar-soft: #3479ad;
}

:root[data-theme="dark"] {
  --filterbar-blue: #173b58;
  --filterbar-blue-strong: #0d263a;
  --sidebar: var(--filterbar-blue);
  --sidebar-strong: var(--filterbar-blue-strong);
  --sidebar-soft: #245372;
}

.topbar {
  background:
    radial-gradient(circle at 12% -80%, rgba(255, 255, 255, .14), transparent 34%),
    linear-gradient(105deg, var(--filterbar-blue), var(--filterbar-blue-strong));
  color: var(--text-on-dark);
  border-bottom-color: rgba(255, 255, 255, .13);
  box-shadow: 0 7px 20px rgba(50, 21, 47, .16);
  backdrop-filter: blur(16px) saturate(1.08);
}

.topbar .filter-row--period {
  border-top-color: rgba(255, 255, 255, .13);
}

.topbar .chip,
.topbar .compact-filter-select,
.topbar .inline-filter-field {
  border-color: rgba(215, 232, 246, .86);
  background: #f8fbfe;
  color: #16344f;
  box-shadow: 0 1px 2px rgba(8, 36, 60, .12);
}

.topbar .chip:hover,
.topbar .chip:focus-visible,
.topbar .inline-filter-field:focus-within {
  border-color: rgba(255, 255, 255, .38);
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.topbar .compact-filter-select:hover,
.topbar .compact-filter-select:focus-visible {
  border-color: rgba(255, 255, 255, .72);
  background: #f8fbfe;
  color: #16344f;
}

.topbar .chip.is-active,
.topbar .quick-period-chip.is-active {
  border-color: color-mix(in srgb, var(--accent) 72%, white);
  background: color-mix(in srgb, var(--accent) 32%, transparent);
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent);
}

.topbar .inline-filter-field > span,
.topbar .active-filter-summary {
  color: color-mix(in srgb, var(--text-on-dark) 76%, transparent);
}

.topbar .inline-filter-field select,
.topbar .inline-filter-field input {
  border-left-color: rgba(26, 76, 116, .18);
  color: #16344f;
  color-scheme: light;
}

.topbar select option {
  background: #fff;
  color: #16344f;
}

:root[data-theme="dark"] .topbar {
  background:
    radial-gradient(circle at 14% -90%, rgba(103, 184, 235, .14), transparent 32%),
    linear-gradient(105deg, var(--filterbar-blue), var(--filterbar-blue-strong));
  border-bottom-color: rgba(255, 218, 178, .12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

:root[data-theme="dark"] .topbar .chip,
:root[data-theme="dark"] .topbar .compact-filter-select,
:root[data-theme="dark"] .topbar .inline-filter-field {
  border-color: rgba(181, 213, 235, .22);
  background: rgba(9, 31, 47, .66);
  color: var(--text-on-dark);
}

:root[data-theme="dark"] .topbar .inline-filter-field select,
:root[data-theme="dark"] .topbar .inline-filter-field input,
:root[data-theme="dark"] .topbar .compact-filter-select {
  color: var(--text-on-dark);
  color-scheme: dark;
}

:root[data-theme="dark"] .topbar .compact-filter-select:hover,
:root[data-theme="dark"] .topbar .compact-filter-select:focus-visible {
  border-color: rgba(181, 213, 235, .46);
  background: #1b4558;
  color: var(--text-on-dark);
}

:root[data-theme="dark"] .topbar select option {
  background: #102a3e;
  color: var(--text-on-dark);
}
