:root {
  --ink:        #1a1a2e;
  --ink-mid:    #4a4a6a;
  --ink-soft:   #8888a8;
  --rule:       #e8e8f0;
  --surface:    #ffffff;
  --canvas:     #f5f5fb;
  --accent:     #5b4fcf;
  --accent-lt:  #ede9ff;
  --green:      #2eb87a;
  --green-lt:   #e6f7f0;
  --amber:      #e8912a;
  --amber-lt:   #fff3e0;
  --red:        #e05252;
  --red-lt:     #fdeaea;

  --sidebar-w: 248px;
  --topbar-h: 72px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(26,26,46,.06), 0 2px 8px rgba(26,26,46,.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }
code { background: var(--accent-lt); padding: 1px 5px; border-radius: 4px; font-size: .85em; }

/* ================= LAYOUT ================= */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--ink);
  color: #cfcfe6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { padding: 22px 22px 14px; }
.brand-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 24px;
  color: #fff;
  line-height: 1;
}
.brand-sub {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 6px;
}

.nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.nav-section-label {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 16px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #cfcfe6;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.is-active { background: var(--accent); color: #fff; }
.nav-item--muted { color: var(--ink-soft); font-size: 12.5px; }
.nav-dot { width: 16px; text-align: center; font-size: 12px; flex-shrink: 0; }
.nav-empty { padding: 6px 12px; color: var(--ink-soft); font-size: 12.5px; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}
.user-meta { overflow: hidden; }
.user-name { color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.user-sub { color: var(--ink-soft); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  min-height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 16px;
  padding: 8px 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 19px; }
.page-sub { margin: 2px 0 0; color: var(--ink-soft); font-size: 12.5px; }
.topbar-center { justify-self: center; display: flex; align-items: center; }
.topbar-actions { display: flex; align-items: center; gap: 14px; justify-self: end; }
/* On roomy screens, nudge the timer to the TRUE screen middle by offsetting
   half the sidebar width (content-centre sits right of screen-centre). Scales
   with --sidebar-w, so it stays centred on any wide display. */
@media (min-width: 1280px) {
  .topbar-center { transform: translateX(calc(var(--sidebar-w) / -2)); }
}

.content { padding: 28px; flex: 1; }

/* ================= BUTTONS ================= */
.btn {
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn:hover { border-color: var(--ink-soft); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #4a3fc0; }
.btn-icon {
  border: 1px solid var(--rule);
  background: var(--surface);
  width: 30px; height: 30px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--ink-mid);
  font-size: 12px;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-start:hover { border-color: var(--green); color: var(--green); }

/* ================= TIMER PILL ================= */
.timer-pill { display: flex; align-items: center; gap: 10px; }
.timer-pill.is-idle { display: none; }
.timer-pill.is-running {
  background: var(--green-lt);
  border: 1px solid var(--green);
  border-radius: 999px;
  padding: 5px 6px 5px 14px;
}
.timer-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.timer-task { font-size: 12.5px; font-weight: 500; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-elapsed { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; color: var(--green); }
.timer-stop {
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: var(--green); color: #fff;
  cursor: pointer; font-size: 10px;
}
.timer-stop:hover { background: #26a069; }

/* ================= TODAY ================= */
.today-grid { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-head--spaced { margin-top: 32px; }
.section-head h2 { font-size: 15px; }
.section-add {
  font-size: 12.5px; color: var(--accent); cursor: pointer;
  padding: 4px 10px; border-radius: 6px;
}
.section-add:hover { background: var(--accent-lt); }

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-list--muted { opacity: .6; }

/* ================= TASK CARD ================= */
.task-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.task-card.priority-high { border-left-color: var(--red); }
.task-card.priority-medium { border-left-color: var(--amber); }
.task-card.priority-low { border-left-color: var(--ink-soft); }
.task-card.is-done { opacity: .55; }
.task-card.is-done .task-title { text-decoration: line-through; }

.task-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--rule);
  background: var(--surface); cursor: pointer;
  color: var(--green); font-size: 13px; flex-shrink: 0;
}
.task-card.is-done .task-check { background: var(--green); border-color: var(--green); color: #fff; }
.task-check:hover { border-color: var(--green); }

.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 500; font-size: 14px; }
.task-client { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--ink-soft); }
.task-client-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.task-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
/* All Tasks: filter tabs on the left, sort/group control on the right. */
.all-tasks-controls { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.all-tasks-controls .client-tabs { margin-bottom: 12px; }
.task-sort { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.field-input--sm { padding: 5px 8px; font-size: 13px; width: auto; }
.task-group-header { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); }
.task-group-header:first-child { margin-top: 0; }
.task-group-name { font-weight: 600; font-size: 13px; color: var(--ink); }
.task-group-count { font-size: 11px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1px 7px; }
.task-project { color: var(--ink-mid); font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.task-project:hover { color: var(--accent); }
.task-due, .task-est { font-size: 11.5px; color: var(--ink-soft); }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; }
.dot { font-size: 10px; }

/* ================= PILLS ================= */
.pill {
  display: inline-block;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: capitalize;
  font-weight: 600;
  letter-spacing: .02em;
}
.pill-priority.pill-high { background: var(--red-lt); color: var(--red); }
.pill-priority.pill-medium { background: var(--amber-lt); color: var(--amber); }
.pill-priority.pill-low { background: var(--canvas); color: var(--ink-soft); }
.pill-status { background: var(--accent-lt); color: var(--accent); }
.pill-status.pill-active { background: var(--green-lt); color: var(--green); }
.pill-status.pill-prospect { background: var(--amber-lt); color: var(--amber); }
.pill-status.pill-paused { background: var(--amber-lt); color: var(--amber); }
.pill-status.pill-completed { background: var(--accent-lt); color: var(--accent); }
.pill-status.pill-archived { background: var(--canvas); color: var(--ink-soft); }

/* ================= FOLLOW-UPS ================= */
.followup-list { display: flex; flex-direction: column; gap: 8px; }
.followup {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 11px 14px; box-shadow: var(--shadow);
}
.followup.is-overdue { border-color: var(--red); background: var(--red-lt); }
.followup-when { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--amber); width: 64px; flex-shrink: 0; }
.followup.is-overdue .followup-when { color: var(--red); }
.followup-note { font-weight: 500; }
.followup-who { font-size: 12px; color: var(--ink-soft); }
.followup-line { padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }

/* ================= PICK PANEL ================= */
.pick-panel { margin-top: 10px; }
.pick-box { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.pick-head { padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--ink-soft); border-bottom: 1px solid var(--rule); text-transform: uppercase; letter-spacing: .08em; }
.pick-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: none; border: none; border-bottom: 1px solid var(--rule); cursor: pointer; text-align: left; font-size: 13px; }
.pick-row:last-child { border-bottom: none; }
.pick-row:hover { background: var(--accent-lt); }
.pick-title { font-weight: 500; }
.pick-project { font-size: 12px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 5px; }
.pick-empty, .pick-panel:empty { display: none; }

/* ================= PANELS / STATS ================= */
.today-panel { display: flex; flex-direction: column; gap: 16px; }
.panel-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel-card h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: 14px; }
.panel-card--accent { background: var(--accent); color: #fff; }
.panel-card--accent h3 { color: rgba(255,255,255,.7); }
.running-task { font-weight: 600; font-size: 15px; }
.running-project { color: rgba(255,255,255,.8); font-size: 13px; margin-top: 4px; }

.stat { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.stat-num { font-size: 28px; font-weight: 700; color: var(--ink); }
.stat-label { color: var(--ink-soft); font-size: 12.5px; }
.panel-card hr { border: none; border-top: 1px solid var(--rule); margin: 14px 0; }
.stat-row { display: flex; justify-content: space-between; padding: 5px 0; }
.stat-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-val--green { color: var(--green); }

/* ================= CARD / DETAIL LISTS ================= */
.card-list { display: flex; flex-direction: column; gap: 8px; max-width: 860px; }
.row-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 15px 18px; box-shadow: var(--shadow);
}
.row-card:hover { border-color: var(--accent); }
.row-title { font-weight: 600; font-size: 14.5px; }
.row-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }
.row-side { display: flex; align-items: center; gap: 14px; }
.row-count { font-size: 12.5px; color: var(--ink-soft); }

.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
.detail-main h2 { font-size: 15px; margin-bottom: 12px; }
.detail-main h2.mt { margin-top: 28px; }
.detail-side { display: flex; flex-direction: column; gap: 16px; }

.activity-list { display: flex; flex-direction: column; gap: 6px; }
.activity { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.activity-type { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--accent); background: var(--accent-lt); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.activity-type--task_completed { color: var(--green); background: var(--green-lt); }
.activity-type--time_logged { color: var(--amber); background: var(--amber-lt); }
.activity-title { font-weight: 500; }
.activity-when { font-size: 11.5px; color: var(--ink-soft); }

.contact-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.contact-line:last-child { border-bottom: none; }
.contact-name { font-weight: 500; }
.contact-role { font-size: 12px; color: var(--ink-soft); }
.tag { font-size: 10px; background: var(--green-lt); color: var(--green); padding: 1px 6px; border-radius: 5px; font-weight: 600; }

.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--ink-soft); font-size: 12.5px; }
.kv dd { margin: 0; font-size: 13px; }
.notes { color: var(--ink-mid); font-size: 13px; white-space: pre-wrap; }

/* ================= EMPTY STATE ================= */
.empty-state { color: var(--ink-soft); font-size: 13px; padding: 20px; background: var(--surface); border: 1px dashed var(--rule); border-radius: var(--radius); text-align: center; }
.empty-state--large { padding: 64px 20px; }
.empty-icon { font-size: 40px; color: var(--rule); margin-bottom: 12px; }
.muted { color: var(--ink-soft); }

/* ================= AUTH / LOGIN ================= */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--ink);
}
.auth-card {
  width: 100%; max-width: 360px;
  background: var(--surface);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand .brand-mark { color: var(--ink); font-size: 30px; }
.auth-brand .brand-sub { color: var(--ink-soft); margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; }
.auth-label { font-size: 12px; font-weight: 600; color: var(--ink-mid); margin: 12px 0 5px; }
.auth-input {
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; color: var(--ink);
  background: var(--surface);
}
.auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lt); }
.auth-remember { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-mid); margin: 14px 0 4px; }
.auth-submit { margin-top: 16px; width: 100%; padding: 11px; font-size: 14px; }
.auth-flash { border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.auth-flash--error { background: var(--red-lt); color: var(--red); }
.auth-flash--info { background: var(--accent-lt); color: var(--accent); }

.logout-form { margin: 0; margin-left: auto; }
.logout-btn {
  background: none; border: 1px solid rgba(255,255,255,.14);
  color: var(--ink-soft); width: 30px; height: 30px; border-radius: 7px;
  cursor: pointer; font-size: 14px; flex-shrink: 0;
}
.logout-btn:hover { color: #fff; border-color: rgba(255,255,255,.35); }

/* ================= PHASE 2 · CRM ================= */

/* Button variants */
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-xs { width: 26px; height: 26px; font-size: 11px; border-radius: 6px; }
.btn-ghost { background: none; border: 1px solid var(--rule); color: var(--ink-mid); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.inline-block { display: inline-block; }

/* Nav badge */
.nav-badge {
  margin-left: auto; background: rgba(255,255,255,.14); color: #fff;
  font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
}
.nav-item.is-active .nav-badge { background: rgba(255,255,255,.28); }

/* Status dot */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.active   { background: var(--green); }
.status-dot.prospect { background: var(--accent); }
.status-dot.paused   { background: var(--amber); }
.status-dot.archived { background: var(--ink-soft); }

/* Clients index layout */
.clients-grid { display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: start; }
.clients-side { display: flex; flex-direction: column; gap: 16px; }

.client-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.client-tab {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  padding: 7px 13px; font-size: 12.5px; font-weight: 500; color: var(--ink-mid); cursor: pointer;
}
.client-tab:hover { border-color: var(--ink-soft); }
.client-tab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab-count { opacity: .6; margin-left: 5px; font-variant-numeric: tabular-nums; }

.client-list { display: flex; flex-direction: column; gap: 8px; }
.client-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.client-card { text-decoration: none; color: inherit; cursor: pointer; }
.client-card:hover { border-color: var(--accent); }
.client-card:hover .client-card-name { color: var(--accent); }
.client-card-main { flex: 1; min-width: 0; }
.client-card-name { font-weight: 600; font-size: 14.5px; display: block; }
.client-card-go { font-size: 12.5px; color: var(--accent); flex-shrink: 0; }
.client-card:hover .client-card-go { text-decoration: underline; }
.client-card-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.soft-pill { font-size: 11px; background: var(--canvas); color: var(--ink-mid); padding: 2px 9px; border-radius: 999px; }
.client-card-contact { font-size: 12px; color: var(--ink-soft); }
.client-card-stats { display: flex; gap: 16px; }
.mini-stat { text-align: center; }
.mini-num { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-label { font-size: 10.5px; color: var(--ink-soft); }

/* Client detail header */
.client-header { margin-bottom: 22px; }
.client-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.client-header-name { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.client-header-sub { margin: 6px 0 0; color: var(--ink-soft); font-size: 13px; }
.client-header-notes { margin: 10px 0 0; color: var(--ink-mid); font-size: 13px; max-width: 640px; white-space: pre-wrap; }
.client-header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Three-column detail grid */
.client-detail-grid { display: grid; grid-template-columns: 240px 1fr 240px; gap: 20px; align-items: start; }

.detail-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.detail-card-title { font-size: 11px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; }
.client-projects { margin-top: 20px; }

/* Contacts */
.contact-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.contact-card { display: flex; gap: 11px; align-items: flex-start; }
.contact-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-lt); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.contact-avatar.primary { background: var(--accent); color: #fff; }
.contact-card-body { flex: 1; min-width: 0; }
.contact-card-name { font-weight: 500; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.contact-card-role { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.contact-card-links { display: flex; gap: 8px; margin-top: 4px; font-size: 13px; }
.contact-card-addresses { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.contact-address { font-size: 12px; color: var(--ink-soft); line-height: 1.35; white-space: pre-line; }
.contact-address-label { display: inline-block; min-width: 46px; font-weight: 600; color: var(--ink); margin-right: 6px; }
.contact-card-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Activity timeline */
.activity-composer { background: var(--canvas); border: 1px solid var(--rule); border-radius: 9px; padding: 12px; margin-bottom: 14px; }
.composer-row { margin-bottom: 8px; }
.composer-type { border: 1px solid var(--rule); border-radius: 7px; padding: 6px 10px; font-size: 12.5px; background: var(--surface); }
.composer-body { width: 100%; border: 1px solid var(--rule); border-radius: 7px; padding: 8px 10px; font-size: 13px; font-family: inherit; resize: vertical; outline: none; }
.composer-body:focus { border-color: var(--accent); }
.composer-actions { margin-top: 8px; text-align: right; }
.activity-feed { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 16px; flex-shrink: 0; width: 24px; text-align: center; }
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-size: 13px; font-weight: 500; }
.activity-text { font-size: 12.5px; color: var(--ink-mid); margin-top: 2px; white-space: pre-wrap; }
.activity-time { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

/* Follow-ups */
.followups-list { display: flex; flex-direction: column; margin-bottom: 12px; }
.followup-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.followup-item:last-child { border-bottom: none; }
.followup-body { flex: 1; min-width: 0; }
.followup-note { font-size: 13px; font-weight: 500; }
.followup-meta { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.followup-who { color: var(--ink-mid); }
.followup-actions { display: flex; gap: 4px; flex-shrink: 0; }
.due-today    { color: var(--amber); font-weight: 600; }
.due-upcoming { color: var(--ink-soft); }
.due-overdue  { color: var(--red); font-weight: 700; }
.btn-done:hover { border-color: var(--green); color: var(--green); }

/* Project line on client detail */
.project-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.project-line:last-child { border-bottom: none; }
.project-line-name { font-weight: 500; }
.project-line-tasks { color: var(--ink-soft); font-size: 12.5px; }
.project-line-go { margin-left: auto; color: var(--accent); font-size: 12.5px; }
.project-line:hover .project-line-go { text-decoration: underline; }

/* Forms (shared) */
.form-page { max-width: 560px; }
.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-mid); margin-bottom: 5px; }
.field-input {
  width: 100%; border: 1px solid var(--rule); border-radius: 8px;
  padding: 9px 11px; font-size: 13px; font-family: inherit; color: var(--ink);
  background: var(--surface); outline: none; margin-bottom: 8px;
}
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lt); }
.field-input.has-error { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12px; margin: -4px 0 8px; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.empty-mini { color: var(--ink-soft); font-size: 12.5px; padding: 8px 0; }

.inline-form { background: var(--canvas); border: 1px solid var(--rule); border-radius: 9px; padding: 14px; margin-top: 10px; }

/* ================= PHASE 3 · PROJECTS + TASKS ================= */
:root { --accent-mid: #8b80e0; }

/* Projects index */
.projects-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.project-group { margin-bottom: 26px; }
.project-group-head { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: 10px; }
.project-group-head a:hover { color: var(--accent); }
.project-list { display: flex; flex-direction: column; gap: 8px; }

.project-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.project-card:hover { border-color: var(--accent); }
.project-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.project-card-main { flex: 1; min-width: 0; }
.project-card-name { font-weight: 600; font-size: 14.5px; }
.project-card-progress { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.project-card-progress .progress-bar-wrap { max-width: 180px; }
.project-card-progress-label { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }
.project-card-side { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.project-card-hours { font-size: 12.5px; color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.project-card-target { font-size: 12px; color: var(--ink-soft); }
.project-card-target.overdue { color: var(--red); font-weight: 600; }

/* Client-detail project line extras */
.detail-card-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.detail-card-title-row .detail-card-title { margin-bottom: 0; }
.detail-card-hint { font-size: 12px; color: var(--ink-soft); margin: -6px 0 12px; }
.client-tasks { margin-top: 20px; }
.client-tasks #client-task-form-container:not(:empty) { margin-bottom: 12px; }
.project-line-progress { width: 90px; flex-shrink: 0; }
.project-line-progress .progress-bar-wrap { margin-top: 0; }
.project-line-target { font-size: 12px; color: var(--ink-soft); }
.project-line-target.overdue { color: var(--red); font-weight: 600; }

/* Project detail */
.project-detail-grid { display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: start; }
.task-filter-tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.task-filter { font-size: 12px; color: var(--ink-mid); padding: 6px 11px; border-radius: 7px; }
.task-filter:hover { background: var(--canvas); }
.task-filter.is-active { background: var(--ink); color: #fff; }
.add-task-btn { margin-bottom: 12px; }

/* Task list */
.task-list { display: flex; flex-direction: column; }

/* Task row */
.task-row {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 9px; padding: 11px 14px 11px 18px;
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px;
  position: relative; transition: border-color .15s;
}
.task-row:hover { border-color: var(--accent-mid); }
.task-row.done { opacity: .5; }
.priority-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 9px 0 0 9px; }
.priority-high .priority-bar { background: var(--red); }
.priority-medium .priority-bar { background: var(--amber); }
.priority-low .priority-bar { background: var(--green); }

.task-check {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--rule);
  background: var(--surface); cursor: pointer; color: var(--green); font-size: 13px;
  flex-shrink: 0; margin-top: 1px;
}
.task-check:hover { border-color: var(--green); }
.task-check.checked { background: var(--green); border-color: var(--green); color: #fff; }

.task-body { flex: 1; min-width: 0; cursor: pointer; }
.task-row .task-title { font-weight: 500; font-size: 14px; }
.task-row .task-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--canvas); color: var(--ink-mid); }
.tag-due.overdue { background: var(--red-lt); color: var(--red); font-weight: 600; }
.tag-due.due-today { background: var(--amber-lt); color: var(--amber); font-weight: 600; }
.status-badge { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }

.status-select {
  border: 1px solid var(--rule); border-radius: 5px; padding: 3px 6px;
  font-size: 11px; font-family: inherit; color: var(--ink-mid);
  background: var(--canvas); cursor: pointer; outline: none;
}
.status-select:focus { border-color: var(--accent); }

.task-actions { display: flex; gap: 4px; align-items: center; opacity: 0; transition: opacity .15s; flex-shrink: 0; }
.task-row:hover .task-actions { opacity: 1; }
.task-action-btn {
  background: none; border: 1px solid transparent; border-radius: 6px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink-soft); font-size: 13px; transition: all .15s;
}
.task-action-btn:hover { background: var(--canvas); border-color: var(--rule); color: var(--ink); }
.task-action-btn.active { color: var(--amber); }

/* Task detail slideout */
.task-detail-panel {
  position: fixed; top: 0; right: 0; width: 380px; max-width: 92vw; height: 100vh;
  background: var(--surface); border-left: 1px solid var(--rule); padding: 24px;
  transform: translateX(100%); transition: transform .25s ease; z-index: 200;
  overflow-y: auto; box-shadow: -4px 0 24px rgba(0,0,0,.08);
}
.task-detail-panel.open { transform: translateX(0); }
.task-panel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.15); z-index: 199; opacity: 0; pointer-events: none; transition: opacity .25s; }
.task-panel-overlay.visible { opacity: 1; pointer-events: auto; }
.panel-close { float: right; background: none; border: none; font-size: 16px; color: var(--ink-soft); cursor: pointer; }
.panel-close:hover { color: var(--ink); }
.panel-title-input { width: 100%; border: none; border-bottom: 2px solid transparent; font-size: 18px; font-weight: 600; padding: 4px 0; margin: 8px 0 18px; outline: none; }
.panel-title-input:focus { border-bottom-color: var(--accent); }
.panel-field { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.panel-field .field-input { margin-bottom: 0; }
.panel-field-block { margin-bottom: 14px; }
.panel-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); min-width: 84px; }
.panel-field-block .panel-label { display: block; margin-bottom: 5px; }
.panel-value { font-size: 13px; color: var(--accent); }
.panel-timelog { background: var(--canvas); border-radius: 8px; padding: 12px; margin: 14px 0; }
.panel-timelog-val { font-size: 15px; font-weight: 600; margin-top: 4px; }
.panel-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.panel-actions .btn.active { color: var(--amber); border-color: var(--amber); }

/* Progress bar */
.progress-bar-wrap { height: 5px; background: var(--rule); border-radius: 3px; overflow: hidden; width: 100%; margin-top: 8px; }
.progress-bar-fill { height: 100%; border-radius: 3px; transition: width .3s ease; }

/* Colour swatches */
.colour-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.colour-swatch { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.colour-swatch:hover { transform: scale(1.15); }
.colour-swatch.selected { border-color: var(--ink); transform: scale(1.15); }

/* ================= PHASE 4 · TODAY VIEW ================= */
.today-layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start; }

.today-section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mid); }
.task-count { background: var(--canvas); border: 1px solid var(--rule); color: var(--ink-soft); font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; }
.add-from-projects { margin: 8px 0 4px; }

/* Today task row */
.today-task-row {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 9px;
  padding: 12px 14px 12px 18px; display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px; position: relative; transition: border-color .15s, box-shadow .15s;
}
.today-task-row:hover { border-color: var(--accent-mid); box-shadow: 0 2px 8px rgba(91,79,207,.06); }
.today-task-row.done { opacity: .45; }
.today-task-row.priority-high { border-left: 3px solid var(--red); }
.today-task-row.priority-medium { border-left: 3px solid var(--amber); }
.today-task-row.priority-low { border-left: 3px solid var(--green); }
.task-row-ghost { opacity: .4; background: var(--accent-lt); }

.drag-handle { color: var(--rule); cursor: grab; font-size: 14px; flex-shrink: 0; user-select: none; padding: 2px; transition: color .15s; }
.today-task-row:hover .drag-handle { color: var(--ink-soft); }
.drag-handle:active { cursor: grabbing; }

.today-task-body { flex: 1; min-width: 0; }
.today-task-title { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-task-title.strikethrough { text-decoration: line-through; }
.today-task-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.tag-dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; margin-right: 3px; vertical-align: middle; }
.tag-project { font-weight: 600; }

.timer-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 12px; flex-shrink: 0; transition: all .15s; background: var(--canvas); color: var(--ink-soft);
}
.timer-btn:hover { background: var(--accent); color: #fff; }
.timer-btn.running { background: var(--green); color: #fff; }

.today-remove-btn {
  width: 22px; height: 22px; border: none; background: none; color: var(--rule);
  cursor: pointer; font-size: 11px; flex-shrink: 0; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; transition: all .15s; opacity: 0;
}
.today-task-row:hover .today-remove-btn { opacity: 1; }
.today-remove-btn:hover { background: var(--red-lt); color: var(--red); }

/* Empty state */
.today-empty { text-align: center; padding: 60px 24px; color: var(--ink-soft); }
.today-all-done { padding: 32px 24px; }
.today-empty-icon { font-size: 40px; margin-bottom: 16px; }
.today-empty h3 { font-size: 18px; color: var(--ink); margin-bottom: 8px; font-weight: 500; }
.today-empty p { font-size: 13px; line-height: 1.6; margin-bottom: 20px; }

/* Right panel */
.today-right-panel { display: flex; flex-direction: column; gap: 12px; }
.stats-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.stats-card-title { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.stats-card .stat-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.stats-card .stat-row:last-child { margin-bottom: 0; }
.stat-number { font-family: Georgia, 'Times New Roman', serif; font-size: 22px; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.stats-card .stat-label { font-size: 11px; color: var(--ink-soft); }

.project-time-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.project-time-row:last-child { margin-bottom: 0; }
.project-time-label { font-size: 11px; font-weight: 600; width: 66px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-time-row .progress-bar-wrap { margin-top: 0; }
.project-time-hrs { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.count-badge { background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 8px; margin-left: auto; }

/* Follow-up mini */
.followup-mini { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.followup-mini:last-child { border-bottom: none; }
.followup-mini-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-lt); color: var(--accent); font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.followup-mini-body { flex: 1; min-width: 0; }
.followup-mini-name { font-size: 11px; font-weight: 500; }
.followup-mini-note { font-size: 10px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.followup-done-btn { background: none; border: 1px solid var(--rule); border-radius: 5px; padding: 2px 6px; font-size: 11px; cursor: pointer; color: var(--ink-soft); flex-shrink: 0; transition: all .15s; }
.followup-done-btn:hover { background: var(--green-lt); border-color: var(--green); color: var(--green); }

/* Quick-add popover */
.quick-add-wrap { position: relative; }
#quick-add-container:not(:empty) {
  position: absolute; right: 0; top: calc(100% + 8px); width: 320px; z-index: 120;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
  padding: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.14);
}
.quick-add-form .field-row { display: flex; gap: 8px; }
.quick-add-form .field-row .field-input { flex: 1; }

/* Task picker modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 300; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-overlay.visible { opacity: 1; pointer-events: auto; }
.pick-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; width: 480px; max-width: 92vw; max-height: 70vh; overflow-y: auto; z-index: 301; box-shadow: 0 20px 60px rgba(0,0,0,.15); padding: 20px; }
.pick-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.pick-modal-title { font-size: 15px; font-weight: 600; }
.pick-modal-close { background: none; border: none; color: var(--ink-soft); cursor: pointer; font-size: 18px; line-height: 1; }
.pick-project-group { margin-bottom: 16px; }
.pick-project-header { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.pick-task-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; transition: background .1s; }
.pick-task-row:hover { background: var(--canvas); }
.pick-task-row.added { opacity: .55; }
.pick-task-title { flex: 1; font-size: 12px; }
.added-badge { font-size: 10px; color: var(--green); font-weight: 600; }
.priority-indicator { width: 16px; height: 16px; border-radius: 3px; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pick-task-row.priority-high .priority-indicator { background: var(--red-lt); color: var(--red); }
.pick-task-row.priority-medium .priority-indicator { background: var(--amber-lt); color: var(--amber); }
.pick-task-row.priority-low .priority-indicator { background: var(--green-lt); color: var(--green); }
.pick-add-btn { background: none; border: 1px solid var(--rule); border-radius: 6px; width: 24px; height: 24px; cursor: pointer; color: var(--accent); font-size: 13px; flex-shrink: 0; }
.pick-add-btn:hover { background: var(--accent-lt); border-color: var(--accent); }

.btn-full { width: 100%; justify-content: center; text-align: center; }

/* ================= PHASE 5 · TIME TRACKER ================= */

/* Timer pill (topbar) */
.timer-pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; transition: all .2s; }
.timer-pill.stopped { background: var(--canvas); color: var(--ink-soft); border: 1px solid var(--rule); }
.timer-dot.inactive { background: var(--rule); animation: none; }
.timer-idle-text { font-size: 11px; }

/* Running timer — a large, dominant module so elapsed time is unmissable. */
.timer-pill.running {
  background: var(--ink); color: #fff; gap: 14px;
  padding: 8px 10px 8px 16px; border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.timer-pill.running .timer-dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--green);
  flex-shrink: 0; animation: pulse 1.5s infinite;
}
.timer-main { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.02; min-width: 0; }
.timer-elapsed {
  font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums;
  font-size: 44px; font-weight: 700; color: var(--green); letter-spacing: .5px;
}
.timer-task-name {
  color: rgba(255,255,255,.72); font-size: 12.5px; font-weight: 500; margin-top: 3px;
  max-width: 300px; line-height: 1.25;
  /* Wrap over up to 3 lines instead of truncating to one. */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.timer-btns { display: flex; flex-direction: column; gap: 5px; align-self: stretch; }
.timer-btns button {
  flex: 1; border: none; color: #fff; border-radius: 8px; padding: 4px 14px;
  font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
  background: rgba(255,255,255,.15); transition: background .15s;
}
.timer-pause-btn:hover { background: var(--amber); }
.timer-stop-btn:hover { background: var(--red); }

/* Paused pill — frozen clock in amber (not counting). */
.timer-pill.paused { background: var(--ink); color: #fff; gap: 14px;
  padding: 8px 10px 8px 16px; border-radius: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.timer-dot.paused { width: 11px; height: 11px; border-radius: 50%; background: var(--amber); flex-shrink: 0; animation: none; }
.timer-elapsed.frozen { color: var(--amber); }
.timer-resume-btn { background: rgba(255,255,255,.16); }
.timer-resume-btn:hover { background: var(--green); }
.running-badge { background: var(--green-lt); color: var(--green); font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 4px; letter-spacing: .5px; }

/* Time log page */
.time-log-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
#manual-entry-container:not(:empty) { background: var(--canvas); border: 1px solid var(--rule); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.manual-entry-form .field-row { display: flex; gap: 12px; }
.manual-entry-form .field-row .field { flex: 1; }
.field-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-mid); margin: 4px 0 10px; }
.optional { color: var(--ink-soft); font-weight: 400; font-size: 11px; }

.time-summary-bar { display: flex; align-items: center; gap: 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 20px; margin-bottom: 20px; box-shadow: var(--shadow); flex-wrap: wrap; }
.summary-stat { display: flex; align-items: baseline; gap: 5px; }
.summary-number { font-family: Georgia, 'Times New Roman', serif; font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.summary-number.billable { color: var(--green); }
.summary-number.accent { color: var(--accent); }
.summary-number.muted { color: var(--ink-soft); }
.summary-label { font-size: 11px; color: var(--ink-soft); }
.summary-divider { width: 1px; height: 30px; background: var(--rule); }

.log-filters { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.log-filters select { border: 1px solid var(--rule); border-radius: 7px; padding: 7px 10px; font-size: 12px; font-family: inherit; color: var(--ink-mid); background: var(--surface); outline: none; cursor: pointer; }
.log-filters select:focus { border-color: var(--accent); }

.log-date-group { margin-bottom: 20px; }
.log-date-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 2px solid var(--rule); margin-bottom: 6px; }
.log-date-label { font-size: 12px; font-weight: 600; color: var(--ink-mid); }
.log-date-total { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.log-entry-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; margin-bottom: 3px; background: var(--surface); border: 1px solid var(--rule); transition: border-color .15s; }
.log-entry-row:hover { border-color: var(--accent-mid); }
.log-entry-row.non-billable { opacity: .7; }
.entry-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.entry-body { flex: 1; min-width: 0; }
.entry-task-name { font-size: 13px; font-weight: 500; }
.entry-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.entry-project { font-size: 11px; font-weight: 500; }
.entry-client { font-size: 11px; color: var(--ink-soft); }
.entry-time-range { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.entry-notes { font-size: 11px; color: var(--ink-mid); font-style: italic; }
.entry-duration { font-size: 13px; font-weight: 500; color: var(--ink); min-width: 50px; text-align: right; font-variant-numeric: tabular-nums; }
.entry-amount { font-size: 12px; color: var(--ink-soft); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.entry-amount.muted { color: var(--rule); }

.billable-toggle { width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--rule); background: none; font-size: 10px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; flex-shrink: 0; }
.billable-toggle.on { background: var(--green-lt); color: var(--green); border-color: var(--green); }
.billable-toggle.off { color: var(--ink-soft); }
.billable-toggle:hover { border-color: var(--green); }

.entry-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.log-entry-row:hover .entry-actions { opacity: 1; }
.entry-action-btn { background: none; border: 1px solid var(--rule); border-radius: 5px; padding: 2px 8px; font-size: 10px; cursor: pointer; color: var(--ink-soft); font-family: inherit; transition: all .15s; }
.entry-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.entry-action-btn.delete:hover { border-color: var(--red); color: var(--red); }
.log-entry-edit { background: var(--canvas); border: 1px solid var(--accent); border-radius: 8px; padding: 12px 14px; margin-bottom: 3px; }
.log-entry-edit .field-row { display: flex; gap: 10px; }
.log-entry-edit .field-row .field { flex: 1; }

.duration-inputs { display: flex; align-items: center; gap: 6px; }
.duration-part { width: 56px !important; }

/* Task detail panel — time section */
.task-time-section { border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 14px; }
.task-time-total { font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.task-time-entry { display: flex; gap: 8px; font-size: 11px; color: var(--ink-soft); padding: 3px 0; border-bottom: 1px solid var(--rule); }
.task-time-entry:last-child { border-bottom: none; }
.task-time-date { min-width: 40px; }
.task-time-dur { font-weight: 500; color: var(--ink-mid); min-width: 40px; font-variant-numeric: tabular-nums; }
.task-time-note { font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= PHASE 6 · REPORTS ================= */
.report-section-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 4px 0 12px; }

.period-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.period-stat { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); }
.period-stat-number { font-family: Georgia, 'Times New Roman', serif; font-size: 24px; color: var(--ink); line-height: 1; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.period-stat-label { font-size: 11px; color: var(--ink-soft); }

.report-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 28px; }
.report-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 18px 20px; transition: border-color .15s, box-shadow .15s; text-decoration: none; display: block; box-shadow: var(--shadow); }
.report-card:hover { border-color: var(--accent-mid); box-shadow: 0 4px 16px rgba(91,79,207,.08); }
.report-card-icon { font-size: 22px; margin-bottom: 10px; }
.report-card-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.report-card-desc { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.report-card-link { font-size: 11px; color: var(--accent); margin-top: 10px; display: block; }

.budget-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.budget-row:last-child { border-bottom: none; }
.budget-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.budget-name { font-size: 13px; font-weight: 500; color: var(--ink); text-decoration: none; width: 160px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-name:hover { color: var(--accent); }
.budget-row .progress-bar-wrap { margin-top: 0; }
.budget-pct { font-size: 11px; font-weight: 600; color: var(--green); width: 40px; text-align: right; flex-shrink: 0; }
.budget-pct.warn { color: var(--amber); }
.budget-pct.danger { color: var(--red); }
.budget-no-cap { font-size: 11px; color: var(--ink-soft); flex: 1; }
.budget-earned { font-size: 12px; color: var(--ink-soft); margin-left: auto; font-variant-numeric: tabular-nums; }

/* Report nav + blocks */
.report-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.report-nav-label { font-size: 15px; font-weight: 600; color: var(--ink); flex: 1; text-align: center; }
.btn.disabled { opacity: .35; pointer-events: none; }
.export-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; color: var(--ink-soft); border: 1px solid var(--rule); border-radius: 7px; padding: 5px 10px; text-decoration: none; transition: all .15s; background: var(--surface); }
.export-btn:hover { border-color: var(--accent); color: var(--accent); }
.log-filters-select { border: 1px solid var(--rule); border-radius: 7px; padding: 7px 10px; font-size: 12px; font-family: inherit; color: var(--ink-mid); background: var(--surface); outline: none; cursor: pointer; }
.log-filters-select:focus { border-color: var(--accent); }

.report-summary-line { font-size: 14px; color: var(--ink-mid); margin-bottom: 20px; font-weight: 500; }
.report-budget-line { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 2px; }
.report-block { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.report-block-title { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; }

/* Bar chart */
.bar-chart-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-label { font-size: 12px; font-weight: 500; color: var(--ink-mid); width: 130px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.bar-value { font-size: 12px; font-weight: 500; color: var(--ink); width: 42px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bar-secondary { font-size: 12px; color: var(--ink-soft); width: 56px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* Day bars (weekly) */
.day-bars { display: flex; gap: 8px; align-items: flex-end; }
.day-col { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.day-bar-wrap { width: 100%; display: flex; justify-content: center; align-items: flex-end; height: 92px; }
.day-bar { width: 28px; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; transition: height .3s ease; }
.day-bar.empty { background: var(--rule); }
.day-label { font-size: 10px; color: var(--ink-soft); }
.day-hours { font-size: 10px; font-weight: 600; color: var(--ink-mid); min-height: 12px; }

/* Report log rows / tables */
.report-log-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 12.5px; }
.report-log-row:last-child { border-bottom: none; }
.report-log-project { font-weight: 600; width: 110px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-log-task { flex: 1; color: var(--ink-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-log-dur { width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.report-log-amt { width: 50px; text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.report-table { display: flex; flex-direction: column; }
.report-table-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 12.5px; }
.report-table-row:last-child { border-bottom: none; }
.report-table-row.done { opacity: .6; }
.report-table-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-table-hrs { width: 70px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.report-table-amt { width: 60px; text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* Client report cards */
.client-report-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.client-report-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.client-report-name { font-size: 14px; font-weight: 600; }
.client-report-totals { font-size: 13px; color: var(--ink-mid); font-variant-numeric: tabular-nums; }
.client-report-pct { font-size: 11px; color: var(--ink-soft); margin-top: 5px; }
.client-report-projects { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.client-project-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 4px 0; color: var(--ink-mid); }
.client-project-row a:hover { color: var(--accent); }

/* Projection box */
.projection-box { background: var(--accent-lt); border: 1px solid rgba(91,79,207,.2); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.projection-box p { font-size: 12.5px; color: var(--accent); line-height: 1.6; margin: 0; }
.projection-box strong { color: var(--ink); }

/* ================= PHASE 7 · AUTH / BILLING / MARKETING ================= */
.auth-link { font-size: 12.5px; color: var(--accent); text-decoration: none; display: block; text-align: center; margin-top: 12px; }
.auth-link:hover { text-decoration: underline; }
.auth-divider { font-size: 11px; color: var(--ink-soft); text-align: center; margin: 16px 0 6px; text-transform: uppercase; letter-spacing: .08em; }
.auth-flash--success { background: var(--green-lt); color: var(--green); }

/* Flash messages (in-app) */
.flash { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; max-width: 640px; }
.flash-success { background: var(--green-lt); color: var(--green); }
.flash-error { background: var(--red-lt); color: var(--red); }
.flash-info { background: var(--accent-lt); color: var(--accent); }

/* Trial banner */
.trial-banner { background: var(--accent-lt); border-bottom: 1px solid rgba(91,79,207,.2); padding: 8px 20px; font-size: 12px; color: var(--accent); text-align: center; }
.trial-banner a { color: var(--accent); font-weight: 600; margin-left: 8px; }

/* Sidebar plan badge */
.sidebar-billing-link { display: inline-block; margin-top: 3px; }
.plan-badge { font-size: 9px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; padding: 2px 7px; border-radius: 8px; background: rgba(255,255,255,.14); color: #cfcfe6; }
.plan-badge.trial { background: rgba(232,145,42,.22); color: var(--amber); }
.plan-badge.solo { background: rgba(91,79,207,.25); color: #b3aaf0; }
.plan-badge.team { background: rgba(46,184,122,.22); color: var(--green); }
.plan-badge.agency { background: rgba(91,79,207,.35); color: #cfc7ff; }
.logout-btn[href] { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* Pricing cards */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 860px; margin: 0 auto; }
.pricing-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 24px; position: relative; box-shadow: var(--shadow); }
.pricing-card.highlight { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 3px 10px; border-radius: 10px; white-space: nowrap; }
.pricing-name { font-size: 14px; font-weight: 600; color: var(--ink-mid); margin-bottom: 8px; }
.price-amount { font-family: Georgia, 'Times New Roman', serif; font-size: 36px; color: var(--ink); }
.price-period { font-size: 13px; color: var(--ink-soft); }
.pricing-annual { font-size: 11px; color: var(--ink-soft); margin: 4px 0 16px; }
.pricing-features { list-style: none; padding: 0; margin: 0 0 20px; }
.pricing-features li { font-size: 12px; color: var(--ink-mid); padding: 4px 0; }
.pricing-annual-link { display: block; text-align: center; font-size: 11px; color: var(--accent); text-decoration: none; margin-top: 8px; }

/* Settings sections */
.settings-section { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.settings-section-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.settings-field { margin-bottom: 14px; }
.settings-field label { display: block; font-size: 11px; font-weight: 500; color: var(--ink-mid); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .8px; }
.settings-field input, .settings-field select { width: 100%; max-width: 360px; border: 1px solid var(--rule); border-radius: 8px; padding: 9px 12px; font-size: 13px; font-family: inherit; outline: none; }
.settings-field input:focus { border-color: var(--accent); }
.settings-field input:disabled { background: var(--canvas); color: var(--ink-soft); }
.settings-hint { font-size: 11.5px; color: var(--ink-soft); margin: 10px 0 0; }

/* Changelog page */
.changelog { max-width: 720px; }
.changelog > .btn { margin-bottom: 20px; }
.changelog-group { margin-bottom: 36px; }
.changelog-group-head h2 { font-size: 18px; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.changelog-group-head p { font-size: 13px; color: var(--ink-soft); margin: 0 0 18px; }
.changelog-phases { list-style: none; margin: 0; padding: 0; }
.changelog-phase { display: flex; gap: 16px; position: relative; padding-bottom: 20px; }
.changelog-phase:not(:last-child)::before {
  content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--rule);
}
.changelog-phase-no {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; z-index: 1;
}
.changelog-phase-body h3 { font-size: 15px; font-weight: 600; color: var(--ink); margin: 5px 0 4px; }
.changelog-phase-body p { font-size: 13px; color: var(--ink-mid); line-height: 1.5; margin: 0; }
.changelog-updates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.changelog-updates li {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px;
}
.changelog-tag {
  flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-lt); border-radius: 20px; padding: 3px 10px; margin-top: 2px; min-width: 64px; text-align: center;
}
.changelog-updates strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 3px; }
.changelog-updates p { font-size: 13px; color: var(--ink-mid); line-height: 1.5; margin: 0; }
.changelog-foot { font-size: 12px; color: var(--ink-soft); text-align: center; margin-top: 8px; }
@media (max-width: 640px) {
  .changelog-updates li { flex-direction: column; gap: 8px; }
  .changelog-tag { text-align: left; }
}

/* Transient error toast (network / server errors) */
.m-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--red); color: #fff; font-size: 13px; font-weight: 500; padding: 11px 18px;
  border-radius: 9px; box-shadow: 0 8px 30px rgba(0,0,0,.2); z-index: 500; opacity: 0;
  pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw; text-align: center; }
.m-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.m-toast.success { background: var(--green); }

/* Marketing page */
.marketing-body { background: var(--canvas); }
.marketing-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 40px; border-bottom: 1px solid var(--rule); background: var(--surface); }
.marketing-nav .brand-mark { font-family: Georgia, serif; font-style: italic; font-size: 22px; color: var(--ink); }
.marketing-nav-actions { display: flex; gap: 10px; }
.marketing-hero { text-align: center; padding: 80px 40px 50px; max-width: 720px; margin: 0 auto; }
.marketing-headline { font-family: Georgia, 'Times New Roman', serif; font-size: 46px; line-height: 1.15; color: var(--ink); margin-bottom: 20px; }
.marketing-sub { font-size: 18px; color: var(--ink-mid); line-height: 1.6; margin-bottom: 30px; }
.marketing-cta { display: flex; gap: 12px; justify-content: center; }
.marketing-cta-note { font-size: 12px; color: var(--ink-soft); margin-top: 12px; }
.marketing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 20px 40px 40px; max-width: 900px; margin: 0 auto; }
.marketing-feature { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 20px; }
.marketing-feature-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.marketing-feature-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.marketing-pricing { text-align: center; padding: 40px; }
.marketing-pricing h2 { font-family: Georgia, serif; font-size: 26px; margin-bottom: 8px; }
.marketing-pricing-line { font-size: 14px; color: var(--ink-mid); margin-bottom: 4px; }
.marketing-footer { text-align: center; padding: 24px; font-size: 11px; color: var(--ink-soft); border-top: 1px solid var(--rule); }

/* ================= PHASE 8 · POLISH ================= */

/* Onboarding */
.onboarding-body { min-height: 100vh; background: var(--canvas); }
.onboarding-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 40px; border-bottom: 1px solid var(--rule); background: var(--surface); }
.onboarding-header .brand-mark { font-family: Georgia, serif; font-style: italic; font-size: 22px; color: var(--ink); }
.onboarding-progress { height: 3px; background: var(--rule); }
.onboarding-progress-fill { height: 100%; background: var(--accent); transition: width .4s ease; }
.onboarding-container { max-width: 520px; margin: 60px auto; padding: 0 20px; }
.onboarding-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 32px; box-shadow: var(--shadow); }
.onboarding-step-label { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.onboarding-title { font-family: Georgia, 'Times New Roman', serif; font-size: 26px; color: var(--ink); margin-bottom: 8px; line-height: 1.2; }
.onboarding-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 24px; }
.onboarding-field { margin-bottom: 16px; }
.onboarding-field label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-mid); margin-bottom: 5px; }
.onboarding-field input, .onboarding-field select { width: 100%; border: 1px solid var(--rule); border-radius: 8px; padding: 11px 14px; font-size: 14px; font-family: inherit; outline: none; transition: border-color .15s; }
.onboarding-field input:focus, .onboarding-field select:focus { border-color: var(--accent); }
.onboarding-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }
.skip-link { font-size: 12px; color: var(--ink-soft); text-decoration: none; background: none; border: none; cursor: pointer; }
.skip-link:hover { color: var(--ink); }
.onboarding-timer-demo { background: var(--ink); border-radius: 10px; padding: 14px 20px; display: flex; align-items: center; gap: 12px; margin: 20px 0 24px; color: #fff; font-size: 13px; }

/* Empty state additions */
.empty-title { font-size: 17px; font-weight: 500; color: var(--ink); margin-bottom: 8px; }
.empty-desc { font-size: 13px; line-height: 1.6; margin: 0 auto 20px; max-width: 320px; color: var(--ink-soft); }
.empty-secondary-link { display: block; font-size: 12px; color: var(--accent); text-decoration: none; margin-top: 12px; }
.empty-state-new-user { padding: 60px 24px; }

/* Marketing additions */
.btn-lg { padding: 14px 28px; font-size: 15px; }
.marketing-cta-group { display: flex; align-items: center; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.marketing-trust { font-size: 12px; color: var(--ink-soft); margin-top: 16px; }
.marketing-secondary-link { font-size: 13px; color: var(--accent); text-decoration: none; }
.marketing-secondary-link:hover { text-decoration: underline; }
.marketing-nav-links { display: flex; align-items: center; gap: 20px; }
.marketing-nav-links a:not(.btn) { font-size: 13px; color: var(--ink-mid); text-decoration: none; }
.marketing-nav-links a:not(.btn):hover { color: var(--ink); }
.marketing-screenshot-section { padding: 20px 40px 60px; text-align: center; }
.marketing-screenshot-wrap { display: inline-block; border-radius: 12px; overflow: hidden; border: 1px solid var(--rule); box-shadow: 0 20px 60px rgba(0,0,0,.1); max-width: 100%; }
.marketing-screenshot { max-width: 100%; display: block; }
.marketing-features-section, .marketing-comparison-section, .marketing-pricing-section, .marketing-about-section { padding: 60px 40px; }
.marketing-features-section, .marketing-comparison-section { background: var(--canvas); }
.marketing-section-title { font-family: Georgia, 'Times New Roman', serif; font-size: 32px; color: var(--ink); text-align: center; margin-bottom: 40px; }
.marketing-feature-icon { font-size: 24px; margin-bottom: 10px; }
.marketing-comparison-sub { text-align: center; font-size: 15px; color: var(--ink-mid); max-width: 560px; margin: -20px auto 32px; line-height: 1.6; }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 760px; margin: 0 auto; }
.comparison-col { border-radius: 12px; padding: 20px 24px; }
.comparison-them { background: var(--surface); border: 1px solid var(--rule); }
.comparison-us { background: var(--accent-lt); border: 1px solid rgba(91,79,207,.2); }
.comparison-col-title { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 12px; }
.comparison-us .comparison-col-title { color: var(--accent); }
.comparison-col ul { list-style: none; padding: 0; margin: 0; }
.comparison-col li { font-size: 13px; padding: 5px 0; color: var(--ink-mid); line-height: 1.4; }
.marketing-pricing-section { text-align: center; }
.marketing-pricing-note { font-size: 13px; color: var(--ink-soft); margin-top: 20px; }
.marketing-about { max-width: 600px; margin: 0 auto; }
.marketing-about h2 { font-family: Georgia, 'Times New Roman', serif; font-size: 26px; color: var(--ink); margin-bottom: 16px; }
.marketing-about p { font-size: 14px; color: var(--ink-mid); line-height: 1.7; margin-bottom: 12px; }

/* Legal pages */
.legal-page { max-width: 680px; margin: 0 auto; padding: 40px 20px; }
.legal-title { font-family: Georgia, 'Times New Roman', serif; font-size: 30px; color: var(--ink); margin-bottom: 8px; }
.legal-updated { font-size: 12px; color: var(--ink-soft); margin-bottom: 32px; }
.legal-page h2 { font-size: 16px; font-weight: 600; color: var(--ink); margin: 24px 0 8px; }
.legal-page p { font-size: 13px; color: var(--ink-mid); line-height: 1.7; margin-bottom: 12px; }
.legal-page ul { font-size: 13px; color: var(--ink-mid); line-height: 1.7; padding-left: 20px; }

/* ================= INBOX ================= */
.inbox { max-width: 760px; }
.inbox-add { display: flex; gap: 8px; align-items: center; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.inbox-add-input { flex: 1; }
.inbox-add-priority { width: auto; flex-shrink: 0; }
.inbox-list { display: flex; flex-direction: column; gap: 8px; }
.inbox-row { display: flex; align-items: center; gap: 10px; position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px 10px 16px; }
.inbox-row .priority-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.inbox-row-body { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.inbox-row-title { font-size: 14px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.inbox-assign { width: auto; }
.inbox-empty { margin-top: 8px; }
.panel-hint { display: block; font-size: 11.5px; color: var(--amber, var(--ink-soft)); margin-top: 5px; }

/* ================= CLIENT DOCUMENTS ================= */
.client-documents { margin-top: 20px; }
.document-upload { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.document-upload input[type=file] { flex: 1; min-width: 160px; padding: 7px 10px; font-size: 12.5px; }
.document-list { display: flex; flex-direction: column; }
.document-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.document-row:last-child { border-bottom: none; }
.document-icon { flex-shrink: 0; }
.document-name { flex: 1; min-width: 0; color: var(--accent); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.document-name:hover { text-decoration: underline; }
.document-size { font-size: 11.5px; color: var(--ink-soft); flex-shrink: 0; }
.document-date { font-size: 11.5px; color: var(--ink-soft); flex-shrink: 0; width: 82px; text-align: right; }

/* ================= DISPLAY PREFERENCES ================= */
/* Text size — zoom the working area (topbar + content). */
html[data-text-size="large"] .main { zoom: 1.12; }
html[data-text-size="larger"] .main { zoom: 1.25; }

/* Reduce motion */
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after {
  transition: none !important; animation: none !important; scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Hide the sidebar project list (clients-only nav) */
html[data-nav="hide-projects"] .nav-item--project,
html[data-nav="hide-projects"] .nav-section-label--projects,
html[data-nav="hide-projects"] .nav-empty,
html[data-nav="hide-projects"] .nav-item--muted { display: none; }

/* ===== Today ticker (opt-in, toggled in Settings) ===== */
.today-ticker { display: none; }
html[data-ticker="on"] .today-ticker {
  display: flex; align-items: center; gap: 14px;
  position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; height: 34px; z-index: 60;
  background: var(--ink); color: #fff; padding: 0 14px; overflow: hidden;
  box-shadow: 0 -2px 10px rgba(0,0,0,.12);
}
/* Keep content clear of the fixed bar. */
html[data-ticker="on"] .content { padding-bottom: 52px; }
.ticker-label { flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; opacity: .85; padding-right: 12px; border-right: 1px solid rgba(255,255,255,.2); }
.ticker-empty { font-size: 12.5px; opacity: .8; }
.ticker-viewport { flex: 1; overflow: hidden; }
.ticker-track { display: inline-flex; align-items: center; gap: 30px; white-space: nowrap;
  will-change: transform; animation: ticker-scroll 40s linear infinite; }
.today-ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 7px; color: #fff; text-decoration: none; font-size: 12.5px; }
.ticker-item:hover .ticker-item-title { text-decoration: underline; }
.ticker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.ticker-dot.priority-dot-high { background: var(--red); }
.ticker-dot.priority-dot-medium { background: var(--amber); }
.ticker-dot.priority-dot-low { background: var(--green); }
.ticker-item-ctx { opacity: .7; font-size: 11.5px; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* Respect reduce-motion: stop scrolling, allow manual horizontal scroll instead. */
html[data-motion="off"] .ticker-viewport { overflow-x: auto; }
html[data-motion="off"] .ticker-track { animation: none; }
/* Tablet: align the ticker to the narrower sidebar. */
@media (max-width: 1024px) and (min-width: 641px) {
  html[data-ticker="on"] .today-ticker { left: 190px; }
}
/* Phone: the sidebar becomes a fixed bottom nav bar, so hide the ticker. */
@media (max-width: 640px) {
  html[data-ticker="on"] .today-ticker { display: none; }
  html[data-ticker="on"] .content { padding-bottom: 16px; }
}

/* Dark theme — override the palette tokens, then fix the few ink-as-background spots. */
html[data-theme="dark"] {
  --ink:       #e9e9f2;
  --ink-mid:   #b7b7cf;
  --ink-soft:  #8585a4;
  --rule:      #2c2c40;
  --surface:   #1e1e2c;
  --canvas:    #13131d;
  --accent-lt: #272251;
  --green-lt:  #122f27;
  --amber-lt:  #33280f;
  --red-lt:    #371c1c;
}
html[data-theme="dark"] body { background: var(--canvas); color: var(--ink); }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .timer-pill.running,
html[data-theme="dark"] .onboarding-timer-demo { background: #0d0d16; }
html[data-theme="dark"] .client-tab.is-active,
html[data-theme="dark"] .task-filter.is-active { background: #3a34a0; border-color: #3a34a0; }
html[data-theme="dark"] .auth-body { background: #0d0d16; }
html[data-theme="dark"] .panel-card, html[data-theme="dark"] .stats-card,
html[data-theme="dark"] .detail-card, html[data-theme="dark"] .report-block,
html[data-theme="dark"] .row-card, html[data-theme="dark"] .task-row,
html[data-theme="dark"] .today-task-row, html[data-theme="dark"] .client-card,
html[data-theme="dark"] .project-card, html[data-theme="dark"] .log-entry-row { box-shadow: none; }

/* ================= CALENDAR ================= */
.cal-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-title { font-size: 16px; font-weight: 600; color: var(--ink); margin-left: 6px; }
.cal-views { margin-bottom: 0; }
.cal-hours { font-size: 10.5px; font-weight: 700; color: var(--green); background: var(--green-lt); border-radius: 8px; padding: 1px 6px; white-space: nowrap; }

/* Month grid */
.cal-weekdays, .cal-week { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-weekday { padding: 6px 8px; font-size: 11px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; text-align: left; }
.cal-month { border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--surface); }
.cal-cell { min-height: 104px; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); padding: 6px 7px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.cal-week > .cal-cell:first-child { border-left: none; }
.cal-cell.other-month { background: var(--canvas); }
.cal-cell.other-month .cal-daynum { color: var(--ink-soft); opacity: .55; }
.cal-cell.is-today { background: var(--accent-lt); }
.cal-cell-head { display: flex; align-items: center; justify-content: space-between; }
.cal-daynum { font-size: 12px; font-weight: 600; color: var(--ink); }
.cal-cell.is-today .cal-daynum { color: var(--accent); }
.cal-cell-tasks { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }

/* A task chip (shared by all views) */
.cal-task { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink); text-decoration: none;
  background: var(--canvas); border-radius: 5px; padding: 2px 6px; overflow: hidden; }
.cal-task:hover { background: var(--accent-lt); }
.cal-task.done .cal-task-title { text-decoration: line-through; color: var(--ink-soft); }
.cal-task-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cal-task-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-task.priority-high { box-shadow: inset 2px 0 0 var(--red); }
.cal-task-time { font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); flex-shrink: 0; }
.cal-task-flag { font-size: 10px; color: var(--amber); flex-shrink: 0; }
.cal-task.kind-due { background: var(--amber-lt); }
.cal-task.kind-due:hover { background: var(--amber-lt); filter: brightness(.97); }
.cal-task.kind-due .cal-task-title { color: var(--ink); }

/* Two inputs side by side in a panel field (scheduled date + time). */
.panel-inline-fields { display: flex; gap: 8px; }
.panel-inline-fields .field-input { margin-bottom: 0; }

/* ===== Task checklist (subtasks) ===== */
.checklist-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.checklist-progress { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.checklist-progress.complete { color: var(--green); }
.checklist-bar { height: 5px; border-radius: 3px; background: var(--canvas); overflow: hidden; margin-bottom: 8px; }
.checklist-bar span { display: block; height: 100%; background: var(--green); transition: width .2s; }
.checklist-items { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.checklist-item { display: flex; align-items: center; gap: 8px; padding: 3px 2px; }
.checklist-check { width: 18px; height: 18px; flex-shrink: 0; border: 1.5px solid var(--rule); border-radius: 5px;
  background: var(--surface); cursor: pointer; font-size: 11px; color: #fff; line-height: 1; display: grid; place-items: center; }
.checklist-check.checked { background: var(--green); border-color: var(--green); }
.checklist-item-title { flex: 1; font-size: 13px; color: var(--ink); }
.checklist-item.done .checklist-item-title { text-decoration: line-through; color: var(--ink-soft); }
.checklist-del { background: none; border: none; color: var(--ink-soft); cursor: pointer; font-size: 12px; opacity: 0; transition: opacity .15s; }
.checklist-item:hover .checklist-del { opacity: 1; }
.checklist-del:hover { color: var(--red); }
.checklist-add { display: flex; gap: 6px; }
.checklist-add .field-input { margin-bottom: 0; }
.tag-checklist { background: var(--canvas); color: var(--ink-soft); border: 1px solid var(--rule); }
.tag-checklist.complete { color: var(--green); border-color: var(--green); }

/* Week view */
.cal-week-view { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-col { border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); min-height: 260px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cal-col.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-col-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.cal-col-wd { font-size: 11px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; }
.cal-col-num { font-size: 18px; font-weight: 700; color: var(--ink); }
.cal-col-tasks { display: flex; flex-direction: column; gap: 4px; }
.cal-col-empty { color: var(--ink-soft); font-size: 12px; }

/* Day view */
.cal-day-view { max-width: 620px; }
.cal-day-summary { display: flex; gap: 18px; margin-bottom: 14px; font-size: 13px; }
.cal-day-hours { font-weight: 700; color: var(--green); }
.cal-day-count { color: var(--ink-soft); }
.cal-day-tasks { display: flex; flex-direction: column; gap: 6px; }
.cal-day-tasks .cal-task { font-size: 13px; padding: 8px 12px; }

@media (max-width: 760px) {
  .cal-week-view { grid-template-columns: 1fr; }
  .cal-cell { min-height: 76px; }
  .cal-task-title { font-size: 10.5px; }
}

/* ================= LEAD PIPELINE ================= */
.pipeline-toolbar { display: flex; gap: 8px; margin-bottom: 16px; }
.pipeline-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.pipeline-col { flex: 0 0 232px; background: var(--canvas); border: 1px solid var(--rule); border-radius: 12px; padding: 10px; }
.pipeline-col-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.pipeline-col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.pipeline-col-count { font-size: 11px; font-weight: 700; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 0 7px; }
.pipeline-col-value { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--green); }
.pipeline-col.stage-won .pipeline-col-title { color: var(--green); }
.pipeline-col.stage-lost .pipeline-col-title { color: var(--red); }
.pipeline-col-cards { display: flex; flex-direction: column; gap: 8px; }
.pipeline-col-empty { color: var(--ink-soft); font-size: 12px; text-align: center; padding: 8px 0; }
.pipeline-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 9px; padding: 9px 10px; box-shadow: var(--shadow); }
.pipeline-card-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); text-decoration: none; }
.pipeline-card-name:hover { color: var(--accent); }
.pipeline-card-value { font-size: 12px; font-weight: 700; color: var(--green); margin-top: 2px; }
.pipeline-card-call { display: inline-block; font-size: 12px; color: var(--accent); text-decoration: none; margin-top: 4px; }
.pipeline-card-source { font-size: 11px; color: var(--ink-soft); margin-top: 3px; }
.pipeline-stage-select { margin-top: 7px; width: 100%; }

/* ================= LEAD IMPORT ================= */
.import-page { max-width: 720px; }
.import-map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-bottom: 18px; }
.import-map-row { display: flex; flex-direction: column; gap: 4px; }
.import-map-label { font-size: 12px; font-weight: 600; color: var(--ink); }
.import-preview { margin: 18px 0; }
.import-preview-title { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; }
.import-preview-table { border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.import-preview-table th, .import-preview-table td { padding: 6px 10px; border-bottom: 1px solid var(--rule); text-align: left; }
.import-preview-table th { background: var(--canvas); font-weight: 600; color: var(--ink-soft); }
.import-result { display: flex; gap: 24px; margin: 8px 0 16px; }
.import-result-num { font-size: 28px; font-weight: 700; color: var(--green); }
.import-result-stat { font-size: 14px; }
@media (max-width: 640px) { .import-map-grid { grid-template-columns: 1fr; } }

/* ================= USER GUIDE ================= */
.guide { max-width: 800px; }
.guide-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 10px; }
.guide-hero .guide-lede { font-size: 15px; color: var(--ink-soft); max-width: 60ch; margin: 6px 0 0; }
.guide-toc { list-style: none; margin: 0 0 34px; padding: 18px 0 0; border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.guide-toc a { display: flex; gap: 10px; padding: 8px 0; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); font-size: 14px; }
.guide-toc a:hover { color: var(--accent); }
.guide-toc .n { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; width: 2ch; }
.guide-section { padding: 26px 0; border-top: 1px solid var(--rule); }
.guide-section:first-of-type { border-top: none; }
.guide-eyebrow { display: flex; align-items: center; gap: 10px; font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.guide-section h2 { font-size: 23px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; }
.guide-section h3 { font-size: 15px; font-weight: 700; margin: 20px 0 6px; }
.guide-section p { max-width: 66ch; margin: 0 0 13px; line-height: 1.6; color: var(--ink); }
.guide-section p.lead { font-size: 16.5px; color: var(--ink-soft); }
.guide-section ul, .guide-section ol { max-width: 66ch; margin: 0 0 14px; padding-left: 20px; line-height: 1.55; }
.guide-section li { margin: 5px 0; }
.guide-kbd { font-family: ui-monospace, Menlo, monospace; font-size: .85em; background: var(--accent-lt);
  color: var(--accent); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.guide-feat { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.guide-feat .card { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; }
.guide-feat .card h4 { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.guide-feat .card p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.guide-steps { counter-reset: gstep; list-style: none; padding: 0; max-width: 66ch; }
.guide-steps li { counter-increment: gstep; position: relative; padding-left: 34px; margin: 10px 0; }
.guide-steps li::before { content: counter(gstep); position: absolute; left: 0; top: 0; width: 22px; height: 22px;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.guide-tip { background: var(--accent-lt); border-radius: 10px; padding: 14px 18px; margin: 18px 0; max-width: 66ch; }
.guide-tip .lbl { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.guide-tip p { margin: 0; }
.guide-stages { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 18px; align-items: center; }
.guide-stages span.chip { font-size: 12px; padding: 4px 10px; border-radius: 20px; background: var(--surface); border: 1px solid var(--rule); color: var(--ink-soft); }
.guide-stages span.chip.won { color: var(--green); border-color: var(--green); }
.guide-stages span.chip.lost { color: var(--red); }
.guide-stages .arr { color: var(--ink-soft); font-size: 12px; }
.guide-kv { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 14px 0; }
.guide-kv th, .guide-kv td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.guide-kv th { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.guide-kv td.k { font-weight: 650; white-space: nowrap; }
@media (max-width: 640px) { .guide-toc, .guide-feat { grid-template-columns: 1fr; } }

/* Print any page cleanly (used by the guide's Save-as-PDF). */
@media print {
  .sidebar, .topbar, #today-ticker, #task-detail-panel, #task-panel-overlay, .quick-add-wrap { display: none !important; }
  .layout, .main, .content { display: block !important; margin: 0 !important; padding: 0 !important; }
  .guide-section { break-inside: avoid; }
  .btn { display: none !important; }
}

/* ================= RESPONSIVE ================= */
/* Tablet: keep a narrower sidebar, stack the wide grids. */
@media (max-width: 1024px) and (min-width: 641px) {
  .sidebar { width: 190px; }
  .today-layout, .client-detail-grid, .project-detail-grid { grid-template-columns: 1fr; }
  .report-cards, .pricing-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .today-grid, .detail-grid, .clients-grid, .project-detail-grid, .today-layout, .client-detail-grid { grid-template-columns: 1fr; }
  .report-cards, .marketing-features, .comparison-grid { grid-template-columns: 1fr; }
  .period-summary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .pricing-grid, .marketing-features { grid-template-columns: 1fr; }
  .marketing-headline { font-size: 32px; }
}

/* Phone: sidebar becomes a fixed bottom nav bar. */
@media (max-width: 640px) {
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100vw; height: 56px;
    flex-direction: row; align-items: center; overflow: hidden; padding: 0;
    z-index: 100; border-right: none; border-top: 1px solid rgba(255,255,255,.1); transform: none;
  }
  /* Bottom nav shows only the 5 core views; projects/labels/footer hidden. */
  .brand, .nav-section-label, .sidebar-footer, .nav-empty, .nav-item--muted,
  .nav-item--project, .nav-badge { display: none; }
  .nav { display: flex; flex-direction: row; flex: 1; min-width: 0; justify-content: space-around;
         overflow: hidden; padding: 0; gap: 0; }
  .nav-item { font-size: 0; flex-direction: column; padding: 6px 4px; border-radius: 8px;
              min-height: 44px; flex: 1; justify-content: center; }
  .nav-dot { font-size: 20px; width: auto; }
  .main { padding-bottom: 64px; }

  .content { padding: 16px 14px; }
  .topbar { padding: 0 14px; column-gap: 8px; }
  .topbar-title h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .today-right-panel { order: -1; }
  .timer-task-name { display: none; }
  .timer-pill.running .timer-elapsed { font-size: 30px; }
  .timer-pill.running { padding: 6px 8px 6px 12px; gap: 10px; }
  /* Let grid/flex children shrink below their content width (kills h-overflow). */
  .today-layout > *, .client-detail-grid > *, .project-detail-grid > *,
  .clients-grid > *, .detail-grid > * { min-width: 0; }
  .today-task-row, .task-row, .log-entry-row, .client-card, .project-card,
  .row-card, .followup-item, .contact-card { min-width: 0; max-width: 100%; }
  .today-task-body, .task-body, .entry-body { min-width: 0; }
  .today-task-meta, .task-meta { min-width: 0; }
  .task-detail-panel { width: 100%; }
  .period-summary { grid-template-columns: 1fr 1fr; }
  .clients-grid, .today-layout, .detail-grid, .project-detail-grid, .client-detail-grid { grid-template-columns: 1fr; }
  .entry-meta { flex-wrap: wrap; gap: 4px; }
  .time-summary-bar { flex-wrap: wrap; gap: 12px; padding: 12px 14px; }
  .bar-label { width: 84px; font-size: 10px; }
  .marketing-nav-links a:not(.btn) { display: none; }
  .marketing-hero { padding: 48px 20px 40px; }
  .marketing-features-section, .marketing-comparison-section, .marketing-pricing-section, .marketing-about-section { padding: 40px 20px; }

  /* Touch targets */
  .task-check, .timer-btn, .task-action-btn, .today-remove-btn, .followup-done-btn,
  .billable-toggle, .btn-icon { min-width: 44px; min-height: 44px; }
  .btn { min-height: 44px; }
  .btn-sm, .btn-xs { min-height: 34px; }
}
@media (max-width: 600px) {
  .period-summary { grid-template-columns: 1fr; }
  .bar-label { width: 80px; }
}
@media (max-width: 768px) {
  .client-detail-grid { grid-template-columns: 1fr; }
  .client-header-row { flex-direction: column; }
}
