/* erp-calendar.css — the ERP calendar (.cal-*). 20 Sep 2026, from the owner-approved canvas "ERP Calendar".
 *
 * Everything is the ERP's own tokens (css/tokens.css). The page answers to its CONTAINER, not the
 * window: the chat panel narrows the main column, and a @media rule would still think it had a
 * desktop. Dialogs and sheets are fixed to the window, so they use @media. Nothing here is named
 * *-overlay (that name joins the layer raise-loop).
 *
 * Rules the canvas was scored on, kept here: one type scale (11 · 12 · 13 · 14 · 16 · 20 · 26 px; phone
 * 12 · 13 · 16 · 17 · 22), a 4-point grid, tabular numerals, every phone control ≥ 44 px, status never
 * by colour alone (each kind has its own glyph), focus always a ring, Reduce Motion respected.
 *
 * Owner, 20 Sep: a week-off or a holiday is a WORD beside the date. No day is shaded, hatched or disabled.
 */
:root {
  --cal-task: #2D5A2A; --cal-task-bg: #EAF1E8; --cal-approval: #7A5C12; --cal-approval-bg: #F7EBD3; --cal-meeting: #23507F; --cal-meeting-bg: #E4EDF7;
  --cal-order: #23615F; --cal-order-bg: #E0EFEE; --cal-maint: #6B4A2B; --cal-maint-bg: #F1E8DE; --cal-leave: #55554E; --cal-leave-bg: #EDEDE8; --cal-perm: #4A5A6A; --cal-perm-bg: #E6EBF0;
  --cal-late: #9E2F2A; --cal-late-bg: #F7E5E3; --cal-pp: #5B4B8A; --cal-pp-bg: #ECE8F5; --cal-qc: #8A3F5E; --cal-qc-bg: #F5E6EC; --cal-muted: #6B6A65; --cal-line: var(--border, #E6E6E0); --cal-line-2: #EFEFEA; }
#calView { container-type: inline-size; container-name: cal; padding: 4px 0 40px; font-family: var(--font, 'Geist', system-ui, sans-serif); color: var(--text, #1B1B19); font-variant-numeric: tabular-nums; }
#ovxAccCal .cal-row, #ovxAccCal .cal-btn, #ovxAccCal .cal-hint { font-family: var(--font, 'Geist', system-ui, sans-serif); box-sizing: border-box; }
#calView *, .cal-pop *, .cal-sheet * { box-sizing: border-box; }
#calView button, .cal-pop button, .cal-sheet button { font-family: inherit; }
#calView :focus-visible, .cal-pop :focus-visible, .cal-sheet :focus-visible, .cal-dlg :focus-visible { outline: 2px solid var(--brand, #3C7538); outline-offset: 2px; }
.cal-mono { font-family: var(--mono, 'Geist Mono', ui-monospace, monospace); }

/* ── header: tabs + actions ─────────────────────────────────────────────── */
.cal-head { display: flex; align-items: flex-end; gap: 16px; border-bottom: 1px solid var(--cal-line); margin-bottom: 16px; min-height: 44px; }
.cal-tabs { display: flex; gap: 4px; flex-grow: 1; min-width: 0; }
.cal-tab { border: 0; background: transparent; padding: 10px 16px; font-size: 14px; color: var(--cal-muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; min-height: 44px; }
.cal-tab:hover { color: var(--text); }
.cal-tab[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--brand, #3C7538); }
.cal-acts { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.cal-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border-strong, #D6D6CE); border-radius: 8px; background: var(--surface, #fff); color: var(--text); font-size: 13px; cursor: pointer; white-space: nowrap; }
.cal-btn:hover { background: var(--surface-2, #FBFBF9); }
.cal-btn.icon { width: 36px; padding: 0; }
.cal-btn.primary { background: var(--brand, #3C7538); border-color: var(--brand, #3C7538); color: #fff; font-weight: 600; padding: 0 16px; }
.cal-btn.primary:hover { background: var(--brand-700, #2D5A2A); }
.cal-btn.blue { background: var(--cal-meeting); border-color: var(--cal-meeting); color: #fff; font-weight: 600; }
.cal-btn.quiet { border-color: transparent; background: transparent; color: var(--brand-700, #2D5A2A); text-decoration: underline; padding: 0 4px; }
.cal-btn.danger { color: var(--cal-late); }
.cal-btn:disabled { opacity: .55; cursor: default; }
.cal-btn svg { flex-shrink: 0; }
.cal-back { display: none; }

/* ── calendar page: rail + main ─────────────────────────────────────────── */
.cal-body { display: flex; gap: 24px; align-items: flex-start; }
.cal-rail { width: 232px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px; }
.cal-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cal-rail-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--cal-muted); font-weight: 600; margin-bottom: 8px; }
.cal-mini { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; text-align: center; }
.cal-mini-h { display: flex; align-items: center; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.cal-mini-h span { flex-grow: 1; }
.cal-mini-h button { border: 0; background: transparent; width: 24px; height: 24px; border-radius: 6px; cursor: pointer; color: var(--cal-muted); display: inline-flex; align-items: center; justify-content: center; }
.cal-mini-h button:hover { background: var(--surface-3, #F1F1ED); color: var(--text); }
.cal-mini .dn { font-size: 11px; color: var(--cal-muted); padding: 2px 0 4px; }
.cal-mini button { position: relative; border: 0; background: transparent; height: 24px; border-radius: 12px; font-size: 12px; cursor: pointer; color: var(--text); padding: 0; font-family: var(--mono, monospace); }
.cal-mini button.out { color: var(--cal-muted); }
.cal-mini button:hover { background: var(--surface-3, #F1F1ED); }
.cal-mini button.today { background: var(--brand, #3C7538); color: #fff; font-weight: 600; }
.cal-mini button.sel:not(.today) { box-shadow: inset 0 0 0 1.5px var(--text); }
.cal-mini button.has::after { content: ''; position: absolute; left: 50%; bottom: -1px; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: var(--brand, #3C7538); }
.cal-layer { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 32px; padding: 0 2px; border: 0; background: transparent; font-size: 13px; color: var(--text); cursor: pointer; text-align: left; border-radius: 6px; }
.cal-layer:hover { background: var(--surface-3, #F1F1ED); }
.cal-layer .box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #8F8F88; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.cal-layer[aria-pressed="true"] .box { border-color: transparent; background: var(--c); }
.cal-layer .n { margin-left: auto; font-size: 11px; color: var(--cal-muted); font-family: var(--mono, monospace); }
.cal-drawer-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 36px; padding: 0 10px; border: 1px dashed var(--border-strong, #D6D6CE); border-radius: 8px; background: transparent; font-size: 13px; cursor: pointer; color: var(--text); }
.cal-drawer-btn:hover { background: var(--surface, #fff); }
.cal-hint { font-size: 12px; line-height: 1.5; color: var(--cal-muted); }

.cal-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-title { font-size: 20px; font-weight: 600; margin: 0 4px; letter-spacing: -.01em; }
.cal-titlerow { display: contents; }
.cal-seg { display: inline-flex; border: 1px solid var(--border-strong, #D6D6CE); border-radius: 8px; overflow: hidden; margin-left: auto; background: var(--surface, #fff); }
.cal-seg button { border: 0; border-right: 1px solid var(--cal-line); background: transparent; min-height: 36px; padding: 0 16px; font-size: 13px; cursor: pointer; color: var(--text); }
.cal-seg button:last-child { border-right: 0; }
.cal-seg button[aria-pressed="true"] { background: var(--text, #1B1B19); color: #fff; font-weight: 600; }
.cal-people { display: inline-flex; align-items: center; gap: 8px; }

/* trays */
.cal-trays { display: flex; gap: 12px; flex-wrap: wrap; }
.cal-tray { flex: 1 1 320px; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--cal-line); border-radius: 8px; background: var(--surface, #fff); min-width: 0; }
.cal-tray.late { border-color: #E9C4C1; background: #FBF1F0; }
.cal-tray .ic { display: inline-flex; color: var(--cal-muted); flex-shrink: 0; }
.cal-tray.late .ic, .cal-tray.late .num { color: var(--cal-late); }
.cal-tray .num { font-family: var(--mono, monospace); font-size: 20px; font-weight: 500; }
.cal-tray .lbl { font-size: 13px; font-weight: 500; white-space: nowrap; }
.cal-tray .smp { font-size: 12px; color: var(--cal-muted); flex-grow: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-note { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--cal-line); border-radius: 8px; background: var(--surface, #fff); font-size: 13px; }
.cal-note.warn { border-color: #E8D5A8; background: #FBF4E4; color: var(--cal-approval); }
.cal-note.bad { border-color: #E9C4C1; background: #FBF1F0; color: var(--cal-late); }

/* ── Month ──────────────────────────────────────────────────────────────── */
.cal-month { border: 1px solid var(--cal-line); border-radius: 10px; overflow: hidden; background: var(--surface, #fff); }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--cal-line); background: var(--surface-2, #FBFBF9); }
.cal-dow div { padding: 8px 12px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--cal-muted); font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-height: 120px; padding: 4px 6px 6px; border-right: 1px solid var(--cal-line); border-bottom: 1px solid var(--cal-line); display: flex; flex-direction: column; gap: 3px; background: var(--surface, #fff); min-width: 0; cursor: pointer; position: relative; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.lastrow { border-bottom: 0; }
.cal-cell.out { background: var(--surface-2, #FBFBF9); }
.cal-cell.drop { box-shadow: inset 0 0 0 2px var(--brand, #3C7538); }
.cal-cell:hover .cal-add { opacity: 1; }
.cal-cell-h { display: flex; align-items: center; gap: 6px; min-height: 24px; }
.cal-date { min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono, monospace); font-size: 13px; border: 0; background: transparent; cursor: pointer; color: var(--text); }
.cal-cell.out .cal-date { color: var(--cal-muted); }
.cal-date:hover { background: var(--surface-3, #F1F1ED); }
.cal-cell.today .cal-date { background: var(--brand, #3C7538); color: #fff; font-weight: 600; }
.cal-today-w { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-700, #2D5A2A); font-weight: 600; }
.cal-mon { font-size: 11px; color: var(--cal-muted); }
.cal-word { margin-left: auto; font-size: 11px; color: var(--cal-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-add { opacity: 0; position: absolute; right: 4px; bottom: 4px; width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border-strong, #D6D6CE); background: var(--surface, #fff); color: var(--cal-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: opacity .14s ease-out; }
.cal-add:focus-visible { opacity: 1; }
.cal-more { border: 0; background: transparent; padding: 0 6px; min-height: 22px; font-size: 12px; color: var(--text-2, #54544E); text-align: left; cursor: pointer; border-radius: 4px; }
.cal-more:hover { background: var(--surface-3, #F1F1ED); }

/* chips: one glyph per kind — colour is never the only signal */
.cal-chip { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 22px; padding: 1px 6px; border: 0; border-radius: 4px; background: var(--bg-c); color: var(--fg-c); font-size: 12px; line-height: 1.3; text-align: left; cursor: pointer; min-width: 0; }
.cal-chip .g { display: inline-flex; flex-shrink: 0; }
.cal-chip .t { font-family: var(--mono, monospace); font-size: 11px; flex-shrink: 0; }
.cal-chip .x { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-chip.done { background: transparent; color: var(--cal-muted); }
.cal-chip.done .x { text-decoration: line-through; }
.cal-chip.busy { background: repeating-linear-gradient(135deg, #EDEDE8 0 6px, #F6F6F3 6px 12px); color: var(--cal-leave); }
.cal-chip.tent { background: var(--surface, #fff); box-shadow: inset 0 0 0 1px var(--fg-c); }
.cal-chip.count { background: transparent; color: var(--cal-order); padding-left: 6px; }
.cal-chip[draggable="true"] { cursor: grab; }
.k-task { --fg-c: var(--cal-task); --bg-c: var(--cal-task-bg); } .k-approval { --fg-c: var(--cal-approval); --bg-c: var(--cal-approval-bg); } .k-meeting { --fg-c: var(--cal-meeting); --bg-c: var(--cal-meeting-bg); }
.k-order, .k-fabric { --fg-c: var(--cal-order); --bg-c: var(--cal-order-bg); } .k-maint { --fg-c: var(--cal-maint); --bg-c: var(--cal-maint-bg); } .k-leave, .k-hold, .k-block { --fg-c: var(--cal-leave); --bg-c: var(--cal-leave-bg); } .k-perm { --fg-c: var(--cal-perm); --bg-c: var(--cal-perm-bg); }
.k-late { --fg-c: var(--cal-late); --bg-c: var(--cal-late-bg); } .k-pp { --fg-c: var(--cal-pp); --bg-c: var(--cal-pp-bg); } .k-qc { --fg-c: var(--cal-qc); --bg-c: var(--cal-qc-bg); } .k-bulk { --fg-c: var(--cal-approval); --bg-c: var(--cal-approval-bg); } .k-ready { --fg-c: var(--cal-task); --bg-c: var(--cal-task-bg); }
.cal-track { display: inline-flex; gap: 2px; flex-shrink: 0; }
.cal-track i { width: 5px; height: 10px; border-radius: 1.5px; border: 1px solid #8F8F88; }
.cal-track i.on { background: currentColor; border: 0; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--cal-muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ── Week / Day ─────────────────────────────────────────────────────────── */
.cal-week { border: 1px solid var(--cal-line); border-radius: 10px; overflow: hidden; background: var(--surface, #fff); }
.cal-week-h, .cal-allday, .cal-hours { display: grid; grid-template-columns: 56px repeat(var(--days, 7), minmax(0, 1fr)); }
.cal-week-h { border-bottom: 1px solid var(--cal-line); background: var(--surface-2, #FBFBF9); }
.cal-week-h > div { padding: 8px 12px; display: flex; align-items: center; gap: 8px; border-left: 1px solid var(--cal-line); min-width: 0; }
.cal-week-h > div:first-child { border-left: 0; }
.cal-week-h .d { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--cal-muted); font-weight: 600; }
.cal-week-h .n { font-family: var(--mono, monospace); font-size: 14px; min-width: 26px; height: 26px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; cursor: pointer; color: var(--text); }
.cal-week-h .today .n { background: var(--brand, #3C7538); color: #fff; font-weight: 600; }
.cal-allday { border-bottom: 1px solid var(--cal-line); }
.cal-allday > div { padding: 4px; display: flex; flex-direction: column; gap: 3px; border-left: 1px solid var(--cal-line); min-height: 32px; min-width: 0; }
.cal-allday > div:first-child { border-left: 0; font-size: 11px; color: var(--cal-muted); padding: 8px 8px 0; align-items: flex-end; }
.cal-scroll { max-height: min(640px, calc(100vh - 360px)); min-height: 360px; overflow-y: auto; }
.cal-hours { position: relative; }
.cal-hcol { border-left: 1px solid var(--cal-line); position: relative; cursor: crosshair; }
.cal-hlab { position: relative; }
.cal-hlab span { position: absolute; right: 8px; font-size: 11px; color: var(--cal-muted); transform: translateY(-50%); font-family: var(--mono, monospace); }
.cal-offhrs { position: absolute; left: 0; right: 0; background: rgba(27, 27, 25, .035); pointer-events: none; }
.cal-hline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--cal-line-2); pointer-events: none; }
.cal-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--cal-late); z-index: 2; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--cal-late); }
.cal-block { position: absolute; border: 0; border-radius: 6px; padding: 4px 8px; background: var(--bg-c); color: var(--fg-c); font-size: 12px; line-height: 1.3; text-align: left; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; gap: 1px; box-shadow: 0 0 0 1px var(--surface, #fff); z-index: 1; }
.cal-block b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block.busy { background: repeating-linear-gradient(135deg, #EDEDE8 0 6px, #F6F6F3 6px 12px); color: var(--cal-leave); }
.cal-block.tent { background: var(--surface, #fff); box-shadow: inset 0 0 0 1px var(--fg-c); border: 1px dashed var(--fg-c); }
.cal-ghost { position: absolute; left: 4px; right: 4px; border-radius: 6px; background: rgba(60,117,56,.16); border: 1.5px solid var(--brand, #3C7538); z-index: 3; pointer-events: none; font-size: 11px; padding: 2px 6px; color: var(--brand-700, #2D5A2A); font-family: var(--mono, monospace); }
.cal-daypanel { width: 320px; flex-shrink: 0; border: 1px solid var(--cal-line); border-radius: 10px; background: var(--surface, #fff); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.cal-daywrap { display: flex; gap: 16px; align-items: flex-start; }
.cal-daywrap .cal-week { flex-grow: 1; min-width: 0; }

/* ── Agenda / lists ─────────────────────────────────────────────────────── */
.cal-agenda { display: flex; flex-direction: column; gap: 16px; }
.cal-ag-day { border: 1px solid var(--cal-line); border-radius: 10px; background: var(--surface, #fff); overflow: hidden; }
.cal-ag-h { display: flex; align-items: baseline; gap: 0 12px; padding: 12px 16px; background: var(--surface-2, #FBFBF9); flex-wrap: wrap; }
.cal-ag-h b { font-size: 14px; font-weight: 600; white-space: nowrap; }
.cal-ag-h span { font-size: 12px; color: var(--cal-muted); }
.cal-ag-h .today { color: var(--brand-700, #2D5A2A); }
.cal-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 4px 16px; border: 0; border-top: 1px solid var(--cal-line-2); background: transparent; text-align: left; cursor: pointer; color: var(--text); font-size: 14px; }
.cal-row:hover { background: var(--surface-2, #FBFBF9); }
.cal-row .tm { width: 76px; flex-shrink: 0; font-family: var(--mono, monospace); font-size: 12px; color: var(--cal-muted); }
.cal-row .g { display: inline-flex; flex-shrink: 0; color: var(--fg-c); }
.cal-row .tx { flex-grow: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.cal-row .tx b { font-weight: 500; }
.cal-row .tx small { font-size: 12px; color: var(--cal-muted); }
.cal-row.done .tx b { text-decoration: line-through; color: var(--cal-muted); }
.cal-pill { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--bg-c); color: var(--fg-c); white-space: nowrap; flex-shrink: 0; }
.cal-empty { padding: 40px 16px; text-align: center; color: var(--cal-muted); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 12px; border: 1px dashed var(--border-strong, #D6D6CE); border-radius: 10px; }
.cal-empty b { font-size: 16px; color: var(--text); font-weight: 600; }
.cal-skel { border-radius: 6px; background: linear-gradient(90deg, #EFEFEA 0%, #F7F7F4 50%, #EFEFEA 100%); background-size: 200% 100%; animation: calSkel 1.2s linear infinite; }
@keyframes calSkel { to { background-position: -200% 0; } }

/* ── Timeline (Production) ──────────────────────────────────────────────── */
.cal-tl { border: 1px solid var(--cal-line); border-radius: 10px; background: var(--surface, #fff); overflow: hidden; }
.cal-tl-scroll { overflow-x: auto; }
.cal-tl-in { min-width: 1080px; position: relative; }
.cal-tl-h, .cal-tl-r { display: flex; align-items: center; }
.cal-tl-h { height: 40px; border-bottom: 1px solid var(--cal-line); background: var(--surface-2, #FBFBF9); position: sticky; top: 0; z-index: 3; }
.cal-tl-lab { width: 300px; flex-shrink: 0; padding: 0 16px; display: flex; align-items: center; gap: 8px; min-width: 0; position: sticky; left: 0; background: inherit; z-index: 2; }
.cal-tl-r { min-height: 36px; border-bottom: 1px solid var(--cal-line-2); background: var(--surface, #fff); cursor: pointer; width: 100%; border-left: 0; border-right: 0; border-top: 0; padding: 0; text-align: left; font: inherit; color: inherit; }
.cal-tl-r:hover { background: var(--surface-2, #FBFBF9); }
.cal-tl-fold { background: #FBF1F0; min-height: 44px; } .cal-tl-fold:hover { background: #F7E5E3; } .cal-tl-fold .cal-tl-lab span { white-space: normal; }
.cal-tl-r .cal-tl-lab b { font-family: var(--mono, monospace); font-size: 12px; font-weight: 600; flex-shrink: 0; }
.cal-tl-r .cal-tl-lab span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-tl-lane { position: relative; flex-grow: 1; height: 36px; }
.cal-tl-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--cal-line-2); font-size: 11px; color: var(--cal-muted); padding: 20px 0 0 6px; white-space: nowrap; }
.cal-tl-bar { position: absolute; top: 12px; height: 12px; border-radius: 3px; background: var(--fg-c); min-width: 3px; }
.cal-tl-bar.rest { background: transparent; border: 1px solid #8F8F88; }
.cal-tl-bar.lateRun { background: repeating-linear-gradient(135deg, #B23A34 0 4px, #E2A9A5 4px 8px); }
.cal-tl-due { position: absolute; top: 8px; width: 2px; height: 20px; background: var(--text); }
.cal-tl-flag { position: absolute; top: 9px; color: var(--cal-meeting); display: inline-flex; }
.cal-tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); z-index: 4; pointer-events: none; }
.cal-tl-today i { position: absolute; top: 2px; left: -24px; font-style: normal; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; background: var(--text); color: #fff; padding: 2px 6px; border-radius: 4px; }
.cal-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cal-sel { min-height: 36px; border: 1px solid var(--border-strong, #D6D6CE); border-radius: 8px; background: var(--surface, #fff); font-size: 13px; padding: 0 28px 0 12px; color: var(--text); font-family: inherit; max-width: 220px; }

/* ── popover, sheet ─────────────────────────────────────────────────────── */
.cal-pop { position: fixed; z-index: 9100; width: 360px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow-y: auto; background: var(--surface, #fff); border: 1px solid var(--border-strong, #D6D6CE); border-radius: 12px; box-shadow: 0 8px 28px rgba(27,27,25,.16); padding: 16px; display: flex; flex-direction: column; gap: 12px; font-family: var(--font, 'Geist', system-ui, sans-serif); color: var(--text, #1B1B19); font-variant-numeric: tabular-nums; animation: calPop .16s var(--ease-out, ease-out); }
@keyframes calPop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
.cal-pop-h { display: flex; align-items: flex-start; gap: 12px; }
.cal-pop-h .g { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-c); color: var(--fg-c); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cal-pop-h h3 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; flex-grow: 1; min-width: 0; overflow-wrap: anywhere; }
.cal-pop-x { border: 0; background: transparent; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; color: var(--cal-muted); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cal-pop-x:hover { background: var(--surface-3, #F1F1ED); }
.cal-pop-l { display: flex; gap: 12px; font-size: 13px; line-height: 1.5; align-items: flex-start; }
.cal-pop-l .i { color: var(--cal-muted); display: inline-flex; padding-top: 2px; flex-shrink: 0; }
.cal-pop-l small { color: var(--cal-muted); font-size: 12px; }
.cal-pop-f { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.cal-rsvp { display: inline-flex; border: 1px solid var(--border-strong, #D6D6CE); border-radius: 8px; overflow: hidden; }
.cal-rsvp button { border: 0; border-right: 1px solid var(--cal-line); background: var(--surface, #fff); min-height: 36px; padding: 0 12px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.cal-rsvp button:last-child { border-right: 0; }
.cal-rsvp button[aria-pressed="true"] { background: var(--cal-task-bg); color: var(--cal-task); font-weight: 600; }
.cal-guest { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 28px; }
.cal-guest small { color: var(--cal-muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.cal-av { width: 24px; height: 24px; border-radius: 50%; background: var(--cal-task-bg); color: var(--cal-task); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cal-av.client { background: var(--cal-meeting-bg); color: var(--cal-meeting); }
.cal-sheet-back { position: fixed; inset: 0; z-index: 9090; background: rgba(27,27,25,.32); }
.cal-list-pop { width: 420px; }
.cal-menu { position: fixed; z-index: 9150; min-width: 220px; background: var(--surface, #fff); border: 1px solid var(--border-strong, #D6D6CE); border-radius: 10px; box-shadow: 0 8px 28px rgba(27,27,25,.16); padding: 6px; display: flex; flex-direction: column; font-family: var(--font, system-ui); }
.cal-menu button { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 0 10px; border: 0; background: transparent; border-radius: 6px; font-size: 13px; cursor: pointer; text-align: left; color: var(--text, #1B1B19); }
.cal-menu button:hover { background: var(--surface-3, #F1F1ED); }
.cal-menu .sep { height: 1px; background: var(--cal-line, #E6E6E0); margin: 4px 0; }
.cal-menu .n { margin-left: auto; font-size: 11px; font-family: var(--mono, monospace); background: #B23A34; color: #fff; border-radius: 9px; padding: 1px 6px; }

/* ── sub-pages: My meetings, Connect, Settings ──────────────────────────── */
.cal-page { display: flex; flex-direction: column; gap: 16px; max-width: 1080px; }
.cal-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cal-card { border: 1px solid var(--cal-line); border-radius: 12px; background: var(--surface, #fff); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cal-card h2 { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.cal-card h2 small { font-size: 12px; font-weight: 400; color: var(--cal-muted); }
.cal-card p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2, #54544E); }
.cal-meet { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--cal-line-2); flex-wrap: wrap; }
.cal-meet:first-of-type { border-top: 0; }
.cal-meet .when { width: 136px; flex-shrink: 0; display: flex; flex-direction: column; font-family: var(--mono, monospace); font-size: 12px; color: var(--cal-muted); }
.cal-meet .when b { font-family: var(--font, system-ui); font-size: 13px; color: var(--text); font-weight: 600; }
.cal-meet .what { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; border: 0; background: transparent; text-align: left; cursor: pointer; padding: 0; color: inherit; font: inherit; }
.cal-meet .what b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.cal-meet .what small { font-size: 12px; color: var(--cal-muted); }
.cal-soon { border-color: #BCD0E6; background: #F2F6FB; }
.cal-set { display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 8px 0; border-top: 1px solid var(--cal-line-2); }
.cal-set:first-of-type { border-top: 0; }
.cal-set .lbl { flex-grow: 1; min-width: 0; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.cal-set .lbl small { font-size: 12px; color: var(--cal-muted); }
.cal-rooms { list-style: none; margin: 0; padding: 0; }
.cal-rooms li { display: flex; align-items: center; gap: 12px; min-height: 44px; border-top: 1px solid var(--cal-line-2); font-size: 14px; }
.cal-rooms li:first-child { border-top: 0; }
.cal-rooms li span { flex-grow: 1; min-width: 0; overflow-wrap: anywhere; }
.cal-roomadd { display: flex; gap: 8px; margin-top: 8px; }
.cal-roomadd .rp-in { flex: 1 1 0; min-width: 0; min-height: 44px; }
.cal-roomadd .cal-btn { min-height: 44px; flex-shrink: 0; }
#calFRoomHint { display: flex; gap: 6px; align-items: flex-start; color: var(--cal-late, #9E2F2A); margin-top: 4px; }
#calFRoomHint[hidden] { display: none; }
.cal-sw { position: relative; width: 44px; height: 26px; border-radius: 13px; border: 0; background: #8F8F88; cursor: pointer; flex-shrink: 0; transition: background .14s ease-out; padding: 0; }
.cal-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .14s ease-out; }
.cal-sw[aria-checked="true"] { background: var(--brand, #3C7538); }
.cal-sw[aria-checked="true"]::after { transform: translateX(18px); }
.cal-link { display: flex; gap: 8px; align-items: center; }
.cal-link input { flex-grow: 1; min-width: 0; min-height: 36px; border: 1px solid var(--border-strong, #D6D6CE); border-radius: 8px; padding: 0 12px; font-family: var(--mono, monospace); font-size: 12px; background: var(--surface-2, #FBFBF9); color: var(--text); }
.cal-steps { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.7; color: var(--text-2, #54544E); }

/* ── forms (inside the shared .rp-dlg shell) ────────────────────────────── */
.cal-dlg .rp-dlg-card { width: min(680px, 100%); }
.cal-kinds { display: inline-flex; border: 1px solid var(--border-strong, #D6D6CE); border-radius: 8px; overflow: hidden; align-self: flex-start; flex-wrap: wrap; }
.cal-kinds button { border: 0; border-right: 1px solid var(--cal-line, #E6E6E0); background: var(--surface, #fff); min-height: 36px; padding: 0 14px; font-size: 13px; cursor: pointer; color: var(--text, #1B1B19); font-family: inherit; }
.cal-kinds button:last-child { border-right: 0; }
.cal-kinds button[aria-pressed="true"] { background: var(--text, #1B1B19); color: #fff; font-weight: 600; }
.cal-when { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-when .rp-in { width: auto; flex: 1 1 140px; }
.cal-when .to { font-size: 13px; color: var(--cal-muted, #6B6A65); }
.cal-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; min-height: 36px; }
.cal-check input { width: 16px; height: 16px; accent-color: var(--brand, #3C7538); }
.cal-dlg fieldset.rp-field { display: flex; flex-direction: row; flex-wrap: wrap; gap: 0 24px; } .cal-dlg fieldset.rp-field legend { width: 100%; }
.cal-err[hidden] { display: none; }
.cal-err { font-size: 12px; color: var(--cal-late, #9E2F2A); display: flex; gap: 6px; align-items: center; }
.cal-guests { border: 1px solid var(--border, #E6E6E0); border-radius: 8px; background: var(--surface, #fff); }
.cal-guests .find { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 40px; color: var(--cal-muted, #6B6A65); position: relative; }
.cal-guests .find input { flex-grow: 1; border: 0; outline: 0; background: transparent; font-family: inherit; font-size: 13px; min-height: 38px; color: var(--text, #1B1B19); min-width: 0; }
.cal-guests .list { border-top: 1px solid var(--cal-line-2, #EFEFEA); padding: 4px 12px; display: flex; flex-direction: column; }
.cal-guests .list:empty { display: none; }
.cal-guests .g-row { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; }
.cal-guests .g-row .nm { flex-grow: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-guests .g-row small { color: var(--cal-muted, #6B6A65); font-size: 12px; white-space: nowrap; }
.cal-guests .g-row button { border: 0; background: transparent; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; color: var(--cal-muted, #6B6A65); display: inline-flex; align-items: center; justify-content: center; }
.cal-guests .g-row button:hover { background: var(--surface-3, #F1F1ED); }
.cal-pick { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; background: var(--surface, #fff); border: 1px solid var(--border-strong, #D6D6CE); border-radius: 10px; box-shadow: 0 8px 28px rgba(27,27,25,.16); max-height: 300px; overflow-y: auto; padding: 6px; }
.cal-pick .h { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cal-muted, #6B6A65); font-weight: 600; padding: 8px 8px 4px; }
.cal-pick button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 0 8px; border: 0; background: transparent; border-radius: 6px; font-size: 13px; cursor: pointer; text-align: left; font-family: inherit; color: var(--text, #1B1B19); }
.cal-pick button:hover, .cal-pick button.on { background: var(--surface-3, #F1F1ED); }
.cal-pick button small { margin-left: auto; color: var(--cal-muted, #6B6A65); font-size: 12px; white-space: nowrap; }
.cal-meetbox { border: 1px solid #BCD0E6; background: #F2F6FB; border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cal-meetbox.wait { border-color: #E8D5A8; background: #FBF4E4; }
.cal-meetbox .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-meetbox .url { font-family: var(--mono, monospace); font-size: 12px; color: var(--cal-meeting, #23507F); overflow-wrap: anywhere; flex-grow: 1; min-width: 0; }
.cal-meetbox p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-2, #54544E); }
.cal-ft-days { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-ft-days { flex-wrap: nowrap !important; }
.cal-ft-days button { flex: 1 1 0; min-width: 0; min-height: 52px; border: 1px solid var(--border, #E6E6E0); border-radius: 8px; background: var(--surface, #fff); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; font-family: inherit; color: var(--text, #1B1B19); }
.cal-ft-days button b { font-family: var(--mono, monospace); font-size: 16px; font-weight: 500; }
.cal-ft-days button[aria-pressed="true"] { background: var(--text, #1B1B19); color: #fff; border-color: var(--text, #1B1B19); }
.cal-ft-days button.away:not([aria-pressed="true"]) { background: var(--cal-late-bg, #F7E5E3); color: var(--cal-late, #9E2F2A); }
.cal-slot { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--border, #E6E6E0); border-radius: 8px; background: var(--surface, #fff); font-size: 13px; cursor: pointer; text-align: left; font-family: inherit; color: var(--text, #1B1B19); }
.cal-slot .tm { font-family: var(--mono, monospace); font-size: 13px; width: 176px; flex-shrink: 0; white-space: nowrap; }
.cal-slot.taken { background: var(--surface-3, #F1F1ED); color: var(--cal-muted, #6B6A65); cursor: default; }
.cal-slot[aria-pressed="true"] { border-color: var(--brand, #3C7538); background: var(--cal-task-bg, #EAF1E8); box-shadow: inset 0 0 0 1px var(--brand, #3C7538); }
.cal-slots { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; }
.cal-toast-undo { text-decoration: underline; cursor: pointer; border: 0; background: transparent; color: inherit; font: inherit; padding: 0 0 0 8px; }

/* My tasks strip + order Schedule + My Deck widget live outside #calView */
.cal-strip { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border, #E6E6E0); border-radius: 12px; background: var(--surface, #fff); margin: 0 0 12px; flex-wrap: wrap; font-family: var(--font, system-ui); font-variant-numeric: tabular-nums; }
.cal-strip .hd { display: flex; flex-direction: column; width: 96px; flex-shrink: 0; }
.cal-strip .hd b { font-size: 14px; font-weight: 600; } .cal-strip .hd small { font-size: 12px; color: #6B6A65; }
.cal-strip .mt { flex: 1 1 220px; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 8px; background: #F2F6FB; border: 0; text-align: left; cursor: pointer; font-family: inherit; color: var(--text, #1B1B19); min-width: 0; }
.cal-strip .mt .tm { font-family: var(--mono, monospace); font-size: 12px; color: #23507F; flex-shrink: 0; }
.cal-strip .mt .g { color: #23507F; display: inline-flex; flex-shrink: 0; }
.cal-strip .mt .tx { display: flex; flex-direction: column; min-width: 0; flex-grow: 1; } .cal-strip .mt .tx b { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cal-strip .mt .tx small { font-size: 12px; color: #6B6A65; }
.cal-strip a, .cal-strip .lnk { font-size: 12px; color: var(--brand-700, #2D5A2A); white-space: nowrap; background: transparent; border: 0; text-decoration: underline; cursor: pointer; font-family: inherit; }
.cal-join { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: #23507F; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; flex-shrink: 0; font-family: inherit; }

/* ── the container is narrow (a phone, or the chat panel is open) ────────── */
@container cal (max-width: 900px) {
  .cal-rail { display: none; }
  .cal-daypanel { display: none; }
  .cal-cols { grid-template-columns: minmax(0, 1fr); }
  .cal-tl-lab { width: 180px; }
}
@container cal (max-width: 640px) {
  .cal-head { border-bottom: 0; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; align-items: center; }
  .cal-tabs { order: 3; flex-basis: 100%; background: #EBEBE5; border-radius: 10px; padding: 2px; gap: 0; }
  .cal-tab { flex: 1 1 0; min-height: 44px; border-radius: 8px; border: 0; margin: 0; font-size: 13px; padding: 0 4px; color: var(--text); }
  .cal-tab[aria-selected="true"] { background: var(--surface, #fff); box-shadow: 0 1px 2px rgba(27,27,25,.12); }
  .cal-acts { padding: 0; margin-left: auto; }
  .cal-btn { min-height: 44px; font-size: 16px; }
  .cal-btn.icon { width: 44px; border-radius: 22px; }
  .cal-btn.primary.new { width: 44px; padding: 0; border-radius: 22px; } .cal-btn.primary.new span { display: none; }
  .cal-back { display: inline-flex; }
  .cal-bar { gap: 8px; }
  .cal-titlerow { display: flex; align-items: center; gap: 8px; order: -1; flex-basis: 100%; }
  .cal-title { font-size: 22px; font-weight: 700; margin: 0; flex-grow: 1; }
  .cal-seg { margin-left: 0; flex-grow: 1; } .cal-seg button { flex: 1 1 0; min-height: 44px; padding: 0 4px; }
  .cal-cell { min-height: 56px; padding: 4px 2px; align-items: center; gap: 2px; }
  .cal-cell-h { justify-content: center; } .cal-cell .cal-word, .cal-cell .cal-today-w, .cal-cell .cal-mon, .cal-cell .cal-add, .cal-cell .cal-chip, .cal-cell .cal-more { display: none; }
  .cal-date { min-width: 32px; width: 32px; height: 32px; padding: 0; flex-shrink: 0; border-radius: 16px; font-size: 16px; }
  .cal-cell.sel:not(.today) .cal-date { box-shadow: inset 0 0 0 1.5px var(--text); }
  /* The WHOLE day cell is the date button on a phone (mobile audit F43, 21 Oct 2026): the visible circle stays 32px,
     its ::after covers the cell (about 52x56), so a thumb anywhere on the day opens it. #calView outranks the touch
     rule in ios-pwa.css that would otherwise stretch the circle into a 44px pill. */
  #calView .cal-cell { position: relative; }
  #calView .cal-date { min-width: 32px; min-height: 32px; }
  #calView .cal-date::after { content: ""; position: absolute; inset: 0; }
  .cal-dots { display: flex !important; }
  .cal-dow div { padding: 8px 0; text-align: center; font-size: 12px; letter-spacing: 0; }
  .cal-phone-day { display: flex !important; }
  .cal-row { min-height: 52px; padding: 4px 12px; font-size: 16px; } .cal-row .tm { width: 64px; font-size: 13px; } .cal-row .tx small, .cal-pill { font-size: 13px; }
  .cal-ag-h b { font-size: 16px; } .cal-ag-h span { font-size: 13px; }
  .cal-tray { min-height: 52px; } .cal-tray .lbl, .cal-tray .smp { font-size: 13px; }
  .cal-legend, .cal-hint { font-size: 13px; }
  .cal-week-h > div { padding: 8px 4px; flex-direction: column; gap: 2px; } .cal-week-h .d { font-size: 12px; letter-spacing: 0; }
  .cal-block { font-size: 13px; } .cal-block small { font-size: 12px; }
  .cal-sel { min-height: 44px; font-size: 16px; flex: 1 1 140px; max-width: none; }
  .cal-tl-lab { width: 132px; padding: 0 8px; } .cal-tl-r, .cal-tl-lane { min-height: 44px; height: 44px; } .cal-tl-bar { top: 16px; } .cal-tl-due { top: 12px; }
  .cal-card { padding: 16px 12px; } .cal-card h2 { font-size: 17px; } .cal-card p, .cal-steps { font-size: 16px; }
  .cal-meet .when { width: 112px; } .cal-meet .what b { font-size: 16px; } .cal-meet .what small { font-size: 13px; }
  .cal-rsvp { display: flex; width: 100%; } .cal-rsvp button { flex: 1 1 0; min-height: 48px; justify-content: center; font-size: 16px; }
  .cal-set .lbl { font-size: 16px; } .cal-set .lbl small { font-size: 13px; }
  .cal-link { flex-wrap: wrap; } .cal-link input { flex-basis: 100%; min-height: 44px; }
}
.cal-dots { display: none; gap: 2px; height: 5px; align-items: center; justify-content: center; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--fg-c); }
.cal-dots i.ring { background: transparent; box-shadow: inset 0 0 0 1.2px var(--fg-c); }
.cal-phone-day { display: none; flex-direction: column; }

/* popovers become bottom sheets on a phone; dialogs fill the screen */
@media (max-width: 640px) {
  .cal-pop { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: 100%; max-width: 100%; max-height: 86vh; border-radius: 16px 16px 0 0; border-width: 1px 0 0; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); animation: calSheet .22s var(--ease-drawer, ease-out); }
  .cal-pop::before { content: ''; width: 36px; height: 4px; border-radius: 2px; background: #C9C9C2; align-self: center; flex-shrink: 0; }
  .cal-pop-h h3 { font-size: 17px; } .cal-pop-l { font-size: 16px; } .cal-pop-l small, .cal-guest small { font-size: 13px; } .cal-guest { font-size: 16px; min-height: 36px; }
  .cal-pop .cal-btn, .cal-pop .cal-join { min-height: 48px; font-size: 16px; flex: 1 1 auto; justify-content: center; }
  .cal-pop .cal-rsvp { display: flex; width: 100%; } .cal-pop .cal-rsvp button { flex: 1 1 0; min-height: 48px; justify-content: center; font-size: 16px; }
  .cal-menu { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; border-radius: 16px 16px 0 0; padding: 12px 8px calc(16px + env(safe-area-inset-bottom)); }
  .cal-menu button { min-height: 52px; font-size: 17px; padding: 0 12px; }
  .cal-dlg.rp-dlg { padding: 0; } .cal-dlg .rp-dlg-card { width: 100%; min-height: 100%; border-radius: 0; }
  .cal-dlg .rp-in, .cal-dlg .rp-btn, .cal-kinds button, .cal-guests .find input { min-height: 44px; font-size: 16px; }
  .cal-dlg .rp-dlg-f { position: sticky; bottom: 0; background: var(--surface, #fff); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .cal-dlg .rp-dlg-f .rp-btn { flex: 1 1 0; }
  .cal-pick button { min-height: 48px; font-size: 16px; } .cal-slot { min-height: 56px; font-size: 16px; flex-wrap: wrap; gap: 0 12px; padding: 6px 16px; } .cal-slot .tm { width: auto; font-size: 16px; }
  .cal-strip .mt { flex-basis: 100%; } .cal-join { min-height: 44px; font-size: 16px; }
}
@keyframes calSheet { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .cal-pop, .cal-skel, .cal-sw, .cal-sw::after, .cal-add { animation: none !important; transition: none !important; } }
@media print {
  body.cal-printing > *:not(#calPrint) { display: none !important; }
  #calPrint { display: block !important; font-family: var(--font, system-ui); color: #000; }
  #calPrint h1 { font-size: 18px; margin: 0 0 4px; } #calPrint p { font-size: 11px; margin: 0 0 12px; color: #444; }
  #calPrint table { width: 100%; border-collapse: collapse; font-size: 11px; } #calPrint th, #calPrint td { border: 1px solid #999; padding: 4px 6px; text-align: left; vertical-align: top; } #calPrint th { background: #eee; }
  #calPrint tr.late td { font-weight: 600; }
}
#calPrint { display: none; }
.cal-sw:disabled { opacity: .45; cursor: default; }
.cal-dlg .rp-btn.danger { background: #B23A34; border-color: #B23A34; color: #fff; }
.cal-dlg .rp-btn.primary { background: var(--brand, #3C7538); border-color: var(--brand, #3C7538); color: #fff; }
@media (max-width: 640px) {
  .cal-dlg .rp-dlg-f .rp-sum { display: none; }
  .cal-dlg .rp-dlg-f { flex-direction: row !important; flex-wrap: nowrap; }
  .cal-dlg .cal-when input[type="date"] { flex-basis: 100%; }
  .cal-dlg .cal-btn { min-height: 44px; font-size: 16px; }
  .cal-dlg .cal-check { min-height: 44px; font-size: 16px; }
}

/* the Save button says what it does ("Save and invite 4 guests") — the footer note gives way, the buttons never wrap */
.cal-dlg .rp-dlg-f { flex-wrap: nowrap; }
.cal-dlg .rp-dlg-f .rp-sum { flex: 1 1 0; min-width: 0; }
.cal-dlg .rp-dlg-f .rp-btn { flex-shrink: 0; white-space: nowrap; }

/* other calendars by address (21 Sep 2026) */
.cal-extrow { display: flex; align-items: center; gap: 2px; }
.cal-extrow .cal-layer { flex: 1 1 0; min-width: 0; }
.cal-extrow .cal-layer span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ext-x { border: 0; background: transparent; width: 28px; height: 28px; border-radius: 6px; color: var(--cal-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cal-ext-x:hover { background: var(--surface-3, #F1F1ED); color: var(--text); }
.cal-ext-add { margin-top: 8px; justify-content: flex-start; }
.cal-ext-add span { display: inline-flex; align-items: center; gap: 8px; }
.cal-swatches { display: flex; gap: 8px; }
.cal-swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; box-shadow: inset 0 0 0 2px #fff; }
.cal-swatches button[aria-pressed="true"] { border-color: var(--c); }
.cal-chip.ext, .cal-block.ext { background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); box-shadow: inset 3px 0 0 var(--c); }

/* search inside the calendar (21 Sep 2026) */
.cal-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong, #D6D6CE); border-radius: 10px; background: var(--surface, #fff); padding: 4px 4px 4px 12px; }
.cal-search .i { display: inline-flex; color: var(--cal-muted); }
.cal-search input { flex: 1 1 0; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; min-height: 40px; color: var(--text); }
.cal-search:focus-within { border-color: var(--brand, #3C7538); box-shadow: 0 0 0 3px rgba(60, 117, 56, .15); }
#calView .cal-search input:focus-visible { outline: 0; }   /* the box itself carries the ring */

/* a meeting being dragged in Week / Day; its lower edge is the handle that changes its length */
.cal-block.moving { opacity: .85; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); z-index: 5; cursor: grabbing; }
.cal-block::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
@media (prefers-reduced-motion: no-preference) { .cal-block { transition: box-shadow .12s ease-out; } }

/* a list row follows the finger on a left swipe, and settles back */
@media (prefers-reduced-motion: no-preference) { .cal-row { transition: transform .16s ease-out; } }
.cal-row { touch-action: pan-y; }

/* a calendar I added, shared with staff */
.cal-xchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cal-xchips:empty { display: none; }
.cal-xchip { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 4px 0 12px; border-radius: 14px; background: var(--surface-3, #F1F1ED); font-size: 13px; }
.cal-xchip button { border: 0; background: transparent; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--cal-muted); }
.cal-xchip button:hover { background: rgba(0, 0, 0, .08); color: var(--text); }
.cal-extrow .cal-layer small { font-size: 11px; }

/* Production — Week as order cards (canvas 10) */
.cal-pw { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
.cal-pw-day { border: 1px solid var(--cal-line); border-radius: 10px; background: var(--surface, #fff); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 160px; }
.cal-pw-day.today { border-color: var(--brand, #3C7538); }
.cal-pw-day header { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cal-muted); }
.cal-pw-day header .n { border: 0; background: transparent; font: inherit; font-size: 16px; letter-spacing: 0; color: var(--text); cursor: pointer; border-radius: 12px; min-width: 24px; height: 24px; padding: 0 4px; }
.cal-pw-day.today header .n { background: var(--brand, #3C7538); color: #fff; font-weight: 600; }
.cal-pw-sum { font-size: 12px; color: var(--cal-muted); padding-bottom: 4px; border-bottom: 1px solid var(--cal-line-2); }
.cal-pw-sum b { color: var(--text); font-weight: 600; }
.cal-pw-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; text-align: left; border: 1px solid var(--cal-line); border-radius: 8px; background: var(--surface-2, #FBFBF9); padding: 8px; cursor: pointer; font-size: 13px; color: var(--text); min-width: 0; }
.cal-pw-card:hover { background: var(--surface-3, #F1F1ED); }
.cal-pw-card b { font-weight: 600; overflow-wrap: anywhere; }
.cal-pw-card small { font-size: 12px; color: var(--cal-muted); }
.cal-pw-card .trk { display: inline-flex; align-items: center; gap: 6px; }
.cal-pw-card.k-late { border-color: #E9C4C1; background: #FBF1F0; }
.cal-pw-ms { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: transparent; font-size: 12px; color: var(--cal-meeting); cursor: pointer; text-align: left; padding: 2px 0; min-height: 24px; }
.cal-pw-ms span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container cal (max-width: 900px) { .cal-pw { grid-template-columns: minmax(0, 1fr); } .cal-pw-day { min-height: 0; } .cal-pw-card, .cal-pw-ms { min-height: 44px; } }

/* canvas 24–25: a press darkens; pop-ups and menus arrive softly; a skip link for the keyboard; all of it still under Reduce Motion */
.cal-skip { position: absolute; left: -9999px; top: 0; z-index: 10; background: var(--surface, #fff); border: 2px solid var(--brand, #3C7538); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--text); }
.cal-skip:focus { left: 8px; top: 8px; }
#calMainStart:focus { outline: 0; }
.cal-btn:active, .cal-chip:active, .cal-row:active, .cal-block:active, .cal-layer:active, .cal-pw-card:active { filter: brightness(.94); }
@media (prefers-reduced-motion: no-preference) {
  .cal-pop, .cal-menu { animation: calIn .14s ease-out; }
  .cal-month, .cal-week, .cal-agenda, .cal-pw { animation: calFade .16s ease-out; }
  @keyframes calIn { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
  @keyframes calFade { from { opacity: .4; } to { opacity: 1; } }
}
