.goals-page {
  color: var(--ink, #19182b);
  container-type: inline-size;
}

.goals-info.goals-glossary { display: block; margin-top: 12px; }
.goals-glossary summary { cursor: pointer; font-weight: 750; }
.goals-glossary dl { display: grid; gap: 10px; margin: 13px 0 8px; font-size: 12px; }
.goals-glossary dt { font-weight: 750; }
.goals-glossary dd { margin: 2px 0 0; color: var(--muted); }

.goals-page-header,
.goals-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-bottom: 20px;
}

.goals-page-header h1 {
  margin: 8px 0 4px;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 750;
  letter-spacing: -.045em;
  line-height: 1.14;
}

.goals-page-header p,
.goals-editor p,
.goals-card p,
.goals-info p {
  margin: 0;
  color: var(--muted, #68677c);
  line-height: 1.55;
}

.goals-page-tag,
.goals-button,
.goals-link,
.goals-metric-state,
.goals-notice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.goals-page-tag {
  padding: 4px 9px;
  border-radius: 7px;
  background: #eee9ff;
  color: #5337cc;
  font-size: .75rem;
  font-weight: 700;
}

.goals-button {
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line, #ebeaf2);
  border-radius: 9px;
  background: white;
  color: var(--ink, #19182b);
  font: inherit;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
}

.goals-button:hover { background: #faf8ff; }
.goals-button:focus-visible, .goals-switch button:focus-visible, .goals-link:focus-visible, .goals-field input:focus-visible {
  outline: 2px solid var(--accent, #6547ed);
  outline-offset: 3px;
}

.goals-button-primary {
  border-color: var(--accent, #6547ed);
  background: var(--accent, #6547ed);
  color: white;
}

.goals-button-primary:hover { background: #573bd7; }
.goals-button-soft { color: var(--muted, #68677c); }

.goals-switch {
  display: inline-flex;
  border: 1px solid var(--line, #ebeaf2);
  border-radius: 10px;
  padding: 4px;
  background: #f2f0f8;
}

.goals-switch button {
  border: 0;
  padding: 8px 11px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted, #68677c);
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}

.goals-switch button[aria-pressed="true"] {
  background: white;
  color: var(--ink, #19182b);
  box-shadow: 0 1px 3px #27204a16;
}

.goals-views {
  padding: 7px 10px;
  border-radius: 8px;
  background: white;
  color: var(--muted, #68677c);
  font-size: .84rem;
}

.goals-views strong { color: var(--ink, #19182b); }

.goals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.goals-card,
.goals-editor {
  min-width: 0;
  padding: clamp(16px, 2.5vw, 24px);
  border: 1px solid var(--line, #ebeaf2);
  border-radius: 15px;
  background: white;
}

.goals-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.goals-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 8px;
}

.goals-card-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: #eee9ff;
  color: #5d42d4;
}

.goals-card h3,
.goals-editor h3 {
  margin: 0;
  font-size: 1.16rem;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -.025em;
}

.goals-card-header h3,
.goals-card-header p { grid-column: 1 / -1; }
.goals-card-header p, .goals-editor p { font-size: .88rem; }

.goals-readiness {
  align-self: center;
  padding: 5px 8px;
  border-radius: 20px;
  background: #f2f0f9;
  color: #615772;
  font-size: .71rem;
  line-height: 1.3;
  text-align: center;
  font-weight: 700;
}

.goals-readiness-met {
  background: #e2f7ec;
  color: #176744;
}

.goals-criteria {
  display: grid;
  gap: 9px;
}

.goals-criteria-label {
  margin-top: 5px;
  color: var(--muted, #68677c);
  font-size: .73rem;
  font-weight: 750;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.goals-metric {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid #efedf7;
  border-radius: 9px;
  background: #faf9fe;
}

.goals-metric-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  gap: 3px 10px;
  font-size: .83rem;
  font-weight: 700;
}

.goals-metric-state {
  color: var(--muted, #68677c);
  font-size: .73rem;
  white-space: nowrap;
}

.goals-metric-met .goals-metric-state { color: #176744; }

.goals-metric-value {
  color: var(--muted, #68677c);
  font-size: .9rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.goals-metric-value strong {
  color: var(--ink, #19182b);
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -.025em;
}

.goals-metric .goal-progress {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 10px;
  background: #e8e4f5;
}

.goals-metric .goal-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, #6547ed);
}

.goals-metric-met .goal-progress span { background: #229364; }
.goals-metric small { color: var(--muted, #68677c); font-size: .72rem; }

.goals-or {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted, #68677c);
  font-size: .75rem;
}

.goals-or::before, .goals-or::after { content: ''; flex: 1; height: 1px; background: var(--line, #ebeaf2); }

.goals-link {
  width: fit-content;
  color: #573acf;
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
}

.goals-link:hover { text-decoration: underline; }
.goals-card > .goals-link { margin-top: auto; }

.goals-info {
  display: flex;
  align-items: start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 15px 16px;
  border: 1px solid #eae4fc;
  border-radius: 11px;
  background: #f6f3fe;
  font-size: .88rem;
}

.goals-info > svg { flex-shrink: 0; color: #5d42d4; }
.goals-info p { margin-top: 5px; }
.goals-info-studio { margin-top: 16px; }
.goals-info-studio .goals-link { margin-top: 7px; }

.goals-editor { margin-bottom: 18px; }
.goals-editor-head { margin-bottom: 17px; }
.goals-editor-head p { margin-top: 6px; }

.goals-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px 14px;
}

.goals-field {
  display: grid;
  gap: 5px;
  color: var(--ink, #19182b);
  font-size: .84rem;
  font-weight: 700;
}

.goals-field small { color: var(--muted, #68677c); font-size: .7rem; font-weight: 500; }

.goals-field input {
  width: 100%;
  height: 39px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #dcd8e9;
  border-radius: 8px;
  background: white;
  color: var(--ink, #19182b);
  font: inherit;
}

.goals-field input::placeholder { color: #787486; font-weight: 500; }

.goals-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.goals-notice {
  margin-bottom: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #e2f7ec;
  color: #176744;
  font-size: .85rem;
  font-weight: 700;
}

.goals-notice svg { flex-shrink: 0; }

@container (max-width: 660px) {
  .goals-grid { grid-template-columns: 1fr; }
  .goals-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (max-width: 390px) {
  .goals-fields { grid-template-columns: 1fr; }
}
