/* ── RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: #0e0e12;
  color: #e8e6f0;
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
h1 { font-family: 'Syne', sans-serif; font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-family: 'Syne', sans-serif; font-size: 1.4rem; font-weight: 600; }
h3 { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 600; }
.hidden { display: none !important; }

/* ── AUTH SCREEN ─────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #0a0a0f;
}
.auth-bg { position: absolute; inset: 0; pointer-events: none; }
.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}
.auth-blob.b1 { width: 500px; height: 500px; background: #7c5cfc; top: -100px; left: -100px; }
.auth-blob.b2 { width: 400px; height: 400px; background: #fc5c7d; bottom: -80px; right: -80px; }
.auth-blob.b3 { width: 300px; height: 300px; background: #5ceafc; top: 40%; left: 50%; transform: translate(-50%,-50%); }
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #7c5cfc, #fc5c7d);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1.3rem; color: white;
}
.brand-mark.sm { width: 30px; height: 30px; font-size: 1rem; border-radius: 8px; }
.brand-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}
.brand-name.sm { font-size: 1.1rem; }
.brand-dot { color: #7c5cfc; }
.auth-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  backdrop-filter: blur(20px);
}
.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1;
  padding: 0.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  transition: all 0.2s;
}
.auth-tab.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1rem; }
.form-group label { font-size: 0.8rem; color: rgba(255,255,255,0.5); font-weight: 500; letter-spacing: 0.02em; }
.form-group input, .form-group textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: #7c5cfc;
  background: rgba(124,92,252,0.08);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.auth-divider {
  text-align: center;
  position: relative;
  margin: 1rem 0;
  color: rgba(255,255,255,0.25);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: rgba(255,255,255,0.1);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.social-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.btn-social {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 0.6rem;
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-social:hover { background: rgba(255,255,255,0.1); color: #fff; }
.auth-note { font-size: 0.78rem; color: rgba(255,255,255,0.35); text-align: center; margin-top: 0.75rem; }
.auth-footer { font-size: 0.8rem; color: rgba(255,255,255,0.3); }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, #7c5cfc, #9b7bfd);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.sm { padding: 0.45rem 0.9rem; font-size: 0.8rem; border-radius: 8px; }
.btn-primary.full-width { width: 100%; }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-secondary.full-width { width: 100%; }
.btn-ghost {
  color: rgba(255,255,255,0.45);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
}
.btn-ghost:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.05); }
.btn-ghost.sm { font-size: 0.78rem; }
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  transition: all 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.full-width { width: 100%; }
.mt-sm { margin-top: 0.75rem; }
.mt { margin-top: 1.5rem; }

/* ── APP SHELL ───────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: #13131a;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: width 0.3s ease, min-width 0.3s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: 60px; min-width: 60px; }
.sidebar.collapsed .brand-name.sm,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .usage-card,
.sidebar.collapsed .user-info,
.sidebar.collapsed .sidebar-toggle svg { display: none; }
.sidebar-header {
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-toggle {
  margin-left: auto;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: rgba(255,255,255,0.35);
  transition: all 0.2s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  padding: 0.6rem 0.75rem 0.3rem;
  margin-top: 0.25rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.18s;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.nav-item.active { background: rgba(124,92,252,0.15); color: #a889ff; }
.nav-item.active svg { stroke: #a889ff; }
.nav-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #7c5cfc, #fc5c7d);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}
.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.usage-card {
  background: rgba(124,92,252,0.08);
  border: 1px solid rgba(124,92,252,0.2);
  border-radius: 12px;
  padding: 0.85rem;
}
.usage-label { font-size: 0.75rem; color: rgba(255,255,255,0.45); margin-bottom: 0.5rem; }
.usage-bar {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  height: 5px;
  margin-bottom: 0.4rem;
}
.usage-bar.lg { height: 8px; margin: 1rem 0; }
.usage-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c5cfc, #a889ff);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.usage-count { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin-bottom: 0.6rem; }
.usage-count span { color: #a889ff; font-weight: 600; }
.btn-upgrade {
  width: 100%;
  background: linear-gradient(135deg, #7c5cfc, #fc5c7d);
  color: #fff;
  padding: 0.45rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: opacity 0.2s;
}
.btn-upgrade:hover { opacity: 0.85; }
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.user-pill:hover { background: rgba(255,255,255,0.06); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c5cfc, #fc5c7d);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.user-name { font-size: 0.83rem; font-weight: 600; color: rgba(255,255,255,0.85); }
.user-plan { font-size: 0.72rem; color: rgba(255,255,255,0.35); }
.user-info { flex: 1; overflow: hidden; }

/* ── MAIN CONTENT ────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: #0e0e12;
}
.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* ── TOPBAR ──────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(14,14,18,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.breadcrumb {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  font-family: 'Syne', sans-serif;
}
.notif-btn { position: relative; }
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: #fc5c7d;
  border-radius: 50%;
  border: 1.5px solid #0e0e12;
}

/* ── PAGES ───────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }
.page-inner {
  padding: 1.75rem 2rem 3rem;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-subtitle { color: rgba(255,255,255,0.4); font-size: 0.9rem; margin-top: 0.3rem; }
.header-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* ── CARDS ───────────────────────────────────────────── */
.card {
  background: #16161f;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.card-title { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 0.95rem; margin-bottom: 1rem; }

/* ── STATS ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #16161f;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.4rem;
}
.stat-icon.purple { background: rgba(124,92,252,0.15); color: #a889ff; }
.stat-icon.blue { background: rgba(56,139,253,0.15); color: #79b8ff; }
.stat-icon.orange { background: rgba(252,140,92,0.15); color: #ffb389; }
.stat-icon.green { background: rgba(92,252,140,0.15); color: #7dffaa; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 1.7rem; font-weight: 700; color: #fff; }
.stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.4); }
.stat-change { font-size: 0.75rem; font-weight: 500; }
.stat-change.up { color: #7dffaa; }
.stat-change.down { color: #ff7d7d; }

/* ── DASHBOARD GRID ──────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.chart-card { overflow: hidden; }

/* ── CHART CONTAINER FIX — prevents infinite resize/sag ── */
.chart-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  flex-shrink: 0;
}
.chart-wrap canvas {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
}
.chart-wrap-sm {
  position: relative;
  width: 100%;
  height: 200px;
  flex-shrink: 0;
}
.chart-wrap-sm canvas {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
}
.chart-wrap-bar {
  position: relative;
  width: 100%;
  height: 160px;
  flex-shrink: 0;
}
.chart-wrap-bar canvas {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
}
.legend-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.legend-dot.purple { background: #7c5cfc; }
.legend-dot.blue { background: #388bfd; }
.legend-dot.orange { background: #fc8c5c; }

/* ── CONTENT LIST ────────────────────────────────────── */
.content-list { display: flex; flex-direction: column; }
.content-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 8px;
  padding-left: 8px;
}
.content-item:last-child { border-bottom: none; }
.content-item:hover { background: rgba(255,255,255,0.03); }
.ci-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.ci-icon.twitter { background: rgba(29,155,240,0.12); }
.ci-icon.linkedin { background: rgba(10,102,194,0.15); }
.ci-icon.email { background: rgba(252,92,125,0.12); }
.ci-icon.instagram { background: rgba(252,140,92,0.12); }
.ci-info { flex: 1; overflow: hidden; }
.ci-title { font-size: 0.875rem; font-weight: 500; color: rgba(255,255,255,0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-meta { font-size: 0.75rem; color: rgba(255,255,255,0.35); margin-top: 2px; }
.ci-score { font-size: 0.78rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.ci-score.high { background: rgba(125,255,170,0.1); color: #7dffaa; }
.ci-score.med { background: rgba(255,183,125,0.1); color: #ffb77d; }
.virality-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(124,92,252,0.15);
  color: #a889ff;
  white-space: nowrap;
}

/* ── QUICK ACTIONS ───────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.qa-card {
  background: #16161f;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.qa-card:hover { border-color: rgba(124,92,252,0.4); transform: translateY(-2px); background: rgba(124,92,252,0.06); }
.qa-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.qa-title { font-weight: 600; font-size: 0.9rem; color: rgba(255,255,255,0.85); margin-bottom: 0.25rem; }
.qa-desc { font-size: 0.78rem; color: rgba(255,255,255,0.35); }

/* ── GENERATE PAGE ───────────────────────────────────── */
.generate-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.input-panel { display: flex; flex-direction: column; gap: 1rem; }
.input-type-tabs {
  display: flex;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 1rem;
  gap: 2px;
}
.input-tab {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 0.45rem;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  transition: all 0.2s;
}
.input-tab.active { background: rgba(255,255,255,0.09); color: #fff; }
.input-section { display: none; }
.input-section.active { display: block; }
.content-textarea {
  width: 100%;
  min-height: 200px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0.85rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.content-textarea:focus { border-color: rgba(124,92,252,0.5); }
.textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
}
.url-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0 0.85rem;
  color: rgba(255,255,255,0.35);
}
.url-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 0.7rem 0;
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
}
.url-preview {
  margin-top: 0.75rem;
  background: rgba(124,92,252,0.08);
  border: 1px solid rgba(124,92,252,0.2);
  border-radius: 10px;
  padding: 0.85rem;
  font-size: 0.83rem;
  color: rgba(255,255,255,0.6);
}
.url-preview-title { font-weight: 600; color: rgba(255,255,255,0.85); margin-bottom: 4px; }
.tone-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.tone-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  transition: all 0.2s;
}
.tone-btn.active {
  background: rgba(124,92,252,0.2);
  border-color: rgba(124,92,252,0.5);
  color: #a889ff;
}
.tone-btn:hover:not(.active) { border-color: rgba(255,255,255,0.25); color: rgba(255,255,255,0.8); }
.tone-controls { display: flex; flex-direction: column; gap: 1rem; }
.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.control-row label { font-size: 0.8rem; color: rgba(255,255,255,0.5); white-space: nowrap; min-width: 120px; }
.segment-control {
  display: flex;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 2px;
}
.seg-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  transition: all 0.2s;
}
.seg-btn.active { background: rgba(255,255,255,0.1); color: #fff; }
input[type="range"] {
  -webkit-appearance: none;
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #7c5cfc;
  cursor: pointer;
}
.toggle {
  width: 40px; height: 22px;
  background: rgba(255,255,255,0.1);
  border-radius: 11px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  top: 3px; left: 3px;
  transition: all 0.2s;
}
.toggle.on { background: #7c5cfc; }
.toggle.on::after { left: 21px; background: #fff; }
.format-checks { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.format-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: all 0.2s;
}
.format-check:hover { border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.02); }
.format-check.checked { border-color: rgba(124,92,252,0.3); background: rgba(124,92,252,0.05); }
.format-check input[type="checkbox"] { display: none; }
.format-check-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}
.format-check-icon.twitter { background: rgba(29,155,240,0.15); color: #1d9bf0; }
.format-check-icon.linkedin { background: rgba(10,102,194,0.15); color: #5cb8ff; }
.format-check-icon.email { background: rgba(252,92,125,0.15); color: #fc5c7d; }
.format-check-icon.instagram { background: rgba(252,140,92,0.15); color: #fc8c5c; }
.format-check-icon.tiktok { background: rgba(105,201,208,0.15); color: #69c9d0; }
.format-check-icon.summary { background: rgba(125,255,170,0.1); color: #7dffaa; }
.fc-name { font-size: 0.83rem; font-weight: 600; color: rgba(255,255,255,0.8); }
.fc-desc { font-size: 0.73rem; color: rgba(255,255,255,0.35); }
.generate-btn {
  padding: 0.8rem !important;
  font-size: 0.9rem !important;
  border-radius: 12px !important;
}

/* ── OUTPUT PANEL ────────────────────────────────────── */
.output-panel {
  min-height: 400px;
}
.output-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  color: rgba(255,255,255,0.25);
  gap: 0.75rem;
  border: 2px dashed rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 3rem;
}
.empty-icon { font-size: 3rem; opacity: 0.5; }
.output-empty h3 { color: rgba(255,255,255,0.4); font-size: 1.1rem; }
.output-empty p { font-size: 0.85rem; max-width: 320px; line-height: 1.6; }
.output-results { display: flex; flex-direction: column; gap: 1.25rem; }
.output-block {
  background: #16161f;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  overflow: hidden;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.output-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
.ob-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'Syne', sans-serif;
}
.ob-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
}
.ob-badge.twitter { background: rgba(29,155,240,0.15); color: #1d9bf0; }
.ob-badge.linkedin { background: rgba(10,102,194,0.15); color: #5cb8ff; }
.ob-badge.email { background: rgba(252,92,125,0.15); color: #fc5c7d; }
.ob-badge.instagram { background: rgba(252,140,92,0.15); color: #fc8c5c; }
.ob-badge.tiktok { background: rgba(105,201,208,0.15); color: #69c9d0; }
.ob-badge.summary { background: rgba(125,255,170,0.1); color: #7dffaa; }
.ob-actions { display: flex; align-items: center; gap: 6px; }
.ob-action-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 0.35rem 0.7rem;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.2s;
}
.ob-action-btn:hover { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.05); }
.ob-action-btn.copied { color: #7dffaa; border-color: rgba(125,255,170,0.3); }
.output-block-body { padding: 1.25rem; }
.ob-content {
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  white-space: pre-wrap;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}
.ob-content:focus {
  color: rgba(255,255,255,0.9);
}
.ob-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.ob-meta-item { font-size: 0.75rem; color: rgba(255,255,255,0.3); }
.ob-virality {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #a889ff;
  margin-left: auto;
}
.virality-score {
  display: flex;
  align-items: center;
  gap: 2px;
}
.vs-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #7c5cfc;
  opacity: 0.3;
}
.vs-dot.active { opacity: 1; }
.email-subjects { margin-bottom: 1rem; }
.email-subject-label { font-size: 0.75rem; color: rgba(255,255,255,0.35); margin-bottom: 0.4rem; font-weight: 500; }
.email-subject-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: all 0.15s;
}
.email-subject-item:hover { border-color: rgba(124,92,252,0.3); color: #fff; }
.loading-shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
  height: 16px;
  margin-bottom: 8px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── HISTORY ─────────────────────────────────────────── */
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0 0.85rem;
  color: rgba(255,255,255,0.35);
}
.search-wrap input {
  background: none; border: none; outline: none;
  padding: 0.55rem 0;
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
  width: 200px;
}
.filter-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.history-card {
  background: #16161f;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
}
.history-card:hover { border-color: rgba(124,92,252,0.3); transform: translateY(-2px); }
.hc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.hc-format-badge {
  font-size: 0.7rem; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
}
.hc-date { font-size: 0.72rem; color: rgba(255,255,255,0.3); }
.hc-title { font-size: 0.9rem; font-weight: 600; color: rgba(255,255,255,0.85); margin-bottom: 0.4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-preview { font-size: 0.8rem; color: rgba(255,255,255,0.35); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hc-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.85rem; }
.hc-actions { display: flex; gap: 6px; }
.hc-btn {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  transition: all 0.2s;
}
.hc-btn:hover { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.15); }

/* ── CALENDAR ────────────────────────────────────────── */
.calendar-wrap { background: #16161f; border: 1px solid rgba(255,255,255,0.07); border-radius: 16px; overflow: hidden; }
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.cal-title { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 1rem; }
.cal-nav { display: flex; gap: 8px; }
.cal-nav-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.cal-nav-btn:hover { border-color: rgba(255,255,255,0.2); color: #fff; }
.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.cal-day-name {
  padding: 0.6rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  min-height: 90px;
  padding: 0.5rem;
  border-right: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
  cursor: pointer;
}
.cal-cell:hover { background: rgba(255,255,255,0.02); }
.cal-cell.other-month .cal-date { color: rgba(255,255,255,0.15); }
.cal-cell.today .cal-date {
  background: #7c5cfc;
  color: #fff;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cal-date { font-size: 0.78rem; color: rgba(255,255,255,0.4); margin-bottom: 4px; font-weight: 500; }
.cal-event {
  font-size: 0.68rem;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-event.twitter { background: rgba(29,155,240,0.2); color: #1d9bf0; }
.cal-event.linkedin { background: rgba(10,102,194,0.2); color: #5cb8ff; }
.cal-event.email { background: rgba(252,92,125,0.2); color: #fc5c7d; }

/* ── TONE PROFILES ───────────────────────────────────── */
.tones-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.tone-card {
  background: #16161f;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 1.25rem;
  transition: all 0.25s;
  position: relative;
}
.tone-card:hover { border-color: rgba(124,92,252,0.3); transform: translateY(-1px); }

/* ── ACTIVE TONE CARD — glowing border + badge ────── */
.tone-card.active-tone {
  border-color: var(--tone-color, #7c5cfc) !important;
  box-shadow: 0 0 0 1px var(--tone-color, #7c5cfc),
              0 0 20px -4px var(--tone-color, #7c5cfc),
              0 4px 24px rgba(0,0,0,0.3);
  background: #1a1a28;
}
.tone-card.active-tone:hover { transform: translateY(-2px); }
.tone-active-badge {
  display: none;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(125,255,170,0.12);
  color: #7dffaa;
  border: 1px solid rgba(125,255,170,0.25);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tone-active-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #7dffaa;
  animation: activePulse 1.4s infinite;
}
@keyframes activePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}
.tone-card.active-tone .tone-active-badge { display: flex; }
.tone-card.active-tone .tone-apply-btn { display: none; }

.tone-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.75rem; }
.tone-card-name { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 0.95rem; color: #fff; }
.tone-card-type { font-size: 0.72rem; color: rgba(255,255,255,0.3); margin-top: 2px; }
.tone-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.tone-card-body { font-size: 0.8rem; color: rgba(255,255,255,0.4); line-height: 1.5; margin-bottom: 1rem; }
.tone-card-settings { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.85rem; }
.tone-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.08);
}
.tone-card-footer { display: flex; gap: 6px; align-items: center; }

/* ── ANALYTICS ───────────────────────────────────────── */
.analytics-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.tone-perf-item {
  display: flex; align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  gap: 0.75rem;
}
.tone-perf-item:last-child { border-bottom: none; }
.tpi-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tpi-name { flex: 1; font-size: 0.83rem; color: rgba(255,255,255,0.7); }
.tpi-score { font-size: 0.8rem; font-weight: 600; color: rgba(255,255,255,0.45); }
.tpi-bar-wrap { width: 80px; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; }
.tpi-bar { height: 100%; border-radius: 2px; }

/* ── SETTINGS ────────────────────────────────────────── */
.settings-layout { display: grid; grid-template-columns: 180px 1fr; gap: 1.5rem; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; }
.settings-tab {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  transition: all 0.2s;
}
.settings-tab.active { background: rgba(124,92,252,0.15); color: #a889ff; }
.settings-tab:hover:not(.active) { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7); }
.settings-content { display: flex; flex-direction: column; gap: 0; }
.settings-tab-content { display: none; }
.settings-tab-content.active { display: block; }
.settings-textarea {
  width: 100%;
  min-height: 80px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
  resize: vertical;
  outline: none;
}
.billing-hero { text-align: center; padding: 2rem; }
.plan-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}
.plan-badge.free { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
.plan-badge.pro { background: rgba(124,92,252,0.2); color: #a889ff; }
.plan-reset { color: rgba(255,255,255,0.35); font-size: 0.83rem; margin-bottom: 2rem; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; text-align: left; margin-top: 1.5rem; }
.plan-option {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  position: relative;
}
.plan-option.featured { border-color: rgba(124,92,252,0.4); background: rgba(124,92,252,0.06); }
.plan-popular {
  font-size: 0.68rem;
  font-weight: 700;
  color: #a889ff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.plan-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.1rem; color: #fff; }
.plan-price { font-family: 'Syne', sans-serif; font-size: 1.8rem; font-weight: 800; color: #fff; }
.plan-price span { font-size: 0.9rem; font-weight: 400; color: rgba(255,255,255,0.4); }
.plan-features { font-size: 0.78rem; color: rgba(255,255,255,0.4); line-height: 1.5; flex: 1; }
.integration-item {
  display: flex; align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  gap: 0.85rem;
}
.integration-item:last-child { border-bottom: none; }
.integration-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.integration-info { flex: 1; }
.integration-name { font-size: 0.875rem; font-weight: 600; color: rgba(255,255,255,0.8); }
.integration-desc { font-size: 0.75rem; color: rgba(255,255,255,0.35); }
.integration-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.integration-status.connected { background: rgba(125,255,170,0.1); color: #7dffaa; }
.integration-status.disconnected { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.3); }
.pref-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  gap: 1rem;
}
.pref-row:last-child { border-bottom: none; }
.pref-name { font-size: 0.875rem; font-weight: 500; color: rgba(255,255,255,0.8); }
.pref-desc { font-size: 0.75rem; color: rgba(255,255,255,0.3); margin-top: 2px; }

/* ── MODAL ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  backdrop-filter: blur(4px);
}
.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 101;
  background: #1a1a24;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 1.75rem;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal h3 { font-family: 'Syne', sans-serif; margin-bottom: 1.25rem; }
.modal-footer { display: flex; gap: 0.75rem; margin-top: 1.5rem; justify-content: flex-end; }

/* ── NOTIFICATIONS ───────────────────────────────────── */
.notif-panel {
  position: fixed;
  top: 56px; right: 1rem;
  width: 300px;
  background: #1a1a24;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  z-index: 50;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-weight: 600; font-size: 0.875rem;
}
.notif-header button { color: rgba(255,255,255,0.4); font-size: 1rem; }
.notif-list { padding: 0.5rem 0; }
.notif-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem 1rem;
  transition: background 0.15s;
  cursor: pointer;
}
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item.unread { background: rgba(124,92,252,0.05); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: #7c5cfc; margin-top: 4px; flex-shrink: 0; }
.notif-dot.read { background: rgba(255,255,255,0.15); }
.notif-title { font-size: 0.83rem; color: rgba(255,255,255,0.75); font-weight: 500; }
.notif-time { font-size: 0.72rem; color: rgba(255,255,255,0.3); margin-top: 2px; }

/* ── PROGRESS LOADER ─────────────────────────────────── */
.gen-progress {
  background: #16161f;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.gen-spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(124,92,252,0.15);
  border-top-color: #7c5cfc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-progress-text { font-size: 0.875rem; color: rgba(255,255,255,0.5); text-align: center; }
.gen-progress-steps { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.gen-step {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.25);
  transition: all 0.3s;
}
.gen-step.done { border-color: rgba(125,255,170,0.3); color: #7dffaa; background: rgba(125,255,170,0.06); }
.gen-step.active { border-color: rgba(124,92,252,0.4); color: #a889ff; background: rgba(124,92,252,0.08); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* ── TOAST ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #1a1a24;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.8);
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
}
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast-icon { font-size: 1rem; }

/* ── RESPONSIVE (tablet) ─────────────────────────────── */
@media (max-width: 900px) {
  .generate-layout { grid-template-columns: 1fr; }
  .dashboard-grid  { grid-template-columns: 1fr; }
  .plan-grid       { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════
   MOBILE OVERLAY — sits behind the drawer, dims content.
   Uses pointer-events so it NEVER blocks taps when closed.
   ══════════════════════════════════════════════════════ */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 300;
  backdrop-filter: blur(3px);
  /* Invisible AND non-interactive by default */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto; /* only capture taps when visible */
}

/* ══════════════════════════════════════════════════════
   MOBILE SLIDE-IN DRAWER
   Always rendered as flex so children display correctly,
   but shifted off-screen and pointer-events:none so it
   NEVER intercepts taps when closed.
   ══════════════════════════════════════════════════════ */
.mobile-drawer {
  position: fixed;
  top: 0; left: 0;
  width: 80%; max-width: 300px;
  height: 100%;
  background: #13131a;
  border-right: 1px solid rgba(255,255,255,0.07);
  z-index: 301;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* Off-screen + non-interactive by default */
  transform: translateX(-100%);
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1),
              visibility 0s linear 0.32s;
}
.mobile-drawer.open {
  transform: translateX(0);
  pointer-events: auto;
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1),
              visibility 0s linear 0s;
}
.mobile-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.mobile-drawer-close {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: rgba(255,255,255,0.45);
  transition: all 0.2s;
}
.mobile-drawer-close:hover { background: rgba(255,255,255,0.08); color: #fff; }
.mobile-drawer-nav {
  flex: 1;
  padding: 0.75rem 0.5rem;
  display: flex; flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.mobile-nav-section-label {
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  padding: 0.6rem 0.75rem 0.3rem;
  margin-top: 0.25rem;
}
.mobile-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  color: rgba(255,255,255,0.5);
  font-size: 0.95rem; font-weight: 500;
  transition: all 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item:active { background: rgba(255,255,255,0.08); }
.mobile-nav-item.active { background: rgba(124,92,252,0.15); color: #a889ff; }
.mobile-nav-item.active svg { stroke: #a889ff; }
.mobile-drawer-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; gap: 0.75rem;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   MOBILE BOTTOM NAV BAR
   Hidden on desktop via display:none.
   Shown only inside the ≤640px media query.
   pointer-events:auto is the default for visible elements
   so buttons are always tappable on mobile.
   ══════════════════════════════════════════════════════ */
.mobile-bottom-nav {
  display: none; /* overridden to flex inside media query */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(19,19,26,0.97);
  border-top: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.4rem 0.25rem calc(0.5rem + env(safe-area-inset-bottom));
  align-items: flex-end;
  justify-content: space-around;
}
.mob-nav-btn {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 0.35rem 0.5rem;
  border-radius: 12px;
  color: rgba(255,255,255,0.38);
  font-size: 0.63rem; font-weight: 500;
  min-width: 50px;
  cursor: pointer;
  /* Remove iOS tap delay and grey flash */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.2s;
}
.mob-nav-btn:active { opacity: 0.7; }
.mob-nav-btn.active { color: #a889ff; }
.mob-nav-btn.active svg { stroke: #a889ff; }

/* Centre Generate FAB above the bar */
.mob-nav-generate-fab {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, #7c5cfc, #fc5c7d);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(124,92,252,0.5);
  margin-top: -12px;
  margin-bottom: 2px;
  transition: transform 0.18s, box-shadow 0.18s;
}
.mob-nav-btn:active .mob-nav-generate-fab {
  transform: scale(0.94);
  box-shadow: 0 2px 8px rgba(124,92,252,0.4);
}
#mob-btn-generate { color: rgba(255,255,255,0.65); }
#mob-btn-generate.active { color: #fff; }
#mob-btn-generate svg { stroke: #fff; }

/* ══════════════════════════════════════════════════════
   MOBILE BREAKPOINT — everything below 640 px
   ══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Show the bottom nav */
  .mobile-bottom-nav { display: flex; }

  /* Core layout */
  .sidebar   { display: none; }
  .page-inner { padding: 1.25rem 1rem 6.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Allow the main content area to scroll normally */
  .app { overflow: hidden; height: 100vh; }
  .main-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: 100%;
  }

  /* Typography & layout tweaks */
  h1 { font-size: 1.4rem; }
  .topbar { padding: 0.6rem 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .page-header .btn-primary { width: 100%; justify-content: center; }
  .header-actions { width: 100%; flex-direction: column; gap: 0.5rem; }
  .header-actions .search-wrap { width: 100%; }
  .header-actions .search-wrap input { width: 100%; min-width: 0; }

  /* Notification panel & toast */
  .notif-panel { left: 0.75rem; right: 0.75rem; width: auto; top: 52px; }
  .toast { bottom: 5.5rem; left: 1rem; right: 1rem; width: auto; justify-content: center; }
}