.cg-goals {
  --goal-ink: #f3f0ff;
  --goal-muted: #d2cde8;
  --goal-border: #5b5678;
  display: grid;
  gap: 16px;
  margin: 22px 0;
  padding: clamp(16px, 3vw, 30px);
  border: 1px solid #494362;
  border-radius: clamp(18px, 3vw, 28px);
  background: radial-gradient(ellipse at 100% 0, #463968 0, transparent 55%), linear-gradient(143deg,#242441,#15172d 72%);
  color: var(--goal-ink);
  scroll-margin-top: 116px;
}

.cg-goals__head, .cg-goals__result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 22px;
}

.cg-goals h2, .cg-goals h3, .cg-goals h4 {
  margin: 0;
  color: var(--goal-ink);
  font-family: var(--font-display, system-ui, sans-serif);
  letter-spacing: -.025em;
}

.cg-goals h2 { font-size: clamp(1.35rem, 2.5vw, 2.2rem); }
.cg-goals h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
.cg-goals h4 { font-size: clamp(.96rem, 1.4vw, 1.16rem); }
.cg-goals p { margin: 5px 0 0; color: var(--goal-muted); font-size: .89rem; line-height: 1.45; }
.cg-goals .cg-goals__browse {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  color: #e3d8ff;
  font-size: .83rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cg-goals__choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.cg-goals .cg-goals__choice {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 9px;
  min-height: 68px;
  padding: 9px;
  border: 1px solid var(--goal-border);
  border-radius: 13px;
  background: #302c49;
  color: var(--goal-ink);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.cg-goals .cg-goals__choice:hover, .cg-goals .cg-goals__choice[aria-current] { background: #474066; border-color: #af9ad6; }
.cg-goals a:focus-visible { outline: 2px solid #f2d6ff; outline-offset: 3px; }
.cg-goals__icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: #484064; color: #e4d2ff; }
.cg-goals__icon svg { width: 20px; height: 20px; }
.cg-goals__arrow { color: #e1cffb; font-size: .85rem; }

.cg-goals__result { display: none; padding-top: 14px; border-top: 1px solid var(--goal-border); scroll-margin-top: 116px; }
.cg-goals:not([data-enhanced]) .cg-goals__result:target { display: block; }
.cg-goals[data-enhanced] .cg-goals__result:not([hidden]) { display: block; }
.cg-goals__matches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.cg-goals__match {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 9px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--goal-border);
  border-radius: 14px;
  background: #25243f;
}
.cg-goals__cover { display: block; overflow: hidden; border-radius: 8px; background: #393653; aspect-ratio: 1.9; }
.cg-goals__cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.cg-goals__copy { min-width: 0; overflow-wrap: anywhere; }
.cg-goals__copy p { font-size: .82rem; }
.cg-goals__actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 7px; }
.cg-goals__actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding: 5px 6px;
  border: 1px solid #8f82ad;
  border-radius: 8px;
  color: var(--goal-ink);
  font-size: .8rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.cg-goals__actions a:last-child { border-color: #e2d3ff; background: #e2d3ff; color: #231c39; }
.cg-goals__actions a:hover { border-color: #ffedff; text-decoration: underline; }

.cg-setup [data-cw-goal-guide] { margin: 0 0 14px; }
.cg-setup [data-cw-goal-guide][hidden] { display: none !important; }
.cg-setup .cw-goal-module { display: block; margin-top: 3px; color: #493092; font-size: .74rem; font-weight: 750; }

@media (max-width: 880px) {
  .cg-goals__choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 659px) {
  .cg-goals { gap: 10px; scroll-margin-top: 84px; }
  .cg-goals p { font-size: .84rem; }
  .cg-goals__result { scroll-margin-top: 84px; }
  .cg-goals .cg-goals__choice { grid-template-columns: 28px minmax(0, 1fr); padding: 7px; gap: 6px; min-height: 60px; font-size: .82rem; }
  .cg-goals__icon { width: 28px; height: 28px; }
  .cg-goals__icon svg { width: 17px; height: 17px; }
  .cg-goals__arrow { display: none; }
  .cg-goals__matches { grid-template-columns: minmax(0, 1fr); }
  .cg-goals__match { grid-template-columns: minmax(74px, 34%) minmax(0, 1fr); grid-template-rows: auto auto; }
  .cg-goals__cover { align-self: center; aspect-ratio: 1.6; }
  .cg-goals__actions { grid-column: 1 / -1; }
}
