/* S1 phone density pass (<=640px). Loads last. Polish only: it tightens padding, gaps, titles and row height on the existing
 * layouts and flows; nothing here changes what a page shows. Desktop and tablet widths are untouched.
 * Touch targets stay at 44px (the 44px min-height rules in s1-shell.css, s1-components.css and s1-kit.css are not lowered).
 *
 * The one place for phone spacing and type: the --s1-* overrides below. Components read these tokens, so a phone
 * value is changed here and nowhere else. */
@media (max-width: 640px) {  :root {
    --s1-scale: 1;
    --s1-gutter: 16px;
    /* The type scale on a phone: one size larger than a monitor from step 2 up (12 13 14 16 18 22 26 30); fields are step 4, 16px, so iOS never zooms the page on focus. */
    --s1-fs-2: 13px; --s1-fs-3: 14px; --s1-fs-4: 16px; --s1-fs-5: 18px; --s1-fs-6: 22px; --s1-fs-7: 26px; --s1-fs-8: 30px;
    --s1-text-base: var(--s1-fs-3);
    --s1-text-small: var(--s1-fs-2);
    --s1-space-3: 10px;
    --s1-space-4: 14px;
    --s1-space-5: 16px;
    --s1-space-6: 18px;
    --s1-inset-x: 14px;
    --s1-inset-y: 10px;
    --s1-panel-pad-x: 14px;
    --s1m-gap: 10px;
    --s1m-gap-lg: 12px;
    --s1m-row-y: 9px;
  }
/* ---- Shell: top bar, bottom dock, page end clearance ---- */
/* The workspace already clears the dock. s1-base.css also pads the body 96px/110px for it, which left a strip of bare page background under the shell. */
  body.s1-shell { padding-bottom: 0; }
}
/* The dock is shown from 660px down (s1-base.css), so its compact form uses the same breakpoint. */
@media (max-width: 660px) {  body.s1-shell .s1n-dock { gap: 0; }
  body.s1-shell .s1n-dock-item { min-height: 48px; gap: 2px; padding: 4px 2px; border-radius: 12px; font-size: var(--s1-fs-1); }
  body.s1-shell .s1n-dock-item .s1n-ico, body.s1-shell .s1n-dock-item .s1n-ico .s1-icon { width: 20px; height: 20px; }
  body.s1-shell .s1n-dock-item .s1n-badge { top: 1px; }
  body.s1-shell .s1n-tabs { margin: 0 16px; }
  body.s1-shell .s1n-tab { min-height: 44px; padding: 0 12px; }
}
@media (max-width: 640px) {/* ---- Kit pages (Projects list, Tasks, Settings, People, Library, Requests, Inbox, Command Center tools) ---- */
  .k-page { padding: 12px var(--s1-gutter) 40px; gap: var(--s1m-gap-lg); }
  .k-head { gap: 6px; }
  .k-head-row { gap: 8px 12px; }
  .k-head .k-kicker { display: none; }
/* the top bar already names the page; the kicker only repeats it */
  .k-stack { gap: var(--s1m-gap-lg); }
  .k-panel-head { padding: 8px 14px; min-height: 42px; gap: 6px 8px; }
  .k-panel-title { font-size: var(--s1-fs-4); }
  .k-panel-body { padding: var(--s1-inset-y) var(--s1-inset-x); }
  .k-panel-body--flush { padding: 0; }
  .k-panel-foot { padding: 8px 14px; }
  .k-row { padding: var(--s1m-row-y) 10px; gap: 2px 10px; }
  .k-tile { width: 30px; height: 30px; border-radius: 9px; }
  .k-setting { padding: 11px 14px; gap: 2px 12px; }
  .k-callout { padding: 10px 12px; gap: 10px; }
  .k-empty { padding: 11px 14px; }
  .k-kcol { padding: 8px; gap: 6px; }
  .k-kcard { padding: 10px 10px 10px 12px; gap: 7px; }
  .k-tab { padding: 8px 12px; }
/* Pills stay on one line. Ones with only text also get an ellipsis; ones with an icon or dot are clipped at the box. */
  :is(.k-pill:not(:has(> *)), .s1h-pill:not(:has(> *))) { display: inline-block; text-overflow: ellipsis; vertical-align: middle; }
/* ---- Home ---- */
  .s1-home { padding: 12px 16px 72px; --h-gap: 12px; }
  .s1h-row, .s1h-day-row, .s1h-wait-row, .s1h-ann, .s1h-person-row, .s1h-lane-row { padding: var(--s1m-row-y) 14px; gap: 10px; }
  .k-tile { width: 34px; height: 34px; border-radius: 10px; }
  .s1h-row-title { font-size: var(--s1-fs-4); }
  .s1h-row-meta { margin-top: 5px; }
  .s1h-lane h3 { padding: 10px 14px 4px; }
  .s1h-lane-more { padding: 4px 14px 12px; }
  .s1h-pw-block h3 { padding: 10px 14px 4px; }
  .s1h-pw-list li { padding: 6px 14px; }
  .s1h-pw-empty { padding: 4px 14px 10px; }
  .s1h-pgrid { padding: 10px; gap: 8px; }
  .s1h-pcard { padding: 12px; gap: 8px; }
  .s1h-note, .s1h-checkin { padding: 10px 14px; gap: 10px; }
  .s1h-note-ico { width: 32px; height: 32px; }
/* ---- Projects list: the stacked card becomes a denser three-column fact row ---- */
  .kp-toolbar, .kt-toolbar { padding: 8px 12px; gap: 8px; }
  .kp-body, .kt-body { padding: 8px 12px 12px; }
  .kp-active { padding: 8px 12px; }
  .tg-cardlist { gap: 8px; }
  .tg-cardgroup { gap: 6px; }
  .tg-cards { gap: 6px; }
  .tg-card { gap: 6px; padding: 10px 12px; border-radius: 11px; }
  .tg-card-top { gap: 8px; }
  .tg-card-top .tg-name { font-size: var(--s1-fs-4); line-height: 1.3; }
  .tg-card-meta { gap: 4px 8px; }
  .tg-card-dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; font-size: var(--s1-text-small); }
  .tg-card-dl dt { font-size: var(--s1-fs-1); }
  .tg-card-dl dd { white-space: nowrap; }
  .tg-gbtn { min-height: 44px; }
/* ---- Project page: header, phase strip, tabs, Work, graph, compliance ---- */
  .s1-project-page { padding: 10px 16px 88px; }
  [data-s1-project] .s1-project-page { padding: 8px 16px 88px; }
  .s1-project-page .s1-project-crumb { margin-bottom: 6px; }
  .s1-project-page .s1-project-header-body { padding: 12px 14px 0; }
  .s1-project-page .s1-project-header-top { gap: 10px; }
  .s1-project-page .s1-project-titlerow { gap: 10px; }
  .s1-project-page .s1-project-header .s1-stepper--interactive { margin: 12px 0 4px; }
  .s1-project-page .s1-project-header-empty { margin: 12px 0 4px; }
  .s1-project-page .s1-project-foryou { margin: 10px 0; gap: 8px; }
  .s1-project-page .s1-project-overview, .s1-project-page .s1-project-col { gap: var(--s1m-gap); }
  .s1-project-page .s1-project-side, .s1-project-page .s1-project-documents, .s1-project-page .s1-project-compliance { gap: var(--s1m-gap); }
  .s1-project-page .s1-panel-head { padding: 9px var(--s1-panel-pad-x); }
/* Panels keep their header and footer bands on a phone (direction B); only the rows get tighter. */
  .s1-project-page .s1-panel-body, .s1-panel-body { padding: 12px var(--s1-panel-pad-x); }
  .s1-project-page .s1-project-workbar { padding: 8px var(--s1-panel-pad-x); gap: 8px; }
  .s1-project-page .s1-project-table-foot { padding: 9px var(--s1-panel-pad-x); }
  .s1-project-page .s1-board { padding: 10px var(--s1-panel-pad-x); gap: 8px; }
  .s1-project-page .s1-board-col { padding: 8px; gap: 6px; min-height: 0; }
  .s1-project-page .s1-task { padding: 8px 10px; }
  .s1-project-page .s1-task-actions { margin-top: 4px; }
  .s1-project-page .s1-work-empty { padding: 10px var(--s1-panel-pad-x); }
  .s1-project-page .s1-timeline { padding: 10px var(--s1-panel-pad-x) 12px; }
  .s1-project-page .s1-tl-note { padding: 0 var(--s1-panel-pad-x) 12px; }
  .s1-project-page .s1-cg { gap: 12px; }
  .s1-project-page .s1-cg-nextcard { padding: 10px 12px; }
  .s1-project-page .s1-cg-icon { width: 30px; height: 30px; }
  .s1-project-page .s1-req-row { padding: 8px 0; gap: 6px; }
  .s1-project-page .s1-kv { gap: 6px 10px; }
/* ---- Messages and Apex tab ---- */
  .s1ag-side-top { padding: 8px 10px; gap: 8px; }
/* ---- Settings ---- */
  .s1set-who { gap: 10px; }
  .s1set-who .k-av { width: 48px; height: 48px; font-size: var(--s1-fs-4); }
  .s1ps-pad { padding: 10px var(--s1-inset-x); }
/* ---- Command Center and its tools ---- */
  .s1cc { padding: 12px 16px 72px; }
  .s1cc-stats { gap: 8px; }
  .s1cc-kpi-value { font-size: var(--s1-fs-6); }
  .s1t-page { gap: 12px; }
  .s1t-body { gap: 12px; }
  .s1t-sub { margin-top: 2px; }
  .s1t-soon { padding: 12px 14px; }
/* ---- Requests and Inbox ---- */
  .s1rq-tabs { padding: 0 4px; }
  .s1rq-tools { padding: 8px 12px 0; }
  .s1rq-body { padding-top: 4px; }
  .s1rq-facts { padding: 10px 0; gap: 8px 14px; }
  .s1rq-dfilters { padding: 8px 12px 4px; }
  .s1ib-pad { padding: 10px 12px; }
  .s1ib-more { padding: 8px 12px; }
}
/* ---- Touch targets (<=640px): small links, chips and avatars keep their look but get a 44px hit area ---- */
@media (max-width: 640px) {  :is(a, button):is(.k-pchip, .s1h-row-title, .s1h-av, .k-av, .k-pm, .k-uchip, .k-pchip, .k-pill, .k-cal-link, .kp-link, .k-row-title, .tg-name, .kt-title, .s1-chip-btn, .s1h-link, .s1h-tlink), .s1-project-crumb a { position: relative; }
  :is(a, button):is(.k-pchip, .s1h-row-title, .s1h-av, .k-av, .k-pm, .k-uchip, .k-pchip, .k-pill, .k-cal-link, .kp-link, .k-row-title, .tg-name, .kt-title, .s1-chip-btn, .s1h-link, .s1h-tlink)::after,
  .s1-project-crumb a::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%); }
/* The ::after is the thumb's 44 px target; the control's own box is also at least 24 px (WCAG 2.2 AA 2.5.8), so a count link is a real target, not a sliver. */
  :is(a, button):is(.kp-link, .s1h-link, .s1h-tlink, .kt-title, .s1t-ws-where, .kp-linkbtn) { display: inline-flex; align-items: center; min-height: 24px; min-width: 24px; }
  a.kp-link:not(.tg-name) { justify-content: center; }
  :is(a, button).k-row-title { min-height: 24px; }
}
@media (max-width: 640px) {  .s1-btn, .k-btn { min-height: 44px; }
  input.k-check { width: 24px; height: 24px; }
}
/* ---- Safe areas (index.html and setup.html set viewport-fit=cover, so env() is the real notch / home-indicator inset on iPhone and 0 everywhere
 * else: desktop and Android are unchanged). Fixed bottom things clear the home indicator; the phone app's own bar and sheets are above. ---- */
@media (max-width: 900px) {  .k-toasts { bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {  .kp-fpop, .k-cal-pop.is-sheet { padding-bottom: env(safe-area-inset-bottom, 0px); }
}
/* ---- Phone floor (<=640px): one shared rule set for the controls that were still under 44px or under 16px on a phone.
 * Look and layout are unchanged; only the hit area and the focus-zoom size change. Row links get an invisible 44px hit area (the technique above);
 * fields and pickers get the 44px height. test/browser/s1-phone-floor.spec.mjs asserts it on real screens. ---- */
@media (max-width: 640px) {/* Fields: 44px tall, 16px text (iOS zooms the page on focus below 16px). The quick-add and Ask boxes are bare inputs, not .k-input. */
  input:is([type=text], [type=search], [type=email], [type=url], [type=tel], [type=date], [type=number], [type=password], :not([type])):not(.k-check):not(.k-tag-in),
  .kt-qa-title, .kt-qa-due { min-height: 44px; font-size: var(--s1-fs-4); }
  .kt-qa-title, .kt-qa-due { height: 44px; }
  .k-tag-in { font-size: var(--s1-fs-4); min-height: 44px; }
  .s1-status-control-select, .s1-menu-item, :is(.s1-menu, .s1-person-menu-pop) > .s1-menu-item, .s1ag-input { min-height: 44px; box-sizing: border-box; }
  summary.s1-btn, summary.k-fchip, summary.s1-segmented-item, .s1-project-page :is(.s1-moreviews, .s1-workfilters) > summary, .s1set-adv > summary { min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; }
  .s1set-adv > summary { display: flex; }
/* Icon-only and short-label buttons are 44 wide as well as 44 tall. */
  :is(.s1-btn, .k-fchip, .k-iconbtn, .k-btn--icon) { min-width: 44px; }
/* Text links inside rows keep their size and gain the hit area. */
  :is(.s1-person-link, .k-cell-title, .k-kcard-title, .s1-project-person b a) { position: relative; }
  :is(.s1-person-link, .k-cell-title, .k-kcard-title, .s1-project-person b a)::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
/* The profile prompt is a sentence of links: pad each one to a 44px line box without moving the text. */
  .s1pp-complete a { display: inline-block; padding: 14px 2px; margin: -14px 0; }
}
/* ---- Sideways-scrolling strips (<=640px): a fade on the trailing edge says "there is more", and the strip keeps 28px of end padding so the
 * last item scrolls fully clear of the fade. Applies to every tab/chip strip that scrolls; the strips already scroll, this only shows it. ---- */
@media (max-width: 640px) {  :is(.s1-tabs, .k-tabs, .s1n-tabs, .s1rq-tabs, .asst-tabs, .s1act-chips, .s1cal-chips, [data-s1-feed] .k-filters) {
    padding-inline-end: 28px; scroll-padding-inline-end: 28px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  }
}
/* Empty states with an action: the message takes the full row and the button drops below it, instead of a six-line sliver beside the button. */
@media (max-width: 640px) {  .k-empty { flex-wrap: wrap; }
  .k-empty > .k-grow { flex: 1 1 60%; min-width: 0; }
  .k-empty > :is(.k-btn, .s1-btn, a.k-btn) { flex: 1 1 100%; justify-content: center; }
}
/* Project header (<=640px): the quick switches and the type picker share ONE sideways-scrolling row (three stacked rows of pills pushed the tabs and the first
 * panel below the dock). Same controls, same order. */
/* ---- Top bar (<=660px): the workspace mark and name on every page, left of the avatar. The page's own heading names the page, so the Feed and Apex
 * top-bar copy (which repeated their H1) is not shown either. ---- */
@media (max-width: 660px) {/* The phone top bar is the ink band of direction B (the rail's surface), so the brand reads white. */
}
/* ---- Sticky save bars clear the floating bottom bar (<=660px) and the home indicator ---- */
@media (max-width: 660px) {  :root { --s1-dock-clear: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .s1ps-finish { bottom: var(--s1-dock-clear); }
  .s1set-actions { padding-bottom: calc(var(--s1-dock-clear) + 12px); }
/* solid down to the dock, so no content shows between the bar and the dock */
}
/* ---- Manage tools (<=640px): one title, then the section select (every tab, "More tools" included, in one labelled control), then the page
 * actions (Print, CSV, Guide me), then the tool. The sideways tab strip is not drawn on a phone. ---- */
@media (max-width: 640px) {  .s1t-page > .s1t-head, .s1t-page > .s1t-head > .k-head-row { display: contents; }
  .s1t-page > .s1t-head .k-kicker { display: none; }
  .s1t-page > .s1t-head .k-grow { order: 1; }
  .s1t-page > .s1t-head .s1t-head-actions { order: 3; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  .s1t-page > .s1t-head .s1cc-agent-slot { order: 3; }
  .s1t-page > .s1t-body { order: 4; }
}
/* ---- More 44px hit areas: chips, small avatars and Home links. The visuals stay; the hit area grows around them. ---- */
@media (max-width: 640px) {  :is(.s1h-tlink, .k-pchip, a.k-pill, button.k-pill, a.k-av--sm, button.k-av--sm, .s1h-av, .s1-chip-btn) { position: relative; }
  :is(.s1h-tlink, .k-pchip, a.k-pill, button.k-pill, a.k-av--sm, button.k-av--sm, .s1h-av, .s1-chip-btn)::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%); }
/* Manuscript author roles: up to 14 chips per author. 36px chips on an 8px row gap give a 44px pitch, so every chip's hit area is 44px tall without overlapping the next row. */
  .s1-project-page .s1-ms-chips { gap: 8px 6px; }
  .s1-project-page .s1-ms-chip { position: relative; min-height: 36px; padding: 6px 12px; }
  .s1-project-page .s1-ms-chip::after { content: ""; position: absolute; inset: -4px -3px; }
}
/* ---- Project page header (<=640px): compact, with the section tabs pinned under the top edge. The header panel stops being one box (display: contents),
 * its body keeps the card look, and the tab strip becomes a sticky bar of the whole page (a sticky box cannot leave its own parent, and the
 * header panel ends right after the tabs). Same controls and order. ---- */
@media (max-width: 640px) {  .s1-project-page .s1-project-header { display: contents; }
  .s1-project-page .s1-project-header-body { background: var(--s1-panel); border: 1px solid var(--s1-line); border-bottom: 0; border-radius: var(--s1-radius-panel) var(--s1-radius-panel) 0 0; padding-bottom: 8px; }
  .s1-project-page .s1-project-header > .s1-tabs { position: sticky; top: 0; z-index: 5; background: var(--s1-panel); border: 1px solid var(--s1-line); border-top: 1px solid var(--s1-line-soft); border-radius: 0 0 var(--s1-radius-panel) var(--s1-radius-panel); }
  .s1-project-page .s1-project-title { text-align: left; }
  .s1-project-page .s1-project-mark:empty { display: none; }
/* People, IRB and pipeline chips: one sideways row with the same trailing fade. */
}
/* Project header on a phone, tightened to about 260px before the tabs (it was ~360): no breadcrumb (the dock has Projects), no summary line, the status
 * beside Post update / Add task / the menu, the three quick switches in ONE row (no clipping; the study type is in About, so its select is not repeated here),
 * and the people chips as avatars (names stay for screen readers). A grid regroups the same controls in the same order; nothing is removed from the page. */
@media (max-width: 640px) {  .s1-project-page .s1-project-crumb { display: none; }
  .s1-project-page .s1-project-header-body { padding-top: 8px; }
  .s1-project-page .s1-status-control::before { left: 8px; }
  .s1-project-page .s1-status-control::after { right: 7px; }
  .s1-project-page .s1-project-header-actions { gap: 6px; }
  .s1-project-page .s1-project-header-actions > .s1-btn--ghost:not(.s1-btn--icon) { font-size: 0; gap: 0; width: 44px; padding: 0; justify-content: center; }
  .s1-project-page .s1-project-header-actions > .s1-btn--ghost:not(.s1-btn--icon) svg { width: 18px; height: 18px; }
  .s1-project-page .s1-project-header .s1-stepper--interactive { margin: 6px 0 0; }
}
/* Project tabs on a phone: Compliance and Publication sit past the edge, so the strip says so with a fading edge and a chevron (it hides once the strip is
 * scrolled to the end where the browser supports scroll-driven animation) instead of the generic mask. */
@media (max-width: 640px) {  .s1-project-page .s1-tabs { -webkit-mask-image: none; mask-image: none; padding-inline-end: 0; scroll-padding-inline-end: 36px; scroll-timeline: --s1-tabs inline; }
  .s1-project-page .s1-tabs::after {
    content: ""; position: sticky; right: 0; flex: none; align-self: stretch; width: 36px; margin-left: -36px; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") right 6px center / 16px no-repeat, linear-gradient(90deg, transparent, var(--s1-panel) 70%);
    animation: s1-tabcue linear both; animation-timeline: --s1-tabs;
  }
  .s1-project-page .s1-tabs > .s1-tab:last-of-type { margin-inline-end: 36px; }
}
@keyframes s1-tabcue { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
/* ---- Taps are never taken by a hit-area extension or a toast (<=660px) ----
 * The ::after hit areas above are invisible boxes that extend past small links and chips. A positioned box paints over unpositioned neighbours, so an
 * extension used to take the edge of the button or title next to it: a tap near the top of "Approve" opened the project behind it instead.
 * Rules: (1) every real control that already meets the 44px floor stacks above any extension (zero specificity, so a control that is
 * absolutely positioned or has its own z-index keeps it); (2) link chips and pills extend to 32px, not 44px (button pills keep 44), because they sit a few px from the title or button next to them;
 * (3) a toast sits above the bottom bar instead of on top of it, so it never covers Projects / Feed / Messages while it shows.
 * test/browser/s1-phone-taps.spec.mjs taps and hit-tests the key screens and fails on any control another box intercepts. */
@media (max-width: 660px) {/* Sticky bars keep painting over the controls that scroll under them. */
  :is(.s1set-actions, .s1ps-finish, .k-aside-sticky, .s1cal-side, .s1cal-detail-host) { z-index: 2; }
  :is(.k-pchip, a.k-pill)::after { height: 44px; }
/* A project card's fact cells clip their text with overflow:hidden; that also clipped the task-count link and the Accepting-students switch, so the part of them that sat outside the cell (and their hit areas) could not be tapped. */
  .tg-card-dl dd:has(> a, > button) { overflow: visible; }
  .k-toasts { bottom: var(--s1-dock-clear, calc(84px + env(safe-area-inset-bottom, 0px))); z-index: 600; }
}
/* ---- Calm, dense phone lists (<=640px): the owner's Cloudflare-iPhone reference, a touch larger. ----
 * The one place a phone screen gets its list density. Every list row has the same anatomy: a 20px leading icon, a one-line 15px semibold title with an
 * ellipsis, ONE 13px muted line of facts (project and status as plain text, status in its semantic colour, never a pill), and a chevron or icon-only
 * actions on the right. Hairline separators, no card inside a card, almost no border or shadow. Icon buttons look 32px but keep a 44px hit area (padding
 * plus a content-box background), so the phone floor and taps specs stay green. test/browser/s1-phone-density.spec.mjs holds the row heights:
 * Home and Feed rows <= 72px, the NEXT card <= 140px, other list rows <= 64px. Shared tokens and shared kit classes only, never a per-screen patch. */
@media (max-width: 640px) {  :root {
    --s1m-row-y: 8px;
    --s1m-gap: 8px;
    --s1m-gap-lg: 10px;
    --k-shadow-card: none;
    --s1m-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
  }
  body { font-size: var(--s1-text-base); }
}
/* Phone top bar (<=900px, where the dock shows): Search (opens the Menu sheet with its box focused) and the bell (the Feed's Needs-you count) beside the avatar. */
/* ---- Sticky save bars clear the floating bottom bar (<=660px) and the home indicator ---- */
@media (max-width: 660px) {  :root { --s1-dock-clear: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .s1ps-finish { bottom: var(--s1-dock-clear); }
  .s1set-actions { padding-bottom: calc(var(--s1-dock-clear) + 12px); }
/* solid down to the dock, so no content shows between the bar and the dock */
}
/* ---- Manage tools (<=640px): one title, then the section select (every tab, "More tools" included, in one labelled control), then the page
 * actions (Print, CSV, Guide me), then the tool. The sideways tab strip is not drawn on a phone. ---- */
@media (max-width: 640px) {  .s1t-page > .s1t-head, .s1t-page > .s1t-head > .k-head-row { display: contents; }
  .s1t-page > .s1t-head .k-kicker { display: none; }
  .s1t-page > .s1t-head .k-grow { order: 1; }
  .s1t-page > .s1t-head .s1t-head-actions { order: 3; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  .s1t-page > .s1t-head .s1cc-agent-slot { order: 3; }
  .s1t-page > .s1t-body { order: 4; }
}
/* ---- More 44px hit areas: chips, small avatars and Home links. The visuals stay; the hit area grows around them. ---- */
@media (max-width: 640px) {  :is(.s1h-tlink, .k-pchip, a.k-pill, button.k-pill, a.k-av--sm, button.k-av--sm, .s1h-av, .s1-chip-btn) { position: relative; }
  :is(.s1h-tlink, .k-pchip, a.k-pill, button.k-pill, a.k-av--sm, button.k-av--sm, .s1h-av, .s1-chip-btn)::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%); }
/* Manuscript author roles: up to 14 chips per author. 36px chips on an 8px row gap give a 44px pitch, so every chip's hit area is 44px tall without overlapping the next row. */
  .s1-project-page .s1-ms-chips { gap: 8px 6px; }
  .s1-project-page .s1-ms-chip { position: relative; min-height: 36px; padding: 6px 12px; }
  .s1-project-page .s1-ms-chip::after { content: ""; position: absolute; inset: -4px -3px; }
}
/* ---- Project page header (<=640px): compact, with the section tabs pinned under the top edge. The header panel stops being one box (display: contents),
 * its body keeps the card look, and the tab strip becomes a sticky bar of the whole page (a sticky box cannot leave its own parent, and the
 * header panel ends right after the tabs). Same controls and order. ---- */
@media (max-width: 640px) {  .s1-project-page .s1-project-header { display: contents; }
  .s1-project-page .s1-project-header-body { background: var(--s1-panel); border: 1px solid var(--s1-line); border-bottom: 0; border-radius: var(--s1-radius-panel) var(--s1-radius-panel) 0 0; padding-bottom: 8px; }
  .s1-project-page .s1-project-header > .s1-tabs { position: sticky; top: 0; z-index: 5; background: var(--s1-panel); border: 1px solid var(--s1-line); border-top: 1px solid var(--s1-line-soft); border-radius: 0 0 var(--s1-radius-panel) var(--s1-radius-panel); }
  .s1-project-page .s1-project-title { text-align: left; }
  .s1-project-page .s1-project-mark:empty { display: none; }
/* People, IRB and pipeline chips: one sideways row with the same trailing fade. */
}
/* Project header on a phone, tightened to about 260px before the tabs (it was ~360): no breadcrumb (the dock has Projects), no summary line, the status
 * beside Post update / Add task / the menu, the three quick switches in ONE row (no clipping; the study type is in About, so its select is not repeated here),
 * and the people chips as avatars (names stay for screen readers). A grid regroups the same controls in the same order; nothing is removed from the page. */
@media (max-width: 640px) {  .s1-project-page .s1-project-crumb { display: none; }
  .s1-project-page .s1-project-header-body { padding-top: 8px; }
  .s1-project-page .s1-status-control::before { left: 8px; }
  .s1-project-page .s1-status-control::after { right: 7px; }
  .s1-project-page .s1-project-header-actions { gap: 6px; }
  .s1-project-page .s1-project-header-actions > .s1-btn--ghost:not(.s1-btn--icon) { font-size: 0; gap: 0; width: 44px; padding: 0; justify-content: center; }
  .s1-project-page .s1-project-header-actions > .s1-btn--ghost:not(.s1-btn--icon) svg { width: 18px; height: 18px; }
  .s1-project-page .s1-project-header .s1-stepper--interactive { margin: 6px 0 0; }
}
/* Project tabs on a phone: Compliance and Publication sit past the edge, so the strip says so with a fading edge and a chevron (it hides once the strip is
 * scrolled to the end where the browser supports scroll-driven animation) instead of the generic mask. */
@media (max-width: 640px) {  .s1-project-page .s1-tabs { -webkit-mask-image: none; mask-image: none; padding-inline-end: 0; scroll-padding-inline-end: 36px; scroll-timeline: --s1-tabs inline; }
  .s1-project-page .s1-tabs::after {
    content: ""; position: sticky; right: 0; flex: none; align-self: stretch; width: 36px; margin-left: -36px; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") right 6px center / 16px no-repeat, linear-gradient(90deg, transparent, var(--s1-panel) 70%);
    animation: s1-tabcue linear both; animation-timeline: --s1-tabs;
  }
  .s1-project-page .s1-tabs > .s1-tab:last-of-type { margin-inline-end: 36px; }
}
@keyframes s1-tabcue { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
/* ---- Taps are never taken by a hit-area extension or a toast (<=660px) ----
 * The ::after hit areas above are invisible boxes that extend past small links and chips. A positioned box paints over unpositioned neighbours, so an
 * extension used to take the edge of the button or title next to it: a tap near the top of "Approve" opened the project behind it instead.
 * Rules: (1) every real control that already meets the 44px floor stacks above any extension (zero specificity, so a control that is
 * absolutely positioned or has its own z-index keeps it); (2) link chips and pills extend to 32px, not 44px (button pills keep 44), because they sit a few px from the title or button next to them;
 * (3) a toast sits above the bottom bar instead of on top of it, so it never covers Projects / Feed / Messages while it shows.
 * test/browser/s1-phone-taps.spec.mjs taps and hit-tests the key screens and fails on any control another box intercepts. */
@media (max-width: 660px) {/* Sticky bars keep painting over the controls that scroll under them. */
  :is(.s1set-actions, .s1ps-finish, .k-aside-sticky, .s1cal-side, .s1cal-detail-host) { z-index: 2; }
  :is(.k-pchip, a.k-pill)::after { height: 44px; }
/* A project card's fact cells clip their text with overflow:hidden; that also clipped the task-count link and the Accepting-students switch, so the part of them that sat outside the cell (and their hit areas) could not be tapped. */
  .tg-card-dl dd:has(> a, > button) { overflow: visible; }
  .k-toasts { bottom: var(--s1-dock-clear, calc(84px + env(safe-area-inset-bottom, 0px))); z-index: 600; }
}
/* ---- Calm, dense phone lists (<=640px): the owner's Cloudflare-iPhone reference, a touch larger. ----
 * The one place a phone screen gets its list density. Every list row has the same anatomy: a 20px leading icon, a one-line 15px semibold title with an
 * ellipsis, ONE 13px muted line of facts (project and status as plain text, status in its semantic colour, never a pill), and a chevron or icon-only
 * actions on the right. Hairline separators, no card inside a card, almost no border or shadow. Icon buttons look 32px but keep a 44px hit area (padding
 * plus a content-box background), so the phone floor and taps specs stay green. test/browser/s1-phone-density.spec.mjs holds the row heights:
 * Home and Feed rows <= 72px, the NEXT card <= 140px, other list rows <= 64px. Shared tokens and shared kit classes only, never a per-screen patch. */
@media (max-width: 640px) {  :root {
    --s1m-row-y: 8px;
    --s1m-gap: 8px;
    --s1m-gap-lg: 10px;
    --k-shadow-card: none;
    --s1m-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
  }
  body { font-size: var(--s1-fs-4); }
/* Panels are quiet sheets: one hairline, no shadow; the title is a small muted section label with 8px of air. */
  :is(.k-panel, .s1-panel, .s1h-panel, .tg-card) { box-shadow: none; border-color: var(--s1-line-soft); border-radius: 10px; }
  :is(.k-panel-head, .s1h-panel-head, .s1-panel-head) { background: transparent; border-bottom: 0; padding: 8px 14px 0; min-height: 0; border-radius: 0; }
  .s1h-panel-toggle { min-height: 44px; }
/* a closed Home panel is one button: the whole band is the tap target */
  .s1-project-page .s1-panel-head { padding: 8px var(--s1-panel-pad-x) 0; }
  .s1-project-page .s1-panel-body, .s1-panel-body { padding: 8px var(--s1-panel-pad-x) 12px; }
  .k-panel-body { padding: 6px var(--s1-inset-x) 10px; }
  .k-panel-body--flush { padding: 0; }
/* Segmented control (Home): 36px tall, each button keeps a 44px-tall hit area. */
/* Status as text, not a pill: inside a row's fact line a pill is the same words in a plain, tone-coloured run. */
  :is(.s1h-row-meta, .kt-meta, .k-row-meta, .tg-card-meta) :is(.s1h-pill, .k-pill):not(a, button) { border: 0; background: none; padding: 0; font: 500 var(--s1-fs-2)/18px var(--s1-font-ui); border-radius: 0; }
  :is(.s1h-row-meta, .kt-meta, .k-row-meta, .tg-card-meta) :is(.s1h-pill, .k-pill):not(a, button) :is(svg, .k-icon) { display: none; }
  :is(.s1h-row-meta, .kt-meta) .s1h-pill:not([class*="--"]), :is(.kt-meta, .k-row-meta, .tg-card-meta) .k-pill--plain { color: var(--s1-mute); }
  :is(.s1h-row-meta, .kt-meta) :is(.s1h-pill--late, .k-tone-late) { font-weight: 600; }
/* Home "Needs you" rows: 20px status icon | title + one fact line | icon-only Snooze and Done. */
  .s1h-row { padding: 6px 8px 6px 14px; gap: 10px; align-items: center; flex-wrap: nowrap; }
  .s1h-row .k-tile { width: 20px; height: 20px; background: transparent; border: 0; border-radius: 0; }
  .s1h-row .k-tile svg svg { width: 20px; height: 20px; }
  .k-row .k-tile { width: 20px; height: 20px; background: transparent; border: 0; border-radius: 0; }
  .k-row .k-tile .k-icon { width: 20px; height: 20px; }
  .s1h-row-main { min-width: 0; flex: 1 1 0; }
  .s1h-row-title { display: block; font: 600 var(--s1-fs-4)/20px var(--s1-font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; padding-block: 4px; margin-block: -4px; }
  .s1h-row-meta { flex-wrap: wrap; gap: 0 8px; margin-top: 1px; font: 400 var(--s1-fs-2)/18px var(--s1-font-ui); color: var(--s1-mute); overflow: clip; }
/* two short facts share a line; a long project name takes its own, so a row is at most title + two lines (64 px) */
  .s1h-row-meta > * { order: 2; flex: none; }
  .s1h-row-meta > .k-pchip { order: 1; flex: 0 1 auto; min-width: 0; display: block; border: 0; background: none; padding: 0; border-radius: 0; font: inherit; color: var(--s1-mute) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .s1h-row-meta > .k-pchip { min-height: 24px; line-height: 24px; min-width: min(12ch, 45%); }
/* The project (or workspace) is what a row is about, so its name is never squeezed: when the status words do not fit beside it they wrap to the next line (it was squeezed to 7 px). */
  .s1h-row-meta > .s1h-pill { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .s1h-row-meta > .k-pchip::after { height: 44px; }
  .s1h-row-meta .k-pn { display: inline; max-width: none; }
  .s1h-row-meta :is(.s1h-mark, .s1h-av, .s1h-avs) { display: none; }
  .s1h-row-meta > .s1h-meta-due { order: 3; display: inline; }
  .s1h-meta-due--late { color: var(--s1-late); }
 .s1h-meta-due--soon { color: var(--s1-soon); }
  .s1h-row-meta > .s1h-meta-due::before { content: "\00b7\00a0"; color: var(--s1-mute); font-weight: 400; }
  .s1h-row-detail { display: none; }
  .s1h-row-act { gap: 0; flex-wrap: nowrap; margin-left: 0; align-self: center; flex: none; }
  .s1h-row-act .s1h-pill { display: none; }
  .s1h-row-reason, .s1h-row-detail { font-size: var(--s1-fs-2); }
/* Row actions beside the text, never under it, so a row stays one title line and one fact line (<= 72 px) with every control still 44 px tall.
     The one action that moves the work (Done, Open, Reply, a count) keeps its word; Snooze and the Details chevron are icon-only, named for screen readers by aria-label. */
  .s1h-row { padding: 4px 4px 4px 14px; gap: 6px; }
  .s1h-row-act .s1h-btn { padding: 0 10px; font-size: var(--s1-fs-2); gap: 5px; }
  .s1h-row-act .s1h-btn:not(.s1h-peekbtn, [data-h-snooze]) > svg { display: none; }
  .s1h-row-act :is(.s1h-peekbtn, [data-h-snooze]) { font-size: 0; gap: 0; width: 44px; min-width: 44px; padding: 0; border: 0; background: transparent; color: var(--s1-ink-2); box-shadow: none; }
  .s1h-row-act :is(.s1h-peekbtn, [data-h-snooze]) > svg { width: 18px; height: 18px; }
/* NEXT: icon | NEXT label, one-line title, one fact line | the two actions across the bottom. */
/* Projects list: a row is the name and its health, then one muted line of facts, then a chevron. */
  .tg-cards, .tg-cardgroup { gap: 0; }
  .tg-card { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; grid-template-areas: "top meta chev" "dl dl chev"; align-items: center; column-gap: 8px; row-gap: 0; border-width: 0 0 1px; border-radius: 0; padding: 6px 2px 0 4px; background: transparent; }
  .tg-card:last-child { border-bottom-width: 0; }
  .tg-card::after { content: ""; grid-area: chev; width: 16px; height: 16px; background: var(--s1-mute); -webkit-mask: var(--s1m-chevron) center / contain no-repeat; mask: var(--s1m-chevron) center / contain no-repeat; }
  .tg-card-top { grid-area: top; display: flex; align-items: center; gap: 8px; min-width: 0; }
  .tg-card-top .k-pm { width: 24px; height: 24px; font-size: var(--s1-fs-1); }
  .tg-card-top .tg-more { flex: none; min-height: 36px; width: 36px; margin-block: -10px; }
/* the 44px tap floor (s1-taps) stretches it; the negative margin keeps the row at 64px */
  .tg-card-top .tg-name { font: 600 var(--s1-fs-4)/20px var(--s1-font-ui); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; min-width: 0; flex: 1 1 0; overflow: hidden; white-space: normal; overflow-wrap: anywhere; padding-block: 2px; margin-block: -2px; }
/* A calmer row: the project, then its facts. Selecting several and the edit menu are for the wide table (the project page edits too), so a phone row carries neither. */
  .tg-card-top .k-check, body.s1-shell .tg-card-top .tg-more { display: none; }
  .tg-card .tg-name::after, .tg-card-dl .kp-link::after { height: 100%; }
/* The title's 44px hit area ends at the title's own bottom edge and reaches up into the row's top padding, so the fact line's links are never under it. */
  .kt-row .kt-title::after { top: -24px; height: 44px; width: 100%; left: 0; transform: none; }
  .tg-card-meta { grid-area: meta; display: flex; flex-wrap: nowrap; align-items: center; gap: 0 6px; min-width: 0; }
  .tg-card-meta .tg-why { display: none; }
  .tg-card-dl { grid-area: dl; display: flex; flex-wrap: nowrap; gap: 0 10px; margin: 9px 0 0; /* clears the 44px ⋯ button above, whose tap floor reaches 10px below its 24px row (1px of it is the dl's own gap) */ padding-left: 32px; overflow: clip; font: 400 var(--s1-fs-2)/18px var(--s1-font-ui); color: var(--s1-mute); }
  .tg-card-dl > div { display: flex; gap: 4px; min-width: 0; flex: none; }
  .tg-card-dl > div:last-child { flex: 0 1 auto; }
/* the last fact shrinks with an ellipsis instead of being cut */
  .tg-card-dl dt { font-size: var(--s1-fs-2); color: var(--s1-mute); text-transform: none; letter-spacing: 0; font-weight: 400; }
  .tg-card-dl dt::after { content: ":"; }
  .tg-card-dl dd { font-size: var(--s1-fs-2); white-space: nowrap; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .tg-card-dl dd:has(> a, > button) { overflow: visible; }
  .tg-card-dl .k-pill, .tg-card-dl .tg-irb { border: 0; background: none; padding: 0; font: 500 var(--s1-fs-2)/18px var(--s1-font-ui); border-radius: 0; display: inline; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tg-card-dl .k-pill :is(svg, .k-icon), .tg-card-dl .tg-irb :is(svg, .k-icon) { display: none; }
  .tg-card-dl .tg-irb-d { display: none; }
/* Three facts a row: the next date, tasks and IRB (lead, team and last activity are on the project page; accepting students is a switch there too). */
  .tg-card-dl > div:not(:nth-child(n+4):nth-child(-n+6)) { display: none; }
/* Tasks: check | title + one fact line (project, due, flags) | icon-only status. */
  .kt-row { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; padding: 10px 4px 4px 12px; align-items: start; }
  .kt-row::before { top: 6px; bottom: 6px; width: 2px; }
  .kt-main { gap: 1px; }
  .kt-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font: 600 var(--s1-fs-4)/20px var(--s1-font-ui); overflow: hidden; white-space: normal; overflow-wrap: anywhere; text-align: left; }
  .kt-meta { flex-wrap: wrap; gap: 0 6px; overflow: clip; font: 400 var(--s1-fs-2)/18px var(--s1-font-ui); color: var(--s1-mute); }
  .kt-meta > * { flex: none; }
  .kt-meta > .k-pchip { flex: 0 1 auto; min-width: min(100%, 9em); border: 0; background: none; padding: 0; font: inherit; color: var(--s1-mute); }
  .kt-meta > .k-pchip { min-height: 24px; }
  .kt-meta > .k-pchip::after { height: 44px; }
  .kt-meta :is(.k-pm, .k-av) { display: none; }
  .kt-meta > .kt-due-inline { display: inline; order: 2; }
  .kt-meta > .kt-due-inline::before { content: "\00b7\00a0"; }
  .kt-meta > :is(.k-pill):not(.kt-due-inline *)::before { content: "\00b7\00a0"; }
  .kt-side > .k-pill { display: none; }
  .kt-side { grid-column: 3; justify-content: flex-end; flex-wrap: nowrap; }
  .kt-check, .kt-status { margin-top: -10px; }
  .kt-check { width: 44px; height: 44px; margin: 0; box-sizing: border-box; border: 11px solid transparent; background-clip: padding-box; box-shadow: inset 0 0 0 1.5px var(--s1-checkbox); justify-self: center; }
  .kt-check.is-on { box-shadow: inset 0 0 0 1.5px var(--s1-ink); }
  .kt-row { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .kt-status { flex-direction: column; font-size: var(--s1-fs-1); line-height: 1.1; gap: 2px; min-width: 56px; min-height: 44px; padding: 4px 6px; border: 0; border-radius: 14px; background: transparent; justify-content: center; align-items: center; }
  .kt-status > :nth-child(3) { display: none; }
  .kt-status > svg, .kt-status > .k-icon { width: 18px; height: 18px; }
  .kt-sec-h { font: 600 var(--s1-fs-1)/1.3 var(--s1-font-ui); text-transform: none; letter-spacing: 0; color: var(--s1-mute); margin: 0 0 4px; }
  .kt-sec-h .k-icon { width: 14px; height: 14px; }
/* Other lists: Kit rows (Library, Requests, Manage lists) share the same anatomy. */
  .k-row { gap: 0 10px; padding-block: var(--s1m-row-y); }
  .k-row-title { font-size: var(--s1-fs-4); font-weight: 600; line-height: 20px; }
  .k-row-meta, .k-row-sub, .s1h-row-reason, .s1h-row-detail { font-size: var(--s1-fs-2); line-height: 18px; }
  .k-row-main { gap: 1px; }
/* Requests: the "start a request" menu rows. */
/* Manage and Kit tables: a row is its first cell as the title, then the other cells as one muted line of "label value" facts. */
  .k-table tr { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 0 10px; padding: 6px 14px; overflow: clip; }
/* The row's controls sit right after the title and the facts clip at the end of the row, so every action stays reachable. */
  .k-table td { order: 2; }
  .k-table td.k-cell-first { order: 0; }
  .k-table td:has(button, .k-btn, .k-switch, input, select) { order: 1; align-self: center; }
  .k-table td { padding: 0; font: 400 var(--s1-fs-2)/18px var(--s1-font-ui); color: var(--s1-mute); text-align: left; flex: none; gap: 4px; width: auto; }
  .k-table td.k-cell-first { display: block; flex: 1 1 0; min-width: 0; font: 600 var(--s1-fs-4)/20px var(--s1-font-ui); color: var(--s1-ink); }
  .k-table td::before { font: 400 var(--s1-fs-2)/18px var(--s1-font-ui); letter-spacing: 0; text-transform: none; }
  .k-table td::before { content: attr(data-label) ":"; }
/* A wide table (five cells or more) wraps: the title takes its own line, the other cells run on below it, instead of the title shrinking to nothing. */
  .k-table tr:has(td:nth-child(5)) { flex-wrap: wrap; row-gap: 6px; }
  .k-table tr:has(td:nth-child(5)) td.k-cell-first { flex: 1 1 100%; }
  .k-table td .k-cell-title { max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Project page: a short header (title, status and switches in one scrolling row, one-line summary), then the tabs. */
  .s1-project-page .s1-project-header-body { padding: 10px 14px 0; }
  .s1-project-page .s1-project-header-actions { gap: 6px; }
  .s1-project-page .s1-project-header .s1-stepper--interactive { margin: 8px 0 2px; }
/* Library and Manage: lists, not boxes. */
  .s1lib-opp, .s1lib-row { box-shadow: none; }
  .s1lib-sum { display: none; }
/* the summary lives on the resource page; a list row is title + meta */
  .s1cc-kpi { box-shadow: none; padding: 10px 12px; }
  .s1cc-kpi-value { font-size: var(--s1-fs-6); }
}
/* The redesign's controls keep the mock-up's sizes; a thumb still gets a 44 px target through an invisible ::after, the same technique as above. */
@media (max-width: 640px) {
  :is(.btn, .avb, .qp, .fold, .seg button, .seg-b, .s1feed-segb, .s1pp-segb) { position: relative; }
  :is(.btn, .avb, .qp, .fold, .seg button, .seg-b, .s1feed-segb, .s1pp-segb)::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
  .k-dd-btn.s1-status-control-select { min-height: 44px; }
  :is(.s1-field-control, input.field, textarea.field) { font-size: var(--s1-fs-4); }
}

/* ---- Phone tap targets (r27c): every link and button is 44px high. These controls drew 13 to 40px tall; on a phone they grow to 44px (text stays centred),
 * so no hit area depends on a neighbour. Desktop is untouched. test/browser/tap-targets.spec.mjs measures the main resident and student screens. ---- */
@media (max-width: 640px) {
  .agd a.ev, .bh a.more, a.more, a.rl, a.pl, a.ob, .tabs > a, .s1feed-segb, .tp-btn, .k-seg-b, .s1cal-mini-d, .k-cal-latebtn, button.kt-title, button.k-row-title, a.k-row-title,
  .hd .bh > a:not(.more), .s1-project-crumb a, a.k-pchip, .btn.sm { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; }
  .agd a.ev { display: flex; }
  .s1cal-mini-d { min-width: 36px; justify-content: center; }
  .tabs > a { justify-content: center; }
  a.k-pchip { height: auto; min-height: 44px; }
  /* A link inside a sentence or a section header: the same 44px of hit area without moving the line (padding and an equal negative margin). */
  p a:not([class]), p a.ob, .agh a { display: inline-block; padding-block: 16px; margin-block: -16px; }
  .crumb a.ws { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; }
  .kt-meta > a.k-pchip, .s1h-row-meta > a.k-pchip { min-height: 44px; }
  .btn:not(.icon):not(.new):not(.ask):not(.sm) { min-height: 44px; box-sizing: border-box; }
  a.pc { min-height: 44px; box-sizing: border-box; }
}

/* Phone tap sizes: nothing a finger must hit is under 24px in either direction, and the top bar's primary action (New) is 44px. Text links inside rows get their height from padding, so lines keep their spacing. */
@media (max-width: 640px) {
  .tb .btn.new { width: 44px; height: 44px; }
  .hw .hw-hleg a { min-height: 24px; }
  .hw a.hw-it, .hw .dlr a, .mini-l a[role="button"], .hw-cell .blk span > a { display: inline-block; padding-block: 4px; }
  .s1-ts-l, .s1-ts-all, .v11-lnk { display: flex; align-items: center; min-height: 24px; }
  .tk > .ck[role="checkbox"] { width: 24px; height: 24px; }
}
