/*
 * goal-editor.css — Goal editor overlay: unique styles.
 * Shared overlay styles (container, backdrop, card, header, close button,
 * inputs, save button) live in overlay.css.
 *
 * Load after overlay.css.
 */

/* ---- Card (narrower than habit editor — simpler form) ------------------- */
.goal-editor__card {
  width: min(360px, calc(100vw - 32px));
}

/* ---- Body --------------------------------------------------------------- */
.goal-editor__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Habit context label (read-only, shows which habit the goal belongs to) */
.goal-editor__habit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ---- Fields ------------------------------------------------------------- */
.goal-editor__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Field row: Target + Unit side by side */
.goal-editor__row {
  display: flex;
  gap: 12px;
}
.goal-editor__row .goal-editor__field {
  flex: 1;
  min-width: 0;
}

/* Track select — styled like overlay inputs, with a theme-adaptive arrow */
.goal-editor__select {
  cursor: pointer;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='currentColor'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  -webkit-appearance: none;
  appearance: none;
}

/* Baseline field — only visible while Direction is "decrease" (inline
   display:none is applied/toggled by goal-editor.js) */
.goal-editor__baseline {
  display: none;
}

/* ---- Footer ------------------------------------------------------------- */
.goal-editor__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

/* ---- Goal wizard (2.3) -------------------------------------------------- */
.goal-wizard__habit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.goal-wizard__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.goal-wizard__prompt {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.goal-wizard__preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  font: inherit;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.goal-wizard__preset:hover {
  border-color: var(--accent);
}
.goal-wizard__preset-label {
  font-weight: 600;
}
.goal-wizard__preset-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.goal-wizard__custom {
  align-self: flex-start;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.goal-wizard__custom:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.goal-wizard__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.goal-wizard__field .overlay__input {
  width: 100%;
}

.goal-wizard__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}