/* Your people and the schedule (team lane). Cell colours follow the status pills: text is always there too. */
.tag-row { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); margin-top: 2px; }
.chip-tag { background: var(--pill-warn-bg); color: var(--pill-warn-text); font-weight: var(--weight-semibold); max-width: 14rem; }
.person-pills { margin-top: var(--space-1); gap: var(--space-1); }
.people-table tr.is-inactive .strong-link, .sched tr.is-inactive .sched-name a { color: var(--color-text-muted); }
.rate-set { border: 0; padding: 0; margin: 0; }
.rate-set legend { font-size: var(--text-sm); font-weight: var(--weight-medium); margin-bottom: var(--space-1); padding: 0; }
.bullets { margin: var(--space-2) 0 0; padding-left: 1.25rem; }
.bullets li + li { margin-top: var(--space-1); }

.sched-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--card-gap); }
.sched-filter .field { min-width: 10rem; }
.sched-filter .field:first-child { flex: 1 1 18rem; }
.sched-form { margin-bottom: var(--card-gap); }
.sched-wrap { display: flex; flex-direction: column; }
.sched-scroll { max-height: calc(100vh - 12rem); min-height: 16rem; overflow: auto; background: var(--color-surface); }
.sched { border-collapse: separate; border-spacing: 0; font-size: var(--text-sm); min-width: 100%; }
.sched th, .sched td { border-bottom: 1px solid var(--color-line); border-right: 1px solid var(--color-line); padding: 0; background: var(--color-surface); }
.sched thead { position: sticky; top: 0; z-index: 3; }
.sched thead th { background: var(--color-surface-2); font-weight: var(--weight-semibold); text-align: center; padding: var(--space-1) var(--space-2); white-space: nowrap; }
.sched .sched-event { text-align: left; vertical-align: bottom; border-bottom: 1px solid var(--color-line-strong); white-space: normal; line-height: 1.3; padding-top: var(--space-2); }
.sched .sched-event a { color: var(--color-text); }
.sched .sched-event > * { position: sticky; left: calc(14rem + var(--space-2)); display: inline-block; max-width: 22rem; }
.sched .sched-corner { position: sticky; left: 0; z-index: 4; text-align: left; width: 14rem; min-width: 14rem; max-width: 14rem; }
.sched-name { position: sticky; left: 0; z-index: 1; text-align: left; font-weight: var(--weight-semibold); padding: var(--space-2) var(--space-3) !important; width: 14rem; min-width: 14rem; max-width: 14rem; white-space: normal; box-shadow: 1px 0 0 var(--color-line-strong); }
.sched-name a { color: var(--color-text); }
.sched-name .meta { font-weight: var(--weight-regular); font-size: var(--text-xs); }
.sched-daybtn { font: inherit; font-weight: var(--weight-semibold); background: none; border: 0; padding: var(--space-1); color: var(--color-text); cursor: pointer; border-radius: var(--radius-sm); white-space: nowrap; text-decoration: underline dotted; text-underline-offset: 3px; }
.sched-daybtn:hover { background: var(--color-surface); }
.sched td.cell { min-width: 6.25rem; }
.sched td.cell label { display: flex; align-items: center; gap: var(--space-2); min-height: 2.75rem; padding: 0 var(--space-2); cursor: pointer; font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.sched td.cell input { width: 1rem; height: 1rem; flex: none; }
.sched td.cell sup { font-size: 0.7em; }
.s-confirmed, .sched td.s-confirmed { background: var(--pill-good-bg); color: var(--pill-good-text); }
.s-available, .sched td.s-available { background: var(--pill-wait-bg); color: var(--pill-wait-text); }
.s-asked, .sched td.s-asked { background: var(--pill-warn-bg); color: var(--pill-warn-text); }
.s-unavailable, .sched td.s-unavailable { background: var(--pill-bad-bg); color: var(--pill-bad-text); }
.s-declined, .sched td.s-declined { background: var(--pill-quiet-bg); color: var(--pill-quiet-text); }
.sched td.cell:has(input:checked) { outline: 3px solid var(--color-text); outline-offset: -3px; }
.sched .sched-tot { padding: var(--space-2) var(--space-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sched tfoot th, .sched tfoot td { position: sticky; bottom: 0; background: var(--color-surface-2); padding: var(--space-2) var(--space-3); font-weight: var(--weight-semibold); z-index: 2; }
.sched tfoot th { left: 0; z-index: 3; text-align: left; }
.sched tfoot td:not(.sched-tot) { text-align: center; }
.sched tfoot td.is-short { color: var(--color-warning); }
.sched tfoot td.is-over { color: var(--color-danger); }
.sched tr.sched-sep th { position: sticky; left: 0; text-align: left; background: var(--color-surface-2); padding: var(--space-2) var(--space-3); font-weight: var(--weight-semibold); color: var(--color-text-muted); }
.sched-key { margin: var(--space-2) 0 0; }
/* desktop: the actions sit above the grid; phone: they follow the day list and stay in reach (sticky) */
.sched-bar { order: -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--color-surface); border: 1px solid var(--color-line-strong); border-radius: var(--radius-md); }
.cell-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: var(--space-3); margin: var(--space-3) 0; }
.cell-counts div { display: flex; flex-direction: column-reverse; gap: 2px; padding: var(--space-2) var(--space-3); background: var(--color-surface-2); border-radius: var(--radius-md); }
.cell-counts dt { font-size: var(--text-sm); color: var(--color-text-muted); }
.cell-counts dd { margin: 0; font-size: var(--text-xl); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.sched-count { font-weight: var(--weight-semibold); margin-right: auto; font-size: var(--text-sm); }
.sched-days-list { display: none; }
.add-days > summary { list-style: none; }
.add-days[open] > summary { margin-bottom: var(--space-4); }
.cal-buttons { margin-top: var(--space-3); }
.cal-buttons .btn .i { width: 18px; height: 18px; }
.cal-more { margin-top: var(--space-3); }
.cal-more summary { cursor: pointer; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.cal-more .copy { display: block; margin: var(--space-2) 0; overflow-wrap: anywhere; font-size: var(--text-xs); }
.cal-more form { margin-top: var(--space-2); }

.offers { border-left: 4px solid var(--color-accent); margin-bottom: var(--card-gap); }
.offer-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.offer-row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--color-line); }
.offer-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.5; }
.offer-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.shift-ics { font-size: var(--text-sm); font-weight: var(--weight-medium); align-self: flex-start; min-height: 32px; display: inline-flex; align-items: center; }
.shifts-page .list > .row-card { min-width: 0; }

@media (max-width: 760px) {
  .sched-scroll, .sched-key { display: none; }
  .sched-days-list { display: grid; gap: var(--space-3); }
  .pday { padding: 0; }
  .pday > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); cursor: pointer; list-style: none; min-height: 3.5rem; }
  .pday > summary::-webkit-details-marker { display: none; }
  .pday-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
  .pday-list { list-style: none; margin: 0; padding: 0 var(--space-4) var(--space-2); }
  .pday-row { display: flex; align-items: center; gap: var(--space-3); min-height: 3rem; padding: var(--space-2) 0; border-top: 1px solid var(--color-line); cursor: pointer; }
  .pday-row input { width: 1.25rem; height: 1.25rem; flex: none; }
  .pday-name { flex: 1; min-width: 0; font-weight: var(--weight-medium); }
  .pday-row:has(input:checked) { background: var(--color-surface-2); margin: 0 calc(-1 * var(--space-4)); padding-left: var(--space-4); padding-right: var(--space-4); }
  .pday-row.is-inactive .pday-name { color: var(--color-text-muted); }
  .sched-bar { order: 0; position: sticky; z-index: 5; margin: var(--space-3) 0 0; box-shadow: var(--shadow-sticky); bottom: calc(60px + env(safe-area-inset-bottom)); border-radius: var(--radius-md) var(--radius-md) 0 0; margin-left: calc(-1 * var(--space-2)); margin-right: calc(-1 * var(--space-2)); padding: var(--space-2) var(--space-3); }
  .sched-bar .btn { flex: 1 1 auto; min-height: 44px; padding: 0 var(--space-3); }
  .sched-count { flex-basis: 100%; }
  .sched-filter .field { min-width: 0; flex: 1 1 100%; }
  .offer-row { flex-wrap: wrap; }
  .offer-actions { flex-basis: 100%; }
  .offer-actions .btn { flex: 1; }
}
