/* ========== RESET & BASE ========== */
html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  background-image: radial-gradient(circle, rgba(0,0,0,0.055) 1px, transparent 1px);
  background-size: 22px 22px;
  min-height: 100dvh;
  overscroll-behavior: none;
}

/* soft decorative glows — tylko za treścią */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 100% 55% at 50% 20%, rgba(37,99,235,0.13) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 100% 55% at 50% 80%, rgba(124,58,237,0.10) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

/* ========== TOKENS — LIGHT ========== */
:root {
  --c-bg:      #ffffff;
  --c-bg2:     #f7f7f5;
  --c-bg3:     #f0efed;
  --c-border:  rgba(0,0,0,0.09);
  --c-border2: rgba(0,0,0,0.16);
  --c-text:    #111111;
  --c-text2:   #3d3d3d;
  --c-text3:   #737373;
  --c-accent:  #2563EB;
  --c-accent-bg: #2563EB;
  --c-accent-fg: #ffffff;
  --c-red:     #DC2626;
  --c-red-bg:  #FEF2F2;
  --c-green:   #16A34A;
  --c-green-bg:#F0FDF4;
  --c-blue:    #2563EB;
  --c-blue-bg: #EFF6FF;
  --c-purple:  #7C3AED;
  --c-purple-bg:#F5F3FF;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
  --shadow:    0 4px 16px rgba(0,0,0,0.09);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --glass-blur: blur(12px);
}

/* ========== TOKENS — DARK (system) ========== */
@media (prefers-color-scheme: dark) {
  :root {
    --c-bg:      #111111;
    --c-bg2:     #1c1c1e;
    --c-bg3:     #2c2c2e;
    --c-border:  rgba(255,255,255,0.1);
    --c-border2: rgba(255,255,255,0.18);
    --c-text:    #f0f0f0;
    --c-text2:   #aaaaaa;
    --c-text3:   #666666;
    --c-accent:  #3B82F6;
    --c-accent-bg: #3B82F6;
    --c-accent-fg: #ffffff;
    --c-red:     #F87171;
    --c-red-bg:  #2a1010;
    --c-green:   #4ADE80;
    --c-green-bg:#0B1F0F;
    --c-blue:    #60A5FA;
    --c-blue-bg: #0d1b2e;
    --c-purple:  #A78BFA;
    --c-purple-bg:#150E2A;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow:    0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  }
  body {
    background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  }
  body::before {
    background: radial-gradient(ellipse 100% 55% at 50% 20%, rgba(59,130,246,0.16) 0%, transparent 100%);
  }
  body::after {
    background: radial-gradient(ellipse 100% 55% at 50% 80%, rgba(167,139,250,0.12) 0%, transparent 100%);
  }
}

/* ========== LAYOUT ========== */
.app { max-width: 980px; margin: 0 auto; }

/* ========== TOPBAR ========== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  padding: 12px 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.topbar-left .t-date {
  font-size: 11px; color: var(--c-text3);
  letter-spacing: 0.07em; text-transform: uppercase; font-weight: 500;
}
.topbar-left h1 { font-size: 18px; font-weight: 600; color: var(--c-text); line-height: 1.3; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.streak-pill { display: none; }
.usage-pill {
  font-size: 11px; font-weight: 500; color: var(--c-text3);
  padding: 4px 12px;
  border: 1px solid var(--c-border);
  border-radius: 20px;
  background: var(--c-bg2);
  cursor: default;
}
.usage-pill.usage-warn {
  color: var(--c-red);
  border-color: var(--c-red);
  background: var(--c-red-bg);
}
.sync-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--c-text3);
  padding: 4px 9px;
  border: 0.5px solid var(--c-border);
  border-radius: 20px;
  background: var(--c-bg2);
  cursor: pointer;
  transition: background 0.15s;
}
.sync-badge:hover { background: var(--c-bg3); }
.sync-badge[data-status="synced"] { color: var(--c-green); border-color: var(--c-green); }
.sync-badge[data-status="error"]  { color: var(--c-red);   border-color: var(--c-red); }
.sync-badge[data-status="pending"],
.sync-badge[data-status="syncing"] { color: var(--c-blue); }
.sync-icon { font-size: 13px; }

/* ========== USER AVATAR ========== */
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent) 0%, #7C3AED 100%);
  display: flex; align-items: center; justify-content: center;
  cursor: default; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.user-avatar span {
  font-size: 13px; font-weight: 600; color: #fff;
  line-height: 1; text-transform: uppercase;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; transition: opacity 0.2s ease;
}
.modal-overlay:not(.hidden) { opacity: 1; }
.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--c-bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
  transform: scale(0.95) translateY(8px); transition: transform 0.25s ease;
}
.modal-overlay:not(.hidden) .modal-card { transform: scale(1) translateY(0); }
.modal-overlay.hidden { display: none; }
.modal-card {
  background: var(--c-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%; max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--c-text3); padding: 4px; }
.modal-desc { font-size: 13px; color: var(--c-text2); line-height: 1.5; margin-bottom: 16px; }
.modal-label { display: block; font-size: 12px; font-weight: 500; color: var(--c-text2); margin-bottom: 6px; }
.modal-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--c-border2); border-radius: var(--radius-sm);
  background: var(--c-bg2); color: var(--c-text);
  font-size: 15px; font-family: inherit;
  outline: none;
}
.modal-input:focus { border-color: var(--c-purple); }
.modal-hint { font-size: 11px; color: var(--c-text3); margin-top: 6px; margin-bottom: 12px; }
.sync-modal-status { font-size: 13px; min-height: 20px; margin-bottom: 12px; }
.sync-modal-status.ok    { color: var(--c-green); }
.sync-modal-status.error { color: var(--c-red); }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.modal-btn {
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer; border: none;
  font-family: inherit;
}
.modal-btn.primary { background: var(--c-accent-bg); color: var(--c-accent-fg); flex: 1; }
.modal-btn.ghost   { background: var(--c-bg3); color: var(--c-text2); }
.ob-sync-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: var(--c-bg2);
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--c-border);
}
.ob-sync-text { font-size: 13px; color: var(--c-text2); }
.ob-sync-btn {
  margin-left: auto;
  font-size: 13px; font-weight: 500;
  padding: 6px 12px;
  background: var(--c-bg);
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius-sm);
  cursor: pointer; color: var(--c-text);
  font-family: inherit;
  white-space: nowrap;
}

/* ========== DASHBOARD LAYOUT ========== */
.dash {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: calc(100dvh - 53px);
}

/* ========== SIDEBAR ========== */
.sidebar {
  border-right: 1px solid var(--c-border);
  padding: 16px 10px;
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 53px; height: calc(100dvh - 53px);
  overflow-y: auto;
}
.sb-label {
  font-size: 10px; letter-spacing: 0.12em; font-weight: 600;
  text-transform: uppercase; color: var(--c-text3);
  padding: 12px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 450; color: var(--c-text2);
  cursor: pointer; transition: all 0.12s;
  border: none; background: none; width: 100%; text-align: left;
  font-family: inherit;
}
.nav-item:hover { background: var(--c-bg2); color: var(--c-text); }
.nav-item.active {
  background: var(--c-blue-bg); color: var(--c-blue);
  font-weight: 500;
}
.nav-item svg { flex-shrink: 0; }

.sidebar-goals { padding: 4px 0; }
.goal-sidebar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  font-size: 12px; color: var(--c-text2);
  border-radius: var(--radius-sm);
  cursor: pointer; margin-bottom: 2px;
}
.goal-sidebar-item:hover { background: var(--c-bg2); }
.goal-sidebar-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.goal-sidebar-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-sidebar-pct { font-size: 10px; color: var(--c-text3); }

.sidebar-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--c-border); }

/* ========== MAIN ========== */
.main { padding: 24px; overflow-y: auto; }

/* ========== PANELS ========== */
.panel { display: none; opacity: 0; }
.panel.active { display: block; opacity: 1; animation: panelIn 0.2s ease; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ========== SECTION HEAD ========== */
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 20px;
}
.section-head h2 { font-size: 16px; font-weight: 600; color: var(--c-text); }
.sh-btn {
  font-size: 12px; color: var(--c-text3); cursor: pointer;
  border: none; background: none; font-family: inherit; padding: 0;
  transition: color 0.12s;
}
.sh-btn:hover { color: var(--c-accent); }

/* ========== STATS ROW ========== */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 28px; }
.stat-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat-card .sv { font-size: 26px; font-weight: 600; color: var(--c-text); }
.stat-card .sl { font-size: 11px; color: var(--c-text3); margin-top: 3px; font-weight: 500; letter-spacing: 0.04em; }

/* ========== TODAY GRID ========== */
.today-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ========== ACTION BAR ========== */
.action-bar {
  display: flex; gap: 10px; margin-bottom: 20px;
}
.action-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 16px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  cursor: pointer; font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1), box-shadow 0.18s, background 0.15s, border-color 0.15s;
}
.action-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.action-btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.action-btn-icon { font-size: 24px; line-height: 1; }
.action-btn-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.03em;
  color: var(--c-text2); white-space: nowrap;
}
.action-btn-plan { border-color: rgba(37,99,235,0.2); }
.action-btn-plan:hover { border-color: rgba(37,99,235,0.45); background: var(--c-blue-bg); }
.action-btn-plan .action-btn-label { color: var(--c-blue); }
.action-btn-ai { border-color: rgba(124,58,237,0.2); }
.action-btn-ai:hover { border-color: rgba(124,58,237,0.45); background: var(--c-purple-bg); }
.action-btn-ai .action-btn-label { color: var(--c-purple); }
.action-btn-ai .action-btn-icon { animation: float-icon 3s ease-in-out infinite; }
@keyframes float-icon { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-3px)} }
.action-btn-settings:hover { background: var(--c-bg2); }

/* ========== PLAN SECTION ========== */
.plan-section {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.plan-section .section-head { margin-bottom: 16px; }

/* ========== TASK LIST ========== */
.task-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-left: 3px solid transparent;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.task-item:last-child { margin-bottom: 0; }
.task-item.current {
  border-left-color: var(--c-accent);
  background: var(--c-blue-bg);
  box-shadow: var(--shadow);
}
.task-item.done { opacity: 0.55; }
.task-check {
  width: 22px; height: 22px; border-radius: 7px;
  border: 1.5px solid var(--c-border2);
  flex-shrink: 0; margin-top: 1px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.task-check.checked { background: var(--c-accent); border-color: var(--c-accent); }
.task-check.checked::after {
  content: '';
  display: block; width: 5px; height: 9px;
  border: 1.5px solid var(--c-accent-fg);
  border-top: none; border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 15px; font-weight: 500; color: var(--c-text); line-height: 1.4; transition: color 0.2s; }
.task-item.current .task-title { font-weight: 600; }
.task-item.done .task-title { text-decoration: line-through; color: var(--c-text3); font-weight: 400; }
.task-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.task-time { font-size: 12px; font-weight: 500; color: var(--c-text2); }
.task-item.current .task-time { color: var(--c-accent); }
.task-now-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  color: var(--c-accent); background: var(--c-blue-bg);
  border: 1px solid var(--c-accent);
  padding: 1px 8px; border-radius: 10px;
}
.tag { font-size: 10px; padding: 1px 7px; border-radius: 8px; }
.tag-work { background: var(--c-blue-bg); color: var(--c-blue); }
.tag-health { background: var(--c-green-bg); color: var(--c-green); }
.tag-learn { background: var(--c-purple-bg); color: var(--c-purple); }
.tag-other { background: var(--c-bg3); color: var(--c-text2); }

.add-task-row { display: flex; gap: 8px; margin-top: 12px; }
.add-task-row input {
  flex: 1; font-size: 13px;
  padding: 8px 10px;
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius-sm);
  color: var(--c-text); background: var(--c-bg);
  font-family: inherit;
}
.add-task-row input:focus { outline: none; border-color: var(--c-accent); }
.add-task-row button {
  padding: 8px 14px; background: var(--c-accent-bg);
  color: var(--c-accent-fg); border: none;
  border-radius: var(--radius-sm); font-size: 14px; cursor: pointer;
}

/* ========== VOICE BOX ========== */
.voice-box {
  margin-top: 16px;
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.voice-box-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.voice-box-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-text3); }
.voice-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 0.5px solid var(--c-border);
  border-radius: 20px; font-size: 12px;
  color: var(--c-text2); background: var(--c-bg);
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.voice-btn.recording { background: var(--c-red-bg); border-color: var(--c-red); color: var(--c-red); }
.vdot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-text3); }
.voice-btn.recording .vdot { background: var(--c-red); animation: blink 0.8s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.voice-transcript {
  width: 100%; min-height: 160px;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg2);
  font-size: 14px; color: var(--c-text); line-height: 1.65;
  font-family: inherit; resize: vertical;
  transition: border-color 0.15s;
}
.voice-transcript:focus { outline: none; border-color: var(--c-accent); }
.voice-transcript .interim { color: var(--c-text3); }
.voice-transcript.empty { color: var(--c-text3); font-style: italic; }
.voice-ctrl { display: flex; gap: 8px; margin-top: 10px; }
.vc-btn {
  padding: 6px 12px; font-size: 12px;
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg); color: var(--c-text2);
  cursor: pointer; font-family: inherit;
}
.vc-btn.primary {
  background: var(--c-accent-bg); color: var(--c-accent-fg);
  border-color: var(--c-accent-bg);
}

/* ========== AI BOX ========== */
.ai-box {
  background: var(--c-bg2);
  border-radius: var(--radius-md);
  padding: 14px;
}
.ai-box-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ai-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent) 0%, #7C3AED 100%);
  flex-shrink: 0;
}
.ai-label { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-text3); }
.ai-msg { font-size: 13px; color: var(--c-text2); line-height: 1.7; min-height: 50px; }
.ai-dots { display: flex; gap: 4px; padding: 8px 0; }
.ai-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--c-accent); animation: pulse 1.2s ease-in-out infinite; opacity: 0.4; }
.ai-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%,80%,100%{opacity:0.3} 40%{opacity:1} }
.ai-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.ai-action {
  font-size: 11px; font-weight: 500; padding: 5px 12px;
  border: 1px solid var(--c-border);
  border-radius: 20px; background: var(--c-bg);
  color: var(--c-text2); cursor: pointer; font-family: inherit;
  transition: all 0.12s;
}
.ai-action:hover { color: var(--c-accent); border-color: var(--c-accent); background: var(--c-blue-bg); }

/* ========== GOALS PANEL ========== */
.goals-list { display: flex; flex-direction: column; gap: 14px; }
.goal-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--c-bg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}
.goal-card:hover { box-shadow: var(--shadow); }
.goal-card-head {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 12px;
}
.goal-cat-badge {
  font-size: 10px; font-weight: 600; padding: 3px 9px;
  border-radius: 8px; margin-bottom: 5px;
  display: inline-block; letter-spacing: 0.04em;
}
.goal-title { font-size: 15px; font-weight: 600; color: var(--c-text); line-height: 1.35; }
.goal-horizon { font-size: 11px; color: var(--c-text3); margin-top: 3px; font-weight: 500; }
.goal-pct { font-size: 22px; font-weight: 700; color: var(--c-accent); }
.prog-bar { height: 4px; background: var(--c-bg3); border-radius: 4px; margin-bottom: 14px; }
.prog-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--c-accent), #7C3AED); transition: width 0.5s ease; }
.milestones { display: flex; flex-direction: column; gap: 6px; }
.ms-item { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--c-text2); }
.ms-dot { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--c-border2); flex-shrink: 0; }
.ms-dot.done { background: var(--c-accent); border-color: var(--c-accent); }
.goal-plan-text { font-size: 12px; color: var(--c-text2); line-height: 1.65; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--c-border); white-space: pre-line; }

/* ========== NOTES PANEL ========== */
.notes-list { display: flex; flex-direction: column; gap: 10px; }
.note-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--c-bg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}
.note-card:hover { box-shadow: var(--shadow); }
.note-card-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.note-date { font-size: 11px; color: var(--c-text3); font-weight: 500; }
.note-type-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 8px; }
.type-voice { background: var(--c-purple-bg); color: var(--c-purple); }
.type-text { background: var(--c-green-bg); color: var(--c-green); }
.type-ai { background: var(--c-blue-bg); color: var(--c-blue); }
.note-actions { margin-left: auto; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.note-card:hover .note-actions { opacity: 1; }
.note-action-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--c-text3); padding: 2px 5px;
  border-radius: 4px; line-height: 1; transition: all 0.12s;
}
.note-action-btn:hover { background: var(--c-bg3); color: var(--c-text); }
.note-action-btn.delete:hover { color: var(--c-red); }
.note-body { font-size: 13px; color: var(--c-text); line-height: 1.65; }
.note-edit-area {
  width: 100%; min-height: 80px; padding: 10px 12px;
  border: 1px solid var(--c-border2); border-radius: var(--radius-sm);
  background: var(--c-bg2); color: var(--c-text);
  font-size: 13px; font-family: inherit; line-height: 1.65;
  resize: vertical; outline: none; transition: border-color 0.12s;
}
.note-edit-area:focus { border-color: var(--c-accent); }
.note-edit-actions { display: flex; gap: 6px; margin-top: 8px; }
.note-insight {
  font-size: 12px; color: var(--c-text2);
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--c-border);
  font-style: italic; line-height: 1.55;
}

/* ========== ONBOARDING ========== */
.onboard {
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 24px;
}
.onboard-card {
  width: 100%; max-width: 520px;
}
.step-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 36px; }
.step-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-bg3); transition: all 0.3s; }
.step-dot.active { background: var(--c-accent); width: 22px; border-radius: 3px; }
.step-dot.done { background: var(--c-text3); }
.onboard-card h2 { font-size: 22px; font-weight: 500; color: var(--c-text); margin-bottom: 8px; text-align: center; }
.onboard-card .sub { font-size: 14px; color: var(--c-text2); text-align: center; margin-bottom: 28px; line-height: 1.65; }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.cat-card {
  padding: 14px; border: 0.5px solid var(--c-border);
  border-radius: var(--radius-md); cursor: pointer;
  transition: all 0.15s; text-align: left;
  background: var(--c-bg);
}
.cat-card:hover { border-color: var(--c-border2); background: var(--c-bg2); }
.cat-card.selected { border: 1.5px solid var(--c-accent); background: var(--c-bg2); }
.cat-icon { font-size: 22px; margin-bottom: 6px; }
.cat-title { font-size: 13px; font-weight: 500; color: var(--c-text); margin-bottom: 2px; }
.cat-desc { font-size: 11px; color: var(--c-text2); line-height: 1.4; }
.horizon-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.h-chip {
  padding: 7px 14px; border: 0.5px solid var(--c-border);
  border-radius: 20px; font-size: 12px; color: var(--c-text2);
  cursor: pointer; transition: all 0.15s; background: var(--c-bg);
  font-family: inherit;
}
.h-chip.selected { background: var(--c-accent-bg); color: var(--c-accent-fg); border-color: var(--c-accent-bg); }
.ob-textarea {
  width: 100%; padding: 12px 14px;
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius-md); font-size: 14px;
  color: var(--c-text); background: var(--c-bg);
  font-family: inherit; resize: none; line-height: 1.6;
  margin-bottom: 16px;
}
.ob-textarea:focus { outline: none; border-color: var(--c-accent); }
.ob-textarea::placeholder { color: var(--c-text3); }
.ob-btn {
  width: 100%; padding: 13px;
  background: var(--c-accent-bg); color: var(--c-accent-fg);
  border: none; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: opacity 0.15s;
  font-family: inherit; margin-top: 6px;
}
.ob-btn:disabled { opacity: 0.3; cursor: default; }
.ob-btn.secondary {
  background: transparent; color: var(--c-text2);
  border: 0.5px solid var(--c-border); margin-top: 8px;
}
.thinking {
  display: flex; flex-direction: column;
  align-items: center; gap: 16px; padding: 48px 0; text-align: center;
}
.spinner {
  width: 32px; height: 32px;
  border: 1.5px solid var(--c-bg3);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.thinking p { font-size: 13px; color: var(--c-text2); }

/* ========== MOBILE ========== */
@media (max-width: 640px) {
  .dash { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .today-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(3,1fr); }
  .main { padding: 16px; }
  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--c-bg);
    border-top: 0.5px solid var(--c-border);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 100;
  }
  .bn-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 3px;
    font-size: 10px; color: var(--c-text3);
    cursor: pointer; padding: 4px 0; border: none; background: none;
    font-family: inherit;
  }
  .bn-item.active { color: var(--c-text); }
  .main { padding-bottom: 80px; }
}
@media (min-width: 641px) { .bottom-nav { display: none; } }

/* ========== SKELETON LOADING ========== */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--c-bg3) 25%, var(--c-bg2) 50%, var(--c-bg3) 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-line { height: 14px; margin-bottom: 8px; width: 100%; }
.skeleton-line:last-child { width: 65%; }
.skeleton-card {
  height: 80px; margin-bottom: 10px;
  border-radius: var(--radius-md);
}
.skeleton-task {
  height: 48px; margin-bottom: 4px;
  border-radius: var(--radius-sm);
}

/* ========== WEEK NAV ========== */
.week-nav {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none;
}
.week-nav::-webkit-scrollbar { display: none; }
.week-day {
  flex: 1; min-width: 45px; padding: 10px 4px;
  text-align: center; border-radius: var(--radius-md);
  border: 1px solid var(--c-border); background: var(--c-bg);
  cursor: pointer; transition: all 0.15s;
}
.week-day:hover:not(.disabled) { background: var(--c-bg2); border-color: var(--c-border2); }
.week-day.active { background: var(--c-accent-bg); color: var(--c-accent-fg); border-color: var(--c-accent-bg); }
.week-day.active .wd-name, .week-day.active .wd-date { color: var(--c-accent-fg); }
.week-day.disabled { opacity: 0.4; cursor: not-allowed; background: var(--c-bg2); }
.wd-name { font-size: 10px; text-transform: uppercase; color: var(--c-text3); margin-bottom: 2px; }
.wd-date { font-size: 16px; font-weight: 500; color: var(--c-text); }

/* ========== TASK EXTRAS ========== */
.task-item-postpone-btn {
  background: none; border: none; cursor: pointer;
  color: var(--c-text3); font-size: 14px; margin-left: 6px;
  padding: 4px; transition: color 0.15s;
}
.task-item-postpone-btn:hover { color: var(--c-accent); }

/* ========== VOICE EXTRAS ========== */
.voice-interim { color: var(--c-text3); font-style: italic; font-size: 13px; margin-top: -4px; margin-bottom: 8px; }
.vl { font-size: 12px; }

/* ========== AI HERO BOX ========== */
.ai-hero-box { border: 0.5px solid var(--c-border); }

/* ========== INSTALL BANNER ========== */
.install-banner {
  position: fixed;
  bottom: -140px;
  left: 50%; transform: translateX(-50%);
  width: min(520px, calc(100% - 24px));
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 850;
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  transition: bottom 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.install-banner.show { bottom: 108px; }
.install-banner-icon { border-radius: 12px; flex-shrink: 0; }
.install-banner-body { flex: 1; min-width: 0; }
.install-banner-title { font-size: 14px; font-weight: 600; color: var(--c-text); }
.install-banner-sub   { font-size: 12px; color: var(--c-text2); margin-top: 2px; line-height: 1.4; }
.install-banner-btns  { display: flex; gap: 8px; flex-shrink: 0; }
.ib-dismiss {
  padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--c-border); background: var(--c-bg2);
  color: var(--c-text2); cursor: pointer; font-family: inherit;
}
.ib-install {
  padding: 8px 16px; font-size: 13px; font-weight: 600; border-radius: var(--radius-sm);
  border: none; background: linear-gradient(135deg, #2563EB, #7C3AED);
  color: #fff; cursor: pointer; font-family: inherit;
  transition: opacity 0.15s;
}
.ib-install:hover { opacity: 0.88; }
@media (max-width: 640px) {
  .install-banner { padding: 14px 14px; gap: 10px; }
  .install-banner.show { bottom: 158px; }
  .install-banner-btns { flex-direction: column; }
  .ib-dismiss, .ib-install { padding: 7px 12px; font-size: 12px; }
}

/* ========== CHAT FAB & DRAWER ========== */
.chat-fab {
  position: fixed; bottom: 28px;
  left: 50%; transform: translateX(-50%);
  border-radius: 30px; padding: 14px 28px;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(37,99,235,0.45);
  z-index: 900; transition: transform 0.2s, box-shadow 0.2s;
  animation: pulse-fab 2.5s ease-in-out infinite;
}
.chat-fab:hover {
  transform: translateX(-50%) translateY(-3px);
  box-shadow: 0 8px 32px rgba(37,99,235,0.6);
  animation: none;
}
@keyframes pulse-fab {
  0%,100% { box-shadow: 0 4px 20px rgba(37,99,235,0.45), 0 0 0 0   rgba(37,99,235,0.3); }
  50%     { box-shadow: 0 4px 20px rgba(37,99,235,0.45), 0 0 0 12px rgba(37,99,235,0); }
}
.chat-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 400px;
  background: var(--c-bg);
  box-shadow: -4px 0 24px rgba(0,0,0,0.2);
  z-index: 1000;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.2,0.8,0.2,1);
  display: flex; flex-direction: column;
}
.chat-drawer.hidden { display: flex !important; transform: translateX(100%); }
@media (max-width: 640px) {
  .chat-drawer { max-width: 100%; transform: translateY(0); }
  .chat-drawer.hidden { transform: translateY(100%); }
  .chat-fab { bottom: 74px; }
}
.chat-drawer-inner { display: flex; flex-direction: column; height: 100%; }
.chat-drawer-head { padding: 16px 20px; border-bottom: 0.5px solid var(--c-border); }
.chat-history {
  flex: 1; overflow-y: auto;
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.chat-msg { max-width: 85%; font-size: 14px; line-height: 1.5; padding: 10px 14px; border-radius: 14px; }
.chat-msg.user { align-self: flex-end; background: var(--c-accent-bg); color: var(--c-accent-fg); border-bottom-right-radius: 4px; }
.chat-msg.assistant { align-self: flex-start; background: var(--c-bg2); color: var(--c-text); border: 0.5px solid var(--c-border); border-bottom-left-radius: 4px; }
.chat-input-area { display: flex; gap: 8px; padding: 16px 20px; border-top: 0.5px solid var(--c-border); }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--c-text3); font-size: 13px; }
.empty-state .es-icon { font-size: 32px; margin-bottom: 10px; }

/* ========== AUTH ========== */
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--c-bg);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 10px; }
.auth-logo img { border-radius: 12px; }
.auth-app-name {
  text-align: center; font-size: 18px; font-weight: 600;
  color: var(--c-text); margin-bottom: 2px;
}
.auth-title {
  text-align: center; font-size: 15px; font-weight: 500;
  color: var(--c-text); margin-bottom: 4px;
}
.auth-sub {
  text-align: center; font-size: 13px; color: var(--c-text3);
  margin-bottom: 24px;
}
.auth-label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--c-text2); margin-bottom: 5px;
}
.auth-input {
  width: 100%; padding: 10px 12px; margin-bottom: 14px;
  border: 1px solid var(--c-border2); border-radius: var(--radius-sm);
  background: var(--c-bg2); color: var(--c-text);
  font-size: 15px; font-family: inherit; outline: none;
}
.auth-input:focus { border-color: var(--c-accent); }
.auth-error {
  font-size: 12px; color: var(--c-red); min-height: 18px;
  margin-bottom: 8px; text-align: center;
}
.auth-btn {
  width: 100%; padding: 12px;
  background: var(--c-accent-bg); color: var(--c-accent-fg);
  border: none; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: inherit; margin-top: 4px;
  transition: opacity 0.15s;
}
.auth-btn:hover { opacity: 0.85; }
.auth-toggle {
  display: flex; justify-content: center; align-items: center;
  gap: 6px; margin-top: 18px;
  font-size: 13px; color: var(--c-text3);
}
.auth-toggle-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--c-accent); font-family: inherit;
  text-decoration: underline;
}
.user-email {
  font-size: 11px; color: var(--c-text3);
  max-width: 140px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ========== UTILITY ========== */
.hidden { display: none !important; }
button { font-family: inherit; }
textarea, input { font-family: inherit; }
