/* =========================================================================
   Sprint Planner — Capacity Lanes paradigm
   Designed to be read top-down: lanes are the page, not a sidebar rail.
   ========================================================================= */

.sp-app {
  --lane-row-h: 78px;
  --tix-h: 40px;
  --overflow-bg: oklch(0.97 0.05 25);
  min-height: calc(100vh - var(--nav-h));
}

/* ============ HEADER ============ */
.sp-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line-2);
  background: var(--paper);
  position: sticky; top: 0; z-index: 5;
  flex-wrap: wrap;
}
.sp-head__left { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; min-width: 0; }
.sp-head__right { display: flex; align-items: center; gap: var(--s-2); }
.sp-head__title {
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink); margin: 0;
  font-variant-numeric: tabular-nums;
}

.sprint-switcher {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13px; font-weight: 500;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.sprint-switcher:hover { background: var(--paper-3); border-color: var(--ink-4); }
.sprint-switcher__crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); white-space: nowrap; }
.sprint-switcher__project { color: var(--ink-3); white-space: nowrap; }
.sprint-switcher__sprint { color: var(--ink); font-weight: 600; white-space: nowrap; }
.sprint-switcher__state {
  font-family: var(--font-mono); font-size: 10px;
  padding: 2px 6px; border-radius: 99px;
  margin-left: 4px; letter-spacing: 0.04em;
  background: var(--paper-3); color: var(--ink-3);
  text-transform: uppercase;
}
.sprint-switcher__state.state-planning { background: var(--accent-soft); color: var(--accent-ink); }
.sprint-switcher__state.state-locked   { background: var(--paper-3); color: var(--ink-2); }
.sprint-switcher__state.state-closing  { background: var(--warn-soft); color: var(--warn-ink); }
.sprint-switcher__state.state-closed   { background: var(--good-soft); color: var(--good-ink); }

.sp-head__goal {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  background: transparent;
  border-radius: var(--r-sm);
  font-size: 12px; color: var(--ink-2);
  max-width: 460px;
}
.sp-head__goal:hover { background: var(--paper-2); }
.sp-head__goal__lbl {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase;
}
.sp-head__goal__txt {
  color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============ BANNER ============ */
.sp-banner {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line-2);
  border-bottom: 1px solid var(--line-2);
}
@media (max-width: 1300px) { .sp-banner { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .sp-banner { grid-template-columns: repeat(2, 1fr); } }
.sp-stat {
  padding: 14px 18px;
  background: var(--paper);
}
.sp-stat__label {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase;
}
.sp-stat__val {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  margin-top: 4px;
  display: flex; align-items: baseline; gap: 4px;
}
.sp-stat__val.is-bad  { color: var(--bad-ink); }
.sp-stat__val.is-warn { color: var(--warn-ink); }
.sp-stat__val.is-good { color: var(--good-ink); }
.sp-stat__pct { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 2px; }
.sp-stat__sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.sp-stat__sub.is-hint { font-style: italic; color: var(--accent-ink); }


/* ============ STATE BANNERS ============ */
.state-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  color: var(--ink-2);
}
.state-banner strong { color: var(--ink); }
.state-banner--warn { background: var(--warn-soft); color: var(--warn-ink); }
.state-banner--warn strong { color: var(--warn-ink); }
.state-banner--good { background: var(--good-soft); color: var(--good-ink); }
.state-banner--good strong { color: var(--good-ink); }
.state-banner > span { flex: 1; }

/* ============ LEGEND ============ */
.lane-legend {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px;
  font-size: 11px;
  color: var(--ink-3);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.lane-legend__title { font-weight: 600; color: var(--ink-2); }
.lane-legend__sw {
  display: inline-block; width: 14px; height: 10px;
  border-radius: 2px;
  margin-right: -8px;
  vertical-align: middle;
}
.lane-legend__sw--filled { background: oklch(0.65 0.09 230); }
.lane-legend__sw--pto {
  background-image: repeating-linear-gradient(45deg, transparent 0 3px, oklch(0.6 0.05 260 / 0.4) 3px 5px);
  background-color: var(--paper-3);
}
.lane-legend__sw--overflow { background: oklch(0.7 0.16 25); }
.lane-legend__sw--limit { width: 2px; height: 14px; background: var(--ink); }
.lane-legend__hint { color: var(--ink-3); font-style: italic; }

/* ============ LANES ============ */
.sp-view {
  padding: var(--s-4) var(--s-5) var(--s-7);
  max-width: 100%;
}

.lanes {
  display: flex; flex-direction: column;
  gap: 14px;
}

.lane {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.lane.is-hover { border-color: var(--accent); background: var(--accent-soft); }
.lane.is-over {
  border-color: oklch(0.85 0.06 25);
  background: oklch(0.995 0.012 25);
}
.lane.is-light { opacity: 0.92; }

.lane__who {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.lane__who__txt { min-width: 0; flex: 1; overflow: hidden; }
.lane__who__name { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane__who__role {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase;
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lane__who__nums { text-align: right; white-space: nowrap; flex-shrink: 0; min-width: 86px; }
.lane__who__hours {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}
.lane__who__hours > span { white-space: nowrap; }
.lane__who__hours.is-bad  { color: var(--bad-ink); }
.lane__who__hours.is-warn { color: var(--warn-ink); }
.lane__who__used { color: var(--ink); }
.lane__who__avail { color: var(--ink-3); font-weight: 400; }
.lane__who__pct {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
  margin-top: 1px;
}

/* Right side: track + foot stacked. The track itself scrolls horizontally. */
.lane__right {
  min-width: 0;
  display: flex; flex-direction: column;
}
.lane__track-wrap {
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.lane__track-wrap::-webkit-scrollbar { height: 6px; }
.lane__track-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.lane__track-wrap::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }
.lane__track {
  position: relative;
  height: var(--tix-h);
  width: calc(var(--track-w) + var(--overflow-w));
  background:
    linear-gradient(to right,
      var(--paper-2) 0,
      var(--paper-2) var(--track-w),
      var(--overflow-bg) var(--track-w),
      var(--overflow-bg) 100%);
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  overflow: hidden;
}

/* Day ticks */
.lane__scale {
  position: absolute; inset: 0;
  pointer-events: none;
}
.lane__scale-tick {
  position: absolute; top: 0; bottom: 0;
  width: 1px;
  background: oklch(0.92 0.005 260 / 0.7);
}
.lane__scale-tick__lbl {
  position: absolute; top: 2px; left: 4px;
  font-family: var(--font-mono); font-size: 9px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}

/* Tickets */
.lane-tix {
  position: absolute; top: 0; bottom: 0;
  display: flex; align-items: center; gap: 5px;
  padding: 0 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-3);
  overflow: hidden;
  cursor: grab;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  font-size: 11px;
}
.lane-tix:hover { z-index: 2; box-shadow: var(--shadow-md); border-color: var(--ink-4); }
.lane-tix:active { cursor: grabbing; }
.lane-tix[data-type="bug"]   { border-left-color: oklch(0.6 0.18 25); }
.lane-tix[data-type="story"] { border-left-color: oklch(0.55 0.13 195); }
.lane-tix[data-type="task"]  { border-left-color: oklch(0.5 0.04 260); }
.lane-tix[data-type="epic"]  { border-left-color: oklch(0.5 0.13 295); }
.lane-tix.is-over {
  background: oklch(0.98 0.04 25);
  border-color: oklch(0.85 0.08 25);
  border-left-color: var(--bad);
}
.lane-tix.is-partial::after {
  content: '';
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 35%;
  background: linear-gradient(to right, transparent, oklch(0.7 0.16 25 / 0.25));
  pointer-events: none;
}

.lane-tix__type {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 2px;
  background: var(--paper-3); color: var(--ink-2);
  flex-shrink: 0;
}
.lane-tix[data-type="bug"]   .lane-tix__type { background: oklch(0.6 0.18 25 / 0.15); color: oklch(0.42 0.16 25); }
.lane-tix[data-type="story"] .lane-tix__type { background: oklch(0.55 0.13 195 / 0.15); color: oklch(0.38 0.13 195); }
.lane-tix[data-type="task"]  .lane-tix__type { background: oklch(0.5 0.04 260 / 0.15); color: oklch(0.32 0.04 260); }
.lane-tix[data-type="epic"]  .lane-tix__type { background: oklch(0.5 0.13 295 / 0.15); color: oklch(0.36 0.13 295); }

.lane-tix__id {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); flex-shrink: 0;
}
.lane-tix__title {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink);
  font-weight: 500;
}
.lane-tix__h {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-2); font-weight: 600;
  flex-shrink: 0;
}
.lane-tix__x {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 99px;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity .12s, background .12s;
  flex-shrink: 0;
}
.lane-tix:hover .lane-tix__x { opacity: 1; }
.lane-tix__x:hover { background: var(--bad-soft); color: var(--bad-ink); }

/* PTO block */
.lane-pto {
  position: absolute; top: 0; bottom: 0;
  background-color: var(--paper-3);
  background-image: repeating-linear-gradient(45deg,
    transparent 0 4px,
    oklch(0.6 0.05 260 / 0.18) 4px 7px);
  border: 1px dashed oklch(0.6 0.05 260 / 0.5);
  border-top: 0; border-bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  overflow: hidden;
}
.lane-pto__lbl { padding: 0 6px; white-space: nowrap; }

/* Capacity limit */
.lane__limit {
  position: absolute; top: -3px; bottom: -3px;
  width: 2px;
  background: var(--ink);
  z-index: 3;
}
.lane__limit::before {
  content: '';
  position: absolute; top: -1px; left: -3px;
  width: 8px; height: 4px;
  background: var(--ink);
  border-radius: 2px 2px 0 0;
}

/* Drop hint */
.lane__drop-hint {
  position: absolute; top: 4px; bottom: 4px;
  display: flex; align-items: center;
  padding: 0 10px;
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 10px;
  color: var(--accent-ink);
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
}

/* Lane foot — suggestions */
.lane__foot {
  margin-top: 10px;
  min-height: 22px;
}
.lane__foot__ok {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--good-ink);
  font-family: var(--font-mono); letter-spacing: 0.04em;
}

.suggestion {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--accent-soft);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--accent-ink);
}
.suggestion--over { background: var(--bad-soft); color: var(--bad-ink); }
.suggestion__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 99px;
  background: var(--paper); flex-shrink: 0;
  color: var(--accent-ink);
}
.suggestion__mark--bad { color: var(--bad-ink); }
.suggestion__txt { flex: 1; line-height: 1.45; }
.suggestion__txt code {
  font-family: var(--font-mono); font-size: 11px;
  padding: 1px 5px; border-radius: 3px;
  background: oklch(1 0 0 / 0.4);
}
.suggestion__act {
  background: var(--ink); color: var(--paper);
  padding: 4px 10px; border-radius: var(--r-sm);
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
  transition: opacity .12s;
}
.suggestion__act:hover { opacity: 0.85; }
.suggestion--over .suggestion__act { background: var(--bad); }

/* ============ FAB (backlog) ============ */
.sp-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 8;
}
.sp-fab__main {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 16px 0 14px; height: 44px;
  background: var(--ink); color: var(--paper);
  border-radius: 99px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: transform .12s, background .15s;
}
.sp-fab__main:hover { background: oklch(0.28 0.01 260); transform: translateY(-1px); }
.sp-fab__count {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  background: oklch(1 0 0 / 0.15);
  padding: 2px 8px; border-radius: 99px;
  font-size: 11px;
}
.sp-fab__main kbd {
  font-family: var(--font-mono); font-size: 10px;
  padding: 1px 5px; border-radius: 3px;
  background: oklch(1 0 0 / 0.12);
  color: oklch(1 0 0 / 0.7);
  margin-left: 2px;
}

/* ============ BACKLOG DRAWER ============ */
.drawer-scrim {
  position: fixed; inset: 0;
  background: oklch(0.18 0.01 260 / 0.32);
  z-index: 50;
  animation: scrim-in .18s var(--ease);
}
.drawer-scrim--light { background: oklch(0.18 0.01 260 / 0.08); }
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }

.backlog-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 460px; max-width: 92vw;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 51;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s var(--ease);
}
.backlog-drawer.is-open { transform: translateX(0); }

.backlog-drawer__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line-2);
}
.backlog-drawer__title { font-size: 16px; font-weight: 600; }
.backlog-drawer__sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }

.backlog-filters {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-2);
}
.filter-row { display: flex; gap: 8px; }
.select.select--sm { height: 30px; font-size: 12px; flex: 1; }

.backlog-bulk {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-bottom: 1px solid var(--accent-line);
  font-size: 12px;
}
.backlog-bulk__lbl { font-weight: 600; }

.backlog-drawer__list {
  flex: 1; overflow-y: auto;
  padding: 8px;
}
.backlog-row {
  display: grid;
  grid-template-columns: 24px 22px 1fr auto 26px;
  align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: grab;
  transition: background .12s;
}
.backlog-row:hover { background: var(--paper-2); }
.backlog-row.is-selected { background: var(--accent-soft); }
.backlog-row__check input { margin: 0; cursor: pointer; }
.backlog-row__type {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  background: var(--paper-3); color: var(--ink-2);
}
.backlog-row__type[data-type="bug"]   { background: oklch(0.6 0.18 25 / 0.12); color: oklch(0.42 0.16 25); }
.backlog-row__type[data-type="story"] { background: oklch(0.55 0.13 195 / 0.12); color: oklch(0.38 0.13 195); }
.backlog-row__type[data-type="task"]  { background: oklch(0.5 0.04 260 / 0.12); color: oklch(0.32 0.04 260); }
.backlog-row__type[data-type="epic"]  { background: oklch(0.5 0.13 295 / 0.12); color: oklch(0.36 0.13 295); }
.backlog-row__title { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.backlog-row__meta {
  display: flex; gap: 6px; align-items: center;
  margin-top: 3px;
  font-size: 11px; color: var(--ink-3);
  flex-wrap: wrap;
}
.backlog-row__meta code { font-family: var(--font-mono); font-size: 10px; }
.backlog-row__assign { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.warn-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 99px;
  background: var(--warn); color: var(--paper);
  font-size: 9px; font-weight: 700;
}
.prio {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  padding: 1px 5px; border-radius: 2px;
  background: var(--paper-3); color: var(--ink-2);
  letter-spacing: 0.04em;
}
.prio--p0 { background: oklch(0.6 0.18 25 / 0.15); color: oklch(0.42 0.16 25); }
.prio--p1 { background: oklch(0.7 0.16 75 / 0.18); color: oklch(0.44 0.13 75); }
.prio--p2 { color: var(--ink-2); }
.prio--p3 { color: var(--ink-3); }

.backlog-row__h {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 13px; font-weight: 600;
}
.backlog-row__add {
  width: 26px; height: 26px;
  border-radius: 99px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s, color .12s;
}
.backlog-row__add:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ============ SWITCHER POP ============ */
.switcher-pop {
  position: fixed;
  top: calc(var(--nav-h) + 60px); left: 280px;
  width: 380px; max-height: 70vh;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  z-index: 52;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: pop-in .15s var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.switcher-pop__head { padding: 10px 12px 6px; border-bottom: 1px solid var(--line-2); }
.switcher-pop__head .eyebrow { padding: 4px 0 6px; }
.switcher-pop__proj {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 8px;
  border-radius: var(--r-sm);
  font-size: 13px; color: var(--ink);
  text-align: left;
}
.switcher-pop__proj:hover { background: var(--paper-2); }
.switcher-pop__proj.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.switcher-pop__proj__dot { width: 10px; height: 10px; border-radius: 99px; }
.switcher-pop__proj__dot[data-tone="1"] { background: oklch(0.6 0.13 230); }
.switcher-pop__proj__dot[data-tone="2"] { background: oklch(0.6 0.13 155); }
.switcher-pop__proj__dot[data-tone="5"] { background: oklch(0.5 0.13 295); }
.switcher-pop__proj > svg { margin-left: auto; }

.switcher-pop__sprints {
  flex: 1; overflow-y: auto;
  padding: 6px;
}
.switcher-pop__sprint {
  display: block; width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-md);
  text-align: left;
  transition: background .12s;
}
.switcher-pop__sprint:hover { background: var(--paper-2); }
.switcher-pop__sprint.is-active { background: var(--accent-soft); }
.switcher-pop__sprint__top { display: flex; justify-content: space-between; align-items: baseline; }
.switcher-pop__sprint__name { font-size: 13px; font-weight: 600; color: var(--ink); }
.switcher-pop__sprint__state {
  font-family: var(--font-mono); font-size: 9px;
  padding: 1px 6px; border-radius: 99px;
  letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--paper-3); color: var(--ink-3);
}
.switcher-pop__sprint__state.state-planning { background: var(--accent-soft); color: var(--accent-ink); }
.switcher-pop__sprint__state.state-closed { background: var(--good-soft); color: var(--good-ink); }
.switcher-pop__sprint__sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.switcher-pop__sprint__goal {
  font-size: 12px; color: var(--ink-2);
  margin-top: 4px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.switcher-pop__new {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 12px;
  border-top: 1px solid var(--line-2);
  margin-top: 4px;
  font-size: 13px; font-weight: 500;
  color: var(--accent-ink);
  border-radius: 0;
}
.switcher-pop__new:hover { background: var(--accent-soft); }

/* ============ EDIT PANEL ============ */
.edit-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 440px; max-width: 92vw;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 52;
  display: flex; flex-direction: column;
  animation: drawer-in .25s var(--ease);
}
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.edit-panel__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line-2);
}
.edit-panel__title { font-size: 18px; font-weight: 600; margin-top: 2px; }
.edit-panel__body { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.edit-panel__warn {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: var(--r-md);
  font-size: 12px;
  line-height: 1.45;
}
.edit-panel__foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ============ TOAST ============ */
.sp-toast {
  position: fixed;
  bottom: 24px; left: 24px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 14px;
  background: var(--ink); color: var(--paper);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  z-index: 60;
  max-width: 460px;
  animation: toast-in .2s var(--ease);
}
.sp-toast__msg { flex: 1; }
.sp-toast__undo {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: oklch(1 0 0 / 0.12);
  border-radius: 99px;
  font-size: 11px; font-weight: 600;
  color: var(--paper);
}
.sp-toast__undo:hover { background: oklch(1 0 0 / 0.22); }
.sp-toast__x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  color: oklch(1 0 0 / 0.6);
  border-radius: 99px;
}
.sp-toast__x:hover { background: oklch(1 0 0 / 0.12); color: var(--paper); }

/* ============ TWEAKS PANEL ============ */
.tweaks-panel {
  position: fixed;
  top: calc(var(--nav-h) + 16px); right: 16px;
  width: 320px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  z-index: 80;
  display: flex; flex-direction: column;
  max-height: calc(100vh - var(--nav-h) - 32px);
  overflow-y: auto;
}
.tweaks-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-2);
}
.tweaks-panel__title { font-size: 14px; font-weight: 600; }
.tweaks-panel__sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.tweaks-panel__section { padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.tweaks-panel__section:last-of-type { border-bottom: 0; }
.tweaks-panel__lbl {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 8px;
}
.tweak-hint {
  margin-top: 8px;
  font-size: 11px; color: var(--warn-ink);
  line-height: 1.4;
}
.tweaks-panel__foot { padding: 12px 16px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.tweaks-panel__link {
  font-size: 12px; color: var(--accent-ink);
  text-decoration: none;
}
.tweaks-panel__link:hover { text-decoration: underline; }

.seg.seg--vert { display: flex; flex-direction: column; gap: 4px; background: transparent; border: 0; padding: 0; }
.seg.seg--wrap { flex-wrap: wrap; }
.seg__item.is-active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }

.tweak-radio {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--paper-2);
  text-align: left;
  transition: background .15s;
}
.tweak-radio:hover { background: var(--paper-3); }
.tweak-radio.is-active { background: var(--accent-soft); }
.tweak-radio__dot {
  width: 14px; height: 14px;
  border-radius: 99px;
  background: var(--paper);
  border: 2px solid var(--line);
  flex-shrink: 0; margin-top: 2px;
}
.tweak-radio.is-active .tweak-radio__dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--paper);
}
.tweak-radio__lbl { font-size: 13px; font-weight: 500; color: var(--ink); }
.tweak-radio__sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; line-height: 1.35; }

/* ============ TWO-COLUMN (alternate) ============ */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.two-col .panel {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-xl); overflow: hidden;
}
.two-col__list {
  padding: 8px; min-height: 400px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--paper-2);
}
.two-col__list.is-drop { background: var(--accent-soft); }
.two-col__row {
  display: grid; grid-template-columns: 22px 1fr auto auto; gap: 10px;
  padding: 10px 12px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: grab;
  align-items: center;
}
.two-col__row:hover { border-color: var(--ink-4); }
.two-col__type {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  background: var(--paper-3); color: var(--ink-2);
}
.two-col__type[data-type="bug"]   { background: oklch(0.6 0.18 25 / 0.12); color: oklch(0.42 0.16 25); }
.two-col__type[data-type="story"] { background: oklch(0.55 0.13 195 / 0.12); color: oklch(0.38 0.13 195); }
.two-col__type[data-type="task"]  { background: oklch(0.5 0.04 260 / 0.12); color: oklch(0.32 0.04 260); }
.two-col__type[data-type="epic"]  { background: oklch(0.5 0.13 295 / 0.12); color: oklch(0.36 0.13 295); }
.two-col__title { font-size: 13px; font-weight: 500; }
.two-col__meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 3px;
  font-size: 11px; color: var(--ink-3);
}
.two-col__meta code { font-family: var(--font-mono); font-size: 10px; }
.two-col__h {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 13px; font-weight: 600;
}
.two-col__act {
  padding: 4px 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 11px; font-weight: 500;
  color: var(--ink-2);
  transition: background .12s, color .12s, border-color .12s;
}
.two-col__act:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.two-col__act.is-danger:hover { background: var(--bad); border-color: var(--bad); }

/* ============ TIMELINE (alternate) ============ */
.timeline {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-xl); overflow: hidden;
  min-width: 940px;
}
.timeline__head {
  display: grid;
  grid-template-columns: 160px 1fr;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.timeline__head__who {
  padding: 10px 14px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase;
}
.timeline__head__days {
  display: flex;
}
.timeline__day {
  width: var(--day-w);
  padding: 6px 8px;
  border-left: 1px solid var(--line-2);
  text-align: center;
}
.timeline__day__lbl {
  font-size: 11px; font-weight: 600; color: var(--ink);
}
.timeline__day__cap {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--ink-3); margin-top: 1px;
}

.timeline__lane {
  display: grid;
  grid-template-columns: 160px 1fr;
  border-bottom: 1px solid var(--line-2);
  min-height: 56px;
}
.timeline__lane:last-child { border-bottom: 0; }
.timeline__lane.is-over { background: oklch(0.99 0.02 25); }
.timeline__who {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-right: 1px solid var(--line-2);
}
.timeline__who__name { font-size: 12px; font-weight: 600; }
.timeline__who__h { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }

.timeline__row {
  position: relative;
  width: calc(var(--day-w) * var(--days));
  height: 56px;
}
.timeline__cell {
  position: absolute; top: 0; bottom: 0;
  width: var(--day-w);
  border-right: 1px solid var(--line-2);
}
.timeline__cell:nth-child(odd) { background: oklch(0.985 0.003 90); }
.timeline-tix {
  position: absolute; top: 10px; height: 32px;
  display: flex; align-items: center; gap: 4px;
  padding: 0 6px;
  background: var(--paper); border: 1px solid var(--line);
  border-left: 3px solid var(--ink-3);
  border-radius: 3px;
  font-size: 10px;
  cursor: grab;
  overflow: hidden;
}
.timeline-tix[data-type="bug"]   { border-left-color: oklch(0.6 0.18 25); }
.timeline-tix[data-type="story"] { border-left-color: oklch(0.55 0.13 195); }
.timeline-tix[data-type="task"]  { border-left-color: oklch(0.5 0.04 260); }
.timeline-tix[data-type="epic"]  { border-left-color: oklch(0.5 0.13 295); }
.timeline-tix.is-over { background: oklch(0.97 0.05 25); border-color: oklch(0.85 0.08 25); }
.timeline-tix__type {
  font-family: var(--font-mono); font-size: 8px; font-weight: 700;
  color: var(--ink-3);
}
.timeline-tix__title { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }
.timeline-tix__h { font-family: var(--font-mono); color: var(--ink-2); font-weight: 600; }
.timeline-tix__x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  margin-left: auto;
  border-radius: 99px;
  color: var(--ink-3); opacity: 0;
}
.timeline-tix:hover .timeline-tix__x { opacity: 1; }

.timeline__pto {
  position: absolute; top: 6px; bottom: 6px;
  background-image: repeating-linear-gradient(45deg, transparent 0 4px, oklch(0.6 0.05 260 / 0.18) 4px 7px);
  background-color: var(--paper-3);
  border: 1px dashed oklch(0.6 0.05 260 / 0.5);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
  letter-spacing: 0.04em;
}

.timeline__foot {
  padding: 10px 14px;
  border-top: 1px solid var(--line-2);
  background: var(--paper-2);
}
.timeline__legend {
  display: flex; align-items: center; gap: 14px;
  font-size: 11px; color: var(--ink-3);
}
.timeline__legend__sw {
  display: inline-block;
  width: 12px; height: 10px;
  border-left: 3px solid;
  background: var(--paper);
  border-radius: 2px;
  margin-right: -8px;
  vertical-align: middle;
}
.timeline__legend__sw--bug   { border-left-color: oklch(0.6 0.18 25); }
.timeline__legend__sw--story { border-left-color: oklch(0.55 0.13 195); }
.timeline__legend__sw--task  { border-left-color: oklch(0.5 0.04 260); }
.timeline__legend__sw--epic  { border-left-color: oklch(0.5 0.13 295); }
.timeline__legend__sw--pto   {
  border: 0;
  background-image: repeating-linear-gradient(45deg, transparent 0 3px, oklch(0.6 0.05 260 / 0.4) 3px 5px);
  background-color: var(--paper-3);
}
.timeline__legend__sw--over  { border: 0; background: oklch(0.97 0.05 25); border: 1px solid oklch(0.85 0.08 25); }

/* ============ CHIP-T (generic) ============ */
.chip-t {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-3);
  border-radius: var(--r-sm);
  font-size: 12px;
  cursor: grab;
}
.chip-t[data-type="bug"]   { border-left-color: oklch(0.6 0.18 25); }
.chip-t[data-type="story"] { border-left-color: oklch(0.55 0.13 195); }
.chip-t[data-type="task"]  { border-left-color: oklch(0.5 0.04 260); }
.chip-t[data-type="epic"]  { border-left-color: oklch(0.5 0.13 295); }
.chip-t__type { font-family: var(--font-mono); font-size: 9px; font-weight: 700; color: var(--ink-3); }
.chip-t__id { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.chip-t__title { font-weight: 500; color: var(--ink); }
.chip-t__hours { font-family: var(--font-mono); font-weight: 600; color: var(--ink-2); }

/* ============ DARK THEME OVERRIDES ============ */
:root[data-theme="dark"] .sp-app {
  --overflow-bg: oklch(0.34 0.06 25);
}
:root[data-theme="dark"] .lane.is-over { background: oklch(0.22 0.02 25); }
:root[data-theme="dark"] .lane-tix.is-over { background: oklch(0.3 0.05 25); }
:root[data-theme="dark"] .timeline-tix.is-over { background: oklch(0.3 0.05 25); }
:root[data-theme="dark"] .sprint-switcher { background: var(--paper-2); }

@media (max-width: 900px) {
  .lane { grid-template-columns: 1fr; }
  .lane__who { grid-template-columns: 32px 1fr auto; }
  .two-col { grid-template-columns: 1fr; }
}
