/* ============================================================
   IDEAS HUB — Stylesheet
   Professional SaaS Dashboard Design
   ============================================================ */

/* === CSS VARIABLES (Light Theme) === */
:root {
  --primary:        #4f46e5;
  --primary-hover:  #3730a3;
  --primary-light:  #eef2ff;
  --primary-mid:    #818cf8;
  --secondary:      #0891b2;
  --accent:         #10b981;

  --success:        #059669;
  --success-light:  #d1fae5;
  --warning:        #d97706;
  --warning-light:  #fef3c7;
  --danger:         #dc2626;
  --danger-light:   #fee2e2;
  --info:           #2563eb;
  --info-light:     #dbeafe;

  --bg:             #f5f7fb;
  --surface:        #ffffff;
  --surface-2:      #f8fafc;
  --border:         #e2e8f0;
  --border-light:   #f1f5f9;

  --text:           #0f172a;
  --text-2:         #334155;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;

  --sidebar-bg:     #111827;
  --sidebar-text:   #c7d2fe;
  --sidebar-muted:  #818cf8;
  --sidebar-hover:  rgba(99,102,241,0.2);
  --sidebar-active: rgba(99,102,241,0.3);
  --sidebar-border: rgba(255,255,255,0.08);
  --sidebar-w:      260px;

  --topbar-h:       64px;
  --radius:         8px;
  --radius-sm:      6px;
  --radius-lg:      10px;
  --radius-full:    9999px;

  --shadow-sm:      0 1px 2px rgba(15,23,42,0.06), 0 1px 8px rgba(15,23,42,0.04);
  --shadow:         0 8px 24px rgba(15,23,42,0.08);
  --shadow-md:      0 14px 32px rgba(15,23,42,0.12);
  --shadow-lg:      0 22px 46px rgba(15,23,42,0.16);
  --shadow-xl:      0 32px 70px rgba(15,23,42,0.22);
  --ring:           0 0 0 3px rgba(79,70,229,0.14);
  --surface-glow:   0 1px 0 rgba(255,255,255,0.85) inset;

  --transition:     all 0.2s ease;
  --transition-slow: all 0.35s ease;
}

/* === DARK THEME === */
[data-theme="dark"] {
  --bg:             #0b1120;
  --surface:        #111827;
  --surface-2:      #182235;
  --border:         #263449;
  --border-light:   #1f2937;

  --text:           #f1f5f9;
  --text-2:         #cbd5e1;
  --text-muted:     #94a3b8;
  --text-light:     #64748b;

  --primary-light:  #1e1b4b;

  --success-light:  #064e3b;
  --warning-light:  #451a03;
  --danger-light:   #450a0a;
  --info-light:     #1e3a5f;

  --sidebar-bg:     #060b16;
  --sidebar-border: rgba(255,255,255,0.06);
  --surface-glow:   0 1px 0 rgba(255,255,255,0.05) inset;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,255,255,0) 280px),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
  background:
    linear-gradient(180deg, rgba(30,41,59,0.22), rgba(30,41,59,0) 300px),
    var(--bg);
}

::selection {
  background: rgba(79,70,229,0.18);
  color: var(--text);
}

a { cursor: pointer; text-decoration: none; }
img { max-width: 100%; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

.hidden { display: none !important; }


/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }


/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(79,70,229,0.18);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-hover), #0e7490); transform: translateY(-1px); box-shadow: 0 14px 28px rgba(79,70,229,0.24); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  color: var(--text-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--surface); border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-sm); }

.btn-primary:disabled,
.btn-secondary:disabled {
  cursor: default;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.45);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-outline:hover { background: var(--primary); color: #fff; box-shadow: 0 12px 24px rgba(79,70,229,0.18); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-ghost:hover { background: var(--bg); color: var(--primary); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-danger:hover { background: #b91c1c; box-shadow: var(--shadow-md); }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  transition: var(--transition);
}
.btn-link:hover { opacity: 0.75; }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; padding: 13px 20px; font-size: 15px; }
.btn-large { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  color: var(--text-muted);
}
.btn-icon:hover { background: var(--border-light); color: var(--text); }


/* ============================================================
   FORMS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.form-label .required { color: var(--danger); }
.form-label .optional { color: var(--text-muted); font-weight: 400; }

.form-input, .form-select, .form-textarea {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  transition: var(--transition);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
  background: var(--surface);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-light); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { cursor: pointer; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-error {
  background: var(--danger-light);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(220,38,38,0.2);
}

.char-count {
  font-size: 11px;
  color: var(--text-light);
  text-align: right;
  margin-top: 4px;
}

.form-card {
  background: linear-gradient(180deg, var(--surface), rgba(248,250,252,0.92));
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow), var(--surface-glow);
  border: 1px solid var(--border);
}

[data-theme="dark"] .form-card {
  background: linear-gradient(180deg, rgba(17,24,39,0.98), rgba(24,34,53,0.92));
}
.form-card .form-group { margin-bottom: 20px; }
.form-card .form-group:last-of-type { margin-bottom: 0; }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

.ai-preview-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-light);
  border: 1px solid rgba(79,70,229,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  margin-top: 4px;
}


/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.45);
}

.badge-new       { background: var(--info-light);    color: var(--info); }
.badge-progress  { background: var(--warning-light); color: var(--warning); }
.badge-reviewed  { background: var(--primary-light); color: var(--primary); }
.badge-completed { background: var(--success-light); color: var(--success); }

.badge-high   { background: #fee2e2; color: #dc2626; }
.badge-medium { background: #fef3c7; color: #b45309; }
.badge-low    { background: #f1f5f9; color: #64748b; }

.tag {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 500;
}
.tag:hover {
  border-color: rgba(79,70,229,0.32);
  color: var(--text-2);
}

[data-theme="dark"] .tag {
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
}

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: var(--surface-glow);
}
.score-high   { background: var(--success-light); color: var(--success); }
.score-mid    { background: var(--warning-light); color: var(--warning); }
.score-low    { background: var(--danger-light);  color: var(--danger); }


/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  min-width: 260px;
  max-width: 380px;
  pointer-events: auto;
  animation: slideInToast 0.3s ease forwards;
}
.toast.toast-success { background: var(--success); }
.toast.toast-error   { background: var(--danger); }
.toast.toast-info    { background: var(--primary); }
.toast.toast-out     { animation: slideOutToast 0.3s ease forwards; }

@keyframes slideInToast {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideOutToast {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}


/* ============================================================
   MODAL
   ============================================================ */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUpModal 0.3s ease;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl), var(--surface-glow);
}
@keyframes slideUpModal {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 1;
}
.modal-close-btn:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }

/* Confirm Dialog */
#confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.7);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.confirm-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  animation: slideUpModal 0.25s ease;
}
.confirm-box h3 { font-size: 18px; margin-bottom: 10px; }
.confirm-box p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 12px; justify-content: flex-end; }


/* ============================================================
   LANDING PAGE
   ============================================================ */
#page-home {
  background:
    linear-gradient(180deg, rgba(238,242,255,0.72) 0%, rgba(255,255,255,0) 36%),
    var(--surface);
  min-height: 100vh;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px;
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.76);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226,232,240,0.7);
  z-index: 100;
}
[data-theme="dark"] .landing-nav {
  background: rgba(17,24,39,0.78);
  border-bottom-color: rgba(51,65,85,0.76);
}

[data-theme="dark"] #page-home {
  background:
    linear-gradient(180deg, rgba(30,41,59,0.46) 0%, rgba(17,24,39,0) 36%),
    var(--bg);
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
}
.logo-bulb {
  font-size: 24px;
  filter: drop-shadow(0 8px 12px rgba(79,70,229,0.18));
}
.logo-text { font-size: 20px; }
.landing-nav-links { display: flex; align-items: center; gap: 12px; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 44px 48px 20px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 28px 20px auto;
  height: 72%;
  background:
    linear-gradient(rgba(79,70,229,0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8,145,178,0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,0.7), transparent 75%);
  pointer-events: none;
}

.hero-content,
.hero-visual {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(238,242,255,0.86);
  color: var(--primary);
  border: 1px solid rgba(79,70,229,0.25);
  border-radius: var(--radius-full);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.hero-title {
  font-size: clamp(32px, 3.8vw, 48px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--text);
  margin-bottom: 18px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 480px;
}

.hero-buttons { display: flex; gap: 14px; margin-bottom: 32px; flex-wrap: wrap; }

.hero-trust {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.trust-item {
  font-weight: 600;
  color: var(--text-2);
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(226,232,240,0.82);
  border-radius: var(--radius-full);
  padding: 5px 10px;
}
.trust-sep { color: var(--border); }

[data-theme="dark"] .trust-item {
  background: rgba(17,24,39,0.72);
  border-color: rgba(51,65,85,0.84);
  color: var(--text-2);
}

/* Mockup Window */
.mockup-window {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), var(--surface-glow);
  border: 1px solid rgba(148,163,184,0.32);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-5deg) rotateX(2deg);
}
.mockup-titlebar {
  background: rgba(248,250,252,0.92);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .mockup-window {
  background: linear-gradient(180deg, rgba(17,24,39,0.98), rgba(24,34,53,0.92));
}

[data-theme="dark"] .mockup-titlebar {
  background: rgba(24,34,53,0.92);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red    { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green  { background: #10b981; }
.mockup-url {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.mockup-content { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.mockup-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mockup-stat-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  border: 1px solid rgba(226,232,240,0.9);
  box-shadow: var(--shadow-sm);
}
.ms-num { display: block; font-size: 22px; font-weight: 800; color: var(--primary); }
.ms-label { font-size: 10px; color: var(--text-muted); font-weight: 500; }

.mockup-idea-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.mockup-idea-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.mi-title { font-size: 13px; font-weight: 700; color: var(--text); }
.mi-score {
  font-size: 12px;
  font-weight: 800;
  color: var(--success);
  background: var(--success-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.mockup-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.mi-tag {
  font-size: 10px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}
.mi-tag.pri-high { background: #fee2e2; color: #dc2626; }
.mi-tag.pri-med  { background: #fef3c7; color: #b45309; }
.mi-feedback { font-size: 11px; color: var(--text-muted); font-style: italic; line-height: 1.5; }

/* Features */
.features-section {
  padding: 80px 48px;
  max-width: 1200px;
  margin: 0 auto;
}
.features-header { text-align: center; margin-bottom: 60px; }
.features-header h2 { font-size: 36px; font-weight: 800; margin-bottom: 12px; color: var(--text); }
.features-header p { font-size: 18px; color: var(--text-muted); }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.feature-card {
  background: linear-gradient(180deg, var(--surface), rgba(248,250,252,0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm), var(--surface-glow);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(79,70,229,0.45); }
.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border: 1px solid rgba(79,70,229,0.15);
  border-radius: var(--radius);
  font-size: 26px;
  margin-bottom: 18px;
}
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

[data-theme="dark"] .feature-icon {
  background: rgba(79,70,229,0.18);
}

/* Footer */
.landing-footer {
  background: linear-gradient(180deg, var(--surface-2), var(--bg));
  border-top: 1px solid var(--border);
  padding: 32px 48px;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; }
.footer-logo { font-size: 18px; font-weight: 700; color: var(--primary); }
.footer-copy { font-size: 13px; color: var(--text-muted); }


/* ============================================================
   AUTH PAGES
   ============================================================ */
.public-page { min-height: 100vh; }

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background:
    linear-gradient(180deg, rgba(238,242,255,0.58), rgba(255,255,255,0) 42%),
    var(--surface);
}

.auth-logo-link {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
  margin-bottom: 40px;
  align-self: flex-start;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(226,232,240,0.85);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow), var(--surface-glow);
}

[data-theme="dark"] .auth-left {
  background:
    linear-gradient(180deg, rgba(30,41,59,0.32), rgba(17,24,39,0) 46%),
    var(--surface);
}

[data-theme="dark"] .auth-card {
  background: rgba(17,24,39,0.82);
}

.auth-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.auth-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.auth-card .form-group { margin-bottom: 16px; }

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}
.auth-link { color: var(--primary); font-weight: 600; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }

.auth-email-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.auth-email-notice strong {
  display: block;
  color: var(--text);
  margin-bottom: 2px;
  font-weight: 600;
}
.auth-email-notice-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Email confirmation screen (shown after signup when confirmation email is sent) */
.auth-confirm-screen {
  text-align: center;
  padding: 12px 0 8px;
}
.auth-confirm-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(99,102,241,0.18));
}
.auth-confirm-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}
.auth-confirm-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 340px;
  margin: 0 auto;
}

.demo-hint {
  background: var(--warning-light);
  border: 1px solid rgba(217,119,6,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--warning);
  margin-top: 16px;
  text-align: center;
}

.auth-right {
  background:
    linear-gradient(135deg, rgba(17,24,39,0.96) 0%, rgba(30,41,59,0.94) 48%, rgba(8,145,178,0.92) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.auth-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(135deg, transparent 8%, black 48%, transparent 100%);
}

.auth-promo {
  max-width: 380px;
  color: #fff;
  position: relative;
  z-index: 1;
  padding: 30px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 24px 60px rgba(0,0,0,0.24);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.promo-quote {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 32px;
  opacity: 0.95;
}
.promo-features { display: flex; flex-direction: column; gap: 14px; }
.promo-feature { font-size: 15px; opacity: 0.9; font-weight: 500; }


/* ============================================================
   APP LAYOUT
   ============================================================ */
#app-wrapper {
  display: flex;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(238,242,255,0.64), rgba(245,247,251,0) 260px),
    var(--bg);
}

/* SIDEBAR */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(79,70,229,0.16), rgba(8,145,178,0.08) 46%, transparent),
    var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 200;
  transition: transform 0.3s ease;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 12px 0 34px rgba(15,23,42,0.14);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.sidebar-logo-text { color: #c7d2fe; }
.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--sidebar-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 10px 20px rgba(79,70,229,0.22);
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: #e0e7ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-email {
  font-size: 11px;
  color: var(--sidebar-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-plan-chip {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-full);
  padding: 4px 9px;
  background: rgba(255,255,255,0.07);
  color: #e0e7ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-plan-chip:hover { background: rgba(255,255,255,0.12); color: #fff; }
.sidebar-plan-chip.plan-pro { border-color: rgba(16,185,129,0.42); color: #bbf7d0; background: rgba(16,185,129,0.12); }
.sidebar-plan-chip.plan-founder { border-color: rgba(245,158,11,0.5); color: #fde68a; background: rgba(245,158,11,0.12); }

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius-sm);
  margin: 2px 12px;
  position: relative;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; transform: translateX(2px); }
.nav-link.active {
  background: linear-gradient(135deg, rgba(79,70,229,0.32), rgba(8,145,178,0.18));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0,0,0,0.16);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-ico { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-lbl { white-space: nowrap; }

.sidebar-bottom {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-theme-toggle:hover { background: var(--sidebar-hover); color: var(--sidebar-text); }

.btn-logout {
  width: 100%;
  background: rgba(220,38,38,0.15);
  border: 1px solid rgba(220,38,38,0.2);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-logout:hover { background: rgba(220,38,38,0.3); color: #fff; }

#sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  backdrop-filter: blur(2px);
}

/* MAIN AREA */
#main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

/* TOP BAR */
#topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,0.82);
  border-bottom: 1px solid rgba(226,232,240,0.82);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] #topbar {
  background: rgba(17,24,39,0.82);
  border-bottom-color: rgba(51,65,85,0.8);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-plan-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(79,70,229,0.28);
  border-radius: var(--radius-full);
  padding: 7px 13px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}
.topbar-plan-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.topbar-plan-btn.plan-pro { background: var(--success-light); border-color: rgba(5,150,105,0.24); color: var(--success); }
.topbar-plan-btn.plan-founder { background: var(--warning-light); border-color: rgba(217,119,6,0.3); color: var(--warning); }

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: none; /* hidden on desktop */
}
.hamburger:hover { background: var(--bg); }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text-muted); border-radius: 2px; }

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.topbar-avatar:hover { transform: scale(1.08); box-shadow: var(--shadow-md); }

/* CONTENT AREA */
#content-area { padding: 28px; flex: 1; min-width: 0; overflow-x: hidden; }
.app-page { animation: fadePageIn 0.25s ease; }
@keyframes fadePageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }


/* ============================================================
   PAGE HEADERS
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.page-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.page-subtitle { font-size: 14px; color: var(--text-muted); }


/* ============================================================
   DASHBOARD
   ============================================================ */
.page-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.welcome-greeting {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.welcome-sub { font-size: 14px; color: var(--text-muted); }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: linear-gradient(180deg, var(--surface), rgba(248,250,252,0.92));
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), var(--surface-glow);
  transition: var(--transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79,70,229,0.08), transparent 42%);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(79,70,229,0.38); }
.stat-card:hover::after { opacity: 1; }

[data-theme="dark"] .stat-card,
[data-theme="dark"] .section-card,
[data-theme="dark"] .ideas-toolbar,
[data-theme="dark"] .idea-card,
[data-theme="dark"] .idea-list-item,
[data-theme="dark"] .feature-card {
  background: linear-gradient(180deg, rgba(17,24,39,0.98), rgba(24,34,53,0.92));
}

[data-theme="dark"] .section-card-header {
  background: rgba(24,34,53,0.64);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.stat-icon {
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon.blue   { background: var(--info-light); }
.stat-icon.green  { background: var(--success-light); }
.stat-icon.purple { background: var(--primary-light); }
.stat-icon.amber  { background: var(--warning-light); }
.stat-icon.red    { background: var(--danger-light); }
.stat-icon.teal   { background: #ccfbf1; }

.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1.2; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-sub { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* Dashboard lower grid */
.dashboard-lower {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}
.dash-col { display: flex; flex-direction: column; gap: 20px; }

.section-card {
  background: linear-gradient(180deg, var(--surface), rgba(248,250,252,0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), var(--surface-glow);
  overflow: hidden;
}
.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  background: rgba(248,250,252,0.62);
}
.section-card-header h3 { font-size: 15px; font-weight: 700; color: var(--text); }

/* Recent Ideas */
.recent-idea-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
}
.recent-idea-item:last-child { border-bottom: none; }
.recent-idea-item:hover { background: var(--bg); }

.ri-score { flex-shrink: 0; }
.ri-body { flex: 1; min-width: 0; }
.ri-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.ri-meta { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.ri-arrow { color: var(--text-light); font-size: 16px; flex-shrink: 0; }

/* Category bar */
.cat-bar-item { padding: 10px 20px; }
.cat-bar-item:not(:last-child) { border-bottom: 1px solid var(--border-light); }
.cat-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}
.cat-name { font-weight: 500; color: var(--text-2); }
.cat-count { font-weight: 700; color: var(--primary); }
.cat-bar-track { background: var(--bg); border-radius: var(--radius-full); height: 6px; }
.cat-bar-fill { background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent)); border-radius: var(--radius-full); height: 6px; transition: width 0.6s ease; }

/* Health indicators */
.health-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.health-item:last-child { border-bottom: none; }
.health-label { color: var(--text-muted); }
.health-value { font-weight: 700; color: var(--text); }
.health-value.good  { color: var(--success); }
.health-value.warn  { color: var(--warning); }
.health-value.great { color: var(--primary); }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-sub { font-size: 14px; color: var(--text-muted); max-width: 300px; margin-bottom: 24px; line-height: 1.6; }


/* ============================================================
   MY IDEAS PAGE
   ============================================================ */
.ideas-toolbar {
  background: linear-gradient(180deg, var(--surface), rgba(248,250,252,0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm), var(--surface-glow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.search-ico {
  position: absolute;
  left: 14px;
  font-size: 15px;
  pointer-events: none;
  color: var(--text-muted);
}
.search-input {
  width: 100%;
  padding: 10px 40px 10px 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
}
.search-input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: var(--ring); }
.search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px;
}

.toolbar-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
  min-width: 130px;
}
.filter-select:focus { outline: none; border-color: var(--primary); }

.view-toggle { display: flex; gap: 4px; }
.idea-tools-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.idea-utility-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.view-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  transition: var(--transition);
  line-height: 1;
}
.view-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.view-btn:hover:not(.active) { border-color: var(--primary-mid); color: var(--text); }

.ideas-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-muted);
  min-height: 24px;
}

/* IDEAS GRID (card view) */
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.idea-card {
  background: linear-gradient(180deg, var(--surface), rgba(248,250,252,0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm), var(--surface-glow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.pinned-card {
  border-color: rgba(245,158,11,0.45) !important;
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(245,158,11,0.12), var(--surface-glow) !important;
}
.pin-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.82);
  color: var(--text-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.pin-btn.inline {
  position: static;
  flex-shrink: 0;
}
.pin-btn:hover,
.pin-btn.active {
  color: #b45309;
  background: #fffbeb;
  border-color: rgba(245,158,11,0.45);
}
.idea-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(79,70,229,0.42); }
.idea-card.completed-card { opacity: 0.75; }

.idea-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-left: 34px;
}
.idea-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
  word-break: break-word;
}
.idea-card-score { flex-shrink: 0; }

.idea-card-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.idea-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.idea-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.idea-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}
.idea-card-date { font-size: 11px; color: var(--text-light); }
.idea-card-actions { display: flex; gap: 4px; }
.card-action-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  transition: var(--transition);
}
.card-action-btn:hover { background: var(--bg); color: var(--text); border-color: var(--primary-mid); }
.card-action-btn.del:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }

/* Priority accent bar */
.idea-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.priority-high::before   { background: linear-gradient(90deg, #ef4444, #f97316); }
.priority-medium::before { background: linear-gradient(90deg, #f59e0b, #eab308); }
.priority-low::before    { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }

/* IDEAS LIST (list view) */
.ideas-list { display: flex; flex-direction: column; gap: 8px; }

.idea-list-item {
  background: linear-gradient(180deg, var(--surface), rgba(248,250,252,0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
}
.idea-list-item:hover { border-color: rgba(79,70,229,0.42); box-shadow: var(--shadow); transform: translateY(-1px); }

.il-score { flex-shrink: 0; }
.il-body { flex: 1; min-width: 0; }
.il-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.il-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.il-category { font-size: 12px; color: var(--primary); font-weight: 600; }
.il-dot { color: var(--border); }
.il-date { font-size: 12px; color: var(--text-muted); }

.il-badges { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.il-actions { display: flex; gap: 4px; flex-shrink: 0; }

.stage-badge {
  border-color: rgba(99,102,241,0.2);
}
.stage-raw { background: #f1f5f9; color: #475569; }
.stage-validating { background: #ecfeff; color: #0891b2; }
.stage-building { background: #eef2ff; color: #4f46e5; }
.stage-launched { background: #ecfdf5; color: #059669; }
.badge-template {
  background: #fdf2f8;
  color: #be185d;
  border-color: rgba(190,24,93,0.18);
}

.template-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 10% 0%, rgba(99,102,241,0.08), transparent 32%),
    var(--surface-2);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 10px;
}
.kanban-column {
  min-width: 220px;
  background: linear-gradient(180deg, var(--surface), rgba(248,250,252,0.9));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm), var(--surface-glow);
  overflow: hidden;
}
.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  background: rgba(248,250,252,0.72);
}
.kanban-column-header h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.kanban-column-header span {
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}
.kanban-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.kanban-card:hover {
  border-color: rgba(79,70,229,0.42);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.kanban-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 8px;
}
.kanban-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.kanban-stage-select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-size: 12px;
}
.kanban-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.resurface-modal,
.duplicate-modal,
.ai-tool-modal {
  padding: 30px;
}
.resurface-kicker {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
}
.resurface-modal h2,
.duplicate-modal h2,
.ai-tool-modal h2 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--text);
}
.resurface-modal p,
.modal-subcopy,
.ai-tool-modal p {
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 18px;
}
.resurface-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.duplicate-group {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 14px;
}
.duplicate-group-title {
  padding: 12px 14px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}
.duplicate-item {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  cursor: pointer;
}
.duplicate-item:hover {
  background: var(--surface-2);
}
.duplicate-item span {
  font-weight: 700;
}
.duplicate-item small {
  color: var(--text-muted);
  white-space: nowrap;
}
.empty-state.compact {
  min-height: 240px;
}

.timeline-plan {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.timeline-plan-group {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.timeline-plan-label {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
}
.timeline-plan-group ul,
.ai-suggestion-card p {
  margin: 0;
}
.timeline-plan-group li {
  margin-left: 16px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 6px;
}
.ai-suggestion-grid,
.digest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.ai-suggestion-card,
.digest-card,
.compare-result-card,
.rewrite-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.ai-suggestion-card strong,
.digest-card span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 7px;
}
.ai-suggestion-card p,
.digest-card p,
.compare-result-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}
.digest-card strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
  margin-bottom: 6px;
}
.compare-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
}
.compare-result {
  margin-top: 14px;
}
.compare-winner {
  color: var(--text);
  font-size: 15px;
  margin-bottom: 10px;
}
.compare-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.compare-scores span {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}
.rewrite-box {
  color: var(--text-2);
  line-height: 1.7;
  white-space: pre-wrap;
}


/* ============================================================
   IDEA DETAIL MODAL
   ============================================================ */
.idea-modal { padding: 28px; }

.idea-modal-header {
  padding-right: 40px;
  margin-bottom: 20px;
}
.idea-modal-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
}
.idea-modal-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.idea-modal-ai {
  background: linear-gradient(135deg, var(--primary-light), #ecfeff);
  border: 1px solid rgba(79,70,229,0.2);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
[data-theme="dark"] .idea-modal-ai {
  background: linear-gradient(135deg, #1e1b4b, #1e293b);
  border-color: rgba(99,102,241,0.3);
}

.ai-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-score-display {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.ai-score-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid;
}
.ai-score-circle.high { border-color: var(--success); background: var(--success-light); }
.ai-score-circle.mid  { border-color: var(--warning); background: var(--warning-light); }
.ai-score-circle.low  { border-color: var(--danger);  background: var(--danger-light); }
.asi-num { font-size: 24px; font-weight: 900; line-height: 1; }
.asi-out { font-size: 10px; font-weight: 600; opacity: 0.7; }
.ai-score-circle.high .asi-num { color: var(--success); }
.ai-score-circle.mid  .asi-num { color: var(--warning); }
.ai-score-circle.low  .asi-num { color: var(--danger); }

.ai-score-text { flex: 1; }
.ai-summary-text { font-size: 14px; color: var(--text-2); line-height: 1.6; }

.ai-feedback-box {
  background: rgba(255,255,255,0.82);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.ai-feedback-box p { font-size: 13px; color: var(--text-2); line-height: 1.7; }

.ai-next-steps { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ai-next-steps li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.ai-next-steps li::before {
  content: '→';
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.idea-modal-body { display: flex; flex-direction: column; gap: 16px; }

.idea-modal-section { }
.ims-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ims-value { font-size: 14px; color: var(--text-2); line-height: 1.6; }
.ims-value.notes-val {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-style: italic;
}

.idea-modal-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.idea-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}


/* ============================================================
   DAILY JOURNAL
   ============================================================ */
.journal-day { margin-bottom: 32px; }

.journal-day-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.journal-day-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.journal-day-info { }
.journal-day-date {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.journal-day-count { font-size: 12px; color: var(--text-muted); }

.journal-day-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.journal-day-ideas { display: flex; flex-direction: column; gap: 10px; }

.journal-idea-card {
  background: linear-gradient(180deg, var(--surface), rgba(248,250,252,0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm), var(--surface-glow);
}
.journal-idea-card:hover { border-color: var(--primary-mid); box-shadow: var(--shadow); transform: translateX(4px); }

.jic-time { font-size: 11px; color: var(--text-light); min-width: 48px; flex-shrink: 0; }
.jic-body { flex: 1; min-width: 0; }
.jic-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.jic-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jic-cat { font-size: 12px; color: var(--primary); font-weight: 500; }
.jic-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}
.jic-score { flex-shrink: 0; }


/* ============================================================
   AI INSIGHTS
   ============================================================ */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.insights-grid .full-width { grid-column: 1 / -1; }

.insight-card {
  background: linear-gradient(180deg, var(--surface), rgba(248,250,252,0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm), var(--surface-glow);
}
.insight-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: rgba(248,250,252,0.62);
  display: flex;
  align-items: center;
  gap: 10px;
}
.insight-card-header h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.insight-icon {
  min-width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.insight-card-body { padding: 20px; }

/* Summary stats */
.insight-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.isummary-item { text-align: center; }
.isummary-num { font-size: 32px; font-weight: 900; color: var(--primary); display: block; }
.isummary-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }

/* Category chart */
.insight-cat-list { display: flex; flex-direction: column; gap: 12px; }
.insight-cat-item { }
.insight-cat-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.icl-name { font-size: 13px; font-weight: 600; color: var(--text-2); }
.icl-count { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: 1px 8px; border-radius: var(--radius-full); }
.insight-bar-track { background: var(--bg); border-radius: var(--radius-full); height: 8px; border: 1px solid var(--border); }
.insight-bar-fill {
  height: 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Best/Worst ideas */
.insight-idea-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
}
.insight-idea-item:last-child { border-bottom: none; padding-bottom: 0; }
.insight-idea-item:hover .iit-title { color: var(--primary); }

.iit-rank { font-size: 16px; font-weight: 800; color: var(--text-light); width: 24px; text-align: center; flex-shrink: 0; }
.iit-body { flex: 1; min-width: 0; }
.iit-title { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.iit-meta { font-size: 11px; color: var(--text-muted); }

/* Tags cloud */
.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud-item {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(79,70,229,0.2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tag-cloud-count {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 0px 6px;
  font-size: 10px;
  font-weight: 700;
}

/* Action plan */
.action-plan-list { display: flex; flex-direction: column; gap: 12px; }
.action-plan-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.ap-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.ap-body { flex: 1; }
.ap-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.ap-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* Improvement list */
.improve-list { display: flex; flex-direction: column; gap: 10px; }
.improve-item {
  background: var(--warning-light);
  border: 1px solid rgba(217,119,6,0.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
}
.improve-item:hover { background: #fde68a; }
.improve-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.improve-reason { font-size: 12px; color: var(--warning); }


/* ============================================================
   SUBSCRIPTION / PRICING
   ============================================================ */
.idea-limit-notice,
.plan-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(79,70,229,0.16);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(238,242,255,0.9), rgba(236,253,245,0.72));
  box-shadow: var(--shadow-sm);
}
.plan-nudge {
  grid-column: 1 / -1;
}
.idea-limit-notice div,
.plan-nudge div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.idea-limit-notice strong,
.plan-nudge strong {
  font-size: 13px;
  color: var(--text);
}
.idea-limit-notice span,
.plan-nudge span {
  font-size: 12px;
  color: var(--text-muted);
}
.plan-live-badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  padding: 5px 10px;
  background: var(--success-light);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
}
.locked-feature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(79,70,229,0.16);
  border-radius: var(--radius);
  padding: 18px;
  background: linear-gradient(135deg, rgba(238,242,255,0.78), rgba(248,250,252,0.96));
}
.locked-feature strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 4px;
}
.locked-feature p {
  color: var(--text-muted);
  font-size: 13px;
}

.pricing-modal {
  padding: 28px;
}
.pricing-hero {
  max-width: 720px;
  margin-bottom: 22px;
}
.pricing-kicker {
  display: inline-flex;
  border-radius: var(--radius-full);
  padding: 5px 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
}
.pricing-hero h2 {
  font-size: 28px;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 8px;
}
.pricing-hero p,
.pricing-footnote {
  font-size: 13px;
  color: var(--text-muted);
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-sm), var(--surface-glow);
}
.pricing-card.featured {
  border-color: rgba(79,70,229,0.34);
  box-shadow: var(--shadow-md);
}
.pricing-card.current {
  outline: 2px solid rgba(16,185,129,0.22);
}
.pricing-accent {
  width: fit-content;
  border-radius: var(--radius-full);
  padding: 4px 9px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
}
.pricing-plan-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--text);
}
.pricing-price span {
  font-size: 34px;
  font-weight: 900;
}
.pricing-price small,
.subscription-price small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.pricing-card p {
  min-height: 42px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.pricing-card ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: auto;
}
.pricing-card li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-2);
}
.pricing-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.pricing-card button {
  width: 100%;
  justify-content: center;
}
.pricing-footnote {
  margin-top: 14px;
  text-align: center;
}

[data-theme="dark"] .idea-limit-notice,
[data-theme="dark"] .plan-nudge,
[data-theme="dark"] .locked-feature {
  background: linear-gradient(135deg, rgba(30,27,75,0.72), rgba(6,78,59,0.34));
}
[data-theme="dark"] .pricing-card {
  background: linear-gradient(180deg, rgba(17,24,39,0.98), rgba(24,34,53,0.92));
}


/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.settings-card {
  background: linear-gradient(180deg, var(--surface), rgba(248,250,252,0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm), var(--surface-glow);
}
.settings-card h3 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 20px; }

.settings-card-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.settings-card-header h3 { margin-bottom: 4px; }
.settings-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .modal-box,
[data-theme="dark"] .journal-idea-card,
[data-theme="dark"] .insight-card,
[data-theme="dark"] .settings-card {
  background: linear-gradient(180deg, rgba(17,24,39,0.98), rgba(24,34,53,0.92));
}

[data-theme="dark"] .insight-card-header {
  background: rgba(24,34,53,0.64);
}

[data-theme="dark"] .ai-feedback-box {
  background: rgba(17,24,39,0.72);
}
.settings-member-since { font-size: 12px; color: var(--text-muted); }
.settings-card .form-group { margin-bottom: 16px; }

.settings-subscription-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.subscription-current {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.subscription-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.subscription-current strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
  margin-bottom: 5px;
}
.subscription-current p {
  color: var(--text-muted);
  font-size: 12px;
  max-width: 360px;
}
.subscription-price {
  white-space: nowrap;
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
}
.subscription-meter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.subscription-meter div {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255,255,255,0.46);
}
.subscription-meter span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}
.subscription-meter strong {
  color: var(--text);
  font-size: 13px;
}

[data-theme="dark"] .subscription-current,
[data-theme="dark"] .subscription-meter div {
  background: rgba(17,24,39,0.55);
}

.settings-pref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.settings-pref-item:last-child { border-bottom: none; }
.pref-info strong { font-size: 14px; color: var(--text); display: block; margin-bottom: 2px; }
.pref-info p { font-size: 12px; color: var(--text-muted); }

.settings-danger-card { border-color: rgba(220,38,38,0.3); }
.settings-danger-card h3 { color: var(--danger); }
.danger-note { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.danger-actions { display: flex; flex-direction: column; gap: 14px; }
.danger-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.danger-action strong { font-size: 14px; color: var(--text); display: block; margin-bottom: 2px; }
.danger-action p { font-size: 12px; color: var(--text-muted); }


/* ============================================================
   INDEX / LANDING VISUAL SYNC
   Aligns index.html with the standalone premium landing page.
   ============================================================ */
@keyframes ihFloatCard {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-14px) rotate(-1deg); }
}

@keyframes ihGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes ihFadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

#page-home {
  background: #05070f;
  color: #f8fafc;
  overflow: hidden;
}

#page-home .landing-nav {
  background: rgba(5,7,15,0.76);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: none;
}

#page-home .landing-logo {
  color: #fff;
}

#page-home .logo-text {
  color: #fff;
  letter-spacing: 0;
}

#page-home .btn-ghost {
  color: rgba(255,255,255,0.78);
}

#page-home .btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

#page-home .hero {
  max-width: none;
  min-height: calc(100vh - 69px);
  padding: 82px 48px 72px;
  background: #05070f;
  isolation: isolate;
}

#page-home .hero::before {
  inset: 0;
  height: auto;
  background-image:
    linear-gradient(rgba(99,102,241,0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.06) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 84% 62% at 50% 48%, black 38%, transparent 100%);
  opacity: 1;
  z-index: -3;
}

#page-home .hero::after {
  content: '';
  position: absolute;
  inset: -22% -14% -18%;
  background:
    radial-gradient(circle at 14% 20%, rgba(99,102,241,0.26), transparent 30%),
    radial-gradient(circle at 86% 28%, rgba(139,92,246,0.22), transparent 28%),
    radial-gradient(circle at 64% 82%, rgba(6,182,212,0.16), transparent 30%);
  filter: blur(22px);
  z-index: -2;
  pointer-events: none;
}

#page-home .hero-content {
  max-width: 600px;
  animation: ihFadeUp 0.65s ease both;
}

#page-home .hero-visual {
  animation: ihFadeUp 0.8s 0.1s ease both;
}

#page-home .hero-badge {
  gap: 8px;
  background: rgba(99,102,241,0.16);
  border: 1px solid rgba(129,140,248,0.36);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.08) inset, 0 12px 32px rgba(0,0,0,0.22);
  color: #c7d2fe;
  padding: 7px 17px;
  margin-bottom: 28px;
}

#page-home .hero-title {
  color: #fff;
  font-size: clamp(42px, 5.45vw, 72px);
  line-height: 1.08;
  letter-spacing: 0;
  margin-bottom: 24px;
}

#page-home .gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 42%, #38bdf8 100%);
  background-size: 200% 200%;
  animation: ihGradientShift 4s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#page-home .hero-subtitle {
  color: rgba(255,255,255,0.58);
  font-size: 18px;
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 40px;
}

#page-home .hero-buttons {
  margin-bottom: 46px;
}

#page-home .btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(99,102,241,0.45), 0 0 0 1px rgba(99,102,241,0.32) inset;
}

#page-home .btn-primary:hover {
  background: linear-gradient(135deg, #5558e8 0%, #7c3aed 100%);
  box-shadow: 0 16px 48px rgba(99,102,241,0.55), 0 0 0 1px rgba(99,102,241,0.4) inset;
}

#page-home .btn-outline {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.86);
  border-radius: 12px;
}

#page-home .btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.28);
  color: #fff;
}

#page-home .hero-trust {
  gap: 20px;
}

#page-home .trust-item {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.52);
  padding: 0;
  font-weight: 500;
}

#page-home .trust-sep {
  display: none;
}

#page-home .mockup-window {
  background: linear-gradient(160deg, #0f1629 0%, #0a0e1c 100%);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 20px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.58), 0 0 0 1px rgba(255,255,255,0.05);
  transform: rotate(-1deg);
  animation: ihFloatCard 6s ease-in-out infinite;
}

#page-home .mockup-titlebar {
  background: rgba(255,255,255,0.045);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 14px 20px;
}

#page-home .mockup-url {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.38);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

#page-home .mockup-content {
  padding: 20px;
}

#page-home .mockup-stat-card,
#page-home .mockup-idea-card {
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.075);
  box-shadow: none;
}

#page-home .ms-num {
  color: #818cf8;
  font-weight: 900;
}

#page-home .ms-label,
#page-home .mi-feedback {
  color: rgba(255,255,255,0.42);
}

#page-home .mi-title {
  color: #e2e8f0;
}

#page-home .mi-score {
  color: #34d399;
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.22);
}

#page-home .mi-tag {
  color: #a5b4fc;
  background: rgba(99,102,241,0.16);
  border: 1px solid rgba(99,102,241,0.22);
}

#page-home .mi-tag.pri-high {
  color: #fca5a5;
  background: rgba(239,68,68,0.14);
  border-color: rgba(239,68,68,0.2);
}

#page-home .mi-tag.pri-med {
  color: #fbbf24;
  background: rgba(245,158,11,0.13);
  border-color: rgba(245,158,11,0.22);
}

#page-home .features-section {
  max-width: none;
  padding: 96px 48px;
  background: #f8fafc;
  color: #0f172a;
}

#page-home .features-header,
#page-home .features-grid {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

#page-home .features-header h2 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
  color: #0f172a;
}

#page-home .features-header p {
  color: #64748b;
  line-height: 1.7;
}

#page-home .feature-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 32px;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(.16,1,.3,1);
}

#page-home .feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#page-home .feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
  border-color: #c7d2fe;
}

#page-home .feature-card:hover::before {
  opacity: 1;
}

#page-home .feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #eef2ff;
  border-color: #c7d2fe;
  font-size: 28px;
}

#page-home .feature-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

#page-home .feature-card p {
  color: #64748b;
  line-height: 1.7;
}

#page-home .landing-footer {
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

#page-home .footer-logo {
  color: #4f46e5;
}

.auth-layout {
  background: #05070f;
}

.auth-left {
  background:
    radial-gradient(circle at 18% 14%, rgba(99,102,241,0.2), transparent 34%),
    linear-gradient(180deg, #090d1a, #05070f);
}

.auth-logo-link {
  color: #fff;
}

.auth-card {
  background: rgba(15,22,41,0.82);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 30px 80px rgba(0,0,0,0.34);
  color: #f8fafc;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-title {
  color: #fff;
}

.auth-subtitle,
.auth-switch {
  color: rgba(255,255,255,0.58);
}

.auth-card .form-label {
  color: rgba(255,255,255,0.82);
}

.auth-card .form-input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #fff;
}

.auth-card .form-input::placeholder {
  color: rgba(255,255,255,0.38);
}

.auth-card .form-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.24);
}

.auth-link {
  color: #a5b4fc;
}

.auth-right {
  background:
    radial-gradient(circle at 78% 72%, rgba(6,182,212,0.38), transparent 34%),
    radial-gradient(circle at 26% 20%, rgba(139,92,246,0.25), transparent 34%),
    #05070f;
}

.auth-right::before {
  background-image:
    linear-gradient(rgba(99,102,241,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.06) 1px, transparent 1px);
  background-size: 50px 50px;
}

.auth-promo {
  background: rgba(255,255,255,0.075);
  border-color: rgba(255,255,255,0.14);
  border-radius: 20px;
}

#app-wrapper {
  background:
    radial-gradient(circle at 28% -6%, rgba(99,102,241,0.16), transparent 32%),
    radial-gradient(circle at 92% 6%, rgba(6,182,212,0.12), transparent 28%),
    #f8fafc;
}

#sidebar {
  background:
    radial-gradient(circle at 20% 0%, rgba(99,102,241,0.25), transparent 35%),
    linear-gradient(180deg, #0f1629, #070b16);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(129,140,248,0.36) transparent;
}

#sidebar::-webkit-scrollbar {
  width: 8px;
}

#sidebar::-webkit-scrollbar-thumb {
  background: rgba(129,140,248,0.28);
  border-radius: 999px;
}

.sidebar-nav {
  flex: 0 0 auto;
  overflow: visible;
  padding: 14px 0 8px;
}

.sidebar-bottom {
  margin-top: 18px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(7,11,22,0.72), rgba(7,11,22,0.98) 34%),
    #070b16;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.btn-logout {
  min-height: 40px;
}

#topbar {
  background: rgba(255,255,255,0.84);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.section-card,
.stat-card,
.ideas-toolbar,
.idea-card,
.idea-list-item,
.journal-idea-card,
.insight-card,
.settings-card,
.form-card {
  border-radius: 16px;
}

/* ============================================================
   DESIGN POLISH
   Subtle motion, empty/loading states, card depth, mobile finesse.
   ============================================================ */
@keyframes polishIn {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes polishShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes polishPulse {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50% { transform: scale(1.05); opacity: 1; }
}

html {
  scroll-padding-top: calc(var(--topbar-h) + 20px);
}

button,
.nav-link,
.idea-card,
.idea-list-item,
.journal-idea-card,
.recent-idea-item,
.insight-idea-item,
.feature-card {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
.nav-link:focus-visible,
.card-action-btn:focus-visible,
.sidebar-theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(129,140,248,0.28);
}

#content-area {
  background:
    radial-gradient(circle at 12% 0%, rgba(99,102,241,0.08), transparent 30%),
    radial-gradient(circle at 100% 6%, rgba(6,182,212,0.07), transparent 28%);
}

.app-page {
  animation: polishIn 0.34s cubic-bezier(.16,1,.3,1);
}

.page-header,
.page-welcome {
  padding: 4px 2px;
}

.page-header h2,
.welcome-greeting {
  letter-spacing: 0;
}

.page-subtitle,
.welcome-sub {
  max-width: 680px;
}

.stat-card,
.section-card,
.ideas-toolbar,
.idea-card,
.idea-list-item,
.journal-idea-card,
.insight-card,
.settings-card,
.form-card {
  transition: transform 0.28s cubic-bezier(.16,1,.3,1), box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

.section-card,
.insight-card,
.settings-card,
.form-card {
  position: relative;
}

.section-card::before,
.insight-card::before,
.settings-card::before,
.form-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), transparent 32%, rgba(6,182,212,0.06));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.section-card:hover::before,
.insight-card:hover::before,
.settings-card:hover::before,
.form-card:hover::before {
  opacity: 1;
}

.section-card-header,
.insight-card-header {
  position: relative;
  z-index: 1;
}

.stat-icon,
.insight-icon,
.feature-icon {
  box-shadow: 0 10px 22px rgba(15,23,42,0.08), inset 0 1px 0 rgba(255,255,255,0.58);
}

.stat-icon.blue,
.stat-icon.purple,
.stat-icon.teal {
  background: linear-gradient(135deg, rgba(99,102,241,0.16), rgba(6,182,212,0.14));
}

.stat-icon.green {
  background: linear-gradient(135deg, rgba(16,185,129,0.16), rgba(6,182,212,0.12));
}

.stat-icon.amber {
  background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(251,191,36,0.14));
}

.stat-icon.red {
  background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(244,114,182,0.12));
}

.loading-state,
.modal-loading {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}

.modal-loading {
  min-height: 220px;
}

.loading-orb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff, transparent 24%),
    linear-gradient(135deg, #6366f1, #8b5cf6 52%, #06b6d4);
  box-shadow: 0 16px 40px rgba(99,102,241,0.32);
  animation: polishPulse 1.45s ease-in-out infinite;
  margin-bottom: 14px;
}

.loading-title {
  display: block;
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 3px;
}

.loading-sub {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.loading-skeleton {
  width: min(420px, 78vw);
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.loading-skeleton span {
  height: 12px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--border-light), rgba(129,140,248,0.18), var(--border-light));
  background-size: 200% 100%;
  animation: polishShimmer 1.25s ease-in-out infinite;
}

.loading-skeleton span:nth-child(2) { width: 82%; margin: 0 auto; }
.loading-skeleton span:nth-child(3) { width: 58%; margin: 0 auto; }

.empty-state {
  min-height: 340px;
  background:
    radial-gradient(circle at 50% 18%, rgba(99,102,241,0.1), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.62), rgba(255,255,255,0));
  border: 1px dashed rgba(148,163,184,0.38);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.62);
}

.empty-icon {
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(99,102,241,0.13), rgba(6,182,212,0.1));
  border: 1px solid rgba(129,140,248,0.24);
  box-shadow: 0 18px 42px rgba(99,102,241,0.14);
}

.empty-title {
  font-size: 20px;
  letter-spacing: 0;
}

.empty-sub {
  max-width: 420px;
}

.card-action-btn {
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.idea-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 90% 10%, rgba(99,102,241,0.1), transparent 28%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.idea-card:hover::after {
  opacity: 1;
}

.idea-card-title,
.il-title,
.jic-title,
.iit-title,
.ri-title {
  letter-spacing: 0;
}

.tag,
.badge,
.tag-cloud-item {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-box {
  scrollbar-width: thin;
  scrollbar-color: rgba(129,140,248,0.34) transparent;
}

.modal-box::-webkit-scrollbar {
  width: 8px;
}

.modal-box::-webkit-scrollbar-thumb {
  background: rgba(129,140,248,0.28);
  border-radius: 999px;
}

.idea-modal-section,
.action-plan-item,
.settings-pref-item,
.danger-action {
  position: relative;
  z-index: 1;
}

[data-theme="dark"] #content-area {
  background:
    radial-gradient(circle at 12% 0%, rgba(99,102,241,0.12), transparent 30%),
    radial-gradient(circle at 100% 6%, rgba(6,182,212,0.09), transparent 28%);
}

[data-theme="dark"] .empty-state {
  background:
    radial-gradient(circle at 50% 18%, rgba(99,102,241,0.16), transparent 28%),
    linear-gradient(180deg, rgba(17,24,39,0.74), rgba(17,24,39,0.2));
  border-color: rgba(129,140,248,0.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

[data-theme="dark"] .loading-skeleton span {
  background: linear-gradient(90deg, rgba(51,65,85,0.65), rgba(129,140,248,0.18), rgba(51,65,85,0.65));
  background-size: 200% 100%;
}

[data-theme="dark"] .pin-btn {
  background: rgba(17,24,39,0.86);
}

[data-theme="dark"] .template-strip,
[data-theme="dark"] .kanban-column,
[data-theme="dark"] .kanban-card,
[data-theme="dark"] .duplicate-item {
  background: linear-gradient(180deg, rgba(17,24,39,0.98), rgba(24,34,53,0.92));
}

[data-theme="dark"] .kanban-column-header,
[data-theme="dark"] .duplicate-group-title {
  background: rgba(24,34,53,0.78);
}

[data-theme="dark"] .kanban-stage-select {
  background: rgba(15,23,42,0.72);
  color: var(--text-2);
}

[data-theme="dark"] .timeline-plan-group,
[data-theme="dark"] .ai-suggestion-card,
[data-theme="dark"] .digest-card,
[data-theme="dark"] .compare-result-card,
[data-theme="dark"] .rewrite-box {
  background: rgba(17,24,39,0.82);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-lower { grid-template-columns: 1fr; }
  .dash-col-sm { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { display: none; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .insights-grid { grid-template-columns: 1fr; }
  .insight-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row-2 { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .idea-modal-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Sidebar: slide in/out on mobile */
  #sidebar {
    transform: translateX(-100%);
    width: min(288px, 88vw);
    max-width: calc(100vw - 24px);
    height: 100vh;
    height: 100dvh;
    bottom: auto;
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #main-area {
    margin-left: 0;
  }
  .hamburger { display: flex; }
  .sidebar-close { display: flex; }
  .sidebar-brand { padding: 18px 18px 14px; }
  .sidebar-user-info { padding: 14px 18px; }
  .sidebar-nav { padding: 12px 0 6px; }
  .nav-link {
    min-height: 46px;
    margin: 2px 10px;
    padding: 11px 14px;
  }
  .sidebar-bottom {
    margin-top: 12px;
    padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  }
  .sidebar-theme-toggle,
  .btn-logout {
    min-height: 42px;
  }

  /* Landing */
  .landing-nav { padding: 16px 20px; }
  .hero { padding: 40px 20px; }
  .hero-title { font-size: 32px; }
  #page-home .hero {
    min-height: auto;
    padding: 56px 20px 64px;
  }
  #page-home .hero-title {
    font-size: clamp(38px, 12vw, 58px);
  }
  #page-home .hero-subtitle {
    font-size: 16px;
  }
  #page-home .hero-buttons {
    gap: 12px;
  }
  #page-home .hero-buttons .btn-large {
    width: 100%;
    justify-content: center;
  }
  #page-home .hero-trust {
    gap: 10px 16px;
  }
  .hero-buttons { flex-direction: column; }
  .features-section { padding: 48px 20px; }
  #page-home .features-section { padding: 64px 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .landing-footer { padding: 24px 20px; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }

  /* Auth */
  .auth-layout { grid-template-columns: 1fr; }
  .auth-right { display: none; }
  .auth-left { padding: 32px 24px; min-height: 100vh; }

  /* App */
  #topbar { padding: 0 16px; }
  #content-area { padding: 16px; }
  .page-welcome { flex-direction: column; align-items: flex-start; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-col-sm { grid-template-columns: 1fr; }
  .dashboard-lower { grid-template-columns: 1fr; }
  .ideas-grid { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .form-card { padding: 20px; }
  .ideas-toolbar { gap: 10px; }
  .toolbar-filters { flex-direction: column; }
  .filter-select { min-width: unset; width: 100%; }
  .template-strip { grid-template-columns: 1fr; }
  .idea-tools-row { align-items: stretch; }
  .idea-utility-actions,
  .view-toggle { width: 100%; }
  .idea-utility-actions .btn-secondary,
  .view-btn { flex: 1; justify-content: center; }
  .kanban-board {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }
  .timeline-plan,
  .ai-suggestion-grid,
  .digest-grid,
  .compare-controls {
    grid-template-columns: 1fr;
  }
  .settings-grid { grid-template-columns: 1fr; }
  .idea-modal-grid { grid-template-columns: 1fr; }
  .idea-modal-actions { flex-direction: column; }
  .idea-modal-actions button { width: 100%; justify-content: center; }
  .insights-grid { grid-template-columns: 1fr; }
  .insight-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-title { font-size: 15px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .new-idea-btn { display: none; }
  .topbar-plan-btn { padding: 7px 10px; }
  .idea-limit-notice,
  .plan-nudge,
  .locked-feature {
    align-items: stretch;
    flex-direction: column;
  }
  .plan-nudge .btn-primary,
  .idea-limit-notice .btn-outline,
  .locked-feature .btn-primary {
    width: 100%;
    justify-content: center;
  }
  .pricing-modal { padding: 22px; }
  .pricing-hero h2 { font-size: 24px; }
  .subscription-current,
  .danger-action {
    flex-direction: column;
  }
  .subscription-meter { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 22px; }
  .hero-title { font-size: 28px; }
  #page-home .hero-title { font-size: clamp(34px, 13vw, 48px); }
  .landing-nav-links { gap: 8px; }
  .landing-nav .btn-primary,
  .landing-nav .btn-ghost {
    padding: 9px 12px;
    font-size: 13px;
  }
  .logo-text { font-size: 18px; }
  .form-card { padding: 16px; }
  .insight-summary-grid { grid-template-columns: 1fr 1fr; }
  .dash-col-sm { grid-template-columns: 1fr; }
  .idea-list-item,
  .journal-idea-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .il-actions,
  .il-badges {
    width: 100%;
    justify-content: flex-start;
  }
}
