/* The same two native radio controls drive the chart, breakdown and data table. */
.home-insights { --home-paper: #1a3231; }
.home-insights .home-link { color: var(--sea-glass); }
.home-dashboard {
  --report-paper: #1b3634;
  --report-surface: #23423e;
  --report-rule: #426057;
  --report-muted: #b7c9bf;
  --report-gap: clamp(15px, 2.2vw, 30px);
  max-width: 100%; overflow: hidden; border: 1px solid var(--report-rule); border-radius: 22px;
  background: var(--report-paper); color: var(--ivory); box-shadow: 0 16px 43px -34px #071715;
  font-variant-numeric: tabular-nums;
}
.insight-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px;
  padding: 17px var(--report-gap); background: #203c38; border-bottom: 1px solid var(--report-rule);
}
.insight-merchant { display: flex; align-items: center; gap: 10px; }
.insight-merchant > svg {
  flex: none; width: 37px; height: 37px; border-radius: 11px;
  background: var(--sea-glass); color: var(--petrol);
}
.insight-merchant h3 { font: 600 1.03rem/1.25 var(--body); letter-spacing: -.028em; }
.insight-merchant p, .insight-period { color: var(--report-muted); font-size: .76rem; }
.insight-period { display: inline-flex; align-items: center; gap: 7px; }
.insight-period svg { width: 16px; height: 16px; }
.insight-report { min-width: 0; position: relative; border: 0; padding: var(--report-gap); margin: 0; }
.insight-sr, .insight-choice {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.insight-toolbar {
  display: flex; justify-content: space-between; flex-wrap: wrap;
  align-items: center; gap: 10px 18px; margin-bottom: 15px;
}
.insight-toolbar h3 { font: 500 clamp(1.35rem,2.1vw,1.85rem)/1.2 var(--display); letter-spacing: -.045em; }
.insight-controls { display: inline-flex; align-items: stretch; padding: 3px; border: 1px solid #577268; border-radius: 100px; }
.insight-controls label {
  display: inline-flex; min-height: 33px; align-items: center; border-radius: 100px;
  padding-inline: 14px; color: var(--report-muted); cursor: pointer; font: 550 .8rem/1 var(--body);
}
.insight-controls label:hover { background: #324e47; color: var(--ivory); }
#overview-visits:checked ~ .insight-toolbar [for="overview-visits"],
#overview-signups:checked ~ .insight-toolbar [for="overview-signups"] { background: var(--mist); color: var(--petrol); }
#overview-visits:focus-visible ~ .insight-toolbar [for="overview-visits"],
#overview-signups:focus-visible ~ .insight-toolbar [for="overview-signups"] { outline: 2px solid var(--ivory); outline-offset: 5px; }
.insight-panel {
  display: none; grid-template-columns: minmax(0,1.9fr) minmax(220px,1fr); align-items: stretch; gap: 12px;
}
#overview-visits:checked ~ .insight-panels .insight-panel--visits,
#overview-signups:checked ~ .insight-panels .insight-panel--signups { display: grid; }
.insight-chart, .insight-breakdown { min-width: 0; border: 1px solid var(--report-rule); border-radius: 13px; }
.insight-chart { padding: clamp(16px, 2.15vw, 29px); margin: 0; background: var(--report-surface); }
.insight-chart h4, .insight-breakdown h4 { margin: 0; color: inherit; font: 550 .94rem/1.3 var(--body); letter-spacing: -.015em; }
.insight-chart figcaption { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; }
.insight-total {
  display: flex; align-items: center; gap: 10px; margin-top: 5px;
  font: 500 clamp(2.55rem,4vw,3.55rem)/1 var(--display); letter-spacing: -.068em;
}
.insight-change {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 6px; border-radius: 5px; background: #34594e; color: #d7e8d7;
  font: 550 .72rem/1 var(--body); letter-spacing: 0;
}
.insight-legend { display: flex; flex-wrap: wrap; gap: 7px 11px; color: var(--report-muted); font-size: .72rem; }
.insight-legend span { display: flex; gap: 6px; align-items: center; }
.insight-legend span::before { content: ""; width: 17px; border-top: 2px solid var(--sea-glass); }
.insight-legend span + span::before { border-color: var(--report-muted); border-top-style: dashed; }
.insight-plot { display: grid; grid-template-columns: 19px minmax(0,1fr); gap: 8px; margin-top: 22px; }
.insight-plot svg { display: block; width: 100%; height: clamp(125px, 11.4vw, 164px); overflow: visible; }
.insight-plot path:not(.plot-fill) { fill: none; vector-effect: non-scaling-stroke; }
.insight-plot .plot-grid { stroke: #46635b; stroke-width: 1; }
.insight-plot .plot-previous { stroke: var(--report-muted); stroke-width: 1.4; stroke-dasharray: 4 4; stroke-linejoin: round; }
.insight-plot .plot-current { stroke: var(--sea-glass); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.insight-y, .insight-x { color: var(--report-muted); font: 450 .65rem/1 var(--mono); }
.insight-y { margin-block: -.5em calc(20px - .5em); display: flex; flex-direction: column; justify-content: space-between; text-align: right; }
.insight-x { position: relative; margin-top: 8px; height: 12px; }
.insight-x span { position: absolute; white-space: nowrap; }
.insight-x span:nth-child(2) { left: 25.93%; transform: translateX(-50%); }
.insight-x span:nth-child(3) { left: 51.85%; transform: translateX(-50%); }
.insight-x span:nth-child(4) { left: 77.78%; transform: translateX(-50%); }
.insight-x span:last-child { right: 0; }
.insight-takeaway { margin-top: 18px; color: var(--mist); font-size: .82rem; line-height: 1.45; }
.insight-breakdown {
  --ring-secondary: #52786a; background: #d3dfd1; border-color: transparent; color: var(--petrol); color-scheme: light;
  display: flex; flex-direction: column; align-items: center; padding: clamp(16px, 2vw, 27px);
}
.insight-breakdown h4 { align-self: flex-start; }
.insight-ring {
  flex: none; display: grid; place-items: center; width: clamp(116px,10vw,145px); aspect-ratio: 1;
  margin: 18px auto; border-radius: 50%;
  background: conic-gradient(from -90deg, var(--dark-teal) 0 calc(var(--split) - .4%), #d3dfd1 0 calc(var(--split) + .4%), var(--ring-secondary) 0 99.7%, #d3dfd1 0);
}
.insight-ring > div {
  width: 80%; aspect-ratio: 1; background: #d3dfd1; border-radius: 50%; display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 4px;
}
.insight-ring b { font: 500 clamp(1.55rem,2.2vw,2.2rem)/1 var(--display); letter-spacing: -.055em; }
.insight-ring span { font-size: .67rem; line-height: 1; }
.insight-key { align-self: stretch; margin: auto 0 0; }
.insight-key > div { display: flex; gap: 6px; justify-content: space-between; align-items: center; border-top: 1px solid #a2b7aa; padding: 8px 0; font-size: .81rem; }
.insight-key > div:last-child { padding-bottom: 0; }
.insight-key dt { display: inline-flex; align-items: center; gap: 7px; }
.insight-key dt::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--dark-teal); }
.insight-key > div + div dt::before { background: var(--ring-secondary); }
.insight-key dd { margin: 0; font-weight: 650; }
.insight-more { grid-column: 1/-1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.insight-data { min-width: 0; }
.insight-history { color: var(--report-muted); padding-block: 6px; font: 550 .8rem/1.4 var(--body); text-decoration: underline; text-underline-offset: 3px; }
.insight-history:hover { color: var(--ivory); }
.insight-data summary { width: fit-content; color: var(--report-muted); font: 550 .8rem/1.4 var(--body); padding: 6px 1px; cursor: pointer; }
.insight-data summary:hover { color: var(--ivory); }
.insight-data table { width: 100%; max-width: 650px; margin-top: 10px; border-collapse: collapse; font-size: .81rem; }
.insight-data th, .insight-data td { padding: 7px; border-bottom: 1px solid var(--report-rule); text-align: right; }
.insight-data th:first-child { text-align: left; }
.insight-data caption { padding: 5px 7px 10px; text-align: left; color: var(--report-muted); }
.insight-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0; border-top: 1px solid var(--report-rule); background: #203c38; }
.insight-summary > div { padding: 15px var(--report-gap) 19px; min-width: 0; }
.insight-summary > div + div { border-left: 1px solid var(--report-rule); }
.insight-summary dt { color: var(--report-muted); font-size: .78rem; }
.insight-summary dd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; margin: 5px 0 0; font: 500 clamp(1.45rem,2.1vw,1.95rem)/1.12 var(--display); letter-spacing: -.045em; }
.insight-summary dd small { color: var(--report-muted); font: 500 .76rem/1.3 var(--body); letter-spacing: normal; }
@media (prefers-reduced-motion: no-preference) {
  .insight-chart.is-in-view .plot-current { animation: insight-trace 1.15s cubic-bezier(.2,.65,.27,1) both; }
  .insight-chart.is-in-view .plot-fill { animation: insight-wash .8s .25s ease-out backwards; }
}
@keyframes insight-trace { from { clip-path: inset(-10% 100% -10% -2%); } to { clip-path: inset(-10% -2% -10% -2%); } }
@keyframes insight-wash { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 730px) {
  .insight-panel { grid-template-columns: minmax(0,1fr); }
  .insight-breakdown { display: grid; grid-template-columns: 84px minmax(0,1fr); grid-template-rows: auto auto; gap: 0 18px; align-items: center; }
  .insight-ring { grid-column:1; grid-row:1/3; width:84px; margin:0; }
  .insight-ring b { font-size:1.35rem; }
  .insight-ring span { font-size:.58rem; }
  .insight-breakdown h4 { grid-column:2; align-self:end; margin-bottom:5px; }
  .insight-breakdown .insight-key { grid-column:2; align-self:start; }
  .insight-key > div { padding-block:5px; }
}
@media (max-width: 480px) {
  .insight-header { gap:8px; }
  .insight-period { font-size:.7rem; }
  .insight-period svg { display:none; }
  .insight-chart figcaption { align-items: flex-start; }
  .insight-legend { width:100%; }
  .insight-controls label { padding-inline:10px; }
  .insight-toolbar h3 { font-size:1.25rem; }
  .insight-summary { grid-template-columns: 1fr; }
  .insight-summary > div { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px var(--report-gap); }
  .insight-summary > div + div { border-left: 0; border-top: 1px solid var(--report-rule); }
  .insight-summary dd { margin:0; font-size:1.15rem; }
  .insight-summary dd small { font-size:.7rem; }
}
@media (max-width: 390px) {
  .insight-x span:nth-child(2), .insight-x span:nth-child(4) { display:none; }
  .insight-breakdown { grid-template-columns: 68px minmax(0, 1fr); gap: 0 10px; padding: 13px; }
  .insight-ring { width:68px; }
  .insight-ring span { display:none; }
  .insight-key > div { font-size:.74rem; }
  .insight-summary > div { gap:5px; }
}
