/* ── LIVE SAVINGS ── */
/* A live "WOZCODE devs saved $X this week" hero, polled every 5s from the */
/* public app:wozcode:publicStats:read RPC. Slots between the title hero   */
/* and the .compare section. Styled to match .bm-section's eyebrow/title   */
/* conventions and the site's brand-green palette.                         */

.ls-section {
  position: relative;
  padding: 3.5rem 0 4rem;
  overflow: hidden;
}

.ls-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(147,232,73,0.05) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(141,140,209,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.ls-section > * {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* ── HEADER ── */

.ls-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2.25rem;
}

.ls-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--color-brand-green);
  margin-bottom: 1rem;
  opacity: 0.95;
}

/* Inherits .eyebrow-pulse (defined globally); `.ls-dot` is slightly       */
/* punchier so the section reads unmistakably "live".                       */
.ls-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-brand-green);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(147,232,73,0.55);
  animation: ls-dot-pulse 1.8s ease-out infinite;
}
@keyframes ls-dot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(147,232,73,0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(147,232,73,0); }
  100% { box-shadow: 0 0 0 0 rgba(147,232,73,0); }
}

.ls-title {
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 0.75rem;
}
.ls-title .ls-big {
  color: var(--color-brand-green);
  font-variant-numeric: tabular-nums;
  display: inline-block;
  min-width: 0.5em;
}
.ls-title .ls-big.ls-bump {
  animation: ls-bump 0.6s cubic-bezier(0.16,1,0.3,1);
}
@keyframes ls-bump {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-3px) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

.ls-sub {
  color: #8b877f;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  letter-spacing: 0.01em;
  max-width: 640px;
  line-height: 1.55;
}
.ls-sub .ls-dot {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.55rem;
  margin-bottom: 2px;
}
.ls-sub strong {
  color: var(--color-white);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── TABS ── */

.ls-tabs-row {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
}
.ls-tabs {
  display: inline-flex;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 3px;
}
.ls-tab {
  background: none;
  border: none;
  color: #78756f;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.ls-tab:hover { color: #d0cdc7; }
.ls-tab.is-active {
  color: var(--color-white);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.ls-tab:focus-visible {
  outline: 2px solid rgba(147,232,73,0.55);
  outline-offset: 2px;
}

/* ── VIEW SWAP ── */

.ls-section.ls-view-week    .ls-view-lifetime-only { display: none; }
.ls-section.ls-view-lifetime .ls-view-week-only    { display: none; }

/* ── KPI GRID ── */

.ls-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.ls-grid-5 { grid-template-columns: repeat(5, 1fr); }

.ls-tile {
  position: relative;
  padding: 1.25rem 1.25rem 1.1rem;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0.015) 100%),
    rgba(17,22,20,0.6);
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.ls-tile:hover {
  border-color: rgba(147,232,73,0.18);
  transform: translateY(-1px);
}
.ls-tile::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(147,232,73,0.65), rgba(147,232,73,0.0));
  opacity: 0.65;
}
.ls-tile-label {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #6b6761;
  margin-bottom: 0.55rem;
}
.ls-tile-value {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.4rem;
}
.ls-tile-helper {
  font-size: 0.72rem;
  color: #7a7872;
  letter-spacing: 0.01em;
}

/* ── CHART ── */

.ls-chart-card {
  position: relative;
  padding: 1.4rem 1.5rem 1.25rem;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%),
    rgba(17,22,20,0.6);
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 1.5rem;
}
.ls-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.ls-chart-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.ls-chart-sub {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: #7a7872;
  letter-spacing: 0.02em;
}

/* ── INFO ICON ── */

.ls-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #6b6761;
  border-radius: 50%;
  cursor: help;
  transition: color 0.2s;
}
.ls-info:hover,
.ls-info:focus-visible {
  color: var(--color-brand-green);
  outline: none;
}
.ls-info-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 0.5rem 0.7rem;
  background: rgba(10,14,12,0.96);
  border: 1px solid rgba(147,232,73,0.3);
  border-radius: 6px;
  color: var(--color-white);
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
  z-index: 3;
}
.ls-info-tip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  background: rgba(10,14,12,0.96);
  border-right: 1px solid rgba(147,232,73,0.3);
  border-bottom: 1px solid rgba(147,232,73,0.3);
  transform: translateX(-50%) rotate(45deg);
}
.ls-info:hover .ls-info-tip,
.ls-info:focus-visible .ls-info-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}
.ls-chart {
  width: 100%;
  height: 180px;
  display: block;
}
.ls-bar-group {
  cursor: pointer;
}
.ls-bar {
  transition: fill 0.2s, transform 0.25s cubic-bezier(0.16,1,0.3,1), filter 0.2s;
  transform-origin: center bottom;
  transform-box: fill-box;
  fill: url(#ls-bar-grad);
}
.ls-bar-hit {
  fill: transparent;
}
.ls-bar-group:hover .ls-bar,
.ls-bar-group.is-hover .ls-bar {
  fill: var(--color-brand-green);
  filter: drop-shadow(0 4px 12px rgba(147,232,73,0.35));
  transform: translateY(-2px);
}

/* ── TOOLTIP ── */

.ls-tip {
  position: absolute;
  pointer-events: none;
  padding: 0.5rem 0.75rem;
  background: rgba(10,14,12,0.95);
  border: 1px solid rgba(147,232,73,0.35);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.35);
  font-size: 0.72rem;
  color: var(--color-white);
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -6px) scale(0.96);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 2;
  font-variant-numeric: tabular-nums;
}
.ls-tip.is-visible {
  opacity: 1;
  transform: translate(-50%, -10px) scale(1);
}
.ls-tip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  background: rgba(10,14,12,0.95);
  border-right: 1px solid rgba(147,232,73,0.35);
  border-bottom: 1px solid rgba(147,232,73,0.35);
  transform: translateX(-50%) rotate(45deg);
}
.ls-tip-date {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-brand-green);
  margin-bottom: 0.2rem;
}
.ls-tip-cost {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-white);
}
.ls-tip-cost .ls-tip-cost-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: #a8a59f;
  margin-left: 0.35rem;
}
.ls-chart-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.65rem;
  text-align: center;
  color: #6b6761;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.ls-chart-labels .today {
  color: var(--color-brand-green);
  font-weight: 700;
}

/* ── AREA CHART (lifetime cumulative) ── */

.ls-area-chart {
  width: 100%;
  height: 220px;
  display: block;
  overflow: visible;
}
.ls-area-fill {
  fill: url(#ls-area-grad);
  pointer-events: none;
}
.ls-area-line {
  fill: none;
  stroke: var(--color-brand-green);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(147,232,73,0.3));
  pointer-events: none;
}
.ls-area-grid {
  stroke: rgba(255,255,255,0.05);
  stroke-width: 1;
  pointer-events: none;
}
.ls-area-guide {
  stroke: rgba(147,232,73,0.4);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.ls-area-dot {
  fill: var(--color-brand-green);
  stroke: rgba(10,14,12,0.95);
  stroke-width: 2;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 0 6px rgba(147,232,73,0.5));
  transition: opacity 0.15s;
}
.ls-area-chart.is-hover .ls-area-guide,
.ls-area-chart.is-hover .ls-area-dot {
  opacity: 1;
}
.ls-area-overlay {
  fill: transparent;
  cursor: crosshair;
}
.ls-area-labels {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 0.35rem;
}
.ls-area-labels span:last-child { text-align: right; }
.ls-area-labels span:first-child { text-align: left; }

/* ── FOOTER NOTE ── */

.ls-footnote {
  margin-top: 1.1rem;
  text-align: center;
  font-size: 0.72rem;
  color: #6b6761;
  letter-spacing: 0.02em;
}
.ls-footnote .ls-dot-small {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--color-brand-green);
  vertical-align: middle;
  margin-right: 0.4rem;
  animation: ls-dot-pulse 1.8s ease-out infinite;
}

/* ── RESPONSIVE ── */

@media (max-width: 1000px) {
  .ls-grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .ls-grid-5 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .ls-section { padding: 2.5rem 0 3rem; }
  .ls-section > * { padding-left: 1rem; padding-right: 1rem; }
  .ls-grid { gap: 0.6rem; }
  .ls-tile { padding: 1rem 1rem 0.9rem; }
  .ls-tile-label { font-size: 0.52rem; letter-spacing: 0.18em; }
  .ls-chart-card { padding: 1rem 1rem 0.9rem; }
  .ls-chart { height: 140px; }
  .ls-chart-labels { font-size: 0.58rem; }
}
