/**
 * 100x Life Planning System - Component Styles
 * Buttons, cards, modals, forms, and reusable UI components
 */

/* ===== DASHBOARD HEADER DROPDOWN ===== */
.dashboard-dropdown {
  position: relative;
}

.dashboard-dropdown .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.dashboard-dropdown .dropdown-toggle::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 0.15rem;
}

.dashboard-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 0.35rem 0;
}

.dashboard-dropdown.open .dropdown-menu {
  display: block;
}

.dashboard-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-dark);
  text-decoration: none;
  transition: background 0.15s;
}

.dashboard-dropdown .dropdown-item:hover {
  background: var(--bg-secondary);
}

.dashboard-dropdown .dropdown-item.active {
  color: var(--teal-accent);
  font-weight: 600;
}

.dashboard-dropdown .dropdown-item.active::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--teal-accent);
  border-radius: 2px;
  position: absolute;
  left: 0.25rem;
}

/* ===== GLOW PULSE EFFECT ===== */
.glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(74, 155, 181, 0.3),
                0 0 10px rgba(74, 155, 181, 0.2),
                0 0 15px rgba(74, 155, 181, 0.1);
  }
  50% {
    box-shadow: 0 0 10px rgba(74, 155, 181, 0.5),
                0 0 20px rgba(74, 155, 181, 0.3),
                0 0 30px rgba(74, 155, 181, 0.2);
  }
}

/* ===== BUTTONS ===== */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: calc(14px + var(--text-bump));
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: calc(13px + var(--text-bump));
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: calc(24px + var(--text-bump));
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.btn-ghost:hover {
  color: var(--text-dark);
  border-color: var(--text-dark);
  background: var(--bg-tertiary);
}

.btn-primary {
  background: var(--teal-accent);
  color: var(--text-light);
}

.btn-primary:hover {
  background: var(--teal-dark);
}

.btn-secondary {
  background: var(--gold);
  color: var(--text-light);
}

.btn-secondary:hover {
  background: var(--gold-dark);
}

.btn-gold,
.btn-accent {
  background: var(--teal-accent);
  color: var(--text-light);
}

.btn-gold:hover,
.btn-accent:hover {
  background: var(--teal-dark);
  color: var(--text-light);
}

.btn-outline-primary {
  background: transparent;
  color: var(--teal-accent);
  border: 1px solid var(--teal-accent);
}

.btn-outline-primary:hover {
  background: var(--teal-accent);
  color: var(--text-light);
}

.btn i {
  color: inherit;
}

/* Responsive button text - show long by default, short on mobile */
.btn-text-long {
  display: inline;
}

.btn-text-short {
  display: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: 0;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: none;
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--text-dark);
}

.btn-icon i {
  font-size: calc(1.1rem + var(--text-bump));
  transition: transform var(--transition-fast);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-primary);
  border: none;
  border-radius: 0;
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: calc(1rem + var(--text-bump));
  font-weight: 500;
  color: var(--text-dark);
}

.card-body {
  padding: var(--spacing-lg);
}

/* Grid Card (for foundation items) */
.grid-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 0;
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.grid-card:hover {
  border-color: var(--teal-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.grid-card.completed {
  border-color: var(--teal-accent);
  border-left: 4px solid var(--teal-accent);
}

.grid-card.suggested {
  border-color: var(--navy-primary);
  box-shadow: 0 0 0 2px rgba(26, 43, 74, 0.1);
}

.card-status {
  font-size: calc(0.7rem + var(--text-bump));
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-status.complete {
  background: var(--teal-light);
  color: var(--teal-accent);
}

.card-preview {
  color: var(--text-secondary);
  font-size: calc(0.85rem + var(--text-bump));
  line-height: 1.5;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: calc(0.85rem + var(--text-bump));
}

/* ===== MODALS ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 43, 74, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-primary);
  border: none;
  border-radius: 0;
  padding: var(--spacing-lg);
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.modal-header h3 {
  color: var(--text-dark);
  font-size: calc(1.1rem + var(--text-bump));
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: calc(1.5rem + var(--text-bump));
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-dark);
}

.modal-body textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0;
  padding: var(--spacing-md);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: calc(0.95rem + var(--text-bump));
  line-height: 1.5;
  min-height: 120px;
  resize: vertical;
}

.modal-body textarea:focus {
  outline: none;
  border-color: var(--teal-accent);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: var(--spacing-md);
}

.quick-edit-status {
  font-size: calc(0.75rem + var(--text-bump));
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: right;
}

/* Export Modal */
.export-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 43, 74, 0.7);
  z-index: 1001;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
}

.export-modal-overlay.active {
  display: flex;
}

.export-modal {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.export-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.export-modal-header h3 {
  color: var(--navy-primary);
  font-size: calc(1.25rem + var(--text-bump));
  font-weight: 600;
}

.export-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: calc(1.75rem + var(--text-bump));
  cursor: pointer;
  line-height: 1;
}

.export-modal-close:hover {
  color: var(--navy-primary);
}

.export-modal-body {
  padding: var(--spacing-lg);
  overflow-y: auto;
  flex: 1;
}

/* Compact export modal (no content preview) */
.export-modal-compact {
  max-width: 480px;
}

/* Export Actions Row — primary (Excel/Print) + secondary (JSON) */
.export-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.export-action-btn {
  flex: 1 1 0;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  gap: 0.375rem;
}

.export-action-btn:hover {
  border-color: var(--teal-accent);
  background: var(--teal-light);
  transform: translateY(-1px);
}

.export-action-btn:active {
  transform: translateY(0);
}

.export-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.export-action-btn i {
  font-size: calc(1.25rem + var(--text-bump));
  color: var(--navy-primary);
}

.export-action-btn:hover i {
  color: var(--teal-accent);
}

.export-action-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--navy-primary);
  white-space: nowrap;
}

/* Secondary actions (JSON import/export) — less prominent */
.export-action-btn--secondary {
  background: transparent;
  border-style: dashed;
}

.export-action-btn--secondary i,
.export-action-btn--secondary .export-action-label {
  color: var(--text-muted);
}

.export-action-btn--secondary:hover i,
.export-action-btn--secondary:hover .export-action-label {
  color: var(--teal-accent);
}

@media (max-width: 640px) {
  .export-action-btn {
    flex-basis: calc(50% - 0.3125rem);
  }
}

/* Export status message */
.export-status {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: calc(0.9rem + var(--text-bump));
  color: var(--teal-accent);
  min-height: 1.5rem;
}

.export-status.error {
  color: #dc3545;
}

/* Assessments section inside Data modal */
.export-modal-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.export-modal-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: calc(1.05rem + var(--text-bump));
  font-weight: 600;
  color: var(--navy-primary);
  margin-bottom: 0.375rem;
}

.export-modal-section-desc {
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-muted);
  margin-bottom: 0.875rem;
  line-height: 1.5;
}

/* Sync Conflict Modal */
.sync-conflict-modal {
  max-width: 650px;
}

.sync-conflict-modal .modal-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #e67e22;
}

.sync-conflict-message {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Conflict List */
.conflict-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.conflict-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

.conflict-item:last-child {
  border-bottom: none;
}

.conflict-item-name {
  font-weight: 500;
  color: var(--navy-primary);
}

.conflict-item-status {
  font-size: calc(0.8rem + var(--text-bump));
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.conflict-item-status.resolved {
  color: var(--teal-accent);
}

/* Bulk Options */
.sync-bulk-options {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.sync-bulk-label {
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.sync-bulk-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.sync-bulk-buttons .btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

.review-each-btn {
  width: 100%;
  justify-content: center;
}

/* Per-Field Review View */
.conflict-review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.conflict-review-progress {
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-muted);
}

.conflict-field-name {
  color: var(--navy-primary);
  margin-bottom: 1rem;
  font-size: calc(1.1rem + var(--text-bump));
}

.conflict-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.conflict-version {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.conflict-version-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  font-size: calc(0.8rem + var(--text-bump));
  font-weight: 600;
  color: var(--navy-primary);
  border-bottom: 1px solid var(--border-light);
}

.conflict-version-label i {
  color: var(--teal-accent);
}

.conflict-version-content {
  padding: 0.75rem;
  font-size: calc(0.9rem + var(--text-bump));
  color: var(--text-secondary);
  max-height: 150px;
  overflow-y: auto;
  line-height: 1.5;
  white-space: pre-wrap;
}

.conflict-version-content:empty::before {
  content: "(empty)";
  color: var(--text-muted);
  font-style: italic;
}

.conflict-review-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.conflict-review-actions .btn {
  flex: 1;
  justify-content: center;
}

/* Status */
.sync-conflict-status {
  margin-top: 1rem;
  text-align: center;
  font-size: calc(0.9rem + var(--text-bump));
  color: var(--teal-accent);
  min-height: 1.5rem;
}

.sync-conflict-status.error {
  color: #dc3545;
}

/* Settings Modal */
.settings-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 43, 74, 0.7);
  z-index: 10000;
  padding: var(--spacing-xl);
}

.settings-modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-modal {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: min(90vh, 700px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.settings-modal.settings-modal-lg {
  max-width: 600px;
}

.settings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.settings-modal-header h3 {
  color: var(--navy-primary);
  font-size: calc(1.25rem + var(--text-bump));
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: calc(1.75rem + var(--text-bump));
  cursor: pointer;
  line-height: 1;
}

.settings-modal-close:hover {
  color: var(--navy-primary);
}

.settings-modal-body {
  padding: var(--spacing-lg);
  overflow-y: auto;
  flex: 1;
}

.settings-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-legal-links {
  font-size: calc(0.8rem + var(--text-bump));
}

.settings-legal-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.settings-legal-links a:hover {
  color: var(--teal-accent);
  text-decoration: underline;
}

.settings-legal-links .separator {
  color: var(--border-medium);
  margin: 0 0.5rem;
}

.settings-section {
  margin-bottom: var(--spacing-lg);
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-header h4 {
  font-size: calc(0.9rem + var(--text-bump));
  font-weight: 600;
  color: var(--navy-primary);
  margin-bottom: var(--spacing-md);
}

/* ===== FORMS ===== */
.form-control {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: calc(0.95rem + var(--text-bump));
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--teal-accent);
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

/* Storage Options */
.storage-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.storage-option {
  cursor: pointer;
}

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

.storage-option-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.storage-option input:checked + .storage-option-content {
  border-color: var(--teal-accent);
  background: var(--teal-light);
}

.storage-option:hover .storage-option-content {
  border-color: var(--border-medium);
}

.storage-option-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.storage-option-icon.local {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.storage-option-icon.cloud {
  background: var(--teal-light);
  color: var(--teal-accent);
}

.storage-option-title {
  font-weight: 600;
  color: var(--navy-primary);
  margin-bottom: 0.25rem;
}

.storage-option-desc {
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-muted);
}

.storage-warning {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: #fef3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  font-size: calc(0.85rem + var(--text-bump));
  color: #856404;
}

[data-theme="dark"] .storage-warning {
  background: var(--gold-light);
  border-color: var(--gold-dark);
  color: var(--gold);
}

/* Settings Toggle */
.settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.settings-toggle-label span {
  display: block;
}

.settings-toggle-label span:first-child {
  font-weight: 500;
  color: var(--navy-primary);
}

.settings-toggle-desc {
  font-size: calc(0.8rem + var(--text-bump));
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.settings-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-medium);
  transition: var(--transition-normal);
  border-radius: 26px;
}

.settings-switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition-normal);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.settings-switch input:checked + .settings-switch-slider {
  background-color: var(--teal-accent);
}

.settings-switch input:checked + .settings-switch-slider:before {
  transform: translateX(22px);
}

/* AI Provider Options */
.ai-provider-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-provider-option {
  cursor: pointer;
}

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

.ai-provider-content {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.ai-provider-option input:checked + .ai-provider-content {
  border-color: var(--teal-accent);
  background: var(--teal-light);
}

.ai-provider-option:hover .ai-provider-content {
  border-color: var(--border-medium);
}

.ai-provider-title {
  font-weight: 600;
  color: var(--navy-primary);
  margin-bottom: 0.25rem;
}

.ai-provider-desc {
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-muted);
}

.ai-provider-badge {
  font-size: calc(0.75rem + var(--text-bump));
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
  display: inline-block;
  width: fit-content;
}

/* WebLLM Progress */
.webllm-status {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.webllm-progress-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.webllm-progress-fill {
  height: 100%;
  background: var(--teal-accent);
  width: 0%;
  transition: width 0.3s ease;
}

.webllm-progress-text {
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.webllm-ready {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--teal-light);
  border-radius: var(--radius-md);
  color: var(--teal-accent);
}

/* ===== Settings Tabs ===== */
.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  padding: 0 1rem;
  background: var(--bg-secondary);
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: calc(0.875rem + var(--text-bump));
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: -1px;
}

.settings-tab:hover {
  color: var(--text-dark);
  background: var(--bg-tertiary);
}

.settings-tab.active {
  color: var(--teal-accent);
  border-bottom-color: var(--teal-accent);
  background: var(--bg-primary);
}

.settings-tab i {
  font-size: calc(1rem + var(--text-bump));
}

.settings-tab-content {
  display: none;
}

.settings-tab-content.active {
  display: block;
}

/* Settings section description */
.settings-section-desc {
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.settings-section-header h4 i {
  margin-right: 0.375rem;
  color: var(--teal-accent);
}

/* ===== Memory Summary ===== */
.memory-summary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.memory-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  padding: 1rem;
}

.memory-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
}

.memory-empty i {
  font-size: calc(2rem + var(--text-bump));
  margin-bottom: 0.5rem;
  display: block;
  opacity: 0.5;
}

.memory-category {
  margin-bottom: 1rem;
}

.memory-category:last-child {
  margin-bottom: 0;
}

.memory-category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.memory-category-header i {
  color: var(--teal-accent);
  font-size: calc(0.9rem + var(--text-bump));
}

.memory-items {
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-secondary);
  line-height: 1.6;
}

.memory-item {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
}

.memory-item-label {
  color: var(--text-muted);
  min-width: 80px;
}

.memory-item-value {
  color: var(--text-dark);
}

.memory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.25rem;
}

.memory-tag {
  display: inline-block;
  background: var(--teal-light);
  color: var(--teal-accent);
  font-size: calc(0.75rem + var(--text-bump));
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
}

.memory-quote {
  font-style: italic;
  color: var(--text-secondary);
  border-left: 2px solid var(--teal-accent);
  padding-left: 0.75rem;
  margin: 0.5rem 0;
}

/* Memory Controls */
.memory-controls {
  margin-bottom: 1rem;
}

/* AI Memory Sync (export/import between 100x and other AIs) */
.memory-sync {
  margin: 1rem 0 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.memory-sync-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: calc(0.95rem + var(--text-bump));
  color: var(--navy-primary);
  margin-bottom: 0.5rem;
}

.memory-sync-block {
  margin-bottom: 1rem;
}

.memory-export {
  margin-top: 0.5rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}

.memory-export-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem 0.35rem 0.75rem;
  background: var(--bg-tertiary, #f1f5f9);
  font-size: calc(0.8rem + var(--text-bump));
  color: var(--text-muted);
}

.memory-export-text {
  margin: 0;
  padding: 0.75rem;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: calc(0.82rem + var(--text-bump));
  background: var(--bg-primary, #fff);
}

.memory-export-empty,
.memory-import-note {
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.memory-import-textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: calc(0.9rem + var(--text-bump));
  resize: vertical;
  margin-bottom: 0.5rem;
}

.memory-import-success {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--teal-accent);
}

.memory-actions {
  display: flex;
  gap: 0.75rem;
}

.memory-actions .btn {
  color: var(--text-muted);
}

.memory-actions .btn:hover {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
}

.webllm-ready-icon {
  display: flex;
  align-items: center;
}

/* AI Status Indicator (Header) */
.ai-status-indicator {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: calc(0.8rem + var(--text-bump));
  color: #DF9A32;
  margin-right: 0.5rem;
}

.ai-status-loading,
.ai-status-ready {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Circular progress indicator */
.ai-progress-circle {
  width: 18px;
  height: 18px;
  transform: rotate(-90deg);
}

.ai-progress-bg {
  fill: none;
  stroke: var(--border-light);
  stroke-width: 3;
}

.ai-progress-fill {
  fill: none;
  stroke: var(--teal-accent);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.3s ease;
}

.ai-status-ready {
  color: var(--teal-accent);
}

.ai-status-ready i {
  font-size: calc(0.9rem + var(--text-bump));
}

.ai-status-text {
  white-space: nowrap;
}

/* Theme Segmented Control */
.theme-segmented-control {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}

.theme-segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-segmented-control label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: calc(0.9rem + var(--text-bump));
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.theme-segmented-control label:hover {
  color: var(--text-dark);
}

.theme-segmented-control input:checked + label {
  background: var(--bg-primary);
  color: var(--navy-primary);
  box-shadow: var(--shadow-sm);
}

.theme-segmented-control label i {
  font-size: calc(1rem + var(--text-bump));
}

/* ===== PROGRESS ===== */
.progress-bar {
  background: var(--border-light);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  background: var(--teal-accent);
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.progress-text {
  color: var(--text-muted);
  font-size: calc(0.875rem + var(--text-bump));
  margin-top: 0.5rem;
}

/* ===== ICONS ===== */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}

.icon-sm {
  width: 0.875em;
  height: 0.875em;
}

.icon-lg {
  width: 1.25em;
  height: 1.25em;
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 768px) {
  /* Settings Modal - full screen on mobile */
  .settings-modal-overlay {
    padding: 0 !important;
  }

  .settings-modal-overlay.active {
    align-items: stretch;
    justify-content: stretch;
  }

  .settings-modal {
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    height: 100%;
    border-radius: 0;
  }

  .settings-modal-header {
    padding: 1rem;
    flex-shrink: 0;
  }

  /* Horizontally scrolling tabs on mobile */
  .settings-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    padding: 0 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }

  .settings-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .settings-tab {
    flex-shrink: 0;
    padding: 0.75rem 0.875rem;
    font-size: calc(0.8rem + var(--text-bump));
  }

  .settings-modal-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
  }

  .settings-modal-footer {
    padding: 1rem;
    flex-shrink: 0;
  }

  /* Storage options - stack on mobile */
  .storage-option-content {
    padding: 0.75rem;
  }

  .storage-option-icon {
    width: 36px;
    height: 36px;
  }

  .storage-option-title {
    font-size: calc(0.95rem + var(--text-bump));
  }

  .storage-option-desc {
    font-size: calc(0.8rem + var(--text-bump));
  }

  /* User info - wrap on mobile */
  .user-info {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
  }

  .user-details {
    flex: 1;
    min-width: 0;
  }

  .user-name {
    font-size: calc(0.95rem + var(--text-bump));
  }

  .user-email {
    font-size: calc(0.8rem + var(--text-bump));
    word-break: break-all;
  }

  .user-info .btn {
    width: 100%;
    margin-top: 0.5rem;
    justify-content: center;
  }

  /* Theme segmented control */
  .theme-segmented-control {
    flex-direction: column;
  }

  .theme-segmented-control label {
    justify-content: flex-start;
    padding: 0.75rem 1rem;
  }

  /* Settings toggle row */
  .settings-toggle-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .settings-toggle-label {
    width: 100%;
  }

  .settings-switch {
    align-self: flex-start;
  }

  /* Export modal */
  .export-modal {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    margin: 0;
  }

  .export-modal-overlay.active {
    padding: 0;
  }

  .export-actions-grid {
    grid-template-columns: 1fr;
  }
}

/* Short viewport - ensure settings modal scrolls properly */
@media (max-height: 700px) {
  .settings-modal {
    max-height: calc(100vh - 3rem);
  }

  .settings-modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
  }
}

/* ===== MODULE VIDEO EMBED ===== */
.module-video {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.module-video-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 600;
  color: var(--teal-accent);
  margin-bottom: var(--spacing-md);
  cursor: pointer;
}

.module-video-header:hover {
  color: var(--navy-primary);
}

.module-video-header:hover + .module-video-hint {
  color: var(--text-secondary);
}

.module-video-header i:first-child {
  font-size: calc(1.25rem + var(--text-bump));
}

.module-video-toggle {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.module-video-toggle:hover {
  color: var(--teal-accent);
  background: var(--bg-tertiary);
}

.module-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--navy-dark);
}

.module-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.module-video-description {
  color: var(--text-secondary);
  font-size: calc(0.875rem + var(--text-bump));
  margin: var(--spacing-md) 0 0;
  line-height: 1.5;
}

/* Collapsed state */
.module-video.collapsed .module-video-content {
  display: none;
}

.module-video.collapsed {
  padding-bottom: var(--spacing-sm);
}

.module-video.collapsed .module-video-header {
  margin-bottom: var(--spacing-xs);
}

/* Hint text - only visible when collapsed */
.module-video-hint {
  display: none;
  color: var(--text-muted);
  font-size: calc(0.8125rem + var(--text-bump));
  font-style: italic;
  margin: 0;
  padding-left: calc(1.25rem + var(--spacing-sm)); /* Align with title text after icon */
  cursor: pointer;
}

.module-video-hint:hover {
  color: var(--text-secondary);
}

.module-video.collapsed .module-video-hint {
  display: block;
}

/* Dark mode */
[data-theme="dark"] .module-video {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .module-video-container {
  background: #000;
}

/* ===== FOUNDATION CARD VIDEO FOOTER ===== */
.foundation-card--with-video .card-body {
  border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
}

.foundation-card-video-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--teal-light, #e8f4f8);
  color: var(--teal-accent, #4a9bb5);
  border: none;
  border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  border-radius: 0;
  font-size: calc(0.8125rem + var(--text-bump));
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s) ease;
  text-align: center;
}

.foundation-card-video-btn:hover,
.foundation-card-video-btn:focus-visible {
  background: var(--teal-accent, #4a9bb5);
  color: #fff;
  outline: none;
}

.foundation-card-video-btn i {
  font-size: calc(1rem + var(--text-bump));
}

/* ===== VIDEO PLAYER MODAL ===== */
.video-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 26, 46, 0.85);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md, 1rem);
}

.video-modal-overlay.active {
  display: flex;
}

.video-modal {
  position: relative;
  background: var(--bg-primary, #fff);
  border-radius: var(--radius-lg, 8px);
  width: min(960px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  box-shadow: var(--shadow-lg, 0 10px 40px rgba(0, 0, 0, 0.3));
  padding: var(--spacing-md, 1rem);
}

.video-modal-header {
  padding-right: 3rem;
  margin-bottom: var(--spacing-md, 1rem);
}

.video-modal-header h3 {
  margin: 0;
  font-family: var(--font-heading, inherit);
  color: var(--navy-primary, #1a2b4a);
  font-size: calc(1.25rem + var(--text-bump));
}

.video-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted, #718096);
  font-size: calc(1.25rem + var(--text-bump));
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 999px;
  line-height: 1;
}

.video-modal-close:hover,
.video-modal-close:focus-visible {
  color: var(--navy-primary, #1a2b4a);
  background: var(--bg-secondary, #f8f9fa);
  outline: none;
}

.video-modal-frame {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--radius-md, 6px);
  overflow: hidden;
  background: #000;
}

.video-modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-modal-description {
  color: var(--text-secondary, #4a5568);
  font-size: calc(0.9rem + var(--text-bump));
  margin: var(--spacing-md, 1rem) 0 0;
  line-height: 1.5;
}

[data-theme="dark"] .video-modal {
  background: var(--bg-tertiary, #1a2b4a);
}

/* ===== AREA-LEVEL INTERVIEW MODAL ===== */
.area-interview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 26, 46, 0.7);
  z-index: 1050;
  padding: var(--spacing-md, 1rem);
  align-items: stretch;
  justify-content: center;
}

.area-interview-overlay.active {
  display: flex;
}

.area-interview-modal {
  background: var(--bg-primary, #fff);
  border-radius: var(--radius-lg, 8px);
  box-shadow: 0 16px 48px rgba(15, 26, 46, 0.25);
  width: min(900px, 100%);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  margin: auto;
  overflow: hidden;
}

.area-interview-header {
  position: relative;
  padding: var(--spacing-md, 1rem) var(--spacing-lg, 1.25rem);
  border-bottom: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
}

.area-interview-title {
  margin: 0 2.5rem 0.25rem 0;
  font-family: var(--font-heading, inherit);
  color: var(--navy-primary, #1a2b4a);
  font-size: calc(1.2rem + var(--text-bump));
}

.area-interview-area-name {
  color: var(--teal-accent, #4a9bb5);
}

.area-interview-subtitle {
  margin: 0;
  color: var(--text-secondary, #4a5568);
  font-size: calc(0.85rem + var(--text-bump));
}

.area-interview-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: none;
  border: none;
  font-size: calc(1.1rem + var(--text-bump));
  color: var(--text-muted, #718096);
  cursor: pointer;
  border-radius: 999px;
  padding: 0.4rem;
  line-height: 1;
}

.area-interview-close:hover,
.area-interview-close:focus-visible {
  color: var(--navy-primary, #1a2b4a);
  background: var(--bg-secondary, #f8f9fa);
  outline: none;
}

.area-interview-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.area-interview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem var(--spacing-lg, 1.25rem);
  border-bottom: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
  background: var(--bg-secondary, #f8f9fa);
}

.area-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem 0.3rem 0.6rem;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
  border-radius: 999px;
  font-size: calc(0.8rem + var(--text-bump));
  color: var(--text-secondary, #4a5568);
}

.area-chip--filled {
  background: var(--teal-light, #e8f4f8);
  border-color: var(--teal-accent, #4a9bb5);
  color: var(--navy-primary, #1a2b4a);
}

.area-chip-icon {
  font-size: calc(0.95rem + var(--text-bump));
  color: var(--text-muted, #718096);
}

.area-chip--filled .area-chip-icon {
  color: var(--teal-accent, #4a9bb5);
}

.area-chip-label {
  white-space: nowrap;
}

.area-chip-synth-btn {
  background: transparent;
  border: none;
  color: var(--teal-accent, #4a9bb5);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  line-height: 1;
  font-size: calc(0.85rem + var(--text-bump));
}

.area-chip-synth-btn:hover,
.area-chip-synth-btn:focus-visible {
  background: var(--teal-accent, #4a9bb5);
  color: #fff;
  outline: none;
}

.area-chip-synth-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.area-interview-chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.area-interview-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--spacing-md, 1rem) var(--spacing-lg, 1.25rem);
}

.area-interview-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem var(--spacing-lg, 1.25rem);
  border-top: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
  background: var(--bg-primary, #fff);
}

.area-interview-input {
  flex: 1 1 auto;
  resize: none;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: calc(0.95rem + var(--text-bump));
  color: var(--text-dark, #1a2b4a);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.1));
  border-radius: 8px;
  background: var(--bg-secondary, #f8f9fa);
}

.area-interview-input:focus {
  outline: none;
  border-color: var(--teal-accent, #4a9bb5);
}

.area-interview-send-btn {
  background: var(--teal-accent, #4a9bb5);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.area-interview-send-btn:hover,
.area-interview-send-btn:focus-visible {
  background: var(--navy-primary, #1a2b4a);
  outline: none;
}

.area-interview-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.area-interview-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem var(--spacing-lg, 1.25rem);
  border-top: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
  background: var(--bg-secondary, #f8f9fa);
}

/* Review panel */
.area-interview-review-panel {
  padding: var(--spacing-md, 1rem) var(--spacing-lg, 1.25rem);
  overflow-y: auto;
  flex: 1 1 auto;
}

.area-review-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-heading, inherit);
  color: var(--navy-primary, #1a2b4a);
  font-size: calc(1.1rem + var(--text-bump));
}

.area-review-subtitle {
  margin: 0 0 1rem;
  color: var(--text-secondary, #4a5568);
  font-size: calc(0.875rem + var(--text-bump));
}

.area-review-field {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.area-review-label {
  font-size: calc(0.85rem + var(--text-bump));
  font-weight: 600;
  color: var(--navy-primary, #1a2b4a);
}

.area-review-textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: calc(0.9rem + var(--text-bump));
  color: var(--text-dark, #1a2b4a);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.1));
  border-radius: 6px;
  background: var(--bg-secondary, #f8f9fa);
  min-height: 70px;
  resize: vertical;
}

.area-review-textarea:focus {
  outline: none;
  border-color: var(--teal-accent, #4a9bb5);
}

.area-review-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
}

[data-theme="dark"] .area-interview-modal {
  background: var(--bg-tertiary, #1a2b4a);
}

/* ===== INPUT / CONFIRM MODAL ===== */
.input-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 26, 46, 0.7);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md, 1rem);
}

.input-modal-overlay.active {
  display: flex;
}

.input-modal {
  background: var(--bg-primary, #fff);
  border-radius: var(--radius-lg, 8px);
  box-shadow: 0 16px 48px rgba(15, 26, 46, 0.25);
  width: min(440px, 100%);
  padding: var(--spacing-lg, 1.25rem);
}

.input-modal-title {
  margin: 0 0 var(--spacing-md, 1rem);
  font-family: var(--font-heading, inherit);
  color: var(--navy-primary, #1a2b4a);
  font-size: calc(1.1rem + var(--text-bump));
}

.input-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: var(--spacing-md, 1rem);
}

.input-modal-label {
  font-size: calc(0.85rem + var(--text-bump));
  font-weight: 500;
  color: var(--text-secondary, #4a5568);
}

.input-modal-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: calc(1rem + var(--text-bump));
  font-family: inherit;
  color: var(--text-dark, #1a2b4a);
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.1));
  border-radius: 6px;
  transition: border-color var(--transition-fast, 0.15s) ease;
}

.input-modal-input:focus {
  outline: none;
  border-color: var(--teal-accent, #4a9bb5);
}

.input-modal-description {
  font-size: calc(0.875rem + var(--text-bump));
  color: var(--text-secondary, #4a5568);
  margin: 0;
  line-height: 1.4;
}

.input-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: var(--spacing-sm, 0.75rem);
}

[data-theme="dark"] .input-modal {
  background: var(--bg-tertiary, #1a2b4a);
}

/* ===== ONBOARDING MODAL ===== */
.onboarding-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 43, 74, 0.85);
  z-index: 10001;
  padding: var(--spacing-lg);
}

.onboarding-modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-modal {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--spacing-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.onboarding-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.onboarding-header h1 {
  font-family: var(--font-display);
  font-size: calc(1.75rem + var(--text-bump));
  color: var(--navy-primary);
  margin-bottom: var(--spacing-xs);
}

.onboarding-subtitle {
  color: var(--text-secondary);
  font-size: calc(1rem + var(--text-bump));
}

.onboarding-step h2 {
  text-align: center;
  color: var(--navy-primary);
  font-size: calc(1.25rem + var(--text-bump));
  margin-bottom: var(--spacing-sm);
}

.onboarding-description {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  font-size: calc(0.95rem + var(--text-bump));
}

/* Option Cards */
.onboarding-options {
  display: grid;
  gap: var(--spacing-md);
}

.onboarding-options-3 {
  grid-template-columns: repeat(3, 1fr);
}

.onboarding-options-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 560px;
  margin: 0 auto;
}

.onboarding-option {
  background: var(--bg-secondary);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
  position: relative;
}

.onboarding-option:hover {
  border-color: var(--teal-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.onboarding-option.recommended {
  border-color: var(--teal-accent);
  background: var(--teal-light);
}

.onboarding-option-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--teal-accent);
  color: white;
  padding: 2px 12px;
  border-radius: 12px;
  font-size: calc(0.7rem + var(--text-bump));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.onboarding-option-icon {
  font-size: calc(2.25rem + var(--text-bump));
  margin-bottom: var(--spacing-sm);
  color: var(--navy-primary);
}

.onboarding-option-icon i {
  display: inline-block;
}

.onboarding-option h3 {
  font-family: var(--font-heading);
  font-size: calc(1.1rem + var(--text-bump));
  color: var(--navy-primary);
  margin-bottom: var(--spacing-xs);
}

.onboarding-option > p {
  color: var(--text-secondary);
  font-size: calc(0.85rem + var(--text-bump));
  margin-bottom: var(--spacing-md);
}

.onboarding-option-features {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font-size: calc(0.85rem + var(--text-bump));
  color: var(--text-secondary);
}

.onboarding-option-features li {
  padding: var(--spacing-xs) 0;
  padding-left: 1.5rem;
  position: relative;
}

.onboarding-option-features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--teal-accent);
  font-weight: bold;
}

.onboarding-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.onboarding-option.disabled .onboarding-option-icon {
  color: var(--text-muted);
}

.onboarding-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: calc(0.85rem + var(--text-bump));
  margin-top: var(--spacing-lg);
}

/* Dark mode */
[data-theme="dark"] .onboarding-modal {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
}

[data-theme="dark"] .onboarding-option {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .onboarding-option.recommended {
  background: rgba(74, 155, 181, 0.15);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .onboarding-modal-overlay {
    padding: var(--spacing-md);
  }

  .onboarding-modal {
    padding: var(--spacing-lg);
    max-height: 95vh;
  }

  .onboarding-header h1 {
    font-size: calc(1.5rem + var(--text-bump));
  }

  .onboarding-options-3,
  .onboarding-options-2 {
    grid-template-columns: 1fr;
  }

  .onboarding-option {
    padding: var(--spacing-md);
  }

  .onboarding-option-icon {
    font-size: calc(1.75rem + var(--text-bump));
  }

  .onboarding-option h3 {
    font-size: calc(1rem + var(--text-bump));
  }
}

/* ===== GLOBAL TRIX EDITOR STYLES ===== */
/* Base Trix content area styling for module textareas */
.trix-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  min-height: 80px;
  font-family: var(--font-body);
  font-size: calc(0.95rem + var(--text-bump));
  line-height: 1.6;
  color: var(--text-dark);
}

.trix-content:focus {
  outline: none;
  border-color: var(--teal-accent);
  box-shadow: 0 0 0 3px rgba(74, 155, 181, 0.1);
}

.trix-content:empty:not(:focus)::before {
  color: var(--text-muted);
}

/* Compact variant for smaller fields */
.trix-content.trix-compact {
  min-height: 60px;
  padding: 0.5rem 0.75rem;
  font-size: calc(0.9rem + var(--text-bump));
}

/* Dark mode for global Trix */
[data-theme="dark"] .trix-content {
  background: var(--bg-secondary);
  border-color: var(--border-medium);
  color: #e8ecf4;
}

[data-theme="dark"] .trix-content:focus {
  border-color: var(--teal-accent);
}

/* Shared rich-text field autosave status line */
.rich-text-field .field-status {
  min-height: 1.1em;
  margin-top: 0.35rem;
  font-size: calc(0.8rem + var(--text-bump));
  color: var(--text-muted, #718096);
}

/* ── Trix toolbar: brand it and limit to the original's compact button set ── */
trix-toolbar {
  margin-bottom: 0.4rem;
}

trix-toolbar .trix-button-row {
  justify-content: flex-start;
  gap: 0.4rem;
}

trix-toolbar .trix-button-group {
  margin-bottom: 0;
  border-color: var(--border-light);
  border-radius: var(--radius-md, 6px);
  overflow: hidden;
}

trix-toolbar .trix-button-group:not(:first-child) {
  margin-left: 0;
}

trix-toolbar .trix-button-group-spacer {
  display: none;
}

trix-toolbar .trix-button {
  border-bottom: none;
  color: var(--text-secondary);
}

trix-toolbar .trix-button.trix-active {
  background: var(--teal-light, #e8f4f8);
  color: var(--teal-accent);
}

/* Keep only bold / italic / bullet / number / undo / redo (the original's set);
   hide every other default Trix control. */
trix-toolbar .trix-button--icon-strike,
trix-toolbar .trix-button--icon-link,
trix-toolbar .trix-button--icon-heading-1,
trix-toolbar .trix-button--icon-quote,
trix-toolbar .trix-button--icon-code,
trix-toolbar .trix-button--icon-decrease-nesting-level,
trix-toolbar .trix-button--icon-increase-nesting-level,
trix-toolbar .trix-button--icon-attach,
trix-toolbar .trix-button-group--file-tools {
  display: none;
}

[data-theme="dark"] trix-toolbar .trix-button-group {
  border-color: var(--border-medium);
}

[data-theme="dark"] trix-toolbar .trix-button {
  color: #cbd5e0;
}

/* ===== PROFILE COMPLETION MODAL ===== */
.profile-complete-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.profile-complete-modal {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-complete-modal .modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.profile-complete-modal .modal-header h3 {
  color: var(--navy-primary);
  font-size: calc(1.25rem + var(--text-bump));
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.profile-complete-modal .modal-header h3 i {
  color: var(--teal-accent);
}

.profile-complete-modal .modal-body {
  padding: 1.5rem;
}

.profile-complete-modal .modal-body p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.profile-name-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-name-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: calc(1rem + var(--text-bump));
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-name-input:focus {
  outline: none;
  border-color: var(--teal-accent);
  box-shadow: 0 0 0 3px rgba(74, 155, 181, 0.1);
}

.profile-name-input::placeholder {
  color: var(--text-muted);
}

.profile-complete-modal .modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
}

.profile-complete-modal .modal-footer .btn {
  min-width: 120px;
  justify-content: center;
}

/* Dark mode */
[data-theme="dark"] .profile-complete-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
}

[data-theme="dark"] .profile-name-input {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  color: var(--text-dark);
}

[data-theme="dark"] .profile-name-input:focus {
  border-color: var(--teal-accent);
}

/* ===== EDIT NAME (Settings) ===== */
.user-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.edit-name-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  font-size: calc(0.75rem + var(--text-bump));
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  opacity: 0.6;
}

.edit-name-icon-btn:hover {
  color: var(--teal-accent);
  background: var(--bg-tertiary);
  opacity: 1;
}

.edit-name-inline {
  /* Hidden until the pencil is clicked; the settings controller toggles the
     inline display. (form_with drops a top-level style:, so default it here.) */
  display: none;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.edit-name-inputs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.edit-name-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: calc(0.9rem + var(--text-bump));
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-dark);
}

.edit-name-input:focus {
  outline: none;
  border-color: var(--teal-accent);
  box-shadow: 0 0 0 2px rgba(74, 155, 181, 0.1);
}

.edit-name-input::placeholder {
  color: var(--text-muted);
}

.edit-name-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Dark mode */
[data-theme="dark"] .edit-name-inline {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .edit-name-input {
  background: var(--bg-secondary);
  border-color: var(--border-medium);
  color: var(--text-dark);
}

/* ===== PROFILE COMPLETION MODAL (Premium Styling) ===== */
.profile-modal {
  max-width: 500px;
  border-radius: 12px;
  padding: 2rem;
}

.profile-modal .modal-header {
  justify-content: center;
  margin-bottom: 0.5rem;
}

.profile-modal .modal-header h3 {
  font-size: calc(1.25rem + var(--text-bump));
  font-weight: 600;
  color: var(--navy-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-modal .modal-header h3 i {
  color: var(--teal-accent);
}

.profile-modal .modal-body {
  text-align: center;
}

.profile-modal-subtitle {
  color: var(--text-secondary);
  font-size: calc(0.95rem + var(--text-bump));
  margin-bottom: 1.5rem;
}

.profile-name-fields {
  display: flex;
  gap: 0.75rem;
}

.profile-field {
  flex: 1;
}

.profile-field label {
  display: none;
}

.profile-field input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: calc(1rem + var(--text-bump));
  border: 2px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.profile-field input:focus {
  outline: none;
  border-color: var(--teal-accent);
  box-shadow: 0 0 0 3px rgba(74, 155, 181, 0.15);
}

.profile-field input::placeholder {
  color: var(--text-muted);
}

.profile-modal .modal-actions {
  justify-content: flex-end;
  margin-top: 1.25rem;
  gap: 0.5rem;
}

.profile-modal .modal-actions .btn {
  padding: 0.75rem 1.25rem;
  font-size: calc(0.9rem + var(--text-bump));
  font-weight: 600;
  border-radius: 6px;
}

/* Dark mode for profile modal */
[data-theme="dark"] .profile-modal {
  background: var(--bg-secondary);
}

[data-theme="dark"] .profile-modal .modal-header h3 {
  color: var(--text-dark);
}

[data-theme="dark"] .profile-field input {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  color: var(--text-dark);
}

[data-theme="dark"] .profile-field input:focus {
  border-color: var(--teal-accent);
}

/* ===== SYNC ERROR STYLES ===== */

/* Sync status warning state */
.sync-error-warning {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  padding: 4px 12px;
  border-radius: 4px;
  animation: syncErrorPulse 2s ease-in-out infinite;
}

.sync-error-warning i {
  color: #dc2626 !important;
}

@keyframes syncErrorPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Sync error banner */
.sync-error-banner {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: calc(0.9rem + var(--text-bump));
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sync-error-banner i {
  font-size: calc(1.2rem + var(--text-bump));
  flex-shrink: 0;
}

.sync-error-banner span {
  flex: 1;
}

.sync-error-banner .sync-error-dismiss {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.sync-error-banner .sync-error-dismiss:hover {
  opacity: 1;
}

/* Dark mode */
[data-theme="dark"] .sync-error-warning {
  background: #450a0a !important;
  color: #fca5a5 !important;
}

[data-theme="dark"] .sync-error-warning i {
  color: #fca5a5 !important;
}

/* ===== IMPERSONATION BANNER ===== */
.impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: #dc2626;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: calc(14px + var(--text-bump));
  font-weight: 500;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.impersonation-exit-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 4px 12px;
  font-size: calc(12px + var(--text-bump));
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.impersonation-exit-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

body.impersonating .app-wrapper,
body.impersonating .login-screen {
  margin-top: 40px;
}

body.impersonating .module-nav {
  top: 40px;
}

/* ============================================================
   Settings modal — sidebar layout (Rails redesign)
   Profile · Appearance · AI Memory · Data, with a left-rail nav.
   Overrides the earlier .settings-modal block above (later wins).
   ============================================================ */
.settings-modal {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  width: 100%;
  max-width: none;
  max-height: min(90vh, 680px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.28);
}

.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.settings-modal-header h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-family: var(--font-heading);
  font-size: calc(1.3rem + var(--text-bump));
  font-weight: 600;
  color: var(--text-dark);
}

.settings-modal-header h3 i { color: var(--teal-accent); font-size: 0.95em; }

.settings-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: calc(1.6rem + var(--text-bump));
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.settings-modal-close:hover { color: var(--text-dark); }

/* ── Shell: sidebar + panes ─────────────────────────────────── */
.settings-shell { display: flex; flex: 1; min-height: 0; }

.settings-nav {
  width: 184px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-light);
  background: var(--bg-secondary);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.7rem;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: calc(0.95rem + var(--text-bump));
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.settings-nav-item i { font-size: 1.05em; width: 1.1em; text-align: center; }
.settings-nav-item:hover { background: var(--bg-tertiary); color: var(--text-dark); }

.settings-nav-item.active {
  background: var(--teal-light);
  color: var(--text-dark);
  font-weight: 600;
  border-left-color: var(--teal-accent);
}

.settings-nav-item.active i { color: var(--teal-accent); }
.settings-nav-item:focus-visible { outline: 2px solid var(--teal-accent); outline-offset: -2px; }

.settings-panes { flex: 1; min-width: 0; overflow-y: auto; padding: 1.5rem 1.75rem; }
.settings-pane { display: none; }
.settings-pane.active { display: block; }
.settings-pane[hidden] { display: none; }

.settings-pane-title {
  font-family: var(--font-heading);
  font-size: calc(1.15rem + var(--text-bump));
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 0.25rem;
}

.settings-pane-lead {
  color: var(--text-secondary);
  font-size: calc(0.9rem + var(--text-bump));
  margin: 0 0 1.5rem;
  line-height: 1.5;
  max-width: 46ch;
}

/* ── Rows ───────────────────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-light);
}

.settings-row-label { display: flex; flex-direction: column; gap: 0.15rem; }

.settings-row-title {
  color: var(--text-dark);
  font-weight: 600;
  font-size: calc(0.95rem + var(--text-bump));
}

.settings-row-desc {
  color: var(--text-secondary);
  font-size: calc(0.82rem + var(--text-bump));
  line-height: 1.45;
  max-width: 42ch;
}

/* ── Blocks (memory summary, sync) ──────────────────────────── */
.settings-block { padding: 1rem 0; border-top: 1px solid var(--border-light); }

.settings-block-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dark);
  font-weight: 600;
  font-size: calc(0.95rem + var(--text-bump));
  margin-bottom: 0.5rem;
}

.settings-block-head i { color: var(--teal-accent); }

.settings-block-desc {
  color: var(--text-secondary);
  font-size: calc(0.85rem + var(--text-bump));
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.settings-sync-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.settings-sync-hint { color: var(--text-muted); font-size: calc(0.8rem + var(--text-bump)); }

/* Compact "what 100x knows" — drop the big grey box; show a clean inline note
   (empty) or a tidy list (populated). */
.settings-pane .memory-summary {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.settings-pane .memory-empty {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0;
  text-align: left;
  color: var(--text-secondary);
  font-size: calc(0.85rem + var(--text-bump));
}

.settings-pane .memory-empty i {
  display: inline;
  font-size: 1.15em;
  margin: 0;
  opacity: 1;
  color: var(--teal-accent);
}

.settings-pane .memory-empty p { margin: 0; line-height: 1.5; }

/* ── Destructive ─────────────────────────────────────────────── */
.settings-danger-link {
  background: none;
  border: none;
  padding: 0.2rem 0;
  color: var(--text-muted);
  font-size: calc(0.9rem + var(--text-bump));
  cursor: pointer;
  text-decoration: underline;
  align-self: center;
}

.settings-danger-link:hover { color: var(--danger, #c0392b); }

.settings-danger-zone {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(192, 57, 43, 0.25);
  border-radius: 8px;
  background: rgba(192, 57, 43, 0.035);
}

.settings-danger-zone-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--danger, #c0392b);
  font-weight: 600;
  font-size: calc(0.95rem + var(--text-bump));
  margin-bottom: 0.4rem;
}

.settings-danger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: none;
  border: 1px solid var(--danger, #c0392b);
  color: var(--danger, #c0392b);
  border-radius: 6px;
  cursor: pointer;
  font-size: calc(0.88rem + var(--text-bump));
  transition: background var(--transition-fast), color var(--transition-fast);
}

.settings-danger-btn:hover:not(:disabled) { background: var(--danger, #c0392b); color: #fff; }
.settings-danger-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.settings-danger-confirm { display: none; margin-top: 0.85rem; }
.settings-danger-confirm-warn { color: var(--danger, #c0392b); font-weight: 600; margin: 0 0 0.5rem; }
.settings-danger-confirm-label { display: block; font-size: calc(0.85rem + var(--text-bump)); margin-bottom: 0.4rem; }

.settings-danger-confirm-input {
  width: 200px;
  max-width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  margin-bottom: 0.6rem;
}

.settings-danger-confirm-actions { display: flex; gap: 0.5rem; }

/* ── Footer ─────────────────────────────────────────────────── */
.settings-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

/* ── Responsive: sidebar collapses to a top strip ───────────── */
@media (max-width: 560px) {
  .settings-shell { flex-direction: column; }

  .settings-nav {
    width: auto;
    flex-direction: row;
    gap: 0.25rem;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding: 0.6rem 0.75rem;
  }

  .settings-nav-item {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.45rem 0.7rem;
    white-space: nowrap;
  }

  .settings-nav-item.active { border-left: none; border-bottom-color: var(--teal-accent); }
  .settings-panes { padding: 1.25rem 1.25rem; }
}
