/* Schedule (js/schedule.js): Google Calendar's layout in the app's Apple look.
 * Colours: --c1..--c6 in the skin (three offices, time off, office events, Google).
 * Text on a colour uses --cd, the colour darkened to pass AA (4.5:1) on both its pale
 * background and white (#51). Type: 1rem for what people read, 0.875rem at the smallest (#52).
 * No hex colours, no px. */

.c1 { --cc: var(--c1); --cb: var(--c1-bg); } .c2 { --cc: var(--c2); --cb: var(--c2-bg); } .c3 { --cc: var(--c3); --cb: var(--c3-bg); }
.c4 { --cc: var(--c4); --cb: var(--c4-bg); } .c5 { --cc: var(--c5); --cb: var(--c5-bg); } .c6 { --cc: var(--c6); --cb: var(--c6-bg); }
.ch { --cc: var(--ink-2); --cb: var(--fill); }
.c1, .c2, .c3, .c4, .c5, .c6, .ch { --cd: color-mix(in srgb, var(--cc) 75%, black); }

/* full height uses dvh (the screen that's really visible), with vh for older browsers */
.shell-main.is-cal { padding: 0; max-width: none; height: 100vh; height: 100dvh; grid-template-columns: minmax(0, 1fr); }
/* on the shell's rail and phone layouts the calendar still runs edge to edge; the shell's bottom padding (tab bar, home bar) stays */
.shell[data-layout] .shell-main.is-cal { padding-top: 0; padding-left: 0; padding-right: 0; }
.cal { display: grid; grid-template-columns: 17.5rem minmax(0, 1fr); height: 100vh; height: 100dvh; }
.cal .fine, .cal-simple .fine, .cal-pop-host .fine, .sc-form .fine { font-size: max(var(--fs-fine), 0.875rem); }
.cal-pop-host .tag, .cal-simple .tag { font-size: 0.875rem; }

/* ---------- side: create, mini month, requests, my calendars ---------- */
.cal-side { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4) var(--space-3) var(--space-4) var(--space-4); overflow-y: auto; }
.cal-create { display: inline-flex; align-items: center; gap: 0.75rem; align-self: flex-start; min-height: 3.5rem; padding: 0 1.5rem 0 1rem; border: 0; border-radius: 1rem; background: var(--surface); color: var(--ink); font-weight: 500; font-size: 1rem; box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.12), 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08); }
.cal-create:hover { box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.16), 0 0.5rem 1rem rgba(0, 0, 0, 0.1); }
.cal-create svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: var(--forest); stroke-width: 2.4; stroke-linecap: round; }
.cal-h { font-size: 1rem; font-weight: 600; color: var(--ink); margin: 0 0 var(--space-2); display: flex; align-items: center; gap: var(--space-2); }
.mm-head { display: flex; justify-content: space-between; align-items: center; padding: 0 0.25rem var(--space-1); font-size: 1rem; font-weight: 500; }
.mm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.0625rem; text-align: center; }
.mm-dow { font-size: 0.875rem; color: var(--ink-3); padding: 0.25rem 0; }
.mm-d { position: relative; aspect-ratio: 1; border: 0; border-radius: 50%; background: none; font-size: 0.875rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.mm-d:hover { background: var(--fill); }
.mm-d.out { color: var(--ink-3); }
.mm-d.sel { background: var(--mint); color: var(--forest-text); border-radius: 0; }
.mm-d.today { background: var(--forest); color: var(--on-primary); border-radius: 50%; }
.mm-d.dot::after { content: ""; position: absolute; left: 50%; bottom: 0.125rem; width: 0.1875rem; height: 0.1875rem; margin-left: -0.09375rem; border-radius: 50%; background: currentColor; opacity: 0.5; }
.cal-arrow { width: 2.25rem; height: 2.25rem; border: 0; border-radius: 50%; background: none; color: var(--ink-2); font-size: 1.5rem; line-height: 1; }
.cal-arrow.sm { width: 1.75rem; height: 1.75rem; font-size: 1.125rem; }
.cal-arrow:hover { background: var(--fill); }
.cal-check { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.3125rem 0.25rem; border-radius: var(--radius-sm); cursor: pointer; font-size: 1rem; }
.cal-check:hover { background: var(--fill-2); }
.cal-check > span { display: grid; }
.cal-check input { appearance: none; -webkit-appearance: none; flex: none; width: 1.125rem; height: 1.125rem; margin: 0.1875rem 0 0; border-radius: 0.25rem; border: 0.125rem solid var(--cc); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.cal-check input:checked { background: var(--cc); }
.cal-check input:checked::after { content: ""; width: 0.375rem; height: 0.625rem; margin-top: -0.125rem; border: solid var(--on-primary); border-width: 0 0.125rem 0.125rem 0; transform: rotate(45deg); }
.cal-reqs { display: grid; gap: var(--space-2); }
.cal .nav-badge { font-size: 0.875rem; }
.cal-req { display: grid; gap: 0.375rem; padding: var(--space-3); border-radius: var(--radius-md); background: var(--warn-bg); font-size: 1rem; }
.cal-req .fine { color: var(--ink-2); }
/* #48: what the approver should know */
.req-ctx { display: grid; gap: 0.25rem; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; line-height: 1.4; color: var(--ink-2); }
.req-ctx li { position: relative; padding-left: 1rem; }
.req-ctx li::before { content: ""; position: absolute; left: 0.125rem; top: 0.5em; width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: var(--ink-3); }
.req-ctx li.hot { color: var(--ink); font-weight: 600; }
.req-ctx li.hot::before { background: var(--bad); }
.req-ctx li.ok::before { background: var(--ok); }

/* ---------- main: toolbar and body ---------- */
.cal-main { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border-radius: var(--radius-xl) 0 0 0; box-shadow: var(--card-shadow); margin-top: var(--space-2); }
.cal-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); box-shadow: inset 0 calc(-1 * var(--border-w)) 0 var(--line); }
.cal-nav { display: inline-flex; }
.cal-title { flex: 1; font-size: 1.375rem; font-weight: 400; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 0 var(--space-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bar-create { display: none; }
.cal-bar-create svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
/* phone and tablet pieces, hidden on wide screens: Requests in the toolbar, the Agenda tab, the dim behind a sheet */
.cal-req-btn, .cal-views .v-agenda, .v-phone, .cal-scrim { display: none; }
.cal-req-btn.has { background: var(--warn-bg); border-color: transparent; color: var(--ink); }
.cal-wk { display: none; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.cal-wk input { width: 1rem; height: 1rem; accent-color: var(--forest); }
.cal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

/* event chips */
.chip-ev { display: block; width: 100%; min-width: 0; padding: 0.0625rem 0.5rem; margin: 0 0 0.125rem; border: 0; border-radius: 0.3125rem; background: var(--cd); color: var(--on-primary); font-size: 0.875rem; font-weight: 500; line-height: 1.4; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-ev:hover { filter: brightness(0.92); }
.chip-ev.sum { background: var(--cb); color: var(--cd); font-weight: 600; }
.chip-ev.timed { background: transparent; color: var(--ink); font-weight: 400; display: flex; align-items: center; gap: 0.375rem; }
.chip-ev.timed:hover { background: var(--fill); filter: none; }
.chip-ev.timed .dot { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--cc); }
.chip-ev.timed .t { color: var(--ink-3); }
.chip-ev.asked { background: repeating-linear-gradient(135deg, var(--cb) 0 0.375rem, var(--surface) 0.375rem 0.75rem); color: var(--cd); box-shadow: inset 0 0 0 0.0625rem var(--cc); }
/* holidays: a quiet grey band, dashed when the office decides (Civic Holiday) */
.chip-hol { display: block; min-width: 0; padding: 0.0625rem 0.5rem; margin: 0 0 0.125rem; border-radius: 0.3125rem; background: var(--fill); color: var(--ink); font-size: 0.875rem; font-weight: 600; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-hol.soft { background: none; box-shadow: inset 0 0 0 0.0625rem var(--line-strong); font-weight: 500; color: var(--ink-2); }
/* office names: full when there's room, Riv / Ouel / SW when the column is narrow (#51) */
.mv-cell { container: cell / inline-size; }
.tv-allday { container: band / inline-size; }
.sh { display: none; }
@container cell (max-width: 9.5rem) { .sum .lg { display: none; } .sum .sh { display: inline; } }
@container cell (max-width: 7.5rem) { .lg { display: none; } .sh { display: inline; } }
@container band (max-width: 7rem) { .lg { display: none; } .sh { display: inline; } }

/* ---------- month ---------- */
.mv-head { display: grid; grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr)); text-align: center; font-size: 0.875rem; font-weight: 500; color: var(--ink-3); padding-top: var(--space-2); }
.mv-grid { flex: 1; display: grid; grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr)); grid-auto-rows: minmax(7rem, 1fr); }
.mv-cell { min-width: 0; padding: 0.25rem 0.375rem 0.375rem; border-right: var(--border-w) solid var(--line); border-bottom: var(--border-w) solid var(--line); overflow: hidden; cursor: pointer; }
.mv-cell:hover { background: var(--fill-2); }
.mv-grid[style*="--cols:7"] .mv-cell:nth-child(7n), .mv-grid[style*="--cols:5"] .mv-cell:nth-child(5n) { border-right: 0; }
.mv-num { display: block; margin: 0 auto 0.25rem; min-width: 2rem; height: 2rem; padding: 0 0.375rem; border: 0; border-radius: var(--radius-pill); background: none; font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.mv-num:hover { background: var(--fill); }
.mv-cell.out .mv-num { color: var(--ink-3); }
.mv-cell.today .mv-num { background: var(--forest); color: var(--on-primary); }
.mv-more { border: 0; background: none; padding: 0.125rem 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--ink-2); border-radius: 0.3125rem; }
.mv-more:hover { background: var(--fill); }

/* ---------- week and day ---------- */
.tv-head, .tv-band, .tv-grid { display: grid; grid-template-columns: 4.5rem repeat(var(--n), minmax(0, 1fr)); }
.tv-gutter { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 0.25rem; font-size: 0.875rem; }
.tv-day { display: grid; justify-items: center; gap: 0.125rem; padding: var(--space-2) 0 var(--space-1); border: 0; background: none; color: var(--ink-2); }
.tv-day .dow { font-size: 0.875rem; font-weight: 500; }
.tv-day .num { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; font-size: 1.5rem; font-weight: 400; color: var(--ink); }
.tv-day:hover .num { background: var(--fill); }
.tv-day.today { color: var(--forest-text); }
.tv-day.today .num { background: var(--forest); color: var(--on-primary); }
.tv-band { box-shadow: inset 0 calc(-1 * var(--border-w)) 0 var(--line); }
.tv-allday { min-width: 0; min-height: 1.75rem; padding: 0.125rem 0.25rem 0.25rem; border-left: var(--border-w) solid var(--line); cursor: pointer; }
.who { display: grid; gap: 0.125rem; margin-bottom: 0.25rem; padding: 0.25rem 0.375rem; border-radius: 0.3125rem; background: var(--cb); border-left: 0.1875rem solid var(--cc); }
.who-o { font-size: 0.875rem; font-weight: 700; color: var(--cd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-p { display: flex; flex-wrap: wrap; gap: 0.125rem 0.375rem; }
.who-n { border: 0; background: none; padding: 0; font-size: 0.875rem; color: var(--ink); }
.who-n:hover { text-decoration: underline; }
.cal-scroll { flex: 1; overflow-y: auto; position: relative; min-height: 0; }
.tv-hours { display: grid; grid-auto-rows: 3rem; }
.tv-hour { position: relative; font-size: 0.875rem; color: var(--ink-3); text-align: right; padding-right: 0.5rem; transform: translateY(-0.5625rem); }
.tv-col { position: relative; border-left: var(--border-w) solid var(--line); background-image: linear-gradient(var(--line) var(--border-w), transparent var(--border-w)); background-size: 100% 3rem; min-height: calc(3rem * 12); cursor: default; }
.tv-ev { position: absolute; z-index: 1; display: grid; align-content: start; gap: 0; padding: 0.1875rem 0.375rem; border: 0; border-radius: 0.375rem; background: var(--cd); color: var(--on-primary); text-align: left; font-size: 0.875rem; line-height: 1.3; overflow: hidden; box-shadow: 0 0 0 0.0625rem var(--surface); }
.tv-ev .t { font-size: 0.875rem; }
.tv-ev:hover { filter: brightness(0.92); z-index: 2; }
.tv-now { position: absolute; z-index: 3; left: -0.375rem; right: 0; height: 0.125rem; background: var(--now); pointer-events: none; }
.tv-now::before { content: ""; position: absolute; left: 0; top: -0.3125rem; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--now); }

/* the day view puts who's where beside the hours */
.cal-body:has(.day-panel) { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; grid-template-rows: auto auto minmax(0, 1fr); }
.cal-body:has(.day-panel) > :not(.day-panel) { grid-column: 1; }
.day-panel { grid-column: 2; grid-row: 1 / -1; margin: var(--space-3); padding: var(--space-4); display: grid; gap: var(--space-3); align-content: start; overflow-y: auto; box-shadow: none; background: var(--fill-2); }
.dp-office { display: grid; gap: 0.125rem; }
.dp-o { display: flex; align-items: center; gap: var(--space-2); font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.dp-hol { margin: 0; display: flex; align-items: center; gap: var(--space-2); }
.dp-hol .chip-hol { display: inline-block; margin: 0; }
.sw { display: inline-block; flex: none; width: 0.75rem; height: 0.75rem; border-radius: 0.1875rem; background: var(--cc); }
.dp-p { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); padding: 0.25rem 0.375rem; border: 0; border-radius: var(--radius-sm); background: none; text-align: left; font-size: 1rem; color: var(--ink); }
.dp-p.ev { grid-template-columns: minmax(0, 1fr) auto; }
.dp-p:hover { background: var(--fill); }
.dp-p .avatar-sm { width: 1.75rem; height: 1.75rem; font-size: 0.75rem; }

/* ---------- the event card and the day's pop-up ---------- */
.ev-card { position: fixed; z-index: 30; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 28rem; max-width: calc(100vw - var(--space-6)); max-height: calc(100vh - var(--space-6)); max-height: calc(100dvh - var(--space-6)); overflow-y: auto; padding: var(--space-3) var(--space-5) var(--space-5); display: grid; gap: var(--space-3); box-shadow: var(--sheet-shadow); font-size: 1rem; }
.ev-tools { display: flex; justify-content: flex-end; gap: 0.25rem; margin-right: calc(-1 * var(--space-3)); }
.ev-tools .x { font-size: 1rem; }
.ev-row { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.ev-row .sw { width: 0.875rem; height: 0.875rem; margin-top: 0.375rem; border-radius: 0.25rem; }
.ev-row .h3 { font-size: 1.375rem; font-weight: 400; }
.ev-note { white-space: pre-wrap; }
.day-card { gap: var(--space-3); }
.day-card > .ev-tools { margin-bottom: calc(-1 * var(--space-4)); }
.day-card > .h3 { font-size: 1.375rem; font-weight: 400; margin: 0; }

/* editor */
.toggle-row.inline { padding: var(--space-2) 0; box-shadow: none; }
.toggle-row.inline > span { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.input.ev-title { font-size: 1.375rem; border-width: 0 0 0.125rem; border-radius: 0; padding-left: 0; }
.input.ev-title:focus { box-shadow: none; border-color: var(--forest); }
.sc-form > .k-shift:not([hidden]), .sc-form > .k-event:not([hidden]), .sc-form > .k-timeoff:not([hidden]), .sc-form .k-repeat:not([hidden]) { display: grid; gap: var(--space-4); }
.sc-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.sc-form legend { padding: 0; margin-bottom: var(--space-2); font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.sc-dows { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: var(--space-2); }
.dow-pick { position: relative; cursor: pointer; }
.dow-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dow-pick span { display: grid; place-items: center; min-width: 3rem; height: 2.5rem; padding: 0 0.5rem; border-radius: var(--radius-pill); background: var(--fill); color: var(--ink); font-size: 0.9375rem; font-weight: 500; }
.dow-pick input:checked + span { background: var(--forest); color: var(--on-primary); }
.dow-pick input:focus-visible + span { outline: 0.1875rem solid var(--focus); outline-offset: 0.125rem; }
.sc-scope { display: grid; gap: 0.375rem; margin-top: var(--space-2) !important; padding: var(--space-3) !important; border-radius: var(--radius-md) !important; background: var(--fill-2); }
.sc-scope label { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; cursor: pointer; }
.sc-sum:empty { display: none; }
.sc-sum { color: var(--ink-2); }
.sc-warn { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--warn-bg); color: var(--ink); font-size: 1rem; }
.sc-warn ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.25rem; }
.sc-warn .strong { margin: 0; color: var(--warn); }

/* ---------- the simple page for hygienists, assistants and the front desk (#44) ---------- */
.cal-simple { height: 100vh; height: 100dvh; overflow-y: auto; padding: var(--space-6) var(--space-6) var(--space-7); display: grid; gap: var(--space-5); align-content: start; max-width: 80rem; }
.sv-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.sv-head .title { margin: 0; }
.sv-head .sub { margin: 0.25rem 0 0; color: var(--ink-2); font-size: 1rem; }
.sv-ask.cal-create { align-self: center; min-height: 4rem; padding: 0 2rem 0 1.25rem; background: var(--forest); color: var(--on-primary); font-size: 1.125rem; font-weight: 600; }
.sv-ask.cal-create svg { stroke: var(--on-primary); }
.sv-seg { justify-self: start; }
.sv-strip { display: grid; gap: var(--space-3); }
.sv-strip > .h3 { margin: 0; }
.sv-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); }
.sv-day { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; min-height: 9rem; padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--card-shadow); border-top: 0.3125rem solid var(--line-strong); cursor: pointer; }
.sv-day:hover { background: var(--fill-2); }
.sv-day.is-on, .sv-day.is-off { border-top-color: var(--cc); }
.sv-day.is-on .sv-where, .sv-day.is-off .sv-where { color: var(--cd); }
.sv-day.asked { background: repeating-linear-gradient(135deg, var(--cb) 0 0.5rem, var(--surface) 0.5rem 1rem); }
.sv-day.today { box-shadow: 0 0 0 0.125rem var(--forest), var(--card-shadow); }
.sv-day.wkend { min-height: 0; background: var(--fill-2); box-shadow: none; }
.sv-date { display: flex; justify-content: space-between; gap: 0.25rem; flex-wrap: wrap; font-size: 0.875rem; color: var(--ink-2); }
.sv-dow { font-weight: 600; color: var(--ink); }
.sv-day.today .sv-dow { color: var(--forest-text); }
.sv-where { font-size: 1.25rem; font-weight: 700; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.sv-where.none { font-size: 1rem; font-weight: 500; color: var(--ink-3); }
.sv-time { font-size: 1rem; color: var(--ink-2); }
.sv-day .chip-hol { margin-top: 0.25rem; white-space: normal; }
.sv-ev { display: block; width: 100%; padding: 0.125rem 0; border: 0; background: none; text-align: left; font-size: 0.875rem; color: var(--ink); }
.sv-ev .t { color: var(--ink-2); font-weight: 600; }
.sv-ev:hover { text-decoration: underline; }
.sv-month { border-radius: var(--radius-xl); margin: 0; }
.sv-month .cal-body { flex: none; }
.sv-reqs { display: grid; gap: var(--space-3); }
.sv-reqs > .h3 { margin: 0; }
.sv-list { list-style: none; margin: 0; padding: 0; display: grid; }
.sv-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; box-shadow: inset 0 calc(-1 * var(--border-w)) 0 var(--line); }
.sv-list li:last-child { box-shadow: none; }
.sv-when { display: grid; gap: 0.125rem; font-size: 1rem; }
.cal-simple .tag { padding: 0.25rem 0.625rem; }

/* ---------- compact month (#23): one button a day, dots and counts on phones, short words on tablets ---------- */
.mv-compact { grid-auto-rows: minmax(4.5rem, auto); }
.mv-cell.mv-c { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; min-width: 0; margin: 0; padding: 0.25rem 0.125rem 0.375rem; border-top: 0; border-left: 0; border-radius: 0; background: var(--surface); color: var(--ink); font: inherit; text-align: center; }
.mv-c .mv-num { display: grid; place-items: center; min-width: 1.75rem; height: 1.75rem; margin: 0; padding: 0 0.25rem; border-radius: var(--radius-pill); font-size: 0.875rem; font-weight: 500; }
.mv-c.today .mv-num { background: var(--forest); color: var(--on-primary); }
.mv-c.out { background: var(--fill-2); }
.mv-c.out .mv-num { color: var(--ink-3); }
.mv-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.125rem 0.375rem; max-width: 100%; }
.mv-dot { display: inline-flex; align-items: center; gap: 0.125rem; min-width: 0; font-size: 0.875rem; font-weight: 700; line-height: 1.2; color: var(--cd); }
.mv-dot i { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--cc); }
.mv-dot.asked i { background: var(--surface); box-shadow: inset 0 0 0 0.125rem var(--cc); }
.mv-lab { display: none; }
.mv-legend { display: flex; flex-wrap: wrap; gap: 0.25rem var(--space-3); margin: 0; padding: var(--space-3) var(--space-4); }
.mv-legend .mv-dot { color: var(--ink-2); font-weight: 500; }
.mv-legend .mv-lab { display: inline; }
@media (min-width: 40.0625em) {
  .mv-cell.mv-c { align-items: stretch; padding: 0.25rem 0.375rem 0.375rem; text-align: left; }
  .mv-c .mv-num { align-self: center; }
  .mv-dots { display: grid; justify-content: stretch; gap: 0.125rem; }
  .mv-dot { gap: 0.375rem; }
  .mv-n { display: none; }
  .mv-lab { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- agenda (#23): who's where, the next 2 weeks ---------- */
.agenda { display: grid; gap: var(--space-4); padding: var(--space-3) var(--space-4) var(--space-5); }
.ag-day { display: grid; gap: 0.25rem; }
.ag-date { display: flex; align-items: baseline; gap: var(--space-2); margin: 0 0 0.25rem; font-size: 1rem; font-weight: 600; color: var(--ink); }
.ag-day.today .ag-dow { color: var(--forest-text); }
.ag-day.wkend .ag-dow { color: var(--ink-2); }
.ag-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-3); width: 100%; min-height: 2.75rem; margin: 0; padding: 0.375rem var(--space-3); border: 0; border-radius: var(--radius-md); background: var(--cb); color: var(--ink); font: inherit; font-size: 1rem; text-align: left; cursor: pointer; }
.ag-row:hover { filter: brightness(0.97); }
.ag-row.asked { background: repeating-linear-gradient(135deg, var(--cb) 0 0.5rem, var(--surface) 0.5rem 1rem); box-shadow: inset 0 0 0 0.0625rem var(--cc); }
.ag-row .sw { width: 0.75rem; height: 0.75rem; }
.ag-main { display: grid; min-width: 0; }
.ag-n { color: var(--cd); }
.ag-sub { font-size: 0.875rem; color: var(--ink-2); overflow-wrap: anywhere; }
.ag-none { margin: 0; color: var(--ink-3); }
.ag-hol { margin: 0; }
.ag-hol .chip-hol { display: inline-block; margin: 0; }
.ag-more { justify-self: center; }

/* ---------- touch: the day's all-day band is one button (#23, #24) ---------- */
button.tv-allday { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; width: 100%; min-height: 2.75rem; margin: 0; border: 0; border-left: var(--border-w) solid var(--line); border-radius: 0; background: none; color: inherit; font: inherit; text-align: left; }
button.tv-allday .who-n { cursor: inherit; }

@media (max-width: 75em) {
  /* one scroll: the page's (#25); room for the shell's tab bar and the iPhone's home bar */
  .shell-main.is-cal { height: auto; }
  .cal { grid-template-columns: minmax(0, 1fr); height: auto; }
  .cal-side { display: none; }
  .cal-bar-create, .cal-wk, .cal-req-btn, .cal-views .v-agenda { display: inline-flex; }
  .cal-bar { flex-wrap: wrap; row-gap: var(--space-2); }   /* #10 */
  .cal-title { flex: 1 1 10rem; }
  .cal-body:has(.day-panel) { grid-template-columns: minmax(0, 1fr); }
  .day-panel { grid-column: 1; grid-row: auto; }
  .sv-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cal-simple { height: auto; overflow: visible; }
  /* cards open as bottom sheets over a dimmed page (#22, #23) */
  .cal-scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, 0.32); }
  .ev-card { top: auto; bottom: var(--tabbar-h, 0px); left: 0; right: 0; transform: none; width: auto; max-width: 40rem; margin: 0 auto;
    max-height: calc(100vh - var(--tabbar-h, 0px) - 3rem); max-height: calc(100dvh - var(--tabbar-h, 0px) - 3rem); overscroll-behavior: contain;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px)); }
  /* above the shell's phone tab bar, which is --tabbar-h plus the home bar */
  .has-tabbar .ev-card { bottom: calc(var(--tabbar-h, 0px) + env(safe-area-inset-bottom, 0px)); padding-bottom: var(--space-5);
    max-height: calc(100vh - var(--tabbar-h, 0px) - env(safe-area-inset-bottom, 0px) - 3rem); max-height: calc(100dvh - var(--tabbar-h, 0px) - env(safe-area-inset-bottom, 0px) - 3rem); }
  .req-sheet .cal-reqs { display: grid; gap: var(--space-2); }
  /* tap targets of 44px or more (#23, #50) */
  .cal-main .btn, .cal-main .btn.sm, .cal-pop-host .btn, .cal-pop-host .btn.sm, .cal-simple .btn, .cal-simple .btn.sm, .cal-views button, .sv-seg button, .cal-wk { min-height: 2.75rem; }
  .cal-arrow, .cal-pop-host .x { width: 2.75rem; height: 2.75rem; }
  .cal-pop-host .ev-tools { margin-right: calc(-1 * var(--space-2)); }
  .dp-p { min-height: 2.75rem; }
  .sv-ev { min-height: 2.75rem; }
  .cal-wk input { width: 1.25rem; height: 1.25rem; }
}
@media (max-width: 40em) {
  .cal-simple { padding: var(--space-4); }
  .sv-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .sv-list li > :last-child { grid-column: 1 / -1; justify-self: start; }
  .sv-list li > span:last-child:empty { display: none; }
  .cal-wk { display: none; }
  .cal-main { margin-top: 0; border-radius: 0; }
  /* the toolbar in three rows: the title and ‹ ›, then Today, Requests and +, then the views (#23) */
  .cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); }
  .cal-title { order: 1; flex: 1 0 calc(100% - 6.25rem); min-width: 0; margin: 0; font-size: 1.25rem; white-space: normal; overflow: visible; }
  .cal-nav { order: 2; flex: none; }
  .cal-today { order: 3; }
  .cal-req-btn { order: 4; margin-left: auto; }
  .cal-bar-create { order: 5; width: 2.75rem; padding: 0; }
  .cal-bar-create span { display: none; }
  .cal-views { order: 6; flex: 1 0 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .cal-views button { padding: 0 var(--space-2); }
  .v-wide { display: none; }
  .v-phone { display: inline; }
  .sv-month { margin: 0 calc(-1 * var(--space-4)); border-radius: 0; }   /* edge to edge, so a day is 44px wide even at 320px */
  /* 3 days and Day: a narrower time column */
  .tv-head, .tv-band, .tv-grid { grid-template-columns: 3rem repeat(var(--n), minmax(0, 1fr)); }
  .tv-gutter { font-size: 0.875rem; }
  .mv-head { font-size: 0.875rem; }
  .agenda { padding: var(--space-3) var(--space-3) var(--space-5); }
}
