/* ============================================================
   components.css — Cards, buttons, habits, modals, forms
   ============================================================ */

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  transition: background var(--t-smooth), border-color var(--t);
}
.card-sm { padding: 14px 16px; }
.card-lg { padding: 24px; }

.card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.card-header h2, .card-header h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ── Discipline Score Card ───────────────────────────────────── */
.score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 16px;
}

.score-ring-wrap {
  position: relative;
  width: 100px;
  height: 100px;
}

.score-ring-wrap svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.ring-bg {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 8;
}

.ring-progress {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 1.2s ease-out;
}

.score-value-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-number {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.score-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-2);
  text-align: center;
  margin-top: 8px;
}

/* ── Progress Card ───────────────────────────────────────────── */
.progress-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 22px 20px;
}

.progress-fraction {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1;
}
.progress-fraction .total { color: var(--text-3); font-size: 22px; }

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 6px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-pill);
  transition: width 0.8s ease-out;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
  to { left: 200%; }
}

.progress-bar.full { background: linear-gradient(90deg, var(--success), #4ade80); }

.progress-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.progress-remaining {
  font-size: 12px;
  color: var(--text-2);
}

/* ── Streak Card ─────────────────────────────────────────────── */
.streak-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 22px 16px;
  background: linear-gradient(145deg, var(--surface), var(--streak-10));
  position: relative;
  overflow: hidden;
}

.streak-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: radial-gradient(circle, var(--streak-10) 0%, transparent 70%);
  border-radius: 50%;
}

.streak-fire {
  font-size: 32px;
  transition: transform 0.3s;
  filter: drop-shadow(0 4px 8px rgba(249,115,22,0.4));
}
.streak-card:hover .streak-fire { transform: scale(1.08); }

.streak-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.streak-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.streak-best {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── XP Card ─────────────────────────────────────────────────── */
.xp-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 18px 20px;
  background: var(--surface);
}

.xp-icon { font-size: 18px; color: var(--xp); }
.xp-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.xp-label { font-size: 12px; color: var(--text-2); font-weight: 500; }

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-10);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-20);
  margin-top: 4px;
  width: fit-content;
}

.level-bar-wrap {
  width: 100%;
  height: 5px;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 6px;
}

.level-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--xp), #fbbf24);
  border-radius: var(--radius-pill);
  transition: width 1s ease-out;
}

.level-xp-info {
  font-size: 11px;
  color: var(--text-3);
}

/* ── Today's Habits Card ─────────────────────────────────────── */
.habits-card {
  margin-bottom: 0;
}

.habits-list { display: flex; flex-direction: column; gap: 8px; }

/* ── Habit Item (in Today's list) ────────────────────────────── */
.habit-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}

.habit-item:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateX(2px);
}

.habit-item.completed {
  background: var(--success-10);
  border-color: var(--success);
}

.habit-item.completed .habit-item-name {
  text-decoration: line-through;
  color: var(--text-2);
}

.habit-check-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-spring);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  color: transparent;
}

.habit-item.completed .habit-check-btn {
  background: var(--success);
  border-color: var(--success);
  color: white;
  transform: scale(1.05);
}

.habit-item:not(.completed) .habit-check-btn:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

.habit-item-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.habit-item-info { flex: 1; min-width: 0; }
.habit-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  transition: color var(--t);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.habit-item-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.habit-meta-streak { color: var(--streak); font-weight: 600; }
.habit-meta-xp { color: var(--xp); font-weight: 600; }

.habit-item-difficulty {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}
.diff-easy   { background: var(--success-10); color: var(--success); }
.diff-medium { background: var(--accent-10);  color: var(--accent);  }
.diff-hard   { background: var(--danger-10);  color: var(--danger);  }

/* ── Reorder Button ──────────────────────────────────────────── */
.btn-reorder {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}
.btn-reorder:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-10);
}
.btn-reorder.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-reorder.active:hover { opacity: 0.88; }

/* ── Drag Handle ─────────────────────────────────────────────── */
.habit-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-3);
  cursor: grab;
  touch-action: none;
  transition: color var(--t), background var(--t);
}
.habit-drag-handle:hover {
  color: var(--accent);
  background: var(--accent-10);
}
.habit-drag-handle:active { cursor: grabbing; }

/* ── Reorder Mode State ───────────────────────────────────────── */
.habit-item.reorder-mode {
  cursor: default;
  border-color: var(--accent-10);
  background: var(--surface-2);
  animation: none;
}
.habit-item.reorder-mode:hover {
  transform: none;
  border-color: var(--border);
  background: var(--surface-2);
}
.habit-item.dragging {
  opacity: 0.45;
  border: 2px dashed var(--accent) !important;
  background: var(--accent-10) !important;
}
.habit-drag-placeholder {
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--accent-10);
  opacity: 0.45;
  margin: 0;
  box-sizing: border-box;
}
.habit-check-btn.disabled-in-reorder {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}



/* ── Habit Cards (Habits Page) ───────────────────────────────── */
.habits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.habit-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 20px;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
  animation: slideInUp 0.3s ease both;
}

.habit-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }

.habit-card-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.habit-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.habit-card-icon-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.habit-card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: var(--accent-10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.habit-card-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 3px;
}
.habit-card-category {
  font-size: 12px;
  color: var(--text-2);
}

.habit-card-menu {
  display: flex;
  gap: 4px;
}
.habit-card-menu button {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--t);
  border: 1px solid var(--border);
}
.habit-card-menu button:hover { background: var(--accent-10); color: var(--accent); border-color: var(--accent); }
.habit-card-menu button.icon-delete-btn:hover { background: var(--danger-10, rgba(239, 68, 68, 0.1)); color: var(--danger, #ef4444); border-color: rgba(239, 68, 68, 0.35); }

.habit-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.habit-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.habit-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.habit-stat-label {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
  text-align: center;
}

.habit-card-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all var(--t);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.btn-primary:hover:not(:disabled) {
  opacity: 0.90;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
}
.btn-primary.full-width { width: 100%; text-align: center; display: block; }

@keyframes inputErrorShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.input-error-shake {
  animation: inputErrorShake 0.4s ease-in-out;
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}
.btn-primary.btn-completed {
  background: var(--success-10);
  border: 1px solid var(--success);
  color: var(--success);
  box-shadow: none;
}
.btn-primary.btn-completed:hover {
  background: rgba(34, 197, 94, 0.22);
  border-color: var(--success);
  transform: none;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  transition: all var(--t);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--accent); }

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-2);
  transition: all var(--t);
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--accent-10); border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: var(--danger-10);
  color: var(--danger);
  border: 1px solid var(--danger);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  transition: all var(--t);
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-checkin {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--t);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.btn-checkin:hover {
  background: var(--surface-hover);
  border-color: var(--border-2);
  transform: translateY(-1px);
}

.btn-checkin:active {
  transform: scale(0.98);
}

.btn-checkin-badge {
  background: var(--accent-10);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-20);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-checkin.checked-in {
  background: var(--success-10);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--success);
  box-shadow: none;
}

.btn-checkin.checked-in:hover {
  background: rgba(16, 185, 129, 0.14);
  border-color: var(--success);
  transform: translateY(-1px);
  color: var(--success);
}

.btn-checkin.checked-in .btn-checkin-badge {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.30);
  box-shadow: none;
}

.daily-quote-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.daily-quote {
  font-size: 14px;
  color: var(--text-2);
  font-style: italic;
  transition: opacity 0.25s ease, transform 0.25s ease;
  cursor: pointer;
  margin-top: 0;
}
.daily-quote:hover {
  color: var(--accent);
}
.daily-quote.quote-fade {
  opacity: 0;
  transform: translateY(-4px);
}

.btn-quote-refresh {
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-spring);
  color: var(--text-2);
  flex-shrink: 0;
}
.btn-quote-refresh:hover {
  background: var(--accent-10);
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(180deg) scale(1.1);
}

/* ── Filter Tabs ─────────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-tab {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface);
  transition: all var(--t);
}
.filter-tab:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-10); }
.filter-tab.active { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 4px 12px rgba(124,111,247,0.4); }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-2);
}
.empty-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.5; }
.empty-state p { margin-bottom: 20px; font-size: 15px; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(10, 8, 26, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 99999 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
}

.modal-overlay.modal-open {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: all !important;
  visibility: visible !important;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto !important;
  position: relative !important;
  z-index: 100000 !important;
  animation: modalPopIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-overlay.modal-open .modal {
  opacity: 1 !important;
  transform: scale(1) translateY(0) !important;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 0;
  margin-bottom: 20px;
}
.modal-header h2 { font-size: 20px; font-weight: 800; }

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 16px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t);
  border: 1px solid var(--border);
}
.modal-close:hover { background: var(--danger-10); color: var(--danger); border-color: var(--danger); }

.modal-body { padding: 0 24px 24px; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: all var(--t);
  outline: none;
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-10);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239B99B5' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* ── Icon Picker ─────────────────────────────────────────────── */
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.icon-option {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t);
}
.icon-option:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--surface-3);
}
.icon-option.selected {
  border-color: var(--accent);
  background: var(--accent-10);
  color: var(--accent);
}

/* ── Radio Groups ────────────────────────────────────────────── */
.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: all var(--t);
  flex: 1;
  min-width: 80px;
}
.radio-option input { display: none; }
.radio-option.selected {
  border-color: var(--accent);
  background: var(--accent-10);
  color: var(--accent);
}
.radio-option:hover { border-color: var(--accent); }

/* ── Frequency group — compact 4-option row ─────────────────── */
.freq-group {
  gap: 6px;
}
.freq-group .radio-option {
  padding: 8px 10px;
  font-size: 12px;
  min-width: 0;
  flex: 1;
  text-align: center;
  justify-content: center;
}
.freq-custom-btn {
  border-style: dashed;
}
.freq-custom-btn.selected {
  border-style: solid;
}

/* ── Custom Days Picker ───────────────────────────────────────── */
.custom-days-picker {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--accent-20, rgba(124,111,247,0.2));
  border-radius: var(--radius-sm);
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.custom-days-picker.hidden { display: none; }

.day-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.day-chip {
  flex: 1;
  min-width: 36px;
  padding: 7px 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t);
}
.day-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-10);
}
.day-chip.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}



.diff-picker { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.diff-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  transition: all var(--t);
  text-align: center;
}
.diff-option input { display: none; }
.diff-option.selected { border-color: var(--accent); background: var(--accent-10); color: var(--accent); }

/* ── Achievement Cards ───────────────────────────────────────── */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.achievement-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: all var(--t);
  animation: slideInUp 0.3s ease both;
  position: relative;
  overflow: hidden;
}
.achievement-card:not(.locked):hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}
.achievement-card.locked { opacity: 0.45; }
.achievement-card.locked:hover { opacity: 0.65; }

.achievement-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  margin-bottom: 4px;
  transition: all var(--t);
}
.achievement-card:not(.locked) .achievement-icon {
  background: var(--accent-10);
  border-color: var(--accent-20);
  color: var(--accent);
}
.achievement-name { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.achievement-desc { font-size: 12px; color: var(--text-2); line-height: 1.5; }

.rarity-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}
.rarity-common     { background: var(--surface-2); color: var(--text-3); }
.rarity-rare       { background: var(--surface-2); color: var(--text-2); }
.rarity-epic       { background: var(--accent-10); color: var(--accent); border-color: var(--accent-20); }
.rarity-legendary  { background: var(--surface-2); color: var(--text); border-color: var(--border-hover); }

.achievement-unlocked-label {
  font-size: 10px;
  color: var(--text-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.achievement-progress {
  width: 100%;
  height: 4px;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 4px;
}
.achievement-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 0.8s ease;
}

/* ── Reward Cards ────────────────────────────────────────────── */
.rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.reward-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  transition: all var(--t);
  cursor: pointer;
  animation: slideInUp 0.3s ease both;
}
.reward-card.unlocked {
  border-color: var(--border);
  background: var(--surface);
}
.reward-card.unlocked:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.reward-card.locked { opacity: 0.45; cursor: not-allowed; }
.reward-card.locked:hover { opacity: 0.65; }

.reward-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--t);
}
.reward-card.unlocked .reward-icon {
  background: var(--accent-10);
  border-color: var(--accent-20);
  color: var(--accent);
}
.reward-name { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.reward-cost {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--text-2);
  background: var(--surface-2);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}
.reward-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}
.reward-status.unlocked { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.reward-status.locked   { color: var(--text-3); background: transparent; border: 1px solid var(--border); }
.reward-status.equipped { color: var(--accent); background: var(--accent-10); border: 1px solid var(--accent); }
.reward-card.equipped   { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent) !important; }

/* ── Analytics ───────────────────────────────────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.stat-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-overview-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--t);
}
.stat-overview-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-overview-value { font-size: 26px; font-weight: 900; color: var(--text); letter-spacing: -0.5px; }
.stat-overview-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }

.top-habits-list { display: flex; flex-direction: column; gap: 10px; }

.top-habit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.top-habit-rank {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-3);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.top-habit-icon { font-size: 18px; flex-shrink: 0; }
.top-habit-info { flex: 1; min-width: 0; }
.top-habit-name { font-size: 14px; font-weight: 600; }
.top-habit-pct-bar-wrap { height: 4px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; margin-top: 4px; }
.top-habit-pct-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); border-radius: var(--radius-pill); }
.top-habit-pct { font-size: 13px; font-weight: 700; color: var(--accent); flex-shrink: 0; }

/* ── Executive Streaks & Consistency Suite ───────────────────── */
.streak-executive-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .streak-executive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .streak-executive-grid {
    grid-template-columns: 1fr;
  }
}

.streak-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}
.streak-kpi-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-2);
}
.streak-kpi-card.streak-kpi-primary {
  border-color: rgba(245, 158, 11, 0.25);
}
[data-theme="dark"] .streak-kpi-card.streak-kpi-primary {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.05) 0%, var(--surface) 100%);
  border-color: rgba(245, 158, 11, 0.20);
}

.streak-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.streak-kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}
.streak-kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--streak);
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--streak);
  box-shadow: 0 0 8px var(--streak);
  animation: pulseLight 1.8s infinite ease-in-out;
}
@keyframes pulseLight {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.streak-kpi-flames {
  font-size: 16px;
  letter-spacing: 3px;
  line-height: 1;
}
.streak-kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
}
.streak-kpi-icon.trophy-glyph {
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.streak-kpi-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.streak-kpi-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.streak-kpi-primary .streak-kpi-num {
  color: var(--streak);
}
.streak-kpi-unit {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.streak-kpi-meter {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.streak-kpi-meter-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.8s ease;
}

.streak-kpi-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
  line-height: 1.3;
}

/* ── Annual Consistency Heatmap ──────────────────────────────── */
.heatmap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}
.heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.heatmap-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.heatmap-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.heatmap-year-selector {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.heatmap-year-btn {
  background: transparent;
  border: none;
  outline: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  padding: 2px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.3;
}
.heatmap-year-btn:hover {
  color: var(--text);
}
.heatmap-year-btn.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.heatmap-subtitle {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.matrix-range-pill,
.matrix-progress-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.heatmap-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-3);
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.legend-text {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 4px;
  font-weight: 600;
}

.heatmap-scroll-container {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
  -webkit-overflow-scrolling: touch;
}
.heatmap-scroll-container::-webkit-scrollbar {
  height: 5px;
}
.heatmap-scroll-container::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 4px;
}
.heatmap-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

.heatmap-matrix-wrapper {
  display: flex;
  flex-direction: column;
  min-width: 860px;
  width: 100%;
}

.heatmap-row-wrapper {
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 8px;
  align-items: start;
}

.heatmap-months-row {
  margin-bottom: 6px;
  height: 18px;
}
.heatmap-day-label-space {
  width: 36px;
}
.heatmap-months-track {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  column-gap: 3.5px;
  height: 18px;
  align-items: center;
}
.heatmap-month-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}
.heatmap-month-label.has-year-tag {
  color: var(--text);
  font-weight: 700;
}
.heatmap-month-label.is-current-month {
  color: var(--accent);
  font-weight: 800;
}
.year-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-10);
  border: 1px solid var(--accent-20);
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0;
  line-height: 1.1;
}

.heatmap-body-row {
  align-items: stretch;
}
.heatmap-days-col {
  width: 36px;
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  row-gap: 3.5px;
  text-align: right;
  padding-right: 6px;
}
.heatmap-day-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  line-height: 1;
  user-select: none;
}

.heatmap-weeks-grid {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  column-gap: 3.5px;
}
.heatmap-col {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  row-gap: 3.5px;
}

.heatmap-cell {
  width: 100%;
  aspect-ratio: 1;
  min-width: 10px;
  min-height: 10px;
  border-radius: 2.5px;
  box-sizing: border-box;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), filter 0.12s ease;
  cursor: pointer;
}
.heatmap-legend .heatmap-cell {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}
.heatmap-cell.lvl-0 {
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.heatmap-cell.lvl-1 {
  background: rgba(94, 106, 210, 0.32);
  border: 1px solid rgba(94, 106, 210, 0.15);
}
.heatmap-cell.lvl-2 {
  background: rgba(94, 106, 210, 0.58);
}
.heatmap-cell.lvl-3 {
  background: rgba(94, 106, 210, 0.82);
}
.heatmap-cell.lvl-4 {
  background: #6366F1;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.45);
}
.heatmap-cell.is-today {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.heatmap-cell.is-future {
  cursor: default;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  opacity: 0.55;
}
.heatmap-cell.is-future:hover {
  opacity: 0.85;
  border-color: var(--text-3);
  transform: scale(1.15);
  z-index: 5;
}
.heatmap-cell.is-outside-year {
  visibility: hidden !important;
  pointer-events: none !important;
}
.heatmap-cell:not(.is-future):hover {
  transform: scale(1.35);
  z-index: 10;
  filter: brightness(1.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.heatmap-tooltip {
  position: absolute;
  pointer-events: none;
  background: #0D0E12;
  color: #EDEDED;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  z-index: 999;
  white-space: nowrap;
  animation: fadeIn 0.12s ease;
}

/* ── Habit Performance Ledger ────────────────────────────────── */
.streak-ledger-section {
  margin-bottom: 24px;
}
.streak-ledger-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.streak-ledger-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.streak-ledger-sub {
  font-size: 12px;
  color: var(--text-3);
}

.streak-ledger-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ledger-table-header {
  display: grid;
  grid-template-columns: minmax(200px, 1.3fr) 175px 120px 115px 170px 125px;
  column-gap: 14px;
  align-items: center;
  padding: 8px 18px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ledger-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ledger-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.3fr) 175px 120px 115px 170px 125px;
  column-gap: 14px;
  align-items: center;
  padding: 13px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  transition: all var(--t);
  animation: slideInUp 0.25s ease both;
}
.ledger-row:hover {
  background: var(--surface-hover);
  border-color: var(--border-2);
  transform: translateY(-1px);
}

.col-habit {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ledger-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.ledger-name-wrap {
  min-width: 0;
}
.ledger-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.ledger-category {
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}

.col-spark {
  display: flex;
  align-items: center;
}
.sparkline-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.spark-dot {
  width: 19px;
  height: 23px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  transition: all var(--t);
  user-select: none;
}
.spark-letter {
  display: block;
  line-height: 1;
}
.spark-dot.is-done {
  background: rgba(16, 185, 129, 0.18);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.45);
  font-weight: 800;
}
[data-theme="dark"] .spark-dot.is-done {
  background: rgba(16, 185, 129, 0.25);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.55);
}
.spark-dot.is-today-due {
  background: rgba(245, 158, 11, 0.14);
  color: #F59E0B;
  border: 1.5px solid #F59E0B;
  font-weight: 800;
}
.spark-dot.is-missed {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-2);
  opacity: 0.85;
}
.spark-dot.is-unscheduled {
  background: transparent;
  color: var(--text-3);
  border: 1px dashed var(--border);
  opacity: 0.55;
}
.spark-dot:hover {
  transform: scale(1.15);
  z-index: 2;
}

.col-streak {
  display: flex;
  align-items: center;
}
.streak-pill-val {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--streak);
  font-variant-numeric: tabular-nums;
}
.streak-pill-val .fire-icon {
  font-size: 14px;
}
.streak-pill-val .num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.col-best {
  display: flex;
  align-items: center;
}
.best-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.best-trophy-icon {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1;
}
.best-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.col-consistency {
  display: flex;
  align-items: center;
}
.ledger-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.ledger-progress-track {
  flex: 1;
  height: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}
.ledger-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366F1, #818CF8);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.35);
}
.ledger-progress-fill.is-elite {
  background: linear-gradient(90deg, #10B981, #34D399);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}
.ledger-progress-num {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

.col-status {
  display: flex;
  align-items: center;
}
.ledger-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.ledger-tag.tag-done {
  background: var(--success-10);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.ledger-tag.tag-due {
  background: var(--streak-10);
  color: var(--streak);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.ledger-tag.tag-rest {
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
}

@media (max-width: 900px) {
  .ledger-table-header {
    display: none;
  }
  .ledger-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }
  .ledger-row > div:not(.col-habit) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .ledger-row .col-spark::before {
    content: "Last 7 Days";
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
  }
  .ledger-row .col-streak::before {
    content: "Current Streak";
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
  }
  .ledger-row .col-best::before {
    content: "Best Record";
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
  }
  .ledger-row .col-consistency::before {
    content: "30D Consistency";
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    margin-right: 12px;
  }
  .ledger-row .col-status::before {
    content: "Today's Status";
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
  }
}

/* ── Discipline Shields / Milestone Matrix ───────────────────── */
.shields-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}
.shields-header {
  margin-bottom: 16px;
}
.shields-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.shields-subtitle {
  font-size: 12px;
  color: var(--text-3);
}

.shields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.shield-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--t);
  position: relative;
}
.shield-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-2);
}
.shield-card.shield-unlocked {
  border-color: rgba(94, 106, 210, 0.25);
}
.shield-card.shield-target {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15);
}
.shield-card.shield-locked {
  opacity: 0.55;
  background: var(--surface-2);
}

.shield-icon-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-2);
}
.shield-card.shield-unlocked .shield-icon-wrap {
  background: var(--accent-10);
  border-color: var(--accent-20);
  color: var(--accent);
}
.shield-card.shield-target .shield-icon-wrap {
  background: var(--streak-10);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--streak);
}

.shield-check {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.shield-content {
  flex: 1;
  min-width: 0;
}
.shield-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.shield-desc {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.35;
  margin: 2px 0 8px;
}
.shield-footer {
  display: flex;
}
.shield-status-pill {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 3px;
  display: inline-block;
}
.shield-status-pill.unlocked {
  color: var(--success);
  background: var(--success-10);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.shield-status-pill.in-progress {
  color: var(--streak);
  background: var(--streak-10);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.shield-status-pill.locked {
  color: var(--text-3);
  background: var(--surface-3);
}

/* ── Calendar Matrix ─────────────────────────────────────────── */
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.calendar-nav h2 { font-size: 20px; font-weight: 800; flex: 1; }
.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-2);
  transition: all var(--t);
}
.cal-nav-btn:hover { background: var(--accent-10); color: var(--accent); border-color: var(--accent); }

.calendar-matrix {
  overflow-x: auto;
  padding-bottom: 12px;
}

.matrix-table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 13px;
}

.matrix-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-align: center;
  padding: 8px 4px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.matrix-table th:first-child { text-align: left; padding-left: 0; min-width: 140px; }

.matrix-habit-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  padding: 8px 12px 8px 0;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}

.matrix-cell {
  width: 28px;
  height: 28px;
  cursor: not-allowed;
  border-radius: var(--radius-xs);
  position: relative;
}

.matrix-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  margin: auto;
  transition: all var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.matrix-cell.done .matrix-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.matrix-cell.not-scheduled .matrix-dot {
  background: transparent;
  border: 1px dashed var(--border);
  opacity: 0.3;
}

.matrix-cell.before-created .matrix-dot {
  background: transparent;
  border: none;
  opacity: 0.12;
}

.matrix-cell.past-missed .matrix-dot {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
  opacity: 0.65;
}

.matrix-cell.today { cursor: pointer; }
.matrix-cell.today .matrix-dot {
  border: 2px solid var(--accent) !important;
  background: var(--surface-2) !important;
  opacity: 1 !important;
  box-shadow: 0 0 0 3px var(--accent-15);
  cursor: pointer;
}
.matrix-cell.today:hover .matrix-dot {
  border-color: var(--accent) !important;
  transform: scale(1.15);
}
.matrix-cell.today.done .matrix-dot {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
}

.matrix-cell.future .matrix-dot { opacity: 0.25; cursor: default; }
.matrix-cell.past-locked .matrix-dot { opacity: 0.5; cursor: not-allowed; }

/* ── Mood Picker ─────────────────────────────────────────────── */
.mood-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;
}
.mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t);
  flex: 1;
  min-width: 70px;
}
.mood-btn span.mood-emoji { font-size: 24px; }
.mood-btn:hover, .mood-btn.selected { border-color: var(--accent); background: var(--accent-10); color: var(--accent); }

/* ── Onboarding ──────────────────────────────────────────────── */
.onboarding-step { display: none; }
.onboarding-step.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.onboarding-logo {
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.onboarding-step h1 {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.onboarding-step h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.onboarding-step > p { font-size: 14px; color: var(--text-2); margin-bottom: 20px; }

.goal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
  max-height: 320px;
  overflow-y: auto;
}
.goal-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  transition: all var(--t);
}
.goal-chip input { display: none; }
.goal-chip.selected { border-color: var(--accent); background: var(--accent-10); color: var(--accent); }
.goal-chip:hover { border-color: var(--accent); }

.starter-habits-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  flex: 1;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}
.starter-habits-list::-webkit-scrollbar { width: 6px; }
.starter-habits-list::-webkit-scrollbar-thumb { background: var(--accent-20); border-radius: 10px; }

.starter-habit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: all var(--t);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.starter-habit-item:hover { border-color: var(--accent); }
.starter-habit-item.selected { border-color: var(--accent); background: var(--accent-10); color: var(--accent); }
.starter-habit-item.selected::after { content: '✓'; margin-left: auto; color: var(--accent); font-weight: 800; }
.starter-habit-icon { font-size: 22px; }
.starter-habit-info { flex: 1; }
.starter-habit-name { font-size: 14px; font-weight: 700; }
.starter-habit-meta { font-size: 11px; color: var(--text-3); }

.onboarding-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 24px;
  flex-shrink: 0;
}
.onboarding-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--surface-3);
  transition: all var(--t);
}
.onboarding-dot.active { background: var(--accent); width: 24px; border-radius: var(--radius-pill); }
.onboarding-dot.done { background: var(--accent-light); }

.onboarding-success-icon {
  font-size: 64px;
  text-align: center;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 16px rgba(249,115,22,0.5));
  animation: streakPulse 2s ease infinite;
}

.onboarding-step-footer { display: flex; gap: 10px; align-items: center; }
.step-back { font-size: 13px; color: var(--text-3); background: none; border: none; cursor: pointer; }
.step-back:hover { color: var(--text-2); }

/* ── Settings Redesign (Minimal & Premium) ──────────────────── */
.settings-container {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 40px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-group-header {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding-left: 6px;
}

.settings-card-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: background var(--t-smooth), border-color var(--t-smooth), box-shadow var(--t);
}
.settings-card-group:hover {
  box-shadow: var(--shadow);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.settings-item:last-child {
  border-bottom: none;
}

.settings-item-info {
  flex: 1;
  min-width: 0;
}

.settings-item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-row-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.settings-row-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.4;
}

/* User Profile Row */
.settings-item-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}

.settings-profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(124, 111, 247, 0.35);
  user-select: none;
}

.settings-profile-input-wrap {
  flex: 1;
  min-width: 0;
}

.settings-mini-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.settings-inline-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-seamless-input {
  flex: 1;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  min-width: 0;
}
.settings-seamless-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-10);
}

.settings-pill-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
}
.settings-pill-badge.badge-synced {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.28);
}

/* Compact Buttons */
.btn-primary-sm {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t);
}
.btn-primary-sm:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-secondary-sm {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t);
}
.btn-secondary-sm:hover {
  background: var(--border);
  color: var(--text);
}

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #ef4444;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t);
}
.btn-danger-sm:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.btn-danger-outline-sm {
  background: transparent;
  color: #ef4444;
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all var(--t);
}
.btn-danger-outline-sm:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

/* Archived Habits Container */
.settings-item-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.settings-archived-container {
  padding-top: 4px;
}
.settings-archived-container p {
  color: var(--text-3);
  font-size: 12.5px;
  margin: 0;
}

/* Danger Card */
.settings-danger-card {
  border-color: rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.02);
}
.settings-item-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

/* Minimal Footer */
.settings-minimal-footer {
  text-align: center;
  padding: 24px 16px 36px;
  color: var(--text-3);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-brand {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.footer-version {
  font-weight: 500;
  font-size: 11px;
  opacity: 0.75;
}
.footer-quote {
  font-style: italic;
  color: var(--text-3);
  font-size: 11.5px;
}
.footer-credits {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-3);
}

/* ── Google-style Profile Avatar & Quick Menu ───────────────── */
.mobile-header-avatar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform var(--t-spring), filter var(--t);
  outline: none;
}
.mobile-header-avatar-btn:hover {
  transform: scale(1.06);
}
.mobile-header-avatar-btn:active {
  transform: scale(0.92);
}

.header-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 8px rgba(124, 111, 247, 0.35);
  overflow: hidden;
  user-select: none;
  transition: all var(--t);
}

.header-avatar-circle.has-photo,
.settings-profile-avatar.has-photo,
.profile-quick-avatar.has-photo,
.user-avatar.has-photo {
  background: transparent !important;
}

.avatar-img-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Settings Profile Avatar Upload */
.settings-profile-avatar-wrap {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--t-spring);
}
.settings-profile-avatar-wrap:hover {
  transform: scale(1.05);
}
.settings-profile-avatar-wrap:hover .avatar-camera-badge {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.avatar-camera-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t);
  user-select: none;
}

.settings-change-photo-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--t);
}
.settings-change-photo-btn:hover {
  color: var(--accent-dark);
}

/* Google-style Profile Quick Menu Popover */
.profile-quick-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.profile-quick-overlay.active {
  display: block;
  opacity: 1;
}

.profile-quick-menu {
  position: fixed;
  top: 66px;
  right: 14px;
  width: calc(100vw - 28px);
  max-width: 320px;
  z-index: 999;
  display: none;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-quick-menu.active {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.profile-quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2), 0 0 1px rgba(0,0,0,0.1);
  padding: 18px;
}

.profile-quick-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.profile-quick-avatar-wrap {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--t-spring);
}
.profile-quick-avatar-wrap:hover {
  transform: scale(1.05);
}

.profile-quick-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #ffffff;
  font-weight: 800;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(124, 111, 247, 0.35);
  overflow: hidden;
  user-select: none;
}

.profile-avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-quick-name {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.profile-quick-email {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  word-break: break-all;
}

.profile-quick-level {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
}

.profile-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-quick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t);
  border: none;
  width: 100%;
  box-sizing: border-box;
}

.profile-btn-upload {
  background: var(--accent);
  color: #ffffff;
}
.profile-btn-upload:hover {
  background: var(--accent-dark);
}

.profile-btn-settings {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.profile-btn-settings:hover {
  background: var(--border);
}

.profile-btn-remove {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.profile-btn-remove:hover {
  background: #ef4444;
  color: #ffffff;
}

/* ── Milestone Modal ─────────────────────────────────────────── */
.milestone-modal, .achievement-modal, .level-up-modal {
  text-align: center;
  padding: 36px 28px;
  max-width: 360px;
}
.milestone-big-emoji, .achievement-big-icon, .level-up-number-wrap {
  font-size: 64px;
  margin-bottom: 12px;
  display: block;
}
.milestone-streak-viz {
  font-size: 22px;
  letter-spacing: 4px;
  margin: 12px 0;
  overflow: hidden;
  white-space: nowrap;
}
.achievement-unlock-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--xp);
  margin-bottom: 8px;
}
.level-up-stars { font-size: 30px; margin-bottom: 8px; }
.level-up-label { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); margin-bottom: 6px; }
.level-up-num { font-size: 72px; font-weight: 900; color: var(--accent); line-height: 1; margin-bottom: 4px; letter-spacing: -2px; }
.level-up-name { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 12px; }

/* Habit complete quick view (day detail) */
.day-detail-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.day-detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
}
.day-detail-item.done { background: var(--success-10); }
.day-detail-status { font-size: 16px; flex-shrink: 0; }

/* ── Habit consistency bar (in streaks) ──────────────────────── */
.consistency-wrap { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.consistency-bar-wrap { flex: 1; height: 6px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
.consistency-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); border-radius: var(--radius-pill); }
.consistency-pct { font-size: 13px; font-weight: 700; color: var(--accent); flex-shrink: 0; }



/* ── Archive & Confirmation Modal Styles ────────────────────────── */
.archive-modal, .confirm-dialog-modal {
  max-width: 440px;
  margin: auto !important;
}

.archive-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.archive-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--xp-10);
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.confirm-icon-badge {
  background: var(--danger-10);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.archive-modal-subtext {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 16px;
  font-weight: 500;
}

.archive-habit-card-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.archive-habit-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--accent-10);
  flex-shrink: 0;
}

.archive-habit-info {
  flex: 1;
  min-width: 0;
}

.archive-habit-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-habit-meta {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}

.archive-habit-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--streak);
  background: var(--streak-10);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(249, 115, 22, 0.25);
  white-space: nowrap;
  flex-shrink: 0;
}

.archive-notice-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(124, 111, 247, 0.08);
  border: 1px solid var(--accent-20);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.45;
  margin-bottom: 24px;
}

.archive-notice-box .notice-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.modal-actions > button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-archive-confirm {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: none;
  transition: all var(--t-spring);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  cursor: pointer;
  white-space: nowrap;
}

.btn-archive-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.50);
}

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

.btn-delete-confirm {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: none;
  transition: all var(--t-spring);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  cursor: pointer;
  white-space: nowrap;
}

.btn-delete-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.50);
}

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

/* ── Auth Landing Overlay & Cloud Sync Styles ───────────────── */
.landing-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(at 10% 10%, rgba(124, 111, 247, 0.18) 0px, transparent 50%),
              radial-gradient(at 90% 90%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
              var(--bg);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.landing-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
  width: 100%;
  max-width: 440px;
  padding: 32px 28px;
  animation: modalPopIn 0.35s var(--t-spring);
}

.landing-header {
  text-align: center;
  margin-bottom: 24px;
}

.landing-logo {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 10px;
}

.landing-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.28;
  margin-bottom: 8px;
  color: var(--text);
}

.landing-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 0;
}

.btn-guest {
  background: var(--surface-2) !important;
  border: 1.5px dashed var(--border-2) !important;
  color: var(--text) !important;
  font-weight: 600 !important;
}

.btn-guest:hover {
  background: var(--surface-3) !important;
  border-color: var(--accent-20) !important;
}

.auth-modal {
  max-width: 420px;
}

.auth-tabs {
  display: flex;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}
.auth-divider span {
  padding: 0 10px;
}

.btn-google {
  background: var(--surface-2);
  color: var(--text);
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--t);
  cursor: pointer;
}

.btn-google:hover {
  background: var(--surface-3);
  border-color: var(--accent-20);
  transform: translateY(-1px);
}



.starter-habit-check {
  margin-left: auto;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-3);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1.5px solid var(--border);
  transition: all var(--t);
  flex-shrink: 0;
}

.starter-habit-item.selected .starter-habit-check {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-30);
}

/* ── Danger Zone & Safety Verification Modal ────────────────────── */
.settings-danger-zone {
  margin-top: 18px;
  background: rgba(239, 68, 68, 0.03);
  border: 1.5px solid rgba(239, 68, 68, 0.22);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.settings-danger-zone:hover {
  border-color: rgba(239, 68, 68, 0.38);
  box-shadow: 0 8px 28px rgba(239, 68, 68, 0.08);
}

.danger-zone-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.danger-zone-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.danger-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.danger-scope-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.danger-zone-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.danger-zone-info {
  flex: 1;
  min-width: 260px;
}

.danger-zone-heading {
  font-size: 15px;
  font-weight: 700;
  color: #ef4444;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.danger-zone-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.45;
}

.btn-danger-outline {
  background: transparent;
  color: #ef4444;
  border: 1.5px solid rgba(239, 68, 68, 0.45);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--t);
  white-space: nowrap;
}

.btn-danger-outline:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

/* Modal specific — Topmost Stacking & High Visibility */
/* ── Minimalist Delete Account & Data Modal ──────────────────────────── */
#modal-delete-safety {
  z-index: 999999 !important;
  isolation: isolate;
}
#modal-delete-safety.modal-open {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: all !important;
}

.modal-delete-safety {
  max-width: 420px;
  width: 90%;
  border-radius: 24px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 4px 20px rgba(239, 68, 68, 0.12) !important;
  padding: 30px 24px 24px !important;
  position: relative !important;
  margin: auto !important;
  z-index: 1000001 !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-align: center;
  overflow: hidden;
}

.delete-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t);
  z-index: 2;
}
.delete-modal-close:hover {
  background: var(--surface-3);
  color: var(--text);
  transform: scale(1.05);
}

.delete-safety-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.delete-safety-icon-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.09);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.12);
  transition: transform var(--t);
}
.delete-safety-icon-circle svg {
  stroke: #ef4444;
}
.modal-delete-safety:hover .delete-safety-icon-circle {
  transform: scale(1.06);
}

.delete-safety-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
  letter-spacing: -0.3px;
}

.delete-safety-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0 auto 20px auto;
  max-width: 340px;
}

.delete-safety-field-group {
  margin-bottom: 20px;
  text-align: center;
}

.delete-safety-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 8px;
  text-align: center;
}

.danger-keyword-badge {
  display: inline-block;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.delete-safety-clean-input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 14.5px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 2px;
  color: var(--text);
  outline: none;
  transition: all var(--t);
}

.delete-safety-clean-input:focus {
  border-color: #ef4444;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.delete-safety-clean-input::placeholder {
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 1px;
  opacity: 0.7;
}

.delete-safety-err-banner {
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.09);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: var(--radius);
  color: #ef4444;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
  text-align: center;
}

.delete-safety-btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-clean-cancel {
  flex: 1;
  padding: 11px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}
.btn-clean-cancel:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-clean-danger {
  flex: 1;
  padding: 11px 16px;
  background: #ef4444;
  border: 1px solid #ef4444;
  border-radius: var(--radius-pill);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.32);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-clean-danger:hover:not(:disabled) {
  background: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}
.btn-clean-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
}

@media (max-width: 480px) {
  .modal-delete-safety {
    width: calc(100% - 32px) !important;
    padding: 26px 18px 20px !important;
    border-radius: 22px !important;
    margin: auto !important;
  }
  .delete-safety-title {
    font-size: 18px;
  }
  .delete-safety-desc {
    font-size: 12.5px;
    margin-bottom: 16px;
  }
  .delete-safety-btn-row {
    gap: 8px;
  }
  .btn-clean-cancel,
  .btn-clean-danger {
    padding: 11px 10px;
    font-size: 12.5px;
  }
}

/* ── Email Verification Modal ────────────────────────────────── */
.verify-email-modal {
  max-width: 440px !important;
  text-align: center;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}
.verify-email-icon-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124, 111, 247, 0.16), rgba(124, 111, 247, 0.05));
  border: 1px solid rgba(124, 111, 247, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin: 0 auto 10px;
  box-shadow: 0 4px 16px rgba(124, 111, 247, 0.15);
}
.verify-email-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent-10);
  border: 1px solid var(--accent-20);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  word-break: break-all;
  max-width: 100%;
}

/* ── Today's Tasks & One-off To-Dos ──────────────────────────── */
.tasks-card {
  margin-top: 16px;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all var(--t);
}

.task-item:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateX(2px);
}

.task-item.completed {
  background: var(--surface);
  border-color: var(--border);
  opacity: 0.75;
}

.task-check-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-2);
  background: var(--surface);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  padding: 0;
}

.task-check-btn:hover {
  border-color: var(--accent);
  transform: scale(1.08);
}

.task-check-btn.checked,
.task-item.completed .task-check-btn {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  cursor: default;
  transform: scale(1.02);
}

.task-item.completed .task-check-btn:hover {
  border-color: var(--success);
  transform: scale(1.02);
}

.task-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  gap: 10px;
}

.task-text {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
  transition: all var(--t);
}

.task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--text-3);
}

.task-reward-chip {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-10);
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.task-delete-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t);
  opacity: 0.6;
  flex-shrink: 0;
  font-size: 13px;
  padding: 0;
}

.task-delete-btn:hover {
  background: var(--danger-10);
  color: var(--danger);
  opacity: 1;
}

/* ── Calendar Interactive Day Headers & Indicators ───────────── */
.matrix-day-th {
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
  padding: 6px 4px;
}

.matrix-day-th:hover {
  background: var(--surface-hover);
  color: var(--accent);
}

.matrix-day-th.today-th {
  color: var(--accent) !important;
  font-weight: 800 !important;
}

.matrix-day-num {
  font-size: 12px;
  font-weight: 700;
}

.day-task-indicator {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: super;
  box-shadow: 0 0 6px var(--accent);
}

/* ── Day Detail Modal ────────────────────────────────────────── */
.day-detail-modal {
  max-width: 480px !important;
}

.day-status-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: 6px;
  display: inline-block;
}

.day-status-pill.today {
  background: var(--accent-10);
  color: var(--accent);
  border: 1px solid var(--accent-20);
}

.day-status-pill.future {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.day-status-pill.past {
  background: var(--surface-3);
  color: var(--text-3);
  border: 1px solid var(--border);
}

.day-modal-habit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  font-size: 13px;
  transition: all var(--t);
}

.day-modal-habit-row.done {
  background: var(--success-10);
  border-color: rgba(34, 197, 94, 0.25);
}

.day-modal-habit-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.day-modal-habit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--accent);
}

.day-modal-habit-icon svg {
  display: block;
}

.day-modal-habit-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-habit-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}

.day-habit-badge.done {
  background: var(--success-10);
  color: var(--success);
}

.day-habit-badge.missed {
  background: var(--danger-10);
  color: var(--danger);
}

.day-habit-badge.pending {
  background: var(--accent-10);
  color: var(--accent);
}

.day-habit-badge.future {
  background: var(--surface-3);
  color: var(--text-3);
}

