/* ── Dark mode: native select dropdown fix ──────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .at-select,
  select.at-input {
    color-scheme: dark;
  }
}
[data-theme="dark"] .at-select,
[data-theme="dark"] select.at-input {
  color-scheme: dark;
}

/* ── People Tab ────────────────────────────────────────────────────────────── */

.at-people-summary {
  padding: var(--at-space-4);
  background: var(--at-brand-50);
  border-radius: var(--at-radius-lg);
  margin-bottom: var(--at-space-4);
  font-size: 14px;
  line-height: 1.5;
  color: var(--at-text-primary);
}

.at-people-summary-text {
  font-style: italic;
}

.at-people-empty {
  text-align: center;
  padding: var(--at-space-8) var(--at-space-4);
}

.at-people-empty-icon {
  font-size: 48px;
  margin-bottom: var(--at-space-3);
}

.at-people-empty-title {
  font-size: 17px;
  font-weight: var(--at-weight-medium);
  margin-bottom: var(--at-space-2);
  color: var(--at-text-primary);
}

.at-people-empty-sub {
  font-size: 14px;
  color: var(--at-text-muted);
  line-height: 1.5;
  margin-bottom: var(--at-space-4);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.at-people-suggestions {
  background: var(--at-surface-2);
  border-radius: var(--at-radius-md);
  padding: var(--at-space-3);
  margin-top: var(--at-space-3);
  font-size: 13px;
  color: var(--at-text-muted);
}

.at-people-suggestions strong {
  color: var(--at-text-primary);
}

/* ── Person Card ──────────────────────────────────────────────────────────── */

.at-person-card {
  display: flex;
  align-items: center;
  gap: var(--at-space-3);
  padding: var(--at-space-3) var(--at-space-4);
  background: var(--at-surface);
  border: 1px solid var(--at-border);
  border-radius: var(--at-radius-md);
  margin-bottom: var(--at-space-2);
  cursor: pointer;
  transition: background var(--at-transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.at-person-card:hover {
  background: var(--at-gray-50);
}

.at-person-card:active {
  background: var(--at-gray-100);
}

.at-person-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--at-brand-100, var(--at-brand-50));
  color: var(--at-color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: var(--at-weight-medium);
  flex-shrink: 0;
}

.at-person-info {
  flex: 1;
  min-width: 0;
}

.at-person-name {
  font-size: 15px;
  font-weight: var(--at-weight-medium);
  color: var(--at-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.at-person-type {
  font-size: 12px;
  color: var(--at-text-muted);
  text-transform: capitalize;
}

.at-person-meta {
  display: flex;
  align-items: center;
  gap: var(--at-space-2);
  margin-top: 2px;
  font-size: 12px;
  color: var(--at-text-muted);
}

.at-person-right {
  display: flex;
  align-items: center;
  gap: var(--at-space-2);
  flex-shrink: 0;
}

/* Follow-through dot */
.at-ft-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.at-ft-dot--green  { background: var(--at-color-success); }
.at-ft-dot--amber  { background: var(--at-color-warning); }
.at-ft-dot--red    { background: var(--at-color-danger);  }
.at-ft-dot--none   { background: var(--at-gray-200);      }

.at-person-overdue {
  font-size: 11px;
  font-weight: var(--at-weight-medium);
  color: var(--at-coral-700, #993C1D);
  background: var(--at-coral-50);
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.at-person-due-soon {
  font-size: 11px;
  font-weight: var(--at-weight-medium);
  color: var(--at-amber-700, #BA7517);
  background: var(--at-amber-50);
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.at-person-promises {
  font-size: 11px;
  color: var(--at-text-muted);
  background: var(--at-surface-2);
  padding: 2px 6px;
  border-radius: var(--at-radius-sm);
}

.at-person-chevron {
  color: var(--at-text-muted);
  font-size: 14px;
}

/* ── Add Person Sheet ─────────────────────────────────────────────────────── */

.at-add-person-form {
  padding: var(--at-space-4);
}

.at-add-person-form .at-field {
  margin-bottom: var(--at-space-3);
}

.at-add-person-form .at-field label {
  display: block;
  font-size: 13px;
  font-weight: var(--at-weight-medium);
  color: var(--at-text-primary);
  margin-bottom: var(--at-space-1);
}

.at-add-person-form .at-field .at-help {
  font-size: 12px;
  color: var(--at-text-muted);
  margin-top: 4px;
}

.at-add-person-form select:not(.at-select) {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--at-border-medium);
  border-radius: var(--at-radius-md);
  font-size: 14px;
  background: var(--at-surface);
  color: var(--at-text-primary);
  color-scheme: inherit;
}

.at-add-person-form textarea:not(.at-input) {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--at-border-medium);
  border-radius: var(--at-radius-md);
  font-size: 14px;
  background: var(--at-surface);
  color: var(--at-text-primary);
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

/* ── Person Detail Sheet ──────────────────────────────────────────────────── */

.at-person-detail-header {
  display: flex;
  align-items: center;
  gap: var(--at-space-3);
  padding: var(--at-space-4);
  border-bottom: 1px solid var(--at-border);
}

.at-person-detail-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--at-brand-100, var(--at-brand-50));
  color: var(--at-color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: var(--at-weight-medium);
  flex-shrink: 0;
}

.at-person-intention {
  background: var(--at-brand-50);
  border-radius: var(--at-radius-md);
  padding: var(--at-space-3);
  margin: var(--at-space-3) var(--at-space-4);
  font-size: 14px;
  line-height: 1.5;
  font-style: italic;
  color: var(--at-text-primary);
}

.at-person-intention-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--at-text-muted);
  font-style: normal;
  margin-bottom: 4px;
}

.at-person-section {
  padding: var(--at-space-3) var(--at-space-4);
}

.at-person-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--at-text-muted);
  margin-bottom: var(--at-space-2);
}

.at-person-task-row {
  display: flex;
  align-items: center;
  gap: var(--at-space-2);
  padding: 6px 0;
  font-size: 14px;
  color: var(--at-text-primary);
  border-bottom: 1px solid var(--at-border);
}

.at-person-task-row:last-child {
  border-bottom: none;
}

.at-person-task-promise {
  color: var(--at-color-warning);
  font-size: 12px;
  flex-shrink: 0;
}

.at-person-interaction-row {
  padding: 6px 0;
  font-size: 13px;
  color: var(--at-text-primary);
  border-bottom: 1px solid var(--at-border);
}

.at-person-interaction-row:last-child {
  border-bottom: none;
}

.at-person-interaction-date {
  font-size: 11px;
  color: var(--at-text-muted);
}

/* ── AI Tether Partner suggestion ─────────────────────────────────────────── */

.at-atp-suggestion {
  display: flex;
  gap: var(--at-space-3);
  padding: var(--at-space-4);
  margin: var(--at-space-4) var(--at-space-4) 0;
  background: var(--at-brand-50);
  border: 1px solid var(--at-color-brand);
  border-radius: var(--at-radius-lg);
}

.at-atp-suggestion-icon {
  font-size: 20px;
  color: var(--at-color-brand);
  flex-shrink: 0;
  margin-top: 2px;
}

.at-atp-suggestion-title {
  font-size: 14px;
  font-weight: var(--at-weight-medium);
  color: var(--at-text-primary);
  margin-bottom: 4px;
}

.at-atp-suggestion-text {
  font-size: 13px;
  color: var(--at-text-secondary);
  line-height: 1.5;
}

/* ── FAB (Floating Action Button for Capture) ─────────────────────────────── */

.at-fab {
  position: fixed;
  bottom: calc(var(--at-nav-height, 58px) + var(--at-safe-bottom, 0px) + 12px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--at-color-brand);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 150; /* Between --at-z-nav (100) and --at-z-header (200) */
  transition: transform var(--at-transition-fast), box-shadow var(--at-transition-fast);
  -webkit-tap-highlight-color: transparent;
}

/* On desktop, anchor FAB inside the #app container (max-width: 1055px, centered) */
@media (min-width: 1056px) {
  .at-fab {
    right: calc(50% - 1055px / 2 + 16px);
  }
}

.at-fab:active {
  transform: scale(0.92);
}

.at-fab svg {
  width: 24px;
  height: 24px;
}

/* ── Dark mode overrides ──────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  .at-people-summary {
    background: #2A2560;
  }

  .at-person-card {
    background: var(--at-surface);
    border-color: var(--at-border);
  }

  .at-person-card:hover {
    background: var(--at-gray-800, #2C2C2A);
  }

  .at-person-avatar,
  .at-person-detail-avatar {
    background: #2A2560;
  }

  .at-person-intention {
    background: #2A2560;
  }

  .at-ft-dot--none {
    background: var(--at-gray-600, #5F5E5A);
  }
}
