/* ═══════════════════════════════════════════
   StoryCollectr Mockup — Subscription Pages
   Shared styles for personal plan and
   family library plan pages.
   ═══════════════════════════════════════════ */


/* ═══════════════════════════════════════════
   1. INFO CALLOUT
   ═══════════════════════════════════════════ */

.plan-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(107, 127, 94, 0.05);
  border: 1px solid rgba(107, 127, 94, 0.15);
  border-radius: 12px;
  margin-bottom: 28px;
}

.plan-note svg {
  width: 18px;
  height: 18px;
  stroke: var(--sc-sage);
  fill: none;
  flex-shrink: 0;
  margin-top: 1px;
}

.plan-note__text {
  font-family: var(--sc-font-ui);
  font-size: 0.85rem;
  color: var(--sc-text-secondary);
  line-height: 1.5;
}

.plan-note__text a {
  color: var(--sc-rust);
  font-weight: 500;
  text-decoration: none;
}

.plan-note__text a:hover {
  text-decoration: underline;
}


/* ═══════════════════════════════════════════
   2. PLAN HERO (Current Plan Banner)
   ═══════════════════════════════════════════ */

.plan-hero {
  margin-bottom: 0;
}

.plan-hero__inner {
  position: relative;
  background:
    radial-gradient(ellipse 70% 80% at 10% 100%, rgba(107, 127, 94, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 90% 20%, rgba(184, 96, 63, 0.05) 0%, transparent 60%),
    var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 18px;
  padding: 32px;
  overflow: hidden;
}

/* Decorative top accent line */
.plan-hero__inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--sc-sage-light), var(--sc-sage), var(--sc-sage-light), transparent);
  border-radius: 0 0 3px 3px;
  opacity: 0.4;
}

/* Link to the library — top-right of hero card */
.plan-hero__lib-link {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--sc-sage);
  text-decoration: none;
  transition: color 0.15s;
}

.plan-hero__lib-link:hover { color: var(--sc-moss); }

.plan-hero__lib-link svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-hero__badge {
  margin-bottom: 12px;
}

.plan-hero__plan {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
}

.plan-hero__name {
  font-family: var(--sc-font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--sc-charcoal);
  line-height: 1;
}

.plan-hero__price {
  font-family: var(--sc-font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sc-bark);
}

.plan-hero__price span {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--sc-text-tertiary);
}

.plan-hero__trial {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  color: var(--sc-status-in-progress);
  background: var(--sc-status-in-progress-bg);
  padding: 5px 12px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.plan-hero__trial svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}

/* Plan limits row */
.plan-hero__limits {
  display: flex;
  align-items: center;
  gap: 0;
}

.plan-hero__limit {
  flex: 1;
  text-align: center;
  padding: 14px 12px;
  background: rgba(107, 127, 94, 0.04);
  border-radius: 10px;
}

.plan-hero__limit:first-child { border-radius: 10px 0 0 10px; }
.plan-hero__limit:last-child { border-radius: 0 10px 10px 0; }

.plan-hero__limit-value {
  font-family: var(--sc-font-ui);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--sc-bark);
  line-height: 1;
  margin-bottom: 4px;
}

.plan-hero__limit-label {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: var(--sc-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-hero__limit-divider {
  width: 1px;
  height: 36px;
  background: var(--sc-border-subtle);
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════
   3. ACCOUNT USAGE (3-column stats)
   ═══════════════════════════════════════════ */

.plan-usage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.plan-usage-stat {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 14px;
  padding: 18px 20px;
}

.plan-usage-stat__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.plan-usage-stat__label {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--sc-bark);
}

.plan-usage-stat__count {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sc-bark);
}

.plan-usage-stat__count span {
  font-weight: 400;
  color: var(--sc-text-tertiary);
}

.plan-usage-stat__addon {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--sc-sage);
  margin-top: 6px;
}


/* ═══════════════════════════════════════════
   4. EXPANDABLE LIBRARY LIST
   ═══════════════════════════════════════════ */

.plan-libraries__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-lib {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.plan-lib:hover {
  border-color: var(--sc-sand);
}

/* Header row: wraps the toggle button + open-library link */
.plan-lib__header {
  display: flex;
  align-items: center;
}

/* Toggle button (expand/collapse) */
.plan-lib__toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

/* Open-library link */
.plan-lib__open-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 20px 0 12px;
  font-family: var(--sc-font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--sc-sage);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s;
}

.plan-lib__open-link:hover { color: var(--sc-moss); }

.plan-lib__open-link svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.plan-lib__monogram {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sc-font-display);
  font-size: 0.95rem;
  color: white;
  flex-shrink: 0;
}

.plan-lib__monogram--empty {
  background: var(--sc-cream-dark);
  border: 2px dashed var(--sc-border);
}

.plan-lib__monogram--empty svg {
  width: 18px;
  height: 18px;
  stroke: var(--sc-text-tertiary);
}

.plan-lib__info {
  flex: 1;
  min-width: 0;
}

.plan-lib__name {
  font-family: var(--sc-font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sc-bark);
}

.plan-lib__meta {
  font-family: var(--sc-font-ui);
  font-size: 0.75rem;
  color: var(--sc-text-tertiary);
  margin-top: 2px;
}

.plan-lib__chevron {
  width: 18px;
  height: 18px;
  stroke: var(--sc-text-tertiary);
  fill: none;
  flex-shrink: 0;
  transition: transform 0.25s;
}

/* Expand/collapse */
.plan-lib__detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.plan-lib--open .plan-lib__detail {
  max-height: 600px;
}

.plan-lib--open .plan-lib__chevron {
  transform: rotate(180deg);
}

.plan-lib__detail > .lib-stats-card {
  padding: 0 20px 20px;
}

/* Empty slot (link) */
.plan-lib--empty {
  text-decoration: none;
  color: inherit;
  border-style: dashed;
  background: var(--sc-cream);
}

.plan-lib--empty:hover {
  border-color: var(--sc-rust-soft);
  background: rgba(184, 96, 63, 0.02);
}

.plan-lib--empty .plan-lib__name {
  color: var(--sc-rust);
  font-weight: 500;
}

.plan-lib--empty .plan-lib__header {
  cursor: pointer;
}


/* ═══════════════════════════════════════════
   5. ADD-ON STORAGE
   ═══════════════════════════════════════════ */

.plan-addon-card {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 14px;
  padding: 24px;
}

.plan-addon-card__desc {
  font-family: var(--sc-font-ui);
  font-size: 0.85rem;
  color: var(--sc-text-secondary);
  margin: 0 0 16px;
}

.plan-addon__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.plan-addon__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  background: var(--sc-cream);
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.plan-addon__option:hover {
  border-color: var(--sc-rust-soft);
  background: rgba(184, 96, 63, 0.02);
  box-shadow: 0 2px 10px rgba(90, 64, 50, 0.06);
}

.plan-addon__option--active {
  border-color: var(--sc-sage);
  background: rgba(107, 127, 94, 0.04);
  box-shadow: 0 0 0 1px var(--sc-sage);
}

.plan-addon__option--active:hover {
  border-color: var(--sc-sage);
  background: rgba(107, 127, 94, 0.06);
  box-shadow: 0 0 0 1px var(--sc-sage);
}

.plan-addon__option-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sc-sage);
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-addon__option-check svg {
  width: 12px;
  height: 12px;
  stroke: white;
}

.plan-addon__option-size {
  font-family: var(--sc-font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sc-bark);
}

.plan-addon__option-price {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  color: var(--sc-text-tertiary);
}


/* ═══════════════════════════════════════════
   6. PLAN TIER COMPARISON GRID
   ═══════════════════════════════════════════ */

/* Trial note above tiers */
.plan-tiers__trial-note {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sc-font-ui);
  font-size: 0.85rem;
  color: var(--sc-text-secondary);
  padding: 14px 18px;
  background: rgba(107, 127, 94, 0.05);
  border: 1px solid rgba(107, 127, 94, 0.12);
  border-radius: 10px;
  margin-bottom: 16px;
}

.plan-tiers__trial-note svg {
  width: 18px;
  height: 18px;
  stroke: var(--sc-sage);
  fill: none;
  flex-shrink: 0;
}

.plan-tiers__trial-note strong {
  color: var(--sc-sage);
}

/* Library upgrade hint */
.plan-lib-upgrade-hint {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  color: var(--sc-text-tertiary);
  margin-top: 12px;
  padding-left: 4px;
}

.plan-lib-upgrade-hint a {
  color: var(--sc-rust);
  font-weight: 500;
  text-decoration: none;
}

.plan-lib-upgrade-hint a:hover {
  text-decoration: underline;
}

.plan-tiers__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.plan-tier {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.plan-tier--active {
  border-color: var(--sc-sage);
  box-shadow: 0 0 0 1px var(--sc-sage), 0 4px 16px rgba(107, 127, 94, 0.1);
}

.plan-tier--recommended {
  border-color: var(--sc-rust);
  box-shadow: 0 0 0 1px var(--sc-rust), 0 4px 16px rgba(184, 96, 63, 0.1);
}

.plan-tier__badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 10px;
  font-family: var(--sc-font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-tier--active .plan-tier__badge {
  background: rgba(107, 127, 94, 0.1);
  color: var(--sc-sage);
}

.plan-tier--recommended .plan-tier__badge {
  background: rgba(184, 96, 63, 0.1);
  color: var(--sc-rust);
}

.plan-tier__name {
  font-family: var(--sc-font-display);
  font-size: 1.15rem;
  color: var(--sc-charcoal);
}

.plan-tier__price {
  font-family: var(--sc-font-ui);
}

.plan-tier__price-amount {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--sc-bark);
}

.plan-tier__price-period {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--sc-text-tertiary);
}

.plan-tier__limits {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  color: var(--sc-text-secondary);
  line-height: 1.6;
}

.plan-tier__limits strong {
  color: var(--sc-bark);
  font-weight: 600;
}

/* Feature checklist */
.plan-tier__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.plan-tier__feature {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  color: var(--sc-text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.plan-tier__feature svg {
  width: 16px;
  height: 16px;
  stroke: var(--sc-sage);
  fill: none;
  flex-shrink: 0;
  margin-top: 1px;
}

.plan-tier__feature--disabled {
  opacity: 0.4;
}

.plan-tier__feature--disabled svg {
  stroke: var(--sc-text-tertiary);
}

.plan-tier__cta {
  margin-top: auto;
}

.plan-tier__cta .btn {
  width: 100%;
  justify-content: center;
}


/* ═══════════════════════════════════════════
   7. CURRENT PLAN (simple card — personal plan)
   ═══════════════════════════════════════════ */

.plan-current {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 28px;
}

.plan-current__label {
  font-family: var(--sc-font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sc-text-tertiary);
  margin-bottom: 10px;
}

.plan-current__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.plan-current__name {
  font-family: var(--sc-font-display);
  font-size: 1.25rem;
  color: var(--sc-charcoal);
}

.plan-current__price {
  font-family: var(--sc-font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sc-bark);
}

.plan-current__price span {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--sc-text-tertiary);
}

.plan-current__meta {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  color: var(--sc-text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ═══════════════════════════════════════════
   8. USAGE BARS (simple — personal plan)
   ═══════════════════════════════════════════ */

.plan-usage {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 28px;
}

.plan-usage__label {
  font-family: var(--sc-font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sc-text-tertiary);
  margin-bottom: 16px;
}

.plan-usage__items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.plan-usage__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-usage__item-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.plan-usage__item-name {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sc-bark);
}

.plan-usage__item-count {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  color: var(--sc-text-tertiary);
}

.plan-usage__bar {
  height: 6px;
  background: var(--sc-cream-dark);
  border-radius: 3px;
  overflow: hidden;
}

.plan-usage__bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--sc-sage), var(--sc-sage-light));
  transition: width 0.5s ease;
}


/* ═══════════════════════════════════════════
   9. RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 960px) {
  .plan-tiers__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .plan-hero__inner {
    padding: 24px 20px;
  }

  .plan-hero__plan {
    flex-direction: column;
    gap: 4px;
  }

  .plan-hero__limits {
    flex-direction: column;
    gap: 8px;
  }

  .plan-hero__limit {
    border-radius: 10px;
  }

  .plan-hero__limit-divider {
    width: 100%;
    height: 1px;
  }

  .plan-usage-grid {
    grid-template-columns: 1fr;
  }

  .plan-tiers__grid {
    grid-template-columns: 1fr;
  }

  .plan-current__row {
    flex-direction: column;
    gap: 8px;
  }

  .plan-usage__items {
    grid-template-columns: 1fr;
  }

  .plan-addon__options {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  }
}
.lib-stats-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── Storage Hero ─── */
.lib-stats-card__storage {
  padding: 20px 22px;
  background: linear-gradient(135deg, rgba(74, 94, 60, 0.04) 0%, rgba(107, 127, 94, 0.06) 100%);
  border: 1px solid rgba(107, 127, 94, 0.10);
  border-radius: 14px;
}

.lib-stats-card__storage-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.lib-stats-card__storage-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(74, 94, 60, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lib-stats-card__storage-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--sc-moss);
}

.lib-stats-card__storage-info {
  flex: 1;
  min-width: 0;
}

.lib-stats-card__storage-label {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sc-text-tertiary);
  margin-bottom: 2px;
}

.lib-stats-card__storage-value {
  font-family: var(--sc-font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sc-bark);
}

/* Stacked storage bar */
.lib-storage-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-top: 14px;
  gap: 2px;
}

.lib-storage-bar__segment {
  height: 100%;
  border-radius: 3px;
  min-width: 4px;
  transition: opacity 0.2s;
  cursor: default;
  position: relative;
}

.lib-storage-bar__segment:hover {
  opacity: 0.75;
}

.lib-storage-bar__segment--images { background: var(--sc-sage); }
.lib-storage-bar__segment--videos { background: var(--sc-rust-soft); }
.lib-storage-bar__segment--audio { background: var(--sc-bark-light); }
.lib-storage-bar__segment--other { background: var(--sc-sand); }

/* Legend */
.lib-storage-bar__legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.lib-storage-bar__legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: var(--sc-text-tertiary);
}

.lib-storage-bar__legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.lib-storage-bar__legend-dot--images { background: var(--sc-sage); }
.lib-storage-bar__legend-dot--videos { background: var(--sc-rust-soft); }
.lib-storage-bar__legend-dot--audio { background: var(--sc-bark-light); }
.lib-storage-bar__legend-dot--other { background: var(--sc-sand); }

/* ─── Stats Grid ─── */
.lib-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.lib-stat {
  position: relative;
  padding: 16px 16px 14px;
  background: var(--sc-cream);
  border: 1px solid var(--sc-border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lib-stat:hover {
  border-color: var(--sc-sand);
  box-shadow: 0 2px 10px rgba(90, 64, 50, 0.06);
}

/* Featured stat (e.g., Memories — the primary metric) */
.lib-stat--featured {
  background: linear-gradient(135deg, rgba(107, 127, 94, 0.05) 0%, var(--sc-cream) 60%);
  border-color: rgba(107, 127, 94, 0.12);
}

/* Accent stat (e.g., Prompts) */
.lib-stat--accent {
  background: linear-gradient(135deg, rgba(184, 96, 63, 0.04) 0%, var(--sc-cream) 60%);
  border-color: rgba(184, 96, 63, 0.10);
}

/* Icon */
.lib-stat__icon {
  margin-bottom: 10px;
}

.lib-stat__icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--sc-bark-faint);
  opacity: 0.5;
}

.lib-stat--featured .lib-stat__icon svg {
  stroke: var(--sc-sage);
  opacity: 0.7;
}

.lib-stat--accent .lib-stat__icon svg {
  stroke: var(--sc-rust-soft);
  opacity: 0.7;
}

/* Body */
.lib-stat__body {
  position: relative;
  z-index: 1;
}

.lib-stat__number {
  font-family: var(--sc-font-ui);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sc-bark);
  line-height: 1;
  margin-bottom: 4px;
}

.lib-stat__label {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: var(--sc-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Sparkline — positioned in bottom-right corner */
.lib-stat__spark {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 65%;
  height: 32px;
  opacity: 0.8;
}

.lib-stat__spark polyline {
  fill: none;
  stroke: var(--sc-sage-light);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lib-stat__spark--rust polyline {
  stroke: var(--sc-rust-soft);
}

/* Growth indicator */
.lib-stat__growth {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: var(--sc-font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--sc-sage);
  background: rgba(107, 127, 94, 0.08);
  padding: 2px 7px;
  border-radius: 6px;
  z-index: 1;
}

.lib-stat__growth--rust {
  color: var(--sc-rust);
  background: rgba(184, 96, 63, 0.08);
}

/* Growth tooltip on hover */
.lib-stat__growth::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--sc-charcoal);
  color: white;
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}

.lib-stat__growth::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  right: 8px;
  border: 4px solid transparent;
  border-top-color: var(--sc-charcoal);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}

.lib-stat__growth:hover::after,
.lib-stat__growth:hover::before {
  opacity: 1;
}
