/* ── AI feature styles ───────────────────────────────────────────────────────── */

/* ── AI status bar (shown in settings) ──────────────────────────────────────── */
.at-ai-status-bar {
  background: var(--at-brand-50);
  border: 1.5px solid var(--at-color-brand);
  border-radius: var(--at-radius-lg);
  padding: var(--at-space-3) var(--at-space-4);
  margin: 0 var(--at-space-4) var(--at-space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--at-space-3);
}

.at-ai-status-label {
  font-size: var(--at-text-sm);
  font-weight: var(--at-weight-medium);
  color: var(--at-brand-800);
}

.at-ai-status-sub {
  font-size: var(--at-text-xs);
  color: var(--at-brand-700);
  margin-top: 2px;
}

.at-ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--at-teal-600);
  flex-shrink: 0;
}

.at-ai-status-dot.off {
  background: var(--at-gray-400);
}

/* ── Think-It-Through chat panel ─────────────────────────────────────────────── */
.at-tit-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 70vh;
}

.at-tit-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--at-space-3) 0;
  display: flex;
  flex-direction: column;
  gap: var(--at-space-2);
  min-height: 120px;
}

.at-tit-bubble {
  max-width: 90%;
  padding: var(--at-space-2) var(--at-space-3);
  border-radius: var(--at-radius-lg);
  font-size: var(--at-text-sm);
  line-height: var(--at-line-normal);
}

.at-tit-bubble.user {
  align-self: flex-end;
  background: var(--at-color-brand);
  color: var(--at-brand-50);
  border-bottom-right-radius: var(--at-radius-sm);
}

.at-tit-bubble.assistant {
  align-self: flex-start;
  background: var(--at-gray-100);
  color: var(--at-text-primary);
  border-bottom-left-radius: var(--at-radius-sm);
}

.at-tit-bubble.thinking {
  background: var(--at-gray-100);
  color: var(--at-text-muted);
  font-style: italic;
  font-size: var(--at-text-xs);
}

.at-tit-input-row {
  display: flex;
  gap: var(--at-space-2);
  padding-top: var(--at-space-2);
  border-top: 0.5px solid var(--at-border);
}

.at-tit-input {
  flex: 1;
  border: 1.5px solid var(--at-border-medium);
  border-radius: var(--at-radius-md);
  padding: var(--at-space-2) var(--at-space-3);
  font-size: var(--at-text-sm);
  background: var(--at-surface-input);
  color: var(--at-text-primary);
  outline: none;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  font-family: var(--at-font-sans);
}

.at-tit-input:focus {
  border-color: var(--at-color-brand);
}

.at-tit-send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--at-radius-md);
  background: var(--at-color-brand);
  color: var(--at-brand-50);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity var(--at-transition-fast);
}

.at-tit-send-btn:disabled { opacity: 0.4; }

.at-tit-resolution {
  background: var(--at-teal-50);
  border-radius: var(--at-radius-md);
  padding: var(--at-space-3);
  margin-top: var(--at-space-2);
  font-size: var(--at-text-sm);
  color: var(--at-teal-800);
  text-align: center;
}

/* ── AI action buttons on task sheet ─────────────────────────────────────────── */
.at-btn-ai-primary {
  background: var(--at-brand-50);
  color: var(--at-brand-800);
  border: 1.5px solid var(--at-color-brand);
  border-radius: var(--at-radius-md);
  padding: var(--at-space-2) var(--at-space-3);
  font-size: var(--at-text-xs);
  font-weight: var(--at-weight-medium);
  cursor: pointer;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: var(--at-space-1);
  transition: all var(--at-transition-fast);
}

.at-btn-ai-primary:active { opacity: 0.75; }

/* ── Daily plan output ────────────────────────────────────────────────────────── */
.at-plan-card {
  background: var(--at-surface-card);
  border-radius: var(--at-radius-lg);
  border: 0.5px solid var(--at-border);
  padding: var(--at-space-3) var(--at-space-4);
  margin: var(--at-space-2) var(--at-space-3);
  display: flex;
  align-items: flex-start;
  gap: var(--at-space-3);
}

.at-plan-time {
  font-size: var(--at-text-xs);
  font-weight: var(--at-weight-medium);
  color: var(--at-text-muted);
  white-space: nowrap;
  padding-top: 2px;
  min-width: 50px;
  flex-shrink: 0;
}

.at-plan-title {
  font-size: var(--at-text-sm);
  font-weight: var(--at-weight-medium);
  color: var(--at-text-primary);
  line-height: var(--at-line-tight);
}

.at-plan-note {
  font-size: var(--at-text-xs);
  color: var(--at-text-muted);
  margin-top: 3px;
  font-style: italic;
  line-height: var(--at-line-normal);
}

.at-plan-narrative {
  background: var(--at-brand-50);
  border-radius: var(--at-radius-lg);
  padding: var(--at-space-4);
  margin: var(--at-space-3) var(--at-space-3) var(--at-space-1);
  font-size: var(--at-text-sm);
  color: var(--at-brand-800);
  line-height: var(--at-line-loose);
}

/* ── Sunday Review ────────────────────────────────────────────────────────────── */
.at-review-section {
  background: var(--at-surface-card);
  border-radius: var(--at-radius-lg);
  border: 0.5px solid var(--at-border);
  padding: var(--at-space-4);
  margin: var(--at-space-2) var(--at-space-3);
}

.at-review-section-label {
  font-size: var(--at-text-xs);
  font-weight: var(--at-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--at-text-muted);
  margin-bottom: var(--at-space-2);
}

.at-review-section-text {
  font-size: var(--at-text-sm);
  color: var(--at-text-primary);
  line-height: var(--at-line-loose);
}

/* ── Search results ────────────────────────────────────────────────────────────── */
.at-search-bar {
  position: sticky;
  top: 0;
  background: var(--at-surface-app);
  z-index: var(--at-z-header);
  padding: var(--at-space-2) var(--at-space-3);
  border-bottom: 0.5px solid var(--at-border);
}

.at-search-input-wrap {
  position: relative;
}

.at-search-input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--at-text-muted);
  pointer-events: none;
}

.at-search-input {
  width: 100%;
  background: var(--at-gray-100);
  border: 1.5px solid var(--at-border-medium);
  border-radius: var(--at-radius-md);
  padding: var(--at-space-2) var(--at-space-3) var(--at-space-2) 34px;
  font-size: var(--at-text-base);
  color: var(--at-text-primary);
  outline: none;
  transition: border-color var(--at-transition-fast);
}

.at-search-input:focus {
  border-color: var(--at-color-brand);
  background: var(--at-surface-input);
}

/* ── Capture AI parse indicator ────────────────────────────────────────────────── */
.at-parse-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--at-brand-50);
  color: var(--at-brand-700);
  border-radius: var(--at-radius-full);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: var(--at-weight-medium);
  animation: at-pulse 1.5s ease-in-out infinite;
}
