/* Desktop refresh (2026-09-24): cases. Rules apply outside phone mode only: prefix :root:not([data-phone="on"]) where a rule could reach the phone layout. */

/* Every rule below carries the prefix, including those inside the wide-screen block:
   phone mode is a per-browser setting, not a width, so a phone-mode window CAN be
   1,600px wide, and it must still render exactly as css/phone/cases.css says. */

/* ── Filter tabs: sentence case, with the loaded tab's count ───────────────────
   The phone chips lost tracked mono caps in the 2026-09-19 refresh and read
   "Open 12 · Recheck · Closed · Archived"; the desktop tabs now say the same words.
   They keep their own shape — underline and travelling ink line, not chips — and
   the markup already spells each label in sentence case, so this is type only.
   Width changes with the count, which faunaInkLine re-measures on every render. */
:root:not([data-phone="on"]) .cases-filter-tab {
    font-family: var(--ed-ui);
    font-size: 0.92rem;
    text-transform: none;
    letter-spacing: 0;
}

/* The count is data, so it is mono with tabular figures (Manrope's would do too,
   but mono sets it apart from the word without a pill). Quieter than the label. */
:root:not([data-phone="on"]) .cases-filter-count {
    margin-left: 0.35rem;
    font-family: var(--ed-mono);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: var(--ed-mute);
}

/* The Mine / All pill beside the tabs was the same tracked caps; it follows them. */
:root:not([data-phone="on"]) .cases-scope-btn {
    font-family: var(--ed-ui);
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: 0;
}

/* ── "/" key cap in the search field ───────────────────────────────────────────
   Says the shortcut exists. Bootstrap styles <kbd> as a dark filled chip; this is
   a hairline cap in the page's own ink instead. Gone while the field has focus:
   by then the shortcut has done its job. The markup marks it desktop-mode-only,
   so phone mode never shows it. */
:root:not([data-phone="on"]) .cases-search-kbd {
    flex: 0 0 auto;
    padding: 0 0.45rem;
    border: 1px solid var(--ed-hairline-strong);
    border-radius: var(--radius-sm, 6px);
    background: transparent;
    box-shadow: none;
    font-family: var(--ed-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--ed-mute);
    cursor: default;
    user-select: none;
}

:root:not([data-phone="on"]) .cases-search-row:focus-within .cases-search-kbd {
    visibility: hidden;
}

/* A touch device in the desktop layout has no keyboard to press it on. Phone mode is
   opt-in, so an iPad (the consult-room device) in the default layout would otherwise
   show a chip that looks like a control and does nothing when tapped. Hidden wherever
   the primary pointer is coarse or cannot hover; the shortcut itself still works for
   anyone who has attached a keyboard. */
@media (hover: none), (pointer: coarse) {
    :root:not([data-phone="on"]) .cases-search-kbd {
        display: none;
    }
}

/* ── Wide screens: a wider column and four card columns ────────────────────────
   At 1,920px the 1,080px column left over a third of the width empty. The column
   widens to about 1,440px (the figure the refresh spec gives every wide page), and
   the grid is pinned at four: auto-fill would turn the extra width into a fifth
   narrow card, when the footer's status, Add clinical info and Archive pills
   already crowd a 270px one. Below 1,600px nothing changes (three columns at
   1,366, as before). NewCase shares the container class but sets its own inline
   max-width, which this does not reach. */
@media (min-width: 1600px) {
    :root:not([data-phone="on"]) .cases-page-container {
        max-width: 1440px;
    }

    :root:not([data-phone="on"]) .cases-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
