/*
 * The Kids Savings Goal Calculator (KID-1324): the goal reached or out of reach, the progress bar, the milestones, and
 * the weekly tracker ticked on paper.
 */
@layer pages {
  .kp-savings__state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--kp-space-2);
    padding: var(--kp-space-6);
    border-radius: var(--kp-radius-md);
    background: #e7f5eb;
    color: #21633a;
    text-align: center;
    break-inside: avoid;
  }

  .kp-savings__state--warning {
    background: #fff6cc;
    color: #5c4300;
  }

  .kp-savings__state > span {
    font-size: 2.5rem;
    line-height: 1;
  }

  .kp-savings__state h3 {
    color: inherit;
    font-size: 1.375rem;
  }

  .kp-savings__state p {
    max-width: 34rem;
    color: var(--kp-ink);
    line-height: var(--kp-body-leading);
  }

  .kp-savings__progress {
    display: flex;
    flex-direction: column;
    gap: var(--kp-space-2);
  }

  .kp-savings__bar {
    display: block;
    height: 0.875rem;
    overflow: hidden;
    border-radius: var(--kp-radius-pill);
    background: var(--kp-alt-2);
  }

  .kp-savings__bar > span {
    display: block;
    block-size: 100%;
    border-radius: inherit;
    background: var(--kp-brand);
  }

  .kp-savings__ends {
    display: flex;
    justify-content: space-between;
    color: var(--kp-ink-2);
    font-size: 0.875rem;
    font-weight: 700;
  }

  .kp-savings__milestones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: var(--kp-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .kp-savings__milestones li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--kp-space-1);
    padding: var(--kp-space-3);
    border-radius: var(--kp-radius-sm);
    background: var(--kp-alt);
    text-align: center;
    break-inside: avoid;
  }

  .kp-savings__milestones small {
    color: var(--kp-muted);
    font-size: 0.75rem;
  }

  .kp-savings__marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.875rem;
    height: 2.875rem;
    border: 2px solid var(--kp-border-2);
    border-radius: 50%;
    background: #ffffff;
    color: var(--kp-ink-2);
    font-size: 0.6875rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }

  .kp-savings__milestones .is-reached .kp-savings__marker {
    border-color: var(--kp-brand);
    background: var(--kp-brand);
    color: #ffffff;
  }

  .kp-savings__tracker {
    padding: var(--kp-space-5);
    border: 2px dashed var(--kp-border-2);
    border-radius: var(--kp-radius-md);
    break-inside: avoid;
  }

  .kp-savings__tracker-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--kp-space-2);
    font-size: 1.0625rem;
  }

  .kp-savings__weeks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(3.5rem, 1fr));
    gap: var(--kp-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .kp-savings__weeks li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--kp-space-1);
    padding: var(--kp-space-2);
    border: 1px solid var(--kp-border);
    border-radius: var(--kp-radius-sm);
    color: var(--kp-muted);
    font-size: 0.75rem;
    font-weight: 800;
  }

  .kp-savings__weeks .kp-checklist__box {
    width: 1.5rem;
    height: 1.5rem;
  }

  .kp-savings__more,
  .kp-savings__save {
    color: var(--kp-ink-2);
  }
}
