/* ═══════════════════════════════════════════════════════════
   BrainDump — Main Stylesheet
   Design tokens ladené k GarcArzP HUB (#1a202c palette)
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@600;700;800&display=swap');

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
  --bg:         #1a202c;
  --surface:    #2d3748;
  --surface-2:  #374151;
  --border:     #4a5568;
  --text:       #e2e8f0;
  --text-muted: #94a3b8;
  --accent:     #4299e1;

  /* Category colours */
  --work:       #4299e1;
  --groceries:  #10b981;
  --personal:   #a78bfa;
  --other:      #f59e0b;

  --radius:     14px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
  --transition: .2s cubic-bezier(.4,0,.2,1);
}

/* ─── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(circle at center, rgba(66,153,225,.08) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ─── Header ─────────────────────────────────────────────── */
.app-header {
  background: rgba(26,32,44,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-back {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color var(--transition);
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.header-back:hover { color: var(--accent); border-color: var(--accent); }

.header-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); background: rgba(66,153,225,.1); }

.btn-apk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0 9px;
  height: 36px;
  border-radius: 18px;
  transition: all var(--transition);
  cursor: pointer;
  box-sizing: border-box;
}
.btn-apk i {
  font-size: 0.85rem;
}
.btn-apk:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #6ee7b7;
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.25);
}
@media (max-width: 480px) {
  .btn-apk span { display: none; }
  .btn-apk { padding: 0; width: 36px; justify-content: center; border-radius: 50%; }
}

/* ─── Main Layout ────────────────────────────────────────── */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ─── Voice Panel ────────────────────────────────────────── */
.voice-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.voice-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(66,153,225,.12) 0%, transparent 70%);
  pointer-events: none;
}

.voice-panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ─── Mic Button ─────────────────────────────────────────── */
.mic-btn-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.mic-btn {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #2d5a8e, var(--accent));
  color: #fff;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  box-shadow: 0 0 0 0 rgba(66,153,225,.5);
}

.mic-btn:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 0 0 8px rgba(66,153,225,.2);
}

.mic-btn.recording {
  background: linear-gradient(135deg, #7f1d1d, #ef4444);
  animation: mic-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(239,68,68,.5);
}

@keyframes mic-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.6); }
  70%  { box-shadow: 0 0 0 18px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

.mic-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Ripple rings during recording */
.mic-rings {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  pointer-events: none;
}
.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(239,68,68,.4);
  animation: ring-expand 2s ease-out infinite;
  opacity: 0;
}
.ring:nth-child(2) { animation-delay: .6s; }
.ring:nth-child(3) { animation-delay: 1.2s; }
@keyframes ring-expand {
  0%   { transform: scale(.8); opacity: .8; }
  100% { transform: scale(1.6); opacity: 0; }
}
.mic-btn:not(.recording) .ring { animation: none; opacity: 0; }

/* ─── Status & Transcript ────────────────────────────────── */
.voice-status {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  min-height: 22px;
  transition: color var(--transition);
}
.voice-status.active { color: #ef4444; }
.voice-status.processing { color: var(--accent); }
.voice-status.success { color: var(--groceries); }
.voice-status.error { color: #f97316; }

.transcript-box {
  background: rgba(15,20,35,.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-height: 72px;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  position: relative;
  transition: border-color var(--transition);
}
.transcript-box.active { border-color: rgba(239,68,68,.5); }
.transcript-box.processing { border-color: rgba(66,153,225,.5); }

.transcript-placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.88rem;
}

.transcript-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #ef4444;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink .7s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Send manually button */
.voice-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, #2d5a8e, var(--accent));
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all var(--transition);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(66,153,225,.4);
}
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all var(--transition);
}
.btn-secondary:hover { color: var(--text); border-color: var(--text-muted); }

/* ─── Stats Bar ──────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.stat-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: center;
  transition: all var(--transition);
  cursor: default;
}

.stat-pill:hover { border-color: var(--cat-color, var(--accent)); }

.stat-count {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--cat-color, var(--accent));
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}

/* ─── Task Board ─────────────────────────────────────────── */
.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.board-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn.active, .filter-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(66,153,225,.1);
}

/* ─── Category Groups ────────────────────────────────────── */
.category-section { margin-bottom: 22px; }

.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 10px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}
.category-header:hover .category-label { color: var(--cat-color); }

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cat-color);
  flex-shrink: 0;
}

.category-emoji { font-size: 1.1rem; }
.category-label {
  font-weight: 600;
  font-size: 0.9rem;
  transition: color var(--transition);
}
.category-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 1px 8px;
  color: var(--text-muted);
  margin-left: auto;
}
.category-chevron {
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: transform var(--transition);
}
.category-section.collapsed .category-chevron { transform: rotate(-90deg); }
.category-section.collapsed .task-list { display: none; }

/* ─── Task Items ─────────────────────────────────────────── */
.task-list { list-style: none; }

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cat-color);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: all var(--transition);
  animation: slide-in .25s ease;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.task-item:hover { background: var(--surface-2); border-color: rgba(255,255,255,.15); }
.task-item.done  { opacity: .45; }
.task-item.done .task-text { text-decoration: line-through; color: var(--text-muted); }

/* Checkbox */
.task-checkbox {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--cat-color);
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  margin-top: 1px;
  transition: all var(--transition);
  background: transparent;
}
.task-checkbox:checked {
  background: var(--cat-color);
}
.task-checkbox:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}
.task-checkbox:hover { transform: scale(1.1); }

/* Task text / edit */
.task-body { flex: 1; min-width: 0; }
.task-text {
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
  transition: color var(--transition);
}

.task-edit-input {
  width: 100%;
  background: rgba(15,20,35,.7);
  border: 1px solid var(--accent);
  color: var(--text);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
}

.task-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Task action buttons */
.task-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
}
.task-item:hover .task-actions { opacity: 1; }

.task-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 0.8rem;
  transition: all var(--transition);
}
.task-btn:hover { color: var(--text); background: rgba(255,255,255,.08); }
.task-btn.delete:hover { color: #ef4444; }
.task-btn.edit:hover { color: var(--accent); }

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: .4; }
.empty-text { font-size: 1rem; margin-bottom: 6px; }
.empty-sub  { font-size: 0.82rem; opacity: .7; }

/* ─── Toast ──────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 0.88rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
  animation: toast-in .3s ease, toast-out .3s ease 2.5s forwards;
  pointer-events: auto;
}
.toast.success { border-color: var(--groceries); }
.toast.error   { border-color: #ef4444; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(20px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(20px); } }

/* ─── Processing Overlay ─────────────────────────────────── */
.processing-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a78bfa, var(--accent));
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: 2px;
  margin-bottom: 20px;
  display: none;
}
.processing-bar.active { display: block; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ─── Language Toggle ────────────────────────────────────── */
.lang-toggle {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.lang-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.78rem;
  cursor: pointer;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .voice-panel { padding: 24px 16px 20px; }
  .mic-btn { width: 84px; height: 84px; font-size: 1.9rem; }
  .board-controls { width: 100%; justify-content: flex-start; }
  .header-back span { display: none; }
}

/* ─── Category CSS Vars ──────────────────────────────────── */
[data-cat="Work"]      { --cat-color: var(--work); }
[data-cat="Groceries"] { --cat-color: var(--groceries); }
[data-cat="Personal"]  { --cat-color: var(--personal); }
[data-cat="Other"]     { --cat-color: var(--other); }

/* ─── Auth Modal / Overlay ───────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 38px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.92) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-logo {
  font-size: 3.2rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px rgba(66, 153, 225, 0.4));
  display: inline-block;
  animation: pulseLogo 3s ease-in-out infinite;
}

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.auth-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px 13px 40px;
  color: #fff;
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.25);
}

.auth-error {
  color: #fc8181;
  background: rgba(229, 62, 62, 0.15);
  border: 1px solid rgba(229, 62, 62, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  text-align: left;
  animation: fadeIn 0.2s ease-out;
}

.auth-submit-btn {
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
}

/* ─── Quick Add Button (TickTick style) ───────────────────── */
.btn-quick-add {
  background: linear-gradient(135deg, var(--accent), #3182ce);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(66, 153, 225, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-quick-add:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(66, 153, 225, 0.55);
  filter: brightness(1.1);
}

.btn-quick-add:active {
  transform: scale(0.96);
}

/* ─── Quick Add Modal ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 440px;
  width: 100%;
  padding: 24px 22px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  transition: color var(--transition);
}

.modal-close:hover {
  color: #fff;
}

.modal-form {
  display: flex;
  flex-direction: column;
}

.modal-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.45;
  resize: none;
  outline: none;
  margin-bottom: 14px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.modal-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.22);
}

.category-selector-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.category-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.cat-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.cat-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.cat-pill.active {
  background: rgba(66, 153, 225, 0.22);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px rgba(66, 153, 225, 0.3);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── Calendar Strip ─────────────────────────────────────── */
.calendar-strip-wrapper {
  position: relative;
  margin: 0 20px 0;
  overflow: hidden;
}

.calendar-strip {
  display: flex;
  gap: 6px;
  padding: 12px 4px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
}

.calendar-strip::-webkit-scrollbar { display: none; }

.cal-day {
  flex: 0 0 auto;
  min-width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 8px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  scroll-snap-align: start;
  font-family: 'Inter', sans-serif;
}

#cal-inbox {
  min-width: 68px;
}

.cal-day:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.cal-day.today {
  border-color: rgba(66, 153, 225, 0.4);
  color: var(--accent);
}

.cal-day.active {
  background: rgba(66, 153, 225, 0.2);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px rgba(66, 153, 225, 0.3);
}

.cal-day-name {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.cal-day-num {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.cal-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cal-badge.overdue {
  background: #f56565;
  animation: pulse 1.5s ease-in-out infinite;
}

.cal-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: rgba(26, 32, 44, 0.9);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  z-index: 2;
}

.cal-nav-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--accent);
}

.cal-prev { left: -2px; }
.cal-next { right: -2px; }

/* ─── Due Date Badges ────────────────────────────────────── */
.due-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
}

.due-today {
  background: rgba(66, 153, 225, 0.2);
  color: var(--accent);
  border: 1px solid rgba(66, 153, 225, 0.35);
}

.due-overdue {
  background: rgba(245, 101, 101, 0.18);
  color: #fc8181;
  border: 1px solid rgba(245, 101, 101, 0.35);
  animation: pulse 1.8s ease-in-out infinite;
}

.due-future {
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.25);
}

/* ─── Overdue Task Highlight ─────────────────────────────── */
.task-item.task-overdue {
  border-left: 3px solid #f56565;
  background: rgba(245, 101, 101, 0.04);
}

/* ─── Due Date Row in Modals ─────────────────────────────── */
.due-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.due-date-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.due-date-input {
  flex: 1;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  color-scheme: dark;
}

.due-date-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.due-date-clear {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition);
}

.due-date-clear:hover {
  border-color: #f56565;
  color: #fc8181;
  background: rgba(245, 101, 101, 0.1);
}

/* ─── Task meta layout ───────────────────────────────────── */
.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.task-date { color: var(--text-muted); }

/* ─── Board Title ────────────────────────────────────────── */
.board-title {
  font-size: 1rem;
  font-weight: 700;
  transition: var(--transition);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ═══════════════════════════════════════════════════════════
   Milestone 2: Habit Tracker, Heatmap Matrix, Streaks & Settings
   ═══════════════════════════════════════════════════════════ */

/* ─── Segmented Tabs Navigation ──────────────────────────── */
.app-tabs-nav {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 24px;
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: linear-gradient(135deg, #2b6cb0, var(--accent));
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(66, 153, 225, 0.35);
}

.tab-pane {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Habits View Layout ─────────────────────────────────── */
.habits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.habits-summary-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.habit-stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.habit-stat-icon {
  font-size: 1.15rem;
}

.habit-stat-meta {
  display: flex;
  flex-direction: column;
}

.habit-stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.habit-stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-add-habit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 22px;
  font-weight: 600;
  font-size: 0.88rem;
}

/* ─── GitHub-Style Heatmap Matrix ────────────────────────── */
.heatmap-card {
  background: rgba(45, 55, 72, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  position: relative;
}

.heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.heatmap-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.heatmap-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.heatmap-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.heatmap-container-outer {
  position: relative;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.heatmap-months-row {
  display: flex;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 28px;
  margin-bottom: 6px;
  height: 16px;
  position: relative;
}

.heatmap-month-label {
  position: absolute;
  white-space: nowrap;
}

.heatmap-body {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.heatmap-days-labels {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  gap: 3px;
  font-size: 0.65rem;
  color: var(--text-muted);
  width: 20px;
  text-align: right;
  line-height: 13px;
  user-select: none;
}

.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  gap: 3px;
}

.heatmap-cell {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.15s ease, outline 0.15s ease, background-color 0.2s ease;
  position: relative;
  box-sizing: border-box;
}

.heatmap-cell:hover,
.heatmap-cell:focus-visible {
  outline: 2px solid #6ee7b7;
  outline-offset: 1px;
  transform: scale(1.3);
  z-index: 5;
}

.heatmap-cell.active-cell {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
  transform: scale(1.25);
  z-index: 4;
}

/* 5 discrete emerald levels */
.heatmap-cell.level-0 {
  background: #232c3d;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.heatmap-cell.level-1 {
  background: #064e3b; /* 1-25% */
}

.heatmap-cell.level-2 {
  background: #047857; /* 26-50% */
}

.heatmap-cell.level-3 {
  background: #10b981; /* 51-75% */
}

.heatmap-cell.level-4 {
  background: #34d399; /* 76-100% */
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
  animation: glowPulse 2.5s infinite alternate ease-in-out;
}

@keyframes glowPulse {
  0%   { box-shadow: 0 0 4px rgba(52, 211, 153, 0.4); }
  100% { box-shadow: 0 0 9px rgba(52, 211, 153, 0.85); }
}

/* Floating Desktop Tooltip */
.heatmap-tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: #ffffff;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -125%);
  transition: opacity 0.1s ease;
}

.heatmap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 8px;
}

.heatmap-selected-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-text {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.legend-swatch.level-0 { background: #232c3d; border: 1px solid rgba(255, 255, 255, 0.05); }
.legend-swatch.level-1 { background: #064e3b; }
.legend-swatch.level-2 { background: #047857; }
.legend-swatch.level-3 { background: #10b981; }
.legend-swatch.level-4 { background: #34d399; box-shadow: 0 0 5px rgba(52, 211, 153, 0.5); }

/* ─── Habits List & Cards ────────────────────────────────── */
.habits-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.habits-list-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.habits-list-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 12px;
}

.habits-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.habit-card {
  background: rgba(45, 55, 72, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: all var(--transition);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.habit-card:hover {
  border-color: rgba(66, 153, 225, 0.45);
  background: rgba(45, 55, 72, 0.75);
  transform: translateY(-1px);
}

.habit-card.is-completed {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.habit-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.habit-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  background: var(--surface-2);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.habit-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.habit-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.habit-name {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.habit-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Streak Counter Flame Badge */
.habit-streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  white-space: nowrap;
  transition: all var(--transition);
}

.habit-streak-badge.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(239, 68, 68, 0.25));
  border-color: rgba(245, 158, 11, 0.55);
  color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}

.habit-streak-badge.pop {
  animation: flamePop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes flamePop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4) rotate(-6deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* 14-Day Chronological Dot Strip */
.habit-history-14 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

.history-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transition: all 0.2s ease;
  cursor: pointer;
  box-sizing: border-box;
}

.history-dot.dot-done {
  background: #10b981;
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
}

.history-dot.dot-missed {
  background: rgba(255, 255, 255, 0.12);
}

.history-dot.dot-today {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 1px;
}

/* 1-Tap Completion Toggle Button */
.habit-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.habit-check-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.2s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.habit-check-btn:hover {
  border-color: #10b981;
  transform: scale(1.08);
}

.habit-check-btn.completed {
  background: linear-gradient(135deg, #059669, #10b981);
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45);
  animation: checkBounce 0.35s ease-out;
}

@keyframes checkBounce {
  0%   { transform: scale(0.85); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.habit-actions-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-habit-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.btn-habit-action:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
}

.btn-habit-action.delete:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ─── Habits Management Modal & Emoji Grid ───────────────── */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-sublabel {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-right: 6px;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.emoji-pick-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.emoji-pick-btn:hover {
  border-color: var(--accent);
  background: rgba(66, 153, 225, 0.15);
  transform: scale(1.08);
}

.emoji-pick-btn.active {
  border-color: var(--accent);
  background: rgba(66, 153, 225, 0.3);
  transform: scale(1.12);
  box-shadow: 0 0 8px rgba(66, 153, 225, 0.4);
}

.custom-emoji-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.modal-input-compact {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  transition: var(--transition);
  max-width: 140px;
}

.modal-input-compact:focus {
  outline: none;
  border-color: var(--accent);
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.color-swatch-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.color-swatch-btn:hover {
  transform: scale(1.12);
}

.color-swatch-btn.active {
  border-color: #ffffff;
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.modal-footer-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #fca5a5;
}

/* ─── Settings Modal & Widget Opacity Slider ─────────────── */
.settings-modal-card {
  max-width: 480px;
}

.settings-content {
  padding: 4px 0 12px 0;
}

.settings-section {
  margin-bottom: 20px;
}

.settings-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.settings-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.settings-value-badge {
  background: rgba(66, 153, 225, 0.15);
  border: 1px solid rgba(66, 153, 225, 0.45);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
}

.slider-wrapper {
  margin: 10px 0;
}

.settings-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.settings-slider::-webkit-slider-thumb:hover,
.settings-slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

.settings-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.settings-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.4;
}

/* Glassmorphic Live Preview Box */
.settings-preview-container {
  margin-top: 14px;
}

.settings-preview-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.settings-widget-preview-box {
  background: radial-gradient(ellipse at bottom, #1e3a8a 0%, #0f172a 75%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  justify-content: center;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.5);
}

.preview-mini-widget {
  width: 100%;
  max-width: 320px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: background-color 0.1s ease;
}

.mini-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mini-widget-brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-widget-logo {
  font-size: 0.95rem;
}

.mini-widget-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
}

.mini-widget-badge {
  background: var(--accent);
  color: #ffffff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.65rem;
  font-weight: 700;
}

.mini-widget-habits-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.mini-habit-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 3px 8px;
  font-size: 0.68rem;
  color: #e2e8f0;
}

.mini-habit-chip.mini-done {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #6ee7b7;
}

.mini-widget-task-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-widget-task-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #e2e8f0;
}

.mini-task-check {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: #10b981;
}

.mini-task-text.completed {
  text-decoration: line-through;
  opacity: 0.55;
}

.settings-footer-status {
  margin-top: 14px;
  font-size: 0.78rem;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 600px) {
  .habits-header {
    flex-direction: column;
    align-items: stretch;
  }
  .habits-summary-stats {
    justify-content: space-between;
  }
  .habit-stat-pill {
    flex: 1;
    min-width: 100px;
    padding: 6px 10px;
  }
  .btn-add-habit {
    justify-content: center;
  }
  .habit-card {
    padding: 12px 14px;
  }
  .habit-icon-wrap {
    width: 40px;
    height: 40px;
    font-size: 1.35rem;
  }
}

