/* Pool Pro Market Analyzer — scoped under .ppp-ma */
.ppp-ma {
  --ma-accent: var(--pico-primary, #3b82f6);
}

/*
 * Location row: use CSS Grid (not flex). Pico + width:100% on inputs collapses flex items
 * next to a button; a fixed `1fr` track gives the field a real width.
 */
.ppp-ma__location-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

@media (min-width: 640px) {
  .ppp-ma__location-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.ppp-ma input.ppp-ma__location-input {
  width: 100%;
  min-width: 0;
  /* grid cell already has width; 100% fills the cell correctly */
  box-sizing: border-box;
}


.ppp-ma__hero {
  padding: 2rem 0 1rem;
}

.ppp-ma__gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.ppp-ma__gauge {
  --pct: 0;
  width: min(14rem, 80vw);
  height: min(14rem, 80vw);
  border-radius: 50%;
  background: conic-gradient(
    var(--ma-accent) calc(var(--pct) * 1%),
    color-mix(in srgb, var(--ma-accent) 12%, transparent) 0
  );
  display: grid;
  place-items: center;
  position: relative;
}

.ppp-ma__gauge::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: var(--ppp-surface-elevated, var(--pico-card-background-color, #1e293b));
}

.ppp-ma__gauge-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.1;
}

.ppp-ma__score-num {
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 800;
}

.ppp-ma__band {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--ppp-text-secondary, #94a3b8);
}

.ppp-ma__subgrid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .ppp-ma__subgrid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ppp-ma__subcard {
  padding: 1rem;
  border-radius: var(--ppp-radius, 0.75rem);
  border: 1px solid var(--ppp-border, #334155);
  background: var(--ppp-surface-elevated, rgba(255, 255, 255, 0.03));
}

.ppp-ma__sublabel {
  font-size: 0.8rem;
  color: var(--ppp-text-muted, #64748b);
  margin-bottom: 0.35rem;
}

.ppp-ma__meter {
  height: 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ma-accent) 15%, transparent);
  overflow: hidden;
}

.ppp-ma__meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ma-accent);
  width: 0%;
  transition: width 0.6s ease;
}

.ppp-ma__seasonal {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  align-items: end;
  height: 140px;
  margin-top: 0.75rem;
}

.ppp-ma__seasonal-bar {
  background: var(--ma-accent);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  opacity: 0.85;
}

.ppp-ma__months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  font-size: 0.65rem;
  color: var(--ppp-text-muted, #64748b);
  text-align: center;
  margin-top: 0.25rem;
}

.ppp-ma__gate {
  margin-top: 2rem;
  padding: 1.25rem;
  border-radius: var(--ppp-radius, 0.75rem);
  border: 1px dashed var(--ppp-border, #475569);
  background: var(--ppp-surface, transparent);
}

.ppp-ma__error {
  color: var(--pico-del-color, #ef4444);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.ppp-ma__loading {
  opacity: 0.7;
  font-size: 0.9rem;
}

.ppp-ma .main-cta:not(.ppp-ma__location-submit) {
  margin-top: 0.5rem;
}
