/* ══════════════════════════════════════════════════════════════════════
   Flowlane — style.css
   Design: clean / minimal / airy — inspired by waterpod + Do. calendar
   ══════════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Background — barely-there warmth */
  --bg:        #f7f8f7;
  --surface:   #ffffff;
  --surface-2: #f3f5f3;

  /* Green — only as accent, never background fill */
  --green:       #4a7a56;
  --green-light: #e6efe8;
  --green-dark:  #2a5239;
  --green-dim:   #c8dece;

  /* Text */
  --t1: #161c16;   /* near-black */
  --t2: #536153;   /* medium  */
  --t3: #9aaa9b;   /* light   */
  --t4: #c5d1c5;   /* very light / disabled */

  /* Borders — extremely subtle */
  --border:   #eaeeea;
  --border-2: #d8dfd8;

  /* Layout */
  --header-h:  108px; /* 2-row header */
  --sidebar-w: 220px;
  --month-h:   44px;
  --hero-h:    68px;
  --lane-h:    92px;
  --bar-h:     36px;
  --nav-h:     76px;

  /* Shadows */
  --sh-xs: 0 1px 3px  rgba(10,20,10,.04);
  --sh-sm: 0 2px 10px rgba(10,20,10,.07);
  --sh-md: 0 4px 20px rgba(10,20,10,.09);
  --sh-lg: 0 8px 32px rgba(10,20,10,.12);
  --sh-xl: 0 20px 60px rgba(10,20,10,.16);

  /* Radii */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-2xl:  28px;
  --r-full: 9999px;

  /* Motion */
  --spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease:   cubic-bezier(0.0, 0.0, 0.2, 1);
  --fast:   100ms;
  --base:   180ms;
  --slow:   300ms;

  /* Status colours */
  --status-planned:  #8BB599;
  --status-active:   #235347;
  --status-done:     #051F20;
  --status-archived: #b5bdb7;

  /* Focus ring */
  --focus-ring: 0 0 0 3px rgba(74,122,86,.1);
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-font-smoothing: antialiased; }
body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: var(--t1);
  line-height: 1.5;
  overflow: hidden;
}
button  { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
svg     { display: block; flex-shrink: 0; }
pre     { font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace; }

/* ── App shell ──────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════════
   HEADER — 2-row: top (logo | title | right) + subnav
   ══════════════════════════════════════════════════════════════════════ */
#header {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: rgba(247,248,247,.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}

/* Top row */
.header-top {
  display: flex;
  align-items: center;
  padding: 24px 36px 12px;
  gap: 20px;
}

.header-title-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  justify-content: flex-end;
}

/* Subnav row */
.header-subnav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 36px 24px;
  gap: 8px;
}

/* Meta title — now in header */
.meta-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -.45px;
  outline: none;
  border-radius: 7px;
  padding: 4px 10px;
  cursor: text;
  white-space: nowrap;
  transition: background var(--fast);
}
.meta-title:hover  { background: rgba(0,0,0,.04); }
.meta-title:focus  { background: rgba(0,0,0,.05); }

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
}
.logo-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.logo-text {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--t1);
}

/* Save toast */
.save-toast {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--green);
  padding: 4px 10px;
  background: var(--green-light);
  border-radius: var(--r-full);
  transition: opacity var(--slow);
}
.save-toast svg { width: 10px; height: 10px; }
.save-toast.hidden { opacity: 0; pointer-events: none; }

/* Action group */
.action-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

#timeline-btns {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
}

#btn-zoom,
#btn-export,
#btn-ms-labels,
#btn-star-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--r-sm);
  color: var(--t4);
  cursor: pointer;
  transition: color var(--fast);
}
#btn-zoom svg,
#btn-export svg,
#btn-ms-labels svg,
#btn-star-filter svg { width: 15px; height: 15px; }
#btn-zoom:hover,
#btn-export:hover,
#btn-ms-labels:hover,
#btn-star-filter:hover { color: var(--t2); }
#btn-zoom.zoom-active,
#btn-ms-labels.zoom-active { color: var(--accent, #235347); }
#btn-star-filter.active { color: var(--accent, #235347); }
#btn-star-filter.active svg polygon { fill: currentColor; }

/* ── Image export: fixes for html2canvas capture ── */
body.exporting #tl-head    { position: static !important; }
body.exporting #tl-corner  { position: static !important; }
body.exporting .lane-label { position: static !important; }
body.exporting .project-bar {
  box-shadow: 0 2px 8px rgba(0,0,0,.08) !important;
}

/* Settings label */
.settings-view-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--t2);
  letter-spacing: -.2px;
}

/* ══════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  transition: background var(--fast), box-shadow var(--fast), transform var(--fast), color var(--fast), border-color var(--fast);
}
.btn svg { width: 13px; height: 13px; }
.btn:active { transform: scale(.96); }

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover {
  background: var(--surface);
  color: var(--t1);
  border-color: var(--t4);
  box-shadow: var(--sh-xs);
}

/* Dark button (primary action) */
.btn-dark {
  background: var(--t1);
  color: #fff;
  border: 1px solid transparent;
}
.btn-dark:hover {
  background: #2c372c;
  box-shadow: var(--sh-sm);
}

/* Save button always pushed to the right in modal footer */
.modal-foot .btn-dark { margin-left: auto; }

/* Danger button (destructive actions) */
.btn-danger {
  background: #c0392b;
  color: #fff;
  border: 1px solid transparent;
}
.btn-danger:hover {
  background: #a93226;
  box-shadow: var(--sh-sm);
}

.modal-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 12.5px;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  margin-bottom: 4px;
}
.modal-error.show { display: block; }

/* Small variant */
.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: var(--r-sm);
}
.btn-sm svg { width: 11px; height: 11px; }

/* Danger */
.btn-danger {
  background: transparent;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fef2f2; }

/* ══════════════════════════════════════════════════════════════════════
   VIEWS
   ══════════════════════════════════════════════════════════════════════ */
.view {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.view.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION — dark pill, matches waterpod reference
   ══════════════════════════════════════════════════════════════════════ */
#bottom-nav {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  background: #18211a;
  border-radius: var(--r-full);
  padding: 5px;
  box-shadow: 0 8px 32px rgba(10,20,10,.22), 0 2px 8px rgba(10,20,10,.18);
  z-index: 300;
}

.nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.38);
  transition: background var(--fast), color var(--fast), transform var(--fast);
}
.nav-btn svg { width: 18px; height: 18px; }
.nav-btn:hover {
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.7);
}
.nav-btn.active {
  background: rgba(255,255,255,.14);
  color: #fff;
}
.nav-btn:active { transform: scale(.88); }

/* ══════════════════════════════════════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════════════════════════════════════ */
#timeline-wrap {
  flex: 1;
  overflow: auto;
  padding-bottom: var(--nav-h);
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
#timeline-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
#timeline-wrap::-webkit-scrollbar-track { background: transparent; }
#timeline-wrap::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

#timeline-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* tl-hero removed — title lives in header now */

/* ── Sticky header (quarters + months) ─────────────────────────────── */
#tl-head {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-shrink: 0;
  background: rgba(247,248,247,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* Corner cell — spans both rows */
#tl-corner {
  position: sticky;
  left: 0;
  z-index: 110;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-left: 22px;
  background: rgba(247,248,247,.98);
  border-right: 1px solid var(--border);
}

.corner-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--t4);
}

/* Column wrapper that stacks quarter row + month row */
#tl-header-cols {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Quarter row ─── */
#tl-quarters {
  position: relative;
  height: 22px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.quarter-cell {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  align-items: center;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  pointer-events: none;
  user-select: none;
}
.quarter-cell:first-child { border-left: none; }

.quarter-cell--current {
  background: rgba(35, 83, 71, 0.06);
}

.quarter-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--t4);
}
.quarter-cell--current .quarter-label {
  color: var(--green);
}
.quarter-year {
  font-weight: 500;
  opacity: .65;
  margin-left: 3px;
}

/* ── Month row ─── */
#tl-months {
  position: relative;
  height: var(--month-h);
  flex-shrink: 0;
  overflow: hidden;
}

.month-cell {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  align-items: center;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  pointer-events: none;
  user-select: none;
}
.month-cell:first-child { border-left: none; }
.month-cell--current { background: rgba(74,122,86,.04); }

.month-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--t3);
  white-space: nowrap;
  letter-spacing: -.1px;
}
.month-label--current {
  color: var(--green);
}
.month-label-year {
  font-size: 10px;
  font-weight: 500;
  color: var(--t4);
  margin-left: 4px;
}

/* Today line in month header */
.today-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 1.5px;
  background: var(--green);
  opacity: .55;
  pointer-events: none;
  z-index: 5;
}
.today-line::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  border: 1.5px solid var(--bg);
}

/* ── Lane rows ──────────────────────────────────────────────────────── */
#tl-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Current-quarter shading (Option A) */
.current-q-shade {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(35, 83, 71, 0.035);
  pointer-events: none;
  z-index: 0;
}

.lane-row {
  display: flex;
  height: var(--lane-h);
  border-bottom: 1px solid var(--border-2);
  position: relative;
  z-index: 1;
}
.lane-row:last-child { border-bottom: none; }

/* Zebra striping — every other lane gets a slightly different bg */
.lane-row:nth-child(odd)  .lane-label,
.lane-row:nth-child(odd)  .lane-canvas { background: var(--surface); }
.lane-row:nth-child(even) .lane-label,
.lane-row:nth-child(even) .lane-canvas { background: var(--surface-2); }
.lane-row:nth-child(even) .lane-label:hover { background: #eaeeea; }
.lane-row:nth-child(even) .lane-canvas:hover { background: #eef1ee; }

/* Lane label — sticky left */
.lane-label {
  position: sticky;
  left: 0;
  z-index: 50;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 0 0 22px;
  gap: 4px;
  transition: background var(--fast);
}
.lane-label:hover { background: var(--surface-2); }

/* Lane drag handle */
.lane-drag-handle {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 4px;
  color: var(--t4);
  cursor: grab;
  opacity: 0;
  transition: opacity var(--fast);
  border-radius: 4px;
}
.lane-drag-handle:hover { color: var(--t2); background: var(--surface-2); }
.lane-label:hover .lane-drag-handle { opacity: 1; }
.lane-drag-handle svg { width: 10px; height: 16px; }

/* Lane reorder drop-line */
#lane-drop-line {
  position: fixed;
  left: 0; right: 0;
  height: 3px;
  background: var(--green);
  border-radius: 2px;
  z-index: 300;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(74,122,86,.5);
}
#lane-drop-line::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
}
#lane-drop-line.hidden { display: none; }

.lane-title {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--t2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
  outline: none;
  border-radius: 4px;
  padding: 2px 4px;
  transition: background var(--fast);
}
.lane-title:hover  { background: rgba(0,0,0,.04); }
.lane-title:focus  { background: rgba(0,0,0,.05); color: var(--t1); }

/* Three-dot menu button */
.lane-menu-btn {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--t4);
  opacity: 0;
  flex-shrink: 0;
  margin-right: 8px;
  transition: background var(--fast), color var(--fast), opacity var(--fast);
}
.lane-menu-btn svg { width: 12px; height: 12px; }
.lane-label:hover .lane-menu-btn { opacity: 1; }
.lane-menu-btn:hover { background: var(--green-light); color: var(--green-dark); }

/* Lane canvas */
.lane-canvas {
  position: relative;
  flex: 1;
  height: var(--lane-h);
  overflow-x: clip;
  overflow-y: visible;
  background: var(--surface);
  cursor: default;
  transition: background var(--fast);
}
.lane-canvas:hover { background: #fcfefc; }

/* Grid lines */
.grid-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
  pointer-events: none;
  z-index: 1;
}

/* Today line in lane body */
.today-line-body {
  position: absolute;
  top: 0; bottom: 0;
  width: 1.5px;
  background: var(--green);
  opacity: .3;
  pointer-events: none;
  z-index: 5;
}

/* ── Project bars ───────────────────────────────────────────────────── */
.project-bar {
  position: absolute;
  height: var(--bar-h);
  top: calc((var(--lane-h) - var(--bar-h)) / 2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  z-index: 20;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08), 0 0 0 1px rgba(255,255,255,.15) inset;
  transition: box-shadow var(--fast) var(--ease), opacity var(--fast), transform var(--fast);
}
.project-bar:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.12), 0 0 0 1px rgba(255,255,255,.2) inset;
  transform: translateY(-1px);
  z-index: 25;
}
.project-bar[data-status="archived"] { opacity: .45; filter: grayscale(.5); }

/* Bar inner layout */
.bar-inner {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  pointer-events: none;
  padding: 0 6px;
}

.bar-title {
  flex: 1;
  font-size: 11.5px;
  font-weight: 600;
  color: inherit; /* set per-bar via JS STATUS_TEXT */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.bar-right-icons {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 10;
}

.bar-done-icon {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  opacity: 0.7;
  pointer-events: none;
}

.bar-status {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,.18);
  color: rgba(255,255,255,.9);
  flex-shrink: 0;
  pointer-events: none;
  white-space: nowrap;
}

/* Resize handles */
.bar-resize {
  position: absolute;
  top: 0; bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 30;
  opacity: 0;
  display: flex;
  touch-action: none;
  align-items: center;
  justify-content: center;
  transition: opacity var(--fast);
}
.project-bar:hover .bar-resize { opacity: 1; }
.bar-resize::after {
  content: '';
  width: 2px; height: 12px;
  border-radius: 1px;
  background: rgba(255,255,255,.6);
}
.bar-resize--left  { left: 2px; }
.bar-resize--right { right: 2px; }

/* Dragging */
.project-bar.dragging {
  cursor: grabbing !important;
  opacity: .82;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  z-index: 200;
  transform: translateY(-2px) scale(1.01);
  transition: none;
}

/* ── Milestone pins ─────────────────────────────────────────────────── */
.milestone-pin {
  position: absolute;
  top: 0;
  transform: translateX(-50%) translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  touch-action: none;
  z-index: 30;
  cursor: pointer;
}

.milestone-diamond {
  width: 11px; height: 11px;
  background: var(--ms-color, #C00021);
  border: none;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform var(--fast) var(--spring), background var(--fast), filter var(--fast);
}
.milestone-pin:hover .milestone-diamond {
  transform: rotate(45deg) scale(1.3);
  filter: brightness(1.2);
  box-shadow: 0 3px 12px rgba(0,0,0,.35);
}

.milestone-fixed-label {
  display: none;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--t2);
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 7px;
  margin-top: 6px;
  pointer-events: none;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
  line-height: 1.4;
}
.milestone-labels-fixed .milestone-fixed-label {
  display: block;
}

.milestone-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--t2);
  white-space: nowrap;
  margin-top: 8px;
  pointer-events: none;
  letter-spacing: -.1px;
  text-shadow: 0 0 8px var(--surface), 0 0 4px var(--surface);
}

/* Closed milestone */
.milestone-pin--closed {
  opacity: 0.35;
  filter: grayscale(1);
}
.milestone-pin--closed .milestone-diamond {
  background: var(--t4);
  box-shadow: none;
}

/* ── Empty state ────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 72px 24px;
  gap: 8px;
  text-align: center;
  color: var(--t3);
}
.empty-state p { font-size: 13px; line-height: 1.6; }
.empty-state strong { color: var(--t2); }

/* ══════════════════════════════════════════════════════════════════════
   KANBAN VIEW
   ══════════════════════════════════════════════════════════════════════ */
#view-kanban {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

/* ── Lane filter bar ──────────────────────────────────────────────── */
#kanban-lane-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 24px 12px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
#kanban-lane-filter::-webkit-scrollbar { display: none; }

.klf-btn {
  padding: 5px 13px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--t2);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast), color var(--fast), border-color var(--fast);
  flex-shrink: 0;
}
.klf-btn:hover { background: var(--surface-2); }
.klf-btn.active {
  background: var(--t1);
  color: #fff;
  border-color: var(--t1);
}

/* Spacer pushes colour dots to the right */
.klf-spacer {
  flex: 1;
}

/* Colour dot filter buttons */
.klf-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast);
}
.klf-dot:hover {
  transform: scale(1.2);
}
.klf-dot.active {
  border-color: var(--t1);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--t1);
}

/* ══════════════════════════════════════════════════════════════════════
   MILESTONES VIEW
══════════════════════════════════════════════════════════════════════ */

#view-milestones {
  flex: 1;
  overflow-y: auto;
  padding: 36px 40px;
}

#milestones-list {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Milestone view toggle bar ── */
.ms-toggle-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 3px;
  align-self: flex-start;
}

.ms-toggle-btn {
  padding: 5px 16px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--t3);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
  white-space: nowrap;
}
.ms-toggle-btn:hover { color: var(--t1); }
.ms-toggle-btn.active {
  background: var(--t1);
  color: #fff;
}

/* Lane pill shown in By Date view */
.ms-lane-pill {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--t3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Section card */
.ms-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-xs);
}

/* Clickable header */
.ms-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
  transition: background var(--fast);
}
.ms-section-header:hover { background: var(--surface-2); }

.ms-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  flex: 1;
}

.ms-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--t3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 2px 8px;
  flex-shrink: 0;
}
.ms-count--overdue {
  color: #c0392b;
  background: rgba(192, 57, 43, .07);
  border-color: rgba(192, 57, 43, .3);
}

.ms-chevron {
  width: 12px;
  height: 12px;
  color: var(--t3);
  flex-shrink: 0;
  transition: transform var(--fast);
}
.ms-chevron--collapsed { transform: rotate(-90deg); }

/* Rows container */
.ms-section-body { padding: 4px 8px 8px; }

.ms-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--fast);
}
.ms-row:hover { background: var(--surface-2); }

.ms-diamond {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  align-self: center;
  color: var(--status-active);
}

/* Text block: title + optional description */
.ms-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ms-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-desc {
  font-size: 12px;
  color: var(--t3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-date {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--t2);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  letter-spacing: .01em;
}
.ms-date--overdue {
  color: #c0392b;
  background: rgba(192, 57, 43, .07);
  border-color: rgba(192, 57, 43, .3);
}

.ms-empty {
  text-align: center;
  color: var(--t4);
  font-size: 13px;
  padding: 80px 0;
}

/* ── Board ────────────────────────────────────────────────────────── */
#kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 0 24px 24px;
  flex: 1;
  overflow-y: auto;
  align-items: start;
  scrollbar-width: thin;
  padding-bottom: calc(var(--nav-h) + 16px);
}

/* ── Column ───────────────────────────────────────────────────────── */
.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  min-height: 120px;
  transition: box-shadow var(--fast);
}
.kanban-col.drag-over {
  box-shadow: 0 0 0 2px var(--green);
}

.kanban-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.kanban-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kanban-col-dot[data-status="planned"]  { background: var(--status-planned); }
.kanban-col-dot[data-status="active"]   { background: var(--status-active); }
.kanban-col-dot[data-status="done"]     { background: var(--status-done); }

.kanban-col-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -.2px;
  flex: 1;
}

.kanban-col-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--t3);
  background: var(--surface-2);
  border-radius: var(--r-full);
  padding: 2px 7px;
  min-width: 20px;
  text-align: center;
}

.kanban-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

/* ── Drop placeholder ─────────────────────────────────────────────── */
.kanban-drop-placeholder {
  height: 60px;
  border: 2px dashed var(--green-dim);
  border-radius: var(--r-md);
  background: var(--green-light);
  flex-shrink: 0;
}

/* ── Card ─────────────────────────────────────────────────────────── */
.kanban-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 13px 10px;
  cursor: grab;
  transition: box-shadow var(--fast), transform var(--fast), border-color var(--fast);
  border-left: 3px solid transparent;
  user-select: none;
}
.kanban-card:hover {
  box-shadow: var(--sh-sm);
  border-color: var(--border-2);
}
.kanban-card.dragging {
  opacity: 0.3;
  pointer-events: none;
}

/* Ghost card that follows the pointer */
.kanban-drag-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  box-shadow: var(--sh-lg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: rotate(2deg);
  opacity: 0.92;
}

.kanban-card[data-status="planned"] { border-left-color: var(--status-planned); }
.kanban-card[data-status="active"]  { border-left-color: var(--status-active); }
.kanban-card[data-status="done"]    { border-left-color: var(--status-done); }

.kanban-card-title {
  padding-right: 48px;
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  line-height: 1.35;
  letter-spacing: -.2px;
  margin-bottom: 7px;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.kanban-card-lane {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--t3);
  background: var(--surface-2);
  border-radius: var(--r-full);
  padding: 2px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.kanban-card-dates {
  font-size: 10.5px;
  color: var(--t3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Archive drop zone (appears while dragging a kanban card) ────────── */
#kanban-archive-zone {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 20px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(420px, calc(100vw - 48px));
  padding: 22px 32px;
  background: var(--surface);
  border: 2px dashed var(--border-2);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  color: var(--t3);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity var(--base) var(--ease), transform var(--base) var(--spring),
              background var(--fast), border-color var(--fast), color var(--fast);
}
#kanban-archive-zone svg { width: 18px; height: 18px; flex-shrink: 0; }
#kanban-archive-zone.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
#kanban-archive-zone.drag-over {
  background: var(--surface-2);
  border-style: solid;
  border-color: var(--t3);
  color: var(--t1);
  transform: translate(-50%, 0) scale(1.05);
}

/* ══════════════════════════════════════════════════════════════════════
   SETTINGS VIEW
   ══════════════════════════════════════════════════════════════════════ */
#view-settings { background: var(--bg); }

.settings-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: var(--nav-h);
  scrollbar-width: thin;
}

.settings-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.settings-section--danger {
  border-color: #fecaca;
  background: #fef8f8;
}
.settings-section--danger .settings-section-head {
  border-bottom-color: #fecaca;
}

.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}

.settings-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -.3px;
}
.settings-section-sub {
  font-size: 12px;
  color: var(--t3);
  margin-top: 2px;
}
.settings-section-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* File list */
.file-list { display: flex; flex-direction: column; }

.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--fast);
}
.file-card:last-child { border-bottom: none; }
.file-card:hover { background: var(--surface-2); }
.file-card--active {}

.file-card--local-only { opacity: .5; }
.file-card--local-only:hover { background: none; }

.file-card--locked:hover { background: none; }
.file-card--locked .file-card-icon,
.file-card--locked .file-card-info { opacity: .5; }
.file-card-icon--locked { background: var(--surface-2); }
.file-card-icon--locked svg { color: var(--t3); }

.file-card-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-card-icon svg { width: 16px; height: 16px; color: var(--green); }

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

.file-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.file-card-name {
  font-size: 11px;
  color: var(--t3);
  margin-top: 1px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.file-badge-active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--green-light);
  color: var(--green);
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.file-badge-active::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.file-list-empty {
  padding: 36px 22px;
  text-align: center;
  color: var(--t3);
  font-size: 12.5px;
}

/* ── FS storage connect panel ───────────────────────────────────────── */
.fs-connect-body {
  padding: 14px 22px 18px;
}

.fs-badge {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  line-height: 1.4;
}

#plan-badge {
  flex: none;
}

.fs-badge--connected {
  background: var(--green-light);
  border-color: var(--green-dim);
  color: var(--green-dark);
}

.fs-badge--local {
  background: var(--surface-2);
  color: var(--t3);
}

.fs-badge--error {
  background: #fff0f0;
  border-color: #f5c2c2;
  color: #b00020;
}

/* MCP token row */
.mcp-token-row { display: flex; align-items: center; gap: 8px; }
.mcp-token-hint { font-size: 11px; color: #dc2626; margin-top: 6px; }
.mcp-endpoint-label { font-size: 11px; color: var(--t3); margin: 10px 0 5px; }
.mcp-token-value {
  flex: 1;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  color: var(--t2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 10px;
  overflow-x: auto;
  white-space: nowrap;
}

/* Code block */
.code-block { padding: 16px 22px; }
.code-block pre {
  font-size: 11px;
  line-height: 1.75;
  color: var(--t2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  overflow-x: auto;
}

/* ══════════════════════════════════════════════════════════════════════
   OVERLAY & MODALS
   ══════════════════════════════════════════════════════════════════════ */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,20,10,.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 400;
  transition: opacity var(--base);
}
#overlay.hidden { opacity: 0; pointer-events: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.modal.hidden { display: none; }

.modal-box {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: all;
  animation: modal-in var(--slow) var(--spring);
  border: 1px solid var(--border);
}
.modal-box--sm { width: 360px; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(.96) translateY(12px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 0;
}
.modal-head h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.4px;
}

.close-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--t3);
  transition: background var(--fast), color var(--fast);
}
.close-btn svg { width: 12px; height: 12px; }
.close-btn:hover { background: var(--surface-2); color: var(--t1); }

.modal-body {
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 22px 20px;
}

/* ── Form ───────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.field label { font-size: 11px; font-weight: 600; color: var(--t3); letter-spacing: .2px; text-transform: uppercase; }
.opt { font-weight: 400; color: var(--t4); text-transform: none; letter-spacing: 0; }

.field input[type="text"],
.field input[type="date"],
.field input[type="password"],
.field textarea,
.field select {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 9px 12px;
  color: var(--t1);
  font-size: 13px;
  width: 100%;
  outline: none;
  transition: border-color var(--fast), background var(--fast), box-shadow var(--fast);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: var(--focus-ring);
}
.field textarea { resize: vertical; min-height: 52px; line-height: 1.5; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%239aaa9b' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 30px;
  cursor: pointer;
}

.field-row { display: flex; align-items: flex-end; gap: 8px; }
.field-arrow { flex-shrink: 0; color: var(--t4); margin-bottom: 11px; font-size: 14px; }

.file-name-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.file-name-input-wrap:focus-within {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(74,122,86,.1);
}
.file-name-input-wrap input {
  flex: 1;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding-right: 4px;
}
.file-ext {
  padding: 0 12px 0 2px;
  font-size: 12px;
  color: var(--t3);
  font-weight: 500;
  flex-shrink: 0;
}

/* ── Color swatches ─────────────────────────────────────────────────── */
.swatch-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0; }
.swatch {
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 2px solid transparent;
  box-sizing: border-box;
  transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast);
}
.swatch:hover { transform: scale(1.15); }
.swatch--active {
  border-color: var(--t1) !important;
  transform: scale(1.18) !important;
  box-shadow: 0 0 0 3px rgba(22,28,22,.1) !important;
}

/* ══════════════════════════════════════════════════════════════════════
   TOOLTIP
   ══════════════════════════════════════════════════════════════════════ */
.tooltip {
  position: fixed;
  z-index: 1000;
  background: var(--t1);
  color: rgba(255,255,255,.9);
  padding: 7px 11px;
  border-radius: var(--r-md);
  font-size: 11.5px;
  font-weight: 500;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--sh-md);
  line-height: 1.55;
  max-width: 240px;
  white-space: normal;
}
.tooltip.hidden { display: none; }

/* ══════════════════════════════════════════════════════════════════════
   CONTEXT MENU
   ══════════════════════════════════════════════════════════════════════ */
.ctx-menu {
  position: fixed;
  z-index: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px;
  box-shadow: var(--sh-lg);
  min-width: 132px;
  animation: ctx-in .1s var(--spring);
}
.ctx-menu.hidden { display: none; }

@keyframes ctx-in {
  from { opacity: 0; transform: scale(.94) translateY(-4px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--t1);
  transition: background var(--fast);
}
.ctx-item svg { width: 12px; height: 12px; color: var(--t3); }
.ctx-item:hover { background: var(--surface-2); }
.ctx-item--danger { color: #dc2626; }
.ctx-item--danger svg { color: #dc2626; }
.ctx-item--danger:hover { background: #fef2f2; }

/* ══════════════════════════════════════════════════════════════════════
   MISC
   ══════════════════════════════════════════════════════════════════════ */
.hidden { display: none !important; }

/* ── Feedback modal ─────────────────────────────────────────────────── */
.feedback-intro {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.6;
}
.feedback-cta {
  display: flex;
  justify-content: center;
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
}

/* ── Footer copyright ───────────────────────────────────────────────── */
#footer-copy {
  position: fixed;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 500;
  color: var(--t4);
  letter-spacing: .2px;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
}

/* ── Drag ghosts — shared base ───────────────────────────────── */
.drag-ghost,
.drag-ghost--milestone {
  position: absolute;
  pointer-events: none;
  transition: left .07s ease;
}

.drag-ghost {
  border-radius: 18px;
  border: 2px dashed rgba(58,140,80,.5);
  background: rgba(62,175,100,.07);
  z-index: 15;
  transition: left .07s ease, width .07s ease;
}

/* ── Dynamic lane heights — override fixed --lane-h ─────────── */
.lane-row   { height: auto; min-height: 64px; }
.lane-label { height: auto; min-height: 64px; }
.lane-canvas { height: auto; min-height: 64px; }

/* Remove fixed top-centering from bars — JS sets top explicitly */
.project-bar { top: auto; transform: none; }

/* ── Milestone drag ghost (vertical line) ───────────────────── */
.drag-ghost--milestone {
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(58, 140, 80, 0.55);
  z-index: 20;
  transform: translateX(-50%);
}

/* ── Milestone pin dragging state ────────────────────────────── */
.milestone-pin.dragging {
  cursor: grabbing !important;
  opacity: 0.75;
  z-index: 40;
  transform: translateX(-50%) translateY(-50%);
}

/* ── Make milestone pins grab-cursor on hover ────────────────── */
.milestone-pin {
  cursor: grab;
}

/* ══════════════════════════════════════════════════════════════
   QUICK EDIT POPOVER
══════════════════════════════════════════════════════════════ */

/* ── Quick-edit popover ─────────────────────────────────────────────────── */
/* 8px grid: outer pad=24, section-gap=16, label-to-input=6, input-pad=8×12 */
.quick-edit {
  position: fixed;
  z-index: 200;
  width: 360px;
  background: #fff;
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.06),
    0 12px 32px rgba(0,0,0,.11),
    0 2px 8px rgba(0,0,0,.06);
  padding: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity .15s ease, transform .15s ease;
  overflow: hidden;
}
.quick-edit.hidden { display: none; }
.quick-edit.qe-entering { animation: qe-in .15s ease forwards; }
@keyframes qe-in {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)  scale(1);    }
}

/* Header */
.qe-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.qe-title-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
  background: transparent;
  padding: 0;
  font-family: var(--font);
  letter-spacing: -.2px;
}
.qe-title-input::placeholder { color: var(--t4); font-weight: 500; }
.qe-close {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--t4);
  flex-shrink: 0;
  transition: background var(--fast), color var(--fast);
}
.qe-close:hover { background: var(--surface-2); color: var(--t1); }
.qe-close svg { width: 10px; height: 10px; }

/* Body — wraps all field sections */
#qe-project-fields,
#qe-milestone-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 24px;
}

/* Generic field wrapper (label + control) */
.qe-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Labels */
.qe-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--t4);
}

/* Description textarea */
.qe-desc-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 400;
  color: var(--t1);
  font-family: var(--font);
  background: var(--surface);
  outline: none;
  resize: vertical;
  min-height: 64px;
  transition: border-color var(--fast), box-shadow var(--fast);
  box-sizing: border-box;
  line-height: 1.5;
}
.qe-desc-input::placeholder { color: var(--t4); }
.qe-desc-input:focus { border-color: var(--green); box-shadow: var(--focus-ring); }

/* Date row */
.qe-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.qe-date-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qe-date-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  font-family: var(--font);
  background: var(--surface);
  outline: none;
  transition: border-color var(--fast), box-shadow var(--fast);
  box-sizing: border-box;
}
.qe-date-input:focus { border-color: var(--green); box-shadow: var(--focus-ring); }
.qe-date-sep { display: none; }

/* Status pills */
.qe-status-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
/* Shared base for all status toggle buttons */
.qe-status-btn,
.qe-ms-status-btn {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--t3);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--fast);
  white-space: nowrap;
  text-align: center;
  font-family: var(--font);
}
.qe-status-btn:hover,
.qe-ms-status-btn:hover    { border-color: var(--border-2); color: var(--t1); background: var(--surface-2); }
.qe-status-btn.active,
.qe-ms-status-btn.active   { border-color: transparent; color: #fff; }

/* Project status active colours */
.qe-status-btn.active[data-status="planned"]  { background: var(--status-planned); }
.qe-status-btn.active[data-status="active"]   { background: var(--status-active); }
.qe-status-btn.active[data-status="done"]     { background: var(--status-done); }
.qe-status-btn.active[data-status="archived"] { background: var(--status-archived); }

/* Milestone status active colours */
.qe-ms-status-btn.active[data-ms-status="open"]   { background: var(--status-active); }
.qe-ms-status-btn.active[data-ms-status="closed"] { background: var(--status-archived); }

/* Size pills */
.qe-size-row {
  display: flex;
  gap: 6px;
}
.qe-size-btn {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--t3);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--fast);
  white-space: nowrap;
  text-align: center;
  font-family: var(--font);
}
.qe-size-btn:hover { border-color: var(--border-2); color: var(--t1); background: var(--surface-2); }
.qe-size-btn.active {
  border-color: transparent;
  color: #fff;
  background: var(--t2);
}

/* Size badge on Kanban card */
.card-size-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--t2);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 1px 4px;
  letter-spacing: .3px;
  line-height: 1.4;
}

/* Lane select */
.qe-lane-row { display: none; } /* replaced by .qe-field */
.qe-lane-select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  font-family: var(--font);
  background: var(--surface);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23999' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color var(--fast), box-shadow var(--fast);
  box-sizing: border-box;
}
.qe-lane-select:focus {
  border-color: var(--green);
  box-shadow: var(--focus-ring);
}

/* Footer */
.qe-footer {
  display: flex;
  gap: 8px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
}
.qe-btn-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #c0392b;
  color: #fff;
  cursor: pointer;
  transition: background var(--fast);
}
.qe-btn-delete svg { width: 14px; height: 14px; }
.qe-btn-delete:hover { background: #a93226; }

.qe-btn-cancel {
  flex: 1;
  padding: 10px 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--t2);
  background: var(--surface);
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--fast);
}
.qe-btn-cancel:hover { background: var(--surface-2); border-color: var(--border-2); }
.qe-btn-save {
  flex: 2;
  padding: 10px 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  color: #fff;
  background: #18211a;
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--fast), transform var(--fast);
}
.qe-btn-save:hover  { background: #2a3a2c; }
.qe-btn-save:active { transform: scale(.98); }

.qe-ms-delete-btn {
  width: 100%;
  margin-top: 0;
  padding: 6px 0;
  background: transparent;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--fast);
}
.qe-ms-delete-btn:hover { background: #fef2f2; }

/* ── Star button (QE popover) ───────────────────────────────────────────── */
.qe-star-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t4);
  flex-shrink: 0;
  transition: all var(--fast);
  padding: 0;
}
.qe-star-btn svg { width: 11px; height: 11px; }
.qe-star-btn:hover { border-color: #E2D02C; color: #E2D02C; }
.qe-star-btn.active {
  background: #f59e0b;
  border-color: #E2D02C;
  color: #fff;
}
.qe-star-btn.active svg polygon { fill: #fff; stroke: #fff; }

/* ── Star on roadmap bar ────────────────────────────────────────────────── */
.bar-star {
  font-size: 14px;
  color: #E2D02C;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}

/* ── Kanban card badges (top-right) ─────────────────────────────────────── */
.kanban-card-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.card-star {
  font-size: 10px;
  color: #E2D02C;
  line-height: 1;
}
.card-color-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

/* ── Milestone color buttons ─────────────────────────────────────────────── */
.ms-color-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast);
  outline: none;
}
.ms-color-btn:hover {
  transform: scale(1.15);
}
.ms-color-btn.active {
  border-color: rgba(255,255,255,.9);
  box-shadow: 0 0 0 2px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.2);
  transform: scale(1.1);
}

/* ── Team color picker (QE popover) ─────────────────────────────────────── */
.qe-color-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.qe-color-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast);
  outline: none;
}
.qe-color-btn:hover {
  transform: scale(1.15);
}
.qe-color-btn.active {
  border-color: rgba(255,255,255,.9);
  box-shadow: 0 0 0 2px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.2);
  transform: scale(1.1);
}

/* ── Team dots on project bar ────────────────────────────────────────────── */
.bar-team-dots {
  position: absolute;
  top: 5px;
  display: flex;
  align-items: center;
  gap: 3px;
  pointer-events: none;
  z-index: 10;
}
.bar-team-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.4);
}
