/* ed-charts.css — styles for js/ed-charts.js (Shopify-style: thin light grid, soft rounded bars, white tooltip card). */
.edc { position: relative; font: 12px/1.3 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #374151; overflow: hidden; font-variant-numeric: tabular-nums; }
.edc svg { display: block; }
.edc .edc-ax { font-size: 11.5px; fill: #6B7280; }
.edc-hit { cursor: default; touch-action: pan-y; }

/* ---- fixed chart boxes: the box never depends on its neighbours or its content ---- */
#view-dashboard .dash-pair .dash-chart-lg, #view-analytics .dash-pair .dash-chart-lg { flex: none; height: 300px; min-height: 0; }
@media (max-width: 859px) { #view-analytics .dash-pair .dash-chart-lg { height: 240px; } }
/* "Total sales over time": Shopify-reference box (257.5px = 8px top pad + 218px plot + 31.5px axis), no extra margins around it */
#view-analytics .an-sales-pair .dash-chart-lg { height: 257.5px; margin: 0; }
@media (max-width: 859px) { #view-analytics .an-sales-pair .dash-chart-lg { height: 240px; } }
.edc .edc-ax-l { font-size: 10.4px; fill: #70707B; }
.dash-chart { overflow: hidden; }

/* ---- tooltip ---- */
.edc-tip { position: fixed; z-index: 9999; display: none; pointer-events: none; min-width: 150px; max-width: 280px; padding: 10px 12px; background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; box-shadow: 0 8px 24px -6px rgba(16, 24, 40, .18); font: 12.5px/1.35 Inter, -apple-system, "Segoe UI", Roboto, sans-serif; color: #111827; font-variant-numeric: tabular-nums; }
.edc-tip-t { font-weight: 600; margin-bottom: 6px; }
.edc-tip-r { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: #4B5563; }
.edc-tip-r i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.edc-tip-r span { flex: 1 1 auto; min-width: 0; }
.edc-tip-r b { color: #111827; font-weight: 600; white-space: nowrap; }
.edc-tip-r.is-stack { align-items: flex-start; }
.edc-tip-r.is-stack i { margin-top: 4px; }
.edc-tip-s { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.edc-tip-s span { color: #4B5563; }
.edc-tip-s b { font-size: 13px; }
.edc-tip-d { margin-top: 6px; font-size: 12px; font-weight: 600; }

/* ---- legend / dots ---- */
.edc-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; height: 22px; font-size: 12px; color: #4B5563; }
.edc-legend.is-inline { display: inline-flex; height: auto; margin-left: auto; }
.edc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 2px 0 8px; flex: none; }
.edc-legend .edc-dot:first-child { margin-left: 0; }
.edc-sub { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: #374151; }

/* ---- ranked rows (name | bar | value) ---- */
.edc-row { display: grid; grid-template-columns: minmax(84px, 40%) minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
.edc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #374151; }
.edc-row:not(.is-split):not(.is-step) .edc-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; word-break: break-word; }
.edc-track { display: flex; flex-direction: column; justify-content: center; gap: 3px; height: 100%; min-width: 0; }
.edc-bar { display: block; height: 10px; min-width: 2px; border-radius: 0 5px 5px 0; }
.edc-row:not(.is-two) .edc-bar { height: 12px; }
.edc-track.is-thin { height: 10px; display: block; }
.edc-val { text-align: right; font-size: 12.5px; font-weight: 600; color: #111827; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.edc-val small { font-weight: 500; font-size: 11.5px; color: #6B7280; }
.edc-row.is-two .edc-val small { color: #168A4E; }
.edc-row.is-step .edc-name { display: flex; flex-direction: column; justify-content: center; }
.edc-drop { color: #B54708; font-size: 11.5px; }
.edc-row:hover .edc-name { color: #111827; }

/* ---- stacked share bar ---- */
.edc-stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: #F3F4F6; }
.edc-stack i { display: block; height: 100%; min-width: 2px; }
.edc-stack.is-lg { height: 26px; border-radius: 8px; }
.edc-stack.is-lg i { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; font-style: normal; }
.edc-row.is-split { height: 36px; grid-template-columns: minmax(60px, 24%) minmax(0, 1fr); }
.edc-lrow { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto 52px; align-items: center; column-gap: 10px; height: 28px; font-size: 13px; }
.edc-lrow .edc-dot { margin: 0; }
.edc-lrow b { font-weight: 600; color: #111827; white-space: nowrap; }
.edc-lrow em { font-style: normal; text-align: right; color: #6B7280; font-size: 12px; }
.edc-stack + .edc-lrow { margin-top: 14px; }

/* ---- conversion-rate comparison ---- */
.edc-rate { padding: 6px 0 4px; }
.edc-rate .edc-name { display: block; margin-bottom: 4px; font-weight: 500; }
.edc-rline { display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: center; column-gap: 10px; height: 14px; margin-bottom: 3px; }
.edc-rline .edc-val { display: block; font-size: 12px; }
.edc-rline .edc-bar { height: 10px; }

.edc-row.is-step { grid-template-columns: minmax(104px, 44%) minmax(0, 1fr) auto; }
.edc-row.is-step .edc-name { white-space: normal; }

/* ---- ADMIN-BLUE-3: Vectra-style bars (ghost track, gradient, grow-in, hover guide) + line draw-on ---- */
.edc .edc-vbar { transition: fill .16s ease; transform-box: fill-box; transform-origin: 50% 100%; }
.edc .edc-vbar.is-on { fill: var(--color-primary, #168A4E); }
.edc .edc-vguide, .edc .edc-vdot { pointer-events: none; }
.edc .is-grow .edc-vtrack, .edc svg.is-grow .edc-vtrack { animation: edcFade .25s ease both; }
.edc svg.is-grow .edc-vbar { animation: edcGrow .6s cubic-bezier(.22, 1, .36, 1) both; animation-delay: var(--d, 0ms); }
.edc svg.is-grow .edc-vline { stroke-dasharray: 1; animation: edcDraw .7s cubic-bezier(.65, 0, .35, 1) both; }
.edc svg.is-grow .edc-varea { animation: edcFade .4s ease .35s both; }
@keyframes edcGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes edcFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes edcDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* chart-type toggle (sliding pill) */
.dash-ctoggle { position: relative; display: inline-flex; padding: 2px; gap: 0; background: var(--color-bg-subtle, #F1F5F9); border: 1px solid #E2E8F0; border-radius: 8px; }
.dash-ctoggle button { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 26px; border: 0; background: transparent; border-radius: 6px; color: #64748B; cursor: pointer; }
.dash-ctoggle button[aria-pressed="true"] { color: #0F172A; }
.dash-ctoggle button:focus-visible { outline: 2px solid var(--color-primary, #168A4E); outline-offset: 1px; }
.dash-ctoggle i.pill { position: absolute; top: 2px; left: 2px; width: 30px; height: 26px; background: #fff; border-radius: 6px; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); transition: transform .18s cubic-bezier(.22, 1, .36, 1); }
.dash-ctoggle[data-mode="line"] i.pill { transform: translateX(30px); }
.dash-ctoggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* load reveal + KPI/table entrance (motion only; reduced-motion safe) */
@keyframes vxReveal { from { opacity: 0; filter: blur(8px); } to { opacity: 1; filter: blur(0); } }
@keyframes vxRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#view-dashboard.vx-reveal .dash-grid { animation: vxReveal .5s cubic-bezier(.22, 1, .36, 1) both; }
#view-dashboard .dash-table tbody tr.vx-row { animation: vxRise .22s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--i, 0) * 35ms); }
@media (prefers-reduced-motion: reduce) {
  .edc svg .edc-vbar, .edc svg .edc-vtrack, .edc svg .edc-vline, .edc svg .edc-varea, #view-dashboard .dash-grid, #view-dashboard .dash-table tbody tr.vx-row { animation: none !important; }
  .dash-ctoggle i.pill, .edc .edc-vbar { transition: none; }
}

/* ---- Shopify-style analytics charts (ANALYTICS-SHOPIFY-1) ---- */
.edc-kv { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: #374151; }
.edc-kv .an-dotted { font-weight: 600; text-decoration: underline dotted #9CA3AF; text-underline-offset: 3px; }
.edc-kv b { font-size: 15px; font-weight: 650; color: #111827; margin-left: auto; }
.edc-kv .edc-chg { margin-left: 0; }
.edc-chg { font-size: 12px; font-weight: 600; white-space: nowrap; }
.edc-chg.is-up { color: #12B76A; } .edc-chg.is-down { color: #F04438; }
.edc-legend.is-center { justify-content: center; }
.edc-ln { display: inline-block; width: 16px; height: 0; border-top: 2px solid #168A4E; margin: 0 4px 0 10px; vertical-align: middle; }
.edc-ln:first-child { margin-left: 0; }
.edc-ln.is-prev { border-top: 2px dashed #9CA3AF; }
/* conversion breakdown columns */
.edc-fc-grid { display: grid; height: 98px; }
.edc-fc { display: flex; flex-direction: column; gap: 2px; padding: 0 6px 0 8px; min-width: 0; overflow: hidden; border-left: 1px solid #EEF0F4; }
.edc-fc:first-child { border-left: 0; padding-left: 0; }
.edc-fc-l { font-size: 11.5px; line-height: 1.25; color: #374151; height: 29px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.edc-fc b { line-height: 1.2; font-weight: 650; color: #111827; white-space: nowrap; }
.edc-fc-n { font-size: 12.5px; color: #374151; }
.edc-fc .edc-drop { font-size: 11px; color: #B54708; white-space: nowrap; }
/* donuts */
.edc .edc-dn { font-weight: 650; fill: #111827; }
.edc .edc-ds { font-size: 11px; fill: #6B7280; }
.edc .edc-seg { cursor: default; transition: opacity .12s; }
.edc .edc-seg:hover { opacity: .82; }
.edc-figs { display: flex; justify-content: center; align-items: flex-start; gap: 12px; }
.edc-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.edc-fig figcaption { font-size: 12px; font-weight: 600; color: #374151; }
.edc-donut-wrap { display: flex; align-items: center; gap: 18px; height: 100%; }
.edc-donut-wrap.is-col { flex-direction: column; align-items: stretch; gap: 8px; }
.edc-donut-wrap.is-col .edc-donut { align-self: center; }
.edc-donut { flex: none; }
.edc-dlist { flex: 1 1 auto; min-width: 0; }
/* stacked blocks */
.edc-blk { display: flex; flex-direction: column; gap: 3px; }
.edc-blk-r { display: flex; align-items: stretch; gap: 14px; min-width: 0; }
.edc-blk-b { flex: 0 0 58%; border-radius: 6px; display: flex; align-items: flex-start; padding: 6px 10px; min-width: 0; overflow: hidden; }
.edc-blk-b i { font-style: normal; font-size: 12px; font-weight: 600; color: #14532D; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edc-blk-b.is-dark i { color: #fff; }
.edc-blk-v { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #111827; }
.edc-blk-v b { font-weight: 650; }
.edc-blk-v em { font-style: normal; font-size: 12px; color: #6B7280; }
/* Overview row 2/3 chart boxes */
#view-analytics #anPerfTrendChart, #view-analytics #anPerfFunnelChart { height: 320px; }
#view-analytics #anSegChart.dash-chart-sm, #view-analytics #anCategoryChart.dash-chart-sm { height: 220px; }
