/* Shopify Insights page. Builds on ../assets/wildlight.css. */

/* Hero: a tool, not a landing page. Intro + steps on the left, an input console on the right. */
.tool-hero { padding-top: clamp(48px, 6vw, 88px); padding-bottom: clamp(48px, 6vw, 88px); }
.tool-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
@media (max-width: 900px) { .tool-hero-grid { grid-template-columns: 1fr; } }
@media (hover: none) { .console-title, .console-sub { display: none; } .console-body { min-height: 0; } }
.tool-intro { display: flex; flex-direction: column; gap: 20px; }
.tool-title { font: 400 clamp(34px, 4.4vw, 56px)/1.06 var(--display); letter-spacing: -.02em; max-width: 16ch; }
.tool-intro .lead { font-size: clamp(15.5px, 1.2vw, 17.5px); max-width: 54ch; }
.steps { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--drule-30); }
.steps li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--drule-16); font-size: 15px; line-height: 1.55; color: var(--on-dark-body); }
.steps .idx { font: 400 12px/1.8 var(--mono); color: rgba(239, 242, 243, .6); min-width: 22px; }
.steps strong { color: var(--paper); font-weight: 500; }
.steps .text-link { font-size: 14px; margin-left: 4px; }

.dark .console { background: var(--paper-2); border: 1px solid rgba(14, 116, 144, .45); color: var(--ink); }
.dark .console .panel-head { background: var(--teal-tint); color: var(--teal); border-bottom-color: rgba(14, 116, 144, .3); }
.console-body {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
  min-height: clamp(240px, 26vw, 320px); padding: 32px 24px; border-bottom: 1px solid rgba(14, 116, 144, .2);
  transition: background-color .15s;
}
.console-title { font: 400 clamp(22px, 2.2vw, 28px)/1.15 var(--display); color: var(--ink); }
.console-sub { color: var(--text-4); }
.console-sample { background: none; border: 0; padding: 0; cursor: pointer; color: var(--teal); font: 400 14px/1.4 var(--sans); text-decoration: underline; text-underline-offset: 3px; margin-top: 4px; }
.console-sample:hover { color: var(--teal-dark); }
.console-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--text-3); font-size: 11.5px; letter-spacing: .04em; }
.console-foot .sq { width: 7px; height: 7px; background: var(--teal); flex: none; }
body.dragging .console { border-color: var(--teal); }
body.dragging .console-body { background: var(--teal-tint); }
body.dragging .console-title::after { content: ' ↓'; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:focus-within { outline: 1px solid var(--teal); outline-offset: 3px; }

.preview-strip { padding-top: 26px; padding-bottom: 26px; }
.preview-label { margin-bottom: 14px; }
.preview-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--rule-28); }
.preview-list li { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 4px 0; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.preview-list .idx { font: 400 12px/1 var(--mono); color: var(--teal); }

/* Status */
.status { padding-top: clamp(32px, 4vw, 56px); padding-bottom: clamp(32px, 4vw, 56px); }
.progress-track { height: 6px; background: rgba(14, 116, 144, .12); }
.progress-bar { height: 100%; width: 0; background: var(--teal); transition: width .2s linear; }
.progress-detail { margin-top: 12px; color: var(--text-3); }
.error-panel .panel-body { display: flex; flex-direction: column; gap: 12px; }
.error-panel code { font: 400 13px var(--mono); }

/* Summary */
.summary-bar { padding-top: 18px; padding-bottom: 18px; }
.summary-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; }
.summary-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--text-3); }
.summary-right { display: flex; gap: 22px; }
.summary-right .link-btn { font-size: 12px; letter-spacing: .06em; }
.warnings { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.warnings p { font: 400 13px/1.5 var(--sans); color: var(--amber); }

/* Section heads */
.section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: clamp(24px, 3vw, 36px); max-width: 760px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(28px, 5vw, 72px); align-items: start; }
.two-col .section-head { margin-bottom: 0; }
.chart-label { margin-bottom: 10px; }

/* LTV */
.ltv-grid { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (max-width: 860px) { .ltv-grid { grid-template-columns: 1fr; } }
.ltv-readout { display: flex; flex-direction: column; gap: 10px; }
.hero-figure { font: 500 clamp(52px, 7vw, 84px)/1 var(--display); letter-spacing: -.02em; color: var(--paper); }
.readout-meta { color: var(--on-dark-label); min-height: 3em; white-space: pre-line; }
.ltv-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--drule-16); border-bottom: 1px solid var(--drule-16); margin: 8px 0 4px; }
.compare-figure { font: 400 26px/1.1 var(--display); color: var(--paper); margin-top: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px; }
.sw-orange { background: var(--orange); }
.slider-block { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 6px; }
.slider-ticks { display: flex; justify-content: space-between; color: var(--on-dark-label); font-size: 11px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--drule-30); }
input[type=range]::-moz-range-track { height: 2px; background: var(--drule-30); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -7px; background: var(--paper); border: 2px solid var(--ink); border-radius: 2px; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; background: var(--paper); border: 2px solid var(--ink); border-radius: 2px; }
input[type=range]:focus-visible { outline: 1px solid var(--paper); outline-offset: 4px; }
.cac-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.cac-result { font-size: 14px; min-height: 1.6em; }
.ltv-chart-wrap { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.note-dark { font-size: 14px; }
.ln { display: inline-block; }
.ln-paper { background: var(--paper); }
.ln-orange { background: var(--orange); }
.ln-ink { background: var(--ink); }

/* Charts */
.chart-host { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; overflow: visible; }
.chart-tick { font: 400 11px var(--mono); letter-spacing: .04em; }
.chart-end { font: 500 12px var(--sans); }
.chart-tip {
  display: none; position: absolute; z-index: 5; pointer-events: none; min-width: 140px;
  background: var(--paper-2); border: 1px solid var(--rule-28); padding: 10px 12px; color: var(--ink);
}
.chart-tip-title { font: 400 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-4); margin-bottom: 6px; }
.chart-tip-row { display: flex; align-items: center; gap: 8px; font: 400 13px/1.6 var(--sans); color: var(--text-3); white-space: nowrap; }
.chart-tip-row strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip-key { width: 12px; height: 2px; flex: none; }

.table-view { margin-top: 12px; }
.table-view summary { cursor: pointer; font: 400 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.dark .table-view summary { color: var(--paper); }
.table-view table { margin-top: 10px; }
.table-scroll { overflow-x: auto; max-width: 100%; }

/* Tables */
.data-table, .table-view table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .table-view th {
  text-align: left; font: 400 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-4);
  padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule-28); white-space: nowrap; vertical-align: bottom;
}
.data-table td, .table-view td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule-12); vertical-align: top; font-variant-numeric: tabular-nums; }
.dark .table-view th { color: var(--on-dark-label); border-bottom-color: var(--drule-30); }
.dark .table-view td { border-bottom-color: var(--drule-10); color: var(--on-dark-body); }
.data-table td.num, .data-table th.num { text-align: right; }
.data-table tr.emph td { font-weight: 600; }
.data-table .sub { display: block; font: 400 11px/1.4 var(--mono); color: var(--text-4); letter-spacing: .04em; margin-top: 2px; }
.data-table .muted { color: var(--text-4); }
.codes-table td:first-child { font: 500 13px/1.4 var(--mono); }
.codes-table .reason { color: var(--text-3); font-size: 13.5px; min-width: 220px; }
.codes-caveat { margin-top: 24px; max-width: 70ch; }

.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: clamp(24px, 4vw, 56px); margin-top: clamp(28px, 4vw, 44px); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* $100 bar */
.stack-bar { display: flex; height: 56px; gap: 2px; margin-top: 8px; }
.stack-bar > div { position: relative; min-width: 2px; display: flex; align-items: center; justify-content: center; font: 500 14px/1 var(--sans); }
.stack-legend { margin-top: 16px; flex-direction: column; gap: 10px; }
.stack-legend li { font-size: 13px; }
.stack-legend strong { color: var(--ink); font: 600 14px var(--sans); min-width: 56px; }

/* More */
/* Hairline-ruled stat tiles, then charts separated by rules rather than boxed in cards. */
.stat-row { list-style: none; margin: 0 0 clamp(36px, 4vw, 56px); padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--rule-28); border-bottom: 1px solid var(--rule-14); }
.stat-row li { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px 22px 0; }
.stat-row li + li { padding-left: 24px; border-left: 1px solid var(--rule-14); }
@media (max-width: 520px) { .stat-row li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule-14); } }
.stat-value { font: 400 clamp(32px, 3.4vw, 44px)/1 var(--display); letter-spacing: -.015em; color: var(--ink); }
.stat-what { font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.stat-sub { font: 400 11.5px/1.5 var(--mono); letter-spacing: .04em; color: var(--text-4); }
.more-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: clamp(28px, 5vw, 72px); }
.more-fig { margin: 0; display: flex; flex-direction: column; gap: 14px; padding-top: 18px; border-top: 1px solid var(--rule-28); min-width: 0; }
.more-fig figcaption { display: flex; flex-direction: column; gap: 8px; }
.more-note { font: 400 clamp(17px, 1.5vw, 20px)/1.35 var(--display); color: var(--ink); max-width: 40ch; }
.more-wide { margin-top: clamp(36px, 4vw, 56px); }
.sw-ink { background: var(--ink); }
.sw-ink-soft { background: rgba(14, 21, 24, .3); }

/* CTA / footer */
.cta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(28px, 5vw, 72px); align-items: end; }
.cta-grid .h2 { margin-top: 16px; max-width: 20ch; }
.cta-copy { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.footer { padding-top: 28px; padding-bottom: 28px; border-top: 1px solid var(--drule-10); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--on-dark-label); font-size: 11.5px; }

/* Modals */
.setup-title { margin: 12px 0 18px; }
.setup-steps li div { font-size: 15px; line-height: 1.6; color: var(--text-2); }
.setup-steps code, .modal code { font: 400 13px var(--mono); background: rgba(14, 21, 24, .06); padding: 1px 5px; }
.setup-note { margin-top: 18px; font-size: 14px; }
#checks-list li { justify-content: space-between; gap: 24px; font-size: 14.5px; color: var(--text-2); }
#checks-list li strong { font-weight: 500; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 520px) {
  .summary-right { gap: 16px; }
  .hero-actions .btn { width: 100%; }
  .ltv-compare { grid-template-columns: 1fr 1fr; }
}
.data-table td.nowrap { white-space: nowrap; }
.compare-sub { color: var(--on-dark-label); font-size: 11px; margin-top: 4px; }
.aov-block { margin-top: clamp(48px, 6vw, 80px); padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--drule-16); }
.aov-block .section-head { margin-bottom: 18px; }
.aov-block .legend { margin-bottom: 12px; }
