.grid-scroll {
  flex: 1 1 auto; min-height: 0;
  overflow: auto;
  position: relative;
  padding: 0 16px 24px;
}

.grid {
  display: grid;
  position: relative;
  width: max-content;
  min-width: 100%;
  grid-auto-rows: minmax(var(--row-min-height), auto);
}

/* ---------------------------------------------------------------- шапка */
.grid-corner,
.col-head {
  position: sticky; top: 0; z-index: 6;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  display: flex; flex-direction: column; justify-content: center;
  padding: 4px 10px; overflow: hidden;
}
.grid-corner .title, .grid-corner .sub,
.col-head .title, .col-head .sub {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.grid-corner { left: 0; z-index: 8; border-right: 1px solid var(--border-primary); }
.col-head { border-right: 1px solid var(--border-primary); }
.col-head .title { font-size: 12px; font-weight: 600; white-space: nowrap; }
.col-head .sub { font-size: 11px; color: var(--text-muted); }
.col-head.non-working { background: repeating-linear-gradient(
    45deg, var(--bg-secondary), var(--bg-secondary) 6px, var(--bg-tertiary) 6px, var(--bg-tertiary) 12px); }
.col-head.later { color: var(--accent-purple); }
.col-head.current { box-shadow: inset 0 -2px 0 var(--accent-blue); }

/* --------------------------------------------------------------- строки */
.row-head {
  position: sticky; left: 0; z-index: 5;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
  padding: 10px; display: flex; flex-direction: column; gap: 4px;
}
.row-head .title { font-weight: 600; }
.row-head .meta { font-size: 11px; color: var(--text-muted); }
.row-head .row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.row-head:hover .row-actions { opacity: 1; }

/* ----------------------------------------------------- ячейки как участки доски */
.cell {
  position: relative;
  background: transparent;
  /* Клетки не рисуем: доска — это поверхность, читаются стикеры.
     Остаются едва заметные направляющие. */
  border-right: 1px dashed rgba(255, 255, 255, .045);
  border-bottom: 1px dashed rgba(255, 255, 255, .045);
  padding: 8px 7px;
  overflow: visible;
  min-height: var(--row-min-height);
}
.cell:hover { background: rgba(255, 255, 255, .028); }
.cell.non-working { background: rgba(0, 0, 0, .22); }
.cell.later { background: rgba(188, 140, 255, .06); }
.cell.drop-target { background: rgba(88, 166, 255, .16); box-shadow: inset 0 0 0 2px var(--accent-blue); }
.cell.meeting-current { box-shadow: inset 0 0 0 2px var(--accent-orange); background: rgba(210, 153, 34, .1); }

.cell .cell-add {
  position: absolute; right: 4px; top: 4px; z-index: 8; width: 20px; height: 20px;
  border-radius: 5px; border: 1px solid var(--border-primary); background: var(--bg-tertiary);
  color: var(--text-secondary); cursor: pointer; display: none;
  align-items: center; justify-content: center; line-height: 1; padding: 0; font-size: 14px;
}
.cell:hover .cell-add { display: flex; }
.cell .cell-add:hover { color: var(--accent-blue); border-color: var(--accent-blue); }

/* Зоны квартального планирования */
.cell.zone-light { background-color: var(--zone-light); }
.cell.zone-gray { background-color: var(--zone-gray); }
.cell.zone-dark { background-color: var(--zone-dark); }

/* ------------------------------------------------------------- поплавки */
.markers-lane {
  position: sticky; top: var(--header-height); z-index: 6;
  height: 30px; background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  display: flex; align-items: center; justify-content: center;
}
.markers-lane.corner { left: 0; z-index: 8; border-right: 1px solid var(--border-primary);
  font-size: 11px; color: var(--text-muted); justify-content: flex-start; padding-left: 10px; }

.float-marker {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--bg-tertiary); border: 1px solid currentColor; cursor: grab;
  user-select: none; white-space: nowrap;
}
.float-marker:active { cursor: grabbing; }
.float-marker::before { content: "◆"; font-size: 9px; }
.float-marker.today { color: var(--marker-today); }
.float-marker.launch { color: var(--marker-launch); }
.float-marker.test_launch { color: var(--accent-purple); }
.float-marker.custom { color: var(--accent-blue); }
.markers-lane.drop-target { background: rgba(88, 166, 255, .16); }
