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

:root {
  /* ══════════════════════════════════════════
     FINTECH DESIGN TOKENS
     Grey-purple palette · opaque surfaces
  ══════════════════════════════════════════ */

  /* ── Base surfaces ── */
  --bg:           #f0f1f6;
  --surface:      #ffffff;
  --surface-2:    #f1f3fb;
  --surface-3:    #e8ecfe;

  /* ── Borders (semi-transparent purple-grey) ── */
  --border:       rgba(148,140,180,0.2);
  --border-light: rgba(148,140,180,0.1);

  /* ── Text ── */
  --text-primary:   #0f172a;
  --text-secondary: #6b6e8a;
  --text-muted:     #9496b0;

  /* ── Primary — Purple (muted fintech) ── */
  --primary:      #7468B5;
  --primary-hover:#6359A5;
  --primary-light:rgba(116,104,181,0.08);
  --primary-muted:rgba(116,104,181,0.22);

  /* ── Semantic colours (muted fintech palette) ── */
  --green:      #5ba88a;
  --green-bg:   rgba(91,168,138,0.08);
  --green-dot:  #6ec4a4;
  --orange:     #c49052;
  --orange-bg:  rgba(196,144,82,0.08);
  --blue:       #6b8cce;
  --blue-bg:    rgba(107,140,206,0.08);
  --amber:      #c49052;
  --amber-bg:   rgba(196,144,82,0.08);
  --red:        #c26b6b;
  --red-bg:     rgba(194,107,107,0.08);
  --purple:     #9080C0;
  --purple-bg:  rgba(144,128,192,0.08);
  --purple-tint-5:  rgba(144,128,192,0.05);
  --purple-tint-10: rgba(144,128,192,0.10);
  --cyan:       #5ea8b8;
  --cyan-bg:    rgba(94,168,184,0.08);
  --teal:       #4d9e96;
  --teal-bg:    rgba(77,158,150,0.08);
  --rose:       #b75d78;
  --rose-bg:    rgba(183,93,120,0.08);
  --gray:       #6b6e8a;
  --gray-bg:    rgba(107,110,138,0.06);

  /* ── Shadows — glass with inner highlight ── */
  --shadow-xs: 0 1px 2px rgba(100,90,130,0.06), inset 0 1px 0 rgba(255,255,255,0.5);
  --shadow-sm: 0 2px 8px rgba(100,90,130,0.08), inset 0 1px 0 rgba(255,255,255,0.45);
  --shadow-md: 0 4px 20px rgba(100,90,130,0.10), inset 0 1px 0 rgba(255,255,255,0.4);
  --shadow-lg: 0 8px 40px rgba(100,90,130,0.14), inset 0 1px 0 rgba(255,255,255,0.35);

  /* ── Shape ── */
  --radius:    12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-lg: 16px;

  /* ── Typography (settings-overridable) ── */
  --font-size-base: 14px;
  --font-size-sm:   13px;
  --font-size-xs:   12px;
  --font-size-xxs:  11px;
  --density-pad: 1;
}

/* ── Dark Theme — deep navy-purple glass ── */
[data-theme="dark"] {
  --bg:           #0c0f1e;
  --surface:      #161a30;
  --surface-2:    #222844;
  --surface-3:    #1c2038;

  --border:       rgba(120,115,170,0.18);
  --border-light: rgba(120,115,170,0.08);

  --text-primary:   #f1f5f9;
  --text-secondary: #b0b3cc;
  --text-muted:     #7478a0;

  --primary:      #9B8ACA;
  --primary-hover:#8B7ABE;
  --primary-light:rgba(155,138,202,0.1);
  --primary-muted:rgba(155,138,202,0.2);

  --green:     #34d399;
  --green-bg:  rgba(52,211,153,0.12);
  --green-dot: #34d399;
  --orange:    #fbbf24;
  --orange-bg: rgba(251,191,36,0.12);
  --blue:      #60a5fa;
  --blue-bg:   rgba(96,165,250,0.12);
  --amber:     #fbbf24;
  --amber-bg:  rgba(251,191,36,0.12);
  --red:       #f87171;
  --red-bg:    rgba(248,113,113,0.12);
  --purple:    #C0B5E0;
  --purple-bg: rgba(192,181,224,0.12);
  --purple-tint-5:  rgba(192,181,224,0.05);
  --purple-tint-10: rgba(192,181,224,0.10);
  --cyan:      #22d3ee;
  --cyan-bg:   rgba(34,211,238,0.12);
  --teal:      #5eead4;
  --teal-bg:   rgba(94,234,212,0.1);
  --rose:      #f9a8d4;
  --rose-bg:   rgba(249,168,212,0.1);
  --gray:      #b0b3cc;
  --gray-bg:   rgba(176,179,204,0.08);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.02);
}
[data-theme="dark"] body {
  background: linear-gradient(135deg, #0c0f1e 0%, #151030 50%, #0c0f1e 100%);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, #e4e0f0 50%, var(--bg) 100%);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: var(--font-size-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.header {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid rgba(148,140,180,0.1);
  box-shadow: 0 1px 8px rgba(100,90,130,0.06);
  display: flex;
  align-items: center;
  padding: 0 20px 0 16px;
  gap: 0;
  flex-shrink: 0;
  z-index: 100;
}

/* ── Left: logo ── */
.header-logo {
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap; min-width: 150px; flex-shrink: 0;
}
.header-logo-diamond { color: var(--text-muted); font-size: 14px; }

/* ── Center: ticker ── */
.header-center {
  flex: 1; min-width: 0;
  display: flex; align-items: center;
  overflow: hidden;
  margin: 0 16px;
}
.header-ticker {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; width: 100%;
  padding: 5px 10px; border-radius: var(--radius-sm);
}
.header-ticker-label {
  font-size: 8px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--blue);
  background: var(--blue-bg); padding: 2px 6px;
  border-radius: 3px; flex-shrink: 0; white-space: nowrap;
  cursor: pointer; transition: opacity 0.12s; user-select: none;
}
.header-ticker-label:hover { opacity: 0.75; }
/* Category jump popout */
#ticker-cat-popout {
  position: fixed; z-index: 9100;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 130px;
}
.header-ticker-sublabel {
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text-secondary); background: var(--surface-2);
  border: 1px solid var(--border-light);
  padding: 2px 7px; border-radius: 3px;
  flex-shrink: 0; white-space: nowrap; cursor: pointer;
}
.header-ticker-sublabel:hover { opacity: 0.75; }
/* Ticker category items overlay */
#ticker-items-popout {
  position: fixed; z-index: 9100;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  width: 400px; max-width: calc(100vw - 32px);
  max-height: 60vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: modalSlideUp 0.18s cubic-bezier(0.34,1.1,0.64,1);
}
#ticker-items-backdrop { position: fixed; inset: 0; z-index: 9099; }
.tip-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px 8px; border-bottom: 1px solid var(--border-light);
}
.tip-cat-pill {
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: 4px;
}
.tip-count { font-size: 10px; color: var(--text-muted); margin-left: auto; }
.tip-items { overflow-y: auto; padding: 4px; }
.tip-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px; cursor: pointer;
  transition: background 0.1s;
}
.tip-row:hover { background: var(--surface-2); }
.tip-row-sub {
  font-size: 9px; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0; width: 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tip-row-text {
  font-size: 11px; font-weight: 500; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.tip-row-arrow { font-size: 10px; color: var(--text-muted); flex-shrink: 0; opacity: 0.5; }
/* Rotating cube ticker window */
.header-ticker-window {
  flex: 1; min-width: 0; overflow: hidden;
  position: relative; height: 22px;
  perspective: 400px;
}
/* Each slide absolute-stacked, cube face transitions */
.header-ticker-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  font-size: 12px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transform-origin: center bottom;
  transition: transform 0.52s cubic-bezier(0.4, 0, 0.2, 1),
              opacity   0.52s cubic-bezier(0.4, 0, 0.2, 1);
  backface-visibility: hidden;
}
/* active: face-on */
.header-ticker-slide.active {
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
}
/* above: rotated away upward (exits) */
.header-ticker-slide.above {
  opacity: 0;
  transform: translateY(-40%) rotateX(30deg);
  pointer-events: none;
}
/* below: about to enter from bottom-below */
.header-ticker-slide.below {
  opacity: 0;
  transform: translateY(40%) rotateX(-30deg);
  pointer-events: none;
}
.header-ticker-arrow {
  font-size: 9px; color: var(--text-muted); flex-shrink: 0;
}
.header-ticker-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-muted); opacity: 0.4; flex-shrink: 0;
}

/* ── Right: subtle chips + online + clock ── */
.header-right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; white-space: nowrap;
}
/* Subtle stat chips — inline num + label */
.header-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.header-chip-num {
  font-size: 12px; font-weight: 700;
  color: var(--text-primary); font-variant-numeric: tabular-nums;
}
.header-chip-label {
  font-size: 9px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.header-sep { width:1px; height:16px; background:var(--border); margin:0 2px; }

/* Header chip dropdown wrappers */
.hdr-chip-wrap { position: relative; }
.hdr-chip-btn { cursor: pointer; transition: background 0.15s; }
.hdr-chip-btn:hover { background: var(--surface-3); }
.hdr-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 10px 0;
  z-index: 100;
}
.hdr-dropdown.open { display: block; }
.hdr-dd-title {
  padding: 0 12px 8px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}
.hdr-dd-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  font-size: 12px; color: var(--text-secondary);
}
.hdr-dd-dot {
  width: 6px; height: 6px;
  border-radius: 50%; flex-shrink: 0;
}
.hdr-dd-row-label { flex: 1; }
.hdr-dd-row-value {
  font-weight: 600; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.hdr-dd-row-selectable { cursor: pointer; border-radius: 6px; transition: background 0.15s; }
.hdr-dd-row-selectable:hover { background: var(--surface-2); }
.hdr-dd-row-active { background: var(--surface-3); }
.hdr-dd-row-active .hdr-dd-row-label { font-weight: 700; color: var(--text-primary); }
.hdr-dd-sep {
  height: 1px; background: var(--border-light);
  margin: 6px 12px;
}
.hdr-dd-toggle {
  display: flex; gap: 4px; padding: 6px 12px 2px;
}
.hdr-dd-toggle-btn {
  flex: 1; padding: 5px 0; border: 1px solid var(--border);
  border-radius: var(--radius-xs); background: transparent;
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
}
.hdr-dd-toggle-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* (online badge removed — replaced by weather chip) */
/* Clock + date stacked */
.header-clock-wrap {
  display: flex; flex-direction: row; align-items: stretch; gap: 6px;
}
.header-clock-text {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px;
}
.header-clock {
  font-size: 12px; font-weight: 700; color: var(--text-primary);
  letter-spacing: 0.01em; font-variant-numeric: tabular-nums; line-height: 1.2;
}
.header-date {
  font-size: 9px; font-weight: 500; color: var(--text-muted);
  letter-spacing: 0.04em; line-height: 1.2;
}
.header-week-chip {
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: var(--primary); background: var(--primary-light);
  border-radius: 6px; padding: 0 8px; letter-spacing: 0.04em; white-space: nowrap;
  align-self: stretch; min-height: 100%;
}

.btn-icon {
  width: 32px; height: 32px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text-secondary); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text-primary); border-color: var(--border); }
.btn-icon.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Legacy — keep for any leftover refs */
.header-stat { display:none; }
.header-divider { display:none; }
.header-objective-pill { display:none; }

@keyframes pulse-dot {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.6; transform:scale(.8); }
}

/* ══════════════════════════════════════════
   GOAL BANNER
══════════════════════════════════════════ */
.goal-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.goal-banner-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Clickable goal banner trigger */
.goal-banner-trigger {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; flex: 1; min-width: 0;
  padding: 4px 8px; margin: 0 -8px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.goal-banner-trigger:hover { background: var(--border-light); }
.goal-banner-trigger:hover .goal-banner-chevron { opacity: 1; }
.goal-banner-chevron {
  font-size: 11px; color: var(--text-muted);
  opacity: 0.4; transition: opacity 0.12s; flex-shrink: 0;
}
.goal-banner-text {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.goal-banner-text strong { color: var(--text-primary); font-weight: 600; }

/* ── Project tree popout ── */
.project-popout-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: transparent;
  display: none;
}
.project-popout-overlay.open { display: block; }
.project-popout {
  position: fixed;
  top: 100px; /* below header + banner */
  left: 50%; transform: translateX(-50%);
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: fadeInDown 0.15s ease;
}
@keyframes fadeInDown {
  from { opacity:0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}
.project-popout-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.project-popout-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
}
.project-popout-objective {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  margin-top: 2px; letter-spacing: -0.01em;
}
.project-popout-close {
  border: none; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; line-height: 1;
  padding: 4px; border-radius: var(--radius-xs);
}
.project-popout-close:hover { color: var(--text-primary); background: var(--border-light); }
.project-popout-body {
  overflow-y: auto; padding: 12px 0;
  flex: 1;
}
/* Project row */
.pp-project {
  padding: 10px 18px 8px;
}
.pp-project-header {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 6px;
}
.pp-project-dot {
  width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0;
}
.pp-project-name {
  font-size: 12px; font-weight: 700; color: var(--text-primary);
  flex: 1; letter-spacing: -0.01em; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-project-status {
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px; border-radius: 8px; flex-shrink: 0;
}
.pp-project-pct {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0; margin-left: 2px;
}
/* Progress bar + % inline in one row */
.pp-project-progress-row {
  display: flex; align-items: center; gap: 7px;
  margin: 0 0 4px 18px;
}
.pp-project-progress-bg {
  flex: 1; height: 3px; background: var(--border); border-radius: 2px;
  overflow: hidden;
}
.pp-project-progress-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.pp-project-task-summary {
  font-size: 10px; color: var(--text-muted);
  padding: 0 0 5px 18px; letter-spacing: 0.02em;
}
/* Overall objective summary bar at popout top */
.pp-objective-summary {
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}
.pp-objective-bar-bg {
  height: 5px; background: var(--border); border-radius: 3px;
  overflow: hidden; margin-bottom: 6px;
}
.pp-objective-bar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  transition: width 0.4s;
}
.pp-objective-meta {
  font-size: 11px; color: var(--text-muted); font-weight: 500;
}
/* Goal rows */
.pp-goals { padding-left: 18px; border-left: 2px solid var(--border-light); margin-left: 22px; }
.pp-goal {
  padding: 6px 0 6px 12px;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}
.pp-goal:last-child { border-bottom: none; }
.pp-goal::before {
  content: ''; position: absolute;
  left: -2px; top: 50%;
  width: 10px; height: 2px;
  background: var(--border-light);
}
.pp-goal-top {
  display: flex; align-items: center; gap: 6px; margin-bottom: 3px;
}
.pp-goal-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.pp-goal-title {
  font-size: 12px; font-weight: 600; color: var(--text-primary);
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-goal-status { font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 5px; border-radius: 8px; flex-shrink: 0; }
.pp-goal-pct-wrap {
  display: flex; align-items: center; gap: 5px; margin-left: auto; flex-shrink: 0;
}
.pp-goal-bar-bg {
  width: 48px; height: 3px; background: var(--border); border-radius: 2px;
  overflow: hidden; flex-shrink: 0;
}
.pp-goal-bar-fill { height: 100%; border-radius: 2px; }
.pp-goal-pct {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0; min-width: 24px; text-align: right;
}
/* Task pills under goal */
.pp-tasks {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 2px 0 2px 12px;
}
.pp-task-pill {
  font-size: 10px; padding: 2px 7px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
}
.pp-task-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.pp-divider { height: 1px; background: var(--border); margin: 4px 18px; }
.pp-empty { padding: 20px 18px; color: var(--text-muted); font-size: 12px; font-style: italic; }
/* Collapsible popout */
.pp-collapsible { cursor: pointer; user-select: none; }
.pp-collapsible:hover { background: var(--surface-2); border-radius: var(--radius-sm); }
/* Chevron is FIRST in the flex row (left of text) */
.pp-chevron { font-size: 10px; color: var(--text-muted); flex-shrink: 0; transition: transform 0.18s; order: -1; }
.pp-chevron-sm { font-size: 9px; }
.pp-goals-wrap { overflow: hidden; transition: max-height 0.22s ease; max-height: 2000px; }
.pp-goals-wrap.collapsed { max-height: 0; }
.pp-tasks-wrap { overflow: hidden; transition: max-height 0.18s ease; max-height: 2000px; }
.pp-tasks-wrap.collapsed { max-height: 0; }
.pp-collapsible.collapsed .pp-chevron { transform: rotate(-90deg); }
/* Mobile: full-width bottom sheet */
@media (max-width: 768px) {
  .project-popout {
    top: auto; bottom: 70px; left: 8px; right: 8px;
    transform: none; width: auto;
    max-height: 70vh;
    animation: slideUp 0.2s cubic-bezier(0.34,1.1,0.64,1);
  }
}

/* Progress bar replaces the old pill */
.goal-progress-wrap {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.goal-progress-bar-bg {
  width: 100px; height: 5px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.goal-progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  transition: width 0.5s ease;
}
.goal-progress-pct {
  font-size: 11px; font-weight: 700;
  color: var(--purple);
  white-space: nowrap;
  min-width: 28px;
  text-align: right;
}

/* ══════════════════════════════════════════
   APP SHELL — persistent nav + page area
══════════════════════════════════════════ */
:root {
  --nav-w: 220px;
  --nav-w-collapsed: 56px;
}

/* The main app shell: nav sidebar + page content area */
.app-shell {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  min-height: 0;
}

/* ══════════════════════════════════════════
   LEFT NAV — Skylead-style persistent sidebar
═══════════════════════════════════���══════ */
.left-nav {
  width: var(--nav-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: width 0.2s ease;
  overflow: hidden;
  z-index: 10;
}
.left-nav.collapsed { width: var(--nav-w-collapsed); }

/* Nav header: app name + collapse button */
.nav-header {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-logo-icon {
  font-size: 18px; flex-shrink: 0;
  width: 28px; text-align: center;
}
.nav-logo-text {
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text-primary); white-space: nowrap; overflow: hidden;
  flex: 1;
}
.nav-collapse-btn {
  width: 26px; height: 26px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-muted); flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.nav-collapse-btn:hover { background: var(--border-light); color: var(--text-primary); }

/* Nav items */
.nav-items { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-bottom { padding: 8px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; border: none; background: transparent;
  color: var(--text-secondary); font-family: inherit;
  font-size: 13px; font-weight: 500;
  text-align: left; width: 100%;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap; overflow: hidden;
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text-primary); border-radius: var(--radius-sm); }
.nav-item.active { background: rgba(124,92,252,0.08); color: var(--primary); font-weight: 600; border: 1px solid rgba(124,92,252,0.12); border-radius: var(--radius-sm); }
.nav-item.active .nav-item-icon { filter: none; }
.nav-item-icon { font-size: 20px; flex-shrink: 0; width: 24px; text-align: center; line-height: 1; }
.nav-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-category {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); padding: 10px 16px 4px; opacity: 0.7;
}
.nav-category:first-child { padding-top: 4px; }
.nav-item-badge {
  font-size: 10px; font-weight: 700; background: var(--red-bg); color: var(--red);
  padding: 1px 6px; border-radius: 10px; flex-shrink: 0;
  min-width: 18px; text-align: center;
}
/* When collapsed, hide labels and badges */
.left-nav.collapsed .nav-item-label,
.left-nav.collapsed .nav-item-badge,
.left-nav.collapsed .nav-category,
.left-nav.collapsed .nav-logo-text,
.left-nav.collapsed .nav-logo-icon ~ .nav-logo-text { display: none; }
.left-nav.collapsed .nav-item { justify-content: center; padding: 9px 0; }
.left-nav.collapsed .nav-header { justify-content: center; padding: 0; }
.left-nav.collapsed .nav-collapse-btn { display: none; }
/* Tooltip on hover when collapsed */
.left-nav.collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute; left: calc(var(--nav-w-collapsed) - 4px);
  background: var(--text-primary); color: var(--surface);
  font-size: 11px; font-weight: 600; white-space: nowrap;
  padding: 4px 10px; border-radius: var(--radius-sm);
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
  z-index: 100;
}
.left-nav.collapsed .nav-item:hover::after { opacity: 1; }

/* Collapsed expand button */
.nav-expand-btn {
  display: none;
  width: 100%; padding: 10px 0;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px;
  transition: color 0.12s;
}
.nav-expand-btn:hover { color: var(--text-primary); }
.left-nav.collapsed .nav-expand-btn { display: flex; align-items: center; justify-content: center; }

/* ══════════════════════════════════════════
   PAGE CONTENT AREA
══════════════════════════════════════════ */
.page-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Individual page (shown/hidden by router) */
.page { display: none; flex: 1; flex-direction: column; overflow: hidden; min-height: 0; }
.page.active { display: flex; }

/* ── Projects page = old 3-column workspace ── */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  overflow: hidden;
  min-height: 0;
}

/* ── Dashboard / other pages have a page-header ── */
.page-header {
  padding: 18px 28px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  display: flex; align-items: center; gap: 16px;
}
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; color: var(--text-primary); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; font-weight: 400; }
.page-header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.page-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px 28px; }
/* Centred content wrapper — keeps pages from stretching to full width */
.page-content { max-width: 860px; width: 100%; margin: 0 auto; }

/* ── Shared page styles ── */
.sidebar-connect-prompt {
  margin: 20px; padding: 16px 18px;
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: var(--radius); text-align: center;
  font-size: 12px; color: var(--text-muted); line-height: 1.7;
}
.sidebar-connect-prompt strong { display: block; color: var(--text-secondary); margin-bottom: 4px; font-size: 13px; }

/* ══════════════════════════════════════════
   GOOGLE CALENDAR-STYLE PAGE
══════════════════════════════════════════ */
.gc-layout { display: flex; height: 100%; overflow: hidden; }
.gc-sidebar { width: 240px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.gc-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.gc-header { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap; }
.gc-today-btn { padding: 6px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-primary); font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.gc-today-btn:hover { background: var(--surface-2); }
.gc-nav-btn { width: 32px; height: 32px; border: none; border-radius: 50%; background: none; cursor: pointer; font-size: 18px; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.gc-nav-btn:hover { background: var(--surface-2); }
.gc-date-label { font-size: 18px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.gc-view-toggle { display: flex; margin-left: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.gc-view-btn { padding: 6px 14px; border: none; background: var(--surface); color: var(--text-secondary); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; border-right: 1px solid var(--border); }
.gc-view-btn:last-child { border-right: none; }
.gc-view-btn.active { background: var(--primary); color: #fff; }
.gc-view-btn:hover:not(.active) { background: var(--surface-2); }
.gc-mini-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.gc-mini-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.gc-mini-nav { display: flex; gap: 2px; }
.gc-mini-nav button { width: 26px; height: 26px; border: none; border-radius: 50%; background: none; cursor: pointer; color: var(--text-secondary); font-size: 14px; display: flex; align-items: center; justify-content: center; }
.gc-mini-nav button:hover { background: var(--surface-2); }
.gc-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; text-align: center; }
.gc-mini-dow { font-size: 10px; font-weight: 700; color: var(--text-muted); padding: 4px 0; text-transform: uppercase; }
.gc-mini-day { font-size: 11px; padding: 4px 0; border-radius: 50%; cursor: pointer; color: var(--text-secondary); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; margin: 0 auto; transition: background 0.1s; }
.gc-mini-day:hover { background: var(--surface-2); }
.gc-mini-day.today { background: var(--primary); color: #fff; font-weight: 700; }
.gc-mini-day.selected { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.gc-mini-day.other-month { color: var(--text-muted); opacity: 0.4; }
.gc-sources-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.gc-source-item { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: var(--radius-xs); cursor: pointer; font-size: 12px; color: var(--text-secondary); transition: background 0.1s; }
.gc-source-item:hover { background: var(--surface-2); }
.gc-source-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.gc-source-item.disabled { opacity: 0.35; }
.gc-source-item.disabled .gc-source-label { text-decoration: line-through; }
.gc-grid-wrap { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }
.gc-col-headers { display: grid; position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--border); }
.gc-col-header { display: flex; flex-direction: column; align-items: center; padding: 8px 0; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); }
.gc-col-header .gc-col-date { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-top: 2px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.gc-col-header.today .gc-col-date { background: var(--primary); color: #fff; }
.gc-col-header.today { color: var(--primary); }
.gc-allday-row { display: grid; border-bottom: 1px solid var(--border); min-height: 28px; position: sticky; top: 60px; z-index: 4; background: var(--surface); }
.gc-allday-cell { padding: 2px 4px; border-right: 1px solid var(--border-light); min-height: 28px; }
.gc-allday-cell:last-child { border-right: none; }
.gc-allday-label { font-size: 10px; color: var(--text-muted); padding: 4px 8px; display: flex; align-items: flex-start; }
.gc-time-body { display: grid; position: relative; }
.gc-time-gutter { font-size: 10px; color: var(--text-muted); text-align: right; padding-right: 8px; position: relative; top: -6px; white-space: nowrap; }
.gc-time-row { display: grid; border-bottom: 1px solid var(--border-light); min-height: 48px; }
.gc-time-cell { border-right: 1px solid var(--border-light); position: relative; cursor: pointer; min-height: 48px; border-bottom: 1px solid var(--border-light); }
.gc-time-cell:last-child { border-right: none; }
.gc-time-cell:hover { background: var(--surface-2); }
.gc-now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; pointer-events: none; }
.gc-now-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); position: absolute; left: -5px; top: -4px; }
.gc-event-chip { position: absolute; left: 2px; right: 2px; border-radius: 4px; padding: 2px 6px; font-size: 11px; font-weight: 600; overflow: hidden; cursor: pointer; z-index: 2; line-height: 1.3; border-left: 3px solid; transition: box-shadow 0.15s; }
.gc-event-chip:hover { box-shadow: var(--shadow-md); z-index: 3; }
.gc-event-chip .gc-ev-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-event-chip .gc-ev-time { font-size: 10px; font-weight: 400; opacity: 0.8; }
.gc-allday-chip { display: block; padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: box-shadow 0.15s; }
.gc-allday-chip:hover { box-shadow: var(--shadow-sm); }
.gc-drag-ghost { position: absolute; border-radius: 4px; background: var(--primary-light); border: 1px solid var(--primary); opacity: 0.7; pointer-events: none; z-index: 4; }
.gc-event-chip[data-editable="1"] { cursor: grab; }
.gc-event-chip.gc-dragging-source { opacity: 0.3 !important; pointer-events: none !important; }
body.gc-event-dragging { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
body.gc-event-dragging * { cursor: grabbing !important; }
.gc-resize-handle { position:absolute;bottom:0;left:0;right:0;height:6px;cursor:ns-resize;border-radius:0 0 4px 4px; }
.gc-event-chip:hover .gc-resize-handle { background:rgba(0,0,0,0.12); }
.gc-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); flex: 1; overflow-y: auto; }
.gc-month-dow { text-align: center; padding: 8px 0; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border); }
.gc-month-cell { border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); padding: 4px; min-height: 90px; cursor: pointer; position: relative; overflow: hidden; }
.gc-month-cell:nth-child(7n) { border-right: none; }
.gc-month-cell:hover { background: var(--surface-2); }
.gc-month-cell.other-month { opacity: 0.35; }
.gc-month-num { font-size: 12px; font-weight: 600; color: var(--text-secondary); width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; margin-bottom: 2px; }
.gc-month-cell.today .gc-month-num { background: var(--primary); color: #fff; }
.gc-month-ev { display: block; padding: 1px 4px; border-radius: 3px; font-size: 10px; font-weight: 600; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.gc-month-more { font-size: 10px; font-weight: 700; color: var(--text-muted); padding: 1px 4px; cursor: pointer; }
.gc-month-more:hover { color: var(--primary); }
.gc-popover { position: fixed; z-index: 200; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 320px; padding: 0; display: none; overflow: hidden; }
.gc-popover.show { display: block; }
.gc-popover-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; }
.gc-popover-title { font-size: 16px; font-weight: 700; color: var(--text-primary); flex: 1; }
.gc-popover-actions { display: flex; gap: 4px; }
.gc-popover-btn { width: 30px; height: 30px; border: none; border-radius: 50%; background: none; cursor: pointer; color: var(--text-muted); font-size: 16px; display: flex; align-items: center; justify-content: center; }
.gc-popover-btn:hover { background: var(--surface-2); }
.gc-popover-body { padding: 0 16px 16px; font-size: 13px; color: var(--text-secondary); }
.gc-popover-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.gc-popover-icon { width: 18px; text-align: center; color: var(--text-muted); flex-shrink: 0; margin-top: 1px; }
.gc-popover-footer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.gc-popover-footer button { flex: 1; padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.gc-popover-footer button:hover { background: var(--surface-2); }
.gc-popover-footer button.danger { color: var(--red); border-color: var(--red); }
.gc-popover-footer button.danger:hover { background: var(--red-bg); }
.gc-modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 300; display: none; align-items: center; justify-content: center; }
.gc-modal-overlay.show { display: flex; }
.gc-modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 460px; max-width: 95vw; max-height: 90vh; overflow-y: auto; }
.gc-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.gc-modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; }
.gc-modal-close { width: 30px; height: 30px; border: none; border-radius: 50%; background: none; cursor: pointer; color: var(--text-muted); font-size: 18px; }
.gc-modal-close:hover { background: var(--surface-2); }
.gc-modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.gc-form-group { display: flex; flex-direction: column; gap: 4px; }
.gc-form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.gc-form-input { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-primary); font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.15s; }
.gc-form-input:focus { border-color: var(--primary); }
.gc-form-row { display: flex; gap: 12px; }
.gc-form-row > .gc-form-group { flex: 1; }
.gc-color-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.gc-color-swatch { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: border-color 0.15s, transform 0.1s; }
.gc-color-swatch:hover { transform: scale(1.15); }
.gc-color-swatch.active { border-color: var(--text-primary); }
.gc-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.gc-modal-footer button { padding: 8px 20px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.gc-modal-footer button:hover { background: var(--surface-2); }
.gc-modal-footer .gc-btn-save { background: var(--primary); color: #fff; border-color: var(--primary); }
.gc-modal-footer .gc-btn-save:hover { background: var(--primary-hover); }
@media (max-width: 768px) {
  .gc-sidebar { display: none; }
  .gc-header { padding: 8px 12px; gap: 6px; flex-wrap: wrap; }
  .gc-date-label { font-size: 13px; }
  .gc-view-btn { padding: 4px 8px; font-size: 10px; min-height: 32px; }
  .gc-nav-btn { width: 28px; height: 28px; font-size: 14px; }
  /* Week/day column headers */
  .gc-col-header { padding: 4px 0; font-size: 9px; }
  .gc-col-header .gc-col-date { font-size: 14px; width: 28px; height: 28px; }
  .gc-col-header .gc-col-day { font-size: 8px; }
  /* Time gutter */
  .gc-time-label { font-size: 8px; padding: 0 3px 0 2px; min-width: 28px; width: 28px; }
  /* Event chips */
  .gc-event-chip { font-size: 9px; padding: 1px 3px; line-height: 1.2; }
  /* All-day row */
  .gc-allday-chip { font-size: 8px; padding: 1px 3px; }
  /* Month view */
  .gc-month-cell { min-height: 56px; padding: 2px; }
  .gc-month-num { font-size: 10px; width: 20px; height: 20px; }
  .gc-month-ev { font-size: 8px; padding: 1px 2px; }
  .gc-month-more { font-size: 8px; }
  /* Popover + modal */
  .gc-popover { width: calc(100vw - 24px); max-width: none; left: 12px !important; right: 12px !important; }
  .gc-modal { width: 95vw; max-height: 85vh; }
}

/* ── Notes page — Google Keep style ── */
/* Compose bar — centred, card-like */
.notes-compose-wrap {
  max-width: 580px; margin: 0 auto 28px;
}
.notes-compose {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.notes-compose-input {
  width: 100%; background: none; border: none; outline: none;
  font-family: inherit; font-size: 14px; color: var(--text-primary);
  resize: none; line-height: 1.55; min-height: 44px;
}
.notes-compose-input::placeholder { color: var(--text-muted); }
.notes-compose-footer {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--border-light);
}
.notes-compose-type {
  padding: 5px 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 11px; color: var(--text-secondary);
  cursor: pointer; font-family: inherit;
}
.notes-compose-cat {
  padding: 5px 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 11px; color: var(--text-secondary);
  cursor: pointer; font-family: inherit;
}
.notes-compose-submit {
  margin-left: auto; padding: 6px 16px; background: var(--text-primary); color: var(--surface);
  border: none; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: opacity 0.12s;
}
.notes-compose-submit:hover { opacity: 0.8; }

/* Masonry-style note grid */
.notes-masonry {
  columns: 5 200px; column-gap: 14px;
}
.note-card {
  break-inside: avoid; display: inline-block; width: 100%;
  border-radius: var(--radius); padding: 14px 16px;
  font-size: 13px; line-height: 1.6; position: relative;
  border: 1px solid rgba(0,0,0,0.08);
  margin-bottom: 14px;
  transition: box-shadow 0.15s, transform 0.12s;
  cursor: default; box-sizing: border-box;
}
.note-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.13); transform: translateY(-1px); }
.note-card:hover .note-card-del { opacity: 0.6; }
.note-card-del {
  position: absolute; top: 8px; right: 10px;
  background: rgba(0,0,0,0.08); border: none; border-radius: 50%;
  width: 22px; height: 22px; cursor: pointer;
  font-size: 11px; opacity: 0; transition: opacity 0.12s, background 0.12s;
  display: flex; align-items: center; justify-content: center;
}
.note-card-del:hover { background: rgba(0,0,0,0.18); opacity: 1 !important; }
.note-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; opacity: 0.55; margin-bottom: 5px; display: block; }
.note-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; color: inherit; }
.note-body { font-size: 12.5px; line-height: 1.6; word-break: break-word; opacity: 0.88; }
.note-footer { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(0,0,0,0.06); }
.note-cat-chip { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 8px; background: rgba(0,0,0,0.1); }
.note-date { font-size: 10px; opacity: 0.45; margin-left: auto; }

/* Keep colour palette */
.note-yellow  { background: #fff8e1; color: #4a3800; }
.note-green   { background: #e2f5e2; color: #1a4a1a; }
.note-blue    { background: #e3f2fd; color: #0d2a4a; }
.note-purple  { background: #f3e5f5; color: #3a0a4a; }
.note-red     { background: #fce4ec; color: #4a0a1a; }
.note-teal    { background: #e0f7fa; color: #003838; }
.note-white   { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
[data-theme="dark"] .note-yellow  { background: #2d2b14; color: #e8d580; }
[data-theme="dark"] .note-green   { background: #1a2d1a; color: #7dd87d; }
[data-theme="dark"] .note-blue    { background: #142030; color: #7eb8f5; }
[data-theme="dark"] .note-purple  { background: #25142d; color: #c49de0; }
[data-theme="dark"] .note-red     { background: #2d1218; color: #f4a0b4; }
[data-theme="dark"] .note-teal    { background: #102525; color: #70d8e0; }
[data-theme="dark"] .note-white   { background: var(--surface-2); color: var(--text-primary); }

/* Legacy colour aliases (for backward compat) */
.note-color-yellow { background: #fff8e1; color: #4a3800; border-color: rgba(0,0,0,0.06); }
.note-color-blue   { background: #e3f2fd; color: #0d2a4a; border-color: rgba(0,0,0,0.06); }
.note-color-green  { background: #e2f5e2; color: #1a4a1a; border-color: rgba(0,0,0,0.06); }
.note-color-purple { background: #f3e5f5; color: #3a0a4a; border-color: rgba(0,0,0,0.06); }
.note-color-gray   { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
[data-theme="dark"] .note-color-yellow { background: #2d2b14; color: #e8d580; border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .note-color-blue   { background: #142030; color: #7eb8f5; border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .note-color-green  { background: #1a2d1a; color: #7dd87d; border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .note-color-purple { background: #25142d; color: #c49de0; border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .note-color-gray   { background: var(--surface-2); color: var(--text-primary); border-color: var(--border); }

.notes-empty { text-align:center; padding:60px 20px; color:var(--text-muted); font-size:13px; }
.notes-empty-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.4; }
.notes-add-type { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; color: var(--text-primary); cursor: pointer; font-family: inherit; }
.notes-loading { padding: 30px; color: var(--text-muted); font-size: 13px; font-style: italic; }

/* ── Rocks page ── */
.rocks-q-tabs { display:flex; gap:4px; }
.rocks-q-tab { /* SnowUI pill tab */
  padding: 5px 12px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: inherit; color: var(--text-secondary); transition: all 0.15s;
}
.rocks-q-tab:hover { background: var(--surface-2); color: var(--text-primary); border-color: var(--border); }
.rocks-q-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,0.25); }

/* Quarter summary — stat card grid */
.rocks-q-section { margin-bottom: 16px; }
.rocks-q-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.rocks-q-header-pill {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px;
}
.rocks-q-header-meta {
  font-size: 11px; color: var(--text-muted); font-weight: 500;
}
.rocks-stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.rocks-stat-card {
  padding: 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow 0.18s, transform 0.18s;
}
.rocks-stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.rocks-stat-label {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
  display: flex; align-items: center; gap: 4px; white-space: nowrap;
}
.rocks-stat-label i { font-size: 13px; opacity: 0.7; }
.rocks-stat-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }

/* Legacy — keep for backward compat if referenced */
.rocks-q-divider { display: none; }

/* Rocks page layout */
.rocks-page-body { padding: 24px 28px; }
.rocks-summary-bar { margin-bottom: 20px; }
.rocks-tab-short { display: none; }

/* ── Rock card — Preview / Collapsed ───────────────────────────── */
.rock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  display: flex; flex-direction: row;
  position: relative;
}
.rock-card:hover {
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--rock-accent) 20%, var(--border));
  transform: translateY(-1px);
}
.rock-card.expanded {
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--rock-accent) 25%, var(--border));
}

/* Full-height accent strip — first child */
.rock-card-strip {
  width: 4px; flex-shrink: 0; border-radius: 0;
  transition: width 0.2s;
}
.rock-card.expanded .rock-card-strip { width: 5px; }

/* Content wrapper */
.rock-card-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rock-card-header {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px 15px;
  cursor: pointer; user-select: none;
  transition: background 0.15s;
}
.rock-card-header:hover { background: var(--surface-2); }
.rock-card.expanded .rock-card-header { background: var(--surface-2); }

/* Rock number — circular ring progress */
.rock-card-num-wrap {
  position: relative; width: 38px; height: 38px; flex-shrink: 0;
}
.rock-card-num-ring {
  position: absolute; inset: 0; border-radius: 50%;
  transform: rotate(-90deg);
}
.rock-card-num-ring circle {
  fill: none; stroke-width: 2.5; stroke-linecap: round;
}
.rock-card-num-ring .ring-bg { stroke: var(--border); }
.rock-card-num-ring .ring-fill {
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4,0,0.2,1);
}
.rock-card-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; letter-spacing: -0.02em;
  border-radius: 50%;
}

.rock-card-title-block { flex: 1; min-width: 0; }
.rock-card-title {
  font-size: 13.5px; font-weight: 700; color: var(--text-primary);
  line-height: 1.35; letter-spacing: -0.01em;
}
.rock-card-measurable {
  font-size: 11.5px; color: var(--text-secondary); line-height: 1.4; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 520px;
}
.rock-card-owner {
  display: flex; align-items: center; gap: 6px; margin-top: 5px;
  flex-wrap: wrap;
}
.rock-card-owner-avatar {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-2); overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center; font-size: 10px;
  border: 1.5px solid var(--border-light);
}
.rock-card-owner-name { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.rock-card-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.rock-card-due { font-size: 11px; color: var(--text-muted); font-weight: 500; }

/* Status badge */
.rock-card-status-badge {
  padding: 3px 10px; border-radius: 99px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  display: inline-flex; align-items: center; gap: 4px;
}
.rock-status-on_track  { background: var(--green-bg); color: var(--green); }
.rock-status-at_risk   { background: var(--amber-bg); color: var(--amber); }
.rock-status-off_track { background: var(--red-bg); color: var(--red); }
.rock-status-complete  { background: var(--blue-bg); color: var(--blue); }
[data-theme="dark"] .rock-status-on_track  { background: var(--green-bg); color: var(--green); }
[data-theme="dark"] .rock-status-at_risk   { background: var(--amber-bg); color: var(--amber); }
[data-theme="dark"] .rock-status-off_track { background: var(--red-bg); color: var(--red); }
[data-theme="dark"] .rock-status-complete  { background: var(--blue-bg); color: var(--blue); }

/* Inline mini progress (fallback — still used on VTO cards) */
.rock-card-mini-progress { display:flex; flex-direction:column; align-items:flex-end; gap:2px; min-width:64px; }
.rock-card-mini-track { width:64px; height:4px; background:var(--border); border-radius:99px; overflow:hidden; }
.rock-card-mini-fill  { height:100%; border-radius:99px; transition:width 0.5s cubic-bezier(0.4,0,0.2,1); }
.rock-card-mini-label { font-size:9px; font-weight:700; color:var(--text-muted); }

.rock-card-chevron {
  font-size: 14px; color: var(--text-muted); transition: transform 0.25s cubic-bezier(0.4,0,0.2,1); flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
}
.rock-card:hover .rock-card-chevron { background: var(--surface-3); }
.rock-card.expanded .rock-card-chevron { transform: rotate(90deg); background: var(--surface-3); }

/* Hidden legacy progress row */
.rock-card-progress-row { display: none; }
.rock-progress-track { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.rock-progress-fill  { height: 100%; border-radius: 99px; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }
.rock-progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Counts (milestones / to-dos) in header */
.rock-card-counts {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--text-muted); font-weight: 500;
}
.rock-card-counts i { font-size: 12px; opacity: 0.6; }
.rock-card-counts-sep { color: var(--border); margin: 0 2px; }

/* ── Rock card — Expanded / Detail body ─────────────────────────── */
.rock-card-body {
  display: none;
  border-top: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}
.rock-card.expanded .rock-card-body { display: block; }
.rock-body-inner {
  padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 20px;
}

.rock-section {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 14px 16px;
  position: relative;
}
.rock-section::before {
  content: ''; position: absolute; top: 12px; left: 0; width: 3px; height: calc(100% - 24px);
  background: var(--rock-accent); border-radius: 0 2px 2px 0; opacity: 0.5;
}
.rock-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.rock-section-label i { font-size: 14px; opacity: 0.7; }

/* Measurable chip */
.rock-measurable {
  font-size: 12.5px; color: var(--text-primary); line-height: 1.6;
}

/* Milestones — timeline style */
.rock-milestones-list { position: relative; padding-left: 4px; }
.rock-milestone-row {
  display: flex; align-items: flex-start; gap: 12px; padding: 8px 0;
  position: relative;
}
.rock-milestone-row:not(:last-child)::after {
  content: ''; position: absolute; left: 7px; top: 26px; bottom: -1px;
  width: 1.5px; background: var(--border);
}
.rock-milestone-row:last-child { padding-bottom: 0; }
.rock-milestone-check {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center; font-size: 9px;
  border: 1.5px solid var(--border); position: relative; z-index: 1;
  background: var(--surface);
  transition: all 0.15s;
}
.rock-milestone-check.done {
  background: var(--green); border-color: var(--green); color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 15%, transparent);
}
.rock-milestone-check.in_progress {
  background: var(--amber); border-color: var(--amber); color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 15%, transparent);
}
.rock-milestone-content { flex: 1; min-width: 0; }
.rock-milestone-text { font-size: 12px; color: var(--text-primary); line-height: 1.45; }
.rock-milestone-date {
  font-size: 10px; color: var(--text-muted); flex-shrink: 0; margin-top: 1px;
  font-weight: 500;
}
.rock-milestone-overdue { color: var(--orange) !important; font-weight: 600; }

/* Task rows in expanded rock */
.rock-task-list { display: flex; flex-direction: column; gap: 4px; }
.rock-task-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--surface-2); border-radius: var(--radius-xs);
  font-size: 12px; border: 1px solid var(--border-light);
  transition: background 0.12s, border-color 0.12s;
}
.rock-task-row:hover {
  background: var(--surface-3);
  border-color: var(--border);
}
.rock-task-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 12%, transparent);
}
.rock-task-title { flex: 1; color: var(--text-primary); line-height: 1.35; font-weight: 500; }
.rock-task-agent { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.rock-task-due   { font-size: 10px; color: var(--text-muted); flex-shrink: 0; font-weight: 500; }

/* Proof of why */
.rock-proof-text {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.6;
  font-style: italic;
}

/* Quarter section dividers */
.rocks-q-section-header {
  display: flex; align-items: center; gap: 10px; margin: 20px 0 10px;
}
.rocks-q-section-header:first-child { margin-top: 0; }
.rocks-q-section-pill {
  padding: 3px 10px; border-radius: 99px; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.07em; flex-shrink: 0;
}
.rocks-q-section-line { flex: 1; height: 1px; background: var(--border); }
.rocks-q-section-meta { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* Keep old project CSS for backward compat */
.projects-goals-section { display: flex; flex-direction: column; gap: 10px; }
.proj-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.proj-section-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer;
  border-left: 4px solid transparent; transition: background 0.12s;
}
.proj-section-header:hover { background: var(--surface-2); }
.proj-section-title  { font-size: 13px; font-weight: 600; flex: 1; }
.proj-section-count  { font-size: 11px; color: var(--text-muted); }
.proj-section-toggle { font-size: 10px; color: var(--text-muted); transition: transform 0.2s; margin-left: 4px; }
.proj-section.open .proj-section-toggle { transform: rotate(90deg); }
.proj-section-body   { display: none; padding: 2px 16px 12px; }
.proj-section.open .proj-section-body { display: block; }
.proj-goal-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.proj-goal-row:last-child { border-bottom: none; }
.proj-goal-avatar {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.proj-goal-title {
  font-size: 12px; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.proj-goal-status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.proj-goal-bar-bg  { width: 70px; height: 3px; background: var(--border); border-radius: 3px; flex-shrink: 0; }
.proj-goal-bar-fill { height: 100%; border-radius: 3px; }
.proj-goal-pct { font-size: 10px; color: var(--text-muted); width: 28px; text-align: right; flex-shrink: 0; }
.proj-task-pills {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0 4px 30px;
}
.proj-task-pill {
  font-size: 10px; padding: 2px 7px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 3px;
}
.proj-task-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

/* ── Issues page (EOS IDS) ── */
.issues-page-body { padding: 24px 28px; }
.issues-filters { display:flex; gap:6px; margin-bottom:18px; flex-wrap:wrap; }
.issue-filter-pill { padding:5px 14px; border-radius:99px; font-size:11px; font-weight:600; cursor:pointer; border:none; color:var(--text-secondary); background:var(--surface-2); transition:all 0.12s; user-select:none; font-family:inherit; }
.issue-filter-pill.active { background:var(--primary-light); color:var(--primary); }
.issue-filter-pill:hover:not(.active) { background:var(--surface-3, var(--surface-2)); }
.issues-list { display:flex; flex-direction:column; gap:8px; }
.issue-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; display:flex; align-items:flex-start; gap:12px; transition:box-shadow 0.18s, transform 0.18s; }
.issue-card:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.issue-card.priority-high   { border-left:3px solid var(--orange); }
.issue-card.priority-medium { border-left:3px solid var(--amber); }
.issue-card.priority-low    { border-left:3px solid var(--green); }
.issue-card-icon { font-size:20px; flex-shrink:0; margin-top:1px; }
.issue-card-body { flex:1; min-width:0; }
.issue-card-title { font-size:13px; font-weight:600; margin-bottom:3px; }
.issue-card-desc  { font-size:12px; color:var(--text-secondary); margin-bottom:8px; line-height:1.45; }
.issue-card-meta  { display:flex; align-items:center; gap:10px; font-size:11px; color:var(--text-muted); flex-wrap:wrap; }
.issue-status-badge { padding:2px 8px; border-radius:99px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; }
.issue-status-open   { background:var(--red-bg); color:var(--red); }
.issue-status-ids    { background:var(--orange-bg); color:var(--orange); }
.issue-status-solved { background:var(--green-bg);  color:var(--green); }
.issue-card-actions { display:flex; gap:6px; flex-shrink:0; align-items:flex-start; margin-top:2px; }
/* Mini avatar used in issue cards */
.issue-raiser-avatar {
  width:22px; height:22px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:10px; overflow:hidden; border:1.5px solid var(--surface);
}
.issue-raiser-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; display:block; }
.issue-action-btn { padding:5px 10px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:11px; font-weight:500; cursor:pointer; background:var(--surface); color:var(--text-secondary); transition:all 0.15s; white-space:nowrap; font-family:inherit; }
.issue-action-btn:hover { background:var(--surface-2); color:var(--text-primary); }
.issue-action-btn.ids-btn   { color:var(--primary); border-color:var(--primary-muted); background:var(--primary-light); }
.issue-action-btn.solve-btn { color:var(--green);   border-color:var(--green);          background:var(--green-bg); }
.issue-empty { padding:48px 20px; text-align:center; color:var(--text-muted); font-size:13px; font-style:italic; }
.issue-empty-icon { font-size:32px; margin-bottom:10px; display:block; }

/* ── Content Planner page — full-width columns ── */
.cp-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: start;
}
.cp-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cp-col-header {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between;
  border-top: 3px solid transparent;
  border: 1px solid var(--border);
  border-top-width: 3px;
}
.cp-col-count {
  font-size: 9px; font-weight: 700;
  background: var(--border); color: var(--text-muted);
  padding: 1px 7px; border-radius: 10px;
}
.cp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 12px; color: var(--text-primary);
  cursor: pointer; transition: box-shadow 0.12s, transform 0.1s;
  position: relative;
}
.cp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.cp-card-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; line-height: 1.4; }
.cp-card-desc { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.45; }
.cp-card-meta { font-size: 10px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cp-card-tag {
  padding: 2px 7px; border-radius: 8px; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.cp-card-tag.platform { background: var(--blue-bg); color: var(--blue); }
.cp-card-tag.agent { background: var(--purple-bg); color: var(--purple); }
.cp-add-card {
  padding: 10px 12px; background: transparent;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  font-size: 11px; color: var(--text-muted); cursor: pointer;
  text-align: left; transition: background 0.1s, color 0.1s; width: 100%;
  font-family: inherit;
}
.cp-add-card:hover { background: var(--surface); color: var(--text-secondary); }

/* ── Drive page ── */
.drive-grid { padding: 20px 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; align-content: start; }
.drive-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: default; transition: box-shadow 0.12s; }
.drive-item:hover { box-shadow: var(--shadow-md); }
.drive-item-icon { font-size: 32px; }
.drive-item-name { font-size: 12px; font-weight: 500; text-align: center; color: var(--text-primary); }

/* ── Dashboard home page ── */
.dash-body { padding: 24px; }
.dash-wrap { max-width: 1200px; width: 100%; margin: 0 auto; }
/* 12-col grid: rocks=5, goals=5, todo=2 | upcoming=5, team=4, issues=3 */
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.dash-col-2  { grid-column: span 2; }
.dash-col-3  { grid-column: span 3; }
.dash-col-4  { grid-column: span 4; }
.dash-col-5  { grid-column: span 5; }
.dash-col-7  { grid-column: span 7; }
.dash-col-8  { grid-column: span 8; }
.dash-col-12 { grid-column: span 12; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: box-shadow 0.18s, transform 0.18s; }
.dash-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.dash-card-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.dash-stat { font-size: 34px; font-weight: 700; letter-spacing: -0.04em; color: var(--text-primary); line-height: 1; }
.dash-stat-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-top: 4px; white-space: nowrap; }
.dash-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.dash-row:last-child { border-bottom: none; }
.dash-row-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dash-row-label { flex: 1; color: var(--text-secondary); }
.dash-row-val { font-weight: 600; color: var(--text-primary); font-size: 12px; }
.dash-agent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dash-agent-chip { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 12px; }
.dash-agent-avatar-img {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1; overflow: hidden;
}
.dash-agent-avatar-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.dash-agent-avatar-img.no-img { background: var(--surface); border: 1px solid var(--border); }
.dash-agent-emoji { font-size: 16px; }
.dash-agent-name { font-weight: 600; flex: 1; font-size: 12px; }
.dash-agent-role { font-size: 10px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-agent-status { width: 7px; height: 7px; border-radius: 50%; background: var(--green-dot); flex-shrink: 0; animation: pulse-dot 2.5s ease-in-out infinite; }
.dash-agent-status.idle { background: var(--text-muted); animation: none; }
.dash-progress-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-light); font-size: 12px; }
.dash-progress-row:last-child { border-bottom: none; }
.dash-progress-label { flex: 1; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-progress-bar-bg { width: 80px; height: 5px; background: var(--border); border-radius: 3px; flex-shrink: 0; overflow: hidden; }
.dash-progress-bar-fill { height: 100%; border-radius: 3px; background: var(--primary); }
.dash-progress-pct { font-size: 11px; font-weight: 700; color: var(--text-muted); width: 28px; text-align: right; flex-shrink: 0; }
.dash-msg-item { padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 12px; }
.dash-msg-item:last-child { border-bottom: none; }
.dash-msg-sender { font-weight: 600; color: var(--text-primary); }
.dash-msg-content { color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-msg-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.dash-section-header { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }

/* ── Agent avatar chip (goal rows) ── */
.dash-goal-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border-light); }
.dash-goal-row:last-child { border-bottom: none; }
.dash-agent-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0; line-height: 1;
  overflow: hidden;
}
.dash-goal-label { flex: 1; font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dash-goal-bar-bg { width: 60px; height: 4px; background: var(--border); border-radius: 2px; flex-shrink: 0; overflow: hidden; }
.dash-goal-bar-fill { height: 100%; border-radius: 2px; }
.dash-goal-pct { font-size: 10px; font-weight: 700; color: var(--text-muted); width: 26px; text-align: right; flex-shrink: 0; }

/* ── Personal ambitions card ── */
.dash-ambition-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 12px; }
.dash-ambition-row:last-child { border-bottom: none; }
.dash-ambition-cat {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 6px; border-radius: 8px; flex-shrink: 0; margin-top: 1px;
}
.dash-ambition-cat.work     { background: var(--primary-light); color: var(--primary); }
.dash-ambition-cat.personal { background: var(--purple-bg);    color: var(--purple); }
.dash-ambition-cat.health   { background: var(--green-bg);  color: var(--green); }
.dash-ambition-cat.financial{ background: var(--amber-bg);  color: var(--amber); }
.dash-ambition-cat.other    { background: var(--gray-bg);   color: var(--gray); }
.dash-ambition-text { flex: 1; color: var(--text-secondary); line-height: 1.45; }

/* ══════════════════════════════════════════
   PANEL COMMON
══════════════════════════════════════════ */
.panel {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
}
.panel:last-child { border-right: none; border-left: 1px solid var(--border); }

.panel-header {
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
  background: var(--surface);
  height: 50px;
}

.panel-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 7px;
  flex: 1;
}
.panel-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green-dot);
  animation: pulse-dot 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 10px; font-weight: 600;
  background: var(--surface-2);
  color: var(--text-muted);
  min-width: 22px;
}

.panel-body { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; }

.panel-popout-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 340;
  background: rgba(10, 14, 28, 0.18);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.panel-popout-backdrop.active {
  display: block;
  background: rgba(10, 14, 28, 0.28);
}

.panel-popout-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s;
  flex-shrink: 0;
}

.panel-popout-close:hover {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* ══════════════════════════════════════════
   AGENTS PANEL
══════════════════════════════════════════ */
/* Keep overflow-y:auto so it can scroll if viewport is very short */
.agents-panel .panel-body { padding: 6px 0; overflow-y: auto; }

/* Human-in-the-loop: Utkarsh pinned row — subtle purple tint */
.agent-row-human {
  background: linear-gradient(to right, var(--purple-bg), transparent);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  position: relative;
}
/* Left accent line for human row */
.agent-row-human::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--purple);
  border-radius: 0 2px 2px 0;
}
.agent-row-human .agent-name { color: var(--purple); }
/* Online green dot for the human */
.agent-row-human .agent-status-dot { background: var(--green-dot) !important; }
[data-theme="dark"] .agent-row-human {
  background: linear-gradient(to right, #3b0f8a14, transparent);
}

.agent-row {
  display: flex; align-items: center; gap: 11px;
  padding: calc(9px * var(--density-pad)) 12px;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s, border-color 0.12s;
  margin: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.agent-row:hover {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.agent-row:active { transform: scale(0.99); }

/* Circular avatar — photo or emoji fallback
   Note: overflow:hidden on the container clips the ::after ring,
   so we use clip-path on the img instead and keep the ring visible */
.agent-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.agent-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: absolute; inset: 0;
}
/* Subtle coloured ring overlay */
.agent-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px currentColor;
  opacity: 0.25;
  pointer-events: none;
  z-index: 1;
}

.agent-presence-dot {
  position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--surface);
  z-index: 2;
}

.agent-info { flex: 1; min-width: 0; }

.agent-name-row {
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 2px;
}
.agent-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.role-badge {
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.role-badge.LEAD { background: var(--amber-bg); color: var(--amber); }
[data-theme="dark"] .role-badge.LEAD { background: rgba(251,191,36,0.1); color: var(--amber); }
.role-badge.SPC  { background: var(--primary-light); color: var(--primary); }
[data-theme="dark"] .role-badge.SPC  { background: rgba(167,139,250,0.1); color: var(--primary); }
.role-badge.INT  { background: var(--surface-2); color: var(--text-muted); }
.role-badge.HUMAN { background: var(--purple-bg); color: var(--purple); }
[data-theme="dark"] .role-badge.HUMAN { background: rgba(167,139,250,0.1); color: var(--purple); }

.agent-status-row { display: flex; align-items: center; gap: 5px; }

.agent-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-dot 2.5s ease-in-out infinite;
}
.agent-role-sub {
  font-size: var(--font-size-xxs);
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.agent-status-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   KANBAN BOARD
══════════════════════════════════════════ */
.queue-panel { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
/* Mobile sub-header for kanban panel — hidden on desktop */
.queue-mobile-bar { display: none; }

.fire-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 9px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-secondary);
  font-size: 11px; font-weight: 600;
}
.active-badge {
  padding: 2px 9px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-secondary);
  font-size: 11px; font-weight: 600;
}

.kanban-board {
  flex: 1;
  display: flex;
  overflow-x: hidden; overflow-y: hidden;
  padding: 10px 8px;
  gap: 6px;
  min-height: 0;
  align-items: stretch;
}

.kanban-col {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column;
  min-height: 0;
}

/* Column header */
.kanban-col-header {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.kanban-col-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  opacity: 0.55;
}
.kanban-col-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-secondary);
  flex: 1;
}
.kanban-col-count {
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: 99px;
  min-width: 22px;
  text-align: center;
}

.kanban-cards {
  flex: 1;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  gap: 5px;
  padding: 6px 5px;
  min-height: 0;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--bg);
}

/* Task card */
.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
/* ── Todo select mode ── */
.task-card .select-check {
  display: none; position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; transition: all 0.15s;
  align-items: center; justify-content: center;
}
.task-card .select-check i { font-size: 12px; color: #fff; display: none; }
body.todo-select-mode .task-card .select-check { display: flex; }
body.todo-select-mode .task-card { cursor: default; }
body.todo-select-mode .task-card:hover .select-check { border-color: var(--primary); }
.task-card.selected .select-check {
  background: var(--primary); border-color: var(--primary);
}
.task-card.selected .select-check i { display: block; }
.task-card.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
/* Selection floating bar */
.todo-select-bar {
  display: none; position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px 16px; box-shadow: var(--shadow-lg); z-index: 9000;
  align-items: center; gap: 12px; font-size: 12px; font-weight: 600;
  color: var(--text-primary);
}
body.todo-select-mode .todo-select-bar { display: flex; }
.todo-select-bar .sel-count { color: var(--primary); min-width: 20px; text-align: center; }
.todo-select-bar button {
  padding: 6px 14px; border: none; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.todo-select-bar .sel-all-btn { background: var(--surface-2); color: var(--text-primary); }
.todo-select-bar .sel-all-btn:hover { background: var(--border); }
.todo-select-bar .sel-delete-btn { background: var(--red); color: #fff; }
.todo-select-bar .sel-delete-btn:hover { opacity: 0.9; }
.todo-select-bar .sel-delete-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.todo-select-bar .sel-cancel-btn { background: none; color: var(--text-muted); }
/* Delete confirmation dialog */
.delete-dialog-overlay {
  display: none; position: fixed; inset: 0; z-index: 9500;
  background: rgba(0,0,0,0.5); align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.delete-dialog-overlay.open { display: flex; }
.delete-dialog {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; max-width: 380px; width: 90%; box-shadow: var(--shadow-lg);
}
.delete-dialog h3 {
  margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--text-primary);
}
.delete-dialog p {
  margin: 0 0 20px; font-size: 12px; color: var(--text-muted); line-height: 1.5;
}
.delete-dialog .dialog-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.delete-dialog .dialog-actions button {
  padding: 8px 18px; border: none; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.delete-dialog .btn-cancel { background: var(--surface-2); color: var(--text-primary); }
.delete-dialog .btn-confirm-delete { background: var(--red); color: #fff; }
.task-card:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(124,92,252,0.10);
  transform: translateY(-1px);
  border-color: rgba(124,92,252,0.20);
}
/* Accent classes — whisper-thin left bar, all same muted tone for cohesion */
.task-card.accent-blue,
.task-card.accent-amber,
.task-card.accent-green,
.task-card.accent-orange,
.task-card.accent-purple,
.task-card.accent-gray   { border-left: 2px solid var(--border); }

.task-card-top {
  display: flex; align-items: flex-start;
  gap: 4px; margin-bottom: 6px;
}
.task-priority {
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}
.task-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  letter-spacing: -0.01em;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-footer {
  display: flex; flex-direction: column;
  gap: 5px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}
.task-footer-row {
  display: flex; align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}
.task-footer-main {
  justify-content: space-between;
}
.task-agent {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
}
.task-agent-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-card-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex-shrink: 0;
  overflow: visible;
}
.task-card-meta .todo-source-badge {
  flex-shrink: 0;
  white-space: nowrap;
}
.task-card-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.task-card-pill[data-rock-preview] {
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.task-card-pill[data-rock-preview]:hover {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}
.task-card-due {
  white-space: nowrap;
}
.task-card-meta .task-due {
  margin-left: 0;
  flex-shrink: 0;
}
/* Round agent avatar on cards */
.task-agent-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gray-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.task-agent-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
  position: absolute; inset: 0;
}
.task-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ── EOS To-Do Source badges — uniform monochrome ── */
.todo-source-badge { display:inline-flex; align-items:center; gap:3px; font-size:9px; font-weight:600; text-transform:uppercase; letter-spacing:0.06em; padding:2px 7px; border-radius:99px; flex-shrink:0; border:1px solid var(--border); color:var(--text-muted); background:transparent; }
.todo-source-ids   { }
.todo-source-rock  { }
.todo-source-admin { }

/* Rock preview popup */
.rock-preview-popup {
  position: fixed; z-index: 600;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg), 0 12px 40px rgba(0,0,0,0.15);
  padding: 0; width: 320px; max-width: calc(100vw - 32px);
  animation: modalSlideUp 0.18s cubic-bezier(0.34,1.1,0.64,1);
  overflow: hidden;
}
.rock-preview-popup::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--rpp-accent, var(--primary)), transparent 80%);
}
.rock-preview-popup .rpp-header {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}
.rock-preview-popup .rpp-ring-wrap {
  position: relative; width: 34px; height: 34px; flex-shrink: 0;
}
.rock-preview-popup .rpp-ring-wrap svg {
  position: absolute; inset: 0; transform: rotate(-90deg);
}
.rock-preview-popup .rpp-ring-wrap svg circle { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.rock-preview-popup .rpp-ring-wrap svg .ring-bg { stroke: var(--border); }
.rock-preview-popup .rpp-ring-wrap svg .ring-fill { transition: stroke-dashoffset 0.5s; }
.rock-preview-popup .rpp-ring-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; border-radius: 50%;
}
.rock-preview-popup .rpp-title { font-size: 13px; font-weight: 700; color: var(--text-primary); flex: 1; line-height: 1.35; }
.rock-preview-popup .rpp-close { width:24px;height:24px;border:none;background:none;cursor:pointer;color:var(--text-muted);font-size:14px;display:flex;align-items:center;justify-content:center;border-radius:4px;flex-shrink:0;font-family:inherit; }
.rock-preview-popup .rpp-close:hover { background:var(--border-light);color:var(--text-primary); }
.rock-preview-popup .rpp-body { padding: 14px 16px; }
.rock-preview-popup .rpp-stat-row { display:flex;gap:6px;margin-bottom:12px;flex-wrap:wrap; }
.rock-preview-popup .rpp-stat {
  display:flex;flex-direction:column;gap:2px;padding:8px 10px;
  background:var(--surface-2);border:1px solid var(--border-light);
  border-radius:var(--radius-sm);flex:1;min-width:70px;
}
.rock-preview-popup .rpp-stat-label { font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.07em;color:var(--text-muted);white-space:nowrap; }
.rock-preview-popup .rpp-stat-val { font-size:13px;font-weight:700;letter-spacing:-0.02em;color:var(--text-primary); }
.rock-preview-popup .rpp-desc { font-size:11.5px;color:var(--text-secondary);line-height:1.5;margin-bottom:12px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden; }
.rock-preview-popup .rpp-progress-bar-wrap { background:var(--border-light);border-radius:99px;height:5px;margin-bottom:12px;overflow:hidden; }
.rock-preview-popup .rpp-progress-bar { height:100%;border-radius:99px;background:var(--primary);transition:width 0.4s; }
.rock-preview-popup .rpp-footer { padding:10px 16px;border-top:1px solid var(--border-light);display:flex;gap:8px;align-items:center;background:var(--surface-2); }
.rock-preview-popup .rpp-go-btn { flex:1;padding:8px 12px;color:#fff;border:none;border-radius:var(--radius-sm);font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;transition:opacity 0.15s,transform 0.1s;letter-spacing:-0.01em; }
.rock-preview-popup .rpp-go-btn:hover { opacity:0.9;transform:translateY(-1px); }
.rock-preview-popup .rpp-dismiss-btn { padding:8px 10px;background:none;border:1px solid var(--border);border-radius:var(--radius-sm);font-size:11px;color:var(--text-secondary);cursor:pointer;font-family:inherit;transition:all 0.12s; }
.rock-preview-popup .rpp-dismiss-btn:hover { background:var(--surface-3);color:var(--text-primary); }
#rock-preview-backdrop { position:fixed;inset:0;z-index:599; }

/* ── Due date chip ── */
.task-due        { font-size:10px; font-weight:500; color:var(--text-muted); margin-left:auto; }
.task-due.overdue   { color:var(--red); font-weight:600; }
.task-due.due-today { color:var(--orange); font-weight:600; }
.task-due.done      { color:var(--green); font-weight:600; }

/* ── New To-Do modal: source picker ── */
.source-picker { display:flex; gap:6px; }
.source-btn { flex:1; padding:7px 6px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:11px; font-weight:600; cursor:pointer; background:var(--surface); color:var(--text-secondary); text-align:center; transition:all 0.15s; font-family:inherit; letter-spacing:0.03em; }
.source-btn:hover { background:var(--surface-2); color:var(--text-primary); }
.source-btn.active-ids   { background:var(--orange-bg);   color:var(--orange); border-color:var(--orange); }
.source-btn.active-rock  { background:var(--primary-light); color:var(--primary); border-color:var(--primary-muted); }
.source-btn.active-admin { background:var(--surface-2);    color:var(--text-secondary); border-color:var(--border); }
.todo-linked-row { display:none; flex-direction:column; gap:4px; }
.todo-linked-row.visible { display:flex; }

/* ══════════════════════════════════════════
   SHARED MODAL OVERLAY  (Issue + To-Do)
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: modalFadeIn 0.15s ease;
}
@keyframes modalFadeIn { from { opacity:0 } to { opacity:1 } }

.modal-box {
  position: relative;
  width: 92%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(100,90,130,0.15), 0 4px 16px rgba(100,90,130,0.08);
  display: flex; flex-direction: column;
  max-height: 88vh;
  overflow: hidden;
  animation: modalSlideUp 0.18s cubic-bezier(0.34,1.1,0.64,1);
}
@keyframes modalSlideUp {
  from { opacity:0; transform:translateY(12px) scale(0.98) }
  to   { opacity:1; transform:translateY(0)    scale(1) }
}

.modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
/* ── Prospect card tabs ── */
.supplier-tab {
  padding: 10px 18px; font-size: 12px; font-weight: 600; color: var(--text-muted);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-family: inherit; transition: color 0.15s, border-color 0.15s;
  letter-spacing: -0.01em;
}
.supplier-tab:hover { color: var(--text-primary); }
.supplier-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.modal-title {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  flex: 1; letter-spacing: -0.01em;
}
.modal-close-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--radius-xs);
  background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 14px; transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.modal-close-btn:hover { background: var(--surface-2); color: var(--text-primary); }

/* ── Unified button system ── */
/* Modal / form primary action */
.btn-primary {
  padding: 8px 18px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background 0.18s, box-shadow 0.18s;
  letter-spacing: -0.01em;
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-sm); }
/* Modal / form secondary action */
.btn-secondary {
  padding: 8px 18px; background: var(--surface); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.18s;
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text-primary); box-shadow: var(--shadow-xs); }
/* Compact header action (+ Add, Save, Start etc.) — solid CTA */
.btn-header {
  padding: 6px 14px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background 0.18s, box-shadow 0.18s;
  white-space: nowrap; letter-spacing: -0.01em;
}
.btn-header:hover { background: var(--primary-hover); box-shadow: var(--shadow-sm); }
/* Header toggle/switcher (Table/Board/Lists, Select, view modes) — ghost outline */
.btn-header-toggle {
  padding: 5px 12px; background: var(--surface); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.18s;
  white-space: nowrap; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-header-toggle:hover { background: var(--surface-2); color: var(--text-primary); border-color: var(--text-muted); }
.btn-header-toggle.active { background: var(--primary-light, rgba(99,102,241,0.1)); color: var(--primary); border-color: var(--primary); }
/* Danger action (delete) */
.btn-danger {
  padding: 8px 14px; background: none; color: var(--red);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.18s;
}
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); box-shadow: var(--shadow-xs); }

.modal-body {
  flex: 1; overflow-y: auto; min-height: 0;
}
.modal-footer {
  flex-shrink: 0;
  background: var(--surface-2);
}

/* ── Styled <input> and <textarea> (app-wide inside modals) ───────────── */
.modal-box input[type="text"],
.modal-box input[type="number"],
.modal-box input[type="email"],
.modal-box input[type="url"],
.modal-box input[type="tel"],
.modal-box input[type="date"],
.modal-box input[type="time"],
.modal-box textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  line-height: 1.4;
}
.modal-box input[type="text"]:hover,
.modal-box input[type="number"]:hover,
.modal-box input[type="email"]:hover,
.modal-box input[type="url"]:hover,
.modal-box input[type="tel"]:hover,
.modal-box input[type="date"]:hover,
.modal-box input[type="time"]:hover,
.modal-box textarea:hover {
  border-color: var(--primary-muted);
  background: var(--surface-2);
}
.modal-box input::placeholder,
.modal-box textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}
.modal-box textarea {
  resize: vertical;
}
/* Dark mode: date/time picker icon colour (covered by global rule below select styles) */

/* ── Styled <select> dropdowns (app-wide) ─────────────────────────────── */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 9px 36px 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-primary);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%237468B5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  line-height: 1.4;
}
select:hover {
  border-color: var(--primary-muted);
  background-color: var(--surface-2);
}
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
/* Dark mode arrow */
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%239B8ACA' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* Smaller variant for compact layouts (inline header dropdowns, filters, etc.) */
select.select-sm {
  padding: 6px 32px 6px 10px;
  font-size: 12px;
  border-radius: var(--radius-xs);
  width: auto;
}

/* ── Global date / time input styling ─────────────────────────────────── */
input[type="date"],
input[type="time"] {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  cursor: pointer;
}
input[type="date"]:hover,
input[type="time"]:hover {
  border-color: var(--primary-muted);
  background: var(--surface-2);
}
input[type="date"]:focus,
input[type="time"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"] {
  color-scheme: dark;
}
/* Style <option> elements (limited browser support but improves Chrome/Edge) */
select option {
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
}
select option:checked {
  background: var(--primary-light);
  color: var(--primary);
}

/* input/select/textarea focus glow inside modals — SnowUI indigo ring */
.modal-box input:focus,
.modal-box select:focus,
.modal-box textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
  outline: none;
}

@media (max-width: 600px) {
  .modal-overlay { align-items: flex-end; }
  .modal-box {
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 90vh;
  }
}

/* ── EOS Traceability Breadcrumb (To-Do card) ── */
.task-breadcrumb { display:flex; align-items:center; gap:3px; margin-bottom:4px; flex-wrap:wrap; overflow:hidden; }
.bc-item  { font-size:9px; color:var(--text-muted); font-weight:500; white-space:nowrap; }
.bc-rock  { color:var(--primary); cursor:pointer; }
.bc-goal  { color:var(--purple); }
.bc-rock:hover { text-decoration:underline; }
.bc-sep   { font-size:9px; color:var(--border); }

/* ── Scorecard ── */
.sc-subheader {
  padding: 4px 28px 10px; display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; border-bottom: 1px solid var(--border-light);
}
.sc-page-body { padding: 24px 28px; }
.sc-table-footer {
  padding: 8px 14px; font-size: 11px; color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.sc-footer-hint { flex: 1; min-width: 0; }
.sc-footer-legend { display: inline-flex; gap: 10px; align-items: center; flex-shrink: 0; }
.scorecard-section-title {
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.08em;
  color:var(--text-secondary); margin-bottom:10px;
}
.scorecard-table { width:100%; border-collapse:collapse; font-size:13px; }
.scorecard-table th {
  text-align:left; font-size:10px; font-weight:700; text-transform:uppercase;
  letter-spacing:0.07em; color:var(--text-muted); padding:6px 10px;
  border-bottom:1px solid var(--border); background:var(--surface-2);
  white-space:nowrap; position:sticky; top:0; z-index:1;
}
.scorecard-table td { padding:9px 10px; border-bottom:1px solid var(--border-light); vertical-align:middle; }
.scorecard-table tr:last-child td { border-bottom:none; }
.scorecard-table tr:hover td { background:var(--surface-2); }
/* EOS scorecard: Metric | Goal | Owner sticky; week cols fill remaining width */
/* Sticky cols use OPAQUE backgrounds so week cells don't ghost through */
.sc-history-table { border-collapse:collapse; width:100%; table-layout:fixed; }
/* Full-page: 4 sticky cols — metric(155) goal(44) owner(100) status(70)
   offsets: col1=0, col2=155, col3=199, col4=299 */
.sc-history-table td:nth-child(-n+4),
.sc-history-table th:nth-child(-n+4) { position:sticky; z-index:2; background:#fff; }
.sc-history-table thead th:nth-child(-n+4) { background:#f1f3fb; }
.sc-history-table td:nth-child(1), .sc-history-table th:nth-child(1) { left:0; }
.sc-history-table td:nth-child(2), .sc-history-table th:nth-child(2) { left:155px; }
.sc-history-table td:nth-child(3), .sc-history-table th:nth-child(3) { left:199px; }
.sc-history-table td:nth-child(4), .sc-history-table th:nth-child(4) { left:299px; }
.sc-history-table td:nth-child(4),
.sc-history-table th:nth-child(4) { box-shadow:2px 0 4px -1px rgba(0,0,0,0.08); }
/* Compact (dashboard): 3 sticky cols — metric(130) goal(40) owner(46)
   offsets: col1=0, col2=130, col3=170 */
.sc-history-table.sc-compact td:nth-child(-n+3),
.sc-history-table.sc-compact th:nth-child(-n+3) { position:sticky; z-index:2; background:#fff; }
.sc-history-table.sc-compact thead th:nth-child(-n+3) { background:#f1f3fb; }
.sc-history-table.sc-compact td:nth-child(2),
.sc-history-table.sc-compact th:nth-child(2) { left:130px; }
.sc-history-table.sc-compact td:nth-child(3),
.sc-history-table.sc-compact th:nth-child(3) { left:170px; box-shadow:2px 0 4px -1px rgba(0,0,0,0.08); }
/* col-4+ in compact are NOT sticky */
.sc-history-table.sc-compact td:nth-child(4),
.sc-history-table.sc-compact th:nth-child(4) { position:static; left:auto; box-shadow:none; }
.sc-history-table tr:hover td:nth-child(-n+4) { background:#f1f3fb; }
.sc-history-table.sc-compact tr:hover td:nth-child(-n+3) { background:#f1f3fb; }
/* Dark theme: opaque equivalents */
[data-theme="dark"] .sc-history-table td:nth-child(-n+4),
[data-theme="dark"] .sc-history-table th:nth-child(-n+4) { background:#161a30; }
[data-theme="dark"] .sc-history-table thead th:nth-child(-n+4) { background:#222844; }
[data-theme="dark"] .sc-history-table.sc-compact td:nth-child(-n+3),
[data-theme="dark"] .sc-history-table.sc-compact th:nth-child(-n+3) { background:#161a30; }
[data-theme="dark"] .sc-history-table.sc-compact thead th:nth-child(-n+3) { background:#222844; }
[data-theme="dark"] .sc-history-table tr:hover td:nth-child(-n+4),
[data-theme="dark"] .sc-history-table.sc-compact tr:hover td:nth-child(-n+3) { background:#222844; }
/* Red cell — below goal */
/* On-theme metric tooltip (notes / cadence explainer) */
.sc-metric-tip { position:relative; }
.sc-metric-tip[data-tip]::after {
  content:attr(data-tip);
  position:absolute; left:0; top:100%; margin-top:4px;
  padding:4px 10px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-xs); box-shadow:var(--shadow-sm);
  font-size:10px; font-weight:500; color:var(--text-secondary);
  white-space:nowrap; z-index:100; pointer-events:none;
  opacity:0; transition:opacity 0.15s;
}
.sc-metric-tip[data-tip]:hover::after { opacity:1; }
.sc-cell-below { background:var(--red-bg) !important; cursor:pointer; }
.sc-cell-below:hover { background:var(--red-bg) !important; }
.sc-cell-below .sc-cell-val { color:var(--red) !important; font-weight:700; }
/* Current week col */
.sc-cell-current { background:var(--blue-bg) !important; }
.sc-cell-current.sc-cell-below { background:var(--red-bg) !important; }
/* Issue button — lives in sticky metric cell, always visible when W13 is below goal */
.sc-issue-btn { display:inline-flex; align-items:center; font-size:9px; font-weight:700; color:var(--red); background:var(--red-bg); border:none; border-radius:3px; padding:1px 4px; margin-right:4px; cursor:pointer; font-family:inherit; white-space:nowrap; vertical-align:middle; flex-shrink:0; }
.scorecard-status { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:99px; font-size:11px; font-weight:700; }
.sc-on-track   { background:var(--green-bg);  color:var(--green); }
.sc-at-risk    { background:var(--amber-bg);  color:var(--amber); }
.sc-below-goal { background:var(--orange-bg); color:var(--orange); }
.sc-progress-bar { height:6px; border-radius:3px; background:var(--border); overflow:hidden; min-width:80px; }
.sc-progress-fill { height:100%; border-radius:3px; transition:width 0.4s; }

/* ── V/TO Page ── */
/* Tab container — segmented control */
.vto-tabs-wrap {
  display:flex; gap:4px; background:var(--surface-2);
  border:1px solid var(--border); border-radius:var(--radius-sm); padding:3px;
}
.vto-q-tab {
  padding:5px 14px; border:none; border-radius:6px;
  font-size:11px; font-weight:700; cursor:pointer;
  font-family:inherit; transition:all 0.15s;
  background:none; color:var(--text-secondary);
}
.vto-q-tab:hover:not(.active) { background:var(--surface-3); color:var(--text-primary); }
.vto-q-tab.active {
  background:var(--surface); color:var(--text-primary);
  box-shadow:var(--shadow-xs);
}
.vto-tab-panel { flex:1; overflow-y:auto; min-height:0; }

/* Vision tab — dashboard-style 12-column grid */
.vto-dash-grid {
  display:grid; grid-template-columns:repeat(12, 1fr); gap:24px;
  max-width:1000px; margin:0 auto; width:100%;
}
.vto-col-3  { grid-column:span 3; }
.vto-col-4  { grid-column:span 4; }
.vto-col-5  { grid-column:span 5; }
.vto-col-6  { grid-column:span 6; }
.vto-col-8  { grid-column:span 8; }
.vto-col-12 { grid-column:span 12; }
/* Section divider — full-width label row */
.vto-section-divider {
  grid-column:span 12;
  font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:0.14em;
  color:var(--text-muted); display:flex; align-items:center; gap:12px;
  padding:8px 0 4px 0; margin-top:24px;
}
.vto-section-divider:first-child { margin-top:0; }
.vto-section-divider::after {
  content:''; flex:1; height:1px; background:var(--border-light);
}

/* Cards — dashboard style */
.vto-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:24px;
  box-shadow:var(--shadow-xs);
  display:flex; flex-direction:column; gap:10px;
  box-sizing:border-box;
  transition:box-shadow 0.18s, transform 0.18s;
}
.vto-card:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
/* Hero card — 10-Year Target */
.vto-card-hero {
  background:linear-gradient(135deg, var(--purple-tint-5), var(--purple-tint-10));
  border-color:var(--primary-muted);
}
/* Left accent border for 3-Year detail cards */
.vto-card-accent { border-left:3px solid var(--primary-muted); }
.vto-card-accent-green  { border-left-color:var(--green); }
.vto-card-accent-blue   { border-left-color:var(--blue); }
.vto-card-accent-purple { border-left-color:var(--purple); }
.vto-card-accent-orange { border-left-color:var(--orange); }
/* Narrative vision card — larger text */
.vto-card-narrative .vto-editable { font-size:15px; line-height:1.65; }
/* Core value oversized number accent */
.vto-cv-number {
  font-size:20px; font-weight:800; color:var(--primary-muted);
  min-width:28px; flex-shrink:0; line-height:1; margin-top:2px; text-align:right;
}
/* Unique item with spacing */
.vto-unique-item {
  padding:10px 14px; background:var(--surface-2);
  border:1px solid var(--border-light); border-radius:var(--radius-xs);
}
.vto-unique-item + .vto-unique-item { margin-top:8px; }
/* Card title — matches dash-card-title */
.vto-badge {
  display:flex; align-items:center; gap:6px;
  font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.07em;
  color:var(--text-muted); margin-bottom:4px;
}
.vto-badge i { font-size:14px; opacity:0.7; }
/* Section field labels inside cards */
.vto-card-label {
  display:flex; align-items:center; gap:5px;
  font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:0.1em;
  color:var(--text-muted); margin-bottom:6px;
}
.vto-card-title {
  display:flex; align-items:center; gap:4px;
  font-size:11px; font-weight:600; color:var(--text-muted); margin-bottom:5px;
  text-transform:uppercase; letter-spacing:0.07em;
}
/* Editable fields — document feel, not heavy form chrome */
.vto-editable {
  font-size:14px; color:var(--text-primary); line-height:1.6;
  border:none; border-bottom:1px solid transparent;
  padding:2px 0; outline:none;
  transition:border-color 0.15s;
  cursor:text; min-height:22px;
}
.vto-editable:empty:before { content:attr(placeholder); color:var(--text-muted); pointer-events:none; font-style:italic; }
.vto-editable:hover  { border-bottom-color:var(--border); }
.vto-editable:focus  { border-bottom-color:var(--primary); }
/* Numbered value rows */
.vto-list-item {
  display:flex; align-items:flex-start; gap:8px;
  font-size:13px; color:var(--text-primary); padding:4px 0;
  border-bottom:1px solid var(--border-light);
}
.vto-list-item:last-child { border-bottom:none; }
.vto-list-icon { font-size:13px; margin-top:1px; flex-shrink:0; }
/* Measurable bullet rows */
.vto-measure-row {
  font-size:12.5px; color:var(--text-secondary); line-height:1.5;
  padding:4px 0; padding-left:14px;
  position:relative;
}
.vto-measure-row::before {
  content:''; position:absolute; left:0; top:11px;
  width:4px; height:4px; border-radius:50%; background:var(--border);
}
/* KPI stat card — large value */
.vto-kpi-value {
  font-size:22px; font-weight:700; letter-spacing:-0.02em; margin-top:4px;
}
/* Field divider inside card */
.vto-field-divider { border:none; border-top:1px solid var(--border-light); margin:12px 0; }
/* Legacy grid (kept for Traction tab) */
.vto-grid { display:flex; flex-direction:column; gap:24px; }
.vto-section { display:flex; flex-direction:column; gap:12px; }
.vto-row { display:grid; gap:12px; }
.vto-row-2 { grid-template-columns:repeat(2, 1fr); }
.vto-row-3 { grid-template-columns:repeat(3, 1fr); }
.vto-stat-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; }
.vto-stat-box {
  background:var(--surface-2); border:1px solid var(--border-light);
  border-radius:8px; padding:10px 12px; display:flex; flex-direction:column; gap:2px;
}
.vto-stat-box .vto-card-title { margin-bottom:1px; font-size:10px; white-space:nowrap; }
.vto-stat-box .vto-editable { font-weight:700; letter-spacing:-0.02em; }
/* Mobile: VTO grid collapses */
@media (max-width:768px) {
  .vto-dash-grid { grid-template-columns:repeat(2, 1fr); gap:12px; }
  .vto-col-3, .vto-col-4, .vto-col-5, .vto-col-6, .vto-col-8, .vto-col-12 { grid-column:span 2; }
  .vto-col-3 { grid-column:span 1; }
  .vto-card { padding:18px; }
  .vto-section-divider { margin-top:12px; }
  .vto-cv-number { font-size:16px; min-width:22px; }
}
@media (max-width:480px) {
  .vto-dash-grid { grid-template-columns:1fr; }
  .vto-col-3 { grid-column:span 1; }
}
/* Traction grid */
.vto-traction-grid {
  display:grid; grid-template-columns:1fr 1fr;
  gap:24px; align-items:stretch;
}
.vto-traction-grid > .vto-card { min-height:0; overflow:hidden; }
.vto-traction-full { grid-column:1 / -1; }
@media (max-width:700px)  { .vto-traction-grid { grid-template-columns:1fr; } }
.vto-progress-row { display:flex; align-items:center; gap:10px; }
.vto-progress-label { font-size:12px; color:var(--text-secondary); min-width:0; flex:1; }
.vto-add-btn {
  margin-top:10px; font-size:11px; font-weight:600; color:var(--primary);
  background:none; border:1px dashed var(--primary-muted); border-radius:var(--radius-xs);
  padding:5px 10px; cursor:pointer; width:100%; font-family:inherit;
  transition:background 0.12s;
}
.vto-add-btn:hover { background:var(--primary-light); }

/* Tag pills — fully rounded, lighter */
.tag-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tag-pill {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px; font-weight: 500;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.kanban-empty {
  border: 1.5px dashed var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 20px 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-xxs);
  background: var(--surface);
}

/* ══════════════════════════════════════════
   ORG CHART / TEAM PAGE
══════════════════════════════════════════ */

/* Tree connector lines drawn with ::before/::after pseudo-elements */
/* ── Viewport + canvas (pan/zoom) ── */
.org-viewport {
  flex: 1; overflow: hidden;
  position: relative;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  min-height: 0;
}
.org-viewport.dragging { cursor: grabbing; }
.org-canvas {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  will-change: transform;
  /* default transform set by JS */
}
/* Zoom controls in page-header */
.org-zoom-controls {
  display: flex; align-items: center; gap: 6px;
}
.org-zoom-group {
  display: flex; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.org-zoom-btn {
  width: 30px; height: 28px; border-radius: 0;
  background: transparent; border: none; border-right: 1px solid var(--border);
  color: var(--text-primary); font-size: 15px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
  font-family: inherit; flex-shrink: 0;
}
.org-zoom-btn:last-child { border-right: none; }
.org-zoom-btn:hover { background: var(--surface-hover); color: var(--blue); }
.org-zoom-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  min-width: 38px; text-align: center; padding: 0 4px;
  border-right: 1px solid var(--border);
  line-height: 28px;
}
.org-zoom-reset {
  height: 28px; padding: 0 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 10px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.12s; letter-spacing: 0.04em;
  font-family: inherit; white-space: nowrap;
}
.org-zoom-reset:hover { background: var(--surface-hover); color: var(--text-primary); border-color: var(--blue); }

.org-tree {
  display: flex; flex-direction: column;
  align-items: center; gap: 0;
  padding: 40px 80px 80px;
  min-width: max-content;
}

/* ── Tier row (each horizontal band) ── */
.org-tier { display: flex; flex-direction: column; align-items: center; width: 100%; }

/* ── Connector stem going down from a node ── */
.org-stem-down {
  width: 2px; height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Horizontal bar that spans across children ── */
.org-h-bar-wrap {
  display: flex; align-items: flex-start; justify-content: center;
  width: 100%; position: relative;
}
.org-h-bar {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  height: 2px; background: var(--border);
}
/* stem going up into each child from the h-bar */
.org-children-row {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 24px; padding-top: 32px; position: relative;
}
.org-children-row::before {
  content: ''; position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  height: 32px; width: 2px;
  background: var(--border);
}

/* Each child column (stem-up + card) */
.org-child-col {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  position: relative;
}
.org-child-col::before {
  content: ''; display: block;
  width: 2px; height: 32px;
  background: var(--border);
}

/* ── The horizontal "bridge" spanning all dept children ── */
.org-dept-bridge {
  position: relative;
  display: flex; align-items: flex-start;
  justify-content: center;
  gap: 24px;
}
.org-dept-bridge::before {
  /* horizontal line across all dept heads */
  content: '';
  position: absolute;
  top: 0;
  left: calc(50% - (var(--bridge-w, 0px) / 2));
  width: var(--bridge-w, 60%);
  height: 2px;
  background: var(--border);
}

/* ── Org node card ── */
.org-node {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  width: 200px;
  min-width: 180px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  position: relative;
}
.org-node:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
  border-color: var(--blue);
}
.org-node.org-node-top {
  width: 240px; padding: 18px 20px;
  border-width: 2px;
}
.org-node.org-node-dept {
  width: 210px;
}
.org-node-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  overflow: hidden; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.org-node-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.org-node-name {
  font-size: 13px; font-weight: 700;
  text-align: center; margin-bottom: 2px;
}
.org-node-role {
  font-size: 11px; color: var(--text-muted);
  text-align: center; margin-bottom: 8px;
}
.org-node-status {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  margin-bottom: 10px;
}
.org-status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.org-status-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.org-node-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 8px 0;
}
.org-node-accountabilities {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.org-node-accountabilities li {
  font-size: 11px; color: var(--text-secondary);
  padding-left: 12px; position: relative; line-height: 1.4;
}
.org-node-accountabilities li::before {
  content: '•'; position: absolute; left: 2px;
  color: var(--text-muted);
}
.org-tier-label {
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
  text-align: center; margin-bottom: 8px;
}

/* ── Dept row: dept columns side-by-side, connected by horizontal bridge ── */
.org-dept-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  position: relative;
}
/* Horizontal grey bridge spanning between outermost dept column stems.
   We add the bridge as a real element in JS for precise control. */
.org-dept-row::before { display: none; } /* disabled — bridge injected via JS */
.org-dept-bridge {
  position: absolute;
  top: 0; height: 2px;
  background: var(--border);
  /* JS sets left/right as inline style */
}
/* Each dept column: stem down from bridge to coloured header */
.org-dept-col {
  display: flex; flex-direction: column; align-items: center;
  padding-top: 28px; /* creates space for the stem */
  position: relative;
}
/* Coloured stem: vertical line from bridge to dept header top.
   Colour set via --dept-color inline style on the element. */
.org-dept-col::before {
  content: ''; display: block;
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 2px; height: 28px;
  background: var(--dept-color, var(--border));
}

/* ── Specialist row below each dept ── */
.org-spec-section {
  display: flex; flex-direction: column; align-items: center;
}
.org-spec-row {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
}
.org-node-spec {
  width: 160px; min-width: 140px;
  padding: 10px 12px;
}
.org-node-spec .org-node-avatar {
  width: 34px; height: 34px; margin-bottom: 7px; font-size: 16px;
}
.org-node-spec .org-node-name { font-size: 12px; }

/* ── Dept seat header banner ── */
.org-dept-header {
  background: var(--surface);
  border: 2px solid var(--dept-color, var(--border));
  border-radius: 12px 12px 0 0;
  padding: 12px 20px 10px;
  text-align: center;
  min-width: 160px;
  border-bottom: none;
  width: 100%;
  box-sizing: border-box;
}
.org-dept-title {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  white-space: nowrap;
}
.org-dept-note {
  font-size: 9px; color: var(--orange); font-weight: 600; margin-top: 3px;
}

/* ── Members row: horizontal band of agent cards below dept header ── */
.org-members-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  padding: 12px 12px 14px;
  background: var(--bg);
  border: 2px solid var(--dept-color, var(--border));
  border-top: none;
  border-radius: 0 0 12px 12px;
  position: relative;
  flex-wrap: wrap;
}
/* Vertical stem into each member card */
.org-member-col {
  display: flex; flex-direction: column; align-items: center;
}
/* Member node — slightly more compact than top nodes */
.org-node-member {
  width: 152px; min-width: 140px;
  padding: 12px 12px;
}
.org-node-member .org-node-avatar {
  width: 38px; height: 38px; margin-bottom: 8px; font-size: 18px;
}
.org-node-member .org-node-name { font-size: 12px; }
.org-node-member .org-node-role { font-size: 10px; }
.org-node-member .org-node-accountabilities li { font-size: 10px; }

/* ══════════════════════════════════════════
   LIVE FEED
══════════════════════════════════════════ */
.feed-panel { border-left: 1px solid var(--border); }

.feed-filters {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.filter-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-pill {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface);
  transition: all 0.12s;
  white-space: nowrap;
}
.filter-pill.active { background: var(--text-primary); color: var(--surface); border-color: var(--text-primary); }
.filter-pill:hover:not(.active) { background: var(--border-light); }

.agent-filters {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; gap: 5px; flex-wrap: wrap;
  flex-shrink: 0;
}
.agent-filter-pill {
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px; font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: all 0.12s;
  white-space: nowrap;
}
.agent-filter-pill.active { background: var(--text-primary); color: var(--surface); border-color: var(--text-primary); }
.agent-filter-pill:hover:not(.active) { background: var(--border-light); }

.feed-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 0; min-height: 0; }

/* Feed entry: avatar on left — matches reference layout */
.feed-entry {
  display: flex; gap: 8px;
  padding: calc(7px * var(--density-pad)) 12px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.08s;
  align-items: flex-start;
  border-radius: 6px;
  margin: 0 4px;
}
.feed-entry:last-child { border-bottom: none; }

/* Circular profile avatar for feed — photo or emoji */
.feed-entry-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
  overflow: hidden;
  position: relative;
}
.feed-entry-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
  position: absolute; inset: 0;
}

.feed-entry-body { flex: 1; min-width: 0; }

/* ── Overlapping avatar pair (sender → receiver) ── */
.feed-avatar-pair {
  position: relative; width: 40px; height: 30px; flex-shrink: 0; margin-top: 1px;
}
.feed-avatar-pair .av-sender {
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; overflow: hidden;
  border: 2px solid var(--surface);
  z-index: 2;
}
.feed-avatar-pair .av-receiver {
  position: absolute; left: 14px; top: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; overflow: hidden;
  border: 2px solid var(--surface);
  z-index: 1; opacity: 0.85;
}
.feed-avatar-pair img { width:100%; height:100%; object-fit:cover; border-radius:50%; display:block; }

/* ── Chat context chip ── */
.feed-chat-chip {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 1px 4px; border-radius: 3px;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border-light);
  white-space: nowrap; flex-shrink: 0;
}
.feed-chat-chip.chip-group    { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-bg); }
.feed-chat-chip.chip-dm       { background: var(--purple-bg); color: var(--purple); border-color: var(--purple-bg); }
.feed-chat-chip.chip-internal { background: var(--surface-3); color: var(--text-muted); border-color: var(--border-light); }

/* Row 1: name → receiver + action — single tight line, no wrap */
.feed-entry-top {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 1px; flex-wrap: nowrap; overflow: hidden;
}
.feed-agent-name {
  font-size: 11px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 90px; flex-shrink: 0;
}
.feed-action {
  font-size: 10px; color: var(--text-secondary); font-weight: 400;
  white-space: nowrap; flex-shrink: 0;
}
/* Row 2: message content — single ellipsis line */
.feed-task-title {
  font-size: 11px; font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 1px; line-height: 1.3;
}
/* Row 3: chip + time on same line */
.feed-entry-bottom {
  display: flex; align-items: center; gap: 5px;
}
.feed-time { font-size: 10px; color: var(--text-muted); }

.feed-entry:hover { background: var(--surface-2); }

/* ── Feed Log Detail Dialog ── */
#feed-detail-overlay {
  position: fixed; inset: 0; z-index: 600;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.42);
  backdrop-filter: blur(2px);
  animation: modalFadeIn 0.15s ease;
}
#feed-detail-overlay.hidden { display: none; }
#goal-detail-overlay { position:fixed;inset:0;z-index:700;background:rgba(0,0,0,0.38);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center;padding:20px;animation:modalFadeIn 0.15s ease; }
#goal-detail-overlay.hidden { display: none; }
#feed-detail-box {
  position: relative; width: min(600px, 94vw);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.22), 0 4px 16px rgba(0,0,0,0.1);
  display: flex; flex-direction: column;
  max-height: 70vh; overflow: hidden;
  animation: modalSlideUp 0.18s cubic-bezier(0.34,1.1,0.64,1);
}
.fdlg-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.fdlg-type-chip {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  padding: 2px 7px; border-radius: 5px;
  background: var(--blue-bg); color: var(--blue);
}
.fdlg-title { font-size: 13px; font-weight: 700; flex: 1; }
.fdlg-close {
  width: 26px; height: 26px; border-radius: 50%;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.fdlg-close:hover { background: var(--surface-hover); color: var(--text-primary); }
.fdlg-body {
  padding: 14px 16px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column;
}
.fdlg-content-box {
  flex: 1;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px;
  font-size: 13px; line-height: 1.7; color: var(--text-primary);
  white-space: pre-wrap; word-break: break-word;
  overflow-y: auto;
}
.fdlg-footer {
  padding: 10px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.fdlg-ts { font-size: 11px; color: var(--text-muted); }
.fdlg-avatar { width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; overflow:hidden; flex-shrink:0; }
.fdlg-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; display:block; }

/* ── Task card agent status dot ── */
.task-agent-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  display: inline-block; margin-left: 4px;
}

.feed-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
  background: var(--surface);
  flex-shrink: 0;
}
.live-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--green);
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green-dot);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* ══════════════════════════════════════════
   SETTINGS — Full page (not drawer)
══════════════════════════════════════════ */
/* Keep overlay/drawer CSS for graceful degradation, but hidden by default */
.settings-overlay { display: none !important; }
.settings-backdrop { display: none; }
.settings-drawer { display: none; }

/* Settings page layout */
.settings-page-body { flex: 1; overflow-y: auto; padding: 28px; }
.settings-page-wrap {
  max-width: 780px; margin: 0 auto;
  display: grid; grid-template-columns: 200px 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
/* Left nav */
.settings-nav {
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  padding: 16px 0;
}
.settings-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  border: none; background: transparent; width: 100%;
  text-align: left; transition: background 0.1s, color 0.1s;
  font-family: inherit;
}
.settings-nav-item:hover { background: var(--border-light); color: var(--text-primary); }
.settings-nav-item.active { background: var(--surface); color: var(--text-primary); font-weight: 600; border-right: 2px solid var(--blue); }
.settings-nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.settings-nav-section {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); padding: 14px 18px 6px; display: block;
}
/* Right content */
.settings-content { padding: 28px; overflow-y: auto; }
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.settings-panel-title {
  font-size: 17px; font-weight: 700; margin-bottom: 4px; color: var(--text-primary);
}
.settings-panel-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 24px; }
.settings-section { margin-bottom: 32px; }
.settings-section-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border-light);
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: var(--font-size-sm); font-weight: 500; color: var(--text-primary); }
.settings-sublabel { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.toggle-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--gray-bg); border-radius: 11px;
  cursor: pointer; transition: background 0.2s;
  border: 1px solid var(--border);
}
.toggle-switch input:checked + .toggle-track { background: var(--purple); border-color: var(--purple); }
.toggle-track::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); }

.settings-slider { display: flex; align-items: center; gap: 10px; flex: 1; }
.slider-input {
  flex: 1; -webkit-appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--border); outline: none; cursor: pointer;
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--purple); cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.slider-value { font-size: 11px; font-weight: 600; color: var(--text-secondary); min-width: 28px; text-align: right; }

.radio-group { display: flex; gap: 5px; flex-wrap: wrap; }
.radio-btn {
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px; font-weight: 500;
  cursor: pointer; transition: all 0.12s;
}
.radio-btn.active { background: var(--text-primary); color: var(--surface); border-color: var(--text-primary); }
.radio-btn:hover:not(.active) { background: var(--border-light); }

.settings-divider { height: 1px; background: var(--border-light); margin: 0 0 20px; }
.settings-footer { padding: 14px 18px; border-top: 1px solid var(--border); }
.btn-reset {
  width: 100%; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-secondary);
  font-size: var(--font-size-xs); font-weight: 500;
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.btn-reset:hover { background: var(--surface-2); color: var(--text-primary); }

/* ══════════════════════════════════════════
   TASK CARD EXPANDED MODAL
══════════════════════════════════════════ */
.card-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
}
.card-modal-overlay.open { display: flex; align-items: center; justify-content: center; }
.card-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.28);
  backdrop-filter: blur(2px);
}
[data-theme="dark"] .card-modal-backdrop { background: rgba(0,0,0,0.55); }

.card-modal {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 420px; max-width: calc(100vw - 40px);
  box-shadow: var(--shadow-md);
  animation: modalIn 0.18s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.card-modal-accent { display: none; }

.card-modal-body { padding: 20px 22px; }

.card-modal-header {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 12px;
}
.card-modal-priority { font-size: 14px; font-weight: 600; flex-shrink: 0; margin-top: 2px; color: var(--text-muted); }
.card-modal-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary); line-height: 1.4;
  flex: 1;
}
.card-modal-close {
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-light); background: none;
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.12s;
}
.card-modal-close:hover { background: var(--border-light); color: var(--text-primary); }
.card-modal-back {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  border: none; background: none; cursor: pointer; padding: 4px 6px;
  border-radius: var(--radius-sm); flex-shrink: 0;
  font-family: inherit; transition: all 0.12s; margin-right: 2px;
}
.card-modal-back:hover { background: var(--bg); color: var(--text-primary); }

.card-modal-liner {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
}

.card-modal-meta {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 16px;
}
.card-modal-meta-row {
  display: flex; align-items: center; gap: 10px;
}
.card-modal-meta-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
  width: 56px; flex-shrink: 0;
}
.card-modal-meta-value {
  font-size: 12px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}
.card-modal-agent-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
  overflow: hidden; position: relative;
}
.card-modal-agent-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
  position: absolute; inset: 0;
}
.card-modal-agent-name { font-weight: 600; font-size: 12px; }

.card-modal-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.card-modal-links { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.card-modal-links-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.card-modal-links-list { display: flex; flex-wrap: wrap; gap: 6px; }
.card-modal-link-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px;
  background: var(--surface-2); font-size: 11px; font-weight: 500;
  color: var(--text-secondary); text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.card-modal-link-pill:hover { background: var(--surface-3); color: var(--text-primary); }
.card-modal-link-pill i { font-size: 13px; }

.card-modal-footer {
  padding: 12px 22px;
  border-top: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
}
.card-modal-status-pill {
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}

/* ══════════════════════════════════════════
   NOTIFICATIONS BELL + DROPDOWN
══════════════════════════════════════════ */
.notif-btn-wrap {
  position: relative;
  flex-shrink: 0;
}
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 17px; height: 17px;
  border-radius: 9px;
  background: var(--orange);
  color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
  pointer-events: none;
  display: none; /* hidden until there are unread */
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 400;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: notifIn 0.15s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes notifIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-dropdown.open { display: flex; }

.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-header-title {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-secondary);
}
.notif-mark-all {
  font-size: 11px; font-weight: 500;
  color: var(--blue); cursor: pointer;
  border: none; background: none; padding: 0;
  font-family: inherit;
}
.notif-mark-all:hover { text-decoration: underline; }

.notif-list {
  flex: 1;
  overflow-y: auto;
  max-height: 360px;
}
.notif-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--border-light); }
.notif-item.unread { background: var(--blue-bg); }
.notif-item.unread:hover { background: var(--blue-bg); }
[data-theme="dark"] .notif-item.unread { background: var(--blue-bg); }
[data-theme="dark"] .notif-item.unread:hover { background: rgba(107,140,206,0.12); }

.notif-item-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
  position: relative; overflow: hidden;
}
.notif-item-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
  position: absolute; inset: 0;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
  font-size: var(--font-size-xs); font-weight: 600;
  color: var(--text-primary); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-msg {
  font-size: 11px; color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-item-time {
  font-size: 10px; color: var(--text-muted);
  white-space: nowrap; margin-top: 3px;
}
.notif-unread-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0; margin-top: 5px;
}

.notif-type-icon {
  font-size: 11px;
  position: absolute; bottom: 0; right: 0;
  background: var(--surface);
  border-radius: 50%;
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* ══════════════════════════════════════════
   AGENT CARD MODAL
══════════════════════════════════════════ */
.agent-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 700;
}
.agent-modal-overlay.open { display: flex; align-items: center; justify-content: center; }
.agent-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.32);
  backdrop-filter: blur(2px);
}
[data-theme="dark"] .agent-modal-backdrop { background: rgba(0,0,0,0.6); }

.agent-modal {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 520px; max-width: calc(100vw - 24px);
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-md);
  animation: modalIn 0.2s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
}

/* Hero top section */
.agent-modal-hero {
  padding: 20px 20px 0;
  background: var(--surface);
  flex-shrink: 0;
}
.agent-modal-hero-top {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 14px;
}
.agent-modal-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
  position: relative;
}
.agent-modal-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
  position: absolute; inset: 0;
}
.agent-modal-avatar::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px currentColor;
  opacity: 0.3; pointer-events: none; z-index: 1;
}
.agent-modal-identity { flex: 1; min-width: 0; }
.agent-modal-name {
  font-size: 20px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 2px;
}
.agent-modal-role {
  font-size: var(--font-size-xs); color: var(--text-secondary);
  margin-bottom: 4px;
}
.agent-modal-bio {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
  font-style: italic;
  white-space: normal;
  overflow: visible;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.agent-modal-status-row {
  display: flex; align-items: center; gap: 6px;
}
.agent-modal-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.agent-modal-status-word {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
}
.agent-modal-status-since {
  font-size: 11px; color: var(--text-muted); margin-left: 2px;
}
.agent-modal-close {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: none;
  color: var(--text-muted); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.12s;
}
.agent-modal-close:hover { background: var(--border-light); color: var(--text-primary); }

/* Stats strip */
.agent-modal-stats {
  display: flex; gap: 0;
  border-top: 1px solid var(--border-light);
  margin: 0 -20px;
}
.agent-modal-stat {
  flex: 1; text-align: center;
  padding: 8px 4px;
  border-right: 1px solid var(--border-light);
}
.agent-modal-stat:last-child { border-right: none; }
.agent-modal-stat-num {
  font-size: 15px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text-primary); line-height: 1.1;
}
.agent-modal-stat-label {
  font-size: 9px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted); margin-top: 1px;
  transition: color 0.06s; white-space: nowrap;
}

/* Clickable stat cards */
.agent-modal-stat-btn {
  cursor: pointer;
  user-select: none;
  transition: background 0.06s;
  border-radius: 0;
  position: relative;
}
/* Underline indicator at bottom */
.agent-modal-stat-btn::after {
  content: ''; position: absolute; bottom: 0; left: 15%; right: 15%;
  height: 2px; background: transparent; transition: background 0.06s;
  border-radius: 99px;
}
.agent-modal-stat-btn:hover { background: var(--surface-2); }
.agent-modal-stat-btn:hover .agent-modal-stat-num { color: var(--text-primary); }
.agent-modal-stat-btn:hover .agent-modal-stat-label { color: var(--text-secondary); }
.agent-modal-stat-btn.active-stat { background: var(--surface-2); }
.agent-modal-stat-btn.active-stat::after { background: var(--primary); }
.agent-modal-stat-btn.active-stat .agent-modal-stat-num { color: var(--text-primary); }
.agent-modal-stat-btn.active-stat .agent-modal-stat-label { color: var(--text-secondary); }

/* Tab content area */
.agent-modal-body {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 16px 20px;
}

/* Task items in agent modal */
/* Task items in agent modal */
.agent-modal-task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--surface);
  transition: background 0.12s, box-shadow 0.12s;
}
.agent-modal-task-clickable { cursor: pointer; }
.agent-modal-task-clickable:hover {
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.agent-modal-task-clickable:active { background: var(--border-light); }
.agent-modal-task-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.agent-modal-task-info { flex: 1; min-width: 0; }
.agent-modal-task-title {
  font-size: var(--font-size-xs); font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.agent-modal-task-meta {
  font-size: 11px; color: var(--text-muted);
}
.agent-modal-task-status {
  font-size: 10px; font-weight: 700; padding: 1px 7px;
  border-radius: 10px; flex-shrink: 0;
}
.agent-modal-task-chevron {
  font-size: 16px; color: var(--text-muted); flex-shrink: 0;
  line-height: 1; margin-left: 2px;
}
.agent-modal-task-clickable:hover .agent-modal-task-chevron { color: var(--text-secondary); }

/* Memory / log items */
.agent-modal-mem-item,
.agent-modal-log-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
}
.agent-modal-mem-item:last-child,
.agent-modal-log-item:last-child { border-bottom: none; }

/* Unified pill — both logs and memories */
.agent-modal-log-level,
.agent-modal-mem-type {
  font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 99px;
  flex-shrink: 0; white-space: nowrap;
  min-width: 56px; text-align: center;
}
.agent-modal-mem-type {
  background: var(--surface-2); color: var(--text-secondary);
}
.agent-modal-mem-content {
  flex: 1; color: var(--text-secondary); line-height: 1.45; font-size: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.agent-modal-log-msg { flex: 1; color: var(--text-secondary); line-height: 1.45; font-size: 12px; }
.agent-modal-mem-time,
.agent-modal-log-time { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }

.agent-modal-empty {
  text-align: center; padding: 32px 16px;
  color: var(--text-muted); font-size: var(--font-size-xs);
}
.agent-modal-loading {
  text-align: center; padding: 24px;
  color: var(--text-muted); font-size: var(--font-size-xs);
}

/* ══════════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════════ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1aa; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3f3f46; }

/* ══════════════════════════════════════════
   LOADING
══════════════════════════════════════════ */
.spinner-sm {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fl-spinner { display:inline-block;width:14px;height:14px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .7s linear infinite;vertical-align:middle; }
.loading-row { padding: 20px 14px; text-align: center; color: var(--text-muted); font-size: var(--font-size-xxs); }

/* ══════════════════════════════════════════
   MOBILE BOTTOM NAV (hidden on desktop)
══════════════════════════════════════════ */
.mobile-nav { display: none; }

/* ═══��══════════════════════════════════════
   LAPTOP — 1025px – 1600px
   Narrow side panels so kanban cards breathe
══════════════════════════════════════════ */
@media (min-width: 1025px) and (max-width: 1600px) {
  .workspace { grid-template-columns: 180px 1fr 240px; }
  .panel-header { padding: 0 12px; height: 44px; }
  .agent-row { padding: 6px 10px; }
  .agent-avatar { width: 34px; height: 34px; }
  .agent-status-dot, .agent-status-label { display: none; }
  .feed-entry { padding: 10px 12px; }
}

/* ══════════════════════════════════════════
   TABLET — 769px – 1024px
══════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --nav-w: 180px; }
  .page-body { padding: 16px 20px; }
  .page-header { padding: 14px 20px 12px; }
  .workspace { grid-template-columns: 160px 1fr 200px; }
  .header { padding: 0 16px; }
  .header-center { margin: 0 10px; }
  .header-chip { padding: 3px 6px; }
  .header-chip-label { display: none; }
  .notes-masonry { columns: 3 180px; }
  .vto-row-3, .vto-row-4 { grid-template-columns:repeat(2, 1fr); }
}

/* To-Dos: mirror main Mission Control's queue-first compact layout */
@media (min-width: 769px) and (max-width: 1450px) {
  #page-tasks .workspace {
    grid-template-columns: minmax(0, 1fr) !important;
    overflow: visible;
  }

  #page-tasks .agents-panel,
  #page-tasks .feed-panel {
    display: none;
  }

  #page-tasks .queue-panel {
    display: flex;
  }

  #page-tasks .queue-panel .panel-header {
    min-width: 0;
  }

  #page-tasks .queue-mobile-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #page-tasks .queue-mobile-panel-btn {
    all: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }

  #page-tasks .kanban-board {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 12px 10px 16px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    margin-left: 12px;
    margin-right: 12px;
  }

  #page-tasks .kanban-col {
    min-width: 220px;
    flex: 0 0 220px;
    scroll-snap-align: start;
  }

  #page-tasks .task-card {
    min-width: 0;
  }

  #page-tasks .feed-panel.mobile-active {
    display: flex !important;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    max-width: calc(100vw - 24px);
    height: min(78dvh, 760px);
    z-index: 350;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
  }

  #page-tasks .feed-panel.mobile-active .panel-header {
    display: flex !important;
  }
}

@media (max-width: 1280px) {
  #page-tasks .workspace {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr;
  }

  #page-tasks .agents-panel,
  #page-tasks .feed-panel {
    display: none;
  }

  #page-tasks .queue-panel {
    display: flex !important;
  }

  #page-tasks .kanban-board {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 12px 10px 18px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  #page-tasks .kanban-col {
    min-width: 260px;
    flex: 0 0 260px;
    scroll-snap-align: start;
  }

  #page-tasks .queue-mobile-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ══════════════════════════════════════════
   MOBILE RESPONSIVE — phones (≤ 768px)
══════════════════════════════════════════ */
@media (max-width: 768px) {
  /* ── Safe area + body padding for bottom nav ── */
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  /* ── Header ── */
  .header {
    height: calc(52px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 12px 0 12px;
    gap: 0;
  }
  .header-logo {
    min-width: unset;
    font-size: 13px;
  }
  /* Hide ticker / chips / clock / status on mobile to save space */
  .header-center { display: none; }
  .hdr-chip-wrap { display: none; }
  .header-chip   { display: none; }
  .header-sep    { display: none; }
  .header-clock-wrap { display: none; }
  #weather-chip  { display: none; }
  .header-right  { margin-left: auto; gap: 6px; }

  /* ── Goal banner ── */
  .goal-banner { padding: 0 12px; gap: 8px; height: 36px; }
  .goal-progress-bar-bg { width: 50px; }
  .goal-banner-label { font-size: 9px; }

  /* ── Hide the left nav entirely on mobile — use bottom nav instead ── */
  .left-nav { display: none !important; }

  /* ── Page body full-width with comfortable padding ── */
  /* Bottom padding clears the fixed bottom nav (60px) + safe area */
  .page-body { padding: 12px 14px calc(72px + env(safe-area-inset-bottom, 0px)) 14px; }
  .page-header { padding: 12px 14px 10px; }
  .page-title { font-size: 17px; }
  .page-content { max-width: 100%; }

  /* ── Workspace: single column ── */
  .workspace {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr;
    overflow: hidden;
  }

  /* All panels hidden by default on mobile, shown by JS */
  .agents-panel,
  .queue-panel,
  .feed-panel {
    display: none;
    border: none;
  }
  .agents-panel.mobile-active,
  .queue-panel.mobile-active,
  .feed-panel.mobile-active {
    display: flex;
  }

  #page-tasks.active .queue-panel {
    display: flex !important;
  }

  /* ── Kanban: horizontal scroll ── */
  .kanban-board {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 14px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 14px;
  }
  .kanban-col {
    min-width: 260px;
    flex: 0 0 260px;
    scroll-snap-align: start;
  }

  /* ── Agent rows: larger tap targets ── */
  .agent-row { padding: calc(12px * var(--density-pad)) 14px; }
  .agent-avatar { width: 40px; height: 40px; }

  /* ── Feed entries ── */
  .feed-entry { padding: 12px 14px; }
  .feed-entry-avatar { width: 34px; height: 34px; }

  /* ── Rocks page ── */
  .rocks-page-body { padding: 12px 14px !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .rocks-summary-bar { margin-bottom: 14px; }
  /* Header: title full-width, tabs on next row */
  .rocks-page-header { flex-wrap: wrap; gap: 6px; padding-bottom: 10px; }
  .rocks-header-title { flex: 1 1 100%; }
  .rocks-header-controls { margin-left: 0 !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Q-tab labels: show short version on mobile */
  .rocks-tab-full { display: none; }
  .rocks-tab-short { display: inline; }
  /* Rock cards: tighter on mobile */
  .rock-card-header { padding: 12px 14px 12px; gap: 10px; flex-wrap: wrap; }
  .rock-card-num-wrap { width: 32px; height: 32px; }
  .rock-card-num { font-size: 10px; }
  .rock-card-title-block { flex: 1 1 calc(100% - 60px); min-width: 0; }
  /* Right column: drop due date, reflow status + chevron below title */
  .rock-card-due { display: none; }
  .rock-card-right { gap: 8px; width: 100%; justify-content: flex-end; padding-left: 42px; margin-top: -4px; }
  /* Owner row + counts: tighter */
  .rock-card-owner { gap: 4px; }
  .rock-card-counts { font-size: 9.5px; }
  /* Measurable: allow wrapping on mobile */
  .rock-card-measurable { white-space: normal; max-width: 100%; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .rock-card-progress-row { padding: 0 14px 12px 48px; }
  /* Expanded body: tighter padding */
  .rock-body-inner { padding: 12px 12px 14px; gap: 12px; }
  .rock-section { padding: 10px 12px; }
  .rock-section-label { font-size: 9px; margin-bottom: 8px; }
  .rock-section-label i { font-size: 12px; }
  /* Milestone rows: compact */
  .rock-milestone-row { gap: 8px; padding: 6px 0; }
  .rock-milestone-text { font-size: 11.5px; }
  .rock-milestone-date { font-size: 10px; }
  /* Task rows: compact */
  .rock-task-row { padding: 6px 10px; gap: 8px; font-size: 11.5px; }
  .rock-task-agent { font-size: 10px; }
  /* Stat grid: 2x2 on mobile */
  .rocks-stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .rocks-stat-card { padding: 10px 12px; }
  .rocks-stat-value { font-size: 18px; }
  /* Drawer: full screen from bottom on mobile */
  .rock-drawer { width: 100vw !important; top: auto !important; height: 80vh; border-left: none !important; border-top: 1px solid var(--border); border-radius: 16px 16px 0 0; }
  /* Summary bar: sticky so it stays visible while list scrolls */
  .rocks-summary-bar { margin-bottom: 12px; }

  /* ── Notes: 2-column masonry ── */
  .notes-masonry { columns: 2 150px; }
  .notes-compose-wrap { margin-bottom: 18px; }

  /* ── Dashboard page ── */
  .dash-body { padding: 12px 14px !important; overflow-x: hidden; }
  .dash-grid { grid-template-columns: 1fr; gap: 12px; width: 100%; min-width: 0; }
  .dash-col-2, .dash-col-3, .dash-col-4, .dash-col-5, .dash-col-7, .dash-col-8, .dash-col-12 { grid-column: span 1; min-width: 0; }
  .dash-card { padding: 16px; border-radius: var(--radius-sm); min-width: 0; overflow: hidden; box-sizing: border-box; width: 100%; }
  .dash-card:hover { transform: none; }
  .dash-stat { font-size: 28px; }
  /* Agent grid: still 2-col but bigger tap targets */
  .dash-agent-chip { padding: 10px 10px; min-height: 48px; }
  /* Progress bars full-width on small screens */
  .dash-progress-bar-bg { width: 100%; flex: 1; }
  .dash-goal-bar-bg { width: 100%; flex: 1; }
  /* Rocks strip: hide the progress bar + status badge on mobile — show pct only */
  .dash-rock-bar { display: none; }
  .dash-rock-status { display: none; }
  /* To-Do Queue rows: tighter on mobile */
  .dash-row { padding: 6px 0; font-size: 12px; gap: 8px; }
  .dash-row-dot { width: 7px; height: 7px; }
  /* Leadership Team: single-column chips on narrow screens */
  .dash-agent-grid { grid-template-columns: 1fr; gap: 6px; }
  .dash-agent-chip { min-height: 44px; }
  .dash-agent-name { font-size: 12px; }
  .dash-agent-role { font-size: 10px; }
  /* Card titles: tighter */
  .dash-card-title { margin-bottom: 8px; font-size: 10px; }
  /* Stat number: slightly smaller */
  .dash-stat { font-size: 24px; }
  /* Page header: stack title + week label vertically on mobile */
  #page-dashboard .page-header { flex-direction: column; align-items: flex-start; gap: 2px; padding-bottom: 10px; }
  #page-dashboard .page-header-right { margin-left: 0; }
  #page-dashboard .page-subtitle { display: none; }
  /* Measurables table: compact + scroll */
  #scorecard-metrics-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .scorecard-section-title { font-size: 10px; }

  /* ── Scorecard full page ── */
  /* Header: stack title above quarter tabs on narrow screens */
  .sc-page-header { flex-wrap: wrap; gap: 8px; padding-bottom: 10px; }
  .sc-header-title { flex: 1 1 100%; }
  .sc-header-controls { margin-left: 0 !important; flex: 1 1 auto; }
  /* Sub-header: left-align on mobile */
  .sc-subheader { padding: 6px 14px 8px; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
  /* Page body: standard mobile padding */
  .sc-page-body { padding: 12px 14px !important; }
  /* Table footer: hint above legend on very narrow screens */
  .sc-table-footer { flex-direction: column; align-items: flex-start; gap: 6px; }
  .sc-footer-hint { font-size: 10px; }
  /* Scorecard: flex column so table fills height and footer pins at bottom */
  .sc-page-body { display: flex; flex-direction: column; overflow-y: hidden !important; }
  .sc-table-card { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-sm); }
  #sc-full-table-body { flex: 1; min-height: 0; overflow-x: auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  /* Footer: pinned at bottom, never scrolls away */
  .sc-table-footer { flex-shrink: 0; }
  /* Compact sticky cols — opaque backgrounds already set in base rules (no ghosting) */

  /* ── Scorecard table: horizontal scroll (dashboard widget) ── */
  .scorecard-table { font-size: 12px; }
  #scorecard-metrics-body > div { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ── Page header right buttons ── */
  .page-header-right { gap: 6px; }
  .page-header-right button { padding: 4px 8px; font-size: 11px; }

  /* ── V/TO ── */
  #page-vto .page-body { padding: 12px 14px !important; }
  #page-vto .page-header { flex-wrap: wrap; gap: 8px; padding-bottom: 10px; }
  #page-vto .page-header > div:first-child { flex: 1 1 100%; }
  /* Tab bar: flex row, tabs grow, save button auto-width */
  .vto-header-right { margin-left: 0 !important; width: 100%; flex-wrap: nowrap !important; }
  .vto-tabs-wrap { flex: 1; }
  .vto-tabs-wrap .vto-q-tab { flex: 1; text-align: center; padding: 8px 6px; font-size: 12px; }
  .vto-save-btn { flex-shrink: 0; width: auto !important; padding: 8px 14px !important; font-size: 12px !important; }
  #page-vto > .page-body > div { max-width: 100% !important; }
  /* VTO Vision: dashboard grid collapses (handled by grid media queries in main block) */
  .vto-traction-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .vto-card { padding: 16px; border-radius: var(--radius-sm); }
  .vto-badge { font-size: 10px; margin-bottom: 4px; }
  .vto-editable { font-size: 13px; }
  .vto-card-title { font-size: 10px; }
  .vto-list-item { font-size: 12px; }
  .vto-section-divider { font-size: 8px; gap: 8px; padding: 2px 0; }
  .vto-kpi-value { font-size: 16px; }
  .vto-measure-row { font-size: 11px; padding: 2px 0; }
  /* Legacy traction rules */
  .vto-grid { gap: 16px; }
  .vto-section { gap: 10px; }
  .vto-row-2, .vto-row-3 { grid-template-columns: 1fr !important; gap: 10px; }
  .vto-stat-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }

  /* ── Issues ── */
  .issues-page-body { padding: 12px 14px !important; }
  .issues-subtitle { display: none; }
  .issues-filters { gap: 5px; margin-bottom: 12px; }
  /* Issue card: stack vertically */
  .issue-card { flex-direction: column; gap: 8px; padding: 12px 14px; }
  .issue-card-icon { display: none; } /* save horizontal space */
  /* Actions: full-width row at bottom */
  .issue-card-actions { flex-direction: row; justify-content: flex-end; width: 100%; margin-top: 0; }
  .issue-action-btn { flex: 1; text-align: center; padding: 7px 8px; }
  /* Modal: single-col grid on small screens */
  .issue-modal-grid { grid-template-columns: 1fr !important; }

  /* ── Modals: bottom sheet ── */
  @keyframes slideUp {
    from { transform: translateY(100%); opacity: 0.5; }
    to   { transform: translateY(0);   opacity: 1; }
  }
  .card-modal {
    width: 100vw;
    max-width: 100vw;
    border-radius: 18px 18px 0 0;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    animation: slideUp 0.22s cubic-bezier(0.34,1.1,0.64,1);
  }
  .card-modal-overlay.open { align-items: flex-end; }
  .agent-modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    animation: slideUp 0.22s cubic-bezier(0.34,1.1,0.64,1);
  }
  .agent-modal-overlay.open { align-items: flex-end; }

  /* ── Notifications: full-width dropdown ── */
  .notif-dropdown {
    position: fixed;
    top: calc(52px + env(safe-area-inset-top, 0px)); left: 0; right: 0;
    width: 100vw;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 60vh;
  }

  /* ── Settings: bottom sheet (mobile) ── */
  .settings-overlay.open {
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }
  .settings-drawer {
    width: 100vw;
    max-width: 100vw;
    border-radius: 18px 18px 0 0;
    position: relative;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
  }
  /* Collapse two-col nav layout → horizontal scrolling tab bar */
  .settings-page-wrap { grid-template-columns: 1fr !important; }
  .settings-nav {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 6px 0;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
  }
  .settings-nav-section { display: none; }
  .settings-nav-item {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 12px;
    border-right: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }
  .settings-nav-item.active {
    border-right: none;
    border-bottom: 2px solid var(--blue);
    background: var(--surface);
  }
  /* Header pinned, body scrolls */
  .settings-header { flex-shrink: 0; }
  .settings-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .settings-content { padding: 16px; }
  .settings-section { margin-bottom: 20px; }
  .settings-row { padding: 10px 0; }
  .settings-footer { flex-shrink: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }

  /* ── Bottom nav ── */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 200;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    transition: background 0.1s;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px; /* iOS tap target */
  }
  .mobile-nav-btn:active { background: var(--border-light); }
  .mobile-nav-icon { font-size: 20px; line-height: 1; }
  .mobile-nav-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .mobile-nav-btn.active .mobile-nav-label { color: var(--primary); }
  .mobile-nav-btn.active .mobile-nav-icon { filter: none; }
  .mobile-nav-btn.active::after {
    content: '';
    position: absolute;
    top: 0; left: 20%; right: 20%;
    height: 2px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
  }
  .mobile-nav-badge {
    position: absolute;
    top: 5px;
    right: calc(50% - 20px);
    font-size: 10px;
    font-weight: 700;
    color: var(--red);
    background: var(--red-bg);
    border-radius: 10px;
    padding: 0 4px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--surface);
  }

  /* ── Hide desktop panel header (we use mobile nav) ── */
  .panel-header { display: none; }

  .panel-popout-close {
    display: inline-flex;
  }

  .agents-panel.mobile-active,
  .feed-panel.mobile-active {
    display: flex !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    width: min(420px, calc(100vw - 24px)) !important;
    max-width: 420px !important;
    height: min(78dvh, 760px) !important;
    z-index: 350 !important;
    border: 1px solid var(--border) !important;
    border-radius: 18px 18px 14px 14px !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow-lg) !important;
    overflow: hidden !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    flex-direction: column;
  }

  .agents-panel.mobile-active .panel-header,
  .feed-panel.mobile-active .panel-header {
    display: flex !important;
  }

  .agents-panel.mobile-active .panel-body,
  .feed-panel.mobile-active .panel-body {
    min-height: 0;
  }

  /* ── Tasks page: kanban panel mobile sub-header ── */
  .queue-mobile-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .queue-mobile-add-btn {
    margin-left: auto;
    -webkit-tap-highlight-color: transparent;
  }

  /* ── Feed: filter pills horizontal scroll on mobile ── */
  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .filter-pills::-webkit-scrollbar { display: none; }
  .agent-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .agent-filters::-webkit-scrollbar { display: none; }
  .feed-filters, .agent-filters { display: flex; }

  /* ── L10 Meeting ── */
  #page-l10 .page-header { flex-wrap: wrap; gap: 8px; }
  #page-l10 .page-header-right { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
  #page-l10 .page-header-right .btn-header { flex: 1; }
  #l10-next-badge { font-size: 10px !important; padding: 3px 8px !important; }
  #l10-agenda-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  #l10-ids-section > div { padding: 12px 14px !important; }
  #l10-last-meeting > div { padding: 12px 14px !important; }

  /* ── Team / Org Chart ── */
  .team-grid { grid-template-columns: 1fr 1fr !important; }
  #page-team .page-header { flex-wrap: wrap; gap: 6px; }
  #page-team .page-header-right { width: 100%; }
  .org-zoom-btn { width: 36px; height: 36px; font-size: 16px; }
  .org-zoom-label { line-height: 36px; min-width: 40px; font-size: 10px; }
  .org-zoom-reset { height: 36px; padding: 0 12px; font-size: 10px; }
  .org-tree { padding: 20px 30px 60px; }
  .org-node { width: 150px; min-width: 150px; padding: 10px 12px; border-radius: 8px; }
  .org-node.org-node-top { width: 170px; padding: 12px 14px; }
  .org-node.org-node-dept { width: 160px; }
  .org-node-avatar { width: 32px; height: 32px; font-size: 14px; margin-bottom: 6px; }
  .org-node-name { font-size: 11px; }
  .org-node-role { font-size: 9px; margin-bottom: 4px; }
  .org-node-status { gap: 3px; }
  .org-status-label { font-size: 8px; }
  .org-node-divider { margin: 4px 0; }
  .org-node-accountabilities li { font-size: 9px; padding-left: 10px; line-height: 1.3; }
  .org-dept-row { gap: 14px; }
  .org-members-row { gap: 10px; }
  .org-stem-down { height: 24px; }
  .org-dept-header { padding: 6px 10px; margin-bottom: 6px; }
  .org-dept-title { font-size: 9px; }

  /* ── Streamlined mobile page headers ── */
  .page-subtitle { display: none; }
  .page-title { font-size: 16px; }
  .page-header { padding: 10px 14px 8px; gap: 8px; }
  .page-header-right { gap: 6px !important; }
  .page-header .btn-header { padding: 5px 8px; font-size: 0; }
  .page-header .btn-header::before { content: '+'; font-size: 16px; font-weight: 600; line-height: 1; }
  .page-header .btn-header-toggle { padding: 5px 8px; font-size: 0; }
  .page-header .btn-header-toggle i { font-size: 14px; }
  .page-header-right input[type="text"] { width: 0 !important; min-width: 0; padding: 6px 12px 6px 28px !important; flex: 1; }

  /* ── Content Planner ── */
  .content-grid { grid-template-columns: 1fr !important; }
  #page-content .page-header { flex-wrap: nowrap; gap: 8px; }
  #page-content .page-header-right { flex: 1; justify-content: flex-end; }
  #page-content .page-header-right .btn-header { width: auto; }
  #cp-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .cp-board {
    grid-template-columns: repeat(auto-fill, 260px) !important;
    overflow-x: auto !important; overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 8px !important;
  }
  .cp-col { scroll-snap-align: start; min-width: 260px; }
  .cp-card { padding: 10px 12px; }
  .cp-card-title { font-size: 12px; }
  .cp-card-desc { font-size: 10px; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .cp-add-card { min-height: 40px; }

  /* ── Drive page ── */
  .drive-grid { grid-template-columns: 1fr !important; }

  /* ── Pipeline page ── */
  #page-pipeline .page-body { padding: 12px 14px !important; }
  #page-pipeline .page-header { flex-wrap: nowrap; gap: 8px; }
  #page-pipeline .page-header-right { flex: 1; justify-content: flex-end; }
  .pipe-tab { font-size: 10px !important; padding: 5px 10px !important; }
  #supplier-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }

  /* ── Clients page ── */
  #page-clients .page-body { padding: 12px 14px !important; }
  #page-clients .page-header { flex-wrap: nowrap; gap: 8px; }
  #page-clients .page-header-right { flex: 1; justify-content: flex-end; }
  #clients-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  #clients-view { overflow-x: auto; }

  /* ── Goal detail popup — bottom sheet ── */
  #goal-detail-overlay { align-items: flex-end; padding: 0; }
  #goal-detail-overlay > div {
    max-width: 100% !important; width: 100% !important;
    border-radius: 18px 18px 0 0 !important;
    padding: 20px 16px 16px !important;
    max-height: 85vh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Org tree — horizontal scroll ── */
  .org-tree { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ── Card modal body — tighter padding ── */
  .card-modal-body { padding: 16px 14px; }

  /* ── Bump tiny labels to 10px minimum ── */
  .org-status-label { font-size: 9px; }
  .org-dept-title { font-size: 10px; }
  .org-node-role { font-size: 10px; }
  .org-node-accountabilities li { font-size: 10px; }

  /* ── Campaigns ── */
  #page-campaigns .page-body { padding: 12px 14px !important; }
  #page-campaigns .page-header { flex-wrap: nowrap; gap: 8px; }
  #page-campaigns .page-header-right { flex: 1; justify-content: flex-end; }
  #adcamp-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  #adcamp-filters { overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #adcamp-filters::-webkit-scrollbar { display: none; }
  #adcamp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

}

/* ── Very small phones (≤ 380px) ── */
@media (max-width: 380px) {
  .header-logo { font-size: 12px; }
  .mobile-nav-icon { font-size: 18px; }
  .mobile-nav-label { font-size: 7px; letter-spacing: 0.02em; }
  .kanban-col { min-width: 240px; flex: 0 0 240px; }
  .notes-masonry { columns: 1; }
  .page-body { padding: 10px 12px; }
  .team-grid { grid-template-columns: 1fr !important; }
  /* Rocks: ultra-compact on very small phones */
  .rock-card-header { padding: 10px 12px; gap: 8px; }
  .rock-card-num-wrap { width: 28px; height: 28px; }
  .rock-card-num { font-size: 9px; }
  .rock-card-title { font-size: 12.5px; }
  .rock-card-measurable { font-size: 10.5px; -webkit-line-clamp: 1; }
  .rock-card-status-badge { font-size: 9px; padding: 2px 7px; }
  .rock-card-right { padding-left: 36px; }
  .rocks-stat-grid { gap: 6px; }
  .rocks-stat-card { padding: 8px 10px; }
  .rocks-stat-value { font-size: 16px; }
  .rock-body-inner { padding: 10px 10px 12px; }
  .rock-section { padding: 8px 10px; }
  /* Stats → single column on tiny phones */
  #adcamp-stats, #eflow-stats, #funnel-stats,
  #cp-stats, #supplier-stats, #clients-stats { grid-template-columns: 1fr !important; }
}

/* ══════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════ */
.mc-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px);
  padding: 10px 22px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  z-index: 10000; box-shadow: var(--shadow-md); color: #fff;
  opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none;
}
.mc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.mc-toast-error { background: var(--red); }
.mc-toast-success { background: var(--green); }
.mc-toast-info { background: var(--blue); }
.mc-toast-warn { background: var(--amber); }

/* ═══ PROSPECT LISTS ═══════════════════════════════════════════ */
.prospect-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.18s;
  display: flex;
  flex-direction: column;
}
.prospect-list-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-icon-sm {
  background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.btn-icon-sm:hover { background: var(--surface-2); color: var(--text-primary); }

/* Floating action bar */
.prospect-floating-bar {
  position: sticky;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  margin-top: 12px;
}

/* Bulk add menu dropdown */
.bulk-add-list-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 6px;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}
.bulk-list-option {
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.1s;
}
.bulk-list-option:hover { background: var(--surface-2); }
.bulk-list-new {
  border-top: 1px solid var(--border);
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 768px) {
  #page-insights .page-header {
    align-items: flex-start;
    gap: 10px;
  }
  #page-insights .page-header-right {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px !important;
    align-items: stretch !important;
  }
  #page-insights .page-header-right .select-sm {
    width: 100%;
    min-width: 0;
  }
  #page-insights #ins-summary-cards {
    grid-template-columns: 1fr !important;
  }
  #page-insights #ins-chart-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  #page-insights #ins-chart-grid > div {
    padding: 12px !important;
  }
  #page-insights #ins-chart-grid > div > div:last-child {
    height: 200px !important;
  }
}

/* ═══ ASK MC CHAT WIDGET ════════════════════════════════════════ */
.mc-chat-btn {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: var(--shadow-md);
  transition: transform 0.15s, box-shadow 0.15s;
}
.mc-chat-btn:hover { transform: scale(1.08); box-shadow: var(--shadow-lg); }

.mc-chat-panel {
  position: fixed; bottom: 84px; right: 24px; z-index: 9998;
  width: 380px; height: 500px; max-height: 70vh;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: none; flex-direction: column; overflow: hidden;
}
.mc-chat-panel.open { display: flex; animation: modalSlideUp 0.18s cubic-bezier(.4,0,.2,1); }

.mc-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.mc-chat-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.mc-chat-close {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--text-muted); line-height: 1; padding: 0 2px;
}
.mc-chat-close:hover { color: var(--text-primary); }

.mc-chat-messages {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.mc-chat-empty {
  text-align: center; color: var(--text-muted); font-size: 12px;
  padding: 40px 16px; line-height: 1.5;
}

.mc-chat-msg { display: flex; }
.mc-chat-msg.user { justify-content: flex-end; }
.mc-chat-msg.assistant { justify-content: flex-start; }

.mc-chat-bubble {
  max-width: 85%; padding: 8px 12px; border-radius: 12px;
  font-size: 12px; line-height: 1.5; word-break: break-word;
}
.mc-chat-msg.user .mc-chat-bubble {
  background: var(--primary); color: #fff; border-bottom-right-radius: 4px;
}
.mc-chat-msg.assistant .mc-chat-bubble {
  background: var(--surface-2); color: var(--text-primary); border-bottom-left-radius: 4px;
}
.mc-chat-bubble strong { font-weight: 700; }
.mc-chat-bubble code { background: var(--border); padding: 1px 4px; border-radius: 3px; font-size: 11px; }
.mc-chat-bubble ul { margin: 4px 0; padding-left: 16px; }
.mc-chat-bubble li { margin: 2px 0; }

.mc-chat-input-row {
  display: flex; gap: 6px; padding: 10px 12px;
  border-top: 1px solid var(--border); background: var(--surface);
}
.mc-chat-input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 20px; background: var(--surface-2); color: var(--text-primary);
  font-size: 12px; outline: none;
}
.mc-chat-input:focus { border-color: var(--primary); }
.mc-chat-send {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  flex-shrink: 0;
}
.mc-chat-send:hover { opacity: 0.85; }

@media (max-width: 768px) {
  .mc-chat-panel { width: calc(100vw - 32px); right: 16px; bottom: 76px; height: 60vh; }
  .mc-chat-btn { bottom: 16px; right: 16px; }
}
