/* Long funnels stay on one horizontal board without widening the workspace. */
.kanban.stage-board {
  --stage-column-width: 250px;
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: var(--stage-column-width);
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 4px 2px 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: auto;
  scrollbar-color: #9bac89 #e6ebdf;
}

.kanban.stage-board > .kanban-column {
  width: 100%;
  min-width: 0;
  min-height: 395px;
}

.kanban.stage-board::-webkit-scrollbar { height: 12px; }
.kanban.stage-board::-webkit-scrollbar-track { background: #e6ebdf; border-radius: 6px; }
.kanban.stage-board::-webkit-scrollbar-thumb { background: #9bac89; border: 2px solid #e6ebdf; border-radius: 6px; }
.kanban.stage-board::-webkit-scrollbar-thumb:hover { background: #748b5e; }

/* Stage figures use the same visible deals as the cards and stage count. */
.kanban-stage-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  margin: 7px 8px 10px;
}
.kanban-stage-summary .kanban-stage-total { max-width: 100%; margin: 0; }
.kanban-stage-profit {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.kanban-stage-profit > span { min-width: 0; }
.kanban-stage-profit b { font-weight: 600; overflow-wrap: anywhere; }
.kanban-stage-profit .is-positive b { color: var(--green, #477900); }
.kanban-stage-profit .is-negative b { color: var(--red, #b64545); }

/* Edge hints follow the visible board bounds without intercepting cards or drops. */
.kanban-scroll-edge {
  --edge-tint: rgb(113 190 0 / 16%);
  position: fixed;
  z-index: 19;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: var(--green, #477900);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 1px 2px rgb(255 255 255 / 90%);
  user-select: none;
}

.kanban-scroll-edge[hidden] { display: none; }
.kanban-scroll-edge.is-left { background: linear-gradient(to right, var(--edge-tint), transparent); }
.kanban-scroll-edge.is-right { background: linear-gradient(to left, var(--edge-tint), transparent); }
.kanban-scroll-edge.is-active { --edge-tint: rgb(113 190 0 / 34%); color: #315400; }

@media (max-width: 600px) {
  .kanban.stage-board {
    --stage-column-width: min(250px, calc(100vw - 96px));
  }
  .kanban.stage-board > .kanban-column { min-height: 260px; }
}
