*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-2: #f7f7f5;
  --bg-3: #f0efed;
  --text: #1a1a1a;
  --text-2: #555450;
  --text-3: #999794;
  --border: rgba(0,0,0,0.08);
  --border-2: rgba(0,0,0,0.14);
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --accent: #1a1a1a;
  --accent-text: #ffffff;
  --green: #22c55e;
  --sidebar-w: 220px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1c;
    --bg-2: #242424;
    --bg-3: #2c2c2c;
    --text: #f0efed;
    --text-2: #aaa89f;
    --text-3: #666460;
    --border: rgba(255,255,255,0.08);
    --border-2: rgba(255,255,255,0.14);
    --accent: #f0efed;
    --accent-text: #1a1a1a;
  }
}

html, body { height: 100%; font-family: var(--font); background: var(--bg-3); color: var(--text); font-size: 14px; line-height: 1.5; }

/* LAYOUT */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg);
  border-right: 0.5px solid var(--border);
  display: flex; flex-direction: column;
  transition: width 0.2s ease, min-width 0.2s ease;
  overflow: hidden;
  position: relative;
}
.sidebar.collapsed { width: 56px; min-width: 56px; }
.sidebar-inner { display: flex; flex-direction: column; height: 100%; padding: 20px 0; overflow: hidden; }

.logo-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px 18px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 14px;
  position: relative;
}
.logo-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-text { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; color: var(--text); }
.sidebar.collapsed .logo-text { opacity: 0; pointer-events: none; }

.collapse-btn {
  position: fixed;
  left: calc(var(--sidebar-w) - 11px);
  top: 14px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg); border: 0.5px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-3); z-index: 200;
  transition: color 0.1s, left 0.2s ease;
}
.collapse-btn:hover { color: var(--text); }
.sidebar.collapsed ~ * .collapse-btn,
body.collapsed .collapse-btn { left: 45px; }


/* NAV */
.nav { flex: 1; padding: 0 8px; overflow: hidden; }
.nav-section { margin-bottom: 6px; }
.nav-label {
  font-size: 10.5px; font-weight: 500; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0 8px; margin-bottom: 2px;
  display: block; white-space: nowrap;
}
.sidebar.collapsed .nav-label { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 7px 8px;
  border-radius: var(--radius); border: none; background: none;
  font-family: var(--font); font-size: 13.5px; color: var(--text-2);
  cursor: pointer; text-align: left; white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}
.nav-item:hover { background: var(--bg-2); color: var(--text); }
.nav-item.active { background: var(--bg-2); color: var(--text); font-weight: 500; }
.nav-item svg { flex-shrink: 0; }
.sidebar.collapsed .nav-item span { opacity: 0; }

/* FOOTER */
.sidebar-footer {
  margin-top: auto; padding: 12px 8px 0;
  border-top: 0.5px solid var(--border);
}
.user-row {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: var(--radius); cursor: pointer;
}
.user-row:hover { background: var(--bg-2); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 500; flex-shrink: 0;
}
.av-you { background: #ece9fb; color: #4b3dbf; }
.av-buddy { background: #dcf5ed; color: #0f6e56; }
.user-name { font-size: 13px; color: var(--text); white-space: nowrap; }
.sidebar.collapsed .user-name { opacity: 0; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-left: auto; flex-shrink: 0; }
.sidebar.collapsed .online-dot { opacity: 0; }

/* MAIN */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* TOPBAR */
.topbar {
  height: 52px; min-height: 52px;
  background: var(--bg); border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; gap: 10px; padding: 0 20px;
}
.topbar-title { font-size: 15px; font-weight: 500; flex: 1; color: var(--text); }
.topbar-date { font-size: 13px; color: var(--text-3); white-space: nowrap; }

/* BUTTONS */
.btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: var(--radius);
  border: 0.5px solid var(--border-2); background: none;
  font-family: var(--font); font-size: 13px; color: var(--text);
  cursor: pointer; transition: background 0.1s; white-space: nowrap;
}
.btn:hover { background: var(--bg-2); }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn-primary:hover { opacity: 0.88; background: var(--accent); }

/* CONTENT */
.content { flex: 1; overflow-y: auto; padding: 24px; }

/* GREETING */
.greeting { font-size: 22px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.subgreeting { font-size: 13.5px; color: var(--text-2); margin-bottom: 22px; }

/* STAT GRID */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 20px; }
.stat-card { background: var(--bg-2); border-radius: var(--radius); padding: 14px 16px; }
.stat-label { font-size: 11.5px; color: var(--text-3); margin-bottom: 5px; }
.stat-value { font-size: 22px; font-weight: 500; color: var(--text); font-family: var(--font-mono); }
.stat-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.progress-wrap { height: 3px; background: var(--border-2); border-radius: 10px; margin-top: 8px; }
.progress-bar { height: 3px; background: var(--accent); border-radius: 10px; transition: width 0.4s; }

/* GRID LAYOUTS */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }

/* PANEL */
.panel {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
}
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-title { font-size: 13px; font-weight: 500; color: var(--text); }
.panel-action { font-size: 12px; color: var(--text-3); cursor: pointer; background: none; border: none; font-family: var(--font); }
.panel-action:hover { color: var(--text); }

/* TASKS */
.task-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 0.5px solid var(--border); }
.task-item:last-child { border-bottom: none; padding-bottom: 0; }
.task-check {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--border-2); flex-shrink: 0;
  margin-top: 1px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.task-check.done { background: var(--accent); border-color: var(--accent); }
.task-body { flex: 1; min-width: 0; }
.task-name { font-size: 13px; color: var(--text); line-height: 1.4; }
.task-name.done { text-decoration: line-through; color: var(--text-3); }
.task-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 20px; font-size: 11px; font-weight: 500; margin-left: 7px; }
.tag-q1 { background: #fce8e8; color: #a32d2d; }
.tag-q2 { background: #e6eefc; color: #1a4fa0; }
.tag-q3 { background: #fef4e0; color: #7a4a08; }
.tag-q4 { background: var(--bg-2); color: var(--text-3); }

/* POMODORO */
.pomo-ring { width: 96px; height: 96px; position: relative; margin: 0 auto 10px; }
.pomo-ring svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border-2); stroke-width: 6; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring-time { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 17px; font-weight: 500; font-family: var(--font-mono); color: var(--text); }
.ring-label { text-align: center; font-size: 11.5px; color: var(--text-3); margin-bottom: 10px; }
.pomo-btns { display: flex; gap: 8px; justify-content: center; }

/* ACTIVITY */
.activity-item { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 0.5px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-text { font-size: 13px; color: var(--text); flex: 1; }
.activity-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* JOURNAL */
.journal-card { padding: 10px 12px; background: var(--bg-2); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; transition: background 0.1s; }
.journal-card:last-child { margin-bottom: 0; }
.journal-card:hover { background: var(--bg-3); }
.journal-date { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.journal-snippet { font-size: 13px; color: var(--text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* PLACEHOLDER PAGE */
.placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 60vh; gap: 14px; text-align: center;
}
.placeholder-icon { font-size: 32px; }
.placeholder-title { font-size: 17px; font-weight: 500; color: var(--text); }
.placeholder-sub { font-size: 13.5px; color: var(--text-2); max-width: 300px; line-height: 1.6; }

/* MODAL */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.3); z-index: 100;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg); border-radius: var(--radius-lg);
  border: 0.5px solid var(--border-2);
  padding: 20px; width: 360px; max-width: 90vw;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 15px; font-weight: 500; color: var(--text); }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-3); cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-input {
  width: 100%; padding: 8px 11px; border-radius: var(--radius);
  border: 0.5px solid var(--border-2); background: var(--bg-2);
  font-family: var(--font); font-size: 13.5px; color: var(--text);
  outline: none;
}
.modal-input:focus { border-color: var(--border-2); box-shadow: 0 0 0 2px rgba(0,0,0,0.06); }
.modal-row { display: flex; gap: 8px; }
.modal-select {
  padding: 8px 11px; border-radius: var(--radius);
  border: 0.5px solid var(--border-2); background: var(--bg-2);
  font-family: var(--font); font-size: 13px; color: var(--text);
  outline: none; cursor: pointer;
}

/* RESPONSIVE */
@media (max-width: 700px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .sidebar { width: 56px; min-width: 56px; }
  .sidebar .logo-text, .sidebar .nav-item span, .sidebar .user-name,
  .sidebar .online-dot, .sidebar .nav-label { opacity: 0; pointer-events: none; }
}

/* ── TASKS PAGE ─────────────────────────────────────────────────────────────── */
.tasks-toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  padding: 5px 12px; border-radius: var(--radius);
  border: 0.5px solid var(--border); background: none;
  font-family: var(--font); font-size: 12.5px; color: var(--text-2);
  cursor: pointer; transition: background 0.1s, color 0.1s;
}
.filter-tab:hover { background: var(--bg-2); color: var(--text); }
.filter-tab.active { background: var(--accent); color: var(--accent-text); border-color: transparent; }

.view-toggle { display: flex; border: 0.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.view-btn {
  padding: 6px 10px; background: none; border: none;
  color: var(--text-3); cursor: pointer; display: flex; align-items: center;
  transition: background 0.1s, color 0.1s;
}
.view-btn:hover { background: var(--bg-2); color: var(--text); }
.view-btn.active { background: var(--bg-2); color: var(--text); }

.task-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  border-bottom: 0.5px solid var(--border);
  transition: background 0.1s;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--bg-2); }
.task-row-body { flex: 1; min-width: 0; }
.task-row-name { font-size: 13.5px; color: var(--text); }
.task-row-name.done { text-decoration: line-through; color: var(--text-3); }
.task-row-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.meta-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--text-3);
}
.avatar-xs {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 500;
}
.task-delete {
  background: none; border: none; color: var(--text-3);
  cursor: pointer; padding: 4px; border-radius: var(--radius);
  opacity: 0; transition: opacity 0.1s, color 0.1s;
  display: flex; align-items: center;
}
.task-row:hover .task-delete,
.board-card:hover .task-delete { opacity: 1; }
.task-delete:hover { color: #a32d2d; }
.empty-state { padding: 32px; text-align: center; color: var(--text-3); font-size: 13.5px; }

/* ── BOARD VIEW ──────────────────────────────────────────────────────────────── */
.board-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px; align-items: start;
}
.board-col { border-radius: var(--radius-lg); overflow: hidden; border: 0.5px solid var(--border); }
.board-col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; font-size: 12.5px; font-weight: 500;
}
.board-count {
  font-size: 11px; font-weight: 500;
  padding: 1px 7px; border-radius: 20px;
  background: rgba(0,0,0,0.08);
}
.board-col-body { background: var(--bg); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.board-card {
  background: var(--bg-2); border-radius: var(--radius);
  padding: 10px 10px 8px; border: 0.5px solid var(--border);
  transition: border-color 0.1s;
}
.board-card:hover { border-color: var(--border-2); }
.board-card-done { opacity: 0.55; }
.board-card-top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.board-card-name { font-size: 13px; color: var(--text); flex: 1; line-height: 1.4; }
.board-card-name.done { text-decoration: line-through; color: var(--text-3); }
.board-card-meta { display: flex; align-items: center; gap: 8px; }
.board-empty { font-size: 12px; color: var(--text-3); padding: 8px 4px; }
.board-add {
  width: 100%; padding: 7px; border-radius: var(--radius);
  border: 0.5px dashed var(--border-2); background: none;
  font-family: var(--font); font-size: 12.5px; color: var(--text-3);
  cursor: pointer; transition: background 0.1s, color 0.1s; margin-top: 2px;
}
.board-add:hover { background: var(--bg-2); color: var(--text); }
@media (max-width: 900px) { .board-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px)  { .board-grid { grid-template-columns: 1fr; } }

/* ── MATRIX ─────────────────────────────────────────────────────────────────── */
.matrix-axis-wrap { display: flex; gap: 0; align-items: stretch; }
.matrix-y-label {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; padding-right: 10px;
  font-size: 10px; font-weight: 500; color: var(--text-3);
  letter-spacing: 0.08em; writing-mode: vertical-rl;
  text-orientation: mixed; transform: rotate(180deg);
  user-select: none;
}
.matrix-arrow { background: var(--border-2); border-radius: 2px; }
.matrix-arrow-v { width: 1.5px; height: 60px; }
.matrix-arrow-h { height: 1.5px; width: 60px; }
.matrix-main { flex: 1; display: flex; flex-direction: column; gap: 0; }
.matrix-x-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 500; color: var(--text-3);
  letter-spacing: 0.08em; margin-bottom: 10px; user-select: none;
}
.matrix-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr; gap: 10px;
}
.matrix-quad {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px;
  display: flex; flex-direction: column; min-height: 180px;
}
.matrix-quad-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.matrix-quad-icon { font-size: 18px; }
.matrix-quad-label { font-size: 13.5px; font-weight: 500; color: var(--text); }
.matrix-quad-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.matrix-count {
  margin-left: auto; font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 20px;
  background: var(--qc); color: var(--qt);
}
.matrix-quad-tasks { flex: 1; display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.matrix-task {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 0.5px solid var(--border);
}
.matrix-task:last-child { border-bottom: none; }
.matrix-task-name { font-size: 12.5px; color: var(--text); flex: 1; }
.matrix-task-due { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.matrix-empty { font-size: 12px; color: var(--text-3); padding: 8px 0; }
.matrix-more { font-size: 11.5px; color: var(--text-3); padding: 4px 0; }
.matrix-add-btn {
  width: 100%; padding: 6px; border-radius: var(--radius);
  border: 0.5px dashed var(--border-2); background: none;
  font-family: var(--font); font-size: 12px; color: var(--text-3);
  cursor: pointer; transition: background 0.1s, color 0.1s; margin-top: auto;
}
.matrix-add-btn:hover { background: var(--bg-2); color: var(--text); }
@media (max-width: 600px) { .matrix-grid { grid-template-columns: 1fr; } }

/* ── FOCUS PAGE ──────────────────────────────────────────────────────────────── */
.focus-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px; align-items: start;
}
@media (max-width: 800px) { .focus-layout { grid-template-columns: 1fr; } }

.focus-left {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}

.focus-mode-tabs {
  display: flex; background: var(--bg-2);
  border-radius: var(--radius); padding: 3px; gap: 3px;
}
.focus-mode-btn {
  padding: 6px 20px; border-radius: 6px; border: none;
  font-family: var(--font); font-size: 13px; cursor: pointer;
  color: var(--text-2); background: none; transition: background 0.15s, color 0.15s;
}
.focus-mode-btn.active { background: var(--bg); color: var(--text); font-weight: 500; }

.focus-ring-wrap {
  position: relative; width: 160px; height: 160px;
}
.focus-ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
}
.focus-time {
  font-size: 26px; font-weight: 500; font-family: var(--font-mono);
  color: var(--text); line-height: 1;
}
.focus-session-label { font-size: 12px; color: var(--text-3); }

.focus-goal-wrap { width: 100%; }
.focus-goal-input {
  width: 100%; padding: 9px 12px; border-radius: var(--radius);
  border: 0.5px solid var(--border-2); background: var(--bg-2);
  font-family: var(--font); font-size: 13.5px; color: var(--text);
  outline: none; text-align: center;
}
.focus-goal-input:focus { border-color: var(--border-2); box-shadow: 0 0 0 2px rgba(0,0,0,0.06); }
.focus-goal-input::placeholder { color: var(--text-3); }

.focus-controls { display: flex; align-items: center; gap: 14px; }
.focus-play-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  border: none; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: opacity 0.15s, transform 0.1s;
}
.focus-play-btn:hover { opacity: 0.85; }
.focus-play-btn:active { transform: scale(0.96); }
.focus-ctrl-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 0.5px solid var(--border-2); background: none;
  color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s;
}
.focus-ctrl-btn:hover { background: var(--bg-2); color: var(--text); }

.focus-custom { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.custom-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; border-bottom: 0.5px solid var(--border);
}
.custom-row:last-child { border-bottom: none; }
.custom-label { font-size: 13px; color: var(--text-2); }
.custom-stepper {
  display: flex; align-items: center; gap: 10px;
}
.custom-stepper button {
  width: 26px; height: 26px; border-radius: var(--radius);
  border: 0.5px solid var(--border-2); background: none;
  font-size: 16px; color: var(--text); cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s;
}
.custom-stepper button:hover { background: var(--bg-2); }
.custom-stepper span { font-size: 13px; font-family: var(--font-mono); color: var(--text); min-width: 30px; text-align: center; }

.sound-panel { width: 100%; }
.sound-label { font-size: 11.5px; color: var(--text-3); margin-bottom: 8px; }
.sound-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.sound-btn {
  padding: 5px 12px; border-radius: 20px;
  border: 0.5px solid var(--border-2); background: none;
  font-family: var(--font); font-size: 12px; color: var(--text-2);
  cursor: pointer; transition: background 0.1s, color 0.1s;
}
.sound-btn:hover { background: var(--bg-2); color: var(--text); }
.sound-btn.active { background: var(--accent); color: var(--accent-text); border-color: transparent; }

.focus-right { display: flex; flex-direction: column; gap: 0; }
.focus-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
@media (max-width: 600px) { .focus-stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.session-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-bottom: 0.5px solid var(--border);
}
.session-row:last-child { border-bottom: none; }
.session-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; margin-top: 5px;
}
.session-goal { font-size: 13px; color: var(--text); }
.session-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.buddy-focus-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; }

/* ── JOURNAL ─────────────────────────────────────────────────────────────────── */
.journal-layout {
  display: grid; grid-template-columns: 320px 1fr;
  gap: 16px; align-items: start;
}
@media (max-width: 820px) { .journal-layout { grid-template-columns: 1fr; } }

.journal-left { display: flex; flex-direction: column; gap: 12px; }
.journal-right { display: flex; flex-direction: column; }

/* CALENDAR */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.cal-month-label { font-size: 13.5px; font-weight: 500; color: var(--text); }
.cal-nav {
  width: 28px; height: 28px; border-radius: var(--radius);
  border: 0.5px solid var(--border); background: none;
  color: var(--text-2); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background 0.1s;
}
.cal-nav:hover { background: var(--bg-2); }

.cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.cal-dow-label {
  text-align: center; font-size: 11px; font-weight: 500;
  color: var(--text-3); padding: 4px 0;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-cell {
  aspect-ratio: 1; border-radius: var(--radius);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: background 0.1s;
}
.cal-cell:hover:not(.cal-blank):not(.cal-future) { background: var(--bg-2); }
.cal-blank { cursor: default; }
.cal-future { opacity: 0.35; cursor: default; }
.cal-today { background: var(--bg-2); border: 1.5px solid var(--border-2); }
.cal-today .cal-day-num { font-weight: 500; color: var(--text); }
.cal-day-num { font-size: 12px; color: var(--text-2); line-height: 1; }
.cal-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); margin-top: 2px;
}
.cal-mood-dot { font-size: 10px; margin-top: 1px; line-height: 1; }
.cal-filled .cal-day-num { color: var(--text); font-weight: 500; }

/* RECENT ENTRIES */
.journal-entry-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 0.5px solid var(--border);
  cursor: pointer; transition: background 0.1s;
}
.journal-entry-row:last-child { border-bottom: none; }
.journal-entry-row:hover { background: var(--bg-2); margin: 0 -16px; padding: 12px 16px; border-radius: var(--radius); }
.journal-entry-left { flex: 1; min-width: 0; }
.journal-entry-date { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.journal-mood-badge { font-size: 12px; color: var(--text-2); margin-right: 6px; }
.journal-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.journal-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: var(--bg-2); color: var(--text-3); border: 0.5px solid var(--border);
}
.journal-entry-preview {
  font-size: 12.5px; color: var(--text-3); margin-top: 4px;
  line-height: 1.5; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* MOOD WEEK */
.mood-week-row {
  display: flex; justify-content: space-between; padding: 4px 0;
}
.mood-day-col {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; cursor: pointer; padding: 6px 8px; border-radius: var(--radius);
  transition: background 0.1s;
}
.mood-day-col:hover { background: var(--bg-2); }
.mood-day-emoji { font-size: 20px; line-height: 1; }
.mood-day-label { font-size: 10.5px; color: var(--text-3); }

/* ENTRY VIEW */
.entry-layout { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.entry-topbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 4px;
}
.entry-date-label { flex: 1; font-size: 14px; font-weight: 500; color: var(--text); text-align: center; }
.entry-panel { padding: 16px !important; }
.entry-section-title {
  font-size: 12px; font-weight: 500; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px;
}

/* MOOD PICKER */
.mood-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.mood-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 16px; border-radius: var(--radius-lg);
  border: 0.5px solid var(--border); background: none;
  cursor: pointer; transition: background 0.1s, border-color 0.1s;
  font-family: var(--font);
}
.mood-btn:hover { background: var(--bg-2); }
.mood-btn.active { background: var(--bg-2); border-color: var(--border-2); }
.mood-emoji { font-size: 22px; line-height: 1; }
.mood-label-sm { font-size: 11px; color: var(--text-3); }

/* TAG PICKER */
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-option {
  padding: 5px 13px; border-radius: 20px;
  border: 0.5px solid var(--border); background: none;
  font-family: var(--font); font-size: 12.5px; color: var(--text-2);
  cursor: pointer; transition: background 0.1s, color 0.1s;
}
.tag-option:hover { background: var(--bg-2); }
.tag-option.active { background: var(--accent); color: var(--accent-text); border-color: transparent; }

/* TEXTAREA */
.entry-textarea {
  width: 100%; min-height: 80px; resize: none; overflow: hidden;
  border: none; background: none; outline: none;
  font-family: var(--font); font-size: 14px; color: var(--text);
  line-height: 1.7;
}
.entry-textarea::placeholder { color: var(--text-3); }

/* PHOTOS */
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.photo-thumb {
  position: relative; width: 80px; height: 80px;
  border-radius: var(--radius); overflow: hidden;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-remove {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  border: none; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.photo-add-btn {
  width: 80px; height: 80px; border-radius: var(--radius);
  border: 1px dashed var(--border-2); background: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-3); transition: background 0.1s;
}
.photo-add-btn:hover { background: var(--bg-2); }

/* ── GOOGLE CALENDAR PAGE ────────────────────────────────────────────────────── */
.gcal-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .gcal-layout { grid-template-columns: 1fr; } }

.gcal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 1px; background: var(--border); border: 0.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gcal-cell { background: var(--bg); min-height: 90px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.gcal-blank { background: var(--bg-2); }
.gcal-today { background: var(--bg-2); }
.gcal-day-num { font-size: 12px; color: var(--text-3); font-weight: 400; margin-bottom: 2px; }
.gcal-today-num { font-weight: 500; color: var(--text); background: var(--accent); color: var(--accent-text); width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.gcal-event-pill { display: flex; align-items: center; gap: 4px; padding: 2px 5px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.gcal-event-time { font-size: 10px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
.gcal-event-title { font-size: 10.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcal-more { font-size: 10px; color: var(--text-3); padding: 1px 4px; }

.upcoming-event { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 0.5px solid var(--border); }
.upcoming-event:last-child { border-bottom: none; }
.upcoming-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.upcoming-body { flex: 1; min-width: 0; }
.upcoming-title { font-size: 13px; color: var(--text); font-weight: 500; }
.upcoming-time { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.upcoming-loc { font-size: 11.5px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gcal-sidebar { display: flex; flex-direction: column; gap: 12px; }

/* ── GOOGLE PHOTOS PICKER BUTTON ─────────────────────────────────────────────── */
.photo-google-btn {
  border-color: var(--border-2);
  position: relative;
}
.photo-google-btn:hover { background: #f0f4ff; }

/* ── TAG INPUT ───────────────────────────────────────────────────────────────── */
.tag-input-wrap { display: flex; flex-direction: column; gap: 8px; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 10px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  background: var(--bg-2); border: 0.5px solid var(--border-2);
  font-size: 12.5px; color: var(--text);
}
.tag-chip-remove {
  background: none; border: none; color: var(--text-3);
  cursor: pointer; font-size: 14px; line-height: 1;
  padding: 0; display: flex; align-items: center;
}
.tag-chip-remove:hover { color: var(--text); }
.tag-input {
  width: 100%; padding: 7px 11px; border-radius: var(--radius);
  border: 0.5px solid var(--border); background: var(--bg-2);
  font-family: var(--font); font-size: 13px; color: var(--text); outline: none;
}
.tag-input:focus { border-color: var(--border-2); }
.tag-input::placeholder { color: var(--text-3); }

/* ── DRAG & DROP ─────────────────────────────────────────────────────────────── */
.drag-handle {
  color: var(--text-3); cursor: grab; padding: 4px 6px 4px 0;
  opacity: 0; transition: opacity 0.1s; flex-shrink: 0;
  display: flex; align-items: center;
}
.task-row:hover .drag-handle { opacity: 1; }
.drag-handle:active { cursor: grabbing; }
.task-row[draggable="true"] { transition: opacity 0.15s; }
.board-card[draggable="true"] { transition: opacity 0.15s; }
.matrix-quad { transition: background 0.1s; }

/* ── EVENT POPOVER ───────────────────────────────────────────────────────────── */
.event-popover {
  position: fixed; z-index: 500;
  width: 220px; background: var(--bg);
  border: 0.5px solid var(--border-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  overflow: hidden;
}
.event-popover-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 0.5px solid var(--border);
  padding-left: 14px;
}
.event-popover-title { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }
.event-popover-close {
  background: none; border: none; font-size: 18px;
  color: var(--text-3); cursor: pointer; line-height: 1;
  padding: 0; margin-left: 8px;
}
.event-popover-close:hover { color: var(--text); }
.event-popover-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.event-popover-row {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12.5px; color: var(--text-2);
}
.event-popover-desc {
  font-size: 12px; color: var(--text-3);
  line-height: 1.5; margin-top: 4px;
}
.gcal-event-pill { cursor: pointer; }
.gcal-event-pill:hover { background: var(--bg-3); }
.gcal-more { cursor: pointer; font-size: 10px; color: var(--text-3); padding: 1px 4px; }
.gcal-more:hover { color: var(--text); }

/* ── AUTH SCREEN ─────────────────────────────────────────────────────────────── */
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 70vh; padding: 24px;
}
.auth-card {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  width: 100%; max-width: 380px;
}
.auth-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 8px;
}
.auth-tab {
  flex: 1; padding: 6px; border-radius: 6px; border: none;
  font-family: var(--font); font-size: 13px; cursor: pointer;
  color: var(--text-2); background: none; transition: background 0.1s, color 0.1s;
}
.auth-tab.active { background: var(--bg); color: var(--text); font-weight: 500; }

/* ── TOAST ───────────────────────────────────────────────────────────────────── */
.fs-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--accent); color: var(--accent-text);
  padding: 10px 20px; border-radius: 20px;
  font-size: 13px; font-family: var(--font);
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  pointer-events: none; z-index: 999; white-space: nowrap;
}
.fs-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── LANDING SCREEN ──────────────────────────────────────────────────────────── */
.landing-wrap { max-width: 680px; margin: 0 auto; padding: 24px 0 48px; }
.landing-hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 48px 24px 40px; gap: 12px;
}
.landing-logo { margin-bottom: 4px; }
.landing-title { font-size: 36px; font-weight: 500; color: var(--text); }
.landing-sub { font-size: 15px; color: var(--text-2); max-width: 340px; line-height: 1.6; }
.landing-actions { margin-top: 8px; }
.landing-btn { padding: 10px 28px; font-size: 14px; }

.landing-features {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px; padding: 0 8px;
}
@media (max-width: 600px) { .landing-features { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.landing-feature-card {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.landing-feature-icon { font-size: 20px; }
.landing-feature-title { font-size: 13px; font-weight: 500; color: var(--text); }
.landing-feature-desc { font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* ── SHARED BOARD ────────────────────────────────────────────────────────────── */
.shared-tabs {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 2px;
}
.shared-tab {
  padding: 6px 14px; border-radius: var(--radius);
  border: 0.5px solid var(--border); background: none;
  font-family: var(--font); font-size: 13px; color: var(--text-2);
  cursor: pointer; transition: background 0.1s, color 0.1s;
}
.shared-tab:hover { background: var(--bg-2); color: var(--text); }
.shared-tab.active { background: var(--accent); color: var(--accent-text); border-color: transparent; }

.shared-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* GOALS */
.goal-card {
  background: var(--bg-2); border-radius: var(--radius-lg);
  padding: 14px 16px; border: 0.5px solid var(--border);
}
.goal-card-header { display: flex; align-items: flex-start; gap: 10px; }
.goal-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.goal-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.goal-pct { font-size: 18px; font-weight: 500; font-family: var(--font-mono); color: var(--text); margin-left: auto; flex-shrink: 0; }
.goal-btns { display: flex; gap: 6px; }
.goal-btns .btn { padding: 5px 12px; font-size: 12px; }

/* CHAT */
.chat-messages {
  max-height: 380px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px 0 12px;
}
.chat-msg { display: flex; align-items: flex-end; gap: 8px; }
.chat-msg-me { flex-direction: row-reverse; }
.chat-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 500; color: #fff; flex-shrink: 0;
}
.chat-bubble-wrap { display: flex; flex-direction: column; gap: 2px; max-width: 70%; }
.chat-msg-me .chat-bubble-wrap { align-items: flex-end; }
.chat-name { font-size: 11px; color: var(--text-3); padding: 0 4px; }
.chat-bubble {
  background: var(--bg-2); border-radius: 12px 12px 12px 4px;
  padding: 8px 12px; font-size: 13.5px; color: var(--text);
  word-break: break-word; line-height: 1.5;
}
.chat-bubble-me { background: var(--accent); color: var(--accent-text); border-radius: 12px 12px 4px 12px; }
.chat-time { font-size: 10.5px; color: var(--text-3); padding: 0 4px; }
.chat-input-row {
  display: flex; gap: 8px; padding-top: 12px;
  border-top: 0.5px solid var(--border); margin-top: 4px;
}
.chat-input-row .modal-input { flex: 1; }

/* LIVE FOCUS */
.live-focus-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 0.5px solid var(--border);
}
.live-focus-row:last-child { border-bottom: none; }
.live-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; color: #fff; flex-shrink: 0;
}
.live-status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* LEADERBOARD */
.leaderboard-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-lg);
  background: var(--bg-2); border: 0.5px solid var(--border);
}
.leaderboard-me { border-color: var(--border-2); background: var(--bg); }
.leaderboard-rank { font-size: 18px; width: 28px; text-align: center; flex-shrink: 0; }
.leaderboard-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500; color: #fff; flex-shrink: 0;
}
.leaderboard-score {
  font-size: 14px; font-weight: 500; font-family: var(--font-mono);
  color: var(--text); flex-shrink: 0;
}

/* ── LOADING SPINNER ─────────────────────────────────────────────────────────── */
.loading-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-2);
  border-top-color: var(--text-2);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
