.monthly-goal-app {
  --mg-blue: #245bd7;
  --mg-ink: #17233b;
  --mg-muted: #728099;
  display: grid;
  gap: 16px;
}

.monthly-goal-hero {
  align-items: center;
  background: linear-gradient(135deg, #173d96, #2e6de4);
  border-radius: 17px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 24px 28px;
}

.monthly-goal-hero span,
.monthly-goal-hero p {
  color: rgba(255,255,255,.78);
  font-size: 12px;
  margin: 0;
}

.monthly-goal-hero h4 {
  font-size: 25px;
  margin: 3px 0 5px;
}

.monthly-goal-hero-copy {
  display: grid;
  justify-items: start;
}

.monthly-goal-period-switch {
  background: rgba(8, 31, 82, .24);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  display: inline-flex;
  gap: 3px;
  margin-top: 14px;
  padding: 3px;
}

.monthly-goal-period-switch button {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: rgba(255,255,255,.78);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  min-width: 58px;
  padding: 7px 10px;
}

.monthly-goal-period-switch button.is-active {
  background: #fff;
  box-shadow: 0 4px 12px rgba(9, 29, 76, .18);
  color: #214fba;
}

.monthly-goal-period-switch button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.monthly-goal-cycle {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 13px;
  display: grid;
  gap: 4px;
  min-width: 280px;
  padding: 13px 16px;
}

.monthly-goal-note {
  align-items: center;
  background: #f3f7ff;
  border: 1px solid #dbe7ff;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  padding: 11px 14px;
}

.monthly-goal-note strong { color: var(--mg-blue); font-size: 12px; }
.monthly-goal-note span { color: var(--mg-muted); font-size: 12px; }

.monthly-goal-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
}

.monthly-goal-card {
  background: #fff;
  border: 1px solid #e0e6f0;
  border-radius: 14px;
  display: grid;
  gap: 12px;
  padding: 15px;
}

.monthly-goal-card.is-pending { background: #fafbfc; }
.monthly-goal-card header { align-items: center; display: flex; justify-content: space-between; }
.monthly-goal-card header strong { color: var(--mg-ink); }
.monthly-goal-card header span { background: #edf3ff; border-radius: 999px; color: var(--mg-blue); font-size: 10px; padding: 4px 7px; }
.monthly-goal-card.is-pending header span { background: #f0f1f3; color: #7b8493; }
.monthly-goal-card label { display: grid; gap: 6px; }
.monthly-goal-card label > span { color: var(--mg-muted); font-size: 11px; }
.monthly-goal-card label > div { align-items: center; display: grid; gap: 7px; grid-template-columns: 1fr auto; }
.monthly-goal-card input { background: #fff; border: 1px solid #d5deeb; border-radius: 9px; min-height: 39px; padding: 8px 10px; width: 100%; }
.monthly-goal-card b { color: var(--mg-muted); font-size: 11px; }
.monthly-goal-result { align-items: baseline; display: grid; grid-template-columns: auto 1fr auto; gap: 7px; }
.monthly-goal-result span { color: var(--mg-muted); font-size: 11px; }
.monthly-goal-result strong { color: var(--mg-ink); font-size: 17px; }
.monthly-goal-result em { color: var(--mg-blue); font-size: 11px; font-style: normal; }
.monthly-goal-progress { background: #edf1f6; border-radius: 999px; height: 7px; overflow: hidden; }
.monthly-goal-progress i { background: linear-gradient(90deg, #2f68df, #52a0f1); border-radius: inherit; display: block; height: 100%; }
.monthly-goal-card.is-pending .monthly-goal-progress i { width: 0 !important; }

.monthly-goal-savebar {
  align-items: center;
  background: #fff;
  border: 1px solid #dfe6f1;
  border-radius: 13px;
  box-shadow: 0 10px 28px rgba(31, 52, 89, .08);
  display: flex;
  justify-content: space-between;
  padding: 13px 16px;
  position: sticky;
  bottom: 8px;
}

.monthly-goal-savebar > div { display: grid; gap: 2px; }
.monthly-goal-savebar span { color: var(--mg-muted); font-size: 11px; }
.monthly-goal-loading { color: var(--mg-muted); padding: 42px; text-align: center; }

@media (max-width: 1100px) {
  .monthly-goal-grid { grid-template-columns: repeat(2, minmax(190px, 1fr)); }
}

@media (max-width: 680px) {
  .monthly-goal-hero, .monthly-goal-savebar { align-items: stretch; flex-direction: column; gap: 12px; }
  .monthly-goal-cycle { min-width: 0; }
  .monthly-goal-period-switch { width: 100%; }
  .monthly-goal-period-switch button { flex: 1; }
  .monthly-goal-grid { grid-template-columns: 1fr; }
}
