body { display: flex; }
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-8);
}
@media (min-width: 1600px) {
  .container { padding: var(--space-6) var(--space-12); }
}
header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-6);
}
h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 4px 0;
}
.subtitle { color: var(--ink-3); font-size: var(--text-md); margin: 0; }
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 28px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field label {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-2);
}
#analyse-model { min-width: 0; width: fit-content; max-width: 155px; }
input[type="date"] {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: var(--text-md);
  min-width: 130px;
}
.custom-date-wrap.hidden { display: none; }
.tab-nav, .tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0;
  margin-bottom: var(--space-5);
}
.tab-nav .tab-item, .tabs button, .tab-nav button {
  padding: 10px 14px;
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 220ms ease, border-color 220ms ease;
  white-space: nowrap;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  font-family: var(--font-body);
}
.tab-nav .tab-item:hover, .tabs button:hover { color: var(--text-primary); }
.tab-nav .tab-item.active, .tabs button.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.tab-nav .tab-secondary {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: var(--space-4);
  border-left: 1px solid var(--border-subtle);
}
.tab-nav .tab-secondary .tab, .tab-nav .tab-secondary button {
  font-size: var(--text-md);
  font-weight: 500;
}
.panel { display: none; }
.panel.active { display: block; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border-subtle); }
.panel-header-left { flex: 1; min-width: 0; }
.panel-page-title { font-size: var(--text-3xl); font-weight: 700; color: var(--ink); margin: 0 0 5px; letter-spacing: -0.5px; }
.panel-account-row { display: inline-flex; align-items: center; gap: 5px; }
.panel-account-icon { width: 13px; height: 13px; color: var(--ink-4); flex-shrink: 0; }
.panel-account-title { font-size: var(--text-base); color: var(--ink-3); font-weight: 500; margin: 0; }
.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 260px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-surface);
}
.data-table, .table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
}
.data-table thead th, .table-wrap thead th {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-label);
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-surface);
}
.data-table thead th:first-child, .table-wrap thead th:first-child { text-align: left; }
.data-table thead th:hover, .table-wrap thead th:hover { color: var(--text-secondary); }
.data-table thead th .sort-icon, .table-wrap thead th .sort-icon {
  margin-left: 4px;
  opacity: 0;
  transition: opacity 220ms ease;
}
.data-table thead th:hover .sort-icon, .table-wrap thead th:hover .sort-icon,
.data-table thead th.sorted .sort-icon, .table-wrap thead th.sorted .sort-icon { opacity: 1; }
.data-table thead th.sortable, .table-wrap thead th.sortable { padding-right: 24px; }
.data-table thead th.sortable::after, .table-wrap thead th.sortable::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-top-color: currentColor;
  opacity: 0;
  transition: opacity 220ms ease;
}
.data-table thead th.sortable:hover::after, .table-wrap thead th.sortable:hover::after,
.data-table thead th.sort-asc::after, .table-wrap thead th.sort-asc::after,
.data-table thead th.sort-desc::after, .table-wrap thead th.sort-desc::after { opacity: 1; }
.data-table thead th.sort-asc::after, .table-wrap thead th.sort-asc::after {
  border-top-color: transparent;
  border-bottom-color: currentColor;
  margin-top: -2px;
}
.data-table tbody tr, .table-wrap tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 220ms ease;
}
.data-table tbody tr:hover, .table-wrap tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child, .table-wrap tbody tr:last-child { border-bottom: none; }
.data-table tbody td, .table-wrap tbody td {
  padding: 12px 16px;
  font-size: var(--text-base);
  color: var(--text-primary);
  text-align: right;
  font-weight: var(--weight-regular);
}
.data-table tbody td:first-child, .table-wrap tbody td:first-child { text-align: left; font-weight: var(--weight-medium); }

/* Sticky first column — anchors entity name on horizontal scroll */
.data-table thead th:first-child, .table-wrap thead th:first-child,
.data-table tbody td:first-child, .table-wrap tbody td:first-child {
  position: sticky;
  left: 0;
  background: var(--bg-surface);
}
.data-table thead th:first-child, .table-wrap thead th:first-child { z-index: 3; }
.data-table tbody td:first-child, .table-wrap tbody td:first-child { z-index: 1; }
.data-table tbody tr:hover td:first-child, .table-wrap tbody tr:hover td:first-child { background: var(--bg-hover); }
.data-table thead th:first-child::after, .table-wrap thead th:first-child::after,
.data-table tbody td:first-child::after, .table-wrap tbody td:first-child::after {
  content: '';
  position: absolute;
  top: 0;
  right: -6px;
  bottom: 0;
  width: 6px;
  pointer-events: none;
  box-shadow: inset 6px 0 6px -6px rgba(0,0,0,0.08);
}

.num, .data-table tbody td.numeric, .table-wrap tbody td.numeric {
  text-align: right;
  font-size: var(--text-sm);
}
.insight-heading { font-size: var(--text-xl); font-weight: 700; margin: 0 0 8px 0; color: var(--ink); }
.insight-desc { font-size: var(--text-md); color: var(--ink-2); margin: 0 0 14px 0; line-height: 1.45; }
.insight-note { font-size: var(--text-base); color: var(--ink-3); margin: 0 0 12px 0; line-height: 1.4; }
td.cost-high, .metric-poor { color: var(--negative) !important; }
.metric-good { color: var(--positive) !important; }
.cell-with-icon { display: flex; align-items: center; gap: var(--space-2); }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  font-family: var(--font-body);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-active .status-dot { background: var(--status-active); }
.status-paused .status-dot { background: var(--status-paused); }
.status-removed .status-dot { background: var(--status-removed); }
.status-icon { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.status-icon--active { width: 10px; height: 14px; border-radius: 5px; background: var(--status-active); }
.status-icon--paused { width: 14px; height: 14px; border-radius: 50%; background: var(--status-paused); padding: 0; }
.status-icon--paused svg { width: 6px; height: 8px; fill: white; }
.status-icon--cancelled { width: 14px; height: 14px; border-radius: 50%; background: var(--status-removed); position: relative; }
.status-icon--cancelled svg { width: 8px; height: 8px; }
.cell-with-status { display: inline-flex; align-items: center; gap: var(--space-3); }
.campaign-name-link { display: inline-flex; align-items: center; gap: inherit; background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.campaign-name-link:hover { text-decoration: underline; color: var(--ink); }
.adgroup-name-link { display: inline-flex; align-items: center; gap: inherit; background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.adgroup-name-link:hover { text-decoration: underline; color: var(--ink); }
.filter-bar, .table-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  flex-wrap: wrap;
}
.filter-bar .filter-group, .table-toolbar .filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-bar .filter-label, .table-toolbar .filter-label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.filter-bar .filter-divider, .table-toolbar .filter-divider {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
  margin: 0 4px;
}
.filter-bar .filter-actions, .table-toolbar .filter-actions { margin-left: auto; }
.table-toolbar label:not(.filter-label) { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--text-secondary); }
.table-toolbar input[type="checkbox"] { cursor: pointer; }

/* Toggle switch — replaces checkbox */
.toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.toggle-wrap .toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.toggle-track {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--border-default);
  transition: background 220ms ease;
  flex-shrink: 0;
}
.toggle-wrap .toggle-input:checked + .toggle-track {
  background: var(--accent);
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 220ms ease;
}
.toggle-wrap .toggle-input:checked + .toggle-track .toggle-thumb {
  transform: translateX(14px);
}
.toggle-wrap .toggle-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--weight-regular);
}
/* Period comparison delta badges */
.delta {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 5px;
  vertical-align: middle;
  white-space: nowrap;
  letter-spacing: 0;
}
.delta-up { background: rgba(34, 197, 94, 0.13); color: #16a34a; }
.delta-down { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.delta-neutral { background: rgba(107, 114, 128, 0.1); color: var(--text-tertiary); }
.compare-period-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 5px;
  padding-left: 2px;
}
.compare-period-label.hidden { display: none; }
.col-chooser { position: relative; }
.col-chooser-btn {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-default);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 220ms ease, border-color 220ms ease;
}
.col-chooser-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}
.col-chooser-drop {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 180px;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.col-chooser-drop label { display: flex; align-items: center; gap: 8px; padding: 4px 6px; cursor: pointer; font-size: var(--text-md); color: var(--ink-2); border-radius: 7px; }
.col-chooser-drop label:hover { background: var(--off); color: var(--ink); }
.col-chooser-drop input { cursor: pointer; }
.ga4-mapping-wrap { position: relative; margin-right: 6px; }
.ga4-link-btn { font-size: var(--text-sm); padding: 5px 10px; white-space: nowrap; }
.ga4-link-btn.linked { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.ga4-mapping-drop {
  position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; min-width: 260px; z-index: 11; box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.ga4-mapping-title { font-size: var(--text-sm); font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.ga4-mapping-drop select { width: 100%; font-size: var(--text-sm); padding: 5px 8px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 6px; }
.ga4-save-btn { width: 100%; font-size: var(--text-sm); padding: 5px 10px; }
.status {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: var(--text-md);
  border: 1px solid var(--border);
}
.status.loading { background: var(--bg-subtle); color: var(--text-secondary); }
.status.error { background: var(--accent-subtle); color: var(--negative); border-color: var(--border-default); }
.status.empty { background: var(--off); color: var(--ink-3); }
.btn-primary, .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  cursor: pointer;
  border: none;
  background: var(--accent);
  color: #fff;
  transition: background 220ms ease, opacity 220ms ease;
  user-select: none;
}
.btn-primary:hover, .btn:hover { background: var(--accent-hover); }
.btn-primary:disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.analysis-panel {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}
.analysis-panel h2 {
  margin: 0;
  padding: 18px 22px;
  font-size: var(--text-xl);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}
.analysis-timestamp {
  font-weight: 400;
  font-size: var(--text-md);
  color: var(--ink-3);
  margin-left: 8px;
}
.analysis-content {
  padding: 22px;
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--ink-2);
}
.analysis-content h3 { margin: 20px 0 10px 0; font-size: var(--text-lg); font-weight: 600; color: var(--ink); }
.analysis-content h3:first-child { margin-top: 0; }
.analysis-content p { margin: 8px 0; }
.analysis-content ul { margin: 8px 0; padding-left: 20px; }
.analysis-content.loading { color: var(--ink-3); }
.analysis-content.error { color: #b91c1c; white-space: pre-wrap; }
.chat-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  background: var(--white);
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 24px;
  text-align: center;
}
.chat-empty-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px 0;
  line-height: 1.3;
}
.chat-empty-title span { color: var(--text-primary); }
.chat-empty-subtitle {
  font-size: var(--text-md);
  color: var(--ink-3);
  max-width: 340px;
}
.chat-msgs-list {
  display: flex;
  flex-direction: column;
}
.chat-msg-row {
  display: flex;
  padding: 16px 24px;
}
.chat-msg-row.user {
  justify-content: flex-end;
  padding: 12px 24px;
}
.chat-msg-row.assistant {
  background: var(--off);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  justify-content: center;
}
.chat-msg {
  font-size: var(--text-md);
  line-height: 1.6;
}
.chat-msg.user {
  max-width: 72%;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 18px 18px 4px 18px;
}
.chat-msg.assistant {
  max-width: 680px;
  width: 100%;
  color: var(--ink);
}
.chat-msg.assistant p { margin: 6px 0; }
.chat-msg.assistant p:first-child { margin-top: 0; }
.chat-msg.assistant p:last-child { margin-bottom: 0; }
.chat-msg.assistant ul { margin: 6px 0; padding-left: 20px; }
.chat-input-area {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.chat-input-wrap { max-width: 720px; margin: 0 auto; }
.chat-input-box {
  display: flex;
  align-items: flex-end;
  background: var(--off);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 8px 8px 8px 14px;
  gap: 8px;
  transition: border 220ms, box-shadow 220ms;
}
.chat-input-box:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17,17,16,0.07);
  background: var(--white);
}
.chat-input-box textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-md);
  color: var(--ink);
  line-height: 1.5;
  min-height: 24px;
  max-height: 180px;
  overflow-y: auto;
  padding: 2px 0;
}
.chat-input-box textarea::placeholder { color: var(--ink-3); }
.chat-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 200ms;
}
.chat-send-btn:disabled { opacity: 0.35; cursor: default; }
.chat-send-btn svg { width: 16px; height: 16px; fill: #fff; }
.chat-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 2px;
}
.chat-input-hint { font-size: var(--text-xs); color: var(--ink-3); }
/* Account context button & modal */
.btn-ghost, .btn-secondary { background: var(--bg-surface); border: 1px solid var(--border-default); color: var(--text-primary); }
.btn-ghost:hover, .btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); opacity: 1; }
.btn-sm { padding: 5px 12px; font-size: var(--text-xs); }
.context-info:hover { color: var(--ink-2); }
.context-info-tip { display: none; position: absolute; left: 0; top: calc(100% + 6px); width: 268px; background: var(--ink); color: var(--white); border-radius: 8px; padding: 12px 14px; font-size: var(--text-xs); line-height: 1.7; z-index: 250; box-shadow: 0 4px 20px rgba(0,0,0,0.15); white-space: normal; pointer-events: none; }
.context-info-tip strong { display: block; margin-bottom: 4px; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.75; }
.context-info:hover .context-info-tip { display: block; }
/* conv-stat cards migrated to shared .stat-card in shared.css */
.conv-section { margin-bottom:32px; }
.conv-section-title { font-size: var(--text-xl); font-weight: 700; color: var(--ink); margin: 0 0 14px; display: flex; align-items: baseline; gap: 8px; }
.conv-section-sub { font-size: var(--text-md); color: var(--ink-3); font-weight: 400; }
.conv-chart-wrap { position:relative; border:1px solid var(--border); border-radius:var(--radius); padding:20px 24px; background:var(--white); }
.conv-chart-bar { cursor:pointer; }
.conv-chart-bar:hover { opacity:1; }
.conv-tooltip { position:absolute; display:none; background:var(--white); border:1px solid var(--border); border-radius:8px; padding:10px 14px; font-size:var(--text-base); box-shadow:0 4px 12px rgba(0,0,0,0.12); pointer-events:none; z-index:10; min-width:160px; }
.conv-tooltip-date { font-weight:600; color:var(--ink); margin-bottom:4px; }
.conv-tooltip-metric { font-size: var(--text-xs); color: var(--ink-3); margin-bottom:2px; }
.conv-tooltip-value { font-weight:600; color:var(--ink); display:flex; align-items:center; gap:6px; }
.conv-tooltip-value .conv-tooltip-dot { width:8px; height:8px; border-radius:50%; background:var(--chart-green); flex-shrink:0; }
/* ── Performance chart cards (unified BEM) ─── */
.perf-charts { display: flex; gap: var(--space-6); flex-wrap: wrap; margin-bottom: var(--space-5); }
.perf-chart-card { flex: 1; min-width: 420px; border: 1px solid var(--border-subtle); border-radius: var(--radius); background: var(--bg-surface); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02); transition: box-shadow 220ms ease, border-color 220ms ease; }
.perf-chart-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.07); border-color: var(--border-default); }
[data-perf-view="day"] .perf-chart-card { border-top: 3px solid var(--chart-cost); }
[data-perf-view="time"] .perf-chart-card { border-top: 3px solid var(--chart-secondary); }
[data-perf-view="device"] .perf-chart-card { border-top: 3px solid var(--chart-green); }
[data-perf-view="matchtype"] .perf-chart-card { border-top: 3px solid var(--status-paused); }
.perf-chart-card--full { flex-basis: 100%; width: 100%; }
.perf-chart-card__header { padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--border-subtle); }
.perf-chart-card__body { padding: var(--space-4) var(--space-6) var(--space-5); }
.perf-chart-card__title { font-size: var(--text-md); font-weight: 600; text-transform: none; letter-spacing: -0.01em; color: var(--text-primary); margin-bottom: var(--space-1); }
.perf-chart-card__subtitle { font-size: var(--text-sm); color: var(--text-tertiary); font-weight: 400; margin-bottom: var(--space-2); line-height: 1.4; }
.perf-chart-card__legend { display: flex; gap: var(--space-4); margin-bottom: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); }
.perf-chart-card__legend span { display: flex; align-items: center; gap: var(--space-2); }
.perf-chart-card__legend .dot { width: 8px; height: 8px; min-width: 8px; min-height: 8px; border-radius: 50%; flex-shrink: 0; }
.perf-comparison { display: flex; gap: var(--space-6); align-items: flex-start; margin-top: var(--space-2); }
.perf-comparison__chart { flex: 0 0 320px; max-width: 360px; }
.perf-comparison .perf-insight-box { flex: 1; margin-top: 0; }
.perf-insight-box { display: none; }
.perf-section-desc { color: var(--text-tertiary); font-size: var(--text-base); margin: 0 0 var(--space-3); line-height: 1.45; }
.perf-all-active .perf-detail-only { display: none !important; }
.perf-all-active .perf-chart-card__subtitle { display: none; }
.perf-all-active .perf-chart-card__title { font-size: var(--text-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); margin-bottom: 0; }
.perf-all-active .perf-chart-card__header { padding: var(--space-3) var(--space-6) 0; border-bottom: none; }
.perf-all-active .chart-avg-line { display: none; }
.panel.active.perf-all-active { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
.perf-all-active > .panel-header,
.perf-all-active > .filter-bar,
.perf-all-active .perf-panel-selectors { grid-column: 1 / -1; }
.perf-all-active .perf-view-section { margin-bottom: 0; }
.perf-all-active .conv-section-title { display: none; }
.perf-all-active .perf-charts { margin-bottom: 0; }
.perf-all-active .perf-chart-card { min-width: 0; }
@media (max-width: 1024px) { .perf-all-active { grid-template-columns: 1fr; } }
.perf-view-details { font-size: var(--text-sm); font-weight: 500; color: var(--accent); cursor: pointer; margin-left: auto; display: none; white-space: nowrap; }
.perf-view-details:hover { text-decoration: underline; }
.perf-all-active .perf-view-details { display: inline; }
.perf-all-active .perf-chart-card { cursor: pointer; }
.perf-all-active .perf-chart-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.09); border-color: var(--accent); }
.perf-toolbar { margin-bottom: var(--space-3); }
.conv-chart-header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:10px; }
.conv-view-toggle { display:flex; gap:0; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.conv-view-btn { padding:6px 12px; font-size:var(--text-base); font-weight:var(--weight-semibold); background:var(--bg-surface); color:var(--text-tertiary); border:none; cursor:pointer; font-family:var(--font-body); }
.conv-view-btn:hover { background:var(--bg-hover); color:var(--text-primary); }
.conv-view-btn.active { background:var(--accent); color:#fff; }
.conv-chart-filters { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.conv-chart-filters label { font-size: var(--text-base); color: var(--ink-3); font-weight: 400; }
.conv-chart-filters select { font-size: var(--text-md); padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); min-width: 180px; max-width: 240px; }
.conv-campaign-chooser, .conv-action-chooser { position: relative; }
.conv-campaign-btn, .conv-action-btn { min-width: 140px; text-align: left; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-campaign-drop, .conv-action-drop { left: 0; right: auto; min-width: 220px; max-height: 280px; overflow-y: auto; }
.conv-campaign-drop label, .conv-action-drop label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer; font-size: var(--text-base); color: var(--ink-2); border-radius: 6px; }
.conv-campaign-drop label:hover, .conv-action-drop label:hover { background: var(--off); color: var(--ink); }
.conv-campaign-empty, .conv-action-empty { font-size: var(--text-base); color: var(--ink-3); padding: 8px; display: block; }
.perf-panel-selectors { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 0 0 24px; }
.perf-panel-selector { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 72px; padding: 12px 20px; background: var(--white); border: 2px solid var(--border); border-radius: 7px; font-family: var(--font-body); font-size: var(--text-md); font-weight: 600; color: var(--ink-2); cursor: pointer; transition: border-color 220ms, background 220ms, color 220ms, box-shadow 220ms; text-align: center; }
.perf-panel-selector:not(.active):hover { border-color: var(--border-strong); background: var(--bg-hover); color: var(--ink); }
.perf-panel-selector.active { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.perf-panel-selector .perf-panel-icon { flex-shrink: 0; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.perf-panel-selector .perf-panel-icon svg { width: 100%; height: 100%; stroke: currentColor; }
.conv-pct-bar-wrap { display:flex; align-items:center; gap:8px; }
.conv-pct-bar { height:6px; border-radius:3px; background:var(--ink); opacity:0.65; flex-shrink:0; }

/* ── Sidebar (base from shared.css; index-specific overrides) ─── */
body { display: flex; }
.sidebar { flex-shrink: 0; }
.main-content { flex: 1; min-width: 0; }
.main-content .container { max-width: none; margin: 0; }

.sidebar-controls #analyse-model { max-width: none; width: 100%; }
.analyse-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 400; display: flex; align-items: center; justify-content: center; }
.analyse-modal { background: var(--bg-surface, #1e1e1e); border: 1px solid var(--border-default, #3a3a3a); border-radius: 12px; width: 100%; max-width: 340px; margin: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.25); padding: 20px; }
.analyse-modal-title { font-size: var(--text-md); font-weight: 700; color: var(--text-primary, #e8e6e0); margin-bottom: 4px; }
.analyse-modal-subtitle { font-size: var(--text-sm); color: var(--text-secondary, #8b8b86); margin-bottom: 16px; }
.analyse-modal-options { display: flex; flex-direction: column; gap: 8px; }
.analyse-modal-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border-default, #3a3a3a); background: var(--bg-base, #181818); color: var(--text-primary, #e8e6e0); cursor: pointer; font-size: var(--text-base); text-align: left; transition: border-color 0.15s, background 0.15s; }
.analyse-modal-opt:hover { border-color: var(--accent, #6c5ce7); background: #252525; }
.analyse-modal-opt .opt-title { font-weight: 600; }
.analyse-modal-opt .opt-desc { font-size: var(--text-xs); color: var(--text-secondary, #8b8b86); margin-top: 2px; }
.analyse-modal-cancel { margin-top: 12px; text-align: center; }
.analyse-modal-cancel button { background: none; border: none; color: var(--text-secondary, #8b8b86); font-size: var(--text-sm); cursor: pointer; padding: 4px 8px; }
.analyse-modal-cancel button:hover { color: var(--text-primary, #e8e6e0); }

/* Divider */
.sidebar-divider { height: 1px; background: #2d2d2d; flex-shrink: 0; margin: 2px 0; }

/* Nav items */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 6px 8px;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  color: #c0bdb8;
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  font-family: var(--font-body);
  transition: background 220ms ease, color 220ms ease;
  white-space: nowrap;
  min-height: 36px;
  line-height: 1.3;
  position: relative;
}
.sidebar-item:hover { background: #252525; color: #e8e6e0; }
.sidebar-item.active { background: rgba(59, 110, 245, 0.12); color: #fff; font-weight: 600; }
.sidebar-item.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent); }
.sidebar-item.parent-open { background: #242424; color: #e8e6e0; }
.sidebar-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.5; transition: opacity 220ms ease; }
.sidebar-item.active .sidebar-icon { opacity: 1; }
.sidebar-item:hover .sidebar-icon { opacity: 0.8; }
.sidebar-item-label {
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  max-width: 150px;
  transition: opacity 220ms ease, max-width 250ms cubic-bezier(0.4,0,0.2,1);
}
body.sidebar-collapsed .sidebar-item-label { opacity: 0; max-width: 0; }
.sidebar-spacer { flex: 1; min-height: 12px; }
.sidebar-bottom { padding: 4px 6px 10px; display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.sidebar-bottom .sidebar-item { color: #c0bdb8; font-size: var(--text-base); }
.sidebar-bottom .sidebar-item:hover { color: #e8e6e0; background: #252525; }
.sidebar-nav-secondary { border-top: none; }

/* Search Terms sub-menu */
.sidebar-sub-nav { display: flex; flex-direction: column; gap: 2px; padding: 2px 6px 6px 22px; }
.sidebar-sub-nav.hidden { display: none; }
body.sidebar-collapsed .sidebar-sub-nav { display: none; }
.sidebar-sub-item { display: flex; align-items: center; padding: 6px 8px 6px 14px; border-radius: 7px; color: #918f8a; font-size: var(--text-sm); font-weight: 500; text-decoration: none; font-family: var(--font-body); transition: background 220ms ease, color 220ms ease; white-space: nowrap; min-height: 32px; line-height: 1.3; position: relative; }
.sidebar-sub-item::before { content: ''; position: absolute; left: 5px; top: 50%; width: 5px; height: 1px; background: #3a3a3a; }
.sidebar-sub-item:hover { background: #252525; color: #e8e6e0; }
.sidebar-sub-item-label { white-space: nowrap; overflow: hidden; opacity: 1; max-width: 150px; transition: opacity 220ms ease, max-width 250ms cubic-bezier(0.4,0,0.2,1); }
body.sidebar-collapsed .sidebar-sub-item-label { opacity: 0; max-width: 0; }

/* Titles shown via native tooltip when sidebar is collapsed */

/* Data coverage footer bar */
.data-coverage-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle, #f0f0f3);
  border-top: 1px solid var(--border-subtle, #e3e3e9);
  font-family: var(--font-mono, 'Inter', sans-serif);
  font-size: var(--text-xs);
  color: var(--text-muted, #87878f);
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
}
.data-coverage-bar.visible { opacity: 1; }

/* Skeleton loading rows */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
.skeleton-row td {
  padding: 14px 16px !important;
}
.skeleton-bar {
  display: inline-block;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-hover) 50%, var(--bg-subtle) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

/* Performance Max */
.pmax-sub-title { font-size: var(--text-lg); font-weight: 600; margin: 0 0 12px; color: var(--ink); }
.pmax-channel-chart { margin-bottom: 16px; }
.pmax-asset-filter-btn {
  padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--white); font-size: var(--text-sm); font-weight: 500;
  color: var(--ink-2); cursor: pointer; transition: all 180ms;
}
.pmax-asset-filter-btn:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.pmax-asset-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
