/* Tap-Pay Agent Portal — the calendar, in OnSight's shape and Tap-Pay's colors.

   Greg, 2026-10-07: "Copy the calendar, all styles that apply to both."
   These are OnSight's .cal* rules (tapfield/app/css/app.css) with the
   OnSight palette swapped for the portal's tokens: --accent (crimson) where
   OnSight acts in blue, --danger for the one red thing (the now line),
   --hair for every hairline, --band for the soft field, --steel and
   --steel-lt for the quieter words. No navy, no Carolina blue. Surfaces are
   flat: a hairline, radius var(--r), no shadow at rest. Body text is 17px,
   labels 15px, badges 14px; every control is 44px tall.

   Loaded after onsight.css. Every class the view (js/views/calendar.js)
   emits has its rule here — a layout class with nothing behind it is the
   fault checking-spacing exists to catch. */

.calpage { display: flex; flex-direction: column; gap: 0; }

/* ---- The bar: ‹ Today ›, the title, the look switch and the span menu ---- */
.calbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 14px; margin-bottom: 14px; }
.calbar__spacer { flex: 1 1 auto; }
.calnav { display: inline-flex; border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; background: var(--ui-surface, #fff); }
.calnav__b {
  border: 0; border-radius: 0; margin: 0; min-height: 44px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--ui-surface, #fff); color: var(--ink); font: inherit; font-size: var(--fs-body); font-weight: 500;
  cursor: pointer; box-shadow: none; white-space: nowrap;
}
.calnav__b + .calnav__b { border-left: 1px solid var(--hair); }
.calnav__b:hover { background: var(--band); }
.calnav__b:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.calnav__today { font-weight: 700; }
.calnav__g { font-size: 1.375rem; line-height: 1; }
.calbar__title { font-size: 1.375rem; font-weight: 600; margin: 0; line-height: 1.25; font-variant-numeric: tabular-nums; }

.calviews { display: flex; align-items: center; gap: 10px; }
.calviews__grp.segbtn { padding: 0; background: var(--ui-surface, #fff); border-radius: 12px; }
.segbtn { display: inline-flex; border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; flex: none; background: var(--ui-surface, #fff); }
.segbtn__b {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px;
  font-size: var(--fs-body); font-weight: 600; color: var(--steel); text-decoration: none;
  background: var(--ui-surface, #fff); border-left: 1px solid var(--hair); white-space: nowrap;
}
.segbtn__b:first-child { border-left: 0; }
.segbtn__b:hover { color: var(--ink); background: var(--band); }
.segbtn__b.is-on { background: var(--accent); color: #fff; }
.segbtn__b:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.calspan { min-height: 44px; height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px;
           font-size: var(--fs-body); font-weight: 600; border-radius: 12px; }
.calspan__chev { font-size: 0.875rem; color: var(--steel); }

/* ⋯ More, beside New event. */
.calmore { gap: 8px; }
.calmore__g { font-size: 1.25rem; line-height: 1; }
.calmore__w { font-weight: 600; }

/* A line above the board: who is showing, what is past due. */
.calfilterline { margin: 0 0 14px; font-size: 1rem; color: var(--steel); }
.calfilterline b { color: var(--ink); font-weight: 600; }
.callate b { color: var(--amber); }
.calpage .linkish {
  border: 0; background: none; padding: 0; margin: 0; font: inherit; font-size: inherit;
  color: var(--ui-link, var(--accent)); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
  min-height: 44px; display: inline-flex; align-items: center;
}
.calempty { margin: 0 0 14px; font-size: var(--fs-body); color: var(--steel); }
.calempty b { color: var(--ink); font-weight: 600; }

/* ---- Tiles --------------------------------------------------------------
   `color` on the tile is the item's color; everything below reads it through
   currentColor — the bar down the left, the tint of a box. */
.calchip {
  display: flex; align-items: baseline; gap: 5px; font-size: var(--fs-badge); padding: 2px 6px 2px 7px;
  background: var(--ui-surface, #fff); border: 1px solid var(--hair); border-left: 3px solid var(--steel);
  border-radius: 4px; cursor: pointer; overflow: hidden; white-space: nowrap; min-height: 24px;
}
.calchip:hover, .calchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.calchip:focus-visible { outline-width: 3px; }
.calchip__time { color: var(--steel-lt); font-size: var(--fs-badge); flex: none; font-variant-numeric: tabular-nums; }
.calchip__label { overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.calchip--event { background: var(--ui-surface, #fff); }
.calchip--past { opacity: .55; }
/* Late is said by the word ("Past due") and its amber dot; the tile itself
   keeps its colour so a late ticket still reads as a ticket. */
.calchip--late .calchip__status { color: var(--amber); }

/* Status: a dot AND a word, in sentence case, never a shouting tag. */
.calchip__status {
  flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 0; background: none;
  font-size: var(--fs-badge); font-weight: 600; color: var(--steel); white-space: nowrap;
}
.calchip__status .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--steel-lt); }
.calchip__status .dot--ok { background: var(--green); }
.calchip__status .dot--info { background: var(--blue); }
.calchip__status .dot--warn { background: var(--amber); }
.calchip__status--warn { color: var(--amber); }
.calchip__warn { color: var(--amber); font-weight: 600; }

/* The two-line tile (Team week): when, with the status as a word, then what. */
.calchip.calchip--two { flex-direction: column; align-items: stretch; gap: 1px; padding: 4px 7px; white-space: nowrap; }
.calchip__line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.calchip.calchip--two .calchip__time { font-weight: 700; color: var(--ink); }
.calchip.calchip--two .calchip__label { font-size: var(--fs-label); line-height: 1.3; }
.calchip--two .calchip__status { margin-left: auto; }

/* A box on the canvas: absolutely placed, tinted with its color, a strong bar
   down the left, ink text — readable at arm's length. Never shorter than 56px
   (layout()). */
.calchip--box {
  position: absolute; margin: 0; overflow: hidden; z-index: 1; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: stretch; gap: 1px;
  background: color-mix(in srgb, currentColor 16%, var(--ui-surface, #fff));
  border: 0; border-left: 4px solid currentColor;
  outline: 1px solid #fff; outline-offset: -1px;
  border-radius: 6px; padding: 5px 8px; box-shadow: none; white-space: normal;
  container-type: inline-size;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .calchip--box { background: var(--band); }
}
.calchip--box:hover { background: color-mix(in srgb, currentColor 24%, var(--ui-surface, #fff)); box-shadow: none; z-index: 3; }
.calchip--box + .calchip--box { border-left-color: inherit; }
.calchip__head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; min-width: 0; }
.calchip__head b {
  font-size: var(--fs-label); line-height: 1.25; font-weight: 600; color: var(--ink);
  min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.calchip__row { font-size: var(--fs-label); line-height: 1.35; color: var(--steel);
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calchip__row.is-who { font-weight: 600; color: var(--ink-2); }
.calchip__when { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
.calchip__when > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.calchip__move { flex: none; height: 30px; min-height: 30px; padding: 0 8px; font-size: var(--fs-label); font-weight: 600;
                 border-radius: 8px; background: var(--ui-surface, rgba(255, 255, 255, .75)); }
.calchip__move::after { content: none; }
@media (pointer: coarse) { .calchip__move { height: 40px; min-height: 40px; } }
/* A box narrowed by an overlap keeps the dot and drops the word, then the button. */
@container (max-width: 170px) { .calchip__sw { display: none; } }
/* A week column at 1440px is about 170px: the title matters more than a
   second door to Move, which the keyboard, a right-click and the event form
   all still offer. */
@container (max-width: 200px) { .calchip__move { display: none; } }

/* Moving: a hand on anything that can be dragged; the ghost follows the pointer. */
.calchip.is-movable { cursor: grab; -webkit-touch-callout: none; touch-action: manipulation; }
.calchip.is-dragsrc { opacity: .4; }
.calchip.dragghost { position: fixed; z-index: 95; pointer-events: none; opacity: .92; box-shadow: 0 8px 24px rgba(16, 24, 32, .22); }
body.is-dragging-cal { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.caldrop.is-dropping { background: var(--tint); }

/* ---- The month ------------------------------------------------------------ */
.calmonth { background: var(--ui-surface, #fff); border: 1px solid var(--hair); border-radius: var(--r); overflow: hidden; }
.calmonth__head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--band); border-bottom: 1px solid var(--hair); }
.calmonth__head span { padding: 8px; font-size: var(--fs-badge); color: var(--steel); font-weight: 600; text-align: center; }
.calmonth__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calcell { min-height: 118px; border-top: 1px solid var(--hair); border-left: 1px solid var(--hair); padding: 5px 6px 6px;
           display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; }
.calcell:nth-child(7n+1) { border-left: 0; }
.calcell:hover { background: var(--band); }
.calcell--out { background: var(--paper); }
.calcell--out .calcell__num, .calcell--out .calcell__count { color: var(--steel-lt); }
.calcell--out .calchip { opacity: .6; }
.calcell__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 26px; }
.calcell__num { font-size: var(--fs-label); font-weight: 600; min-width: 26px; height: 26px;
                display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
                align-self: flex-start; font-variant-numeric: tabular-nums; }
.calcell--today .calcell__num { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; }
.calcell__count { font-size: var(--fs-badge); color: var(--steel-lt); font-variant-numeric: tabular-nums; }
.calcell__items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.calcell__more { align-self: flex-start; border: 0; background: none; padding: 0; margin: 0; font: inherit;
                 font-size: var(--fs-badge); font-weight: 600; color: var(--ui-link, var(--accent)); cursor: pointer;
                 min-height: 28px; white-space: normal; text-align: left; }
.calcell__more-w { white-space: nowrap; }
@media (max-width: 560px) { .calcell__more-w { display: none; } }
/* A month cell's tile: a solid line of its color, like the canvas boxes, so a
   month can be scanned for "where is the crimson" the same way a week can. */
.calmonth .calchip { background: color-mix(in srgb, currentColor 16%, var(--ui-surface, #fff)); border: 0; border-left: 3px solid currentColor;
                     border-radius: 4px; padding: 2px 6px; gap: 5px; min-height: 22px; }
@supports not (color: color-mix(in srgb, red 50%, blue)) { .calmonth .calchip { background: var(--band); } }
.calmonth .calchip .calchip__label { color: var(--ink); font-size: var(--fs-badge); flex: 1 1 auto; min-width: 0; }
.calmonth .calchip .calchip__time { color: var(--steel); }
.calmonth .calchip .calchip__status, .calday__allday .calchip .calchip__status,
.calweekc__cell .calchip .calchip__status, .calteam__cell .calchip .calchip__status { margin-left: auto; }
.calday__allday .calchip .calchip__label, .calweekc__cell .calchip .calchip__label,
.calteam__cell .calchip .calchip__label { flex: 0 1 auto; min-width: 0; }

/* ---- The day, as a canvas ---------------------------------------------- */
.calday { background: var(--ui-surface, #fff); border: 1px solid var(--hair); border-radius: var(--r); overflow: hidden; }
.calday__allday { padding: 8px; border-bottom: 1px solid var(--hair); display: flex; gap: 6px; flex-wrap: wrap; background: var(--band); }
.calday__allday .calchip { min-height: 32px; align-items: center; }
.calday__scroll { max-height: calc(100vh - 300px); overflow: auto; }
@supports (height: 1dvh) { .calday__scroll { max-height: calc(100dvh - 300px); } }
.calday__body { display: flex; align-items: stretch; }
.calday__body > .calcol { flex: 1; }

.calcol { position: relative; border-left: 1px solid var(--hair); min-width: 0; cursor: pointer; }
.callines { position: absolute; inset: 0; pointer-events: none; }
.calline { position: relative; border-bottom: 1px solid var(--hair); }
.calline:last-child { border-bottom: 0; }
.calline__half { position: absolute; left: 0; right: 0; top: 50%; border-bottom: 1px dashed var(--hair); opacity: .45; }
.calgutter { flex: none; width: 64px; position: sticky; left: 0; z-index: 5; background: var(--ui-surface, #fff); }
.calgutter__spacer { display: block; flex: none; width: 64px; }
.calgutter__h { font-size: var(--fs-badge); color: var(--steel-lt); text-align: right; padding: 2px 8px 0 0;
                border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); box-sizing: border-box; white-space: nowrap; }
/* Now: the one red thing — a 2px line, its dot, and the time in the gutter. */
.calnow { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--danger); z-index: 3; pointer-events: none; }
.calnow__dot { position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.calgutter__now { position: absolute; right: 6px; transform: translateY(-50%); z-index: 6; padding: 0 3px; border-radius: 4px;
                  background: var(--ui-surface, #fff); color: var(--danger); font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- The week: the same canvas, one scroller for every column ------------ */
.calweekc { border: 1px solid var(--hair); border-radius: var(--r); overflow: hidden; background: var(--ui-surface, #fff); }
.calweekc__scroll { max-height: calc(100vh - 260px); overflow: auto; }
@supports (height: 1dvh) { .calweekc__scroll { max-height: calc(100dvh - 260px); } }
.calweekc__track { min-width: 0; }
.calweekc--long .calweekc__track { min-width: max-content; }
.calweekc--long .calweekc__body > .calcol, .calweekc--long .calweekc__day, .calweekc--long .calweekc__cell { min-width: 150px; }
.calweekc__top { position: sticky; top: 0; z-index: 6; background: var(--band); }
.calweekc__head { display: flex; background: var(--band); border-bottom: 1px solid var(--hair); }
.calweekc__head > .calgutter__spacer { position: sticky; left: 0; z-index: 7; background: var(--band); }
.calweekc__day { flex: 1 1 0; min-width: 0; padding: 7px 8px; text-align: center; border-left: 1px solid var(--hair); cursor: pointer; min-height: 44px; }
.calweekc__day:hover { background: var(--ui-surface, #fff); }
.calweekc__day:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.calweekc__day b { font-size: var(--fs-badge); color: var(--steel); display: block; }
.calweekc__num { font-size: 1.1875rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.calweekc__day .sub { display: block; font-size: var(--fs-badge); color: var(--steel-lt); min-height: 13px; }
.calweekc__day.is-today .calweekc__num { color: #fff; background: var(--accent); border-radius: 999px; padding: 0 7px; display: inline-block; }
.calweekc__allday { display: flex; align-items: stretch; border-bottom: 1px solid var(--hair); background: var(--band); }
.calweekc__allday > .calgutter__spacer { position: sticky; left: 0; z-index: 5; background: var(--band); }
.calweekc__cell { flex: 1 1 0; min-width: 0; padding: 5px; border-left: 1px solid var(--hair); display: flex; flex-direction: column; gap: 4px; min-height: 36px; }
.calweekc__body { display: flex; align-items: stretch; }
.calweekc__body > .calcol { flex: 1 1 0; }

/* ---- Team day: a column per person, time down the page ------------------- */
.calteam { border: 1px solid var(--hair); border-radius: var(--r); overflow: hidden; background: var(--ui-surface, #fff); --calcolmin: 160px; }
.calteam__scroll { max-height: calc(100vh - 260px); overflow: auto; }
@supports (height: 1dvh) { .calteam__scroll { max-height: calc(100dvh - 260px); } }
.calteam__track { min-width: calc(64px + var(--calcols, 1) * var(--calcolmin)); }
.calteam__top { position: sticky; top: 0; z-index: 6; background: var(--ui-surface, #fff); }
.calteam__head { display: flex; background: var(--ui-surface, #fff); border-bottom: 1px solid var(--hair); }
.calteam__head > .calgutter__spacer { position: sticky; left: 0; z-index: 7; background: var(--ui-surface, #fff); }
.calteam__person { flex: 1 1 0; min-width: var(--calcolmin); display: flex; align-items: center; gap: 10px; padding: 12px 10px;
                   border-left: 1px solid var(--hair); background: var(--ui-surface, #fff); container-type: inline-size; }
.calteam__id { flex: 1; min-width: 0; }
.calteam__person b { display: block; font-size: var(--fs-body); font-weight: 600; line-height: 1.3; overflow-wrap: break-word; }
.calteam__person .sub { display: block; font-size: var(--fs-label); color: var(--steel); }
@container (max-width: 230px) { .calteam__person > .calav { display: none; } }
.calteam__allday { display: flex; align-items: stretch; border-bottom: 1px solid var(--hair); background: var(--band); }
.calteam__allday > .calgutter__spacer { position: sticky; left: 0; z-index: 5; background: var(--band); }
.calteam__cell { flex: 1 1 0; min-width: var(--calcolmin); padding: 5px; border-left: 1px solid var(--hair); display: flex; flex-direction: column; gap: 4px; min-height: 36px; }
.calteam__body { display: flex; align-items: stretch; }
.calteam__body > .calcol { flex: 1 1 0; min-width: var(--calcolmin); }
.calav { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
         font-size: 0.8125rem; font-weight: 700; letter-spacing: .02em; color: var(--ink);
         background: var(--av, var(--band)); }

/* ---- Team week: a row per person, the days across -------------------------- */
.calteamw { border: 1px solid var(--hair); border-radius: var(--r); overflow: hidden; background: var(--ui-surface, #fff); }
.calteamw__scroll { overflow: auto; }
.calteamw__days, .calteamw__row { display: grid; grid-template-columns: 180px repeat(var(--calcols, 7), minmax(132px, 1fr)); }
.calteamw__days { background: var(--band); border-bottom: 1px solid var(--hair); position: sticky; top: 0; z-index: 2; }
.calteamw__corner { display: block; }
.calteamw__day { padding: 7px 8px; text-align: center; border-left: 1px solid var(--hair); }
.calteamw__day b { display: block; font-size: var(--fs-badge); color: var(--steel); }
.calteamw__num { font-size: 1.125rem; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; }
.calteamw__day.is-today .calteamw__num { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; display: inline-block; }
.calteamw__row { border-top: 1px solid var(--hair); }
.calteamw__row:first-of-type { border-top: 0; }
.calteamw__who { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; align-content: start; align-items: center; padding: 10px; min-width: 0; }
.calteamw__who b { font-size: var(--fs-body); font-weight: 600; line-height: 1.3; }
.calteamw__who .sub { grid-column: 2; font-size: var(--fs-label); color: var(--steel); }
.calteamw__cell { min-height: 74px; padding: 5px; border-left: 1px solid var(--hair); display: flex; flex-direction: column; gap: 4px; min-width: 0; cursor: pointer; }
.calteamw__cell:hover { background: var(--band); }
.calteamw__cell.is-today { background: color-mix(in srgb, var(--accent) 4%, var(--ui-surface, #fff)); }
.calteamw .calchip { background: color-mix(in srgb, currentColor 16%, var(--ui-surface, #fff)); border: 0; border-left: 3px solid currentColor; }
@supports not (color: color-mix(in srgb, red 50%, blue)) { .calteamw .calchip { background: var(--band); } }

/* ---- A phone's day: the list ----------------------------------------------- */
.callist { display: flex; flex-direction: column; gap: 14px; }
.callist__grp { margin: 0; }
.callist__h { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: var(--fs-body); font-weight: 600; }
.callist__h .sub { margin-left: auto; font-size: var(--fs-label); font-weight: 500; color: var(--steel); }
.callist__rows { border: 1px solid var(--hair); border-radius: var(--r); background: var(--ui-surface, #fff); overflow: hidden; }
.calrow { display: flex; align-items: stretch; min-height: 64px; border-left: 4px solid var(--calrow-tone, var(--hair)); background: var(--ui-surface, #fff); }
.calrow + .calrow { border-top: 1px solid var(--hair); }
.calrow--event { --calrow-tone: var(--steel-lt); }
.calrow.is-late .calchip__status { color: var(--amber); }
.calrow__time { flex: none; width: 78px; padding: 12px 0 12px 12px; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.calrow__time b { font-size: 1.25rem; font-weight: 600; line-height: 1.15; color: var(--ink); }
.calrow__time span { font-size: 0.8125rem; font-weight: 600; color: var(--steel-lt); }
.calrow__open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 8px; margin: 0;
                border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.calrow__who { font-size: var(--fs-body); font-weight: 600; line-height: 1.3; }
.calrow__what { font-size: var(--fs-label); color: var(--steel); line-height: 1.35; }
.calrow > .movebtn { align-self: center; flex: none; margin: 0 10px 0 0; }

/* ---- The slot dialog, Who shows, Customize, the event form ---------------- */
.calslot { display: flex; flex-direction: column; gap: 10px; }
.calslot__q { margin: 0 0 4px; font-size: var(--fs-body); color: var(--steel); }
.calslot__b { width: 100%; justify-content: center; }

.calwho { display: flex; flex-direction: column; gap: 0; }
.calwho__row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 4px; border-top: 1px solid var(--hair); cursor: pointer; font-size: var(--fs-body); }
.calwho__row:first-child { border-top: 0; }
.calwho__row input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.calwho__name { font-weight: 600; }
.calwho__row .sub { color: var(--steel); font-size: var(--fs-label); margin-left: auto; }

.calcustom { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.calcustom__label { display: block; font-size: var(--fs-label); color: var(--steel); font-weight: 600; margin: 14px 0 8px; }
.calcustom__label:first-child { margin-top: 0; }
.calcustom__pills { margin-bottom: 0; }
.calcustom__checks { display: flex; flex-direction: column; gap: 0; }
.calcustom__check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--fs-body); cursor: pointer; }
.calcustom__check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.calcustom__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.calcustom__legend { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.calcustom__key { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-label); color: var(--steel); }
.calcustom__key i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.calswatches { display: flex; flex-wrap: wrap; gap: 8px; }
.calswatch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px;
             border: 1px solid var(--hair); background: var(--ui-surface, #fff); color: var(--ink-2); font: inherit; font-size: var(--fs-label); font-weight: 600; cursor: pointer; }
.calswatch:hover { background: var(--band); }
.calswatch.is-on { border-color: var(--sw); background: color-mix(in srgb, var(--sw) 12%, var(--ui-surface, #fff)); color: var(--ink); }
@supports not (color: color-mix(in srgb, red 50%, blue)) { .calswatch.is-on { background: var(--band); } }
.calswatch__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sw); flex: none; }
.calform__check { justify-content: flex-end; }
.calform__check .check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--fs-body); cursor: pointer; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 500; }
.calform__check .check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

/* ---- Phones ----------------------------------------------------------------- */
@media (max-width: 700px) {
  .calnav__w { display: none; }
  .calbar__title { font-size: 1.1875rem; flex: 1 1 100%; order: 3; }
  .calgutter, .calgutter__spacer { width: 52px; }
  .calgutter__h { font-size: 0.75rem; padding-right: 5px; }

  /* Keep the two-week board's intentional horizontal scroll inside the board.
     Its content may be wider than a phone; the page and toolbar must not be. */
  .calpage, .calbar, .calviews, .calweekc { min-width: 0; max-width: 100%; }
  .calpage { width: 100%; }
  .calbar { width: 100%; gap: 8px; }
  .calbar__spacer { display: none; }
  .calviews { margin-left: auto; }
  .calspan { min-width: 0; }
  .calweekc__scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; }
  .calweekc__track { width: 100%; min-width: 0; }
  .calweekc--long .calweekc__track { width: max-content; min-width: max-content; }
  .calweekc__head, .calweekc__allday, .calweekc__body { min-width: 0; }

  /* A ticket/status word may wrap in a narrow line chip; keep its dot visible. */
  .calmonth .calchip__status, .calday__allday .calchip__status,
  .calweekc__cell .calchip__status, .calteam__cell .calchip__status,
  .calteamw__cell .calchip__status {
    flex: 0 1 auto; min-width: 0; white-space: normal;
  }

  /* The event editor uses the shared modal, but its grid and controls need
     shrinkable tracks on a narrow viewport. */
  .modal .calform { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .modal .calform > * { min-width: 0; }
  .modal .calform .field { min-width: 0; }
  .modal .calform input, .modal .calform select, .modal .calform textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
}
@media (prefers-reduced-motion: no-preference) {
  .calchip { transition: outline-color var(--t-quick, .12s) ease, background-color var(--t-quick, .12s) ease; }
}
