:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-soft: #f8f9fc;
  --panel-tint: #f5f3ff;
  --ink: #171a22;
  --muted: #6d7481;
  --muted-2: #9399a5;
  --line: #e5e8ee;
  --line-strong: #d8dce5;
  --nav: #11141b;
  --nav-soft: #1c202a;
  --accent: #6657f2;
  --accent-strong: #5142df;
  --accent-soft: #eeeaff;
  --green: #138768;
  --green-soft: #eaf7f2;
  --amber: #b26b12;
  --amber-soft: #fff5e7;
  --red: #b24655;
  --red-soft: #fff0f2;
  --blue: #3d6db5;
  --blue-soft: #edf4ff;
  --shadow: 0 16px 46px rgba(26, 31, 45, 0.07);
  --shadow-soft: 0 8px 24px rgba(26, 31, 45, 0.05);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --sidebar-width: 250px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(102, 87, 242, .22);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px 18px;
  background: var(--nav);
  color: #e7eaf0;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand-row { display: flex; align-items: center; gap: 11px; padding: 2px 7px 21px; }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, #6555f6, #aaa2ff);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 7px 18px rgba(92,75,236,.24);
  flex: 0 0 auto;
}
.brand-name { font-weight: 760; letter-spacing: -.01em; }
.brand-status { margin-top: 1px; color: #7f8796; font-size: 10px; }
.project-switcher {
  width: 100%; border: 1px solid #2a2f3b; background: #1a1e27; color: #f5f6f8;
  border-radius: 12px; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between;
  text-align: left; cursor: pointer; margin-bottom: 14px;
}
.project-switcher:hover { background: #202530; border-color: #343a48; }
.project-switcher small { color: #777f8e; font-size: 9px; letter-spacing: .12em; display: block; margin-bottom: 2px; }
.project-switcher strong { font-size: 13px; font-weight: 680; }
.nav-stack { overflow: auto; padding-right: 2px; }
.nav-group + .nav-group { margin-top: 17px; }
.nav-label { color: #646c7a; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; padding: 0 10px 6px; }
.nav-item {
  width: 100%; border: 0; background: transparent; color: #9fa7b5; border-radius: 10px;
  padding: 9px 10px; display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left;
  min-height: 38px;
}
.nav-item:hover:not(:disabled) { color: #fff; background: #1b202a; }
.nav-item.is-active { color: #fff; background: #242936; }
.nav-item.is-disabled { cursor: default; opacity: .58; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: #5f6775; flex: 0 0 auto; }
.nav-item.is-active .nav-dot { background: #8d80ff; box-shadow: 0 0 0 4px rgba(141,128,255,.11); }
.nav-count { margin-left: auto; background: #303643; color: #b8beca; font-size: 10px; border-radius: 999px; padding: 1px 6px; }
.nav-pill { margin-left: auto; color: #868e9c; border: 1px solid #343a46; font-size: 8px; padding: 2px 5px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.health-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: #22aa78; box-shadow: 0 0 0 3px rgba(34,170,120,.1); }
.mobile-more { display: none; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #252a34; padding: 14px 7px 0; }
.sample-badge { display: inline-flex; border: 1px solid #373d49; color: #9da5b3; font-size: 8px; letter-spacing: .11em; padding: 4px 6px; border-radius: 999px; }
.sidebar-footer p { color: #696f7c; font-size: 10px; margin: 7px 0 0; line-height: 1.45; }

.main-column { min-width: 0; }
.topbar {
  height: 68px; background: rgba(255,255,255,.91); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 28px; position: sticky; top: 0; z-index: 8;
}
.mobile-brand { display: none; }
.topbar-context { display: flex; align-items: center; gap: 7px; min-width: 0; }
.breadcrumb { color: var(--muted-2); }
.breadcrumb-separator { color: #c6cad1; }
.topbar-context strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.button {
  border: 1px solid var(--line-strong); background: #fff; min-height: 36px; padding: 7px 11px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-weight: 600; font-size: 12px;
}
.button:hover { border-color: #c8cdd8; background: #fbfcfd; }
.button-primary { color: #fff; background: var(--ink); border-color: var(--ink); }
.button-primary:hover { background: #262a34; border-color: #262a34; }
.button-accent { color: #fff; background: var(--accent); border-color: var(--accent); }
.button-accent:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.button-quiet { color: #565d69; }
.button-danger { color: var(--red); background: #fff; border-color: #efd1d6; }
.button-danger:hover { background: var(--red-soft); border-color: #e9bec5; }
.button-link { border: 0; background: none; min-height: auto; padding: 2px 0; color: var(--accent-strong); }
.button-link:hover { background: none; text-decoration: underline; }
.button:disabled { cursor: default; opacity: .48; }

.main-content { padding: 28px 30px 56px; max-width: 1520px; margin: 0 auto; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-kicker { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.page-title { margin: 0; font-size: 27px; line-height: 1.15; letter-spacing: -.035em; }
.page-description { color: var(--muted); max-width: 680px; margin: 7px 0 0; font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.grid { display: grid; gap: 16px; }
.grid-overview { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .72fr); }
.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-channel { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .65fr); }
.card {
  min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
}
.card-pad { padding: 18px 20px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-title { margin: 0; font-size: 13px; font-weight: 720; letter-spacing: -.01em; }
.card-subtitle { color: var(--muted); font-size: 11px; margin-top: 3px; }
.section-title { font-size: 12px; color: #4a515d; font-weight: 680; margin: 0 0 10px; }
.eyebrow { color: var(--muted); font-size: 9px; letter-spacing: .105em; text-transform: uppercase; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

.hero-card { overflow: hidden; }
.hero-summary { padding: 20px 22px 5px; }
.metric-row { display: flex; align-items: baseline; gap: 9px; margin-top: 5px; }
.metric-big { font-size: 34px; line-height: 1; font-weight: 780; letter-spacing: -.05em; }
.delta { display: inline-flex; align-items: center; gap: 4px; color: var(--green); background: var(--green-soft); padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 650; }
.delta.down { color: var(--red); background: var(--red-soft); }
.hero-insight {
  margin: 14px 22px 4px; padding: 12px 13px; border: 1px solid #e6e1ff; background: #f8f6ff; border-radius: 12px;
  color: #4e44aa; display: flex; gap: 10px; align-items: flex-start;
}
.hero-insight strong { color: #3f358f; }
.hero-insight p { margin: 1px 0 0; font-size: 11px; line-height: 1.5; }
.evidence-badge, .status-chip, .type-chip {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 7px; font-size: 9px; font-weight: 650; white-space: nowrap;
}
.evidence-badge.observed { color: #665c91; background: #f4f1ff; border-color: #e6e0ff; }
.evidence-badge.attributed { color: var(--green); background: var(--green-soft); border-color: #d9eee6; }
.evidence-badge.strong { color: var(--blue); background: var(--blue-soft); border-color: #d9e7fb; }
.status-chip.confirmed { color: #5b50c7; background: #f1eeff; border-color: #e5e0ff; }
.status-chip.detected { color: var(--amber); background: var(--amber-soft); border-color: #f2dfbf; }
.status-chip.source { color: var(--green); background: var(--green-soft); border-color: #d5ebe3; }
.status-chip.manual { color: #626a77; background: #f5f6f8; }
.type-chip { color: #626a77; background: #fafbfc; }

.chart-card { padding: 10px 22px 4px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 6px; }
.segmented { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); }
.segmented button { border: 0; background: transparent; color: var(--muted); padding: 5px 8px; border-radius: 7px; font-size: 9px; cursor: pointer; }
.segmented button.is-active { color: #3f4550; background: #fff; box-shadow: 0 1px 4px rgba(24,28,36,.08); }
.performance-chart { position: relative; height: 268px; }
.performance-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: #edf0f4; stroke-width: 1; }
.chart-axis-text { fill: #858c98; font-size: 10px; }
.line-web { fill: none; stroke: #6758f2; stroke-width: 3; stroke-linecap: round; }
.line-store { fill: none; stroke: #1b9d73; stroke-width: 2.4; stroke-linecap: round; }
.provisional-zone { fill: url(#provisionalPattern); opacity: .7; }
.event-marker {
  position: absolute; top: 12px; bottom: 29px; width: 1px; border-left: 1px dashed #bcb4ff; cursor: pointer;
}
.event-marker-button {
  position: absolute; top: -3px; transform: translateX(-50%); border: 1px solid #ded9ff; background: #fff; color: #584dca;
  border-radius: 8px; padding: 4px 7px; font-size: 9px; white-space: nowrap; cursor: pointer; box-shadow: 0 4px 12px rgba(84,70,200,.08);
}
.event-marker-button:hover { background: #f8f6ff; }
.chart-legend { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 0 0 12px; color: var(--muted); font-size: 10px; }
.legend-group { display: flex; gap: 13px; flex-wrap: wrap; }
.legend-key { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: #6758f2; }
.legend-dot.store { background: #1b9d73; }
.legend-provisional { width: 15px; height: 8px; border-radius: 3px; background: repeating-linear-gradient(135deg,#eef0f5,#eef0f5 3px,#dfe3ea 3px,#dfe3ea 5px); }

.outcome-section { padding: 0 22px 20px; }
.outcome-header { display: flex; justify-content: space-between; gap: 15px; align-items: flex-end; margin: 3px 0 9px; }
.outcome-header p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.outcome-chain { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 24px; position: relative; }
.outcome-stage { position: relative; border: 1px solid var(--line); background: #fbfcfd; border-radius: 11px; padding: 10px 11px; min-width: 0; }
.outcome-stage:not(:last-child)::after {
  content: ""; position: absolute; right: -25px; top: 50%; width: 24px; border-top: 1px dashed #cfd4dc;
}
.outcome-stage.is-attributed::after { border-top: 2px solid #5ab493; }
.outcome-stage.is-attributed::before {
  content: "tracked"; position: absolute; right: -23px; top: calc(50% - 15px); font-size: 7px; color: var(--green); background: #fff; padding: 0 2px; z-index: 1;
}
.outcome-stage span { color: var(--muted); font-size: 8px; letter-spacing: .06em; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outcome-stage strong { display: block; font-size: 16px; margin-top: 2px; }
.outcome-stage small { color: var(--muted-2); font-size: 8px; display: block; margin-top: 1px; }

.signal-list { display: grid; gap: 9px; }
.signal-card { border: 1px solid var(--line); background: var(--panel-soft); border-radius: 11px; padding: 11px 12px; }
.signal-card.is-positive { border-color: #d8eee5; background: #f6fcf9; }
.signal-card.is-warning { border-color: #f0dfc6; background: #fffaf1; }
.signal-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.signal-card strong { display: block; font-size: 11px; }
.signal-card p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.signal-card button { margin-top: 7px; }

.freshness-list { display: grid; gap: 8px; }
.freshness-row { display: grid; grid-template-columns: 82px 1fr auto; gap: 9px; align-items: center; }
.freshness-row strong { font-size: 10px; }
.freshness-track { height: 6px; background: #edf0f3; border-radius: 999px; overflow: hidden; }
.freshness-fill { height: 100%; border-radius: inherit; background: #62af91; }
.freshness-fill.partial { width: 71%; background: #d7a35e; }
.freshness-row small { font-size: 9px; color: var(--muted); }

.timeline-preview { margin-top: 16px; }
.timeline-list { position: relative; }
.timeline-list::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: #e2e5ea; }
.timeline-row {
  position: relative; display: grid; grid-template-columns: 18px 74px minmax(0,1fr) auto; gap: 9px; align-items: start; padding: 9px 0;
  border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer;
}
.timeline-row:hover .timeline-title { color: var(--accent-strong); }
.timeline-node { width: 15px; height: 15px; border: 3px solid #fff; box-shadow: 0 0 0 1px #ccd1da; border-radius: 50%; background: #78808d; z-index: 1; margin-top: 2px; }
.timeline-node.launch { background: var(--accent); box-shadow: 0 0 0 1px #8f83ff; }
.timeline-node.change { background: #2f9a75; }
.timeline-row time { color: var(--muted); font-size: 10px; padding-top: 2px; }
.timeline-title { display:block; font-size: 11px; font-weight: 680; }
.timeline-desc { display:block; color: var(--muted); font-size: 10px; margin-top: 2px; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search-input { min-width: 220px; flex: 1; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); border-radius: 10px; min-height: 36px; padding: 8px 10px; font-size: 11px;
}
.select { width: auto; min-width: 125px; }
.textarea { min-height: 88px; resize: vertical; }
.timeline-day { margin: 18px 0 8px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.timeline-card {
  display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 12px; align-items: start; border: 1px solid var(--line); background: #fff;
  border-radius: 13px; padding: 13px 14px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 3px 10px rgba(25,30,42,.025);
}
.timeline-card:hover { border-color: #d6d1ff; box-shadow: 0 8px 20px rgba(70,57,170,.06); }
.timeline-icon { width: 34px; height: 34px; border-radius: 10px; background: #f0eeff; color: #5f53ce; display: grid; place-items: center; font-weight: 760; }
.timeline-icon.metric { color: var(--green); background: var(--green-soft); }
.timeline-card h3 { margin: 0; font-size: 12px; }
.timeline-card p { color: var(--muted); font-size: 10px; margin: 3px 0 0; }
.timeline-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.timeline-actions { display: flex; gap: 5px; align-items: center; }
.mini-button { border: 1px solid var(--line); background: #fff; border-radius: 8px; min-height: 28px; padding: 5px 8px; font-size: 9px; cursor: pointer; }
.mini-button:hover { background: #fafbfc; border-color: #ccd1d9; }
.mini-button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.mini-button.danger { color: var(--red); }
.empty-state { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--ink); display: block; margin-bottom: 4px; }

.channel-kpi-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.kpi-card { border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 13px 14px; }
.kpi-card span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.kpi-card strong { display: block; font-size: 21px; margin-top: 3px; letter-spacing: -.03em; }
.kpi-card small { color: var(--muted); font-size: 9px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; text-align: left; font-weight: 650; padding: 8px 9px; border-bottom: 1px solid var(--line); }
.data-table td { font-size: 10px; padding: 10px 9px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr[data-event-id] { cursor: pointer; }
.data-table tr[data-event-id]:hover td { background: #faf9ff; }
.table-primary { font-weight: 660; font-size: 11px; }
.table-secondary { color: var(--muted); font-size: 9px; margin-top: 2px; }

.integration-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.integration-card { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 15px; }
.integration-card.is-planned { background: #fafbfc; opacity: .8; }
.integration-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.provider-id { display: flex; gap: 10px; align-items: center; }
.provider-logo { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; background: #f1f3f6; font-weight: 780; font-size: 12px; }
.provider-id h3 { margin: 0; font-size: 12px; }
.provider-id p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.connection-state { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 9px; font-weight: 650; }
.connection-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.connection-state.degraded { color: var(--amber); }
.connection-state.planned { color: var(--muted); }
.integration-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 13px 0; }
.meta-box { background: var(--panel-soft); border: 1px solid #eef0f3; border-radius: 9px; padding: 8px; }
.meta-box span { color: var(--muted); font-size: 8px; display: block; }
.meta-box strong { font-size: 9px; display: block; margin-top: 2px; }
.meta-box em { color:var(--muted); font-size:8px; font-style:normal; display:block; margin-top:2px; }
.scope-list { display: flex; flex-wrap: wrap; gap: 5px; }
.scope-chip { border: 1px solid var(--line); color: var(--muted); background: #fbfcfd; border-radius: 999px; padding: 3px 6px; font-size: 8px; }
.integration-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 13px; }

.surface-list { display: grid; gap: 8px; }
.surface-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; }
.surface-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #f2f3f6; color: #5d6470; font-size: 11px; }
.surface-row strong { display: block; font-size: 10px; }
.surface-row small { color: var(--muted); font-size: 9px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toggle { position: relative; width: 32px; height: 19px; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: #d7dbe2; border-radius: 999px; cursor: pointer; transition: .15s; }
.toggle span::after { content: ""; position: absolute; width: 13px; height: 13px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.12); transition: .15s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(13px); }

.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.field { display: grid; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #4f5662; font-size: 10px; font-weight: 650; }
.field-hint { color: var(--muted); font-size: 9px; }
.info-banner { border: 1px solid #dde7f7; background: #f4f8fe; color: #4d668b; border-radius: 11px; padding: 10px 11px; font-size: 10px; }
.warning-banner { border: 1px solid #f0dfc1; background: #fff9ed; color: #88612e; border-radius: 11px; padding: 10px 11px; font-size: 10px; }

.share-layout { display: grid; grid-template-columns: minmax(280px,.72fr) minmax(0,1.28fr); gap: 16px; align-items: start; }
.share-card-preview { border-radius: 20px; background: linear-gradient(150deg,#171923,#25213f 64%,#443b85); color: #fff; padding: 28px; min-height: 420px; box-shadow: var(--shadow); position: sticky; top: 88px; overflow: hidden; }
.share-card-preview::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(136,120,255,.12); right: -70px; bottom: -70px; }
.share-preview-kicker { color: #aeb4c3; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.share-preview-title { font-size: 25px; line-height: 1.12; letter-spacing: -.035em; max-width: 360px; margin: 16px 0 20px; }
.share-preview-metric { font-size: 48px; line-height: 1; font-weight: 780; letter-spacing: -.05em; }
.share-preview-metric-label { color: #aeb4c3; font-size: 10px; margin-top: 4px; }
.share-preview-evidence { margin-top: 26px; border-top: 1px solid rgba(255,255,255,.13); padding-top: 16px; font-size: 11px; color: #cdd1da; }
.share-preview-foot { position: absolute; left: 28px; right: 28px; bottom: 24px; display: flex; justify-content: space-between; color: #8e95a4; font-size: 9px; z-index: 2; }
.privacy-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 11px; padding: 10px; }
.privacy-row strong { font-size: 10px; display: block; }
.privacy-row small { color: var(--muted); font-size: 9px; display: block; }

.detail-drawer {
  position: fixed; top: 0; right: 0; width: min(520px, 94vw); height: 100vh; background: #fff; z-index: 30; box-shadow: -24px 0 70px rgba(18,22,32,.18);
  transform: translateX(105%); transition: transform .22s ease; overflow-y: auto;
}
.detail-drawer.is-open { transform: translateX(0); }
.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; background: rgba(16,19,27,.34); backdrop-filter: blur(2px); z-index: 20; }
.drawer-head { position: sticky; top: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding: 16px 18px; z-index: 2; }
.drawer-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer-head h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.025em; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 9px; cursor: pointer; }
.icon-button:hover { background: #f7f8fa; }
.drawer-body { padding: 18px; }
.drawer-section + .drawer-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.drawer-section h3 { margin: 0 0 9px; font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.detail-box { background: var(--panel-soft); border-radius: 9px; padding: 9px; }
.detail-box span { color: var(--muted); font-size: 8px; display: block; }
.detail-box strong { font-size: 10px; display: block; margin-top: 2px; }
.source-preview { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfcfd; }
.source-preview p { margin: 0; font-size: 11px; }
.source-preview footer { color: var(--muted); font-size: 9px; margin-top: 8px; }
.before-after { display: grid; grid-template-columns: 1fr 34px 1fr; align-items: center; gap: 8px; }
.compare-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.compare-box span { color: var(--muted); font-size: 8px; }
.compare-box strong { display: block; font-size: 17px; margin-top: 2px; }
.compare-arrow { text-align: center; color: var(--muted-2); }
.evidence-list { display: grid; gap: 7px; }
.evidence-row { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.evidence-row strong { font-size: 10px; display: block; }
.evidence-row p { color: var(--muted); margin: 2px 0 0; font-size: 9px; }
.drawer-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(560px, calc(100vw - 30px)); max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 18px; box-shadow: 0 30px 90px rgba(17,20,30,.28); z-index: 40;
}
.modal-head { padding: 17px 18px 13px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-head p { color: var(--muted); font-size: 10px; margin: 4px 0 0; }
.modal-body { padding: 17px 18px; }
.modal-foot { padding: 12px 18px 17px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 7px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 7px; }
.toast { background: #171a22; color: #fff; border-radius: 11px; padding: 10px 12px; min-width: 240px; box-shadow: 0 12px 32px rgba(18,22,30,.18); font-size: 10px; animation: toast-in .18s ease; }
.toast strong { display: block; font-size: 10px; }
.toast span { color: #b9bec8; display: block; margin-top: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1120px) {
  .grid-overview, .grid-channel, .share-layout { grid-template-columns: 1fr; }
  .share-card-preview { position: relative; top: 0; }
  .grid-three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar-width: 210px; }
  .main-content { padding: 22px 18px 48px; }
  .topbar { padding: 0 18px; }
  .outcome-chain { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .outcome-stage::after, .outcome-stage::before { display: none; }
  .integration-grid, .grid-two, .integration-layer-grid, .integration-layer-grid.planned { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: 100%; height: 64px; padding: 8px; z-index: 15; display: block; border-top: 1px solid #272c35; }
  .brand-row, .project-switcher, .nav-label, .sidebar-footer, .nav-group:nth-child(2), .nav-group:nth-child(3) .nav-item:last-child { display: none; }
  .nav-stack { display: block; overflow: visible; width: calc(100% - 72px); }
  .nav-group { margin: 0 !important; }
  .nav-group:not(:first-child) { display: none; }
  .nav-group:first-child { display: grid; grid-template-columns: repeat(4,1fr); }
  .nav-group:first-child .nav-item[data-route="web"] { display: none; }
  .nav-item { min-height: 46px; flex-direction: column; gap: 3px; justify-content: center; padding: 4px; font-size: 9px; border-radius: 9px; }
  .mobile-more { display:flex; position:absolute; right:8px; top:8px; width:64px; }
  .nav-count, .nav-pill, .health-dot { display: none; }
  .nav-dot { width: 6px; height: 6px; }
  .topbar { height: auto; min-height: 62px; padding: 8px 12px; }
  .topbar-context { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-size: 11px; min-width:0; }
  .mobile-sample { display:inline-flex; border:1px solid var(--line); color:var(--muted); padding:2px 5px; border-radius:999px; font-size:7px; text-transform:uppercase; letter-spacing:.06em; }
  .mobile-brand .brand-mark { width: 25px; height: 25px; border-radius: 8px; }
  .topbar-actions { gap: 5px; min-width: 0; }
  #addEventButton { display: none; }
  #dateRangeButton { max-width: 122px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .topbar-actions .button { min-height: 34px; padding: 6px 8px; font-size: 10px; }
  .main-content { padding: 18px 12px 90px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .page-title { font-size: 23px; }
  .grid-three, .channel-kpi-grid { grid-template-columns: 1fr; }
  .hero-summary, .chart-card, .outcome-section { padding-left: 15px; padding-right: 15px; }
  .hero-insight { margin-left: 15px; margin-right: 15px; }
  .performance-chart { height: 230px; overflow: hidden; }
  .chart-legend { align-items:flex-start; flex-direction:column; gap:6px; }
  .legend-group { gap:8px 10px; }
  .hero-insight { display:block; }
  .hero-insight > div:first-child { margin-bottom:5px; }
  .page-description, .card-subtitle, .hero-insight p { overflow-wrap:anywhere; }
  .event-marker-button { font-size: 8px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
  .outcome-chain { grid-template-columns: 1fr; }
  .timeline-row { grid-template-columns: 18px 58px minmax(0,1fr); }
  .timeline-row > .status-chip { grid-column: 3; justify-self: start; }
  .timeline-card { grid-template-columns: 36px minmax(0,1fr); }
  .timeline-actions { grid-column: 2; justify-content: flex-start; }
  .filter-bar { align-items: stretch; }
  .search-input { min-width: 100%; }
  .select { flex: 1; }
  .integration-meta, .form-grid, .detail-grid, .rule-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .share-card-preview { min-height: 390px; padding: 22px; }
  .share-preview-foot { left: 22px; right: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}


/* Interaction and decision-support refinements */

.mobile-sample { display:none; }
.integration-section-label { display:flex; align-items:baseline; gap:10px; margin:18px 0 9px; }
.integration-section-label:first-of-type { margin-top:0; }
.integration-section-label strong { font-size:11px; }
.integration-section-label span { color:var(--muted); font-size:9px; }
.integration-section-label.planned { margin-top:22px; }
.integration-layer-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.integration-layer-grid.planned { grid-template-columns:repeat(2,minmax(0,1fr)); }
.integration-layer-group { min-width:0; }
.integration-layer-head { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:0 2px 7px; color:#505763; }
.integration-layer-head > span { font-size:9px; font-weight:750; text-transform:uppercase; letter-spacing:.08em; }
.integration-layer-head small { color:var(--muted-2); font-size:8px; }
.integration-layer-group .integration-card { height:calc(100% - 24px); }
.rule-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }

.timeline-explainer { display:flex; flex-wrap:wrap; gap:7px 9px; align-items:center; padding:10px 11px; border:1px solid var(--line); border-radius:10px; background:var(--panel-soft); color:var(--muted); font-size:9px; margin-bottom:14px; }
.table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.surface-button { width:100%; border:1px solid var(--line); background:#fff; text-align:left; cursor:pointer; }
.surface-button:hover { border-color:#d6d1ff; background:#faf9ff; }
.lifecycle-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.lifecycle-step { border:1px solid var(--line); border-radius:12px; padding:12px; background:#fbfcfd; }
.lifecycle-step > span { width:22px; height:22px; border-radius:50%; display:grid; place-items:center; background:var(--accent-soft); color:var(--accent-strong); font-size:9px; font-weight:750; margin-bottom:9px; }
.lifecycle-step strong { display:block; font-size:11px; }
.lifecycle-step p { margin:4px 0 0; color:var(--muted); font-size:9px; }
.lifecycle-step.danger { border-color:#efd8dc; background:#fffafa; }
.lifecycle-step.danger > span { background:var(--red-soft); color:var(--red); }
.lifecycle-step .button { margin-top:10px; }
.choice-list { display:grid; gap:8px; }
.choice-row { width:100%; border:1px solid var(--line); background:#fff; border-radius:11px; padding:11px 12px; display:flex; justify-content:space-between; align-items:center; gap:12px; text-align:left; cursor:pointer; }
.choice-row:hover { background:#faf9ff; border-color:#d8d2ff; }
.choice-row.is-selected { border-color:#cfc7ff; background:#f8f6ff; }
.choice-row strong { display:block; font-size:11px; }
.choice-row small { display:block; color:var(--muted); font-size:9px; margin-top:2px; }
.copy-field { display:flex; gap:8px; align-items:stretch; }
.copy-field code { flex:1; min-width:0; padding:9px 10px; border:1px solid var(--line); background:var(--panel-soft); border-radius:9px; color:#4b5360; font:9px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; overflow-wrap:anywhere; }
.card p.muted { font-size:10px; }
.signal-card .evidence-badge { flex:0 0 auto; }
.nav-item .nav-pill { line-height:1.2; }

@media (max-width: 900px) {
  .lifecycle-grid { grid-template-columns:1fr; }
}
@media (max-width: 720px) {
  .copy-field { flex-direction:column; }
  .timeline-explainer { align-items:flex-start; }
}
