/* ============================================================
   DONEFLOW — Main Stylesheet v2
   Lighter dark theme with strong contrast + new task UX
   ============================================================ */

:root {
  --bg:        #f0f4f0;
  --bg-card:   #ffffff;
  --bg-alt:    #e8ede8;
  --bg-input:  #f7faf7;
  --bg-hover:  #f0f7f0;

  --border:       #d4e0d4;
  --border-hover: #b0c8b0;
  --border-focus: #22c55e;

  --text-primary:   #111a11;
  --text-secondary: #76bb76;
  --text-muted:     #76bb76;

  --done:         #16a34a;
  --done-dim:     #dcfce7;
  --done-bright:  #22c55e;
  --progress:     #ea580c;
  --progress-dim: #ffedd5;
  --wait:         #dc2626;
  --wait-dim:     #fee2e2;

  --accent:       #16a34a;
  --accent-hover: #15803d;
  --accent-glow:  rgba(22,163,74,0.15);
  --highlight:    #16a34a;

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --radius:    8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --transition: 140ms ease;

  --shadow-card: 0 1px 8px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-lg:   0 8px 48px rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--font-body); }
[x-cloak] { display: none !important; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(17,24,39,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  height: 70px; display: flex; align-items: center; justify-content: space-between;
}
.logo { font-family: var(--font-display); font-size: 21px; font-weight: 800; letter-spacing: -0.5px; }
.logo-done { color: var(--done); }
.logo-flow { color: var(--text-secondary); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 14px; color: var(--text-secondary); padding: 7px 12px;
  border-radius: var(--radius); transition: color var(--transition), background var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); background: var(--bg-card); }
.nav-link.muted { color: var(--text-muted); font-size: 13px; }

.nav-btn-ghost {
  display: flex; align-items: center; gap: 6px; font-size: 14px;
  color: var(--text-secondary); padding: 7px 12px; border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}
.nav-btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--border-hover); display: flex; align-items: center;
  justify-content: center; background: var(--bg-card); margin-left: 6px;
}
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials { font-size: 12px; font-weight: 700; color: var(--done); font-family: var(--font-display); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--done); color: #052e16; font-weight: 700; font-size: 14px;
  padding: 10px 20px; border-radius: var(--radius);
  transition: background var(--transition), transform var(--transition);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary-sm {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--done); color: #052e16; font-weight: 700; font-size: 13px;
  padding: 7px 14px; border-radius: var(--radius); transition: background var(--transition);
}
.btn-primary-sm:hover { background: var(--accent-hover); }

.btn-ghost {
  font-size: 14px; color: var(--text-secondary); padding: 10px 16px;
  border-radius: var(--radius); border: 1px solid var(--border);
  transition: background var(--transition), color var(--transition);
}
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }

.btn-ghost-sm {
  font-size: 12px; color: var(--text-muted); padding: 5px 10px;
  border-radius: var(--radius); border: 1px solid var(--border);
  transition: background var(--transition), color var(--transition);
}
.btn-ghost-sm:hover:not(:disabled) { background: var(--bg-card); color: var(--text-secondary); }
.btn-ghost-sm:disabled { opacity: 0.4; cursor: default; }

.btn-ghost-lg {
  display: inline-flex; align-items: center; font-size: 15px;
  color: var(--text-secondary); padding: 12px 24px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); transition: background var(--transition), color var(--transition);
}
.btn-ghost-lg:hover { background: var(--bg-card); color: var(--text-primary); }

.btn-hero {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--done); color: #052e16; font-family: var(--font-display);
  font-weight: 700; font-size: 15px; padding: 14px 28px; border-radius: var(--radius-lg);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 0 32px rgba(34,197,94,0.25);
}
.btn-hero:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 4px 40px rgba(34,197,94,0.4); }

.btn-add {
  display: flex; align-items: center; gap: 6px;
  background: var(--done); color: #052e16; font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: var(--radius); transition: background var(--transition);
  white-space: nowrap;
}
.btn-add:hover { background: var(--accent-hover); }
.btn-add:disabled { opacity: 0.35; cursor: not-allowed; }

/* ============================================================
   STATUS DOTS
   ============================================================ */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-done { background: var(--done); }
.dot-progress { background: var(--progress); }
.dot-wait { background: var(--wait); }

/* ============================================================
   MAIN / FOOTER
   ============================================================ */
.site-main { flex: 1; }
.site-footer { border-top: 1px solid var(--border); padding: 20px 24px; }
.footer-inner {
  max-width: 1280px; margin: 0 auto; display: flex;
  align-items: center; gap: 16px; flex-wrap: wrap;
}
.footer-copy { font-size: 13px; color: var(--text-muted); }
.footer-links { display: flex; gap: 16px; margin-left: auto; }
.footer-links a { font-size: 13px; color: var(--text-muted); }
.footer-links a:hover { color: var(--text-secondary); }
.logo-sm { font-family: var(--font-display); font-size: 15px; font-weight: 700; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.hero {
  max-width: 1280px; margin: 0 auto; padding: 80px 24px 60px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 48px; padding: 48px 20px 40px; } }

.hero-badge {
  display: inline-flex; align-items: center; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--done); background: var(--done-dim); padding: 4px 12px;
  border-radius: 20px; border: 1px solid rgba(34,197,94,0.3); margin-bottom: 24px;
}
.hero-title {
  font-family: var(--font-display); font-size: clamp(40px,5.5vw,68px);
  font-weight: 800; line-height: 1.05; letter-spacing: -2px;
  color: var(--text-primary); margin-bottom: 20px;
}
.accent-done { color: var(--done); }
.hero-sub { font-size: 17px; line-height: 1.7; color: var(--text-secondary); max-width: 480px; margin-bottom: 36px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-demo { display: flex; justify-content: center; }
.demo-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 24px; width: 100%; max-width: 380px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(34,197,94,0.08);
}
.demo-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.demo-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.demo-streak { font-size: 13px; color: var(--text-secondary); }
.demo-tasks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.demo-task { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius); font-size: 13px; }
.demo-task.done { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.2); }
.demo-task.progress { background: rgba(249,115,22,0.12); border: 1px solid rgba(249,115,22,0.2); }
.demo-task.wait { background: rgba(248,113,113,0.10); border: 1px solid rgba(248,113,113,0.2); }
.demo-task span:nth-child(2) { flex: 1; color: var(--text-primary); }
.tag-done { font-size: 11px; color: var(--done); font-family: var(--font-mono); }
.tag-progress { font-size: 11px; color: var(--progress); font-family: var(--font-mono); }
.tag-wait { font-size: 11px; color: var(--wait); font-family: var(--font-mono); }
.demo-graph { display: grid; grid-template-columns: repeat(43,1fr); gap: 2px; border-radius: var(--radius); overflow: hidden; }
.demo-cell { height: 10px; border-radius: 1px; }

.section { padding: 80px 24px; }
.alt-bg { background: var(--bg-alt); }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-title { font-family: var(--font-display); font-size: clamp(28px,3.5vw,42px); font-weight: 700; letter-spacing: -1px; color: var(--text-primary); margin-bottom: 12px; }
.section-sub { font-size: 16px; color: var(--text-secondary); margin-bottom: 48px; }

.states-grid { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.state-card { flex: 1; min-width: 180px; padding: 28px 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.state-card h3 { font-family: var(--font-display); font-size: 18px; margin: 12px 0 6px; }
.state-card p { font-size: 13px; color: var(--text-secondary); }
.state-card.state-done { border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.06); }
.state-card.state-progress { border-color: rgba(249,115,22,0.4); background: rgba(249,115,22,0.06); }
.state-card.state-wait { border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.06); }
.state-dot { width: 12px; height: 12px; border-radius: 50%; }
.state-arrow { font-size: 24px; color: var(--text-muted); }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 20px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px 24px; transition: border-color var(--transition), transform var(--transition);
}
.feature-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.feature-icon { font-size: 22px; color: var(--done); margin-bottom: 12px; }
.feature-card h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.showcase-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 10px; }
.showcase-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: rgba(34,197,94,0.07); border: 1px solid rgba(34,197,94,0.15);
  border-radius: var(--radius); font-size: 13px; color: var(--text-secondary);
}

.blog-preview-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 16px; }
.blog-preview-card {
  display: flex; flex-direction: column; gap: 8px; padding: 24px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: border-color var(--transition), transform var(--transition);
}
.blog-preview-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.blog-preview-card h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--text-primary); }
.blog-preview-card p { font-size: 13px; color: var(--text-secondary); flex: 1; }
.read-more { font-size: 13px; color: var(--done); font-family: var(--font-mono); }

.cta-section { background: var(--bg-alt); text-align: center; }
.cta-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cta-title { font-family: var(--font-display); font-size: clamp(28px,3.5vw,48px); font-weight: 800; letter-spacing: -1px; }
.cta-sub { font-size: 16px; color: var(--text-secondary); }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard {
  display: grid; grid-template-columns: 160px 1fr 160px;
  max-width: 1280px; margin: 0 auto; padding: 28px 16px; gap: 24px;
}
@media (max-width: 1100px) { .dashboard { grid-template-columns: 1fr; } .sidebar-left,.sidebar-right { display: none; } }

.sidebar-left,.sidebar-right { display: flex; flex-direction: column; align-items: center; padding-top: 8px; }
.ad-slot { width: 100%; min-height: 200px; }
.dashboard-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Stats bar */
.stats-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 30px; padding: 7px 16px; font-size: 13px;
}
.accent-done-border { border-color: rgba(34,197,94,0.4); }
.stat-num { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text-primary); }
.stat-label { color: var(--text-muted); font-size: 12px; }
.done-color { color: var(--done); }

/* ============================================================
   DATE NAV + CALENDAR PICKER
   ============================================================ */
.date-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.date-nav-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-secondary); font-size: 20px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.date-nav-btn:hover:not(:disabled) { background: var(--bg-input); color: var(--text-primary); border-color: var(--border-hover); }
.date-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.date-display { display: flex; align-items: center; gap: 10px; }

.date-label-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 14px; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.date-label-btn:hover { border-color: var(--done); background: var(--bg-input); }
.date-label-btn svg { color: var(--text-muted); flex-shrink: 0; }
.date-label-text { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text-primary); }

.date-today-badge {
  font-size: 11px; font-family: var(--font-mono);
  background: rgba(34,197,94,0.15); color: var(--done);
  padding: 3px 9px; border-radius: 20px; border: 1px solid rgba(34,197,94,0.3);
}

/* Native date input hidden, triggered via button */
.date-picker-input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}

/* ============================================================
   TASK INPUT
   ============================================================ */
.task-input-wrap { display: flex; flex-direction: column; gap: 6px; }

.task-input-row { display: flex; gap: 10px; }
.task-input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary); font-size: 15px;
  padding: 11px 16px; outline: none; transition: border-color var(--transition);
}
.task-input:focus { border-color: var(--done); }
.task-input::placeholder { color: var(--text-muted); }
.task-input:disabled { opacity: 0.4; cursor: not-allowed; }

.past-notice {
  display: flex; align-items: center; gap: 8px;
  background: rgba(249,115,22,0.08); border: 1px solid rgba(249,115,22,0.25);
  border-radius: var(--radius); padding: 9px 14px;
  font-size: 13px; color: var(--progress);
}

/* ============================================================
   TASK SECTIONS
   ============================================================ */
.tasks-section { display: flex; flex-direction: column; gap: 6px; }

.section-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  font-family: var(--font-mono); color: var(--text-muted); margin-bottom: 4px;
}
.section-label-done { color: var(--done); }
.section-label-progress { color: var(--progress); }
.section-label-wait { color: var(--wait); }

.task-count {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; font-size: 10px; padding: 1px 7px; color: var(--text-muted);
}

.task-list { display: flex; flex-direction: column; gap: 5px; }

/* ---- TASK ROW ---- */
.task-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.task-row:hover { border-color: var(--border); }

.task-done     { background: rgba(34,197,94,0.06);   border-color: rgba(34,197,94,0.12); }
.task-in-progress { background: rgba(249,115,22,0.07); border-color: rgba(249,115,22,0.15); }
.task-wait     { background: rgba(248,113,113,0.05); border-color: rgba(248,113,113,0.10); }

.task-title {
  flex: 1; font-size: 15px; color: var(--text-primary);
  outline: none; border-radius: 3px; line-height: 1.4;
}
.task-title-done {
  color: var(--text-secondary);
}
.task-title[contenteditable="true"] {
  background: var(--bg-input); border: 1px solid var(--done);
  padding: 2px 8px; border-radius: var(--radius);
}

/* ---- 3-WAY STATUS TOGGLE ---- */
.status-toggle {
  display: inline-flex; align-items: center;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px; gap: 2px; flex-shrink: 0;
}

.status-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  flex: 1; min-width: 60px; padding: 4px 8px; border-radius: 14px; font-size: 11px;
  font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.03em;
  transition: background var(--transition), color var(--transition);
  color: var(--text-muted); white-space: nowrap;
}
.status-btn:hover { color: var(--text-secondary); background: var(--bg-card); }
.status-btn .sbdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.status-btn.active-wait   { background: rgba(248,113,113,0.18); color: var(--wait); }
.status-btn.active-progress { background: rgba(249,115,22,0.18); color: var(--progress); }
.status-btn.active-done   { background: rgba(34,197,94,0.18); color: var(--done); }

.task-delete {
  color: var(--text-muted); font-size: 18px; opacity: 0;
  transition: opacity var(--transition), color var(--transition);
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); flex-shrink: 0;
}
.task-row:hover .task-delete { opacity: 1; }
.task-delete:hover { color: var(--wait); background: rgba(248,113,113,0.15); }

/* Empty state */
.empty-state { text-align: center; padding: 52px 24px; color: var(--text-muted); }
.empty-icon { font-size: 36px; margin-bottom: 14px; }
.empty-sub { font-size: 13px; margin-top: 6px; }

/* ============================================================
   ACTIVITY GRAPH
   ============================================================ */
.graph-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  overflow: hidden;  /* curvy canvas */
}
.graph-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.graph-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.graph-container { position: relative; overflow-x: auto; overflow-y: visible; scrollbar-width: thin; scrollbar-color: var(--border-hover) transparent; padding-bottom: 6px; }
#graph-canvas { display: block; }
.graph-tooltip {
  position: absolute; background: var(--bg-card); border: 1px solid var(--border-hover);
  border-radius: var(--radius); padding: 6px 10px; font-size: 12px; color: var(--text-secondary);
  pointer-events: none; white-space: nowrap; z-index: 10; font-family: var(--font-mono);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.graph-legend { display: flex; align-items: center; gap: 6px; margin-top: 10px; justify-content: flex-end; }
.legend-label { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.legend-cells { display: flex; gap: 3px; }
.legend-cell { width: 12px; height: 12px; border-radius: 2px; }

/* Weekly summary */
.weekly-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.weekly-list { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.weekly-item {
  display: flex; gap: 16px; align-items: center; padding: 8px 12px;
  border-radius: var(--radius); border-left: 2px solid var(--done); font-size: 13px;
}
.weekly-date { color: var(--text-muted); font-family: var(--font-mono); min-width: 52px; font-size: 11px; }
.weekly-title { color: var(--text-secondary); flex: 1; }

.ad-bottom { display: flex; justify-content: center; padding: 16px; border-top: 1px solid var(--border); }

/* ============================================================
   CONTACT MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: var(--bg-card); border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl); padding: 28px; width: 100%; max-width: 460px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.modal-close {
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--bg-input); color: var(--text-primary); }

.form-group { margin-bottom: 16px; }
.form-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 8px;
}
.char-count { font-size: 11px; color: var(--text-muted); }
.char-count.warn { color: var(--progress); }

.form-select,.form-textarea {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary); font-size: 14px;
  padding: 10px 14px; outline: none; transition: border-color var(--transition);
}
.form-select:focus,.form-textarea:focus { border-color: var(--done); }
.form-select option { background: var(--bg-card); }
.form-textarea { resize: vertical; line-height: 1.6; }
.form-error { color: var(--wait); font-size: 13px; margin-bottom: 12px; }

.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.contact-success {
  text-align: center; padding: 24px; display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.success-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(34,197,94,0.12); border: 2px solid var(--done);
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--done);
}

.fab-contact {
  position: fixed; bottom: 28px; right: 28px; width: 48px; height: 48px;
  background: var(--done); color: #052e16; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(34,197,94,0.35); z-index: 90;
  transition: transform var(--transition), box-shadow var(--transition);
}
.fab-contact:hover { transform: scale(1.1); box-shadow: 0 8px 32px rgba(34,197,94,0.5); }

.overlay-enter { opacity: 0; }
.overlay-enter-active { opacity: 1; transition: opacity 200ms ease; }
.modal-slide-enter { opacity: 0; transform: translateY(20px); }
.modal-slide-active { opacity: 1; transform: translateY(0); transition: opacity 200ms ease, transform 200ms ease; }

/* Clickable stat pill variant */
.stat-pill-btn {
  cursor: pointer; border: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  background: var(--bg-card);
}
.stat-pill-btn:hover {
  border-color: var(--done); background: var(--bg-hover);
  transform: translateY(-1px);
}
.stat-pill-btn:active { transform: translateY(0); }

/* Tasks popup */
.tasks-popup-overlay { z-index: 200; }
.tasks-popup-box { max-width: 520px; max-height: 80vh; display: flex; flex-direction: column; }

.popup-loading {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 40px 0; color: var(--text-muted); font-size: 14px;
}
.popup-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--done);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.popup-empty {
  text-align: center; padding: 40px 24px;
  color: var(--text-muted); display: flex; flex-direction: column;
  align-items: center; gap: 10px;
}

.popup-task-list {
  overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  max-height: calc(80vh - 100px);
  scrollbar-width: thin; scrollbar-color: var(--border-hover) transparent;
}

.popup-task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  background: rgba(34,197,94,0.05); border: 1px solid rgba(34,197,94,0.12);
  font-size: 14px;
}
.popup-task-check {
  color: var(--done); font-size: 12px; flex-shrink: 0;
}
.popup-task-title {
  flex: 1; color: var(--text-secondary); line-height: 1.4;
}
.popup-task-date {
  color: var(--text-muted); font-family: var(--font-mono);
  font-size: 11px; flex-shrink: 0; white-space: nowrap;
}


.page-inner { max-width: 900px; margin: 0 auto; padding: 48px 24px; }
.page-inner.narrow { max-width: 680px; }
.page-header { margin-bottom: 48px; }
.page-title { font-family: var(--font-display); font-size: clamp(32px,4vw,52px); font-weight: 800; letter-spacing: -1.5px; margin-bottom: 10px; }
.page-sub { font-size: 16px; color: var(--text-secondary); }

.blog-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 20px; }
.blog-card {
  display: flex; flex-direction: column; gap: 10px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px;
  transition: border-color var(--transition), transform var(--transition);
}
.blog-card:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.blog-card-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.blog-card-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.5px; color: var(--text-primary); }
.blog-card-excerpt { font-size: 14px; color: var(--text-secondary); flex: 1; line-height: 1.6; }

.blog-post-meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.blog-post-title { font-family: var(--font-display); font-size: clamp(28px,4vw,48px); font-weight: 800; letter-spacing: -1.5px; margin-bottom: 36px; line-height: 1.1; }
.blog-post-content { font-size: 16px; color: var(--text-secondary); line-height: 1.8; }
.blog-post-content p { margin-bottom: 20px; }

.related-posts { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.related-grid { display: flex; flex-direction: column; gap: 8px; }
.related-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; color: var(--text-secondary);
  transition: border-color var(--transition), color var(--transition);
}
.related-card:hover { border-color: var(--done); color: var(--text-primary); }

.blog-cta-box {
  margin-top: 56px; padding: 32px; background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.2); border-radius: var(--radius-xl);
  text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 16px; font-size: 16px; color: var(--text-secondary);
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ============================================================
   RESPONSIVE — Tablet (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

  /* Dashboard single column */
  .dashboard { grid-template-columns: 1fr; padding: 16px 12px; gap: 16px; }
  .sidebar-left, .sidebar-right { display: none; }

  /* Nav */
  .nav-inner { padding: 0 16px; }
  .nav-link:not(.active) { display: none; }
  .nav-btn-ghost span { display: none; }

  /* Stats bar: 2-column grid */
  .stats-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-pill { justify-content: center; border-radius: var(--radius); padding: 10px 8px; overflow: hidden; min-width: 0; }
  .stat-pill:last-child { grid-column: 1 / -1; }
  .stat-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Date nav */
  .date-nav { gap: 8px; flex-wrap: nowrap; }
  .date-display { min-width: 0; flex: 1; }
  .date-label-btn { padding: 6px 10px; min-width: 0; width: 100%; }
  .date-label-text { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Task input */
  .task-input-row { gap: 8px; }
  .btn-add { padding: 11px 14px; }

  /* Task rows: stack title above toggle on mobile */
  .task-row { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .task-title { width: 100%; font-size: 14px; flex: none; order: 1; min-width: 0; }
  .status-toggle { order: 2; flex: 1; }
  .task-delete { order: 3; opacity: 1; }

  /* Status toggle */
  .status-btn { padding: 4px 8px; font-size: 10px; gap: 4px; }
  .status-btn .sbdot { width: 6px; height: 6px; }

  /* Graph: horizontal scroll */
  .graph-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #graph-canvas { min-width: 600px; }
  .graph-section { padding: 16px 12px; }

  /* Weekly */
  .weekly-section { padding: 16px 12px; }
  .weekly-item { flex-direction: column; gap: 2px; padding: 8px 10px; }
  .weekly-date { min-width: unset; }

  /* Landing */
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 40px 16px 32px; }
  .hero-title { font-size: 36px; letter-spacing: -1px; }
  .hero-sub { font-size: 15px; }
  .hero-cta { flex-direction: column; }
  .btn-hero, .btn-ghost-lg { width: 100%; justify-content: center; }
  .section { padding: 48px 16px; }
  .section-title { font-size: 26px; }
  .states-grid { flex-direction: column; }
  .state-arrow { transform: rotate(90deg); align-self: center; }
  .features-grid { grid-template-columns: 1fr; }
  .showcase-grid { grid-template-columns: 1fr; }
  .blog-preview-grid { grid-template-columns: 1fr; }

  /* FAB */
  .fab-contact { bottom: 20px; right: 16px; }

  /* Page */
  .page-inner { padding: 32px 16px; }
  .page-title { font-size: 28px; }
  .blog-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {

  .stats-bar { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 14px; }
  .stat-label { font-size: 11px; }

  /* Hide status labels, show dots only */
  .status-text { display: none; }
  .status-btn { padding: 5px 8px; }

  .date-label-text { font-size: 13px; }
  .task-title { font-size: 13px; }

  .graph-header { flex-wrap: wrap; gap: 8px; }

  /* Modal slides up from bottom on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-width: 100%;
    border-left: none;
    border-right: none;
  }

  .hero-title { font-size: 30px; }
  .hero-badge { font-size: 10px; }
}
/* ============================================================
   AI INSIGHTS & BILLING — New Component Styles
   ============================================================ */

/* Hero additions */
.hero-disclaimer { font-size: 12px; color: var(--text-muted); margin-top: 12px; font-family: var(--font-mono); }

.demo-insight-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
}
.demo-insight-logo { font-family: var(--font-display); font-size: 14px; font-weight: 800; color: var(--done); margin-bottom: 10px; }
.demo-insight-text { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 10px; }
.demo-insight-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.demo-insight-stat { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.demo-share-icons { margin-left: auto; display: flex; gap: 6px; font-size: 12px; color: var(--text-muted); font-weight: 700; }

/* Steps grid */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 40px; }
.step-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.step-num { font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--done); opacity: 0.3; margin-bottom: 12px; line-height: 1; }
.step-card h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.step-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* Live board on landing */
.live-board-section { background: var(--bg-alt); }
.live-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 32px; }
.live-board-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.live-board-avatar { font-family: var(--font-mono); font-size: 11px; background: var(--done-dim); color: var(--done); padding: 3px 10px; border-radius: 20px; display: inline-block; margin-bottom: 10px; }
.live-board-text { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 10px; }
.live-board-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }

/* Landing pricing cards */
.cta-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 680px; margin: 40px auto 0; }
@media (max-width: 600px) { .cta-plan-grid { grid-template-columns: 1fr; } }
.plan-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 32px; position: relative; }
.plan-card-pro { border-color: var(--done); box-shadow: 0 0 0 1px var(--done), 0 8px 32px rgba(22,163,74,0.1); }
.plan-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--done); color: #fff; font-size: 11px; font-family: var(--font-mono); padding: 3px 12px; border-radius: 20px; white-space: nowrap; }
.plan-name { font-family: var(--font-display); font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.plan-price { font-family: var(--font-display); font-size: 36px; font-weight: 800; color: var(--done); margin-bottom: 8px; }
.plan-price span { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.plan-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; font-size: 13px; color: var(--text-secondary); }
.plan-features li.muted { color: var(--text-muted); }

/* Full pricing page */
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 780px; margin: 48px auto; }
@media (max-width: 640px) { .pricing-grid { grid-template-columns: 1fr; } }

/* Interval toggle */
.interval-toggle { display: inline-flex; background: var(--bg-card); border: 1px solid var(--border); border-radius: 30px; padding: 4px; gap: 4px; margin: 24px auto; }
.interval-btn { padding: 7px 20px; border-radius: 24px; font-size: 13px; color: var(--text-muted); transition: background var(--transition), color var(--transition); }
.interval-btn.active { background: var(--done); color: #fff; }
.save-badge { background: rgba(22,163,74,0.15); color: var(--done); font-size: 10px; border-radius: 10px; padding: 1px 6px; font-family: var(--font-mono); margin-left: 4px; }

/* Billing status card */
.billing-status-card { max-width: 480px; margin: 48px auto; text-align: center; background: var(--bg-card); border: 2px solid var(--done); border-radius: var(--radius-xl); padding: 40px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pro-badge { background: var(--done); color: #fff; font-family: var(--font-mono); font-size: 12px; padding: 4px 14px; border-radius: 20px; }

/* FAQ */
.faq-section { max-width: 640px; margin: 64px auto 0; }
.faq-list { display: flex; flex-direction: column; gap: 20px; }
.faq-item { padding: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.faq-item strong { display: block; margin-bottom: 8px; font-family: var(--font-display); }
.faq-item p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* Dashboard AI insight bar */
.ai-insight-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: linear-gradient(135deg, rgba(22,163,74,0.08), rgba(22,163,74,0.03)); border: 1px solid rgba(22,163,74,0.25); border-radius: var(--radius-lg); }
.ai-insight-bar.free { background: var(--bg-card); border-color: var(--border); }
.btn-ai-insight { display: inline-flex; align-items: center; gap: 8px; background: var(--done); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 14px; padding: 9px 20px; border-radius: var(--radius); transition: background var(--transition), transform var(--transition); white-space: nowrap; }
.btn-ai-insight:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ai-insight-free { font-size: 13px; color: var(--text-secondary); }
.btn-ai-insight-free:hover { color: var(--done); }
.ai-insight-hint { font-size: 13px; color: var(--text-secondary); }

/* Insight generate bar */
.insight-generate-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }

/* Insight card */
.insight-card-wrap { margin-bottom: 36px; }
.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.insight-card-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.insight-logo { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--done); }
.insight-logo span { color: var(--text-muted); }
.insight-period-badge { font-family: var(--font-mono); font-size: 11px; background: var(--done-dim); color: var(--done); padding: 3px 10px; border-radius: 20px; border: 1px solid rgba(22,163,74,0.2); }
.insight-card-body { padding: 24px; }
.insight-content { font-size: 17px; line-height: 1.75; color: var(--text-primary); font-family: var(--font-body); }
.insight-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: var(--bg-alt); border-top: 1px solid var(--border); flex-wrap: wrap; gap: 12px; }
.insight-stats { display: flex; gap: 16px; font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); }

/* Share buttons */
.insight-actions { display: flex; gap: 8px; }
.share-btn { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; transition: transform var(--transition), opacity var(--transition); cursor: pointer; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); }
.share-btn:hover { transform: scale(1.1); }
.share-li  { background: #0077b5; color: #fff; border-color: #0077b5; }
.share-ig  { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; border: none; }
.share-x   { background: #000; color: #fff; border-color: #000; }
.share-pub-on  { background: var(--done); color: #fff; border-color: var(--done); }
.share-pub-off { }

/* Insight period chips */
.insight-period-chip { font-size: 10px; font-family: var(--font-mono); padding: 2px 8px; border-radius: 20px; background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border); }
.insight-period-chip.daily  { background: rgba(22,163,74,0.1); color: var(--done); }
.insight-period-chip.weekly { background: rgba(99,102,241,0.1); color: #6366f1; }

/* Insight history */
.insight-history { margin-top: 24px; }
.insight-history-list { display: flex; flex-direction: column; gap: 10px; }
.insight-history-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; cursor: pointer; transition: border-color var(--transition); }
.insight-history-item:hover { border-color: var(--border-hover); }
.insight-history-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.insight-history-meta { display: flex; align-items: center; gap: 8px; }
.insight-history-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.insight-history-stats { display: flex; gap: 10px; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.insight-headline { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.insight-full { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* Public board */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 40px; }
.board-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: border-color var(--transition); }
.board-card:hover { border-color: var(--border-hover); }
.board-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.board-avatar { font-family: var(--font-mono); font-size: 11px; background: var(--done-dim); color: var(--done); padding: 3px 10px; border-radius: 20px; border: 1px solid rgba(22,163,74,0.2); }
.board-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.board-headline { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.board-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }

/* Error message */
.error-msg { color: var(--wait); font-size: 13px; }

/* ============================================================
   PRO DASHBOARD LAYOUT
   ============================================================ */
.pro-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 860px) 300px;
  height: calc(100vh - 58px);
  overflow: hidden;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Panels */
.pro-panel {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px);
  overflow-y: auto;
  position: sticky;
  top: 58px;
}
.pro-panel-left  { border-right: 1px solid var(--border); border-radius: 20px; margin: 10px 10px 10px;}
.pro-panel-right { border-left:  1px solid var(--border); border-radius: 20px; margin: 10px 10px 10px;}

.pro-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg-card); z-index: 2;
}
.pro-panel-title {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
}
.panel-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pro-panel-sub { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.pro-panel-link {
  display: block; padding: 10px 14px;
  font-size: 12px; color: var(--done); font-family: var(--font-mono);
  border-top: 1px solid var(--border); margin-top: auto;
}
.pro-panel-link:hover { background: var(--bg-hover); }

/* Center column */
.pro-center {
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto;
  height: calc(100vh - 58px);
}

/* Board feed */
.board-feed { display: flex; flex-direction: column; flex: 1; overflow-y: auto; }
.board-feed-card {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.board-feed-card:hover { background: var(--bg-hover); }
.board-feed-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.board-feed-avatar { font-family: var(--font-mono); font-size: 10px; background: var(--done-dim); color: var(--done); padding: 2px 8px; border-radius: 20px; border: 1px solid rgba(22,163,74,0.2); }
.board-feed-period { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.board-feed-headline { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 5px; }
.board-feed-stats { display: flex; gap: 8px; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.board-feed-empty { padding: 28px 14px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Digest toggle (panel header) */
.digest-toggle-sm { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 2px; gap: 2px; }
.digest-btn-sm { padding: 3px 9px; border-radius: 14px; font-size: 11px; color: var(--text-muted); transition: background var(--transition), color var(--transition); }
.digest-btn-sm.active { background: var(--done); color: #fff; }

/* Generate button */
.btn-generate-insight {
  margin: 12px 14px 4px;
  display: flex; align-items: center; justify-content: center;
  width: calc(100% - 28px);
  background: var(--done); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  padding: 9px 14px; border-radius: var(--radius);
  transition: background var(--transition);
}
.btn-generate-insight:hover:not(:disabled) { background: var(--accent-hover); }
.btn-generate-insight:disabled { opacity: 0.5; cursor: not-allowed; }

/* Insight panel card */
.insight-panel-card {
  margin: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.ipc-logo { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--done); padding: 12px 12px 3px; }
.ipc-logo span { color: var(--text-muted); }
.ipc-badge { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); padding: 0 12px 10px; }
.ipc-content { font-size: 13px; line-height: 1.7; color: var(--text-primary); padding: 0 12px 10px; }
.ipc-stats { display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); padding: 8px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ipc-share { display: flex; align-items: center; gap: 5px; padding: 8px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ipc-share-label { font-size: 11px; color: var(--text-muted); margin-right: 2px; }
.ipc-share-btn {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; cursor: pointer;
  transition: transform var(--transition); border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-secondary);
}
.ipc-share-btn:hover { transform: scale(1.15); }
.ipc-x   { background: #000; color: #fff; border-color: #000; }
.ipc-fb  { background: #1877f2; color: #fff; border-color: #1877f2; }
.ipc-ig  { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; border: none; }
.active-pub { background: var(--done) !important; color: #fff !important; border-color: var(--done) !important; }

/* Insight history */
.insight-panel-history { padding: 0 14px 14px; }
.iph-title { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; padding: 12px 0 6px; }
.iph-item {
  padding: 10px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 7px; cursor: pointer;
  transition: border-color var(--transition);
}
.iph-item:hover { border-color: var(--border-hover); }
.iph-meta { display: flex; gap: 7px; align-items: center; margin-bottom: 5px; }
.iph-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.iph-period { font-family: var(--font-mono); font-size: 10px; background: var(--bg-card); color: var(--text-muted); padding: 1px 6px; border-radius: 10px; border: 1px solid var(--border); }
.iph-headline { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.insight-panel-empty { padding: 28px 14px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Share popup */
.share-popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.share-popup-box {
  background: var(--bg-card); border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl); padding: 24px; width: 100%; max-width: 500px;
  position: relative; box-shadow: 0 32px 80px rgba(0,0,0,0.4);
}
.share-popup-close {
  position: absolute; top: 12px; right: 14px; font-size: 22px;
  color: var(--text-muted); cursor: pointer; line-height: 1;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
}
.share-popup-close:hover { background: var(--bg-input); color: var(--text-primary); }

.share-card {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 16px; margin-top: 16px;
  background: #f0f4f0;
}
.sc-bar-top, .sc-bar-bottom { height: 8px; background: #16a34a; }
.sc-body { padding: 22px 26px; }
.sc-logo { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; color: #16a34a; margin-bottom: 3px; }
.sc-logo span { color: #7a9a7a; }
.sc-badge { font-family: 'DM Mono', monospace; font-size: 11px; color: #7a9a7a; margin-bottom: 14px; }
.sc-content { font-size: 15px; line-height: 1.7; color: #111a11; margin-bottom: 14px; }
.sc-stats { font-family: 'DM Mono', monospace; font-size: 12px; color: #3d5c3d; margin-bottom: 10px; }
.sc-url { font-family: 'DM Mono', monospace; font-size: 11px; color: #7a9a7a; }

.share-popup-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.5; }
.share-popup-actions { display: flex; justify-content: flex-end; }

/* Upgrade banner (free users) */
.upgrade-banner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(22,163,74,0.06));
  border: 1px solid rgba(99,102,241,0.2); border-radius: var(--radius-lg);
  font-size: 14px; color: var(--text-secondary);
}
.upgrade-banner-btn { font-size: 13px; font-weight: 700; color: var(--done); font-family: var(--font-display); white-space: nowrap; }
.upgrade-banner-btn:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 1100px) {
  .pro-layout { grid-template-columns: 200px 1fr 240px; }
}
@media (max-width: 860px) {
  .pro-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    overflow: visible;
  }
  /* Mobile order: center (tasks) first, then left panel, then right panel */
  .pro-center      { order: 1; height: auto; max-height: none; }
  .pro-panel-left  { order: 2; position: static; height: auto; max-height: 280px;
                     border-right: none; border-top: 1px solid var(--border); }
  .pro-panel-right { order: 3; position: static; height: auto; max-height: none;
                     border-left: none; border-top: 1px solid var(--border); }
}

/* Activity graph: scale properly on all screen sizes */
.graph-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#graph-canvas    { display: block; min-width: 480px; }

/* ─── Done-tasks period popup ─── */
.done-popup-box {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  width: min(520px, 92vw);
}
.done-popup-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.done-popup-loading {
  color: var(--text-muted);
  font-size: 14px;
  padding: 12px 0;
}
.done-popup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.done-popup-date-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
}
.done-popup-date-header:first-child {
  border-top: none;
  padding-top: 0;
}
.done-popup-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  color: var(--text);
}
.done-popup-check {
  color: #22c55e;
  font-size: 12px;
  flex-shrink: 0;
}
.done-popup-task-title {
  line-height: 1.4;
}
.done-popup-empty {
  color: var(--text-muted);
  font-size: 14px;
  margin: 16px 0 0;
}
.stat-label-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  opacity: .8;
  transition: opacity .15s;
}
.stat-label-btn:hover { opacity: 1; color: var(--done); }