/* The calendar works like Apple Calendar (plan 58, calendar.js + calendar-apple.js), in Rndez's own look and tokens.
   Loaded after app.css and calendar-parts.css: the rules here win over the older toolbar's. Rndez is light only. */

/* ---------- computers and iPads: one toolbar row, the date and ‹ Today › under it ---------- */
.cal-toolbar.apple { display: grid; gap: 10px; margin: 2px 0 10px; }
.cal-toolbar.apple .cal-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.cal-toolbar.apple .cal-row-left { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cal-toolbar.apple .cal-row-right { display: flex; justify-content: flex-end; min-width: 0; }
.cal-toolbar.apple .icon-btn { position: relative; width: 34px; height: 34px; min-height: 34px; border-radius: var(--r-inner); background: none; color: var(--ink); }
.cal-toolbar.apple .icon-btn svg { width: var(--icon-m); height: var(--icon-m); }
@media (hover: hover) { .cal-toolbar.apple .icon-btn:hover { background: var(--fill); } }
.cal-toolbar.apple .icon-btn:active { background: var(--fill-2); }
.cal-toolbar.apple .cal-side-toggle[aria-pressed="true"] { background: var(--fill); }
.cal-toolbar.apple .cal-add { display: inline-flex; align-items: center; justify-content: center; } /* app.css hides the old + under 768 px */
/* The 34 px segmented switch (.seg): 30 px segments to the eye, 44 px to a finger (::after). */
.cal-toolbar.apple .cal-modes { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 34px; }
.cal-toolbar.apple .cal-modes button { position: relative; min-width: 76px; min-height: 30px; height: 30px; padding: 0 14px; font-weight: 500; }
.cal-toolbar.apple .cal-modes button[aria-pressed="true"] { font-weight: 600; }
.cal-toolbar.apple .cal-modes button::after, .cal-toolbar.apple .icon-btn::after { content: ""; position: absolute; inset: -5px 0; }
/* Search: a field on the right, like Apple's. */
.cal-search { display: flex; align-items: center; gap: 6px; width: clamp(140px, 20vw, 240px); height: 30px; padding: 0 10px; border-radius: var(--r-inner); background: var(--fill); cursor: text; }
.cal-search-icon { display: inline-flex; flex: none; color: var(--fade); }
.cal-search-icon svg { width: 15px; height: 15px; }
.cal-search input { flex: 1 1 auto; width: 100%; min-width: 0; height: 28px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; font-size: var(--t-subhead); outline: 0; }
.cal-search:focus-within { box-shadow: 0 0 0 2px var(--focus); }
.cal-toolbar.apple .cal-row2 { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-width: 0; }
.cal-toolbar.apple .cal-title-wrap { flex: 1 1 auto; min-width: 0; }
.cal-toolbar.apple .cal-title { display: block; max-width: 100%; }
.cal-toolbar.apple .cal-title-main { display: block; font-size: var(--t-title1); line-height: 1.12; }
.cal-toolbar.apple .cal-nav { flex: none; margin-bottom: 2px; }
.cal-toolbar.apple .cal-nav .icon-btn { width: 30px; height: 30px; min-height: 30px; }
.cal-toolbar.apple .cal-nav .cal-today { height: 30px; min-height: 30px; padding: 0 12px; border-radius: var(--r-inner); background: var(--fill); font-size: var(--t-subhead); font-weight: 600; }
@media (pointer: coarse) {
  .cal-toolbar.apple .icon-btn, .cal-toolbar.apple .cal-nav .icon-btn { width: 44px; height: 44px; }
  .cal-toolbar.apple .icon-btn::after { content: none; }
  .cal-toolbar.apple .cal-nav .cal-today { height: 36px; }
}
@media (max-width: 900px) {
  .cal-toolbar.apple .cal-modes button { min-width: 0; padding: 0 10px; }
  .cal-search { width: clamp(110px, 18vw, 180px); }
  .cal-toolbar.apple .cal-title-main { font-size: var(--t-title2); }
}

/* ---------- the side bar: the small month and the calendars ---------- */
.cal-shell.has-side { grid-template-columns: 232px minmax(0, 1fr); }
.cal-side { gap: 8px; }
.cal-side-loc select { width: 100%; }
.cal-list { display: grid; gap: 1px; }
.cal-list-head { margin: 12px 0 4px; font-size: var(--t-caption1); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fade); }
.cal-cal { display: flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 2px 0 4px; border-radius: var(--r-inner); }
@media (hover: hover) { .cal-cal:hover { background: var(--fill); } }
.cal-cal-row { flex: 1 1 auto; display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 30px; cursor: pointer; }
.cal-tick { appearance: none; -webkit-appearance: none; display: grid; place-items: center; flex: none; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; border: 2px solid var(--c, var(--ink)); border-radius: 4px; background: none; cursor: pointer; }
.cal-tick:checked { background: var(--c, var(--ink)); }
.cal-tick:checked::after { content: ""; width: 8px; height: 4px; margin-top: -2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.cal-tick:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cal-cal-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-subhead); }
.cal-cal.off .cal-cal-name { color: var(--fade); }
.cal-dot-btn { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; }
.cal-dot { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ink)); }
@media (hover: hover) { button.cal-dot-btn:hover { background: var(--fill-2); } }
button.cal-dot-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.cal-side-foot { display: grid; justify-items: start; gap: 0; margin-top: 12px; padding-top: 8px; border-top: .5px solid var(--sep); }
.cal-side-link { min-height: 28px; padding: 4px 0; font-size: var(--t-footnote); color: var(--fade); text-align: left; text-decoration: none; }
@media (hover: hover) { .cal-side-link:hover { color: var(--ink); text-decoration: underline; } }
/* An iPad standing up (under 1100 px): the side bar floats over the grid, under the toolbar. */
.cal-shell.has-side.side-over { display: flex; position: relative; }
.cal-shell.side-over > .cal-side { position: absolute; left: 0; bottom: 0; z-index: 30; width: 260px; padding: 12px 14px; border-radius: var(--r-card); background: var(--solid-side); box-shadow: var(--shadow-lift); }

/* The calendars' colours: twelve for people (none red; s6–s11 dark enough for white initials) and the other calendars. */
.s10 { --c: #2d6a8f; } .s11 { --c: #a3519b; }
.sres { --c: #7a5c3e; } .sroom { --c: #4a6670; } .sclass { --c: #3f4a8a; } .soff { --c: #7a7d76; } .ssquare { --c: #34373b; }
/* A person's colour, picked by the owner: twelve dots. */
.colour-pick { display: grid; grid-template-columns: repeat(6, 40px); gap: 6px; padding: 4px 0 8px; }
.colour-swatch { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.colour-swatch i { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--c); }
.colour-swatch.on { box-shadow: inset 0 0 0 2px var(--ink); }
@media (hover: hover) { .colour-swatch:hover { background: var(--fill); } }
.colour-pop { width: min(300px, calc(100vw - 16px)) !important; }

/* ---------- picking, opening, the edges ---------- */
/* One click picks a booking, like Apple's selected event: filled with its colour. A double-click opens it. */
.bk.selected { z-index: 5; background: color-mix(in srgb, var(--c, var(--faint)) 46%, var(--bg)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c, var(--faint)) 70%, transparent); }
.bk.selected.clash { box-shadow: 0 0 0 2px var(--red); }
/* The top edge changes the start, the bottom edge the end. */
.bk-grip.top { top: 0; bottom: auto; height: 6px; }
.bk-grip.top::after { top: 2px; bottom: auto; }
@media (pointer: coarse) { .bk-grip.top { height: 12px; } }
.bk.from-top .drag-time { top: -24px; bottom: auto; }

/* Week shows every calendar together now: a narrow card puts its time on one line and the name under it (never a
   time with no name), and leaves the service to the tooltip and the booking. */
@container (max-width: 140px) {
  .is-week .bk.l2 > .bk-time, .is-week .bk.l2 > b { grid-column: 1 / -1; }
  .is-week .bk.l2 > .bk-what { display: none; }
}

/* ---------- the all-day row under the heads (Day and Week) ---------- */
.cal-headbox { position: sticky; top: 0; z-index: 7; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.cal-headbox > .cal-head { position: static; }
.cal-allday { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 2px; min-height: 22px; padding: 2px 3px; border-left: 1px solid var(--line-ink); border-bottom: 1px solid var(--line-ink); cursor: copy; }
.cal-allday-item { display: block; max-width: 100%; padding: 1px 6px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-caption2); font-weight: 600; line-height: 16px; background: rgba(0, 0, 0, .08); color: color-mix(in srgb, var(--ink) 80%, transparent); }
.cal-allday-item.off { background: color-mix(in srgb, var(--c, #7a7d76) 20%, var(--bg)); border-left: 3px solid var(--c, #7a7d76); }
.cal-corner { display: flex; align-items: flex-end; justify-content: flex-end; }
.cal-allday-word { padding: 0 6px 5px 0; font-size: max(10px, .625rem); font-weight: 600; color: var(--fade); white-space: nowrap; }

/* ---------- Month on a computer: one-line bookings and "+3 more" ---------- */
.month-wrap.apple .month-cell { gap: 2px; padding: 4px 4px 4px; cursor: default; }
.month-wrap.apple .month-top { justify-content: flex-start; gap: 6px; }
.month-wrap.apple .month-cell .num { cursor: pointer; }
@media (hover: hover) { .month-wrap.apple .month-cell .num:hover { background: var(--fill-2); } .month-wrap.apple .month-cell.picked .num:hover { background: var(--ink); } .month-wrap.apple .month-cell.today .num:hover { background: var(--red); } }
.month-wrap.apple .month-items { gap: 1px; }
.month-wrap.apple .month-item { width: 100%; min-height: 19px; padding: 1px 4px; border-radius: 4px; text-align: left; font-size: var(--t-caption1); line-height: 1.35; cursor: default; }
@media (hover: hover) { .month-wrap.apple .month-item:hover { background: color-mix(in srgb, var(--c, var(--faint)) 16%, transparent); } }
.month-wrap.apple .month-item.selected { background: var(--c, var(--ink)); color: #fff; }
.month-wrap.apple .month-item.selected .month-item-time { color: rgba(255, 255, 255, .86); }
.month-wrap.apple .month-item.selected > i { background: #fff; }
.month-wrap.apple .month-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; }
.month-wrap.apple .month-more { justify-self: start; padding: 1px 4px; border-radius: 4px; text-align: left; }
@media (hover: hover) { .month-wrap.apple .month-more:hover { background: var(--fill); color: var(--ink); } }
.month-wrap.apple .month-cell.outside { cursor: default; }
.month-wrap.apple .month-cell.outside .num { color: color-mix(in srgb, var(--ink) 45%, transparent); }

/* Month on a phone too: today is the red circle, the picked day the ink circle (like the strip and Apple's). */
/* (This replaces CAL-UX-05's "today never red": plan 58 copies Apple, and Paul's mockup has today in red.) */
.month-cell.today .num { background: var(--red); color: #fff; box-shadow: none; }
.month-cell.picked:not(.today) .num { background: var(--ink); color: var(--bg); }
.month-cell.today.picked .num { background: var(--red); color: #fff; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--red); }

/* ---------- Year: 12 small months ---------- */
.cal.cal-year { border-top: 0; overflow: auto; }
.year-wrap { padding: 6px 2px 28px; }
.year-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 34px; }
@media (max-width: 1180px) { .year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.year-month { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 0; text-align: left; color: var(--ink); }
.year-name { justify-self: start; padding: 2px 4px; margin-left: -4px; border-radius: 6px; font-family: var(--display); font-stretch: 112%; font-size: var(--t-headline); font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.year-month.this-month .year-name { color: var(--today-text); }
@media (hover: hover) { button.year-name:hover { background: var(--fill); } }
.year-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; justify-items: center; }
.year-dow { padding-bottom: 2px; font-size: max(10px, .625rem); font-weight: 600; color: color-mix(in srgb, var(--ink) 60%, transparent); }
.year-day { position: relative; display: grid; place-items: center; width: 100%; max-width: 30px; aspect-ratio: 1; border-radius: 50%; font-size: var(--t-caption1); font-variant-numeric: tabular-nums; color: var(--ink); }
.year-day.past { color: color-mix(in srgb, var(--ink) 55%, transparent); }
.year-day.has { font-weight: 600; color: var(--ink); }
.year-day.has::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 70%, transparent); }
.year-day.on:not(.today) { box-shadow: inset 0 0 0 1.5px var(--ink); }
.year-day.today { background: var(--red); color: #fff; font-weight: 600; }
.year-day.today::after { background: #fff; }
@media (hover: hover) { button.year-day:not(.today):hover { background: var(--fill-2); } }
button.year-day:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }

/* ---------- Quick Event (the +) ---------- */
.quick-event { display: grid; gap: 8px; }
.quick-input { width: 100%; }
.quick-said { min-height: 1.3em; margin: 0; }
.quick-actions { display: flex; justify-content: flex-end; }
.quick-pop { width: min(380px, calc(100vw - 16px)) !important; }

/* ---------- iPhone: "‹ October", the list, search and +; the strip; the day's title; Today · Calendars · Inbox ---------- */
.cal-toolbar.apple-phone { display: grid; gap: 0; margin: 0 0 2px; padding-top: 4px; } /* no pull-up: the view clips what goes above it (capsules cut flat, 2026-10-18) */
.cal-ptop { display: flex; align-items: center; min-height: 44px; margin: 0 -10px 0 -8px; }
.cal-ptop .grow { flex: 1 1 auto; }
.cal-zoom-out { display: inline-flex; align-items: center; gap: 0; min-height: 44px; padding: 0 8px 0 0; color: var(--today-text); font-size: var(--t-body); font-weight: 500; }
.cal-zoom-out[hidden] { display: none; }
.cal-zoom-mark { display: inline-flex; }
.cal-zoom-mark svg { width: 24px; height: 24px; stroke-width: 2.2; }
.cal-ptop .icon-btn { width: 44px; height: 44px; background: none; color: var(--ink); }
.cal-ptop .icon-btn svg { width: 22px; height: 22px; }
.cal-ptop .cal-list-btn.on svg { padding: 3px; border-radius: 7px; background: var(--ink); color: var(--bg); width: 28px; height: 28px; }
.cal-toolbar.apple-phone .cal-strip { margin: 0 0 4px; }
.cal-ptitle { min-width: 0; padding: 0 0 2px; }
.cal-toolbar.apple-phone .cal-title { display: flex; align-items: center; max-width: 100%; min-height: 44px; margin: 0; padding: 0; }
.cal-toolbar.apple-phone .cal-title-main { display: block; font-size: var(--t-title3); line-height: 1.2; }
@media (max-height: 500px) and (pointer: coarse) { .cal-toolbar.apple-phone .cal-strip { display: none; } }
/* The bottom bar sits above the dock (--dock-space holds the dock and the home bar), never under it. */
.cal-bottom { display: flex; align-items: center; justify-content: space-between; flex: none; margin: 0 -6px var(--dock-space, calc(96px + env(safe-area-inset-bottom))); padding: 0; border-top: .5px solid var(--sep); }
.cal-bottom button { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; color: var(--today-text); font-size: var(--t-body); font-weight: 500; }
.cal-bottom button:active { opacity: .6; }
.cal-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9999px; background: var(--red); color: #fff; font-size: var(--t-caption2); font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-badge[hidden] { display: none; }
/* The grid ends above the bottom bar now (it no longer runs under the dock): a small end, not the dock's room. */
@media (max-width: 767px), (max-height: 500px) and (pointer: coarse) {
  .cal-main.has-bottom .cal { scroll-padding-bottom: 8px; }
  .cal-main.has-bottom .cal-end { height: 16px; }
  .cal-main.has-bottom :is(.month-wrap, .list-wrap, .year-wrap), .cal-main.has-bottom .cal > .empty, .cal-main.has-bottom .cal.all-list { padding-bottom: 16px; }
  .year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; }
  .year-name { font-size: var(--t-subhead); }
  .year-days { row-gap: 1px; }
  .year-dow { font-size: 8px; }
  .year-day { max-width: 16px; font-size: 9px; font-weight: 500; }
  .year-day.has { font-weight: 600; }
  .year-day.has::after { content: none; }
  .year-day.has:not(.today) { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
  .year-month:active { opacity: .7; }
}
/* The Calendars sheet. */
.shade .cal-list { margin-bottom: 12px; }
.shade .cal-cal { min-height: 44px; }
.shade .cal-cal-row { min-height: 44px; }
.cal-sheet-week { margin-bottom: 12px; }

/* ---------- ⌘+ / ⌘–: the calendar's text a step bigger or smaller (cal.textSize), only while the calendar is open ---------- */
html[data-cal-text="-2"]:has(.view.cal-view) { font-size: 75%; }
html[data-cal-text="-1"]:has(.view.cal-view) { font-size: 84.375%; }
html[data-cal-text="1"]:has(.view.cal-view) { font-size: 103.125%; }
html[data-cal-text="2"]:has(.view.cal-view) { font-size: 112.5%; }
html[data-cal-text="3"]:has(.view.cal-view) { font-size: 121.875%; }
html[data-cal-text="4"]:has(.view.cal-view) { font-size: 131.25%; }

/* ---------- ⌘P: the calendar on paper ---------- */
@media print {
  .side, .nav, .top, .fab, .cal-side, .cal-bottom, .cal-toolbar .cal-row, .cal-nav, .cal-ptop, .cal-strip, .toast, .shade { display: none !important; }
  .view.cal-view { height: auto !important; overflow: visible !important; padding: 0 !important; }
  .cal-shell, .cal-shell.has-side { display: block !important; }
  .cal-main > .cal { flex: none; height: auto; overflow: visible; border: 0; }
  .cal-headbox, .cal-corner, .cal-gutter { position: static; }
}

/* =====================================================================================================================
   Apple Calendar details (plan 58, 2026-10-17, from Paul's iPhone next to Apple's): one font, capsules, the strip,
   the date line, the hour column, the cards, the now pill, Month like a Year month, the Year's first scroll.
   Every colour new here is a token below, so a dark theme can redefine them in one place later. Rndez stays light:
   no dark theme is turned on (Paul has not decided; plan 58 "Dark mode later").
   ===================================================================================================================== */
:root {
  --cal-font: var(--sans);                                              /* the one font of the calendar */
  /* Both at 56% ink: 4.7:1 on the page and 4.8:1 on a card, so the small grey words pass WCAG AA (they were 52%,
     4.1:1, and 38%, 2.6:1; desktop UX audit 2026-10-18). Past days still read as past: the days to come are ink. */
  --cal-soft: color-mix(in srgb, var(--ink) 56%, transparent);          /* small grey words: weekday letters, hours */
  --cal-past: color-mix(in srgb, var(--ink) 56%, transparent);          /* past days, the days of other months */
  --cal-hair: color-mix(in srgb, var(--ink) 15%, transparent);          /* hairlines: the hours, the date line, Month */
  --cal-capsule: rgba(255, 255, 255, .74);                              /* a floating capsule's soft fill */
  --cal-capsule-edge: 0 0 0 .5px rgba(0, 0, 0, .08), 0 2px 10px rgba(0, 0, 0, .07);
  --cal-capsule-fx: blur(16px) saturate(170%);
  --cal-capsule-ink: var(--ink);
  --cal-capsule-on: rgba(0, 0, 0, .07);                                 /* a capsule button pressed or turned on */
  --cal-today-fill: var(--red);                                         /* today's circle (white on it: 5.4:1) */
  --cal-today-ink: #fff;
  --cal-pick-fill: var(--ink);                                          /* the picked day's circle */
  --cal-pick-ink: var(--bg);
  --cal-now-line: var(--red);                                           /* the now line and its pill */
  --cal-card-tint: 17%;                                                 /* how much of the calendar's colour fills a card */
  --cal-card-strong: 60%;                                               /* the card's words: its colour, this much ... */
  --cal-card-deep: #000;                                                /* ... mixed with this (white in a dark theme) */
  --cal-noshow-fill: #eceee9;
  --cal-noshow-bar: #8a8f86;
}

/* ---------- 8. One font in the calendar: the app's own (no wide display font, no mono); times in tabular figures ---------- */
.view.cal-view { --display: var(--cal-font); --mono: var(--cal-font); font-family: var(--cal-font); }
.view.cal-view, .view.cal-view * { font-stretch: 100%; }
.view.cal-view :is(.cal-title-main, .year-name, .month-cell .num, .mini-head b, .cal-head.day-link b, .list-day b, .month-agenda-head b) { letter-spacing: -.01em; }
.view.cal-view :is(.bk-time, .cal-gutter, .cal-now-label, .month-item-time, .lr-time, .strip-day b, .year-day, .mini-day, .month-cell .num, .drag-time, .cal-ghost) { font-variant-numeric: tabular-nums; }

/* ---------- 1. iPhone top: "‹ October" in a capsule; one capsule with the list and the + (search is the app bar's) ---------- */
.cal-capsule { display: inline-flex; align-items: center; flex: none; height: 44px; padding: 0 3px; border-radius: 9999px; background: var(--cal-capsule); box-shadow: var(--cal-capsule-edge); -webkit-backdrop-filter: var(--cal-capsule-fx); backdrop-filter: var(--cal-capsule-fx); }
/* The app bar sits right above: the two rows close up (not when a notice sits between them). */
.view.cal-view:not(:has(> .note:not([hidden]))) .cal-toolbar.apple-phone { margin-top: 0; }
.cal-toolbar.apple-phone .cal-ptop { min-height: 44px; margin: 0 0 6px; gap: 8px; }
.cal-ptop .cal-zoom-cap .cal-zoom-out { min-height: 44px; padding: 0 16px 0 8px; color: var(--cal-capsule-ink); font-size: var(--t-body); font-weight: 500; }
.cal-ptop .cal-zoom-cap .cal-zoom-out[hidden] { display: none; }
.cal-ptop .cal-zoom-cap:has(.cal-zoom-out[hidden]) { display: none; }
.cal-ptop .cal-zoom-mark svg { width: 21px; height: 21px; stroke-width: 2.2; }
/* No padding: one button makes a true circle, not a pill with a white edge around a smaller circle. */
.cal-ptop .cal-tools-cap { padding: 0; }
.cal-ptop .cal-tools-cap .icon-btn { width: 44px; height: 44px; min-height: 44px; border-radius: 9999px; color: var(--cal-capsule-ink); }
.cal-ptop .cal-tools-cap .icon-btn svg { width: 21px; height: 21px; }
.cal-ptop .cal-tools-cap .icon-btn:active, .cal-ptop .cal-tools-cap .cal-list-btn.on { background: var(--cal-capsule-on); }
.cal-ptop .cal-tools-cap .cal-list-btn.on svg { width: 21px; height: 21px; padding: 0; border-radius: 0; background: none; color: inherit; }

/* ---------- 2. The week strip: small grey letters, big numbers, past days grey, today red, the picked day ink ---------- */
.cal-toolbar.apple-phone .cal-strip { gap: 0; margin: 0 0 6px; }
.cal-toolbar.apple-phone .cal-strip .strip-day { min-height: 0; gap: 4px; padding: 0; border-radius: 0; }
.cal-toolbar.apple-phone .cal-strip .strip-dow, .cal-toolbar.apple-phone .cal-strip .strip-day.on .strip-dow { font-size: var(--t-caption2); font-weight: 500; color: var(--cal-soft); }
.cal-toolbar.apple-phone .cal-strip .strip-day b { width: 38px; height: 38px; font-size: var(--t-title3); font-weight: 400; line-height: 1; color: var(--ink); }
.cal-toolbar.apple-phone .cal-strip .strip-day.past b { color: var(--cal-past); }
.cal-toolbar.apple-phone .cal-strip .strip-day.on:not(.today) b { background: var(--cal-pick-fill); color: var(--cal-pick-ink); font-weight: 600; }
.cal-toolbar.apple-phone .cal-strip .strip-day.today b { background: var(--cal-today-fill); color: var(--cal-today-ink); font-weight: 600; }
.cal-toolbar.apple-phone .cal-strip .strip-day i { display: none; }

/* ---------- 3. The date line: a hairline, "Saturday – Oct 17, 2026" centred and semibold, a hairline ---------- */
.cal-toolbar.apple-phone.is-day .cal-ptitle { padding: 0; border-top: .5px solid var(--cal-hair); border-bottom: .5px solid var(--cal-hair); }
.cal-toolbar.apple-phone.is-day .cal-title-wrap { display: flex; justify-content: center; }
.cal-toolbar.apple-phone.is-day .cal-title { justify-content: center; min-height: 44px; margin: 0; padding: 0 8px; }
.cal-toolbar.apple-phone.is-day .cal-title-main { font-size: var(--t-subhead); font-weight: 600; line-height: 1.2; letter-spacing: 0; text-align: center; }
.cal-main.has-bottom > .cal { border-top: 0; }

/* ---------- 4. The hour column and the hours: the number big, "PM" small, Noon at 12; hairlines, no half hours ---------- */
.cal-gutter span { color: var(--cal-soft); font-weight: 500; }
.cal-gutter span b { font-size: var(--t-caption1); font-weight: 600; color: color-mix(in srgb, var(--ink) 62%, transparent); }
.cal-gutter span small { font-size: max(9px, .5625rem); font-weight: 600; letter-spacing: .02em; }
.cal-gutter span .gut-noon { font-size: var(--t-caption1); }
.cal-line { border-top: .5px solid var(--cal-hair); }
.cal-inner.apple-day .cal-col { border-left: 0; }
.cal-inner.apple-day .cal-gutter span { right: 6px; }
/* A thin scroll mark, like iOS's. */
.cal-main.has-bottom > .cal { scrollbar-width: thin; }
.cal-main.has-bottom > .cal::-webkit-scrollbar { width: 3px; height: 3px; }
.cal-main.has-bottom > .cal::-webkit-scrollbar-thumb { border: 0; border-radius: 3px; background: color-mix(in srgb, var(--ink) 28%, transparent); }

/* ---------- 5. Bookings: a soft tint, a rounded bar on the left, 6 px corners, no border, no shadow ---------- */
:is(.cal, .cal-key-list) .bk { border-left: 0; padding-left: 11px; border-radius: 6px; box-shadow: none; background: color-mix(in srgb, var(--c, var(--faint)) var(--cal-card-tint), var(--bg)); }
:is(.cal, .cal-key-list) .bk::before { content: ""; position: absolute; left: 2px; top: 2px; bottom: 2px; width: 3.5px; border-radius: 3px; background: var(--c, var(--faint)); }
:is(.cal, .cal-key-list) .bk.grown { box-shadow: none; }
:is(.cal, .cal-key-list) .bk.pending { background: color-mix(in srgb, var(--c, var(--faint)) 9%, var(--bg)); box-shadow: none; }
:is(.cal, .cal-key-list) .bk.pending::before { background: repeating-linear-gradient(to bottom, var(--c, var(--faint)) 0 4px, transparent 4px 7px); }
:is(.cal, .cal-key-list) .bk.done { box-shadow: none; background: color-mix(in srgb, var(--c, var(--faint)) 11%, var(--bg)); }
:is(.cal, .cal-key-list) .bk.done::before { opacity: .5; }
:is(.cal, .cal-key-list) .bk.noshow { box-shadow: none; background: var(--cal-noshow-fill); }
:is(.cal, .cal-key-list) .bk.noshow::before { background: var(--cal-noshow-bar); }
:is(.cal, .cal-key-list) .bk.is-class::before { width: 6px; background: linear-gradient(to right, var(--c, var(--faint)) 0 2px, transparent 2px 4px, var(--c, var(--faint)) 4px); }
:is(.cal, .cal-key-list) .bk.clash { box-shadow: 0 0 0 2px var(--red); }
.cal .is-week .bk { padding-left: 8px; }
.cal .is-week .bk::before { left: 1.5px; width: 3px; }
@media (hover: hover) { .cal .bk:hover { background: color-mix(in srgb, var(--c, var(--faint)) 26%, var(--bg)); } }
/* The iPhone Day card: line 1 the title (semibold, the calendar's strong colour), line 2 a small clock and the time. */
.cal .bk.apple-bk { --cal-strong: color-mix(in srgb, var(--c, var(--ink)) var(--cal-card-strong), var(--cal-card-deep)); display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 1px; padding: 4px 8px 4px 12px; color: var(--cal-strong); white-space: nowrap; }
.cal .bk.apple-bk.l1 { justify-content: center; padding-top: 0; padding-bottom: 0; }
.cal .bk.apple-bk > .bk-title { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: var(--t-subhead); font-weight: 600; line-height: 1.25; color: var(--cal-strong); }
.cal .bk.apple-bk .bk-title-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .bk.apple-bk .bk-ico { display: inline-flex; flex: none; }
.cal .bk.apple-bk .bk-ico svg { width: 12px; height: 12px; }
.cal .bk.apple-bk > .bk-title > .bk-tag { margin-left: auto; padding: 0 6px; font-size: var(--t-caption2); font-weight: 600; letter-spacing: 0; text-transform: none; line-height: 16px; }
.cal .bk.apple-bk > .bk-time { display: flex; align-items: center; gap: 4px; font-size: var(--t-footnote); font-weight: 500; line-height: 1.25; color: color-mix(in srgb, var(--cal-strong) 80%, transparent); }
.cal .bk.apple-bk .bk-clock { display: inline-flex; flex: none; }
.cal .bk.apple-bk .bk-clock svg, .cal .bk.apple-bk .bk-done svg { width: 12px; height: 12px; stroke-width: 2.1; }
.cal .bk.apple-bk .bk-done { color: inherit; }
.cal .apple-bk .bk-range { display: inline; }
.cal .apple-bk .bk-compact, .cal .apple-bk .bk-start { display: none; }
.cal .apple-bk .bk-time.time-mid .bk-range { display: none; }
.cal .apple-bk .bk-time.time-mid .bk-compact { display: inline; }
.cal .apple-bk .bk-time.time-short .bk-compact { display: none; }
.cal .apple-bk .bk-time.time-short .bk-start { display: inline; }
.cal .bk.apple-bk.noshow .bk-who { text-decoration: line-through; }

/* ---------- 6. Now: a red line across, its time in a red pill in the hour column ---------- */
.cal-inner.apple-day .cal-now { height: 1.5px; margin-top: -.75px; background: var(--cal-now-line); }
.cal-inner.apple-day .cal-now::before { content: none; }
.cal-inner.apple-day .cal-now-label { right: 0; padding: 1px 6px; background: var(--cal-now-line); font-size: var(--t-caption2); font-weight: 600; }

/* ---------- 7. iPhone bottom: "Today" in a capsule; one capsule with Calendars and Inbox (and its count) ---------- */
.cal-bottom { margin-top: 6px; margin-left: 0; margin-right: 0; padding: 0; border-top: 0; }
.cal-bottom .cal-capsule { height: 44px; }
.cal-bottom .cal-cap-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 9999px; color: var(--cal-capsule-ink); font-size: var(--t-body); font-weight: 500; }
.cal-bottom .cal-cap-words { padding: 0 16px; }
.cal-bottom .cal-cap-icon { display: inline-flex; }
.cal-bottom .cal-cap-icon svg { width: 22px; height: 22px; }
.cal-bottom .cal-cap-btn:active { opacity: 1; background: var(--cal-capsule-on); }
.cal-bottom .cal-badge { min-width: 0; height: auto; padding: 0; border-radius: 0; background: none; color: var(--cal-capsule-ink); font-size: var(--t-subhead); font-weight: 600; }

/* ---------- Month: like one month of the Year, but big. No boxes, grey past days, a dot, today a red circle ---------- */
.month-grid { border: 0; background: none; }
.month-dow, .month-wrap.fits .month-dow { border: 0; background: var(--bg); text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--cal-soft); }
.month-cell, .month-cell.closed, .month-cell.outside { background: none; }
.month-cell .num { font-weight: 400; letter-spacing: 0; }
.month-cell.past .num, .month-cell.outside .num, .month-cell.closed:not(.picked) .num { color: var(--cal-past); font-weight: 400; }
.month-cell.picked, .month-wrap.apple .month-cell.picked { box-shadow: none; }
.month-cell.picked:not(.today) .num { background: var(--cal-pick-fill); color: var(--cal-pick-ink); box-shadow: none; }
.month-cell.today .num, .month-cell.today.picked .num { background: var(--cal-today-fill); color: var(--cal-today-ink); font-weight: 600; box-shadow: none; }
@media (hover: hover) { .month-wrap.apple .month-cell.today .num:hover { background: var(--cal-today-fill); } }
.month-cell .day-dot { width: 6px; height: 6px; background: var(--cal-soft); }
.month-cell .day-dot.need { background: #e69500; box-shadow: none; }
/* Phones: the numbers sit on the page, a big one per day, the dot under it. A tap opens the day. */
@media (max-width: 699px), (max-height: 500px) and (pointer: coarse) {
  .month-dow { padding: 4px 0 6px; font-size: var(--t-caption2); }
  .month-cell { min-height: 58px; padding: 4px 0 2px; border: 0; }
  .month-top { gap: 4px; }
  .month-cell .num { width: 36px; min-width: 36px; height: 36px; font-size: var(--t-title3); }
  .month-cell.closed:not(.picked) .num { font-weight: 400; }
}
/* Computers: one-line bookings stay in the days (Apple's Mac Month), on light hairlines, no boxes. */
@media (min-width: 700px) and (min-height: 501px), (min-width: 700px) and (pointer: fine) {
  .month-dow { padding: 6px 8px; font-size: var(--t-footnote); }
  .month-cell { border-right: .5px solid var(--cal-hair); border-bottom: .5px solid var(--cal-hair); }
  .month-cell:nth-child(7n) { border-right: 0; }
  .month-grid > .month-dow { border-bottom: .5px solid var(--cal-hair); }
  .month-cell .num { font-size: var(--t-body); }
  .month-closed { font-weight: 500; color: var(--cal-past); }
}

/* ---------- Year: the app's font; on a phone the twelve months are small enough to fit, like Apple's ---------- */
.year-name { letter-spacing: -.01em; }
@media (max-width: 767px), (max-height: 500px) and (pointer: coarse) {
  .year-wrap { padding-top: 2px; }
  .year-grid { gap: 8px 14px; }
  .year-month { gap: 2px; }
  .year-name { font-size: var(--t-subhead); line-height: 1.15; }
  .year-dow { display: none; } /* Apple's iPhone year has no weekday letters: the twelve months fit */
  .year-days { row-gap: 0; }
  .year-day { max-width: none; height: 13px; aspect-ratio: auto; border-radius: 4px; font-size: 9px; line-height: 13px; }
  .year-day.today { width: 15px; height: 15px; margin: -1px 0; border-radius: 50%; }
}
