:root {
  --ink: #15231f;
  --muted: #6e7b76;
  --paper: #f3f2ec;
  --card: #fbfaf6;
  --line: #dcded7;
  --green: #0d6955;
  --green-light: #d9eee6;
  --lime: #c7ed70;
  --orange: #ef7f56;
  --sidebar: #10231e;
  --mono: "DM Mono", monospace;
  --sans: "Manrope", sans-serif;
  --serif: "Newsreader", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, input, select { font: inherit; }
button { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 20px 22px; background: var(--sidebar); color: #f5f7f1; display: flex; flex-direction: column; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: 19px; font-weight: 700; letter-spacing: -.5px; padding: 0 8px; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: var(--lime); color: var(--sidebar); font-family: var(--mono); font-size: 8px; font-weight: 700; }
.brand-dot { color: var(--lime); }
.nav { display: grid; gap: 7px; margin-top: 54px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #9aaca6; border-radius: 8px; padding: 12px 13px; display: flex; align-items: center; gap: 11px; cursor: pointer; text-align: left; font-size: 13px; transition: .2s ease; }
.nav-item:hover { color: #fff; background: #19332c; }
.nav-item.active { color: #fff; background: #214238; box-shadow: inset 3px 0 var(--lime); }
.nav-icon { width: 20px; color: var(--lime); font-family: var(--mono); font-size: 16px; text-align: center; }
.sidebar-status { margin-top: auto; padding: 17px 14px; border: 1px solid #2c463f; border-radius: 10px; background: #152b25; }
.status-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgba(199,237,112,.1); }
.status-time { margin-top: 8px; color: #91a49d; font-size: 10px; }
.progress-track { height: 3px; margin: 15px 0 8px; border-radius: 3px; background: #345048; overflow: hidden; }
.progress-track span { display: block; width: 92%; height: 100%; background: var(--lime); }
.status-meta { display: flex; justify-content: space-between; color: #91a49d; font-family: var(--mono); font-size: 8px; text-transform: uppercase; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 18px 8px 0; border-top: 1px solid #29413a; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e7dfcb; color: var(--ink); font-size: 10px; font-weight: 700; }
.sidebar-foot strong, .sidebar-foot span { display: block; }
.sidebar-foot strong { font-size: 10px; }
.sidebar-foot span { color: #81958e; font-size: 9px; margin-top: 2px; }

.main { min-width: 0; padding: 0 42px 60px; }
.topbar { min-height: 114px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.eyebrow, .section-kicker { color: var(--green); font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 6px 0 0; font-family: var(--serif); font-size: 31px; font-weight: 600; letter-spacing: -.5px; }
.header-actions { display: flex; gap: 10px; }
.select-wrap select { appearance: none; border: 1px solid var(--line); border-radius: 7px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%2315231f'/%3E%3C/svg%3E") no-repeat right 13px center; padding: 10px 34px 10px 13px; color: var(--ink); font-size: 11px; cursor: pointer; }
.present-button { border: 0; border-radius: 7px; background: var(--green); color: #fff; padding: 10px 15px; font-size: 11px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 10px rgba(13,105,85,.16); }
.view { display: none; padding-top: 26px; }
.view.active { display: block; animation: fade .32s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.insight-banner { min-height: 91px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 17px; padding: 17px 20px; border-radius: 10px; color: #e9f5ef; background: linear-gradient(110deg, #0f6b57, #185243); box-shadow: 0 7px 20px rgba(26,59,49,.12); }
.insight-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--sidebar); background: var(--lime); font-size: 20px; }
.insight-label { display: block; color: #afd7ca; font-family: var(--mono); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.insight-banner strong { display: block; margin-top: 4px; font-family: var(--serif); font-size: 17px; font-weight: 500; }
.insight-banner p { margin: 3px 0 0; color: #b7d2c9; font-size: 10px; }
.insight-banner button { border: 1px solid rgba(255,255,255,.3); border-radius: 6px; background: transparent; color: #fff; padding: 9px 12px; font-size: 10px; cursor: pointer; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 17px; }
.metric-card { position: relative; min-height: 126px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -20px; bottom: -30px; width: 85px; height: 85px; border: 1px solid #e5e6df; border-radius: 50%; }
.metric-label { color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.metric-value { display: block; margin-top: 9px; font-family: var(--serif); font-size: 27px; font-weight: 600; }
.metric-foot { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: #8a948f; font-size: 9px; }
.metric-change { color: var(--green); font-family: var(--mono); font-size: 9px; font-weight: 500; }

.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr); gap: 14px; margin-top: 14px; }
.performance-panel, .channel-panel, .journey-panel { padding: 20px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel h2, .customer-hero h2, .pipeline-intro h2, .sql-copy h2 { margin: 5px 0 0; font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -.25px; }
.legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.revenue-dot, .spend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.revenue-dot { background: var(--green); }
.spend-dot { margin-left: 6px; background: var(--orange); }
.chart-summary { display: flex; align-items: end; gap: 28px; margin-top: 20px; }
.chart-summary span, .chart-summary strong { display: block; }
.chart-summary span { color: var(--muted); font-size: 8px; }
.chart-summary strong { margin-top: 2px; font-family: var(--serif); font-size: 18px; }
.roas-pill { margin-left: auto; border-radius: 15px; background: var(--green-light); color: var(--green); padding: 5px 8px; font-family: var(--mono); font-size: 8px; }
.chart { position: relative; height: 150px; margin-top: 12px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 36px, #e9e9e3 37px); }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-labels { position: absolute; left: 0; right: 0; bottom: -19px; display: flex; justify-content: space-between; color: #8a948f; font-family: var(--mono); font-size: 7px; }
.text-button { border: 0; background: transparent; color: var(--green); padding: 2px; font-size: 9px; font-weight: 600; cursor: pointer; }
.channel-list { display: grid; gap: 16px; margin-top: 24px; }
.channel-row { display: grid; grid-template-columns: 83px 1fr 42px; align-items: center; gap: 8px; }
.channel-name { font-size: 9px; font-weight: 600; }
.channel-bar { height: 7px; border-radius: 6px; background: #e7e8e2; overflow: hidden; }
.channel-bar span { display: block; height: 100%; border-radius: inherit; background: var(--green); transform-origin: left; animation: grow .7s ease both; }
@keyframes grow { from { transform: scaleX(0); } }
.channel-value { text-align: right; font-family: var(--mono); font-size: 8px; }
.channel-meta { grid-column: 2 / 4; display: flex; justify-content: space-between; margin-top: -5px; color: #8c9691; font-size: 7px; }
.journey-panel { margin-top: 14px; }
.model-chip { border: 1px solid var(--line); border-radius: 15px; padding: 5px 8px; color: var(--muted); font-family: var(--mono); font-size: 7px; }
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
th { padding: 9px 10px; border-bottom: 1px solid var(--line); color: #89928e; font-size: 7px; font-weight: 600; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 12px 10px; border-bottom: 1px solid #ecece6; font-size: 9px; }
tbody tr:last-child td { border-bottom: 0; }
.journey-path { display: flex; align-items: center; gap: 6px; }
.touch { display: inline-grid; place-items: center; min-width: 58px; border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 4px 6px; font-size: 7px; font-weight: 600; }
.path-arrow { color: #9ca49f; }
.positive { color: var(--green); font-weight: 700; }

.customer-hero, .pipeline-intro { display: flex; justify-content: space-between; align-items: center; padding: 23px 26px; border-radius: 10px; color: #edf6f1; background: var(--sidebar); }
.channel-hero { display: flex; justify-content: space-between; align-items: center; padding: 23px 26px; border-radius: 10px; color: #edf6f1; background: linear-gradient(110deg, #10231e, #164a3d); }
.channel-hero .section-kicker { color: var(--lime); }
.channel-hero h2 { margin: 5px 0 0; font-family: var(--serif); font-size: 27px; font-weight: 600; }
.channel-hero p { max-width: 620px; margin: 6px 0 0; color: #a9bbb5; font-size: 10px; line-height: 1.6; }
.channel-hero-total { min-width: 185px; padding-left: 26px; border-left: 1px solid #406159; }
.channel-hero-total span, .channel-hero-total strong, .channel-hero-total em { display: block; }
.channel-hero-total span { color: #9eb2aa; font-size: 8px; }
.channel-hero-total strong { margin-top: 4px; color: var(--lime); font-family: var(--serif); font-size: 27px; }
.channel-hero-total em { margin-top: 4px; color: #bad0c8; font-size: 7px; font-style: normal; }
.source-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 14px; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: #e9e9e3; }
.source-tab { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 10px 8px; font-size: 9px; font-weight: 600; cursor: pointer; transition: .2s ease; }
.source-tab:hover { color: var(--ink); }
.source-tab.active { background: var(--card); color: var(--green); box-shadow: 0 2px 7px rgba(21,35,31,.08); }
.source-content { margin-top: 14px; animation: fade .25s ease; }
.source-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.source-metric { min-height: 105px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.source-metric span, .source-metric strong, .source-metric small { display: block; }
.source-metric span { color: var(--muted); font-size: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.source-metric strong { margin-top: 8px; font-family: var(--serif); font-size: 24px; }
.source-metric small { margin-top: 6px; color: var(--green); font-family: var(--mono); font-size: 7px; }
.source-detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, .55fr); gap: 14px; margin-top: 14px; }
.source-table-panel, .source-insight-panel { padding: 20px; }
.source-table-panel h3, .source-insight-panel h3 { margin: 5px 0 0; font-family: var(--serif); font-size: 20px; }
.source-data-table td:first-child { font-weight: 600; }
.source-data-table .bar-cell { min-width: 135px; }
.source-data-table .bar-cell strong { display: block; margin-bottom: 5px; font-family: var(--mono); font-size: 8px; }
.mini-bar { width: 100%; height: 5px; border-radius: 5px; background: #e5e7e0; overflow: hidden; }
.mini-bar span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.source-insight-panel { color: #edf6f1; background: var(--green); border-color: var(--green); }
.source-insight-panel .section-kicker { color: var(--lime); }
.source-insight-panel p { color: #bfd5cd; font-size: 9px; line-height: 1.65; }
.source-insight-value { margin: 22px 0; padding: 16px 0; border-top: 1px solid rgba(255,255,255,.18); border-bottom: 1px solid rgba(255,255,255,.18); }
.source-insight-value span, .source-insight-value strong, .source-insight-value small { display: block; }
.source-insight-value span { color: #b8cec6; font-size: 7px; text-transform: uppercase; }
.source-insight-value strong { margin-top: 4px; color: var(--lime); font-family: var(--serif); font-size: 30px; }
.source-insight-value small { margin-top: 3px; color: #dce9e4; font-size: 7px; }
.source-insight-panel ul { margin: 0; padding: 0; list-style: none; }
.source-insight-panel li { position: relative; margin-top: 9px; padding-left: 14px; color: #d4e3de; font-size: 8px; line-height: 1.5; }
.source-insight-panel li::before { content: "✓"; position: absolute; left: 0; color: var(--lime); }
.customer-hero .section-kicker, .pipeline-intro .section-kicker { color: var(--lime); }
.customer-hero h2, .pipeline-intro h2 { font-size: 27px; }
.customer-hero p, .pipeline-intro p { max-width: 610px; margin: 6px 0 0; color: #a9bbb5; font-size: 10px; line-height: 1.6; }
.identity-score { text-align: right; padding-left: 30px; border-left: 1px solid #345048; }
.identity-score strong, .identity-score span { display: block; }
.identity-score strong { color: var(--lime); font-family: var(--serif); font-size: 29px; }
.identity-score span { color: #9eb2aa; font-size: 8px; }
.customer-layout { display: grid; grid-template-columns: 295px 1fr; gap: 14px; margin-top: 14px; }
.customer-list-panel { padding: 13px; }
.search-box { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 8px 9px; color: #88938e; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 9px; }
.customer-list { display: grid; gap: 5px; margin-top: 10px; }
.customer-item { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; padding: 9px; text-align: left; cursor: pointer; }
.customer-item:hover, .customer-item.active { border-color: #b7d5ca; background: #edf5f1; }
.customer-initials { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #dce6e1; color: var(--green); font-size: 8px; font-weight: 700; }
.customer-item strong, .customer-item span { display: block; }
.customer-item strong { font-size: 9px; }
.customer-item span { margin-top: 2px; color: var(--muted); font-size: 7px; }
.customer-value { font-family: var(--mono); font-size: 8px; }
.customer-detail { min-height: 500px; padding: 24px; }
.profile-head { display: flex; align-items: center; gap: 13px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.profile-avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--green); color: #fff; font-family: var(--serif); font-size: 17px; }
.profile-head h3 { margin: 0; font-family: var(--serif); font-size: 20px; }
.profile-head p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.profile-segment { margin-left: auto; border-radius: 15px; background: var(--green-light); color: var(--green); padding: 6px 9px; font-size: 7px; font-weight: 700; text-transform: uppercase; }
.profile-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 17px 0 25px; }
.profile-metric { padding: 11px; border-radius: 6px; background: #f0f1eb; }
.profile-metric span, .profile-metric strong { display: block; }
.profile-metric span { color: var(--muted); font-size: 7px; }
.profile-metric strong { margin-top: 3px; font-family: var(--serif); font-size: 16px; }
.timeline-title { font-family: var(--mono); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.timeline { position: relative; display: grid; gap: 17px; margin: 19px 0 0 9px; }
.timeline::before { content: ""; position: absolute; top: 4px; bottom: 8px; left: 5px; width: 1px; background: var(--line); }
.timeline-event { position: relative; display: grid; grid-template-columns: 12px 80px 1fr auto; align-items: start; gap: 10px; }
.event-dot { position: relative; z-index: 1; width: 11px; height: 11px; border: 3px solid var(--card); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.event-date { color: var(--muted); font-family: var(--mono); font-size: 7px; }
.event-copy strong, .event-copy span { display: block; }
.event-copy strong { font-size: 9px; }
.event-copy span { margin-top: 3px; color: var(--muted); font-size: 7px; }
.event-value { color: var(--green); font-family: var(--mono); font-size: 8px; font-weight: 500; }

.time-saved { min-width: 195px; padding-left: 26px; border-left: 1px solid #345048; }
.time-saved span, .time-saved strong, .time-saved em { display: block; }
.time-saved span { color: #9eb2aa; font-size: 8px; }
.time-saved strong { margin-top: 5px; font-family: var(--serif); font-size: 19px; }
.time-saved em { width: fit-content; margin-top: 5px; border-radius: 10px; background: var(--lime); color: var(--sidebar); padding: 3px 6px; font-size: 7px; font-style: normal; font-weight: 700; }
.pipeline-stage-labels { display: grid; grid-template-columns: 1.4fr .85fr .8fr; gap: 70px; margin: 27px 20px 9px; color: var(--muted); font-family: var(--mono); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.pipeline-map { display: grid; grid-template-columns: 1.4fr 65px .85fr 65px .8fr; align-items: center; gap: 14px; }
.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.source-card, .transform-card, .output-card { border: 1px solid var(--line); border-radius: 7px; background: var(--card); }
.source-card { min-height: 66px; display: flex; flex-direction: column; justify-content: space-between; padding: 10px; }
.source-top { display: flex; align-items: center; justify-content: space-between; }
.source-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; color: #fff; font-size: 8px; font-weight: 700; }
.source-check { color: var(--green); font-size: 9px; }
.source-card strong { font-size: 7px; }
.source-card small { color: var(--muted); font-size: 6px; }
.pipeline-arrow { color: var(--green); text-align: center; }
.pipeline-arrow span { display: block; color: var(--muted); font-family: var(--mono); font-size: 6px; }
.pipeline-arrow i { display: block; font-size: 25px; font-style: normal; }
.transform-stack, .output-stack { display: grid; gap: 9px; }
.transform-card, .output-card { display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 12px; }
.transform-card > span { color: var(--green); font-family: var(--mono); font-size: 8px; }
.transform-card strong, .transform-card small, .output-card strong, .output-card small { display: block; }
.transform-card strong, .output-card strong { font-size: 8px; }
.transform-card small, .output-card small { margin-top: 4px; color: var(--muted); font-size: 6px; line-height: 1.4; }
.output-card > span { color: var(--green); }
.output-card.featured { border-color: var(--green); background: var(--green); color: #fff; }
.output-card.featured small { color: #b9d4cb; }
.output-card.featured > span { color: var(--lime); }
.quality-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 27px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.quality-strip > div { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 14px 16px; border-right: 1px solid var(--line); }
.quality-strip > div:last-child { border-right: 0; }
.quality-strip span { grid-row: 1 / 3; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--green-light); color: var(--green); font-size: 9px; }
.quality-strip strong { font-size: 8px; }
.quality-strip small { color: var(--muted); font-size: 6px; }

.sql-layout { display: grid; grid-template-columns: .7fr 1.3fr; gap: 42px; align-items: start; padding: 20px 5px; }
.sql-copy { padding: 20px 0; }
.sql-copy h2 { max-width: 430px; margin-top: 9px; font-size: 35px; line-height: 1.08; }
.sql-copy > p { max-width: 430px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.logic-list { display: grid; gap: 14px; margin-top: 25px; }
.logic-list > div { display: flex; gap: 13px; }
.logic-list > div > span { display: grid; place-items: center; flex: 0 0 27px; height: 27px; border-radius: 50%; background: var(--green-light); color: var(--green); font-family: var(--mono); font-size: 7px; }
.logic-list strong { font-size: 9px; }
.logic-list p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.download-link { display: inline-flex; align-items: center; gap: 9px; margin-top: 25px; border-bottom: 1px solid var(--green); color: var(--green); padding-bottom: 3px; text-decoration: none; font-size: 9px; font-weight: 700; }
.code-window { overflow: hidden; border: 1px solid #30443e; border-radius: 11px; background: #13241f; box-shadow: 0 18px 35px rgba(16,35,30,.18); }
.code-top { height: 44px; display: flex; align-items: center; gap: 14px; padding: 0 16px; border-bottom: 1px solid #30443e; color: #93a69f; font-family: var(--mono); font-size: 8px; }
.window-dots { display: flex; gap: 5px; }
.window-dots i { width: 7px; height: 7px; border-radius: 50%; background: #475b54; }
.window-dots i:first-child { background: #ef7f56; }
.window-dots i:nth-child(2) { background: #e9c766; }
.window-dots i:nth-child(3) { background: #78ba8d; }
.code-top button { margin-left: auto; border: 1px solid #3d534b; border-radius: 4px; background: transparent; color: #c1d0cb; padding: 4px 8px; font-size: 7px; cursor: pointer; }
pre { min-height: 530px; margin: 0; padding: 25px; overflow: auto; color: #c7d4cf; font: 10px/1.8 var(--mono); tab-size: 2; }
.sql-keyword { color: #c7ed70; }
.sql-string { color: #f0a582; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 20; padding: 10px 14px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 9px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: none; }

body.presentation .sidebar { display: none; }
body.presentation .app-shell { grid-template-columns: 1fr; }
body.presentation .main { max-width: 1440px; width: 100%; margin: 0 auto; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 74px 1fr; }
  .sidebar { padding: 24px 11px; }
  .brand { justify-content: center; padding: 0; }
  .brand > span:last-child, .nav-item:not(.active)::after, .nav-item { font-size: 0; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-icon { font-size: 16px; }
  .sidebar-status, .sidebar-foot { display: none; }
  .main { padding: 0 24px 45px; }
  .pipeline-map { grid-template-columns: 1fr; }
  .pipeline-stage-labels, .pipeline-arrow { display: none; }
  .source-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; top: auto; bottom: 0; width: 100%; height: 62px; flex-direction: row; padding: 8px 12px; }
  .brand { display: none; }
  .nav { width: 100%; grid-template-columns: repeat(3, 1fr); margin: 0; gap: 4px; }
  .nav-item, .nav-item.active { flex-direction: column; gap: 2px; justify-content: center; box-shadow: none; font-size: 7px; padding: 5px; }
  .nav-icon { font-size: 14px; }
  .main { padding: 0 14px 90px; }
  .topbar { min-height: 96px; align-items: flex-start; padding-top: 17px; }
  h1 { font-size: 25px; }
  .header-actions { flex-direction: column; gap: 5px; }
  .select-wrap select, .present-button { width: 125px; padding-top: 7px; padding-bottom: 7px; font-size: 9px; }
  .insight-banner { grid-template-columns: auto 1fr; }
  .insight-banner button { grid-column: 2; justify-self: start; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid, .customer-layout, .sql-layout { grid-template-columns: 1fr; }
  .source-detail-grid { grid-template-columns: 1fr; }
  .source-summary { grid-template-columns: repeat(2, 1fr); }
  .journey-table-wrap { overflow-x: auto; }
  table { min-width: 620px; }
  .customer-hero, .pipeline-intro { align-items: flex-start; gap: 20px; }
  .channel-hero { align-items: flex-start; gap: 20px; }
  .customer-hero h2, .pipeline-intro h2 { font-size: 23px; }
  .identity-score, .time-saved { min-width: 120px; padding-left: 15px; }
  .source-grid { grid-template-columns: repeat(3, 1fr); }
  .quality-strip { grid-template-columns: repeat(2, 1fr); }
  .quality-strip > div:nth-child(2) { border-right: 0; }
  .quality-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .sql-copy h2 { font-size: 30px; }
  .source-tabs { display: flex; overflow-x: auto; }
  .source-tab { min-width: 104px; }
}

@media (max-width: 470px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 105px; }
  .chart-summary { gap: 15px; }
  .customer-hero, .pipeline-intro { display: block; }
  .channel-hero { display: block; }
  .channel-hero-total { margin-top: 17px; padding: 12px 0 0; border-top: 1px solid #406159; border-left: 0; }
  .source-summary { grid-template-columns: 1fr; }
  .identity-score, .time-saved { margin-top: 17px; padding: 12px 0 0; border-top: 1px solid #345048; border-left: 0; text-align: left; }
  .profile-metrics { grid-template-columns: repeat(2, 1fr); }
  .timeline-event { grid-template-columns: 12px 58px 1fr; }
  .event-value { grid-column: 3; }
  .source-grid { grid-template-columns: repeat(2, 1fr); }
}
