/* STRIDE Scout scheduling cards (.sched-*). Load after stride-brain.css; the
   --bp-* tokens, .bp-btn and .bp-face come from it. One T0 card on the
   surface, radius 16, shadow 1, like the "Scout noticed" alert. Neutral paint
   everywhere: no ember, no accent bars, no coloured status. Dark Graphite is
   the default; Daybreak mirrors it through the same tokens. */

.sched-card { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 440px; padding: 16px; border-radius: 16px; background: var(--bp-surface); box-shadow: var(--bp-shadow-1); color: var(--bp-text); font-family: var(--bp-sans); box-sizing: border-box; transition: opacity 160ms var(--bp-ease); animation: sched-enter 220ms var(--bp-ease) both; }
.sched-card * { box-sizing: border-box; }
.sched-card.is-busy { opacity: 0.72; }
.sched-card.is-quiet { opacity: 0.62; box-shadow: none; background: var(--bp-inset); }
.sched-card.is-quiet .sched-title { text-decoration: none; }
.sched-card[data-state="cancelled"] .sched-title { text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: var(--bp-text3); }

.sched-i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sched-i--sm { width: 12px; height: 12px; stroke-width: 2.2; }

.sched-kicker { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sched-kicker__mark { width: 24px; height: 24px; border-radius: 50%; background: var(--bp-inset); color: var(--bp-text2); display: grid; place-items: center; flex: none; }
.sched-kicker__mark .sched-i { width: 13px; height: 13px; }
.sched-kicker__label { font: 500 12px/1.4 var(--bp-sans); letter-spacing: 0.02em; color: var(--bp-text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-cal { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; font-size: 13px; border-radius: 999px; background: var(--bp-inset); color: var(--bp-text2); font: 500 11px/1 var(--bp-sans); white-space: nowrap; flex: none; }
.sched-cal.is-written { color: var(--bp-text); }
.sched-cal .sched-i { width: 13px; height: 13px; stroke-width: 1.9; }

.sched-title { margin: 2px 0 0; font: 600 17px/1.3 var(--bp-sans); letter-spacing: -0.005em; color: var(--bp-text); text-wrap: balance; overflow-wrap: anywhere; }
.sched-when { margin: 0; font: 500 15px/1.4 var(--bp-sans); color: var(--bp-text); font-variant-numeric: tabular-nums; }
.sched-source { margin: 0; font: 500 12px/1.4 var(--bp-sans); color: var(--bp-text3); }

.sched-people { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sched-faces { display: inline-flex; flex: none; }
.sched-faces .bp-face { box-shadow: 0 0 0 2px var(--bp-surface); font-size: 10px; color: #fff; }
.sched-faces .bp-face + .bp-face { margin-left: -5px; }
.sched-people__names { font: 400 14px/1.4 var(--bp-sans); color: var(--bp-text2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-room { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; row-gap: 8px; color: var(--bp-text3); font: 400 14px/1.4 var(--bp-sans); }
.sched-room .sched-i { width: 14px; height: 14px; }
.sched-room__chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; box-sizing: border-box; max-width: 100%; padding: 0 12px; border: 0; border-radius: 999px; background: var(--bp-inset); color: var(--bp-text); font: 500 14px/1 var(--bp-sans); cursor: pointer; transition: background-color 120ms var(--bp-ease), transform 120ms var(--bp-ease); }
span.sched-room__chip { cursor: default; }
button.sched-room__chip:hover { background: var(--bp-selected); }
button.sched-room__chip:active { transform: scale(0.98); }
.sched-room__chip .sched-i { color: var(--bp-text2); }
.sched-room__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-room__new { color: var(--bp-text3); font: 500 12px/1 var(--bp-sans); }

.sched-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.sched-undo { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px 0 12px; border: 0; border-radius: 999px; background: var(--bp-text); color: var(--bp-canvas); font: 600 14px/1 var(--bp-sans); cursor: pointer; transition: transform 120ms var(--bp-ease); }
.sched-undo:active { transform: scale(0.98); }
.sched-undo__count { min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; background: color-mix(in srgb, var(--bp-canvas) 16%, transparent); font: 600 11px/1 var(--bp-mono); font-variant-numeric: tabular-nums; }

.sched-question { margin: 0; font: 400 16px/1.45 var(--bp-sans); color: var(--bp-text); }
.sched-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sched-groups { display: flex; flex-direction: column; gap: 12px; }
.sched-group { display: flex; flex-direction: column; gap: 8px; }
.sched-group__day { margin: 0; font: 500 13px/1.4 var(--bp-sans); color: var(--bp-text2); }
.sched-chip { height: 32px; padding: 0 14px; border: 1px solid var(--bp-hair); border-radius: 999px; background: var(--bp-inset); color: var(--bp-text); font: 500 14px/1 var(--bp-sans); cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; transition: background-color 120ms var(--bp-ease), transform 120ms var(--bp-ease); }
.sched-chip:hover:not(:disabled) { background: var(--bp-selected); }
.sched-chip:active:not(:disabled) { transform: scale(0.98); }
.sched-chip:disabled { cursor: default; opacity: 0.6; }

.sched-tray { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; border-top: 1px solid var(--bp-hair); }

.sched-why { align-self: flex-start; display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--bp-inset); color: var(--bp-text2); font: 600 12px/1 var(--bp-sans); }
.sched-note { margin: 0; font: 400 14px/1.45 var(--bp-sans); color: var(--bp-text3); }
.sched-error { margin: 0; font: 500 13px/1.4 var(--bp-sans); color: var(--bp-text2); }

:is(.sched-chip, .sched-undo, .sched-room__chip, .sched-day, .sched-icon, .sched-menu__item):focus-visible { outline: 2px solid var(--stride-color-focus, #FF7A40); outline-offset: 2px; }
@media (pointer: coarse) { .sched-chip { height: 40px; } .sched-undo { height: 36px; } }
@media (max-width: 480px) { .sched-card { max-width: none; } }

/* ⋯ menu (Change time, Cancel) */
.sched-head { display: flex; align-items: flex-start; gap: 8px; }
.sched-head .sched-title { flex: 1 1 auto; min-width: 0; margin-top: 4px; }
.sched-head .sched-more { margin: -2px -6px 0 0; }
.sched-status { margin: -4px 0 0; font: 500 12px/1.4 var(--bp-sans); letter-spacing: 0.02em; color: var(--bp-text3); }
.sched-more { position: relative; flex: none; }
.sched-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 999px; background: none; color: var(--bp-text2); cursor: pointer; transition: background-color 120ms var(--bp-ease); }
.sched-icon:hover, .sched-icon[aria-expanded="true"] { background: var(--bp-inset); color: var(--bp-text); }
.sched-icon .sched-i { width: 18px; height: 18px; }
.sched-icon circle { fill: currentColor; stroke: none; }
.sched-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 184px; padding: 6px; border-radius: 12px; background: var(--bp-pop); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); box-shadow: var(--bp-shadow-float); display: flex; flex-direction: column; animation: sched-pop 160ms var(--bp-ease) both; transform-origin: top right; }
.sched-menu__item { height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--bp-text); font: 500 15px/1 var(--bp-sans); text-align: left; cursor: pointer; }
.sched-menu__item:hover, .sched-menu__item:focus-visible { background: var(--bp-inset); }
.sched-menu__item.is-danger { color: var(--bp-danger); }
.sched-actions:has(.sched-undo:only-child) { justify-content: flex-start; }
.sched-actions .sched-undo:only-child { margin-left: 0; }

/* the quote and the reply are Moment rows, not a boxed panel */
.sched-moment + .sched-moment { margin-top: 2px; }

/* Change time: suggestions, then day chips and time chips */
.sched-picker { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sched-picker__label { margin: 4px 0 0; font: 500 12px/1.4 var(--bp-sans); letter-spacing: 0.02em; color: var(--bp-text3); }
.sched-days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; scroll-snap-type: x proximity; }
.sched-days::-webkit-scrollbar { display: none; }
.sched-day { flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--bp-inset); color: var(--bp-text2); font: 500 14px/1 var(--bp-sans); white-space: nowrap; cursor: pointer; scroll-snap-align: start; transition: background-color 120ms var(--bp-ease), color 120ms var(--bp-ease); }
.sched-day:hover { color: var(--bp-text); }
.sched-day[aria-checked="true"] { background: var(--bp-text); color: var(--bp-canvas); }
.sched-chip.is-current, .sched-chip.is-current:disabled { opacity: 1; background: var(--bp-text); border-color: var(--bp-text); color: var(--bp-canvas); }
/* fixed, equal-width time columns: 6 wide, 3 in the phone sheet */
.sched-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sched-grid .sched-chip { padding: 0 4px; min-width: 0; }
.sched-sheet .sched-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* wide: the day row wraps; phone sheet: it bleeds to the sheet edge with a trailing fade */
.sched-tray .sched-days { flex-wrap: wrap; overflow: visible; }
.sched-sheet .sched-days { margin: 0 -16px; padding: 2px 16px; scroll-padding: 0 16px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }

/* phone: the picker is a bottom sheet */
.sched-sheet { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; justify-content: flex-end; font-family: var(--bp-sans); }
.sched-sheet__scrim { position: absolute; inset: 0; background: var(--bp-scrim); animation: sched-fade 180ms var(--bp-ease) both; }
.sched-sheet__panel { position: relative; max-height: 82vh; overflow-y: auto; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: var(--bp-surface); color: var(--bp-text); box-shadow: var(--bp-shadow-float); animation: sched-rise 240ms var(--bp-ease) both; }
.sched-sheet__grabber { display: block; width: 36px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: color-mix(in srgb, var(--bp-text) 18%, transparent); }
.sched-sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sched-sheet__title { margin: 0; font: 600 17px/1.3 var(--bp-sans); }
.sched-sheet .sched-chip, .sched-sheet .sched-day { height: 40px; }

@keyframes sched-pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes sched-rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sched-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes sched-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .sched-card, .sched-sheet__panel, .sched-menu { animation-name: sched-fade; }
  .sched-chip, .sched-undo, .sched-card { transition: opacity 120ms linear; }
}
