/* ==================== N1: ULTRA-QUIET ATTIO SIDEBAR ==================== */
.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--rail);
  border-right: 1px solid var(--hairline);
  padding: 10px 8px;
  user-select: none;
  z-index: 30;
}

.sidebar-top-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.switcher-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.switcher-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: var(--r-sm);
  text-align: left;
  transition: background 110ms ease;
}

.switcher-trigger:hover,
.switcher-trigger[aria-expanded="true"] {
  background: var(--hover);
}

.brand-avatar {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.brand-avatar.sm {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  font-size: 8.5px;
}

.brand-avatar.all-mark {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
  font-weight: 600;
}

.brand-avatar img {
  width: 14px;
  height: 11px;
  object-fit: contain;
  filter: brightness(0);
}

.switcher-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.018em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.switcher-chevron {
  margin-left: auto;
  color: var(--ink-3);
  transition: transform 140ms ease;
}

.switcher-trigger[aria-expanded="true"] .switcher-chevron {
  transform: rotate(180deg);
}

.switcher-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: -24px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-popover);
  padding: 4px;
  z-index: 60;
  display: grid;
  gap: 2px;
}

.switcher-divider {
  height: 1px;
  background: var(--hairline);
  margin: 4px 2px;
}

.switcher-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  text-align: left;
  font-size: 12.5px;
  color: var(--ink);
}

.switcher-option:hover { background: var(--hover); }
.switcher-option[aria-selected="true"] { background: var(--active); font-weight: 500; }

.conn-dot {
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-left: auto;
}

.conn-dot.live { background: var(--blue); }
.conn-dot.wait { border: 1.2px solid var(--ink-4); background: transparent; }

.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  flex: 0 0 auto;
}

.icon-btn:hover { background: var(--hover); color: var(--ink); }

.cmd-trigger {
  width: 100%;
  height: 30px;
  margin: 0 0 14px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink-3);
  font-size: 12px;
  text-align: left;
}

.cmd-trigger:hover { border-color: var(--hairline-2); color: var(--ink-2); }

.kbd-group {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.kbd-group kbd {
  font-family: inherit;
  font-size: 10px;
  line-height: 1;
  color: var(--ink-3);
  padding: 2.5px 4px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--rail);
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-section { display: grid; gap: 1px; }

.nav-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
}

.back-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px;
  margin-bottom: 4px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-3);
}

.back-all-btn:hover { background: var(--hover); color: var(--ink); }

.nav-item {
  width: 100%;
  height: 29px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
}

.nav-item .icon { color: var(--ink-3); }
.nav-item:hover { background: var(--hover); color: var(--ink); }

/* Attio flat active state: ZERO shadow, ZERO border */
.nav-item[aria-current="page"] {
  background: var(--active);
  color: var(--ink);
  font-weight: 500;
}

.nav-item[aria-current="page"] .icon { color: var(--ink); }

.nav-chevron {
  width: 12px;
  height: 12px;
  color: var(--ink-4);
  flex: 0 0 auto;
  transition: transform 120ms ease, color 120ms ease;
}

.nav-item:hover .nav-chevron {
  color: var(--ink-2);
  transform: translateX(2px);
}

.brand-nav-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.brand-nav-meta .conn-dot {
  margin-left: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
}

/* ==================== WORKSPACE & SINGLE CLEAN TOPBAR ==================== */
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
}

.topbar {
  height: var(--topbar-h);
  flex: 0 0 auto;
  padding: 0 28px;
  border-bottom: 1px solid var(--hairline);
  background: var(--paper);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 15;
}

.open-sidebar-btn { display: none; }
body.sidebar-collapsed { --rail-w: 0px; }
body.sidebar-collapsed .sidebar { display: none; }
body.sidebar-collapsed .open-sidebar-btn { display: grid; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumb-btn { color: var(--ink-3); }
.crumb-btn:hover { color: var(--ink); }
.crumb-sep { color: var(--ink-4); }
.crumb-current { color: var(--ink); font-weight: 500; }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

/* Quiet borderless Attio mode switcher */
.topbar-mode-label {
  font-size: 11px;
  color: var(--ink-3);
  margin-right: 4px;
}

.mode-strip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.mode-strip button {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
  white-space: nowrap;
}

.mode-strip button:hover { color: var(--ink); }
.mode-strip button[aria-pressed="true"] {
  background: var(--hover);
  color: var(--ink);
}

/* ==================== C2 ATTIO AIRY CANVAS ==================== */
.main-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  background: var(--paper);
}

.main-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 36px 68px;
}

.view-fade {
  animation: fadeIn 120ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.view-stack {
  display: grid;
  row-gap: 20px;
}

.view-stack > *,
.stats-grid > *,
.report-grid > *,
.split-even > *,
.area-grid > * {
  min-width: 0;
}

/* Clean Page Head: Title + Subtle Meta Left, Borderless Period & Filters Right */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
}

.page-title-block {
  display: grid;
  gap: 4px;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.page-title {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--ink);
}

.page-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-3);
}

.meta-dot {
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
  background: var(--blue);
  display: inline-block;
}

.meta-dot.wait {
  background: transparent;
  border: 1.2px solid var(--ink-4);
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Attio Borderless Period / Filter Strips */
.quiet-strip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.quiet-strip button {
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
}

.quiet-strip button:hover { color: var(--ink); }
.quiet-strip button[aria-pressed="true"] {
  background: var(--hover);
  color: var(--ink);
}

.period-custom-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
}

.period-custom-btn:hover { color: var(--ink); background: var(--hover); }
.period-custom-btn[aria-pressed="true"],
.period-custom-btn[aria-expanded="true"] {
  background: var(--hover);
  color: var(--ink);
}

.period-custom-btn[aria-pressed="true"] .icon { color: var(--blue); }

.date-popover {
  width: 296px;
  padding: 12px;
  gap: 10px;
}

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

.date-preset-btn {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  font-size: 11.5px;
  color: var(--ink-2);
  text-align: left;
  transition: border-color 110ms ease, background 110ms ease, color 110ms ease;
}

.date-preset-btn:hover {
  border-color: var(--hairline-2);
  background: var(--rail);
  color: var(--ink);
}

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

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

.date-field label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
}

.date-field input[type="date"] {
  width: 100%;
  height: 30px;
  padding: 0 7px;
  border: 1px solid var(--hairline-2);
  border-radius: 6px;
  background: var(--paper);
  font-size: 11.5px;
  color: var(--ink);
}

.date-field input[type="date"]:focus {
  border-color: var(--blue);
  outline: none;
}

.date-popover-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
}

.btn-ghost-sm {
  height: 27px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.btn-ghost-sm:hover { background: var(--hover); color: var(--ink); }

.btn-primary-sm {
  height: 27px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--blue);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 500;
}

.btn-primary-sm:hover { background: var(--blue-strong); }

/* Sales Waterfall Breakdown Bars */
.waterfall-list {
  display: grid;
  gap: 13px;
  margin: auto 0;
}

.wf-row {
  display: grid;
  gap: 5px;
}

.wf-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.wf-name {
  color: var(--ink-2);
  font-weight: 500;
}

.wf-row.final .wf-name,
.wf-row.gross .wf-name {
  color: var(--ink);
}

.wf-val {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 500;
  color: var(--ink);
}

.wf-val.neg { color: var(--rose); }
.wf-val small { font-size: 11px; font-weight: 400; color: var(--ink-3); }

.wf-track {
  height: 7px;
  border-radius: 99px;
  background: var(--subtle);
  overflow: hidden;
}

.wf-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(59, 118, 246, 0.45), #3B76F6);
}

.wf-fill.deduct {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.30), rgba(225, 29, 72, 0.62));
}

.wf-fill.fee {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.30), rgba(217, 119, 6, 0.64));
}

.wf-fill.profit {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.42), #10B981);
}

.donut-sub-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
}

.donut-sub-box {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--rail);
}

.donut-sub-box span { font-size: 11px; color: var(--ink-3); }
.donut-sub-box strong { font-size: 13px; font-weight: 500; color: var(--ink); }

/* ==================== SALES: ORDER SIZE HEATMAP & ORDER MIX ==================== */
.sales-mix-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.hm-wrap {
  position: relative;
  display: grid;
  gap: 12px;
}

.hm-scale {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-3);
}

.hm-swatches {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
}

.hm-swatches i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: block;
}

.hm-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.hm-matrix {
  display: grid;
  gap: 5px;
  min-width: 470px;
}

.hm-row {
  display: grid;
  grid-template-columns: 112px repeat(5, minmax(0, 1fr));
  gap: 5px;
  align-items: center;
}

.hm-head-cell {
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  padding-bottom: 4px;
}

.hm-head-cell.first {
  text-align: left;
  padding-left: 2px;
}

.hm-row-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 6px;
}

.hm-row.total-row {
  padding-top: 6px;
  margin-top: 2px;
  border-top: 1px solid var(--hairline);
}

.hm-row.total-row .hm-row-label {
  color: var(--ink);
}

.hm-cell {
  height: 46px;
  border-radius: 8px;
  border: 1px solid rgba(29, 31, 36, 0.035);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: transform 110ms ease, box-shadow 110ms ease;
  cursor: default;
}

.hm-cell:hover,
.hm-cell:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1.5px var(--blue);
  outline: none;
}

.hm-pct {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.15;
}

.hm-cnt {
  font-size: 10.5px;
  opacity: 0.78;
  line-height: 1.1;
}

.hm-cell.zero .hm-pct { opacity: 0.45; font-weight: 400; }
.hm-cell.zero .hm-cnt { opacity: 0.4; }

.hm-row.total-row .hm-cell {
  height: 40px;
  background: var(--rail) !important;
  color: var(--ink) !important;
  border-color: var(--hairline);
}

/* Order Mix Card (Single vs Multi) */
.mix-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.mix-summary-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.mix-headline {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.mix-headline strong {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.mix-headline span {
  font-size: 12px;
  color: var(--ink-3);
}

.mix-bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  gap: 2px;
  background: var(--subtle);
}

.mix-seg {
  height: 100%;
  border-radius: 3px;
}

.mix-seg.s1 { background: #3B76F6; }
.mix-seg.s2 { background: #7C6DF8; }
.mix-seg.s3 { background: #55B3F9; }

.mix-rows {
  display: grid;
  gap: 10px;
}

.mix-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--hairline);
  background: var(--paper);
}

.mix-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mix-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.mix-dot.s1 { background: #3B76F6; }
.mix-dot.s2 { background: #7C6DF8; }
.mix-dot.s3 { background: #55B3F9; }

.mix-row-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.mix-row-sub {
  font-size: 11px;
  color: var(--ink-3);
}

.mix-metric {
  text-align: right;
  display: grid;
  gap: 1px;
}

.mix-metric strong {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.mix-metric span {
  font-size: 10.5px;
  color: var(--ink-3);
}

.combo-box {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  display: grid;
  gap: 7px;
}

.combo-head {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
}

.combo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.combo-name {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: 11.5px;
}

.combo-meta strong {
  color: var(--ink);
  font-weight: 500;
}

/* ==================== ADS: FUNNEL BRIDGE, ANGLE HEATMAP & QUADRANT ==================== */
.mix-seg.s4, .mix-dot.s4 { background: #CBD5E1; }

.angle-hm-row {
  display: grid;
  grid-template-columns: 146px repeat(5, minmax(0, 1fr));
  gap: 5px;
  align-items: center;
}

.angle-hm-label {
  display: grid;
  gap: 1px;
  padding-right: 6px;
  min-width: 0;
}

.angle-hm-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.angle-hm-sub {
  font-size: 10.5px;
  color: var(--ink-3);
}

.angle-hm-cell {
  height: 40px;
  border-radius: 7px;
  border: 1px solid rgba(29, 31, 36, 0.035);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 500;
  transition: transform 110ms ease, box-shadow 110ms ease;
  cursor: default;
}

.angle-hm-cell:hover,
.angle-hm-cell:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1.5px var(--blue);
  outline: none;
}

.spend-rev-list {
  display: grid;
  gap: 14px;
  margin: auto 0;
}

.sr-item {
  display: grid;
  gap: 6px;
}

.sr-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.sr-head strong { font-weight: 500; color: var(--ink); }
.sr-head span { font-size: 11px; color: var(--ink-3); }

.sr-bars {
  display: grid;
  gap: 4px;
}

.sr-bar-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-3);
}

.sr-bar-row .val {
  text-align: right;
  font-weight: 500;
  color: var(--ink-2);
}

.sr-track {
  height: 6px;
  border-radius: 99px;
  background: var(--subtle);
  overflow: hidden;
}

.sr-fill-spend {
  height: 100%;
  border-radius: 99px;
  background: #CBD5E1;
}

.sr-fill-rev {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(59, 118, 246, 0.45), #3B76F6);
}

/* ==================== META ADS MANAGER STYLE TABLE ==================== */
.mgr-level-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}

.mgr-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mgr-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
}

.mgr-tab:hover { color: var(--ink); }
.mgr-tab[aria-selected="true"] { color: var(--ink); }
.mgr-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--blue);
}

.mgr-tab-cnt {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--subtle);
}

.mgr-tab[aria-selected="true"] .mgr-tab-cnt {
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.mgr-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink-3);
  width: 178px;
}

.mgr-search:focus-within {
  border-color: var(--blue);
}

.mgr-search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 12px;
  color: var(--ink);
}

.mgr-search input::placeholder { color: var(--ink-4); }

.mgr-switch {
  width: 28px;
  height: 16px;
  border-radius: 99px;
  background: var(--hairline-2);
  position: relative;
  display: inline-block;
  vertical-align: middle;
  transition: background 140ms ease;
}

.mgr-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
  transition: transform 140ms ease;
}

.mgr-switch[aria-checked="true"] { background: var(--blue); }
.mgr-switch[aria-checked="true"]::after { transform: translateX(12px); }

.ad-creative-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.ad-thumb {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.ad-thumb.video {
  background: linear-gradient(135deg, rgba(59, 118, 246, 0.16), rgba(124, 109, 248, 0.10));
  color: var(--blue-strong);
  border-color: rgba(59, 118, 246, 0.22);
}

.ad-thumb.static {
  background: linear-gradient(135deg, rgba(124, 109, 248, 0.14), rgba(167, 139, 250, 0.08));
  color: #6D28D9;
  border-color: rgba(124, 109, 248, 0.20);
}

.ad-thumb.search {
  background: linear-gradient(135deg, rgba(85, 179, 249, 0.16), rgba(59, 118, 246, 0.06));
  color: #0284C7;
  border-color: rgba(85, 179, 249, 0.24);
}

.ad-thumb.carousel {
  background: var(--subtle);
  color: var(--ink-2);
}

.ad-name-stack {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.ad-name-main {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-name-sub {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mgr-row-off td { opacity: 0.56; }
.mgr-row-off td:first-child { opacity: 1; }

.mgr-result-cell {
  display: grid;
  justify-items: end;
  gap: 1px;
}

.mgr-result-sub {
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 400;
}

.mgr-preview-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-3);
}

.attio-table tbody tr.clickable-row:hover .mgr-preview-hint {
  color: var(--blue);
}

/* ==================== AD DETAIL & PLACEMENT PREVIEW MODAL ==================== */
dialog.modal.ad-detail-modal {
  width: min(880px, calc(100vw - 32px));
  max-width: 880px;
  max-height: 88dvh;
}

.ad-modal-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.ad-modal-body {
  padding: 20px 24px 24px;
  max-height: calc(88dvh - 54px);
}

.ad-modal-grid {
  display: grid;
  grid-template-columns: minmax(290px, 0.92fr) minmax(0, 1.18fr);
  gap: 24px;
  align-items: start;
}

.ad-preview-col,
.ad-detail-col {
  min-width: 0;
}

.ad-preview-col {
  display: grid;
  gap: 12px;
}

.ad-preview-stage {
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--rail);
  padding: 18px 16px;
  display: grid;
  place-items: center;
  min-height: 368px;
}

/* Reels 9:16 Mockup */
.mock-reels {
  width: 224px;
  aspect-ratio: 9 / 15.5;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  color: #FFFFFF;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}

.mock-reels.cobalt { background: linear-gradient(155deg, #1E3A8A 0%, #3B76F6 54%, #93C5FD 100%); }
.mock-reels.indigo,
.mock-reels.violet { background: linear-gradient(155deg, #312E81 0%, #6D5DF6 55%, #C4B5FD 100%); }
.mock-reels.sky { background: linear-gradient(155deg, #0C4A6E 0%, #0EA5E9 55%, #BAE6FD 100%); }
.mock-reels.amber { background: linear-gradient(155deg, #78350F 0%, #D97706 58%, #FDE68A 100%); }
.mock-reels.slate { background: linear-gradient(155deg, #1E293B 0%, #475569 58%, #CBD5E1 100%); }

.mock-reels-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  opacity: 0.92;
}

.mock-reels-badge {
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(6px);
  font-size: 10px;
  font-weight: 500;
}

.mock-reels-center {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 8px 4px;
}

.mock-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  display: grid;
  place-items: center;
}

.mock-visual-tag {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  font-weight: 600;
  opacity: 0.85;
}

.mock-visual-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.mock-reels-foot {
  display: grid;
  gap: 7px;
}

.mock-acct-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
}

.mock-acct-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #1D1F24;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 600;
}

.mock-reels-copy {
  font-size: 10.5px;
  line-height: 1.35;
  opacity: 0.9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mock-reels-cta {
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  color: #1D1F24;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

/* Feed 4:5 Mockup (Instagram / Facebook Feed) */
.mock-feed {
  width: 266px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: #FFFFFF;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.mock-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  font-size: 11px;
}

.mock-feed-brand {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mock-feed-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 600;
}

.mock-feed-media {
  aspect-ratio: 4 / 3.6;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 6px;
  color: #FFFFFF;
}

.mock-feed-media.cobalt { background: linear-gradient(135deg, #2563EB 0%, #60A5FA 100%); }
.mock-feed-media.indigo,
.mock-feed-media.violet { background: linear-gradient(135deg, #5B4DF0 0%, #A78BFA 100%); }
.mock-feed-media.sky { background: linear-gradient(135deg, #0284C7 0%, #7DD3FC 100%); }
.mock-feed-media.amber { background: linear-gradient(135deg, #B45309 0%, #FBBF24 100%); }
.mock-feed-media.slate { background: linear-gradient(135deg, #334155 0%, #94A3B8 100%); }

.mock-feed-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  background: var(--rail);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
}

.mock-feed-caption {
  padding: 9px 11px 11px;
  font-size: 11px;
  line-height: 1.42;
  color: var(--ink-2);
}

/* Search & Amazon Sponsored Mockups */
.mock-search-card {
  width: 100%;
  max-width: 288px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: #FFFFFF;
  padding: 14px;
  display: grid;
  gap: 6px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.mock-search-spon {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink);
}

.mock-search-url {
  font-size: 11px;
  color: var(--ink-3);
}

.mock-search-h {
  font-size: 14px;
  font-weight: 500;
  color: var(--blue-strong);
  line-height: 1.3;
}

.mock-search-desc {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.45;
}

.ad-detail-col {
  display: grid;
  gap: 16px;
}

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

.ad-kpi-mini {
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  display: grid;
  gap: 3px;
}

.ad-kpi-mini span { font-size: 11px; color: var(--ink-3); }
.ad-kpi-mini strong { font-size: 15px; font-weight: 500; color: var(--ink); letter-spacing: -0.02em; }

.ad-detail-section {
  display: grid;
  gap: 8px;
}

.ad-detail-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
}

.ad-kv-list {
  display: grid;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
}

.ad-kv-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #F3F4F7;
  font-size: 12px;
}

.ad-kv-row:last-child { border-bottom: 0; }
.ad-kv-k { color: var(--ink-3); }
.ad-kv-v { color: var(--ink); word-break: break-all; }

.placement-perf-list {
  display: grid;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
}

.placement-perf-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid #F3F4F7;
  font-size: 12px;
  text-align: left;
  background: var(--paper);
}

.placement-perf-row:last-child { border-bottom: 0; }
.placement-perf-row:hover { background: #FAFBFD; }
.placement-perf-row[aria-selected="true"] { background: #F5F8FF; }
.placement-perf-row strong { font-weight: 500; color: var(--ink); }

@media (max-width: 720px) {
  .ad-modal-grid { grid-template-columns: minmax(0, 1fr); }
  .ad-preview-stage { min-height: 280px; }
}

/* ==================== ONSITE: HERO GRID, SCROLL DEPTH & CLICK CONTRIBUTION ==================== */
.onsite-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.scroll-depth-list {
  position: relative;
  display: grid;
  gap: 13px;
}

.sd-row {
  display: grid;
  gap: 6px;
}

.sd-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.sd-name {
  font-weight: 500;
  color: var(--ink);
}

.sd-nums {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.sd-nums strong { font-weight: 500; color: var(--ink); }
.sd-gap { font-size: 11px; font-weight: 500; color: var(--blue-strong); }

.sd-tracks {
  display: grid;
  gap: 4px;
}

.sd-track {
  height: 7px;
  border-radius: 99px;
  background: var(--subtle);
  overflow: hidden;
}

.sd-fill-a {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(59, 118, 246, 0.48), #3B76F6);
}

.sd-fill-b {
  height: 100%;
  border-radius: 99px;
  background: #CBD5E1;
}

.click-list {
  display: grid;
  gap: 9px;
  margin: auto 0;
}

.click-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--hairline);
  background: var(--paper);
}

.click-left {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.click-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.click-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.click-sub {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}

.click-mini-track {
  height: 4px;
  border-radius: 99px;
  background: var(--subtle);
  overflow: hidden;
}

.click-mini-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(59, 118, 246, 0.42), #3B76F6);
}

.click-cvr {
  text-align: right;
  display: grid;
  gap: 1px;
}

.click-cvr strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.click-cvr span {
  font-size: 10.5px;
  color: var(--ink-3);
}

/* ==================== A/B TEST DETAIL MODAL ==================== */
.ab-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ab-variant-card {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  display: grid;
  gap: 12px;
}

.ab-variant-card.winner {
  border-color: rgba(59, 118, 246, 0.38);
  background: linear-gradient(180deg, rgba(59, 118, 246, 0.03) 0%, #FFFFFF 100%);
}

.ab-var-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ab-var-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--subtle);
  color: var(--ink-2);
}

.ab-variant-card.winner .ab-var-badge {
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.ab-var-desc {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.ab-var-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
}

.ab-var-m {
  display: grid;
  gap: 2px;
}

.ab-var-m span { font-size: 10.5px; color: var(--ink-3); }
.ab-var-m strong { font-size: 14px; font-weight: 500; color: var(--ink); }

.ab-conf-row {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: var(--rail);
}

@media (max-width: 720px) {
  .ab-compare-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ==================== CRM: COHORT HEATMAP, LIFECYCLE 4-STAGE & EMAIL/SMS PREVIEW ==================== */
.cohort-row {
  display: grid;
  grid-template-columns: 98px repeat(5, minmax(0, 1fr)) 68px;
  gap: 5px;
  align-items: center;
}

.cohort-cell {
  height: 36px;
  border-radius: 7px;
  border: 1px solid rgba(29, 31, 36, 0.035);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 500;
  transition: transform 110ms ease, box-shadow 110ms ease;
  cursor: default;
}

.cohort-cell:not(.empty):hover,
.cohort-cell:not(.empty):focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1.5px var(--blue);
  outline: none;
}

.cohort-cell.empty {
  background: transparent;
  border: 1px dashed var(--hairline);
  color: var(--ink-4);
  font-weight: 400;
}

.cohort-ltv {
  text-align: right;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  padding-right: 2px;
}

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

.lc-card {
  padding: 15px 17px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  display: grid;
  gap: 9px;
  text-align: left;
}

.lc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.lc-stage {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

.lc-key {
  font-size: 10.5px;
  color: var(--ink-3);
}

.lc-val-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.lc-val {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.lc-val.empty { color: var(--ink-4); font-weight: 400; }

.lc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-3);
}

/* Email & SMS Mobile Preview inside Modal */
.mock-email {
  width: 274px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: #FFFFFF;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.09);
}

.mock-email-top {
  padding: 11px 13px;
  border-bottom: 1px solid var(--hairline);
  background: var(--rail);
  display: grid;
  gap: 3px;
}

.mock-email-from {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-3);
}

.mock-email-from strong { color: var(--ink); font-weight: 500; }

.mock-email-subj {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.mock-email-pre {
  font-size: 10.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-email-hero {
  padding: 18px 14px;
  background: linear-gradient(135deg, #2563EB 0%, #60A5FA 100%);
  color: #FFFFFF;
  text-align: center;
  display: grid;
  gap: 4px;
}

.mock-email-body {
  padding: 13px 14px 15px;
  display: grid;
  gap: 12px;
  font-size: 11.5px;
  line-height: 1.48;
  color: var(--ink-2);
}

.mock-email-btn {
  height: 32px;
  border-radius: 7px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 500;
  display: grid;
  place-items: center;
}

.mock-sms {
  width: 256px;
  border-radius: 18px;
  border: 1px solid var(--hairline);
  background: #FFFFFF;
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.09);
}

.mock-sms-head {
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
  display: grid;
  gap: 2px;
}

.mock-sms-head strong { font-size: 12px; font-weight: 600; color: var(--ink); }
.mock-sms-head span { font-size: 10px; color: var(--ink-3); }

.mock-sms-bubble {
  padding: 11px 13px;
  border-radius: 14px 14px 14px 4px;
  background: #F1F5FD;
  color: var(--ink);
  font-size: 11.5px;
  line-height: 1.48;
}

.mock-sms-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--blue-strong);
  text-decoration: underline;
}

@media (max-width: 960px) {
  .lifecycle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==================== OWNED CONTENT: PUBLISHING RHYTHM & ORGANIC PREVIEW ==================== */
.rhythm-wrap {
  display: grid;
  gap: 14px;
}

.rhythm-goal-bar {
  display: grid;
  gap: 7px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.rhythm-goal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.rhythm-goal-head strong { font-weight: 500; color: var(--ink); }
.rhythm-goal-head span { font-size: 11px; color: var(--ink-3); }

.rhythm-matrix {
  display: grid;
  gap: 6px;
  min-width: 440px;
}

.rhythm-row {
  display: grid;
  grid-template-columns: 82px repeat(7, minmax(0, 1fr));
  gap: 5px;
  align-items: center;
}

.rhythm-ch {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  display: grid;
  gap: 1px;
}

.rhythm-ch span {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-3);
}

.rhythm-cell {
  height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(59, 118, 246, 0.16);
  background: rgba(59, 118, 246, 0.08);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1px;
  padding: 2px 3px;
  transition: transform 110ms ease, box-shadow 110ms ease;
}

.rhythm-cell.clickable:hover,
.rhythm-cell.clickable:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1.5px var(--blue);
  outline: none;
  cursor: pointer;
}

.rhythm-cell.high {
  background: rgba(59, 118, 246, 0.24);
  border-color: rgba(59, 118, 246, 0.34);
}

.rhythm-cell.peak {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
}

.rhythm-cell.empty {
  background: transparent;
  border: 1px dashed var(--hairline);
  color: var(--ink-4);
  font-size: 11px;
}

.rhythm-fmt {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.1;
}

.rhythm-reach {
  font-size: 10.5px;
  font-weight: 500;
  opacity: 0.88;
}

.mock-organic-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--hairline);
  background: var(--rail);
  text-align: center;
}

.mock-organic-bar div { display: grid; gap: 1px; }
.mock-organic-bar span { font-size: 9.5px; color: var(--ink-3); }
.mock-organic-bar strong { font-size: 11px; font-weight: 600; color: var(--ink); }

/* ==================== EXTERNAL MENTIONS: INSIGHTS & VISUAL POST ARCHIVE ==================== */
.insight-list {
  display: grid;
  gap: 8px;
}

.insight-row {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  display: grid;
  gap: 6px;
  transition: border-color 120ms ease, background 120ms ease;
}

.insight-row:hover {
  border-color: var(--hairline-2);
  background: var(--rail);
}

.insight-row[aria-pressed="true"] {
  border-color: var(--blue);
  background: rgba(59, 118, 246, 0.045);
}

.insight-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.insight-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.insight-kw {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-cnt {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.insight-cnt strong {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.insight-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-2);
}

.insight-action-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--subtle);
  color: var(--ink-2);
  white-space: nowrap;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 20px 20px;
}

.archive-card {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--paper);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.archive-card:hover,
.archive-card:focus-visible {
  border-color: var(--blue);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  outline: none;
}

.archive-banner {
  position: relative;
  height: 112px;
  padding: 10px 12px;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.archive-banner.cobalt { background: linear-gradient(145deg, #1E3A8A 0%, #3B76F6 58%, #60A5FA 100%); }
.archive-banner.violet { background: linear-gradient(145deg, #312E81 0%, #6366F1 55%, #A78BFA 100%); }
.archive-banner.sky { background: linear-gradient(145deg, #0C4A6E 0%, #0284C7 55%, #38BDF8 100%); }
.archive-banner.slate { background: linear-gradient(145deg, #1F2937 0%, #374151 60%, #6B7280 100%); }
.archive-banner.story { background: linear-gradient(145deg, #1D4ED8 0%, #4F46E5 55%, #818CF8 100%); }

.story-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 5px;
}

.story-bars i {
  display: block;
  height: 2px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.36);
}

.story-bars i.done { background: rgba(255, 255, 255, 0.92); }

.mock-story-sticker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  color: #1D4ED8;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
}

.archive-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.archive-chip {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
}

.archive-banner-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.archive-hook-title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.archive-views-pill {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.34);
  color: #FFFFFF;
  white-space: nowrap;
}

.archive-body {
  padding: 12px 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.archive-author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.archive-handle {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-meta {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}

.archive-quote {
  font-size: 11.5px;
  line-height: 1.48;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.archive-insight-box {
  padding: 8px 10px;
  border-radius: 8px;
  background: #F4F7FF;
  border: 1px solid rgba(59, 118, 246, 0.14);
  display: grid;
  gap: 2px;
  margin-top: auto;
}

.archive-insight-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--blue-strong);
  letter-spacing: 0.01em;
}

.archive-insight-text {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}

.archive-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--ink-3);
}

.archive-nums {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.comment-list {
  display: grid;
  gap: 7px;
}

.comment-item {
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  display: grid;
  gap: 4px;
}

.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-3);
}

.comment-head strong { color: var(--ink); font-weight: 500; }
.comment-text { font-size: 12px; color: var(--ink-2); line-height: 1.42; }

@media (max-width: 1120px) {
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .archive-grid { grid-template-columns: minmax(0, 1fr); padding: 14px; }
}

.strip-sep {
  width: 1px;
  height: 14px;
  background: var(--hairline);
}

/* ==================== C2 AIRY STAT CARDS ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 14px;
}

.stat-card {
  text-align: left;
  padding: 17px 20px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  display: grid;
  align-content: start;
  gap: 8px;
  transition: border-color 120ms ease, background 120ms ease;
}

.stat-card.interactive { cursor: pointer; }
.stat-card.interactive:hover { border-color: var(--hairline-2); background: #FCFDFE; }

.stat-card.interactive[aria-selected="true"] {
  border-color: rgba(59, 118, 246, 0.36);
  box-shadow: 0 0 0 3px rgba(59, 118, 246, 0.055);
}

.stat-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  flex: 0 0 auto;
}

.stat-val-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-num {
  font-size: clamp(21px, 1.9vw, 25px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
}

.stat-num.empty {
  color: var(--ink-4);
  font-weight: 400;
}

.stat-delta {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--mint-ink);
  white-space: nowrap;
}

.stat-delta.warn { color: var(--amber); }
.stat-delta.risk { color: var(--rose); }
.stat-delta.muted { color: var(--ink-3); }

.stat-foot {
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ==================== C2 REPORT GRID & CARDS ==================== */
.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.split-even {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.report-card {
  padding: 22px 24px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.report-card.flush {
  padding: 0;
  overflow: visible;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.report-card.flush .card-top {
  padding: 16px 20px 13px;
  margin-bottom: 0;
}

.card-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
}

/* Attio borderless soft object tag */
.obj-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--subtle);
  white-space: nowrap;
}

.obj-tag .icon { width: 11.5px; height: 11.5px; color: var(--ink-3); }

.card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Borderless 3-Icon Chart Mode Switcher (Glass | Solid vs Dashed | Hatched Line) */
.mode-icons {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.mode-icons button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
}

.mode-icons button:hover { background: var(--hover); color: var(--ink); }
.mode-icons button[aria-pressed="true"] { background: var(--hover); color: var(--ink); }

.text-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.text-link:hover { color: var(--blue); }

/* ==================== CHARTS & ATTIO WHITE POPOVER TOOLTIP ==================== */
.legend-inline {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--ink-3);
}

.legend-inline span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-inline strong {
  font-weight: 500;
  color: var(--ink);
}

.lg-dot-solid { width: 8px; height: 8px; border-radius: 2.5px; background: var(--blue); }
.lg-dot-dashed { width: 8px; height: 8px; border-radius: 2.5px; background: rgba(59, 118, 246, 0.12); border: 1px dashed #82ABFA; }
.lg-line { width: 12px; border-top: 1.8px solid var(--ink); }
.lg-line-dash { width: 12px; border-top: 1.2px dashed #9CA3AF; }

.chart-wrap { position: relative; width: 100%; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg text { font-family: var(--font-sans); font-variant-numeric: tabular-nums; }

.attio-tip {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  background: #FFFFFF;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 184px;
  box-shadow: var(--shadow-popover);
  font-size: 11.5px;
}

.tip-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--ink);
}

.tip-delta {
  font-size: 10.5px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--mint-bg);
  color: var(--mint-ink);
}

.tip-delta.neg { background: var(--rose-bg); color: var(--rose); }

.tip-rows { display: grid; gap: 7px; }

.tip-entry {
  padding-left: 9px;
  border-left: 2px solid var(--blue);
  display: grid;
  gap: 2px;
}

.tip-entry.cmp { border-left: 2px dashed #93B8FD; }
.tip-entry.dark { border-left: 2px solid var(--ink); }

.tip-sub { font-size: 10.5px; color: var(--ink-3); }

.tip-val-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-2);
}

.tip-chip {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--subtle);
  color: var(--ink);
  font-weight: 500;
}

/* ==================== C2 ATTIO LUMINOUS 14PX DONUT ==================== */
.donut-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex: 1;
}

.donut-stage {
  position: relative;
  width: 156px;
  height: 156px;
  display: grid;
  place-items: center;
}

.donut-center {
  position: absolute;
  text-align: center;
  display: grid;
  gap: 2px;
}

.donut-total {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.donut-caption {
  font-size: 11px;
  color: var(--ink-3);
}

.donut-list {
  width: 100%;
  display: grid;
  gap: 10px;
}

.donut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.donut-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
  min-width: 0;
}

.donut-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.donut-right {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.donut-right strong { font-weight: 500; color: var(--ink); }
.donut-right span { font-size: 11.5px; color: var(--ink-3); min-width: 38px; text-align: right; }

/* ==================== BR3 ATTIO LUMINOUS VERTICAL FUNNEL PILLARS ==================== */
.funnel-pillars {
  display: grid;
  gap: 10px;
  align-items: end;
  min-height: 204px;
  padding-top: 6px;
}

.funnel-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  height: 100%;
}

.funnel-stage-track {
  position: relative;
  height: 162px;
  display: flex;
  align-items: flex-end;
}

.funnel-pillar {
  width: 100%;
  min-height: 54px;
  border-radius: 7px 7px 5px 5px;
  background: linear-gradient(180deg, rgba(59, 118, 246, 0.22) 0%, rgba(59, 118, 246, 0.03) 100%);
  border-top: 2.2px solid var(--blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 6px 6px;
  gap: 3px;
}

.funnel-badge {
  padding: 1.5px 6px;
  border-radius: 5px;
  background: var(--paper);
  border: 1px solid rgba(59, 118, 246, 0.16);
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}

.funnel-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
}

.funnel-foot {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== C2 SOFT ROUNDED HORIZONTAL BARS ==================== */
.color-bar-list { display: grid; gap: 15px; margin: auto 0; }
.color-bar-item { display: grid; gap: 6px; }
.color-bar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; }
.color-bar-name { font-weight: 500; color: var(--ink); }
.color-bar-val { font-weight: 500; color: var(--ink); white-space: nowrap; }
.color-bar-val small { font-weight: 400; color: var(--ink-3); margin-left: 5px; font-size: 11px; }
.color-bar-track { position: relative; height: 6px; background: var(--subtle); border-radius: 99px; }
.color-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, rgba(59, 118, 246, 0.45), #3B76F6); }
.color-bar-fill.s2 { background: linear-gradient(90deg, rgba(124, 109, 248, 0.45), #7C6DF8); }
.color-bar-fill.s3 { background: linear-gradient(90deg, rgba(85, 179, 249, 0.45), #55B3F9); }
.color-bar-marker { position: absolute; top: -4px; bottom: -4px; border-left: 1.25px dashed var(--ink); }

/* ==================== 7-AREA MODULAR BENTO GRID ==================== */
.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.area-card {
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--paper);
  display: grid;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.area-card:hover {
  border-color: rgba(59, 118, 246, 0.36);
  background: #FCFDFE;
}

.area-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.area-card-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.area-card-title .icon { color: var(--ink-3); }
.area-card:hover .area-card-title .icon { color: var(--blue); }
.area-arrow { color: var(--ink-4); transition: transform 130ms ease, color 130ms ease; }
.area-card:hover .area-arrow { transform: translateX(2px); color: var(--blue); }

.area-card-val {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}

.area-card-val.empty { color: var(--ink-4); font-weight: 400; }

.area-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ==================== TB1 (CAUSAL) & TB2 (ATTIO) AIRY WHITE-HEADER TABLES ==================== */
.table-scroll { width: 100%; overflow-x: auto; }

table.attio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}

.attio-table th {
  padding: 10px 20px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-3);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--paper);
}

.attio-table th.sortable { cursor: pointer; }
.attio-table th.sortable:hover { color: var(--ink); }

.attio-table td {
  padding: 13px 20px;
  border-bottom: 1px solid #F3F4F7;
  color: var(--ink);
  vertical-align: middle;
}

.attio-table tbody tr:last-child td { border-bottom: 0; }
.attio-table tbody tr:hover td { background: #FAFBFD; }
.attio-table tbody tr.clickable-row { cursor: pointer; }
.attio-table tbody tr.clickable-row:hover td { background: #F5F8FF; }
.attio-table tbody tr.clickable-row:hover .brand-cell,
.attio-table tbody tr.clickable-row:hover .area-row-name { color: var(--blue); }
.attio-table tbody tr.clickable-row:hover .row-chevron-cell .nav-chevron { color: var(--blue); transform: translateX(2px); }

.row-chevron-cell {
  width: 34px;
  text-align: right;
  padding-left: 4px !important;
  padding-right: 16px !important;
}

.area-row-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--ink);
}

.area-row-name .icon {
  color: var(--ink-3);
}

.attio-table tbody tr.clickable-row:hover .area-row-name .icon {
  color: var(--blue);
}

/* ==================== BRAND SUMMARY COMPARISON: OPTION B (2-GROUP) & OPTION C (SIGNAL QUEUE) ==================== */
.option-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.option-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.option-divider-line {
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.group-list {
  display: grid;
  border-top: 1px solid var(--hairline);
}

.group-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid #F3F4F7;
  text-align: left;
  transition: background 110ms ease;
}

.group-row:last-child { border-bottom: 0; }
.group-row:hover { background: #F5F8FF; }

.group-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.group-row-left .icon { color: var(--ink-3); }
.group-row:hover .group-row-left .icon { color: var(--blue); }

.group-row-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.group-row-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.group-row:hover .group-row-title { color: var(--blue); }

.group-row-sub {
  font-size: 11.5px;
  color: var(--ink-3);
}

.group-row-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.group-row-metric {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.group-row-metric.empty { color: var(--ink-4); font-weight: 400; }

.group-row:hover .nav-chevron {
  color: var(--blue);
  transform: translateX(2px);
}

.group-foot-strip {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 20px;
  border-top: 1px solid var(--hairline);
  background: var(--rail);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  font-size: 11.5px;
  color: var(--ink-2);
}

.group-foot-strip strong {
  color: var(--ink);
  font-weight: 500;
}

.signal-queue {
  display: grid;
  border-top: 1px solid var(--hairline);
}

.signal-queue-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid #F3F4F7;
  text-align: left;
  transition: background 110ms ease;
}

.signal-queue-item:last-child { border-bottom: 0; }
.signal-queue-item:hover { background: #F5F8FF; }

.signal-q-left {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.signal-q-left .sig-dot { margin-top: 5px; }

.signal-q-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.signal-q-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.signal-q-area {
  font-size: 11px;
  color: var(--ink-3);
}

.signal-q-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.signal-queue-item:hover .signal-q-title { color: var(--blue); }

.signal-q-meta {
  font-size: 11.5px;
  color: var(--ink-3);
}

.signal-q-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.signal-q-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.signal-queue-item:hover .nav-chevron {
  color: var(--blue);
  transform: translateX(2px);
}

.attio-table tfoot td {
  padding: 12px 20px;
  border-top: 1px solid var(--hairline);
  background: var(--paper);
  font-weight: 500;
}

.attio-table .num { text-align: right; }
.attio-table .wrap-col { white-space: normal; min-width: 164px; }

.spark-cell { width: 96px; padding-top: 7px !important; padding-bottom: 7px !important; }
.spark-svg { display: block; width: 82px; height: 22px; overflow: visible; }

.brand-cell {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  color: var(--ink);
}

.brand-cell:hover { color: var(--blue); }

/* Quiet Dot Signals (Zero Traffic-Light Sticker Clutter) */
.quiet-signal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}

.quiet-signal:hover { color: var(--blue); }

.sig-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  flex: 0 0 auto;
}

.sig-dot.positive { background: var(--mint); }
.sig-dot.caution { background: var(--amber); }
.sig-dot.risk { background: var(--rose); }
.sig-dot.neutral { background: var(--ink-4); }
.sig-dot.wait { background: transparent; border: 1.2px solid var(--ink-4); }

/* TB2 Attio Ledger Controls & View Settings Popover */
.ledger-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px 12px;
}

.ledger-left, .ledger-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 9px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.tool-btn:hover { border-color: var(--hairline-2); color: var(--ink); background: var(--rail); }
.tool-btn[aria-expanded="true"] { border-color: rgba(59, 118, 246, 0.45); color: var(--blue-strong); background: var(--blue-soft); }

.tool-count {
  display: inline-grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 600;
}

.popover-anchor { position: relative; }

.attio-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-popover);
  padding: 6px;
  z-index: 45;
  display: grid;
  gap: 2px;
}

.popover-label {
  padding: 4px 8px 2px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
}

.popover-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink);
  text-align: left;
}

.popover-row:hover { background: var(--hover); }

.toggle-pill {
  width: 27px;
  height: 15px;
  border-radius: 99px;
  background: var(--hairline-2);
  position: relative;
  flex: 0 0 auto;
  transition: background 140ms ease;
}

.toggle-pill::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform 140ms ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14);
}

.popover-row[aria-checked="true"] .toggle-pill { background: var(--blue); }
.popover-row[aria-checked="true"] .toggle-pill::after { transform: translateX(12px); }

/* ==================== CLEAN PRE-CONNECTION EMPTY STATE ==================== */
.empty-panel {
  flex: 1;
  min-height: 204px;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #FAFBFD 0%, #FFFFFF 100%);
  border: 1px dashed var(--hairline-2);
}

.empty-inner {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.empty-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.connector-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.connector-tile {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 11.5px;
}

.empty-table-row td {
  padding: 34px 20px !important;
  text-align: center !important;
  color: var(--ink-3) !important;
  background: var(--paper) !important;
  font-size: 12px;
}

/* ==================== MODALS ==================== */
dialog.modal {
  width: min(456px, calc(100vw - 28px));
  max-height: 78dvh;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-popover);
  overflow: hidden;
}

dialog.modal::backdrop { background: var(--scrim); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--hairline);
}

.modal-head h2 { font-size: 13.5px; }
.modal-body { padding: 12px 16px 16px; overflow-y: auto; max-height: calc(78dvh - 48px); }

.cmd-input-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--hairline);
}

.cmd-input-row input { width: 100%; border: 0; outline: none; font-size: 13px; background: transparent; }
.cmd-list { padding: 6px; display: grid; gap: 1px; max-height: 340px; overflow-y: auto; }
.cmd-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; text-align: left; font-size: 12.5px; }
.cmd-item:hover, .cmd-item:focus-visible { background: var(--hover); }
.cmd-scope { font-size: 11px; color: var(--ink-3); }

.guide-row { padding: 10px 0; border-bottom: 1px solid var(--hairline); display: grid; gap: 4px; }
.guide-row:last-child { border-bottom: 0; }
.guide-formula { width: fit-content; font-size: 11.5px; padding: 2px 7px; border-radius: 5px; background: var(--subtle); color: var(--ink-2); }

.nav-backdrop { display: none; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1080px) {
  .report-grid, .split-even, .sales-mix-grid, .onsite-hero-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  body, body.sidebar-collapsed { display: block; }
  .workspace { height: 100%; }
  .sidebar, body.sidebar-collapsed .sidebar {
    display: none;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(252px, 84vw);
    z-index: 50;
    box-shadow: 12px 0 36px rgba(15, 23, 42, 0.14);
  }
  body.mobile-menu-open .sidebar { display: flex; }
  body.mobile-menu-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: var(--scrim); }
  .open-sidebar-btn { display: grid; }
  .switcher-popover { right: 0; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 14px; }
  .main-inner { padding: 18px 14px 48px; }
  .crumb-root, .crumb-sep { display: none; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .report-card { padding: 16px 16px 14px; }
  .report-card.flush .card-top, .ledger-bar { padding: 12px 14px; }
  .attio-table th, .attio-table td { padding: 10px 14px; }
  .funnel-pillars { gap: 6px; }
  .mode-strip button { padding: 3px 6px; font-size: 11px; }
  .topbar-mode-label { display: none; }
  .attio-popover { right: auto; left: 0; }
}

@media (prefers-reduced-motion: reduce) { .view-fade { animation: none; } }
