/* The dashboards' own calendar for picking a date (assets/js/datepicker.js; the founder's motion choices, October 30, 2026).
   Loaded only by the two dashboards, which are always Lamplight, so it reads the --ll-* tokens (lamplight/site.css)
   and the dashboards' cell tokens (--dd-*, lamplight/dash.css).
   - The box stays the browser's date box, typeable as before. Its own picker icon is hidden, and a calendar button
     (a drawn calendar, 48 by 44px) sits at its end, where the icon was.
   - The calendar is a lit panel under the box, like the open list of a dropdown: the month in Caslon Text, brass
     weekday letters, the days as quiet tiles, today ringed in amber, the picked day filled amber (as the tutor's
     breaks calendar), the days of the months around it dimmed, and days that can't be picked faded.
   - Pointing at a day lights it (a hover state, set at once).
   - The calendar light (the founder's choice, October 30, 2026; zvCalLight in datepicker.js): on the day grids of this
     calendar, the tutor's Month at a glance, Breaks calendar and weekly hours (November 3, 2026, his "the same
     highlighting lamp style as all the others") and the admin's Master calendar, a soft lamp light follows a mouse or pen,
     like the calendar in the Windows taskbar: the edges of the days near the pointer glow amber, fading out about 84px
     away, and the day under the pointer gets a faint lit fill. Each day draws it on its own ::after, behind the day's
     words and over its edge, so today's ring, the picked day, the marks and focus rings all stay as they are. Only
     where the screen can hover with a fine pointer; it fades away when the pointer leaves (at once with reduced
     motion); off in Windows high contrast.
   - Motion: only after a press, it rises into place over 0.5 seconds on the even ease-out curve, and it sinks away
     the same way when it closes (Motion, below). Reduced motion: it is simply there, and simply goes.
   - Windows high contrast: system colours; the days that can be picked are boxed, the picked one in Highlight,
     today with a thicker edge. */

/* ============================== The box and its button ============================== */
.dp{position:relative;}
.dp-input{padding-inline-end:52px;}
/* The browser's own picker icon: the calendar button takes its place */
.dp-input::-webkit-calendar-picker-indicator{display:none;}
.dp-btn{
  position:absolute; inset-block:0; inset-inline-end:0; width:48px; min-height:44px;
  display:grid; place-items:center; margin:0; padding:0; border:0; border-radius:0 var(--r-field) var(--r-field) 0;
  background:transparent; color:var(--ll-ink-2); cursor:pointer; -webkit-tap-highlight-color:transparent;
}
/* a soft key inside the box's end, so the box's own edge stays whole */
.dp-btn::before{content:""; position:absolute; inset:6px 6px 6px 4px; border-radius:var(--r-btn-sm); background:transparent; transition:background-color 150ms ease;}
.dp-btn .i{position:relative; width:22px; height:22px;}
.dp-btn .dp-dots{stroke-width:2.4;}
.dp-btn[aria-expanded="true"]{color:var(--ll-amber);}
.dp-btn[aria-expanded="true"]::before{background:var(--btn2-bg);}
@media (hover:hover) and (pointer:fine){
  .dp-btn:hover{color:var(--ll-amber-2);}
  .dp-btn:hover::before{background:var(--btn2-bg-h);}
}
/* the focus ring stays inside the box's end */
.dp-btn:focus-visible{outline-offset:-6px;}

/* ============================== The date in words ============================== */
/* Under the box (datepicker.js, design audit, October 31, 2026): "Tuesday, November 3", since the box shows the
   browser's own order ("11/03/2026" on most computers), which in Ontario can read as 11 March */
.dp-words{margin:6px 0 0; font-size:0.9375rem; line-height:1.4; color:var(--ll-ink-2); font-variant-numeric:tabular-nums;}
/* A row that lines its fields and buttons up along their bottoms (Hours and pay's From and To on tablets and
   computers): the words hang under the box (one line, its 27px taken back by the negative margin), so the buttons
   stay level with the box, and the row keeps that room under it, and between its lines when it wraps
   (!important: a row that sets its gap on the tag itself) */
.hstack > .field > .dp-words{margin-bottom:-27px; white-space:nowrap;}
.hstack:has(> .field > .dp-words:not([hidden])){padding-bottom:27px; row-gap:37px !important;}
@media (min-width:721px){
  .pay-filters > .field > .dp-words{margin-bottom:-27px; white-space:nowrap;}
  .pay-filters:has(> .field > .dp-words:not([hidden])){padding-bottom:27px; row-gap:37px;}
}

/* ============================== The calendar ============================== */
.dp-pop{
  position:absolute; z-index:30; top:calc(100% + 8px); left:0;
  width:min(336px, calc(100vw - 32px)); padding:12px 12px 14px;
  border:1px solid var(--ll-line-2); border-radius:16px;
  background:var(--ll-panel-bg); background-color:var(--ll-panel); color:var(--ll-paper);
  box-shadow:var(--ll-panel-depth);
}
.dp-pop .cal-head{margin-bottom:6px;}
.dp-title{font-family:var(--ll-serif); font-weight:400; font-size:1.1875rem; letter-spacing:-0.004em; color:var(--ll-paper); text-align:center;}
.dp-grid{display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:4px;}
.dp-pop .cal-dow{color:var(--ll-brass); font-size:0.875rem;}
.dp-day{
  position:relative; display:grid; place-items:center; width:100%; min-width:0; height:44px; margin:0; padding:0;
  border:1px solid transparent; border-radius:var(--r-btn-sm);
  background:var(--dd-cell); color:var(--ll-paper); font:400 1rem/1 var(--f); font-variant-numeric:tabular-nums; cursor:pointer;
}
/* the tap area reaches into the 4px gaps */
.dp-day::before{content:""; position:absolute; inset:-2px;}
.dp-day:focus-visible{outline-offset:2px;}
.dp-day.is-other{background:transparent; color:var(--ll-ink-3);}
.dp-day[aria-current="date"]{border-color:var(--ll-amber); box-shadow:inset 0 0 0 1px var(--ll-amber);}
.dp-day[aria-pressed="true"]{background:var(--ll-amber); border-color:var(--ll-amber); color:var(--btn-fg); font-weight:600; box-shadow:var(--pick-depth);}
.dp-day:disabled{background:transparent; border-color:transparent; box-shadow:none; color:var(--ll-ink-3); opacity:.7; cursor:default;
  text-decoration:line-through; text-decoration-thickness:1px;}   /* 4.9:1 on the panel, readable (audit F-x2-13: .45 gave 2.7:1); no box and the line say it can't be picked */
.dp-day[aria-current="date"]:disabled{border-color:var(--ll-line-2);}   /* today, when it can't be picked: a faint ring */
@media (hover:hover) and (pointer:fine){
  .dp-day:not(:disabled, [aria-pressed="true"]):hover{background:var(--btn2-bg-h); border-color:var(--ll-amber-2); color:var(--ll-paper);}
}

/* ============================== The calendar light ============================== */
/* Shared by the day grids (zvCalLight marks each grid .cal-light, and .is-lit while a mouse or pen is over it): the
   date picker, the tutor's Month at a glance and Breaks calendar (.cal-day) and the admin's Master calendar.
   Each day's ::after covers the day's whole box, edge included, and sits behind its words (the day is isolated, so
   z-index -1 stays inside it). Its one picture is a round lamp-amber light centred on the pointer, the pointer's
   place in the grid less the day's own (--light-x minus --light-cx), fading to nothing 84px out. A mask shows it
   only on the day's 1px edge, plus, on the day under the pointer, a faint share of it inside (--light-fill). */
@media (hover:hover) and (pointer:fine){
  .cal-light > :is(.dp-day, .month-cell, .acal-cell, .cal-day):not(.blank, .is-blank){isolation:isolate;}
  .cal-light > :is(.dp-day, .month-cell, .acal-cell, .cal-day):not(.blank, .is-blank)::after{
    content:""; position:absolute; inset:-1px; z-index:-1; padding:2px; border-radius:inherit; pointer-events:none;
    background:radial-gradient(circle 84px at calc(var(--light-x, -200px) - var(--light-cx, 0px)) calc(var(--light-y, -200px) - var(--light-cy, 0px)), var(--ll-amber-2), transparent);
    -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite:xor;
    mask:linear-gradient(rgb(0 0 0 / calc(1 - var(--light-fill, 0))) 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite:exclude;
    opacity:0;
  }
  .cal-light.is-lit > :is(.dp-day, .month-cell, .acal-cell, .cal-day):not(.blank, .is-blank)::after{opacity:1;}
  /* the day under the pointer, when it can be pressed: a faint lit fill too */
  .cal-light.is-lit > :is(.dp-day, .month-cell, .acal-cell, .cal-day):is(button):not(.blank, .is-blank, :disabled):hover::after{--light-fill:.18;}
}

/* ============================== Motion ============================== */
/* It rises 8px into place as it fades in, only after the press that opens it (it is hidden when a page loads) */
@keyframes dp-rise{from{opacity:0; transform:translateY(8px);}}
/* Closing (founder, October 30, 2026: "add a bit of motion for them ... like when closing"): it sinks 8px as it fades,
   the way it came, over the same 0.5 seconds, however it closes (a day picked, Escape, the button, a press outside).
   datepicker.js marks it hidden at once (and inert, so nothing in it can be pressed or reached meanwhile; the focus
   goes back at once); the browser keeps it drawn (display, allow-discrete) until the motion ends. Where it can, the
   opening is a transition too (@starting-style), so a calendar opened again while it closes turns back from where it
   is. A browser that can't keep it drawn keeps the opening rise and closes at once; so does reduced motion. */
.dp-pop[hidden]{pointer-events:none;}
@media (prefers-reduced-motion: no-preference){
  .dp-pop:not([hidden]){animation:dp-rise var(--motion, 500ms) var(--ease-motion, cubic-bezier(.33, 1, .68, 1));}
  @supports (transition-behavior: allow-discrete){
    .dp-pop:not([hidden]){animation:none;}
    .dp-pop{transition:opacity var(--motion, 500ms) var(--ease-motion, cubic-bezier(.33, 1, .68, 1)), transform var(--motion, 500ms) var(--ease-motion, cubic-bezier(.33, 1, .68, 1)), display var(--motion, 500ms) allow-discrete;}
    .dp-pop[hidden]{opacity:0; transform:translateY(8px);}
    @starting-style{ .dp-pop:not([hidden]){opacity:0; transform:translateY(8px);} }
  }
  /* The calendar light comes up and fades away softly as the pointer comes and goes (where it is moves at once) */
  .cal-light > :is(.dp-day, .month-cell, .acal-cell, .cal-day):not(.blank, .is-blank)::after{transition:opacity 240ms ease;}
}

/* ============================== Windows high contrast ============================== */
/* The fills and shadows are dropped there: the panel keeps an edge, a day that can be picked is a boxed button and
   one that can't is plain grey, today has a thicker edge, and the picked day is the system's highlight */
@media (forced-colors: active){
  .dp-pop{border-color:CanvasText;}
  .dp-btn{color:ButtonText;}
  .dp-day{border-color:ButtonText;}
  .dp-day:disabled{border-color:Canvas; color:GrayText; opacity:1;}
  .dp-day[aria-current="date"]{border:2px solid ButtonText;}
  .dp-day[aria-current="date"]:disabled{border-color:GrayText;}
  .dp-day[aria-pressed="true"]{forced-color-adjust:none; background:Highlight; border-color:Highlight; color:HighlightText;}
  .dp-day:not(:disabled):hover{border-color:Highlight;}
  .cal-light > :is(.dp-day, .month-cell, .acal-cell, .cal-day)::after{display:none;}   /* no calendar light */
}
