/* ═══════════════════════════ People & companies ═══════════════════════════ */

:root {
  --whatsapp: #22c55e;
  --whatsapp-gradient: linear-gradient(135deg, #22c55e, #16a34a);
  --task: #06b6d4;
}

.avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

.avatar.xs {
  width: 24px;
  height: 24px;
  font-size: 9px;
  box-shadow: 0 0 0 2px var(--bg-surface);
}

.avatar.xs.more {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  text-shadow: none;
}

.company-avatar {
  border-radius: 12px;
  background: var(--company);
}

.company-avatar.lg { border-radius: 14px; }
.company-avatar.xl { border-radius: 18px; }

.avatar-stack {
  display: inline-flex;
  align-items: center;
  padding-left: 6px;
}

.avatar-stack .avatar {
  margin-left: -6px;
}

.deal-people,
.company-people {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.deal-people {
  margin-top: 8px;
}

.company-people .muted {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mode-switch {
  margin-top: 10px;
}

.mode-switch button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.company-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.company-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.company-stats span {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.company-stats strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.company-stats small {
  color: var(--text-secondary);
  font-size: 11px;
}

.person-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.person-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.person-row:has(.role-select) {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "avatar main actions"
    "avatar role manage";
  row-gap: 6px;
}

.person-row:has(.role-select) > .avatar { grid-area: avatar; align-self: start; }
.person-row:has(.role-select) > .person-main { grid-area: main; }
.person-row:has(.role-select) > .role-select { grid-area: role; justify-self: start; }
.person-row:has(.role-select) > .person-actions { grid-area: actions; justify-self: end; }
.person-row:has(.role-select) > .person-manage { grid-area: manage; justify-self: end; }

.person-row:hover {
  border-color: var(--glass-border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.person-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.person-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.person-main .muted {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.person-actions,
.person-manage {
  display: inline-flex;
  gap: 4px;
}

.primary-pill,
.role-pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.primary-pill {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.2);
}

.role-pill {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.14);
}

.role-select {
  width: auto;
  max-width: 132px;
  height: 30px;
  padding: 0 28px 0 10px;
  font-size: 12px;
  background-position: right 9px center;
}

.add-person {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 8px;
  margin-bottom: 12px;
}

.add-person select {
  height: 32px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 12px;
}

.primary-info {
  margin-top: 4px;
}

.phone-link {
  font-variant-numeric: tabular-nums;
}

.card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.people-strip {
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
  padding-bottom: 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.person-chip {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  scroll-snap-align: start;
}

.person-chip-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 13px;
}

.person-chip.add {
  gap: 6px;
  border-style: dashed;
  color: var(--accent-soft);
  font-size: 13px;
  font-weight: 500;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.person-chip.add:hover {
  border-color: rgba(129, 140, 248, 0.5);
  background: rgba(99, 102, 241, 0.1);
}

.person-option span {
  display: inline-flex;
}

.field-hint {
  min-height: 16px;
  color: var(--accent-soft);
  font-size: 11px;
  font-style: normal;
}

/* ═══════════════════════════ Shared action buttons ═══════════════════════════ */

.action-row {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 8px;
}

.customer-detail > .action-row {
  margin-bottom: 16px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  padding: 8px 4px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: transform var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.action-btn .icon {
  color: var(--accent-soft);
}

.action-btn:hover {
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
  background: rgba(255, 255, 255, 0.06);
}

.action-btn:active {
  transform: scale(0.97);
}

.action-btn.whatsapp .icon {
  color: var(--whatsapp);
}

.btn.whatsapp {
  border-color: transparent;
  background: var(--whatsapp-gradient);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 6px 20px rgba(34, 197, 94, 0.3);
}

.btn.whatsapp:hover {
  filter: brightness(1.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 28px rgba(34, 197, 94, 0.45);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  filter: saturate(0.6);
  box-shadow: none;
  cursor: not-allowed;
}

.mini-btn {
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--glass-border);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.mini-btn:hover {
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
  background: rgba(255, 255, 255, 0.07);
}

.toast-action {
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  color: #c7d2fe;
  font-size: 12px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.18);
  transition: background-color var(--transition-fast);
}

.toast-action:hover {
  background: rgba(99, 102, 241, 0.3);
}

.inline-warning,
.inline-tip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
}

.inline-warning {
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: var(--warning-dim);
  color: #fde68a;
}

.inline-tip {
  margin: 0 0 14px;
  border: 1px solid rgba(99, 102, 241, 0.28);
  background: rgba(99, 102, 241, 0.1);
  color: #c7d2fe;
}

.modal-body > .inline-warning:first-child {
  margin: 0 0 14px;
}

.inline-warning span,
.inline-tip span {
  flex: 1;
  min-width: 160px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.check-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.check-row input {
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════ Next steps ═══════════════════════════ */

.next-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  height: 28px;
  margin-top: 10px;
  padding: 0 10px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
  color: #c7d2fe;
  font-size: 12px;
  text-align: left;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.next-chip:hover {
  border-color: rgba(129, 140, 248, 0.5);
  background: rgba(99, 102, 241, 0.18);
}

.next-chip-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.next-chip-due {
  flex: none;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.next-chip[data-due="today"] {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.12);
  color: #a5f3fc;
}

.next-chip[data-due="overdue"] {
  border-color: rgba(245, 158, 11, 0.45);
  background: var(--warning-dim);
  color: #fde68a;
}

.next-chip[data-due="overdue"] .next-chip-due {
  color: #fcd34d;
}

.next-chip.is-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-muted);
}

.next-chip.is-empty:hover {
  color: var(--accent-soft);
  border-color: rgba(129, 140, 248, 0.45);
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.step-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--tone);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.step-row:hover {
  border-color: var(--glass-border-hover);
  border-left-color: var(--tone);
  background: rgba(255, 255, 255, 0.045);
}

.step-check {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid color-mix(in srgb, var(--tone) 60%, transparent);
  border-radius: 50%;
  color: transparent;
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.step-check:hover {
  border-color: var(--success);
  background: var(--success-dim);
  color: var(--success);
}

.step-check:active {
  transform: scale(0.9);
}

.step-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.step-main strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.step-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.step-meta .icon {
  flex: none;
  color: color-mix(in srgb, var(--tone) 70%, white);
}

.step-meta .muted {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.step-row[data-due="overdue"] .step-due {
  color: #fcd34d;
  font-weight: 600;
}

.step-row[data-due="today"] .step-due {
  color: #67e8f9;
  font-weight: 600;
}

.step-tools {
  display: inline-flex;
  gap: 4px;
  opacity: 0.55;
  transition: opacity var(--transition-fast);
}

.step-row:hover .step-tools,
.step-row:focus-within .step-tools {
  opacity: 1;
}

.agenda-group + .agenda-group {
  margin-top: 12px;
}

.agenda-label {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

[data-agenda="overdue"] .agenda-label {
  color: #fcd34d;
}

.agenda-panel .step-list {
  margin-bottom: 0;
}

.panel-spacer {
  flex: 1;
}

.agenda-panel .panel-head {
  justify-content: flex-start;
}

.forecast-panel {
  grid-column: 1 / -1;
}

.priority-row {
  position: relative;
}

.priority-row .priority {
  width: 100%;
  padding-right: 84px;
}

.priority-actions {
  position: absolute;
  top: 50%;
  right: 34px;
  display: flex;
  gap: 4px;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.priority-row:hover .priority-actions,
.priority-row:focus-within .priority-actions {
  opacity: 1;
}

/* ═══════════════════════════ Chronicle: plan bar and two-way timeline ═══════════════════════════ */

.plan-bar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.plan-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  transition: transform var(--transition-fast), box-shadow var(--transition-normal), border-color var(--transition-fast), filter var(--transition-fast);
}

.plan-btn > .icon {
  flex: none;
}

.plan-btn span {
  display: flex;
  flex-direction: column;
}

.plan-btn strong {
  font-size: 14px;
}

.plan-btn small {
  color: var(--text-secondary);
  font-size: 12px;
}

.plan-btn:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-hover);
}

.plan-btn:active {
  transform: translateY(0) scale(0.98);
}

.plan-btn.primary {
  border-color: rgba(129, 140, 248, 0.45);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(139, 92, 246, 0.16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 28px rgba(99, 102, 241, 0.2);
}

.plan-btn.primary > .icon { color: #c7d2fe; }
.plan-btn.whatsapp > .icon { color: var(--whatsapp); }
.plan-btn.voice > .icon { color: #f0abfc; }

.plan-btn.whatsapp:hover { box-shadow: 0 8px 28px rgba(34, 197, 94, 0.18); }
.plan-btn.voice:hover { box-shadow: 0 8px 28px rgba(217, 70, 239, 0.18); }

.timeline-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-self: center;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(16, 16, 28, 0.96);
  color: #fcd34d;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.timeline-label.future {
  color: #67e8f9;
}

.day-separator.is-future span {
  border-style: dashed;
  border-color: rgba(6, 182, 212, 0.45);
  color: #a5f3fc;
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.18);
}

.today-anchor {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
  scroll-margin-top: 80px;
}

.today-anchor > span {
  padding: 6px 20px;
  border-color: transparent;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 12px;
  box-shadow: 0 0 0 4px var(--bg-void), 0 0 30px rgba(99, 102, 241, 0.55);
}

.upcoming-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 999px;
  background: rgba(10, 10, 15, 0.92);
  color: #67e8f9;
  font-size: 11px;
  font-weight: 600;
  transition: background-color var(--transition-fast);
}

.upcoming-hint:hover {
  background: rgba(6, 182, 212, 0.14);
}

.now-marker {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin: 2px 0;
}

.now-marker::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.6), transparent);
}

.now-marker span {
  position: relative;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 600;
}

.entry.is-planned {
  border-style: dashed;
  border-left-style: solid;
  background: rgba(20, 20, 32, 0.55);
}

.entry.is-planned .entry-dot {
  background: var(--bg-void);
  box-shadow: 0 0 0 4px var(--bg-void), inset 0 0 0 2px var(--tone), 0 0 14px var(--tone);
}

.entry[data-due="overdue"] {
  border-color: rgba(245, 158, 11, 0.35);
  border-left-color: var(--warning);
}

.due-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.14);
  font-size: 12px;
  font-weight: 600;
}

.due-chip[data-due="today"] {
  color: #a5f3fc;
  background: rgba(6, 182, 212, 0.14);
}

.due-chip[data-due="overdue"] {
  color: #fde68a;
  background: var(--warning-dim);
}

.meta-chip.voice {
  color: #f5d0fe;
  background: rgba(217, 70, 239, 0.14);
}

.entry-plan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.entry-plan-actions .mini-btn {
  height: 32px;
  padding: 0 10px;
}

.timeline-end {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(16, 16, 28, 0.96);
  color: var(--text-muted);
  font-size: 12px;
}

.jump-today {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 24;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.45);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal), transform var(--transition-slow);
}

.jump-today[data-visible="true"] {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

/* ═══════════════════════════ Sheets: plan, message, call, voice ═══════════════════════════ */

.modal.sheet {
  width: min(560px, 100%);
}

.modal.sheet.compact {
  width: min(440px, 100%);
}

.modal.sheet .modal-icon {
  border-color: color-mix(in srgb, var(--tone, var(--accent-primary)) 45%, transparent);
  background: color-mix(in srgb, var(--tone, var(--accent-primary)) 18%, transparent);
  color: color-mix(in srgb, var(--tone, var(--accent-primary)) 55%, white);
}

.suggestions,
.template-chips,
.recipients {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suggestions {
  margin-top: -6px;
}

.suggestion {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 12px;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.suggestion .avatar {
  margin-left: -7px;
}

.suggestion:hover,
.suggestion.is-on {
  border-color: rgba(129, 140, 248, 0.45);
  background: rgba(99, 102, 241, 0.14);
  color: #e0e7ff;
}

.type-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.type-option {
  position: relative;
}

.type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-option span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 4px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.type-option span .icon {
  color: color-mix(in srgb, var(--tone) 70%, white);
}

.type-option:hover span {
  border-color: var(--glass-border-hover);
}

.type-option input:checked + span {
  border-color: color-mix(in srgb, var(--tone) 60%, transparent);
  background: color-mix(in srgb, var(--tone) 18%, transparent);
  color: var(--text-primary);
  box-shadow: 0 0 18px color-mix(in srgb, var(--tone) 22%, transparent);
}

.type-option input:focus-visible + span {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.step-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--tone);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.step-summary > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.compose-to {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.compose-to > span:not(.avatar):not(.deal-ref) {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.compose-to small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.recipients {
  margin-bottom: 12px;
}

.recipient {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  text-align: left;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.recipient > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.recipient small {
  color: var(--text-muted);
  font-size: 10px;
}

.recipient:hover {
  border-color: var(--glass-border-hover);
}

.recipient.is-on {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.12);
}

.template-chips {
  margin-bottom: 12px;
}

.bubble-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 20% 20%, rgba(34, 197, 94, 0.06), transparent 50%),
    rgba(255, 255, 255, 0.02);
}

.bubble {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 12px 12px 4px 12px;
  background: #144d37;
  color: #e7fbe9;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.bubble-meta {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compose-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.compose-meta [data-char-count] {
  font-variant-numeric: tabular-nums;
}

.sheet-lead {
  margin: 0 0 10px;
}

.person-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.call-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.call-person > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.call-person small,
.call-person-number {
  color: var(--text-secondary);
  font-size: 12px;
}

.call-person-number {
  font-variant-numeric: tabular-nums;
}

.call-person:hover {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.1);
}

.call-person:active {
  transform: scale(0.99);
}

.call-person[data-no-phone="true"] {
  opacity: 0.6;
}

.call-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.call-hero > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.call-hero strong {
  font-size: 16px;
}

.call-number {
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.call-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.call-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.16), rgba(59, 130, 246, 0.06));
  color: var(--text-primary);
  text-align: left;
  transition: transform var(--transition-fast), filter var(--transition-fast), box-shadow var(--transition-normal);
}

.call-option > span:nth-child(2) {
  display: flex;
  flex-direction: column;
}

.call-option strong {
  font-size: 15px;
}

.call-option small {
  color: var(--text-secondary);
  font-size: 12px;
}

.call-option-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--call);
  color: #fff;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
}

.call-option:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.call-option:active {
  transform: scale(0.99);
}

.call-option.whatsapp {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.16), rgba(34, 197, 94, 0.06));
}

.call-option.whatsapp .call-option-icon {
  background: var(--whatsapp-gradient);
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.4);
}

.call-option.subtle {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 54px;
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, 0.025);
}

.call-option.subtle .call-option-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  box-shadow: none;
}

.call-option.log-past {
  margin-top: 8px;
}

/* Voice */

.voice-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
  text-align: center;
}

.voice-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  margin: 6px 0 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0abfc, #a855f7 45%, #6366f1);
  color: #fff;
  box-shadow: 0 0 0 8px rgba(168, 85, 247, 0.12), 0 18px 50px rgba(168, 85, 247, 0.45);
  transition: transform var(--transition-fast), filter var(--transition-normal);
}

.voice-orb:active {
  transform: scale(0.96);
}

.voice-orb .icon {
  position: relative;
  z-index: 1;
}

.voice-ring {
  position: absolute;
  inset: -6px;
  border: 2px solid rgba(240, 171, 252, 0.5);
  border-radius: 50%;
  animation: voice-ring 1.8s ease-out infinite;
}

.voice-ring.delay {
  animation-delay: 0.9s;
}

[data-voice-state="paused"] .voice-orb {
  filter: grayscale(0.7) brightness(0.8);
}

[data-voice-state="paused"] .voice-ring {
  animation: none;
  opacity: 0;
}

@keyframes voice-ring {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(1.55); opacity: 0; }
}

.voice-timer {
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.voice-status {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.voice-transcript {
  width: 100%;
  min-height: 96px;
  max-height: 30vh;
  margin-top: 6px;
  padding: 14px;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(10, 10, 15, 0.5);
  font-size: 15px;
  line-height: 1.55;
  text-align: left;
}

.voice-transcript .interim {
  color: var(--text-muted);
}

.voice-transcript .placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.voice-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
}

.voice-fab {
  display: none;
}

/* ═══════════════════════════ Settings: messaging ═══════════════════════════ */

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

.settings-pair em {
  font-style: normal;
}

.template-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 14px 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.template-head .muted {
  font-weight: 400;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.template-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.template-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.template-row input {
  font-weight: 600;
}

.template-item textarea {
  min-height: 64px;
  font-size: 13px;
}

.template-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ═══════════════════════════ Small screens ═══════════════════════════ */

@media (max-width: 1023px) {
  .forecast-panel {
    grid-column: auto;
  }
}

@media (max-width: 767px) {
  .voice-fab {
    position: fixed;
    right: 16px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 27;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #f0abfc, #a855f7 45%, #6366f1);
    color: #fff;
    box-shadow: 0 0 0 6px rgba(168, 85, 247, 0.12), 0 12px 32px rgba(168, 85, 247, 0.5);
    transition: transform var(--transition-fast);
  }

  .voice-fab:active {
    transform: scale(0.94);
  }

  .menu-open .voice-fab {
    display: none;
  }

  .plan-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .plan-btn {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 68px;
    padding: 8px 6px;
    text-align: center;
  }

  .plan-btn small {
    display: none;
  }

  .plan-btn strong {
    font-size: 12px;
  }

  .timeline-label,
  .timeline-end,
  .now-marker {
    align-self: flex-start;
    margin-left: 34px;
  }

  .today-anchor {
    align-items: flex-start;
    scroll-margin-top: 72px;
  }

  .jump-today {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .action-btn {
    min-height: 62px;
  }

  .add-person {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .add-person [data-field="addStakeholder"] {
    grid-column: 1 / -1;
  }

  .step-tools,
  .priority-actions {
    opacity: 1;
  }

  .priority-row .priority {
    padding-right: 12px;
  }

  .priority-actions {
    position: static;
    justify-content: flex-end;
    margin-top: 6px;
    transform: none;
  }

  .settings-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .type-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .overlay-sheet {
    place-items: end stretch;
  }

  .modal.sheet {
    height: auto;
    max-height: 92vh;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .modal.sheet.voice,
  .modal[data-modal-type="plan"],
  .modal[data-modal-type="message"] {
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .modal.sheet .modal-actions {
    flex-wrap: wrap;
  }

  .modal.sheet .modal-actions .btn {
    flex: 1 1 auto;
  }

  .company-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .company-stats strong {
    font-size: 15px;
  }
}
