/* Goals Panel — compact pill strip pinned above chat messages */

#goals-panel {
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

#goals-panel.hidden {
  display: none;
}

/* ── Pill strip (horizontally scrollable) ── */

.goals-strip {
  display: flex;
  align-items: center;
  gap: 4px;
}

.goals-pills-scroll {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.goals-pills-scroll::before,
.goals-pills-scroll::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  z-index: 1;
  pointer-events: none;
}

.goals-pills-scroll::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}

.goals-pills-scroll::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}

.goals-pills-row {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  overflow-y: visible;
  flex-wrap: nowrap;
  scrollbar-width: none;
  padding: 8px 16px 8px 6px;
}

.goals-pills-row::-webkit-scrollbar {
  display: none;
}

/* ── Goal pill (shared between panel and confirmation card) ── */

.goal-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.3;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transition: border-color 0.15s;
  flex-shrink: 0;
  max-width: 100%;
}

.goal-confirmation-pills .goal-pill {
  flex-shrink: 1;
}

.goal-pill.status-fulfilled {
  border-color: var(--success, #22c55e);
}

.goal-pill.status-fulfilled .goal-status-icon {
  color: var(--success, #22c55e);
}

.goal-pill.status-unfulfilled .goal-status-icon {
  color: var(--error, #ef4444);
}

.goal-pill.status-partial .goal-status-icon {
  color: var(--warning, #f59e0b);
}

.goal-pill.status-pending .goal-status-icon {
  color: var(--text-muted);
  font-size: 8px;
}

.goal-status-icon {
  font-size: 11px;
  flex-shrink: 0;
}

.goal-text {
  cursor: pointer;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.goal-text:hover {
  opacity: 0.8;
}

.goal-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  color: var(--text-muted);
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.goal-pill:hover .goal-remove,
.goal-pill:hover .goal-toggle-kind {
  opacity: 1;
}

.goal-remove:hover,
.goal-toggle-kind:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── Toggle kind button (hover-visible, top-left) ── */

.goal-toggle-kind {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--text-muted);
  cursor: pointer;
  font-size: 8px;
  line-height: 14px;
  text-align: center;
  color: var(--text-muted);
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

/* ── Non-goal pill variant ── */

.goal-pill.kind-non_goal {
  border-style: dashed;
  border-color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 5%, transparent);
}

.goal-pill.kind-non_goal .goal-status-icon {
  color: var(--text-muted);
}

.goal-pill.kind-non_goal.status-respected .goal-text {
  text-decoration: line-through;
  opacity: 0.6;
}

.goal-pill.kind-non_goal.status-violated {
  border-color: var(--error, #ef4444);
}

.goal-pill.kind-non_goal.status-violated .goal-status-icon {
  color: var(--error, #ef4444);
}

.goal-add-btn {
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.goal-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.goal-add-btn.hidden {
  display: none;
}

.goal-add-input {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.goal-add-input input {
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  outline: none;
  min-width: 200px;
}

.goal-add-input button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  padding: 2px 4px;
}

.goal-add-input button:hover {
  color: var(--text);
}

.goal-edit-input {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
}

/* ── Inline confirmation card (in chat thread) ── */

.goal-confirmation-card {
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--accent);
  animation: card-fade-in 0.3s ease-out both;
  overflow: hidden;
}

.goal-confirmation-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.goal-confirmation-label.non-goal-label {
  margin-top: 10px;
}

.goal-confirmation-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.goal-confirmation-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.goal-confirmation-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.goal-confirmation-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.goals-skip-btn {
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.goals-skip-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.goals-confirm-btn {
  padding: 6px 16px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.goals-confirm-btn:hover {
  background: var(--accent-hover);
}


/* ── Goal check entry in chat (inline results) ── */

.goal-check-results {
  padding: 8px 12px;
  margin: 4px 0;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  font-size: 12px;
  animation: card-fade-in 0.3s ease-out both;
}

.goal-check-results.goal-check-compact {
  padding: 4px 10px;
  color: var(--text-muted);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.goal-check-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 0;
}

.goal-check-icon {
  flex-shrink: 0;
  font-size: 12px;
}

.goal-check-icon.fulfilled { color: var(--success, #22c55e); }
.goal-check-icon.respected { color: var(--text-muted); }
.goal-check-icon.unfulfilled, .goal-check-icon.violated { color: var(--error, #ef4444); }
.goal-check-icon.partial { color: var(--warning, #f59e0b); }

.goal-check-description {
  color: var(--text);
}

.goal-check-reason {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 4px;
}
