:root {
  --sidebar: #2f5f90;
  --sidebar-strong: #234b72;
  --sidebar-soft: #3d6f9f;
  --text-on-dark: #f6fbff;
  --bg: #eaf2f9;
  --panel: #ffffff;
  --panel-soft: #f4f8fc;
  --line: #cddaea;
  --line-strong: #9fb5cf;
  --text: #16324a;
  --muted: #67809a;
  --accent: #2f5f90;
  --accent-soft: #dceaf7;
  --ok: #2d7a55;
  --warn: #9a6a22;
  --danger: #a33e3e;
  --shadow: 0 12px 28px rgba(23, 60, 94, 0.08);
  --sidebar-expanded-width: 164px;
  --sidebar-collapsed-width: 54px;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  font: 13px/1.35 "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

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: 26px;
  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;
}

.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:
    radial-gradient(circle at top left, rgba(115, 174, 232, 0.25), transparent 32%),
    radial-gradient(circle at bottom right, rgba(90, 142, 196, 0.22), transparent 30%),
    linear-gradient(180deg, rgba(12, 31, 50, 0.78), rgba(18, 46, 74, 0.82));
  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; }

.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;
}

.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,
#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);
}

.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;
}

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

.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 { width: 38px; min-width: 38px; max-width: 38px; text-align: center !important; }
.flow-col { width: 68px; min-width: 68px; max-width: 68px; }
.date-col { width: 64px; min-width: 64px; max-width: 64px; }
.weekday-col { width: 62px; min-width: 62px; max-width: 62px; }
.time-col { width: 58px; min-width: 58px; max-width: 58px; 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; }

.column-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 8;
}

.column-resizer:hover,
.column-resizer.is-resizing { background: rgba(47, 95, 144, 0.22); }

.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 { min-width: 190px; 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;
}

.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;
  min-width: 240px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  z-index: 0;
  isolation: isolate;
}

.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;
}

.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-filter-group {
  min-width: 0;
  margin: 0;
}

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

.comparison-compact-filters {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.comparison-filter-menu {
  position: relative;
}

.comparison-filter-menu > summary {
  min-width: 94px;
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.comparison-filter-menu > summary::-webkit-details-marker { display: none; }

.comparison-filter-menu[open] > summary {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.comparison-filter-menu[open] > :not(summary) {
  position: relative;
}

.comparison-filter-group[open],
.comparison-period-menu[open] {
  z-index: 5;
  width: min(360px, 100%);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
}

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

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

.comparison-filter-group-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.comparison-filter-group--utm[open] {
  width: min(760px, calc(100vw - 48px));
}

.comparison-utm-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 7px;
}

.comparison-utm-group {
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.comparison-utm-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 11px;
}

.comparison-utm-group-head span {
  display: flex;
  gap: 6px;
}

.comparison-filter-options {
  display: grid;
  gap: 2px;
  max-height: 128px;
  overflow: auto;
}

.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));
  }
}

/* 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: fixed; }
.conversion-table .conversion-stream-cell { width: 210px; }
.conversion-table .conversion-head,
.conversion-table th:not(.conversion-stream-cell),
.conversion-table td:not(.conversion-stream-cell) { width: 82px; min-width: 82px; max-width: 82px; }

.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 { width: 260px; min-width: 260px; border-right: 1px solid var(--line); }
.comparison-column-groups__segment { display: flex; align-items: center; padding: 2px 5px; }
.comparison-column-group {
  min-width: 84px;
  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: 84px;
  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: fixed; }
.comparison-table thead { position: sticky; top: 0; z-index: 5; }
.comparison-segment-cell { width: 260px; min-width: 260px; left: 0; z-index: 4; }
.comparison-table th:not(.comparison-segment-cell),
.comparison-table td:not(.comparison-segment-cell) { width: 84px; min-width: 84px; max-width: 84px; }
.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: 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-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);
}

.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: fixed;
}

#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: 100%;
  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; }

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

.resizable-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: 6px 11px;
  border: 1px solid #9dc3ea;
  border-radius: 999px;
  background: #d9ecff;
  color: #174b78;
  box-shadow: 0 4px 16px rgb(30 76 116 / 18%);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}
