/* Proof 1, the schedule: a window with next week's grid, the team above it, the Fill button under it. */
.sch { display: grid; gap: 24px; min-width: 0; max-width: 940px; margin-inline: auto; }
.sch-window { min-width: 0; }

/* The team: one line of chips; after a fill each carries its number of shifts. */
.sch-tray { display: flex; gap: 6px; padding: 10px 12px 4px; overflow-x: auto; scrollbar-width: none; }
.sch-tray::-webkit-scrollbar { display: none; }
.sch-tray .chip { flex: none; height: 30px; padding-inline: 3px 10px; font-size: 13px; }
.sch-tray .chip b { margin-inline-start: 1px; font: 500 12px/1 var(--mono); color: var(--accent-text); animation: sch-count 420ms var(--ease-spring) both; }
@keyframes sch-count { from { opacity: 0; transform: scale(0.3); } }

/* The grid scrolls sideways inside the window; the row titles stay at the start. */
.sch-scroll { overflow-x: auto; container-type: inline-size; overscroll-behavior-x: contain; }
.sch-scroll:focus-visible { outline-offset: -3px; }
.sch-grid { --rh: 108px; --cw: 58px; --gap: 4px; width: max-content; min-width: 100%; padding: 6px 12px 12px; }
@supports (width: 1cqw) { .sch-grid { --cw: clamp(58px, calc((100cqw - 160px) / 7), 110px); } }
.sch-grid .g-rowhead { position: sticky; inset-inline-start: 0; z-index: 2; width: var(--rh); padding-inline: 2px 8px; background: var(--surface); }
.sch-grid .g-rowhead b { font-size: 12px; line-height: 15px; }
.sch-grid .g-rowhead span { font-size: 10px; line-height: 13px; letter-spacing: -0.02em; white-space: normal; }
.sch-grid .sch-corner { height: 46px; }
.sch-grid .g-colhead { height: 46px; padding: 0 7px; border-radius: 10px; }
.sch-grid .g-colhead b { font-size: 20px; line-height: 22px; }
.sch-grid .g-colhead span { font-size: 11px; line-height: 14px; }
.sch-grid .g-sec { height: 24px; font-size: 12px; line-height: 16px; }
.sch-grid .g-sec span { position: sticky; inset-inline-start: 14px; }
.sch-grid .g-cell { height: auto; min-height: calc(var(--n, 1) * 16px + 14px); padding: 6px 7px; border-radius: 10px; font: 500 12px/16px var(--sans); justify-content: center; }
.sch-nm { display: block; overflow: hidden; text-overflow: ellipsis; }
.sch-op { color: var(--open-text); font-weight: 400; }
.sch-shut { background: var(--sunken); border-color: transparent; }
.sch-shut .sch-op { font-size: 11px; }

/* A name lands; a cell a wish changed lights up for a moment. */
.sch-land { animation: sch-land 440ms var(--ease-spring) both; }
@keyframes sch-land { from { opacity: 0; transform: translateY(-14px) scale(0.6); } }
.sch-flash { animation: sch-flash 1500ms var(--ease-out); }
@keyframes sch-flash { 0%, 45% { background: var(--accent-tint); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); } }

.sch-tool { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 8px 12px 10px; }
.sch-answers { font: 400 13px/18px var(--sans); color: var(--text-2); }
.sch-act { display: inline-flex; align-items: center; gap: 14px; margin-inline-start: auto; }
.sch-fill { height: 52px; padding-inline: 26px; border-radius: 15px; font-size: 17px; }
.sch-wait { animation: sch-wait 1.5s var(--ease-in-out) infinite; }
@keyframes sch-wait { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--ink) 50%, transparent); } 55% { box-shadow: 0 0 0 12px color-mix(in oklab, var(--ink) 0%, transparent); } }

/* The proof itself: how many shifts, how fast. */
.sch-result { flex: 1 1 14em; font: 500 14px/1.7 var(--mono); color: var(--text); text-wrap: pretty; animation: sch-in 420ms var(--ease-out) both; }
.sch-result b { font-weight: 500; padding: 2px 7px 3px; border-radius: 8px; background: var(--accent-tint); color: var(--accent-text); white-space: nowrap; }

/* "Now tell it what you want": what an admin would say, as chips. */
.sch-wishes { display: grid; gap: 12px; justify-items: start; animation: sch-in 520ms var(--ease-out) both; }
@keyframes sch-in { from { opacity: 0; transform: translateY(14px); } }
.sch-label { font: 500 12px/16px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mark); }
.sch-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sch-wish { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 8px 16px 8px 11px; border-radius: 21px; background: var(--surface); color: var(--fg); font: 600 15px/1.25 var(--sans); text-align: start; box-shadow: 0 8px 18px -12px color-mix(in oklab, var(--navy) 55%, transparent); transition: transform 180ms var(--ease-spring), background 160ms linear, color 160ms linear; }
.sch-wish:hover { transform: translateY(-2px) rotate(-0.6deg); }
.sch-wish:active { transform: scale(0.97); }
.sch-wish i { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-control); display: grid; place-items: center; }
.sch-wish.on { background: var(--navy); color: var(--on-navy); }
.sch-wish.on i { background: var(--cyan); border-color: var(--cyan); }
.sch-wish.on i::after { content: ''; width: 9px; height: 5px; border: solid var(--on-cyan); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.sch-line { min-height: 50px; max-width: 32em; font: 600 clamp(16px, 1.3vw, 19px)/1.4 var(--sans); color: var(--fg); text-wrap: pretty; }
.sch-reset { font-size: 14px; color: var(--fg-2); }

@media (max-width: 520px) {
  .sch-act { width: 100%; justify-content: space-between; }
  .sch-fill { flex: 1; }
}

/* Spanish: "Sin cubrir" is wider than a phone's column, so there it takes two lines, and so does a long line title
   ("Recepción de mercancía"); the window's title is set a size smaller on a phone, so "Borrador" still shows at its end. */
:lang(es) .sch-grid .sch-op { white-space: normal; }
:lang(es) .sch-grid .g-rowhead b { white-space: normal; }
@media (max-width: 520px) { :lang(es) .sch-window .window-bar span { font-size: 11px; } }

/* With the whole width the week is drawn larger. */
@media (min-width: 1040px) { .sch-grid { --cw: 98px; --rh: 136px; --gap: 6px; padding: 10px 20px 22px; } .sch-grid .g-cell { font-size: 13px; line-height: 18px; min-height: calc(var(--n, 1) * 18px + 18px); padding: 8px 10px; } }
