{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard-marketing",
  "type": "registry:component",
  "title": "Marketing Campaigns Dashboard",
  "description": "A campaign report with a KPI band, a sortable channel table with inline spend and ROAS bars, a flowing conversion funnel, budget burn rings with pacing, top regions and gradient creative thumbnails ranked by CTR.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "dashboards",
    "dashboard",
    "marketing",
    "campaigns",
    "funnel",
    "roas",
    "creatives"
  ],
  "docs": "https://hyperblur.dev/effects/dashboard-marketing",
  "files": [
    {
      "path": "registry/hyperblur/dashboard-marketing.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/dashboard-marketing.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type MarketingPeriod = \"7D\" | \"30D\" | \"QTD\";\n\nexport interface DashboardMarketingProps extends React.HTMLAttributes<HTMLDivElement> {\n  accent?: string;\n  brand?: string;\n  user?: string;\n  campaign?: string;\n  currency?: string;\n  period?: MarketingPeriod;\n  defaultPeriod?: MarketingPeriod;\n  onPeriodChange?: (period: MarketingPeriod) => void;\n}\n\nconst css = `\n.hb-yd4 {\n  --a: #ff6b57;\n  container: hb-yd4 / inline-size;\n  box-sizing: border-box;\n  width: 100%;\n  border: 1px solid #241f1f;\n  border-radius: 18px;\n  background:\n    radial-gradient(1000px 360px at 60% -12%, color-mix(in srgb, var(--a) 9%, transparent), transparent 70%),\n    #0b0a0a;\n  color: #eeeae8;\n  font-family: inherit;\n  font-size: 13px;\n  line-height: 1.4;\n  overflow: hidden;\n  position: relative;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-yd4 *, .hb-yd4 *::before, .hb-yd4 *::after { box-sizing: border-box; }\n.hb-yd4 button, .hb-yd4 input { font: inherit; color: inherit; }\n.hb-yd4 button:focus-visible, .hb-yd4 [tabindex]:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }\n.hb-yd4-app { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 720px; }\n.hb-yd4-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 12px; border-right: 1px solid rgba(255, 255, 255, .06); background: rgba(14, 12, 12, .8); }\n.hb-yd4-ws { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; }\n.hb-yd4-logo { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(140deg, var(--a), color-mix(in srgb, var(--a) 40%, #ffd166)); color: #1a0b07; box-shadow: 0 6px 18px -8px var(--a); }\n.hb-yd4-ws b { display: block; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }\n.hb-yd4-ws span { display: block; color: #85807d; font-size: 11.5px; }\n.hb-yd4-nav { display: flex; flex-direction: column; gap: 1px; margin: 0; padding: 0; list-style: none; }\n.hb-yd4-link { display: flex; align-items: center; gap: 10px; width: 100%; height: 33px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #a39e9b; font-size: 13px; text-align: left; cursor: pointer; transition: background .15s ease, color .15s ease; }\n.hb-yd4-link:hover { background: rgba(255, 255, 255, .04); color: #eeeae8; }\n.hb-yd4-link[aria-current=\"page\"] { background: rgba(255, 255, 255, .07); color: #ffffff; }\n.hb-yd4-link[aria-current=\"page\"] .hb-yd4-ico { color: var(--a); }\n.hb-yd4-sh { display: flex; align-items: center; justify-content: space-between; padding: 16px 10px 6px; color: #6f6a67; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }\n.hb-yd4-camp { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: #a39e9b; font-size: 12.5px; text-align: left; cursor: pointer; transition: background .15s ease, color .15s ease; }\n.hb-yd4-camp:hover { background: rgba(255, 255, 255, .04); color: #eeeae8; }\n.hb-yd4-camp[aria-current=\"true\"] { background: color-mix(in srgb, var(--a) 10%, transparent); color: #ffffff; }\n.hb-yd4-camp i { width: 8px; height: 8px; border-radius: 50%; }\n.hb-yd4-camp i[data-s=\"live\"] { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .14); }\n.hb-yd4-camp i[data-s=\"scheduled\"] { background: #fbbf24; }\n.hb-yd4-camp i[data-s=\"draft\"] { background: #57534f; }\n.hb-yd4-camp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.hb-yd4-camp em { color: #6f6a67; font-size: 11px; font-style: normal; font-variant-numeric: tabular-nums; }\n.hb-yd4-up { margin-top: auto; padding: 14px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--a) 16%, #141111), #121010 60%); }\n.hb-yd4-up b { display: block; font-size: 13px; font-weight: 600; }\n.hb-yd4-up p { margin: 4px 0 10px; color: #a39e9b; font-size: 12px; }\n.hb-yd4-up button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: #eeeae8; color: #141111; font-size: 12px; font-weight: 600; cursor: pointer; }\n.hb-yd4-main { display: flex; flex-direction: column; min-width: 0; }\n.hb-yd4-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid rgba(255, 255, 255, .06); }\n.hb-yd4-tt { min-width: 0; margin-right: auto; }\n.hb-yd4-crumb { color: #85807d; font-size: 12px; }\n.hb-yd4-tt h2 { display: flex; align-items: center; gap: 10px; margin: 2px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }\n.hb-yd4-live { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; background: rgba(74, 222, 128, .12); color: #4ade80; font-size: 11px; font-weight: 600; letter-spacing: 0; }\n.hb-yd4-live i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: hb-yd4-blink 1.4s ease-in-out infinite; }\n.hb-yd4-team { display: flex; }\n.hb-yd4-team span + span { margin-left: -8px; }\n.hb-yd4-av { display: grid; place-items: center; flex: none; border-radius: 50%; color: #ffffff; font-size: 10.5px; font-weight: 600; box-shadow: 0 0 0 2px #0b0a0a; }\n.hb-yd4-seg { display: inline-flex; padding: 3px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; background: rgba(0, 0, 0, .3); }\n.hb-yd4-seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: #85807d; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s ease, color .15s ease; }\n.hb-yd4-seg button:hover { color: #ffffff; }\n.hb-yd4-seg button[aria-pressed=\"true\"] { background: rgba(255, 255, 255, .1); color: #ffffff; }\n.hb-yd4-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border: 0; border-radius: 10px; background: var(--a); color: #1a0b07; font-size: 12.5px; font-weight: 650; cursor: pointer; box-shadow: 0 0 0 1px rgba(255, 255, 255, .2) inset; transition: filter .15s ease; }\n.hb-yd4-btn:hover { filter: brightness(1.08); }\n.hb-yd4-ico { display: block; flex: none; width: 16px; height: 16px; }\n.hb-yd4-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 20px 24px 24px; }\n.hb-yd4-card { position: relative; min-width: 0; padding: 18px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 16px; background: #121010; animation: hb-yd4-rise .6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--d, 0) * 70ms); }\n.hb-yd4-ch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }\n.hb-yd4-ct { margin: 0; font-size: 13.5px; font-weight: 600; }\n.hb-yd4-cs { margin: 2px 0 0; color: #85807d; font-size: 12px; }\n.hb-yd4-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; overflow: hidden; }\n.hb-yd4-band::before { content: \"\"; position: absolute; top: 0; right: 0; left: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--a), #ffd166, transparent); opacity: .8; }\n.hb-yd4-kpi { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; min-width: 0; padding: 18px; border-left: 1px solid rgba(255, 255, 255, .06); }\n.hb-yd4-kpi:first-child { border-left: 0; }\n.hb-yd4-kpi span { display: block; color: #85807d; font-size: 12px; }\n.hb-yd4-kpi b { display: block; margin: 6px 0 4px; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1; white-space: nowrap; }\n.hb-yd4-kpi small { font-size: 12px; font-weight: 600; }\n.hb-yd4-good { color: #4ade80; }\n.hb-yd4-bad { color: #f87171; }\n.hb-yd4-mb { display: flex; align-items: flex-end; gap: 3px; height: 36px; }\n.hb-yd4-mb i { width: 5px; height: var(--h); border-radius: 2px; background: rgba(255, 255, 255, .14); transform-origin: bottom; animation: hb-yd4-grow .6s cubic-bezier(.3, .7, .2, 1) both; }\n.hb-yd4-mb i:last-child { background: var(--a); }\n.hb-yd4-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }\n.hb-yd4-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }\n.hb-yd4-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }\n.hb-yd4-tbl th { padding: 0 8px 10px; color: #6f6a67; font-size: 11.5px; font-weight: 500; text-align: right; white-space: nowrap; }\n.hb-yd4-tbl th:first-child, .hb-yd4-tbl td:first-child { padding-left: 0; text-align: left; }\n.hb-yd4-tbl th:last-child, .hb-yd4-tbl td:last-child { padding-right: 0; }\n.hb-yd4-tbl th button { display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none; color: inherit; font-size: inherit; font-weight: inherit; cursor: pointer; }\n.hb-yd4-tbl th button:hover, .hb-yd4-tbl th[aria-sort] button { color: #eeeae8; }\n.hb-yd4-tbl th svg { width: 11px; height: 11px; }\n.hb-yd4-tbl td { padding: 10px 8px; border-top: 1px solid rgba(255, 255, 255, .05); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }\n.hb-yd4-tbl tbody tr { transition: background .15s ease; }\n.hb-yd4-tbl tbody tr:hover { background: rgba(255, 255, 255, .025); }\n.hb-yd4-tbl tfoot td { border-top: 1px solid rgba(255, 255, 255, .1); color: #a39e9b; font-weight: 600; }\n.hb-yd4-chn { display: flex; align-items: center; gap: 9px; }\n.hb-yd4-chn i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); font-size: 10px; font-style: normal; font-weight: 700; }\n.hb-yd4-chn b { font-weight: 500; }\n.hb-yd4-ib { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }\n.hb-yd4-ib s { position: relative; display: block; width: 56px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .06); overflow: hidden; text-decoration: none; }\n.hb-yd4-ib s::after { content: \"\"; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: var(--c, var(--a)); transform-origin: left; animation: hb-yd4-bar .9s cubic-bezier(.3, .7, .2, 1) both; animation-delay: inherit; }\n.hb-yd4-fun { position: relative; }\n.hb-yd4-fun svg { display: block; width: 100%; height: 150px; overflow: visible; }\n.hb-yd4-fun-a { animation: hb-yd4-wipe 1.1s .2s cubic-bezier(.3, .7, .2, 1) both; }\n.hb-yd4-fun-band { fill: rgba(255, 255, 255, 0); transition: fill .15s ease; cursor: pointer; }\n.hb-yd4-fun-band[data-on=\"true\"] { fill: rgba(255, 255, 255, .04); }\n.hb-yd4-fun-sep { stroke: rgba(255, 255, 255, .12); stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }\n.hb-yd4-fl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 10px; }\n.hb-yd4-fl button { min-width: 0; padding: 6px 4px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; transition: background .15s ease; }\n.hb-yd4-fl button[aria-pressed=\"true\"], .hb-yd4-fl button:hover { background: rgba(255, 255, 255, .05); }\n.hb-yd4-fl span { display: block; overflow: hidden; color: #85807d; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }\n.hb-yd4-fl b { display: block; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }\n.hb-yd4-fl em { display: block; color: var(--a); font-size: 11px; font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }\n.hb-yd4-fsum { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .06); color: #85807d; font-size: 12px; }\n.hb-yd4-fsum b { color: #eeeae8; font-weight: 600; }\n.hb-yd4-burn { display: grid; grid-template-columns: 168px minmax(0, 1fr); align-items: center; gap: 20px; }\n.hb-yd4-rings { position: relative; width: 168px; height: 168px; }\n.hb-yd4-rings svg { width: 100%; height: 100%; transform: rotate(-90deg); }\n.hb-yd4-rings circle { fill: none; stroke-width: 9; stroke-linecap: round; }\n.hb-yd4-rt { stroke: rgba(255, 255, 255, .06); }\n.hb-yd4-rv { animation: hb-yd4-arc 1.2s cubic-bezier(.3, .7, .2, 1) both; transition: opacity .2s ease; }\n.hb-yd4-rv[data-dim=\"true\"] { opacity: .3; }\n.hb-yd4-rc { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }\n.hb-yd4-rc b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }\n.hb-yd4-rc span { color: #85807d; font-size: 11px; }\n.hb-yd4-bl { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }\n.hb-yd4-bl li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; margin: 0 -8px; border-radius: 10px; cursor: default; transition: background .15s ease; }\n.hb-yd4-bl li:hover { background: rgba(255, 255, 255, .04); }\n.hb-yd4-bl i { width: 10px; height: 10px; border-radius: 50%; }\n.hb-yd4-bl b { display: block; font-size: 12.5px; font-weight: 500; }\n.hb-yd4-bl span { display: block; color: #85807d; font-size: 11.5px; font-variant-numeric: tabular-nums; }\n.hb-yd4-pace { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }\n.hb-yd4-pace[data-p=\"on\"] { background: rgba(74, 222, 128, .12); color: #4ade80; }\n.hb-yd4-pace[data-p=\"over\"] { background: rgba(248, 113, 113, .12); color: #f87171; }\n.hb-yd4-pace[data-p=\"under\"] { background: rgba(251, 191, 36, .12); color: #fbbf24; }\n.hb-yd4-burn-f { margin-top: 12px; color: #85807d; font-size: 12px; }\n.hb-yd4-burn-f b { color: #eeeae8; font-weight: 600; }\n.hb-yd4-geo { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }\n.hb-yd4-geo li { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1.2fr) 56px; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 9px; transition: background .15s ease; }\n.hb-yd4-geo li:hover { background: rgba(255, 255, 255, .04); }\n.hb-yd4-cc { display: grid; place-items: center; height: 22px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 6px; background: rgba(255, 255, 255, .03); color: #c9c4c1; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; }\n.hb-yd4-gn { min-width: 0; overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }\n.hb-yd4-gb { position: relative; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .05); overflow: hidden; }\n.hb-yd4-gb i { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--a) 50%, transparent), var(--a)); transform-origin: left; animation: hb-yd4-bar .9s cubic-bezier(.3, .7, .2, 1) both; }\n.hb-yd4-gv { font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }\n.hb-yd4-gv span { display: block; color: #6f6a67; font-size: 11px; }\n.hb-yd4-crs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }\n.hb-yd4-cr { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 0; border: 1px solid rgba(255, 255, 255, .07); border-radius: 14px; background: #0e0c0c; overflow: hidden; text-align: left; cursor: pointer; animation: hb-yd4-rise .5s cubic-bezier(.2, .7, .2, 1) both; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }\n.hb-yd4-cr:hover, .hb-yd4-cr:focus-visible { border-color: rgba(255, 255, 255, .18); box-shadow: 0 18px 36px -18px rgba(0, 0, 0, .9); transform: translateY(-3px); }\n.hb-yd4-art { position: relative; aspect-ratio: 4 / 5; overflow: hidden; }\n.hb-yd4-art::after { content: \"\"; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .22) 50%, transparent 65%); transform: translateX(-120%); transition: transform .7s ease; }\n.hb-yd4-cr:hover .hb-yd4-art::after { transform: translateX(120%); }\n.hb-yd4-art-t { position: absolute; right: 10px; bottom: 10px; left: 10px; color: #ffffff; font-size: 13px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }\n.hb-yd4-art-t small { display: block; margin-bottom: 4px; font-size: 9.5px; font-weight: 600; letter-spacing: .12em; opacity: .85; text-transform: uppercase; }\n.hb-yd4-fmt { position: absolute; top: 8px; left: 8px; padding: 2px 6px; border-radius: 5px; background: rgba(0, 0, 0, .45); color: #ffffff; font-size: 10px; font-weight: 600; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }\n.hb-yd4-win { position: absolute; top: 8px; right: 8px; padding: 2px 6px; border-radius: 5px; background: #ffd166; color: #1a1205; font-size: 10px; font-weight: 700; }\n.hb-yd4-crm { display: flex; flex-direction: column; gap: 2px; padding: 10px 11px 11px; }\n.hb-yd4-crm b { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }\n.hb-yd4-crm span { display: flex; justify-content: space-between; gap: 6px; color: #85807d; font-size: 11px; font-variant-numeric: tabular-nums; }\n.hb-yd4-crm span em { color: #eeeae8; font-style: normal; font-weight: 600; }\n.hb-yd4-st { display: inline-flex; align-items: center; gap: 4px; }\n.hb-yd4-st::before { content: \"\"; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }\n@keyframes hb-yd4-rise { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }\n@keyframes hb-yd4-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }\n@keyframes hb-yd4-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }\n@keyframes hb-yd4-arc { from { stroke-dasharray: 0 100; } }\n@keyframes hb-yd4-wipe { from { clip-path: inset(-10px 100% -10px -10px); } to { clip-path: inset(-10px -10px -10px -10px); } }\n@keyframes hb-yd4-blink { 50% { opacity: .35; } }\n@container hb-yd4 (max-width: 1099px) {\n  .hb-yd4-crs { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n}\n@container hb-yd4 (max-width: 999px) {\n  .hb-yd4-row, .hb-yd4-row2 { grid-template-columns: minmax(0, 1fr); }\n  .hb-yd4-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n  .hb-yd4-kpi:nth-child(3) { border-left: 0; }\n  .hb-yd4-kpi:nth-child(n + 3) { border-top: 1px solid rgba(255, 255, 255, .06); }\n}\n@container hb-yd4 (max-width: 759px) {\n  .hb-yd4-app { grid-template-columns: minmax(0, 1fr); min-height: 0; }\n  .hb-yd4-side { flex-direction: row; align-items: center; gap: 4px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .06); overflow-x: auto; }\n  .hb-yd4-ws { padding: 0 8px 0 0; }\n  .hb-yd4-ws div, .hb-yd4-sh, .hb-yd4-camps, .hb-yd4-up, .hb-yd4-link-t { display: none; }\n  .hb-yd4-nav { flex-direction: row; gap: 4px; }\n  .hb-yd4-link { justify-content: center; width: 34px; padding: 0; }\n  .hb-yd4-top { padding: 16px; }\n  .hb-yd4-team { display: none; }\n  .hb-yd4-content { padding: 16px; }\n  .hb-yd4-hide-sm { display: none; }\n  .hb-yd4-burn { grid-template-columns: minmax(0, 1fr); justify-items: center; }\n  .hb-yd4-bl { width: 100%; }\n}\n@container hb-yd4 (max-width: 479px) {\n  .hb-yd4-band { grid-template-columns: minmax(0, 1fr); }\n  .hb-yd4-kpi { border-left: 0; }\n  .hb-yd4-kpi:nth-child(n + 2) { border-top: 1px solid rgba(255, 255, 255, .06); }\n  .hb-yd4-crs { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n  .hb-yd4-hide-xs { display: none; }\n  .hb-yd4-geo li { grid-template-columns: 30px minmax(0, 1fr) 56px; }\n  .hb-yd4-gb { display: none; }\n  .hb-yd4-fl b { font-size: 12px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-yd4 *, .hb-yd4 *::before, .hb-yd4 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nfunction hash(n: number) {\n  let x = Math.imul(n + 1, 2654435761) >>> 0;\n  x ^= x >>> 15;\n  x = Math.imul(x, 2246822519) >>> 0;\n  x ^= x >>> 13;\n  return (x >>> 0) / 4294967296;\n}\n\nfunction tone(name: string) {\n  let h = 0;\n  for (let i = 0; i < name.length; i++) h = (h * 31 + name.charCodeAt(i)) >>> 0;\n  const hue = h % 360;\n  return `linear-gradient(135deg, hsl(${hue} 62% 56%), hsl(${(hue + 44) % 360} 58% 38%))`;\n}\n\nfunction initials(name: string) {\n  return name\n    .split(\" \")\n    .map((w) => w[0])\n    .slice(0, 2)\n    .join(\"\")\n    .toUpperCase();\n}\n\nconst icons: Record<string, string[]> = {\n  grid: [\"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z\"],\n  mega: [\"M3 11v2a1 1 0 0 0 1 1h3l6 4V6L7 10H4a1 1 0 0 0-1 1z\", \"M17 9a4 4 0 0 1 0 6\", \"M20 6a8 8 0 0 1 0 12\"],\n  users: [\"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2\", \"M9 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8z\", \"M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75\"],\n  image: [\"M3 4h18v16H3z\", \"M8.5 8a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z\", \"M21 15l-5-5L5 20\"],\n  chart: [\"M3 3v18h18\", \"M7 15l4-4 3 3 5-6\"],\n  plug: [\"M9 2v6M15 2v6\", \"M6 8h12v4a6 6 0 0 1-12 0z\", \"M12 18v4\"],\n  share: [\"M4 12v8h16v-8\", \"M16 6l-4-4-4 4\", \"M12 2v13\"],\n  sort: [\"M8 10l4-4 4 4\", \"M8 14l4 4 4-4\"],\n  sortd: [\"M8 10l4 4 4-4\"],\n  sortu: [\"M8 14l4-4 4 4\"],\n};\n\nfunction Ico({ n, className = \"hb-yd4-ico\" }: { n: string; className?: string }) {\n  return (\n    <svg className={className} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      {(icons[n] ?? []).map((d, i) => (\n        <path key={i} d={d} />\n      ))}\n    </svg>\n  );\n}\n\nconst PERIODS: MarketingPeriod[] = [\"7D\", \"30D\", \"QTD\"];\nconst SCALE: Record<MarketingPeriod, number> = { \"7D\": 0.24, \"30D\": 1, QTD: 1.38 };\nconst RANGE_LABEL: Record<MarketingPeriod, string> = { \"7D\": \"Oct 29 to Nov 4\", \"30D\": \"Oct 6 to Nov 4\", QTD: \"Oct 1 to Nov 4\" };\n\nconst CHANNELS = [\n  { name: \"Paid search\", code: \"PS\", color: \"#ff6b57\", spend: 14820, impr: 612000, clicks: 31400, conv: 1412, revenue: 71600 },\n  { name: \"Paid social\", code: \"SO\", color: \"#c084fc\", spend: 12260, impr: 1480000, clicks: 28900, conv: 986, revenue: 49800 },\n  { name: \"Email\", code: \"EM\", color: \"#4ade80\", spend: 1940, impr: 96000, clicks: 18300, conv: 1128, revenue: 46200 },\n  { name: \"Affiliates\", code: \"AF\", color: \"#ffd166\", spend: 6410, impr: 210000, clicks: 7800, conv: 402, revenue: 24100 },\n  { name: \"Display\", code: \"DI\", color: \"#7fb3ff\", spend: 8150, impr: 640000, clicks: 4600, conv: 158, revenue: 7900 },\n  { name: \"Podcasts\", code: \"PO\", color: \"#f472b6\", spend: 4620, impr: 90000, clicks: 1400, conv: 211, revenue: 15300 },\n];\n\nconst FUNNEL = [\n  { name: \"Impressions\", base: 3128000 },\n  { name: \"Clicks\", base: 92400 },\n  { name: \"Sessions\", base: 81700 },\n  { name: \"Sign-ups\", base: 9860 },\n  { name: \"Purchases\", base: 4297 },\n];\n\nconst BUDGETS = [\n  { name: \"Paid search\", spent: 14820, budget: 22000, color: \"#ff6b57\" },\n  { name: \"Paid social\", spent: 12260, budget: 16000, color: \"#c084fc\" },\n  { name: \"Everything else\", spent: 21120, budget: 36000, color: \"#ffd166\" },\n];\nconst MONTH_ELAPSED = 0.62;\n\nconst GEO = [\n  { code: \"US\", name: \"United States\", share: 38.2, conv: 1663 },\n  { code: \"GB\", name: \"United Kingdom\", share: 13.9, conv: 605 },\n  { code: \"DE\", name: \"Germany\", share: 10.7, conv: 466 },\n  { code: \"CA\", name: \"Canada\", share: 8.6, conv: 374 },\n  { code: \"AU\", name: \"Australia\", share: 7.1, conv: 309 },\n  { code: \"FR\", name: \"France\", share: 5.8, conv: 252 },\n  { code: \"BR\", name: \"Brazil\", share: 4.9, conv: 213 },\n];\n\nconst CREATIVES = [\n  { title: \"Gifts they will actually use\", kicker: \"Holiday edit\", fmt: \"1:1\", channel: \"Paid social\", ctr: 3.84, spend: 4210, status: \"Winning\", art: \"radial-gradient(circle at 75% 25%, #ffd166 0 16%, transparent 17%), radial-gradient(circle at 20% 80%, rgba(255,255,255,.18) 0 22%, transparent 23%), linear-gradient(160deg, #ff6b57, #c2185b)\" },\n  { title: \"Wrap up 30% off\", kicker: \"Ends Sunday\", fmt: \"9:16\", channel: \"Stories\", ctr: 2.91, spend: 3380, status: \"Learning\", art: \"repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 10px, transparent 10px 20px), linear-gradient(200deg, #7c3aed, #0ea5e9)\" },\n  { title: \"The cozy collection is back\", kicker: \"New arrivals\", fmt: \"4:5\", channel: \"Paid social\", ctr: 2.47, spend: 2960, status: \"Learning\", art: \"radial-gradient(120% 80% at 50% 110%, #fb923c 0 35%, transparent 36%), radial-gradient(circle at 30% 30%, #fde68a 0 10%, transparent 11%), linear-gradient(180deg, #1e293b, #334155)\" },\n  { title: \"Free shipping on every order\", kicker: \"Search ad\", fmt: \"Banner\", channel: \"Display\", ctr: 0.71, spend: 2140, status: \"Paused\", art: \"linear-gradient(90deg, rgba(0,0,0,.25) 0 1px, transparent 1px) 0 0 / 18px 18px, linear-gradient(0deg, rgba(0,0,0,.25) 0 1px, transparent 1px) 0 0 / 18px 18px, linear-gradient(135deg, #22c55e, #065f46)\" },\n  { title: \"Your cart misses you\", kicker: \"Retargeting\", fmt: \"1:1\", channel: \"Email\", ctr: 5.12, spend: 380, status: \"Winning\", art: \"radial-gradient(circle at 50% 45%, #fff1f2 0 18%, #fda4af 19% 30%, transparent 31%), linear-gradient(150deg, #be123c, #4c0519)\" },\n  { title: \"Build the perfect bundle\", kicker: \"Gift guide\", fmt: \"16:9\", channel: \"Podcasts\", ctr: 1.96, spend: 1720, status: \"Learning\", art: \"conic-gradient(from 200deg at 70% 60%, #ffd166, #ff6b57, #c084fc, #7fb3ff, #ffd166)\" },\n];\nconst STATUS_COLOR: Record<string, string> = { Winning: \"#4ade80\", Learning: \"#fbbf24\", Paused: \"#85807d\" };\n\nconst CAMPAIGNS = [\n  { name: \"Holiday Launch 2026\", s: \"live\", n: \"$48K\" },\n  { name: \"Black Friday Retargeting\", s: \"live\", n: \"$19K\" },\n  { name: \"Brand Search Always-on\", s: \"live\", n: \"$11K\" },\n  { name: \"Winter Newsletter\", s: \"scheduled\", n: \"Nov 12\" },\n  { name: \"Spring Teaser\", s: \"draft\", n: \"Draft\" },\n];\n\nconst NAV = [\n  { id: \"overview\", label: \"Overview\", icon: \"grid\" },\n  { id: \"campaigns\", label: \"Campaigns\", icon: \"mega\" },\n  { id: \"audiences\", label: \"Audiences\", icon: \"users\" },\n  { id: \"creatives\", label: \"Creatives\", icon: \"image\" },\n  { id: \"reports\", label: \"Reports\", icon: \"chart\" },\n  { id: \"integrations\", label: \"Integrations\", icon: \"plug\" },\n];\n\ntype SortKey = \"spend\" | \"conv\" | \"roas\";\n\nfunction fmtK(n: number, cur = \"\") {\n  if (n >= 1000000) return `${cur}${(n / 1000000).toFixed(2)}M`;\n  if (n >= 10000) return `${cur}${(n / 1000).toFixed(1)}K`;\n  return `${cur}${Math.round(n).toLocaleString(\"en-US\")}`;\n}\n\nexport function DashboardMarketing({\n  accent = \"#ff6b57\",\n  brand = \"Flare\",\n  user = \"Daniel Brooks\",\n  campaign = \"Holiday Launch 2026\",\n  currency = \"$\",\n  period,\n  defaultPeriod = \"30D\",\n  onPeriodChange,\n  className = \"\",\n  style,\n  ...rest\n}: DashboardMarketingProps) {\n  const uid = React.useId().replace(/:/g, \"\");\n  const [innerPeriod, setInnerPeriod] = React.useState<MarketingPeriod>(defaultPeriod);\n  const [nav, setNav] = React.useState(\"campaigns\");\n  const [camp, setCamp] = React.useState(0);\n  const [stage, setStage] = React.useState<number | null>(null);\n  const [ring, setRing] = React.useState<number | null>(null);\n  const [sort, setSort] = React.useState<{ key: SortKey; desc: boolean }>({ key: \"spend\", desc: true });\n  const p = period ?? innerPeriod;\n  const k = SCALE[p];\n\n  const pickPeriod = (next: MarketingPeriod) => {\n    setInnerPeriod(next);\n    setStage(null);\n    onPeriodChange?.(next);\n  };\n\n  const pi = PERIODS.indexOf(p);\n  const rows = CHANNELS.map((c, i) => {\n    const wobble = 1 + (hash(i * 11 + pi * 5) - 0.5) * 0.12;\n    const spend = c.spend * k;\n    const clicks = c.clicks * k * wobble;\n    const conv = c.conv * k * wobble;\n    const revenue = c.revenue * k * wobble;\n    return { ...c, spend, clicks, conv, revenue, impr: c.impr * k, ctr: (clicks / (c.impr * k)) * 100, cpa: spend / conv, roas: revenue / spend };\n  });\n  const sorted = [...rows].sort((a, b) => (sort.desc ? b[sort.key] - a[sort.key] : a[sort.key] - b[sort.key]));\n  const toggleSort = (key: SortKey) => setSort((s) => (s.key === key ? { key, desc: !s.desc } : { key, desc: true }));\n  const spendT = rows.reduce((s, r) => s + r.spend, 0);\n  const imprT = rows.reduce((s, r) => s + r.impr, 0);\n  const clicksT = rows.reduce((s, r) => s + r.clicks, 0);\n  const convT = rows.reduce((s, r) => s + r.conv, 0);\n  const revT = rows.reduce((s, r) => s + r.revenue, 0);\n  const maxSpend = Math.max(...rows.map((r) => r.spend));\n  const maxRoas = Math.max(...rows.map((r) => r.roas));\n\n  const kpis = [\n    { label: \"Spend\", value: fmtK(spendT, currency), delta: \"+12.4%\", good: true, seed: 1 },\n    { label: \"Impressions\", value: fmtK(imprT), delta: \"+18.1%\", good: true, seed: 2 },\n    { label: \"Conversions\", value: fmtK(convT), delta: \"+9.7%\", good: true, seed: 3 },\n    { label: \"ROAS\", value: `${(revT / spendT).toFixed(2)}x`, delta: \"-0.3x\", good: false, seed: 4 },\n  ];\n\n  const funnel = FUNNEL.map((f, i) => ({ ...f, value: f.base * k * (i === 0 ? 1 : 1 + (hash(i + pi * 9) - 0.5) * 0.06) }));\n  const logMax = Math.log10(funnel[0].value);\n  const logMin = Math.log10(funnel[funnel.length - 1].value) - 0.6;\n  const fh = funnel.map((f) => 16 + ((Math.log10(f.value) - logMin) / (logMax - logMin)) * 84);\n  const fx = funnel.map((_, i) => (i + 0.5) * 20);\n  let ftop = `M0 ${(50 - fh[0] / 2).toFixed(2)}L${fx[0].toFixed(2)} ${(50 - fh[0] / 2).toFixed(2)}`;\n  let fbot = \"\";\n  for (let i = 0; i < fh.length - 1; i++) {\n    const mx = (fx[i] + fx[i + 1]) / 2;\n    ftop += `C${mx.toFixed(2)} ${(50 - fh[i] / 2).toFixed(2)} ${mx.toFixed(2)} ${(50 - fh[i + 1] / 2).toFixed(2)} ${fx[i + 1].toFixed(2)} ${(50 - fh[i + 1] / 2).toFixed(2)}`;\n  }\n  ftop += `L100 ${(50 - fh[fh.length - 1] / 2).toFixed(2)}L100 ${(50 + fh[fh.length - 1] / 2).toFixed(2)}L${fx[fh.length - 1].toFixed(2)} ${(50 + fh[fh.length - 1] / 2).toFixed(2)}`;\n  for (let i = fh.length - 1; i > 0; i--) {\n    const mx = (fx[i] + fx[i - 1]) / 2;\n    fbot += `C${mx.toFixed(2)} ${(50 + fh[i] / 2).toFixed(2)} ${mx.toFixed(2)} ${(50 + fh[i - 1] / 2).toFixed(2)} ${fx[i - 1].toFixed(2)} ${(50 + fh[i - 1] / 2).toFixed(2)}`;\n  }\n  const fpath = `${ftop}${fbot}L0 ${(50 + fh[0] / 2).toFixed(2)}Z`;\n\n  const radii = [44, 33, 22];\n  const spentAll = BUDGETS.reduce((s, b) => s + b.spent, 0);\n  const budgetAll = BUDGETS.reduce((s, b) => s + b.budget, 0);\n\n  const vars = { \"--a\": accent, ...style } as React.CSSProperties;\n  const sortIco = (key: SortKey) => <Ico n={sort.key === key ? (sort.desc ? \"sortd\" : \"sortu\") : \"sort\"} className=\"\" />;\n  const ariaSort = (key: SortKey) => (sort.key === key ? (sort.desc ? \"descending\" : \"ascending\") : undefined);\n\n  return (\n    <div className={`hb-yd4 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-dashboard-marketing\" precedence=\"default\">\n        {css}\n      </style>\n      <div className=\"hb-yd4-app\">\n        <aside className=\"hb-yd4-side\">\n          <div className=\"hb-yd4-ws\">\n            <span className=\"hb-yd4-logo\" aria-hidden=\"true\">\n              <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                <path d=\"M12 2c1 4 5 5 5 10a5 5 0 0 1-10 0c0-2 1-3 2-4 0 2 1 3 2 3 0-3-1-6 1-9z\" />\n              </svg>\n            </span>\n            <div>\n              <b>{brand}</b>\n              <span>Growth team</span>\n            </div>\n          </div>\n          <nav aria-label=\"Main\">\n            <ul className=\"hb-yd4-nav\">\n              {NAV.map((item) => (\n                <li key={item.id}>\n                  <button type=\"button\" className=\"hb-yd4-link\" aria-label={item.label} aria-current={nav === item.id ? \"page\" : undefined} onClick={() => setNav(item.id)}>\n                    <Ico n={item.icon} />\n                    <span className=\"hb-yd4-link-t\">{item.label}</span>\n                  </button>\n                </li>\n              ))}\n            </ul>\n          </nav>\n          <div className=\"hb-yd4-sh\">\n            <span>Campaigns</span>\n            <span>{CAMPAIGNS.length}</span>\n          </div>\n          <ul className=\"hb-yd4-nav hb-yd4-camps\">\n            {CAMPAIGNS.map((c, i) => (\n              <li key={c.name}>\n                <button type=\"button\" className=\"hb-yd4-camp\" aria-current={camp === i ? \"true\" : undefined} onClick={() => setCamp(i)}>\n                  <i data-s={c.s} title={c.s} />\n                  <span>{i === 0 ? campaign : c.name}</span>\n                  <em>{c.n}</em>\n                </button>\n              </li>\n            ))}\n          </ul>\n          <div className=\"hb-yd4-up\">\n            <b>Weekly digest</b>\n            <p>Send this report to the growth channel every Monday at 9:00.</p>\n            <button type=\"button\">Schedule</button>\n          </div>\n        </aside>\n\n        <div className=\"hb-yd4-main\">\n          <header className=\"hb-yd4-top\">\n            <div className=\"hb-yd4-tt\">\n              <div className=\"hb-yd4-crumb\">Campaigns · {RANGE_LABEL[p]}</div>\n              <h2>\n                {camp === 0 ? campaign : CAMPAIGNS[camp].name}\n                <span className=\"hb-yd4-live\">\n                  <i />\n                  Live\n                </span>\n              </h2>\n            </div>\n            <div className=\"hb-yd4-team\" aria-label=\"Collaborators\">\n              {[user, \"Yara Haddad\", \"Leo Okafor\"].map((n) => (\n                <span key={n} className=\"hb-yd4-av\" style={{ width: 28, height: 28, background: tone(n) }} title={n}>\n                  {initials(n)}\n                </span>\n              ))}\n            </div>\n            <div className=\"hb-yd4-seg\" role=\"group\" aria-label=\"Period\">\n              {PERIODS.map((x) => (\n                <button key={x} type=\"button\" aria-pressed={p === x} onClick={() => pickPeriod(x)}>\n                  {x}\n                </button>\n              ))}\n            </div>\n            <button type=\"button\" className=\"hb-yd4-btn\">\n              <Ico n=\"share\" />\n              Share report\n            </button>\n          </header>\n\n          <div className=\"hb-yd4-content\">\n            <section className=\"hb-yd4-card hb-yd4-band\" aria-label=\"Campaign totals\" style={{ \"--d\": 0 } as React.CSSProperties}>\n              {kpis.map((m) => (\n                <div className=\"hb-yd4-kpi\" key={m.label}>\n                  <div>\n                    <span>{m.label}</span>\n                    <b>{m.value}</b>\n                    <small className={m.good ? \"hb-yd4-good\" : \"hb-yd4-bad\"}>{m.delta} vs previous</small>\n                  </div>\n                  <div className=\"hb-yd4-mb\" aria-hidden=\"true\" key={p}>\n                    {Array.from({ length: 8 }, (_, j) => (\n                      <i key={j} style={{ \"--h\": `${(30 + j * 6 + hash(m.seed * 40 + j + pi * 7) * 30).toFixed(0)}%`, animationDelay: `${200 + j * 40}ms` } as React.CSSProperties} />\n                    ))}\n                  </div>\n                </div>\n              ))}\n            </section>\n\n            <div className=\"hb-yd4-row\">\n              <section className=\"hb-yd4-card\" style={{ \"--d\": 1 } as React.CSSProperties} aria-label=\"Channel performance\">\n                <div className=\"hb-yd4-ch\">\n                  <div>\n                    <h3 className=\"hb-yd4-ct\">Channel performance</h3>\n                    <p className=\"hb-yd4-cs\">Last-click attribution, {RANGE_LABEL[p]}</p>\n                  </div>\n                </div>\n                <table className=\"hb-yd4-tbl\">\n                  <thead>\n                    <tr>\n                      <th scope=\"col\">Channel</th>\n                      <th scope=\"col\" aria-sort={ariaSort(\"spend\")}>\n                        <button type=\"button\" onClick={() => toggleSort(\"spend\")}>\n                          Spend\n                          {sortIco(\"spend\")}\n                        </button>\n                      </th>\n                      <th scope=\"col\" className=\"hb-yd4-hide-xs\">\n                        CTR\n                      </th>\n                      <th scope=\"col\" className=\"hb-yd4-hide-sm\" aria-sort={ariaSort(\"conv\")}>\n                        <button type=\"button\" onClick={() => toggleSort(\"conv\")}>\n                          Conv.\n                          {sortIco(\"conv\")}\n                        </button>\n                      </th>\n                      <th scope=\"col\" className=\"hb-yd4-hide-sm\">\n                        CPA\n                      </th>\n                      <th scope=\"col\" aria-sort={ariaSort(\"roas\")}>\n                        <button type=\"button\" onClick={() => toggleSort(\"roas\")}>\n                          ROAS\n                          {sortIco(\"roas\")}\n                        </button>\n                      </th>\n                    </tr>\n                  </thead>\n                  <tbody key={p}>\n                    {sorted.map((r, i) => (\n                      <tr key={r.name}>\n                        <td>\n                          <span className=\"hb-yd4-chn\" style={{ \"--c\": r.color } as React.CSSProperties}>\n                            <i>{r.code}</i>\n                            <b>{r.name}</b>\n                          </span>\n                        </td>\n                        <td>\n                          <span className=\"hb-yd4-ib\">\n                            <s className=\"hb-yd4-hide-xs\" style={{ \"--w\": `${((r.spend / maxSpend) * 100).toFixed(1)}%`, \"--c\": r.color, animationDelay: `${i * 60}ms` } as React.CSSProperties} />\n                            {fmtK(r.spend, currency)}\n                          </span>\n                        </td>\n                        <td className=\"hb-yd4-hide-xs\">{r.ctr.toFixed(2)}%</td>\n                        <td className=\"hb-yd4-hide-sm\">{Math.round(r.conv).toLocaleString(\"en-US\")}</td>\n                        <td className=\"hb-yd4-hide-sm\">\n                          {currency}\n                          {r.cpa.toFixed(2)}\n                        </td>\n                        <td>\n                          <span className=\"hb-yd4-ib\">\n                            <s className=\"hb-yd4-hide-xs\" style={{ \"--w\": `${((r.roas / maxRoas) * 100).toFixed(1)}%`, \"--c\": r.roas >= 3 ? \"#4ade80\" : r.roas >= 1.5 ? \"#ffd166\" : \"#f87171\", animationDelay: `${i * 60 + 120}ms` } as React.CSSProperties} />\n                            <span className={r.roas >= 3 ? \"hb-yd4-good\" : r.roas < 1.5 ? \"hb-yd4-bad\" : undefined}>{r.roas.toFixed(1)}x</span>\n                          </span>\n                        </td>\n                      </tr>\n                    ))}\n                  </tbody>\n                  <tfoot>\n                    <tr>\n                      <td>Total</td>\n                      <td>{fmtK(spendT, currency)}</td>\n                      <td className=\"hb-yd4-hide-xs\">{((clicksT / imprT) * 100).toFixed(2)}%</td>\n                      <td className=\"hb-yd4-hide-sm\">{Math.round(convT).toLocaleString(\"en-US\")}</td>\n                      <td className=\"hb-yd4-hide-sm\">\n                        {currency}\n                        {(spendT / convT).toFixed(2)}\n                      </td>\n                      <td>{(revT / spendT).toFixed(1)}x</td>\n                    </tr>\n                  </tfoot>\n                </table>\n              </section>\n\n              <section className=\"hb-yd4-card\" style={{ \"--d\": 2 } as React.CSSProperties} aria-label=\"Conversion funnel\">\n                <div className=\"hb-yd4-ch\">\n                  <div>\n                    <h3 className=\"hb-yd4-ct\">Conversion funnel</h3>\n                    <p className=\"hb-yd4-cs\">From first view to purchase, log scale</p>\n                  </div>\n                </div>\n                <div className=\"hb-yd4-fun\" onPointerLeave={() => setStage(null)}>\n                  <svg key={p} viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" role=\"img\" aria-label={`Funnel: ${funnel.map((f) => `${f.name} ${Math.round(f.value)}`).join(\", \")}`}>\n                    <defs>\n                      <linearGradient id={`${uid}f`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n                        <stop offset=\"0\" stopColor=\"var(--a)\" stopOpacity=\".95\" />\n                        <stop offset=\".6\" stopColor=\"color-mix(in srgb, var(--a) 60%, #ffd166)\" stopOpacity=\".8\" />\n                        <stop offset=\"1\" stopColor=\"#ffd166\" stopOpacity=\".7\" />\n                      </linearGradient>\n                    </defs>\n                    {funnel.map((f, i) => (\n                      <rect key={f.name} className=\"hb-yd4-fun-band\" data-on={stage === i} x={i * 20} y=\"0\" width=\"20\" height=\"100\" onPointerEnter={() => setStage(i)} />\n                    ))}\n                    <path className=\"hb-yd4-fun-a\" d={fpath} fill={`url(#${uid}f)`} pointerEvents=\"none\" />\n                    {[1, 2, 3, 4].map((i) => (\n                      <line key={i} className=\"hb-yd4-fun-sep\" x1={i * 20} x2={i * 20} y1=\"0\" y2=\"100\" pointerEvents=\"none\" />\n                    ))}\n                  </svg>\n                </div>\n                <div className=\"hb-yd4-fl\">\n                  {funnel.map((f, i) => (\n                    <button\n                      key={f.name}\n                      type=\"button\"\n                      aria-pressed={stage === i}\n                      onPointerEnter={() => setStage(i)}\n                      onPointerLeave={() => setStage(null)}\n                      onFocus={() => setStage(i)}\n                      onBlur={() => setStage(null)}\n                    >\n                      <span>{f.name}</span>\n                      <b>{fmtK(f.value)}</b>\n                      <em>{i === 0 ? \"Start\" : `${((f.value / funnel[i - 1].value) * 100).toFixed(1)}%`}</em>\n                    </button>\n                  ))}\n                </div>\n                <div className=\"hb-yd4-fsum\">\n                  <span>\n                    View to purchase <b>{((funnel[4].value / funnel[0].value) * 100).toFixed(3)}%</b>\n                  </span>\n                  <span>\n                    Biggest drop <b>Sessions to sign-ups</b>\n                  </span>\n                </div>\n              </section>\n            </div>\n\n            <div className=\"hb-yd4-row2\">\n              <section className=\"hb-yd4-card\" style={{ \"--d\": 3 } as React.CSSProperties} aria-label=\"Budget burn\">\n                <div className=\"hb-yd4-ch\">\n                  <div>\n                    <h3 className=\"hb-yd4-ct\">Budget burn</h3>\n                    <p className=\"hb-yd4-cs\">November budgets, {Math.round(MONTH_ELAPSED * 100)}% of the month elapsed</p>\n                  </div>\n                </div>\n                <div className=\"hb-yd4-burn\">\n                  <div className=\"hb-yd4-rings\">\n                    <svg viewBox=\"0 0 100 100\" role=\"img\" aria-label={`${Math.round((spentAll / budgetAll) * 100)} percent of total budget spent`}>\n                      {BUDGETS.map((b, i) => {\n                        const r = radii[i];\n                        const pct = Math.min(100, (b.spent / b.budget) * 100);\n                        return (\n                          <React.Fragment key={b.name}>\n                            <circle className=\"hb-yd4-rt\" cx=\"50\" cy=\"50\" r={r} />\n                            <circle\n                              className=\"hb-yd4-rv\"\n                              cx=\"50\"\n                              cy=\"50\"\n                              r={r}\n                              pathLength={100}\n                              data-dim={ring !== null && ring !== i}\n                              style={{ stroke: b.color, strokeDasharray: `${pct.toFixed(2)} 100`, animationDelay: `${i * 150}ms` }}\n                            />\n                          </React.Fragment>\n                        );\n                      })}\n                    </svg>\n                    <div className=\"hb-yd4-rc\">\n                      <b>{ring === null ? `${Math.round((spentAll / budgetAll) * 100)}%` : `${Math.round((BUDGETS[ring].spent / BUDGETS[ring].budget) * 100)}%`}</b>\n                      <span>{ring === null ? \"of budget used\" : BUDGETS[ring].name}</span>\n                    </div>\n                  </div>\n                  <ul className=\"hb-yd4-bl\">\n                    {BUDGETS.map((b, i) => {\n                      const used = b.spent / b.budget;\n                      const pace = used > MONTH_ELAPSED + 0.04 ? \"over\" : used < MONTH_ELAPSED - 0.06 ? \"under\" : \"on\";\n                      return (\n                        <li key={b.name} tabIndex={0} onPointerEnter={() => setRing(i)} onPointerLeave={() => setRing(null)} onFocus={() => setRing(i)} onBlur={() => setRing(null)}>\n                          <i style={{ background: b.color }} />\n                          <div>\n                            <b>{b.name}</b>\n                            <span>\n                              {fmtK(b.spent, currency)} of {fmtK(b.budget, currency)}\n                            </span>\n                          </div>\n                          <span className=\"hb-yd4-pace\" data-p={pace}>\n                            {pace === \"over\" ? \"Overspending\" : pace === \"under\" ? \"Underspent\" : \"On pace\"}\n                          </span>\n                        </li>\n                      );\n                    })}\n                  </ul>\n                </div>\n                <p className=\"hb-yd4-burn-f\">\n                  Projected month end <b>{fmtK(spentAll / MONTH_ELAPSED, currency)}</b> against <b>{fmtK(budgetAll, currency)}</b>\n                </p>\n              </section>\n\n              <section className=\"hb-yd4-card\" style={{ \"--d\": 4 } as React.CSSProperties} aria-label=\"Top regions\">\n                <div className=\"hb-yd4-ch\">\n                  <div>\n                    <h3 className=\"hb-yd4-ct\">Top regions</h3>\n                    <p className=\"hb-yd4-cs\">Share of conversions by country</p>\n                  </div>\n                </div>\n                <ol className=\"hb-yd4-geo\">\n                  {GEO.map((g, i) => (\n                    <li key={g.code}>\n                      <span className=\"hb-yd4-cc\">{g.code}</span>\n                      <span className=\"hb-yd4-gn\">{g.name}</span>\n                      <span className=\"hb-yd4-gb\">\n                        <i key={p} style={{ \"--w\": `${((g.share / GEO[0].share) * 100).toFixed(1)}%`, animationDelay: `${i * 60}ms` } as React.CSSProperties} />\n                      </span>\n                      <span className=\"hb-yd4-gv\">\n                        {g.share.toFixed(1)}%<span>{Math.round(g.conv * k).toLocaleString(\"en-US\")} conv.</span>\n                      </span>\n                    </li>\n                  ))}\n                </ol>\n              </section>\n            </div>\n\n            <section className=\"hb-yd4-card\" style={{ \"--d\": 5 } as React.CSSProperties} aria-label=\"Creatives\">\n              <div className=\"hb-yd4-ch\">\n                <div>\n                  <h3 className=\"hb-yd4-ct\">Creatives</h3>\n                  <p className=\"hb-yd4-cs\">Ranked by click-through rate</p>\n                </div>\n              </div>\n              <div className=\"hb-yd4-crs\">\n                {CREATIVES.map((c, i) => (\n                  <button key={c.title} type=\"button\" className=\"hb-yd4-cr\" style={{ animationDelay: `${300 + i * 60}ms` }} aria-label={`${c.title}, ${c.channel}, CTR ${c.ctr}%, ${c.status}`}>\n                    <span className=\"hb-yd4-art\" style={{ background: c.art }}>\n                      <span className=\"hb-yd4-fmt\">{c.fmt}</span>\n                      {i === 4 ? <span className=\"hb-yd4-win\">Top CTR</span> : null}\n                      <span className=\"hb-yd4-art-t\">\n                        <small>{c.kicker}</small>\n                        {c.title}\n                      </span>\n                    </span>\n                    <span className=\"hb-yd4-crm\">\n                      <b>{c.channel}</b>\n                      <span>\n                        CTR <em>{c.ctr.toFixed(2)}%</em>\n                      </span>\n                      <span>\n                        <span className=\"hb-yd4-st\" style={{ \"--c\": STATUS_COLOR[c.status] } as React.CSSProperties}>\n                          {c.status}\n                        </span>\n                        {fmtK(c.spend * k, currency)}\n                      </span>\n                    </span>\n                  </button>\n                ))}\n              </div>\n            </section>\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}