/* ═══════════════════════════════════════════════
   BRAINFLOW – DESIGN SYSTEM  v1.3
   (License key system — welcome screen styles)
   ═══════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  /* Brand Colors */
  --primary:       #5B9BD5;
  --primary-dark:  #4a87c1;
  --primary-light: #e8f1fb;
  --purple:        #9B59B9;
  --purple-light:  #f3e8fa;
  --green:         #27AE60;
  --green-light:   #e8f8ef;
  --yellow:        #F39C12;
  --yellow-light:  #fef6e4;
  --red:           #E74C3C;
  --red-light:     #fdecea;
  --gray:          #95A5A6;
  --gray-light:    #ecf0f1;

  /* Semantic */
  --bg:            #f0f4ff;
  --surface:       #ffffff;
  --surface-alt:   #f7f9ff;
  --border:        #e2e8f4;
  --text-primary:  #1a2332;
  --text-secondary:#4a5568;
  --text-muted:    #94a3b8;

  /* Typography */
  --font-heading:  'Nunito', sans-serif;
  --font-body:     'Quicksand', sans-serif;

  /* Spacing */
  --gap-xs:  4px;
  --gap-sm:  8px;
  --gap-md:  16px;
  --gap-lg:  24px;
  --gap-xl:  32px;
  --gap-2xl: 48px;

  /* Radius */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 12px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.06);
  --shadow-xl:  0 20px 50px rgba(0,0,0,.15), 0 8px 20px rgba(0,0,0,.08);

  /* Transition */
  --transition: 200ms cubic-bezier(.4, 0, .2, 1);
  --transition-slow: 350ms cubic-bezier(.4, 0, .2, 1);

  /* Layout */
  --header-height: 64px;
  --max-width: 1200px;
}

/* ── Dark Mode ── */
[data-theme="dark"] {
  --bg:            #0f1629;
  --surface:       #1a2540;
  --surface-alt:   #1e2c4a;
  --border:        #2a3555;
  --text-primary:  #e8edf7;
  --text-secondary:#a0aec0;
  --text-muted:    #4a5568;
  --primary-light: #1e3a5c;
  --purple-light:  #2d1a40;
  --green-light:   #152c1e;
  --yellow-light:  #2c2010;
  --red-light:     #2c1510;
  --gray-light:    #1e2540;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,.35);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.45);
  --shadow-xl:  0 20px 50px rgba(0,0,0,.55);
}

/* ════════════════════════════════════════
   BASE RESET & GLOBALS
════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition-slow), color var(--transition-slow);
}

/* ════════════════════════════════════════
   HEADER
════════════════════════════════════════ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  padding: 0 var(--gap-lg);
  gap: var(--gap-md);
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

.header-left { flex-shrink: 0; }
.header-center { flex: 1; display: flex; align-items: center; justify-content: center; gap: var(--gap-md); }
.header-right { flex-shrink: 0; display: flex; align-items: center; gap: var(--gap-sm); }

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  text-decoration: none;
}

.logo-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(91,155,213,.4));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* Stat chips */
.stat-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 700;
  cursor: default;
  transition: background var(--transition-slow), border-color var(--transition-slow);
  white-space: nowrap;
}

.stat-chip .stat-icon { font-size: 1rem; }
.stat-chip .stat-label { font-weight: 500; color: var(--text-muted); font-size: .75rem; margin-left: 2px; }

.points-chip { color: var(--yellow); border-color: var(--yellow-light); }
.streak-chip { color: var(--red); border-color: var(--red-light); }

/* Progress Ring */
.progress-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.progress-ring { transform: rotate(-90deg); }

.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 4;
}

.ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100.5;
  stroke-dashoffset: 100.5;
  transition: stroke-dashoffset 0.6s ease;
}

.ring-label {
  position: absolute;
  font-family: var(--font-heading);
  font-size: .65rem;
  font-weight: 800;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Header buttons */
.upgrade-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, var(--yellow), #e67e22);
  color: white;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: .8rem;
  font-weight: 700;
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}

.upgrade-btn:hover { opacity: .9; transform: translateY(-1px); }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.icon-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* ════════════════════════════════════════
   MAIN LAYOUT
════════════════════════════════════════ */
.app-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--gap-lg) var(--gap-lg) 120px;
}

/* ════════════════════════════════════════
   WELCOME BANNER
════════════════════════════════════════ */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  border-radius: var(--radius-xl);
  padding: var(--gap-xl) var(--gap-xl);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-lg);
  margin-bottom: var(--gap-lg);
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
}

.welcome-banner h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.welcome-banner p {
  font-size: .95rem;
  opacity: .9;
}

.welcome-actions {
  display: flex;
  gap: var(--gap-sm);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  border: none;
  font-family: var(--font-heading);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(91,155,213,.4);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(91,155,213,.5); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--purple);
  color: white;
  box-shadow: 0 4px 14px rgba(155,89,185,.35);
}
.btn-secondary:hover { background: #8e44ad; transform: translateY(-1px); }

.btn-outline {
  background: rgba(255,255,255,.15);
  color: white;
  border: 2px solid rgba(255,255,255,.5);
  backdrop-filter: blur(4px);
}
.btn-outline:hover { background: rgba(255,255,255,.25); }

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

.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover { background: #c0392b; }

.btn-premium {
  background: linear-gradient(135deg, #f6d365, #fda085);
  color: white;
  width: 100%;
  justify-content: center;
  margin-top: var(--gap-md);
  box-shadow: 0 4px 14px rgba(253,160,133,.4);
}
.btn-premium:hover { opacity: .9; transform: translateY(-1px); }

.btn-sm {
  padding: 6px 12px;
  font-size: .8rem;
}

.btn-xl {
  padding: 14px 28px;
  font-size: 1.05rem;
}

/* ════════════════════════════════════════
   FILTER BAR
════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  margin-bottom: var(--gap-lg);
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.filter-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(91,155,213,.35);
}

.task-count-badge {
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

/* ════════════════════════════════════════
   TASK GRID
════════════════════════════════════════ */
.task-grid-section { min-height: 300px; }

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap-md);
}

/* ════════════════════════════════════════
   TASK CARD
════════════════════════════════════════ */
.task-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  padding: var(--gap-md) var(--gap-md) var(--gap-sm);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
  animation: cardIn .3s ease both;
  cursor: default;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

.task-card.completed-card {
  opacity: .55;
  border-style: dashed;
}

.task-card.snoozed-card {
  opacity: .6;
  filter: grayscale(.3);
}

.task-card.removing {
  animation: cardOut .3s ease forwards;
}

@keyframes cardOut {
  to { opacity: 0; transform: scale(.9) translateY(10px); }
}

/* Card accent bar */
.task-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.task-card[data-priority="high"]::before   { background: linear-gradient(90deg, var(--red), #ff6b6b); }
.task-card[data-priority="medium"]::before { background: linear-gradient(90deg, var(--yellow), #f9ca24); }
.task-card[data-priority="low"]::before    { background: linear-gradient(90deg, var(--green), #55efc4); }

/* Card header */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-sm);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
  word-break: break-word;
}

.task-card.completed-card .card-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Card badges */
.card-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: var(--gap-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 700;
  font-family: var(--font-heading);
  white-space: nowrap;
}

.badge-high   { background: var(--red-light);    color: var(--red); }
.badge-medium { background: var(--yellow-light);  color: #c0820a; }
.badge-low    { background: var(--green-light);   color: var(--green); }

.badge-energy-high   { background: #fff3e0; color: #e65100; }
.badge-energy-medium { background: #e3f2fd; color: #1565c0; }
.badge-energy-low    { background: var(--purple-light); color: var(--purple); }

/* Card meta row */
.card-meta {
  display: flex;
  gap: var(--gap-sm);
  align-items: center;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: var(--gap-sm);
  flex-wrap: wrap;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Subtask progress bar */
.card-subtask-progress {
  margin-bottom: var(--gap-sm);
}

.mini-progress-track {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  border-radius: var(--radius-full);
  transition: width .4s ease;
}

.mini-progress-label {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Card actions */
.card-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: var(--gap-sm);
  margin-top: var(--gap-sm);
  flex-wrap: wrap;
}

.card-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.card-action-btn:hover { transform: translateY(-1px); }

.card-action-btn.btn-complete { color: var(--green); border-color: var(--green-light); }
.card-action-btn.btn-complete:hover { background: var(--green-light); }

.card-action-btn.btn-breakdown { color: var(--primary); border-color: var(--primary-light); }
.card-action-btn.btn-breakdown:hover { background: var(--primary-light); }

.card-action-btn.btn-snooze { color: var(--yellow); border-color: var(--yellow-light); }
.card-action-btn.btn-snooze:hover { background: var(--yellow-light); }

.card-action-btn.btn-delete { color: var(--red); border-color: var(--red-light); }
.card-action-btn.btn-delete:hover { background: var(--red-light); }

.card-action-btn.btn-edit { color: var(--purple); border-color: var(--purple-light); }
.card-action-btn.btn-edit:hover { background: var(--purple-light); }

/* Points chip on card */
.card-points {
  font-family: var(--font-heading);
  font-size: .75rem;
  font-weight: 800;
  color: var(--yellow);
  background: var(--yellow-light);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  white-space: nowrap;
}

/* ════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: var(--gap-2xl) var(--gap-lg);
  max-width: 420px;
  margin: 0 auto;
}

.empty-illustration {
  font-size: 4rem;
  margin-bottom: var(--gap-md);
  animation: float 3s ease-in-out infinite;
}

.empty-state h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--gap-sm);
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: var(--gap-lg);
  font-size: .95rem;
}

.empty-actions {
  display: flex;
  gap: var(--gap-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════
   STATS SECTION
════════════════════════════════════════ */
.stats-section {
  margin-top: var(--gap-2xl);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--gap-md);
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--gap-md);
}

.stat-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-slow);
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.stat-icon-lg {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 1.3rem;
  opacity: .4;
}

/* Locked stat card */
.locked-card { opacity: .7; }

.lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(var(--bg), .7);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-heading);
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-lg);
  z-index: 1;
}

/* ════════════════════════════════════════
   BRAIN DUMP FAB
════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 14px 20px;
  font-family: var(--font-heading);
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(91,155,213,.5);
  transition: all var(--transition);
}

.fab:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 30px rgba(91,155,213,.6); }
.fab:active { transform: translateY(0) scale(.98); }

.fab-icon { font-size: 1.3rem; }

/* ════════════════════════════════════════
   MODALS
════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10,15,30,.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap-md);
  animation: overlayIn .2s ease;
}

.modal-overlay[hidden] { display: none; }

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .25s cubic-bezier(.34, 1.56, .64, 1);
  border: 1px solid var(--border);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.93) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gap-md) var(--gap-lg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

.modal-body {
  padding: var(--gap-lg);
}

.modal-footer {
  display: flex;
  gap: var(--gap-sm);
  justify-content: flex-end;
  padding: var(--gap-md) var(--gap-lg);
  border-top: 1px solid var(--border);
}

.modal-subtitle {
  font-size: .88rem;
  color: var(--text-secondary);
  margin-bottom: var(--gap-md);
}

/* ── Form Elements ── */
.form-group {
  margin-bottom: var(--gap-md);
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: .83rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.form-group label .required { color: var(--red); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: .92rem;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition-slow);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,155,213,.15);
}

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2395A5A6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-md);
}

/* Select Pills */
.select-pills {
  display: flex;
  gap: var(--gap-xs);
  flex-wrap: wrap;
}

.select-pill {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.select-pill:hover { border-color: var(--primary); }

.select-pill.active.pill-high { background: var(--red-light); color: var(--red); border-color: var(--red); }
.select-pill.active.pill-medium { background: var(--yellow-light); color: var(--yellow); border-color: var(--yellow); }
.select-pill.active.pill-low { background: var(--green-light); color: var(--green); border-color: var(--green); }
.select-pill.active.pill-energy-high { background: #fff3e0; color: #e65100; border-color: #e65100; }
.select-pill.active.pill-energy-medium { background: #e3f2fd; color: #1565c0; border-color: #1565c0; }
.select-pill.active.pill-energy-low { background: var(--purple-light); color: var(--purple); border-color: var(--purple); }

/* ════════════════════════════════════════
   BRAIN DUMP MODAL
════════════════════════════════════════ */
.dump-modal { max-width: 560px; }
.dump-textarea { min-height: 140px; font-size: .95rem; }

.dump-actions {
  display: flex;
  gap: var(--gap-sm);
  margin-top: var(--gap-md);
  flex-wrap: wrap;
}

.recent-dumps {
  margin-top: var(--gap-lg);
  border-top: 1px solid var(--border);
  padding-top: var(--gap-md);
}

.dumps-title {
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: var(--gap-sm);
}

.dump-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--gap-sm) var(--gap-md);
  margin-bottom: var(--gap-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  animation: cardIn .2s ease both;
}

.dump-item:hover { border-color: var(--primary); background: var(--primary-light); }

.dump-item-text {
  font-size: .88rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60px;
  overflow: hidden;
}

.dump-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
  gap: var(--gap-sm);
}

.dump-item-time {
  font-size: .72rem;
  color: var(--text-muted);
}

.dump-item-actions {
  display: flex;
  gap: 4px;
}

.dump-action-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: .75rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition);
}
.dump-action-btn:hover { background: var(--primary-light); color: var(--primary); }
.dump-action-btn.del:hover { background: var(--red-light); color: var(--red); }

.converted-badge {
  font-size: .68rem;
  background: var(--green-light);
  color: var(--green);
  border-radius: var(--radius-full);
  padding: 1px 6px;
  font-weight: 700;
  font-family: var(--font-heading);
}

/* ════════════════════════════════════════
   BREAKDOWN MODAL
════════════════════════════════════════ */
.breakdown-modal { max-width: 500px; }

.breakdown-progress { margin-bottom: var(--gap-md); }

.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.progress-bar-track {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  border-radius: var(--radius-full);
  transition: width .4s ease;
}

.progress-pct {
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 36px;
  text-align: right;
}

.subtasks-list { margin-bottom: var(--gap-md); }

.subtask-item {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 10px var(--gap-sm);
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border);
  cursor: default;
  animation: cardIn .2s ease both;
  transition: background var(--transition);
}

.subtask-item:hover { background: var(--surface-alt); }

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

.subtask-cb {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--primary);
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.subtask-label {
  flex: 1;
  font-size: .9rem;
  color: var(--text-primary);
  line-height: 1.4;
  transition: all var(--transition);
}

.subtask-label.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.subtask-delete {
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .85rem;
  border-radius: 4px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.subtask-delete:hover { background: var(--red-light); color: var(--red); }

.add-subtask-row {
  display: flex;
  gap: var(--gap-sm);
  align-items: center;
}

.add-subtask-row .form-input { margin-bottom: 0; }

/* ════════════════════════════════════════
   FOCUS TIMER MODAL
════════════════════════════════════════ */
.timer-modal {
  max-width: 440px;
}

.fullscreen-modal .modal {
  max-width: 440px;
}

.timer-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-lg);
  text-align: center;
}

.timer-presets {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.timer-preset-btn {
  padding: 7px 18px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.timer-preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.timer-preset-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Timer ring */
.timer-ring-container {
  position: relative;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

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

.timer-ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}

.timer-ring-progress {
  fill: none;
  stroke: url(#timerGradient);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 596.9;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .5s ease;
}

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

.timer-time {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -1px;
}

.timer-phase {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.timer-controls { display: flex; gap: var(--gap-sm); flex-wrap: wrap; justify-content: center; }

.timer-sessions { width: 100%; }

.sessions-label {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: var(--gap-sm);
}

.session-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.session-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--primary);
  animation: popIn .3s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes popIn {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ════════════════════════════════════════
   SNOOZE MODAL
════════════════════════════════════════ */
.snooze-modal { max-width: 380px; }

.snooze-desc {
  font-size: .9rem;
  color: var(--text-secondary);
  margin-bottom: var(--gap-md);
}

.snooze-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-sm);
}

.snooze-opt-btn {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}

.snooze-opt-btn:hover {
  border-color: var(--yellow);
  background: var(--yellow-light);
  color: #c0820a;
  transform: translateY(-1px);
}

/* ════════════════════════════════════════
   SETTINGS MODAL
════════════════════════════════════════ */
.settings-modal { max-width: 420px; }

.settings-section {
  margin-bottom: var(--gap-lg);
  padding-bottom: var(--gap-lg);
  border-bottom: 1px solid var(--border);
}

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

.settings-section h3 {
  font-family: var(--font-heading);
  font-size: .9rem;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: var(--gap-md);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
}

.setting-row label {
  font-size: .9rem;
  color: var(--text-primary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--radius-full);
  transition: background .3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: var(--radius-full);
  transition: transform .3s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

.mini-select { max-width: 120px; }

.lock-badge {
  font-size: .8rem;
  vertical-align: middle;
}

.premium-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
}

.premium-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  font-size: .88rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ════════════════════════════════════════
   TOAST NOTIFICATIONS
════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-sm);
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: var(--surface);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: .88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn .3s cubic-bezier(.34, 1.56, .64, 1) forwards;
  white-space: nowrap;
  max-width: 360px;
  text-align: center;
}

.toast.toast-success { background: var(--green); }
.toast.toast-error   { background: var(--red); }
.toast.toast-info    { background: var(--primary); }
.toast.toast-warning { background: var(--yellow); }

.toast.hiding {
  animation: toastOut .25s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(.9); }
}

/* ════════════════════════════════════════
   SCROLLBAR
════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray); }

/* ════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE
════════════════════════════════════════ */

/* ── Tablet & Mobile: ≤ 768px ── */
@media (max-width: 768px) {
  .app-header {
    padding: 0 var(--gap-sm);
    height: 56px;
    gap: var(--gap-xs);
  }

  .logo-text { font-size: 1.05rem; }

  /* Upgrade butonu sadece ikon göster */
  .upgrade-btn .upgrade-text { display: none; }
  .upgrade-btn { padding: 6px 10px; }

  /* ── 1. HEADER-CENTER: gizleme yerine kompakt flex ── */
  .header-center {
    display: flex;                  /* none → flex */
    gap: var(--gap-xs);
    transform: scale(0.88);         /* hafif küçültme */
    transform-origin: center center;
  }

  /* stat chip padding küçült */
  .stat-chip {
    padding: 4px 8px;
    font-size: .78rem;
  }

  /* metin etiketleri gizli kalıyor (zaten mevcut) */
  .stat-chip .stat-label { display: none; }

  /* Progress ring biraz küçült */
  .progress-ring { transform: rotate(-90deg) scale(0.9); }
  .ring-label { font-size: .6rem; }

  /* Ana içerik */
  .app-main { padding: var(--gap-md) var(--gap-md) 100px; }

  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--gap-lg);
  }

  .welcome-banner h1 { font-size: 1.3rem; }

  .task-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }

  /* FAB kompakt */
  .fab { bottom: 20px; right: 16px; padding: 16px; width: 60px; height: 60px; border-radius: var(--radius-full); justify-content: center; }
  .fab-label { display: none; }
  .fab-icon { margin: 0; font-size: 1.5rem; }

  /* ── 2. DOKUNMATIK ALANLAR: Kart aksiyon butonları ── */
  .card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;  /* 2x2 grid yapısı */
    gap: 6px;
    justify-items: stretch;
    margin-top: var(--gap-sm);
  }

  .card-action-btn {
    padding: 10px 8px;               /* Daha büyük dokunma alanı */
    font-size: .78rem;
    justify-content: center;
    min-height: 40px;                /* Minimum 40px yükseklik */
  }

  /* ── Subtask sil butonu dokunma toleransı ── */
  .subtask-delete {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  /* Subtask checkbox da büyüsün */
  .subtask-cb {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  /* Subtask item padding artır */
  .subtask-item {
    padding: 12px var(--gap-sm);
    gap: var(--gap-md);
  }

  /* ── 3. TIMER MODAL TAM EKRAN ── */
  .fullscreen-modal {
    padding: 0;                      /* overlay padding kaldır */
    align-items: flex-end;           /* alttan yukarı çıksın */
  }

  .fullscreen-modal .modal {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;                  /* dynamic viewport height */
    max-height: 100dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0; /* sadece üst köşe */
    border-bottom: none;
    overflow-y: auto;
  }

  /* Timer içi düzenlemeler */
  .timer-body {
    padding-bottom: env(safe-area-inset-bottom, 20px);
    gap: var(--gap-md);
  }

  .timer-ring-container {
    width: 200px;
    height: 200px;
  }

  .timer-time { font-size: 2.6rem; }
}

/* ── Küçük Telefon: ≤ 480px ── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filter-pill { font-size: .73rem; padding: 5px 9px; }

  /* Header daha da kompakt */
  .header-center {
    transform: scale(0.80);
    gap: 2px;
  }

  .stat-chip { padding: 3px 6px; }

  /* Timer tam ekran küçük telefon */
  .timer-ring-container { width: 170px; height: 170px; }
  .timer-time { font-size: 2.2rem; }

  /* Snooze tek kolon */
  .snooze-options { grid-template-columns: 1fr; }

  /* Kart butonları tam genişlik */
  .card-actions {
    grid-template-columns: 1fr 1fr;
  }

  .card-action-btn {
    padding: 11px 6px;
    font-size: .73rem;
  }
}

/* ── Landscape telefon ── */
@media (max-width: 768px) and (orientation: landscape) {
  .fullscreen-modal .modal {
    height: 100dvh;
    border-radius: 0;
  }

  .timer-ring-container { width: 140px; height: 140px; }
  .timer-time { font-size: 1.9rem; }
  .timer-body { gap: var(--gap-sm); }
}

/* ── Desktop: ≥ 1024px ── */
@media (min-width: 1024px) {
  .task-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ════════════════════════════════════════
   LICENSE & WELCOME SCREEN STYLES
════════════════════════════════════════ */

/* ── Full-screen Welcome Overlay ── */
#welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: linear-gradient(145deg, #0f1629 0%, #1a2540 40%, #0f2040 100%);
  display: none; /* JS shows this only for new users */
  align-items: center;
  justify-content: center;
  padding: var(--gap-lg);
  transition: opacity .6s ease, transform .6s ease;
  overflow-y: auto;
}

#welcome-screen.is-visible {
  display: flex;
}

#welcome-screen.fading-out {
  opacity: 0;
  transform: scale(1.04) translateY(-8px);
  pointer-events: none;
}

.welcome-card {
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 28px;
  padding: var(--gap-2xl) var(--gap-xl);
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: welcomeCardIn .6s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes welcomeCardIn {
  from { opacity: 0; transform: translateY(40px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-brain {
  font-size: 3.5rem;
  display: block;
  margin-bottom: var(--gap-md);
  animation: brainFloat 3s ease-in-out infinite;
}

@keyframes brainFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.welcome-title {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 900;
  background: linear-gradient(90deg, #5B9BD5, #9B59B9, #5B9BD5);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--gap-sm);
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer { to { background-position: 200% center; } }

.welcome-tagline {
  font-size: .95rem;
  color: rgba(255,255,255,.6);
  margin-bottom: var(--gap-lg);
  line-height: 1.6;
}

.welcome-divider {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  color: rgba(255,255,255,.3);
  font-size: .78rem;
  font-weight: 600;
  margin: var(--gap-sm) 0;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.welcome-divider::before,
.welcome-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.1);
}

/* ── License Input ── */
.license-input-wrap {
  position: relative;
  margin-bottom: var(--gap-sm);
}

.license-input {
  width: 100%;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.18);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.license-input::placeholder {
  color: rgba(255,255,255,.3);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-size: .9rem;
}

.license-input:focus {
  border-color: #5B9BD5;
  background: rgba(91,155,213,.12);
  box-shadow: 0 0 0 3px rgba(91,155,213,.2);
}

.license-input.input-error {
  border-color: #E74C3C;
  background: rgba(231,76,60,.1);
  animation: shake .4s ease;
}

.license-input.input-success {
  border-color: #27AE60;
  background: rgba(39,174,96,.1);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

.license-hint {
  font-size: .78rem;
  color: rgba(255,255,255,.38);
  margin-bottom: var(--gap-sm);
}

.license-error {
  font-size: .82rem;
  color: #ff8080;
  min-height: 1.2em;
  margin-bottom: var(--gap-sm);
}

/* ── Welcome Buttons ── */
.btn-activate {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #5B9BD5, #9B59B9);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: var(--gap-sm);
  box-shadow: 0 6px 20px rgba(91,155,213,.35);
}

.btn-activate:hover {
  opacity: .92;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(91,155,213,.45);
}

.btn-get-brainflow {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #27AE60, #1e8449);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-heading);
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: var(--gap-sm);
  text-align: center;
  box-shadow: 0 4px 14px rgba(39,174,96,.3);
}

.btn-get-brainflow:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(39,174,96,.4);
}

.btn-try-demo-welcome {
  background: transparent;
  color: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-md);
  padding: 10px;
  width: 100%;
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-try-demo-welcome:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.7);
  border-color: rgba(255,255,255,.3);
}

/* ── Activation Success Card ── */
.activation-success {
  display: none !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-md);
}

.activation-success.is-visible {
  display: flex !important;
}

.success-ring {
  font-size: 4rem;
  animation: successPop .5s cubic-bezier(.34,1.56,.64,1);
}

@keyframes successPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
}

.success-sub {
  font-size: .9rem;
  color: rgba(255,255,255,.55);
}

/* ── Premium Badge (header) ── */
.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #F39C12, #e67e22);
  color: white;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(243,156,18,.35);
}

/* ── Demo Top Banner (clean, subtle) ── */
.demo-top-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  background: rgba(15,22,41,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-md);
  padding: 7px var(--gap-lg);
  font-family: var(--font-heading);
  font-size: .8rem;
  font-weight: 600;
}

.demo-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-banner-pill {
  background: rgba(243,156,18,.18);
  border: 1px solid rgba(243,156,18,.35);
  border-radius: var(--radius-full);
  padding: 1px 8px;
  font-size: .72rem;
  font-weight: 800;
  color: #F39C12;
  letter-spacing: .5px;
}

.demo-banner-cta {
  background: rgba(91,155,213,.15);
  border: 1px solid rgba(91,155,213,.35);
  color: #5B9BD5;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-family: var(--font-heading);
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition);
  white-space: nowrap;
}

.demo-banner-cta:hover {
  background: rgba(91,155,213,.28);
  transform: translateY(-1px);
}

/* Push header down when demo banner is visible */
.demo-top-banner:not(.hidden) ~ * .app-header,
body:has(.demo-top-banner:not(.hidden)) .app-header {
  top: 34px;
}

/* ── Demo Limit Bar ── */
.demo-limit-bar {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-family: var(--font-heading);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition);
}

.demo-limit-bar.near {
  border-color: var(--yellow);
  color: #92400e;
  background: var(--yellow-light);
}

.demo-limit-bar.full {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
  animation: limitPulse 1.5s ease-in-out infinite;
}

@keyframes limitPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,.3); }
  50%       { box-shadow: 0 0 0 5px rgba(231,76,60,0); }
}

.dlb-track {
  width: 50px;
  height: 4px;
  background: rgba(0,0,0,.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dlb-fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--radius-full);
  transition: width .4s ease, background .3s ease;
}

.dlb-fill.near { background: var(--yellow); }
.dlb-fill.full { background: var(--red); }

/* ── License Info Box (in Settings) ── */
.license-info-box {
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-md);
  margin-bottom: var(--gap-md);
}

.license-info-box.premium {
  border-color: rgba(243,156,18,.4);
  background: rgba(243,156,18,.06);
}

.license-info-box.demo {
  border-color: rgba(91,155,213,.3);
  background: rgba(91,155,213,.06);
}

.lic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}

.lic-row:last-child { border-bottom: none; }

.lic-label {
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.lic-value {
  color: var(--text-primary);
  font-weight: 700;
  font-family: var(--font-heading);
  text-align: right;
  word-break: break-all;
}

.lic-status-ok   { color: var(--green); font-weight: 700; }
.lic-status-demo { color: var(--yellow); font-weight: 700; }

/* ── Demo Upgrade Overlay ── */
.demo-upgrade-modal {
  max-width: 420px;
  text-align: center;
}

.dum-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--gap-md);
  animation: bounceIn .5s cubic-bezier(.34,1.56,.64,1);
}

@keyframes bounceIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.dum-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: var(--gap-sm);
}

.dum-sub {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: var(--gap-lg);
}

.dum-features {
  text-align: left;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-md);
  margin-bottom: var(--gap-lg);
}

.dum-feat {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 6px 0;
  font-size: .88rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.dum-feat:last-child { border-bottom: none; }

.dum-feat-check {
  color: var(--green);
  font-size: 1rem;
  flex-shrink: 0;
}

.btn-get-full {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #5B9BD5, #9B59B9);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: var(--gap-sm);
  box-shadow: 0 6px 20px rgba(91,155,213,.35);
  animation: ctaPulse 2.5s ease-in-out infinite;
  transition: all var(--transition);
}

.btn-get-full:hover {
  opacity: .92;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(91,155,213,.45);
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(91,155,213,.35); }
  50%       { box-shadow: 0 6px 28px rgba(91,155,213,.6); }
}

.btn-enter-key {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  width: 100%;
  font-family: var(--font-heading);
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  display: block;
}

.btn-enter-key:hover {
  background: var(--surface-alt);
  color: var(--text-secondary);
}

/* ── Mobile responsive for license UI ── */
@media (max-width: 480px) {
  .welcome-card {
    padding: var(--gap-xl) var(--gap-md);
    border-radius: 20px;
  }
  .welcome-title { font-size: 1.5rem; }
  .welcome-brain { font-size: 2.8rem; }
  .license-input { font-size: .95rem; padding: 12px 14px; }
  .demo-top-banner { flex-wrap: wrap; gap: 6px; font-size: .74rem; }
  .demo-banner-cta { font-size: .72rem; padding: 3px 10px; }
}

@media (max-width: 768px) {
  .demo-top-banner { padding: 6px var(--gap-md); }
  .premium-badge { font-size: .72rem; padding: 4px 10px; }
}

/* ════════════════════════════════════════
   UTILITY
════════════════════════════════════════ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* Snooze countdown */
.snooze-countdown {
  font-size: .72rem;
  color: var(--yellow);
  font-weight: 700;
  font-family: var(--font-heading);
}

/* Task notes */
.card-notes {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: var(--gap-sm);
  font-style: italic;
  border-left: 3px solid var(--border);
  padding-left: 8px;
  line-height: 1.5;
}
