/* =====================================================================
   Admin styles.
   Plain, calm and readable: the people using this are not web designers.
   Classes are prefixed cms- so they never collide with a theme.
   Breakpoints match CLAUDE.md: mobile < 600, tablet 600-1023, laptop 1024+.
   ===================================================================== */

/* ---------------------------------------------------------------------
   Light and dark, and the colour the admin is painted in.

   Three things decide what you see, in this order:

     1. the scheme    light / dark / whatever the computer is set to
     2. the colour    which green, blue, plum and so on the brand is
     3. nothing else  every rule below reads a token; no rule names a colour

   The scheme is an attribute on <html>, written by the picker in the top
   bar and read back by a script in the head before the page draws, so the
   screen never flashes the wrong one. With no attribute and no script the
   media query decides, which is what the admin did before any of this and
   is still the right answer for somebody who never opens the picker.

   --on-brand is the one worth explaining: it is the colour of words that
   sit ON a solid brand fill. White on a dark green button, near-black on a
   pale green one. Before it existed, six separate dark-mode blocks each
   re-stated #0d1511 for a button, a tab, a pill, a page number -- and one
   of them had already been written twice over after it turned every quiet
   button in the admin into something that looked switched off.
   --------------------------------------------------------------------- */

:root {
    --ink:        #17231d;
    --ink-soft:   #55675d;
    --line:       #dde5e0;
    --line-soft:  #eef2f0;
    --bg:         #f4f7f5;
    --panel:      #ffffff;
    --brand:      #1f6b4a;
    --brand-dark: #185439;
    --brand-soft: #e8f2ec;
    --on-brand:   #ffffff;
    --on-brand-soft: rgba(255, 255, 255, .78);
    --danger:     #a32525;
    --danger-soft:#fbeaea;
    --warn:       #8a6412;
    --warn-soft:  #fdf3e0;
    --ok:         #1b6b45;
    --ok-soft:    #e6f3ec;
    --radius:     10px;
    --shadow:     0 1px 2px rgba(20, 40, 30, .06), 0 4px 16px rgba(20, 40, 30, .05);
    --sidebar:    15rem;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    -webkit-text-size-adjust: 100%;
}

/* Tamil and Urdu need more room between lines. */
:lang(ta), :lang(ur) { line-height: 1.75; letter-spacing: 0; text-transform: none; }

a { color: var(--brand); }
a:hover, a:focus-visible { color: var(--brand-dark); }

/* Always show where the keyboard is. */
:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

/* For screen readers only. */
.cms-sr {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.cms-skip {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--brand); color: var(--on-brand); padding: .75rem 1.25rem;
}
.cms-skip:focus { left: .5rem; top: .5rem; }

/* =====================================================================
   Shell: sidebar + top bar + content
   ===================================================================== */

.cms-shell {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
        "side top"
        "side main";
    min-height: 100vh;
}

/* --- sidebar --- */
.cms-side {
    grid-area: side;
    background: var(--panel);
    border-inline-end: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.cms-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 1.1rem 1.1rem .9rem;
    border-bottom: 1px solid var(--line-soft);
    text-decoration: none; color: inherit;
}
.cms-brand-mark {
    flex: 0 0 2rem; height: 2rem;
    display: grid; place-items: center;
    background: var(--brand); color: var(--on-brand);
    border-radius: 8px; font-weight: 700;
}
.cms-brand-name { font-weight: 700; line-height: 1.25; font-size: .98rem; }
.cms-brand-sub  { color: var(--ink-soft); font-size: .78rem; }

.cms-nav { padding: .6rem; flex: 1 1 auto; }
.cms-nav ul { list-style: none; margin: 0; padding: 0; }

.cms-nav a, .cms-nav span.cms-soon {
    display: flex; align-items: center; gap: .65rem;
    padding: 0.1rem .7rem; margin-bottom: .15rem;
    border-radius: 8px;
    text-decoration: none; color: var(--ink);
    font-size: .95rem;
}
.cms-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.cms-nav a[aria-current="page"] {
    background: var(--brand); color: var(--on-brand); font-weight: 600;
}
.cms-nav .cms-ico { flex: 0 0 1.1rem; text-align: center; opacity: .85; }

/* How many are waiting, next to the word it belongs to. The link is a flex
   row with a gap meant for the icon, so the count is pulled back against
   the label it reads with -- otherwise it floats between the two and
   belongs to neither. */
.cms-nav-n {
    margin-inline-start: -.45rem;
    font-weight: 600; font-variant-numeric: tabular-nums;
}

.cms-nav span.cms-soon { color: var(--ink-soft); cursor: default; }
.cms-nav span.cms-soon .cms-tag {
    margin-inline-start: auto; font-size: .7rem;
    background: var(--line-soft); color: var(--ink-soft);
    padding: .1rem .4rem; border-radius: 99px;
}

.cms-side-foot {
    padding: .8rem 1.1rem;
    border-top: 1px solid var(--line-soft);
    font-size: .8rem; color: var(--ink-soft);
}
.cms-side-foot a { text-decoration: none; }

/* --- top bar --- */
.cms-top {
    grid-area: top;
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
    padding: .75rem 1.25rem;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.cms-top h1 { margin: 0; font-size: 1.1rem; line-height: 1.3; }
.cms-top-head { min-width: 0; }
/* Wrapping, and staying at the right when it does. On a 320px phone the
   appearance picker, Add and Sign out together are wider than the screen,
   and in one unwrapping row they took the whole screen sideways with
   them. */
.cms-top-right {
    margin-inline-start: auto;
    display: flex; flex-wrap: wrap; justify-content: flex-end;
    align-items: center; gap: .9rem;
}

/* --- the way back, on every screen below the top level --- */
.cms-back {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .7rem;
    border: 1px solid var(--line); border-radius: 8px;
    color: var(--ink); text-decoration: none;
    font-size: .82rem; white-space: nowrap;
}
.cms-back:hover { background: var(--line-soft); }
.cms-back:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

@media (max-width: 599px) {
    /* The arrow alone, and no trail: on a phone there is room for the way
       back or for the story of how you got here, and the way back is the
       one somebody is reaching for. The heading still names the screen. */
    .cms-back span:last-child { position: absolute; width: 1px; height: 1px;
        padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .cms-back { padding: .35rem .5rem; }
    .cms-top .cms-crumb { display: none; }
    .cms-top-head { overflow: hidden; }
    .cms-top h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.cms-who { font-size: .85rem; color: var(--ink-soft); text-align: end; line-height: 1.35; }
.cms-who strong { display: block; color: var(--ink); font-size: .9rem; }

.cms-burger {
    display: none;
    background: none; border: 1px solid var(--line);
    border-radius: 8px; padding: .45rem .6rem;
    font-size: 1.1rem; cursor: pointer; color: var(--ink);
}

/* --- main --- */
.cms-main { grid-area: main; padding: 1.25rem; }
.cms-wrap { max-width: 62rem; }
/* A grid of things, not a page of words. See _header.php. */
.cms-wrap--wide { max-width: none; }

/* =====================================================================
   Pieces
   ===================================================================== */

.cms-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    margin-bottom: .7rem;
}
.cms-card h2 { margin: 0 0 .2rem; font-size: 1.05rem; }
.cms-card .cms-hint { margin: 0 0 .6rem; color: var(--ink-soft); font-size: .9rem; }

.cms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
    gap: .75rem;
}

/* Task buttons: the dashboard is tasks, not menus (SPEC §14). */
.cms-task {
    display: flex; flex-direction: column; gap: .2rem;
    padding: 1rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none; color: inherit;
}
.cms-task:hover, .cms-task:focus-visible {
    border-color: var(--brand); box-shadow: var(--shadow);
}
.cms-task-name { font-weight: 600; }
.cms-task-why  { font-size: .85rem; color: var(--ink-soft); }
.cms-task[aria-disabled="true"] {
    opacity: .55; pointer-events: none;
}

.cms-btn {
    display: inline-block;
    padding: .65rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--brand); color: var(--on-brand);
    font: inherit; font-weight: 600;
    text-decoration: none; cursor: pointer;
}
.cms-btn:hover, .cms-btn:focus-visible { background: var(--brand-dark); color: var(--on-brand); }
.cms-btn[disabled] { opacity: .6; cursor: not-allowed; }
.cms-btn { white-space: nowrap; }   /* never break "Sign out" across two lines */
.cms-btn--quiet {
    background: transparent; color: var(--ink); border-color: var(--line);
}
.cms-btn--quiet:hover { background: var(--line-soft); color: var(--ink); }
.cms-btn--wide { width: 100%; }
.cms-btn--small { padding: .25rem .7rem; font-size: .78rem; }

/* --- messages --- */
.cms-msg {
    display: flex; gap: .6rem;
    padding: .8rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    margin-bottom: 1rem;
    font-size: .95rem;
}
.cms-msg--ok     { background: var(--ok-soft);     border-color: #bfe0cd; color: var(--ok); }
.cms-msg--warn   { background: var(--warn-soft);   border-color: #ecd9ad; color: var(--warn); }
.cms-msg--error  { background: var(--danger-soft); border-color: #ecc3c3; color: var(--danger); }

/* --- lines that do not fit the date ---
   Reported, never applied. The quoted line comes first and the reason
   after it, because the thing being talked about is what somebody needs
   to find in the box above. */
.cms-tense { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.cms-tense li {
    display: grid; gap: .2rem;
    padding: .6rem .8rem;
    border-left: 3px solid #ecd9ad;
    background: var(--warn-soft);
    border-radius: 0 8px 8px 0;
}
/* The quoted line is what somebody has to find in the box above, so it
   leads. The reason and the suggestion are the point of the panel and
   must NOT use .cms-help -- that class is taken off the screen on every
   admin page by design, and the panel would have shown six quotations
   and no explanation at all. */
.cms-tense-said { font-style: normal; font-weight: 600; }
.cms-tense-why  { font-size: .85rem; color: var(--ink-soft, #55675d); }
.cms-tense-hint { font-size: .85rem; color: var(--ink-soft, #55675d); }
.cms-tense-hint q { font-style: normal; color: var(--ink, #17231d); }

/* --- forms --- */
/* 1.1rem under every field was 17.6px, and Achievements Settings draws
   a hundred and twenty fields: two whole screens of gap. */
.cms-field { margin-bottom: .7rem; }

/* --- a form of many short fields ---
   A record with a dozen one-line answers -- a name, two dates, a department
   -- reads as a wall when every answer takes a whole row and brings a line of
   help with it. On this grid the short ones sit beside each other and the
   page stops being a scroll.

   The help is still there; it is smaller and under the box rather than above
   it, so the eye goes label, box, next field, and only drops to the note when
   it wants one. */
.cms-fields {
    display: grid; gap: .55rem .9rem;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
}
.cms-fields > .cms-field { grid-column: span 12; margin-bottom: 0; min-width: 0; }

/* Two to a row once there is room for two.
 *
 * A screen of settings was fourteen fields stacked in one column, each a
 * label, a line of help and a 47px box, and the width beside every one of
 * them was empty: 2180px of page for a form that is mostly short answers.
 *
 * Only the short ones pair up. A long address, a paragraph, a picture or a
 * row of its own keeps the full width, because halving the box a street
 * address goes in does not save anybody a scroll worth having.
 */
/* Two to a row for a field that has not said how wide it is.
 *
 * `:not([data-span])` is what makes the widths below mean anything. A
 * `:has()` carries the weight of what is inside it, so these three beat
 * `[data-span="3"]` even though that is written after them, and a screen
 * that had asked for five boxes across got two. Staff Profile sets
 * fifteen of them; Achievements Settings asks for 3/3/2/2/2 and was
 * given 6/6/6/6/6, which is the row it was trying not to take. */
@media (min-width: 60rem) {
    .cms-fields > .cms-field:not([data-span]):has(> .cms-input:not(textarea)),
    .cms-fields > .cms-field:not([data-span]):has(> .cms-select),
    .cms-fields > .cms-field:not([data-span]):has(> .cms-check) { grid-column: span 6; }

    /* Three to a row for a picture chosen from the library.
       ---------------------------------------------------------------
       The logo, the years badge and the browser tab icon were a column
       of three, each a label and a small thumbnail with the width beside
       it empty. They belong together and they are small, so they sit
       together.

       `.cms-picked` is what admin_picture_field() draws, which is not
       the `.cms-media-pick` a widget's picture field uses -- these were
       never caught by the full-width rule below; they simply matched
       nothing and fell back to twelve. */
    .cms-fields > .cms-field:not([data-span]):has(> .cms-picked) { grid-column: span 4; }

    .cms-fields > .cms-field:has(textarea),
    .cms-fields > .cms-field:has(.cms-media-pick),
    .cms-fields > .cms-field:has(.cms-repeater),
    .cms-fields > .cms-field:has(.cms-subfields) { grid-column: span 12; }
}
/* Said once, under the row of pickers it belongs to. It was under each
   of them: the same sentence three times across one row. */
.cms-pick-note { grid-column: 1 / -1; margin: 0 0 .2rem; }

.cms-fields .cms-field label,
.cms-fields .cms-field .cms-label { margin-bottom: .15rem; }
.cms-fields .cms-field .cms-help { font-size: .78rem; margin: .2rem 0 0; }
.cms-fields .cms-input,
.cms-fields .cms-select,
.cms-fields .cms-textarea { width: 100%; }

@media (min-width: 46rem) {
    .cms-fields > .cms-field[data-span="2"] { grid-column: span 2; }
    .cms-fields > .cms-field[data-span="3"] { grid-column: span 3; }
    .cms-fields > .cms-field[data-span="4"] { grid-column: span 4; }
    .cms-fields > .cms-field[data-span="5"] { grid-column: span 5; }
    .cms-fields > .cms-field[data-span="6"] { grid-column: span 6; }
    .cms-fields > .cms-field[data-span="8"] { grid-column: span 8; }
}
/* `.cms-label` is the same words in the same place as a `label`, for a
   caption that sits over several boxes and so belongs to none of them. */
.cms-field label,
.cms-field .cms-label { display: block; font-weight: 600; margin-bottom: .2rem; }
.cms-field .cms-help { display: block; color: var(--ink-soft); font-size: .85rem; margin-bottom: .35rem; }

/* How long a box is.
   ---------------------------------------------------------------------
   A card is 62rem across, and a box that filled it was a line as long as
   this paragraph for a username of five letters. Nothing about that is
   easier to read or to fill in: the eye travels the whole way to the right
   edge and finds nothing there.

   So a box still fills the column it is in -- a narrow column in a repeater
   row stays narrow -- but it never grows past a comfortable reading length,
   and a box whose content has a known, short length is given a width that
   suits it instead. The ceiling, not the width, is what changed: on a phone
   every one of these is still the width of the screen.

   `max-width` was 100% for a reason that still holds: where a box is let off
   a fixed width -- the search bars set width:auto -- a <select> grows to fit
   its longest option, and one long page name was enough to push the screen
   sideways. A smaller ceiling keeps that promise and adds to it. */
.cms-input, .cms-select, .cms-textarea {
    width: 100%;
    max-width: 30rem;
    padding: .45rem .6rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
}

/* Paragraphs, not a line: a box somebody writes in needs the room. */
.cms-textarea { max-width: 44rem; }

/* A list that stands the whole width of what it is in, where the screen
   wants it that way: the role on the account form sits alone on its line
   under three boxes that share one, and a short box there reads as a
   fourth box in that row rather than a question of its own.

   It is asked for by name, one screen at a time. Every other list keeps
   the ceiling. */
.cms-select--wide { max-width: none; }

/* A box that holds a number, a time or a date knows how long what it holds
   is. Twelve characters of date in thirty rems of box is the same waste,
   one line further down. */
.cms-input[type="number"] { max-width: 8rem; }
.cms-input[type="time"]   { max-width: 9rem; }
.cms-input[type="date"]   { max-width: 12rem; }
.cms-input[type="datetime-local"] { max-width: 15rem; }
.cms-input[type="color"]  { max-width: 5rem; }
.cms-input:focus, .cms-select:focus, .cms-textarea:focus {
    border-color: var(--brand); outline: 2px solid var(--brand-soft);
}
.cms-textarea { min-height: 7rem; resize: vertical; }
.cms-input[aria-invalid="true"] { border-color: var(--danger); }

.cms-pw { position: relative; }
.cms-pw .cms-input { padding-inline-end: 4.2rem; }
.cms-pw button {
    position: absolute; inset-inline-end: .35rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: 0; color: var(--ink-soft);
    font: inherit; font-size: .82rem; cursor: pointer; padding: .3rem .45rem;
}
.cms-pw button:hover { color: var(--brand); }

/* =====================================================================
   Sign-in screen
   ===================================================================== */

/* ---------------------------------------------------------------------
   Signing in

   Two halves on a laptop, one on a phone: the form in a column of its own
   and the college's name beside it. The panel carries nothing to click --
   a sign-in screen has exactly one thing to do on it, and the half that is
   not the form should not be competing for the same attention.

   Below 64rem the panel is gone entirely rather than stacked above the
   form. Stacked, it pushes the password box under the fold on a phone,
   which is the one thing this screen must never do.
   --------------------------------------------------------------------- */
.cms-login {
    /* The college's colours, on this screen only. Signing in is the front
       door and an admin and a member of staff come through the same one, so
       it wears the college's green rather than whichever colour somebody
       picked for the inside of the admin -- otherwise a member of staff
       signs in on one green and lands on another.

       Scoped here, so the picker still rules every screen past this one.
       The fallbacks are the admin's own, for an install with no theme
       stylesheet yet. */
    --brand:      var(--iw-green, #1f6b4a);
    --brand-dark: var(--iw-green-d, #185439);
    --brand-soft: var(--iw-green-l, #e8f2ec);
    /* The theme's own white. A college picks a brand colour its website
       already prints white on; --on-brand flips to near-black in dark mode,
       which on a dark green panel is a panel with nothing readable on it. */
    --on-brand:   var(--iw-white, #fff);

    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}
.cms-login-form {
    display: grid; place-items: center;
    padding: 1.5rem;
}
.cms-login-side { display: none; }

@media (min-width: 64rem) {
    .cms-login { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .cms-login-form { padding: 2rem; }
    .cms-login-mark { display: none; }

    .cms-login-side {
        display: grid; place-items: center;
        padding: 3rem;
        /* --brand with --on-brand, which is the pair this admin already
           uses for every solid brand fill. --brand-dark is a text colour:
           in dark mode it is the LIGHTER green, so a panel painted with it
           came out minty and the words on it vanished. */
        background: var(--brand);
        color: var(--on-brand);
    }
}

.cms-login-side-in { max-width: 22rem; text-align: center; }
/* The logo on its own white tile. The brand colour is the client's to
   choose -- green, blue, plum, rust -- and a logo drawn for one of them
   disappears on another. White is the paper every logo was drawn for. */
.cms-login-logo {
    width: 7rem; height: 7rem; margin-bottom: 1.5rem;
    padding: .9rem; border-radius: 18px;
    background: #fff; object-fit: contain;
    box-shadow: 0 6px 20px rgb(0 0 0 / .18);
}
.cms-login-side-name {
    margin: 0; font-size: 1.45rem; line-height: 1.3; font-weight: 700;
}
.cms-login-side-note {
    margin: .7rem 0 0; font-size: .95rem; opacity: .78;
}

.cms-login-box {
    width: 100%; max-width: 24rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: var(--shadow);
}
.cms-login-head { text-align: center; margin-bottom: 1.25rem; }
.cms-login-head .cms-brand-mark {
    margin: 0 auto .6rem; width: 2.6rem; height: 2.6rem; font-size: 1.1rem;
}
.cms-login-head h1 { margin: 0 0 .2rem; font-size: 1.2rem; }
.cms-login-head p  { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.cms-login-foot { margin-top: 1.1rem; text-align: center; font-size: .82rem; color: var(--ink-soft); }

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 1023px) {
    :root { --sidebar: 0px; }

    .cms-shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "top" "main";
    }

    .cms-side {
        position: fixed; inset-block: 0; inset-inline-start: 0;
        width: 15rem; z-index: 40;
        transform: translateX(-100%);
        transition: transform .18s ease-out;
        box-shadow: var(--shadow);
    }
    [dir="rtl"] .cms-side { transform: translateX(100%); }
    .cms-side.is-open { transform: translateX(0); }

    .cms-burger { display: block; }

    .cms-backdrop {
        position: fixed; inset: 0; z-index: 30;
        background: rgba(10, 20, 15, .4);
        border: 0; padding: 0;
    }
}

@media (max-width: 599px) {
    .cms-main { padding: 1rem; }
    .cms-card { padding: 1.1rem; }
    .cms-top  { padding: .65rem .9rem; gap: .6rem; }
    .cms-top h1 { font-size: 1rem; }
    .cms-who { font-size: .78rem; }
    .cms-who span { display: none; }       /* the role name; the name is enough */
    /* With a Back button in the row too, the name squeezed the screen's own
       heading down to one letter. Signing out is still there, and that says
       whose account it is. */
    .cms-who { display: none; }
    .cms-btn { padding: .55rem .85rem; font-size: .9rem; }
    .cms-bar-right { margin-inline-start: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cms-side { transition: none; }
}

/* =====================================================================
   Dark mode
   ===================================================================== */

/* The dark palette. Written twice on purpose, and only twice: once for a
   computer set to dark where nobody has chosen otherwise, and once for
   somebody who picked dark themselves. CSS has no way to say "these two
   selectors share a block" without a preprocessor, and a preprocessor is a
   build step this project does not have. */
@media (prefers-color-scheme: dark) {
    :root:not([data-scheme="light"]) {
        --ink:        #e7eeea;
        --ink-soft:   #a3b3ab;
        --line:       #2a3832;
        --line-soft:  #212d28;
        --bg:         #101613;
        --panel:      #171f1b;
        --brand:      #3c9068;
        --brand-dark: #4aa87a;
        --brand-soft: #1d2d25;
        --on-brand:   #0d1511;
        --on-brand-soft: #3d4f45;
        --danger:     #f0a0a0;
        --danger-soft:#2d1b1b;
        --warn:       #e3bd74;
        --warn-soft:  #2b2416;
        --ok:         #78ca9f;
        --ok-soft:    #152a20;
        --shadow:     0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
    }
}

:root[data-scheme="dark"] {
    --ink:        #e7eeea;
    --ink-soft:   #a3b3ab;
    --line:       #2a3832;
    --line-soft:  #212d28;
    --bg:         #101613;
    --panel:      #171f1b;
    --brand:      #3c9068;
    --brand-dark: #4aa87a;
    --brand-soft: #1d2d25;
    --on-brand:   #0d1511;
    --on-brand-soft: #3d4f45;
    --danger:     #f0a0a0;
    --danger-soft:#2d1b1b;
    --warn:       #e3bd74;
    --warn-soft:  #2b2416;
    --ok:         #78ca9f;
    --ok-soft:    #152a20;
    --shadow:     0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
}

/*
 * A quiet button has no fill, so it takes the ordinary text colour and not
 * the one meant for words sitting on a brand fill. This rule is here, after
 * .cms-btn, because it once lost to it on equal specificity and every
 * "Trash", "Cancel" and "Sign out" in the admin read as switched off.
 */
.cms-btn--quiet,
.cms-btn--quiet:hover,
.cms-btn--quiet:focus-visible { color: var(--ink); }

/* =====================================================================
   Tabs (Settings)
   ===================================================================== */

.cms-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-bottom: 1rem;
}

.cms-tab {
    padding: .5rem .95rem;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: var(--panel);
    color: var(--ink);
    text-decoration: none;
    font-size: .92rem;
}
/* The number on a tab: how many are under that role in all, not how many
   a search has left. A tab saying 3 that opens on 1 is worse than a tab
   saying nothing. */
.cms-tab-n{display:inline-block;margin-left:.35rem;padding:0 .35rem;border-radius:99px;
  background:var(--line-soft);font-size:.75rem;font-weight:600;color:var(--ink-soft)}
.cms-tab.is-on .cms-tab-n{background:rgba(255,255,255,.22);color:inherit}
.cms-tab:hover { border-color: var(--brand); color: var(--brand-dark); }
.cms-tab.is-on {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
}

/* A yes/no setting reads as one line, not a label floating above a box. */
.cms-check {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 600;
    cursor: pointer;
}
.cms-check input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--brand);
    flex: 0 0 auto;
}

.cms-help--bad { color: var(--danger); font-weight: 600; }

/* =====================================================================
   Help, off the screen and onto the label

   Every explanation in the admin used to sit under the thing it
   explains. Measured across the thirty-odd screens: a hundred and
   eighteen of them, around 26px each, and on the screens that carry
   many fields it was most of what somebody scrolled past -- the same
   sentence, every day, long after they knew it.
 *
 * Hidden, not deleted, and not `display: none`: this way a screen
 * reader still reads every word of it, admin.js puts it on the field's
 * label so hovering gives it back, and nothing a college wrote is lost.
 *
 * A warning is not help. `.cms-help--bad` is the colour that cannot be
 * read, the picture that is too small, the name already taken -- those
 * stay where somebody will see them.
 *
 * Nor is a link. Seven of these hold one -- "Upload the file first",
 * and on a staff record the attached file itself -- and a link nobody
 * can click is worse than a line nobody reads.
 *
 * The one line a screen is allowed is its opening line, which is a
 * `.cms-hint` in the bar beside the heading, not one of these.
   ===================================================================== */
.cms-help:not(.cms-help--bad):not(:has(a)) {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.cms-tab.is-on { color: var(--on-brand); }

/* =====================================================================
   Tabs inside one screen

   The tabs above are links: each one is a screen of its own with its own
   address. These are not. They are one form, cut into parts, so that six
   slides are six tabs rather than six blocks somebody scrolls past -- and
   so that everything typed into every one of them is still saved by the
   one Save at the bottom, whichever tab happens to be open.

   A part that is not open is `hidden`, which keeps it out of the tab order
   as well as off the screen, and still posts what is in it.
   ===================================================================== */

.cms-panes-strip {
    display: flex; flex-wrap: wrap; gap: .35rem;
    margin-bottom: .75rem;
}

/* The browser's own rule for `hidden` is display:none at the weakest
   strength there is, so any `display` a part already carries beats it --
   and a repeater row carries display:flex. Without this the tabs select
   correctly and every slide stays on the screen. */
[data-pane][hidden] { display: none; }

.cms-pane-tab {
    padding: .35rem .8rem;
    border: 1px solid var(--line); border-radius: 99px;
    background: var(--panel); color: var(--ink);
    font: inherit; font-size: .85rem; cursor: pointer;
}
.cms-pane-tab:hover { border-color: var(--brand); color: var(--brand-dark); }
.cms-pane-tab.is-on {
    background: var(--brand); border-color: var(--brand);
    color: var(--on-brand); font-weight: 600;
}
/* A part holding something that needs attention says so on its tab, so a
   problem on a tab nobody is looking at is not a problem nobody is told
   about. */
.cms-pane-tab.has-problem { border-color: var(--danger); color: var(--danger); }
.cms-pane-tab.has-problem.is-on { background: var(--danger); border-color: var(--danger); color: #fff; }

/* The spare one at the end. It is not a slide that is there already -- it
   is the empty one waiting to be filled in -- so it is dashed and quiet
   rather than another numbered tab in the row. */
.cms-pane-tab--add {
    border-style: dashed; color: var(--ink-soft);
}
.cms-pane-tab--add.is-on { border-style: solid; color: var(--on-brand); }

/* Settings in columns rather than one under another.
   ---------------------------------------------------------------------
   Background, Text size, Space around it: three words, three boxes, each
   on a line of its own and each as wide as the card. Across the width of
   the card they are three boxes on one line, each the width of what goes
   in it, and the block is a third of the height.

   A column is never narrower than 16rem -- a date box wants about that much
   before its calendar button starts crowding the digits -- so on a phone
   they go back to one under another by themselves. */
.cms-fields-across {
    display: grid; gap: .3rem .9rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    align-items: start;
}
.cms-fields-across > .cms-field { min-width: 0; }

/* =====================================================================
   Photos and files
   ===================================================================== */

.cms-bar {
    display: flex; flex-wrap: wrap; gap: .6rem;
    align-items: center; margin-bottom: .55rem;
}
/* One line where there is room for one.
   ---------------------------------------------------------------------
   The form wrapped before the bar did, so Search sat alone on a second
   row under a row with space left in it. It stays on the line and the
   box gives way instead; below 60rem everything wraps as before. */
.cms-search { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; flex: 1 1 20rem; }
.cms-search .cms-input { flex: 1 1 12rem; width: auto; min-width: 0; }
.cms-search .cms-select { width: auto; flex: 0 1 auto; min-width: 0; }

@media (min-width: 60rem) {
    .cms-search { flex-wrap: nowrap; }
    .cms-search .cms-input { flex: 1 1 8rem; }
}

/* Icon only, with the name on the tooltip and on the icon itself for a
   screen reader. Square, so a row of them reads as a row. */
.cms-btn--icon {
    width: 2.4rem; padding-inline: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.cms-btn--icon .cms-i { margin: 0; }
/* The bar itself wraps, so this group drops to its own line when it has to
   -- but the buttons inside it did not, and "Trash" beside "Add department"
   is wider than a phone. That pushed the whole screen sideways. */
.cms-bar-right { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: .5rem; }

/* --- drop zone --- */
/* A button on the bar. See media.php for why.
   It keeps the id and the `is-over` class, because it is still what
   lights up while a file is being dragged over the page. */
.cms-drop {
    transition: border-color .15s, background .15s;
}
/* Something is being dragged over the page: the button says where it
   will land. An outline rather than a colour, so a button that is
   already the brand colour still visibly changes. */
.cms-drop.is-over { outline: 3px solid var(--brand); outline-offset: 2px; }
.cms-drop-link { color: var(--brand); text-decoration: underline; }

/* --- upload progress --- */
.cms-uploads { list-style: none; margin: 1rem 0 0; padding: 0; }
.cms-upload {
    display: grid;
    grid-template-columns: minmax(0, 14rem) 1fr;
    gap: .25rem .75rem;
    align-items: center;
    padding: .5rem 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: .9rem;
}
.cms-upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cms-upload-bar {
    grid-column: 2; height: .45rem; border-radius: 99px;
    background: var(--line-soft); overflow: hidden;
}
.cms-upload-fill {
    display: block; height: 100%; width: 0;
    background: var(--brand); transition: width .15s linear;
}
.cms-upload-msg { grid-column: 2; color: var(--ink-soft); font-size: .82rem; }
.cms-upload.is-done .cms-upload-fill { background: var(--ok); }
.cms-upload.is-done .cms-upload-msg  { color: var(--ok); }
.cms-upload.is-bad  .cms-upload-fill { background: var(--danger); }
.cms-upload.is-bad  .cms-upload-msg  { color: var(--danger); font-weight: 600; }

/* --- the grid --- */
.cms-media {
    list-style: none; margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
    gap: .85rem;
    /* Level bottoms, asked for.
       ---------------------------------------------------------------
       This used to let each file be as tall as itself, so a PDF was not
       given the 4:3 band of grey a photograph needs. The college would
       rather the rows lined up, so every tile takes the height of the
       tallest in its row and the buttons sit on the floor of each.
       What that costs is paid back above: the size, the shape and the
       date are two tight lines now instead of two or three loose ones. */
    align-items: stretch;
}
.cms-tile {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
    display: flex; flex-direction: column;
}
.cms-tile.is-new  { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cms-tile.is-going { opacity: 0; transform: scale(.97); transition: opacity .2s, transform .2s; }

/* A shorter band, and the whole picture in it.
   ---------------------------------------------------------------------
   The band was 4:3 and the picture filled it, so what somebody saw was
   the middle of the file and not the file. Measured across this
   college's own twenty-four pictures, 72% of each one was showing --
   and the square seals fared worst of all: NAAC, NIRF and Green Campus
   were cut to three quarters, while a wide banner logo was down to 26%.
   A library is for recognising files, and half a seal is hard to tell
   from half another one.

   `contain` shows all of every picture whatever shape it is, which also
   frees the band to be shorter: at 2:1 a tile is 50px less tall and the
   page 298px shorter, with MORE of each picture visible than before,
   not less. The grey around a tall one is the cost, and it is the same
   grey a PDF sits on. */
.cms-tile-view {
    position: relative;             /* a height the picture can measure */
    aspect-ratio: 2 / 1;
    background: var(--line-soft);
    display: grid; place-items: center;
    overflow: hidden;
}
/* Bounded, not stretched.
   ---------------------------------------------------------------------
   `width: 100%; height: 100%` looked like the way to fill the band, and
   the height never resolved: the parent's is set by aspect-ratio, which
   a percentage cannot read. So the box became the band's WIDTH by the
   picture's own shape -- 199x199 for a 100x100 logo -- and object-fit
   had nothing left to do. A 94px logo was drawn at 2.12 times its size,
   soft and cut off top and bottom by the band's overflow.

   Bounds instead. The grid centres what is inside it, so a picture
   smaller than the band is left at its own size and stays crisp, and a
   bigger one comes down to fit whole. */
.cms-tile-view img {
    /* Laid over the band rather than inside it, so `inset: 0` gives the
       picture a height to measure 100% against. In the ordinary flow the
       parent's height comes from aspect-ratio, which a percentage cannot
       read: max-height never resolved and a tall clipping was drawn 253px
       deep in a 99px band, with the rest cut off. */
    position: absolute; inset: 0; margin: auto;
    max-width: 100%; max-height: 100%;
    width: auto; height: auto;
    display: block;
}
.cms-tile-ext { font-weight: 700; color: var(--ink-soft); letter-spacing: .05em; }

/* A document keeps the strip and not the picture frame: 4:3 of grey
   around the word PDF is 134px a file, and thirty-two of them is most of
   the screen. */
/* A document gets the same band as a photograph, so the words under
   the two of them start at the same height. */
.cms-tile--doc .cms-tile-view { padding: .45rem; }
.cms-tile--doc .cms-tile-ext { font-size: .95rem; }

.cms-tile-body {
    padding: .55rem .7rem .6rem;
    display: flex; flex-direction: column; gap: .25rem;
    flex: 1 1 auto;                 /* fill the stretched tile... */
}
/* ...so the buttons rest on the floor of every tile, level with the
   buttons beside them, whatever is above. */
.cms-media:not(.cms-media--list) .cms-tile-acts { margin-top: auto; }

/* The same files, one to a line.
   ---------------------------------------------------------------------
   One template, one set of markup: the shape is the stylesheet's. The
   body becomes `display: contents` so the name, the size and the
   actions stop being a stack inside a card and become cells on the row.

   Measured at 1440px with the college's own library: thirty-two files
   as tiles is 2626px, and as a list 1380px.

   What is in a photograph is asked in the tiles, where there is a line
   to write it on. On a row there is not, and a box squeezed between a
   name and a date is a box nobody fills in properly. */
/* A row is a row across the whole list, not a row of its own.
   ---------------------------------------------------------------------
   Five columns, because a tile has five things in it, and the first of
   them is easy to forget: whether the file is used. It was, and
   everything sat one column left of where it was meant to -- USED
   wrapped onto two lines inside 1.5rem, the thumbnail took the column
   meant to stretch, and every file name was pushed right by whatever
   slack was left over.

   The columns belong to the list rather than to each tile. They were on
   the tile, so forty rows sized their columns forty different ways and
   no two file names began at the same place. A list is a table or it is
   nothing.

   subgrid is how a row borrows them. A browser that does not know it
   drops the line and the tile falls back to columns of its own, which
   is what this looked like before -- worse, not broken. */
.cms-media--list {
    grid-template-columns: auto 1.5rem minmax(0, 1fr) auto auto;
    gap: 0 .6rem;
}
/* The thumbnail is what sets the height of a row, so it is what decides
   how many files fit on a screen. At 2rem a row was 42px; the tables
   worth copying -- Attio, Clay, folk, Dovetail, Vanta, Xero, Skiff --
   sit at 32 to 36. 1.5rem gives 32, which is ten more files on a screen
   over a page of forty-eight. */
.cms-media--list .cms-tile {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: center;
    gap: .6rem;
    border: 0; border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
    padding: .22rem .4rem;
}
.cms-media--list .cms-tile:last-child { border-bottom: 0; }
.cms-media--list .cms-tile-view {
    width: 1.5rem; height: 1.5rem; aspect-ratio: 1;
    border-radius: 3px; padding: 0;
}
.cms-media--list .cms-tile-ext { font-size: .6rem; }
.cms-media--list .cms-tile-body { display: contents; }
.cms-media--list .cms-tile-meta { white-space: nowrap; }
/* Two words on one line. It had 1.5rem to live in, which is narrower
   than the word "USED". */
.cms-media--list .cms-tile-use { white-space: nowrap; }
.cms-media--list .cms-tile-acts { justify-content: flex-end; }

/* Used, or spare.
   ---------------------------------------------------------------------
   Two words, and the places themselves on the tooltip. A library is easy
   to add to and frightening to tidy; this is the one thing somebody
   needs before reaching for Trash, and it is now on every file rather
   than on the refusal after the click. */
.cms-tile-use {
    margin: 0; font-size: .74rem; font-weight: 600;
    letter-spacing: .02em; text-transform: uppercase;
}
/* In the corner of the picture rather than down in the words: it is the
   one thing on a tile that is scanned rather than read. Somebody tidying
   a library runs their eye down the column looking for the spare ones,
   and a word in a paragraph of other words is not something an eye can
   run down. */
.cms-tile { position: relative; }
.cms-media:not(.cms-media--list) .cms-tile-use {
    position: absolute; top: .3rem; right: .3rem; z-index: 1;
    padding: .1rem .35rem; border-radius: 4px;
    background: var(--panel); border: 1px solid var(--line);
    font-size: .68rem;
}
/* How long ago, under the date rather than beside it: the date says
   which day and this says whether it is the one from this morning. */
.cms-tile-ago { display: inline; }

/* Written as the character itself. It was "\00b7", the CSS escape for
   it, and the script that wrote this file read the \00 as a byte and
   put a real NUL here -- so the page showed a broken box and "b7"
   between the date and how long ago it was. */

.cms-tile-use.is-used  { color: var(--ink-soft); }
/* Where it leads somewhere, it looks like it does. */
a.cms-tile-use { text-decoration: underline; text-underline-offset: 2px; }
a.cms-tile-use:hover { color: var(--brand); }
.cms-tile-use.is-spare { color: var(--warn, #9a6b00); }

/* The amber edge is what is left of "Needed for people using a screen
   reader": no height, and it still catches the eye down a page of
   photographs. The words moved into the box they belong to. */
.cms-tile-alt.is-empty { border-left: 3px solid var(--warn, #9a6b00); }
/* Asked in the tiles, where there is a line to write it on. */
/* `label.cms-sr`, not every .cms-sr: this is here for the alt box's
   own label, which has nothing to point at in a list because the box
   itself is not drawn. Written broadly it also took the name off the
   tile's icon buttons, which is the only name they have. */
.cms-media--list .cms-tile-alt,
.cms-media--list .cms-tile-warn,
.cms-media--list label.cms-sr { display: none; }

.cms-tile-name {
    margin: 0; font-size: .88rem; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Two lines, and only two. Each half is a block, so the break is where
   it is meant to be rather than wherever the words ran out. */
.cms-tile-meta { margin: 0; font-size: .75rem; line-height: 1.35; color: var(--ink-soft); }
.cms-media:not(.cms-media--list) .cms-tile-size,
.cms-media:not(.cms-media--list) .cms-tile-when {
    display: block;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cms-tile-alt  { font-size: .82rem; padding: .35rem .5rem; }
.cms-tile-alt.is-saving { opacity: .6; }
.cms-tile-alt.is-saved  { border-color: var(--ok); }
.cms-tile-alt.is-bad    { border-color: var(--danger); }
.cms-tile-warn { font-size: .72rem; color: var(--warn); }

/* --- icons ---
   Drawn from the sprite in _icons.php, sized in ems so they follow the
   text they sit beside and take its colour. */
.cms-i {
    width: 1.05em; height: 1.05em; flex: 0 0 auto;
    vertical-align: -.18em;
}
.cms-btn .cms-i { margin-right: .45rem; }

/* A tile's actions: five of them, on one line.
   ---------------------------------------------------------------------
   They were four underlined words that wrapped to two rows on a narrow
   tile and pushed the tiles below it out of line. As icons they fit,
   and each one keeps its name for a screen reader and its tooltip for
   everybody else -- an icon with neither is a guess.

   Copy the address made it five on a photograph -- open, copy, crop,
   replace, trash. A tile is 11rem at its narrowest and its body takes
   1.4rem of that in padding, which leaves 9.6rem; five at 1.9rem with
   .15rem between them came to 10.1rem and the last one hung over the
   edge. 1.75rem and .1rem is 9.15rem, which fits with room to spare,
   and the icon inside is untouched: the box is smaller, the shape in
   it is the same size it always was. */
.cms-tile-acts {
    display: flex; flex-wrap: nowrap; align-items: center;
    gap: .1rem; margin-top: .15rem;
}
.cms-tile-acts a, .cms-tile-acts button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.75rem; height: 1.75rem; flex: 0 0 auto;
    background: none; border: 0; padding: 0; border-radius: 6px;
    font: inherit; font-size: .78rem;
    color: var(--ink-soft, #55675d); text-decoration: none; cursor: pointer;
}
.cms-tile-acts a:hover, .cms-tile-acts button:hover,
.cms-tile-acts a:focus-visible, .cms-tile-acts button:focus-visible {
    background: var(--brand-soft, #eef3f0); color: var(--brand);
}
.cms-tile-acts .cms-i { width: 1.05rem; height: 1.05rem; vertical-align: 0; }
.cms-tile-acts .cms-danger { color: var(--danger); }

/* Copied.
   ---------------------------------------------------------------------
   The message above the grid says which address went to the clipboard,
   which is the answer; this is the button saying it was this button,
   for the eye that is already on it. A second and a bit, because a
   click that leaves nothing behind feels like a click that missed. */
.cms-tile-acts .is-copied,
.cms-tile-acts .is-copied:hover { background: var(--brand); color: var(--on-brand); }

/* --- paging --- */
.cms-pages { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: 1rem; }
.cms-page {
    min-width: 2.2rem; padding: .35rem .6rem; text-align: center;
    border: 1px solid var(--line); border-radius: 6px;
    text-decoration: none; color: var(--ink); font-size: .9rem;
}
.cms-page.is-on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }

.cms-say { position: sticky; top: .5rem; z-index: 15; }



/* =====================================================================
   Tables (Words on the site, Activity)
   ===================================================================== */

/* A wide table scrolls inside its own box, never the whole page. */
.cms-table-wrap { overflow-x: auto; margin-top: .5rem; }

.cms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}
.cms-table th, .cms-table td {
    text-align: start;
    padding: .55rem .6rem;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: top;
}
.cms-table th {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.cms-table tbody tr:hover { background: var(--line-soft); }
.cms-table tr.is-changed { background: var(--brand-soft); }
.cms-table tr.is-changed:hover { background: var(--brand-soft); }

.cms-key { font-weight: 600; display: block; }
.cms-default { color: var(--ink-soft); max-width: 18rem; }
.cms-label-input { min-width: 12rem; }
.cms-label-input.is-saving { opacity: .6; }
.cms-label-input.is-saved  { border-color: var(--ok); }
.cms-label-input.is-bad    { border-color: var(--danger); }

.cms-reset {
    background: none; border: 0; padding: 0;
    font: inherit; font-size: .8rem;
    color: var(--brand); text-decoration: underline;
    cursor: pointer; white-space: nowrap;
}

/* On a phone a row becomes a small stack, so nothing is cut off. */
@media (max-width: 699px) {
    .cms-table thead { display: none; }
    .cms-table, .cms-table tbody, .cms-table tr, .cms-table td { display: block; width: 100%; }
    .cms-table tr {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: .6rem;
        margin-bottom: .6rem;
    }
    .cms-table td { border: 0; padding: .25rem 0; }
    .cms-default::before {
        content: "Theme wording: ";
        font-size: .78rem; color: var(--ink-soft);
    }
    .cms-default { max-width: none; }
}

/* =====================================================================
   Activity
   ===================================================================== */

.cms-when { white-space: nowrap; color: var(--ink-soft); font-size: .85rem; }

.cms-act {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}
.cms-act--good  { background: var(--ok-soft);     color: var(--ok); }
.cms-act--bad   { background: var(--danger-soft); color: var(--danger); }
.cms-act--plain { background: var(--line-soft);   color: var(--ink-soft); }

.cms-what { display: block; margin-top: .15rem; }
.cms-changes { font-size: .85rem; line-height: 1.5; }
.cms-was { color: var(--ink-soft); text-decoration: line-through; }

/* =====================================================================
   The page tree
   ===================================================================== */

.cms-tree, .cms-tree-children { list-style: none; margin: 0; padding: 0; }
.cms-tree-children { margin-inline-start: 26px; border-inline-start: 1px solid var(--line); }

.cms-tree-row {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .25rem;
    border-bottom: 1px solid var(--line-soft);
}
.cms-tree-item.is-dragging > .cms-tree-row {
    background: var(--brand-soft);
    border-radius: 8px;
    box-shadow: var(--shadow);
    opacity: .95;
}
.cms-tree.is-sorting .cms-tree-row { cursor: grabbing; }
body.cms-dragging { user-select: none; }

.cms-grab {
    flex: 0 0 1rem; color: var(--ink-soft);
    cursor: grab; font-size: .85rem; line-height: 1;
    touch-action: none;           /* the drag handles the gesture, not the page */
}
.cms-grab:active { cursor: grabbing; }
.cms-grab--off { cursor: default; opacity: 0; }

/* --- folding a branch away ---
   `is-shut` is written by PHP so the hundred and eighty department rows are
   never drawn open and then collapsed in front of somebody. It only bites
   under .cms-js: with no script there is no way back open, so nothing folds. */
.cms-js .cms-tree-item.is-shut > .cms-tree-children { display: none; }

.cms-fold {
    flex: 0 0 1.4rem;
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.4rem; height: 1.4rem; padding: 0;
    background: none; border: 1px solid transparent; border-radius: 6px;
    color: var(--ink-soft); cursor: pointer;
}
.cms-fold:hover { background: var(--line-soft); color: var(--ink); }
.cms-fold:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.cms-fold--none { cursor: default; }

/* A triangle drawn in CSS, so it turns rather than swapping character. */
.cms-fold-mark {
    width: 0; height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-inline-start: 6px solid currentColor;
    transition: transform .12s ease-out;
}
.cms-fold[aria-expanded="true"] .cms-fold-mark { transform: rotate(90deg); }
[dir="rtl"] .cms-fold-mark { transform: rotate(180deg); }
[dir="rtl"] .cms-fold[aria-expanded="true"] .cms-fold-mark { transform: rotate(90deg); }

@media (prefers-reduced-motion: reduce) {
    .cms-fold-mark { transition: none; }
}

.cms-tree-count { color: var(--ink); font-weight: 600; }

.cms-fold-bar {
    display: flex; align-items: center; gap: .5rem;
    margin-bottom: .35rem;
}
.cms-nojs .cms-js-only { display: none; }

/* The card at the top of the section editor is gone: the title bar and the
   trail under it already said the page, the place on it and the section's
   own name, and the form's own heading said its kind. What stands there now
   is two buttons, and a warning only where there is one to give. */

/* One line, always. A trail four levels deep wrapped to four lines, which
   grew the top bar until the + Add button sat on top of it. */
.cms-crumb {
    display: flex; align-items: center; gap: .1rem .4rem;
    font-size: .8rem; color: var(--ink-soft);
    min-width: 0; overflow: hidden; white-space: nowrap;
}
.cms-crumb > * { overflow: hidden; text-overflow: ellipsis; }
.cms-crumb > * + *::before {
    content: "›";
    margin-inline-end: .4rem;
    color: var(--ink-soft);
}
.cms-crumb a { color: var(--brand); text-decoration: none; }
.cms-crumb a:hover { text-decoration: underline; }
.cms-crumb [aria-current="page"] { color: var(--ink); font-weight: 600; }

.cms-tree-main { flex: 1 1 auto; min-width: 0; }
.cms-tree-title { display: block; font-weight: 600; text-decoration: none; }
.cms-tree-meta {
    display: block; font-size: .78rem; color: var(--ink-soft);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.cms-tree-state { flex: 0 0 auto; }
.cms-pill {
    display: inline-block; padding: .15rem .6rem;
    border: 1px solid transparent; border-radius: 99px;
    font: inherit; font-size: .72rem; font-weight: 600;
    cursor: pointer;
}
.cms-pill--on  { background: var(--ok-soft);   color: var(--ok);       border-color: #bfe0cd; }
.cms-pill--off { background: var(--line-soft); color: var(--ink-soft); border-color: var(--line); }

.cms-tree-acts { flex: 0 0 auto; display: flex; gap: .7rem; }
.cms-tree-acts a, .cms-tree-acts button {
    background: none; border: 0; padding: 0;
    font: inherit; font-size: .78rem;
    color: var(--brand); text-decoration: underline; cursor: pointer;
}

.cms-tree-saving { color: var(--ink-soft); font-style: italic; }

/* --- the page form --- */
.cms-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.cms-more { padding: 0; }
.cms-more > summary {
    padding: 1rem 1.25rem; cursor: pointer;
    font-weight: 600; list-style: none;
}
.cms-more > summary::-webkit-details-marker { display: none; }
.cms-more > summary::before { content: "▸ "; color: var(--ink-soft); }
.cms-more[open] > summary::before { content: "▾ "; }
.cms-more[open] > summary { border-bottom: 1px solid var(--line-soft); margin-bottom: 1rem; }
.cms-more > *:not(summary) { padding-inline: 1.25rem; }
.cms-more > *:last-child { padding-bottom: 1.25rem; }

@media (max-width: 599px) {
    .cms-tree-row { flex-wrap: wrap; }
    .cms-tree-main { flex: 1 1 100%; order: 1; }
    .cms-grab { order: 0; }
    .cms-tree-state { order: 0; margin-inline-start: auto; }
    .cms-tree-acts { order: 2; flex: 1 1 100%; padding-inline-start: 1.6rem; }
    .cms-tree-children { margin-inline-start: 14px; }
}

/* =====================================================================
   Themes screen.
   ===================================================================== */

/* The themes, side by side and wide enough to read.
   ---------------------------------------------------------------------
   They used the four-across grid the rest of the admin uses. Two themes
   in four columns is two cards 229px wide with two empty columns beside
   them, and a description that reads in four lines wrapping into ten:
   375px a card, on a screen whose whole job is two cards and a list of
   colours. */
.cms-themes {
    display: grid; gap: .5rem;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    align-items: start;
}

/* One line a theme. A college picks a theme once; the card was 160px of
   name, version, three lines of blurb and a button, twice over, at the
   top of a screen they open to change a colour. The blurb is on the
   card's title now, so hovering still gives it. */
.cms-theme {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .4rem .6rem;
    background: var(--panel);
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.cms-theme.is-on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.cms-theme h3 { margin: 0; font-size: .95rem; }
.cms-theme-meta { font-size: .75rem; color: var(--ink-soft); }
.cms-theme form { margin-left: auto; }
.cms-theme > .cms-pill { margin-left: auto; }

/* The words beside the control rather than above it.
 *
 * Measured on Look of the site: a token was 105px tall -- a 26px label, a
 * 26px line of help, and the 46px that is the control itself. More than
 * half the height of the screen was text stacked on top of the thing it
 * describes, and the width beside it was empty. Side by side, a token is
 * as tall as the taller of the two.
 *
 * The help is on the label's title for every kind now, including the
 * gradients and surfaces that used to keep theirs in the open: those are
 * a single row each, so a line of prose under one is the row over again.
 */
.cms-tokens {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: .5rem .9rem;
}
.cms-token {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .25rem .6rem;
}
/* Seven of the seventeen colour labels wrap at a third of the width --
   "Deeper soft background", "Words on a gradient" -- and a grid row is as
   tall as its tallest cell, so every row was 51px for a 31px control.
   Two lines at this size are 30px and the row is the control again. */
.cms-token label { font-weight: 600; margin: 0; align-self: center;
    font-size: .84rem; line-height: 1.15; }
/* And the code box takes what #RRGGBB needs, not what was going spare:
   the width it was giving back is the width the labels wrap for. */
.cms-token .cms-hex { flex: 0 0 4.6rem; min-width: 0; max-width: 4.6rem;
    font-size: .76rem; padding-inline: .3rem; }
.cms-token > label { grid-column: 1; grid-row: 1; }
.cms-token > :not(label) { grid-column: 2; grid-row: 1; }

/* A warning is the one thing here that is a sentence.
   ---------------------------------------------------------------------
   "One end of this gradient is too pale against the white writing on the
   menu bar" does not belong in the cell a swatch sits in. In the grid it
   was laid in the same cell as the control and printed over it; in the
   gradient row it was handed whatever width was left over, which was
   none, and ran across the colours.

   It takes a line of its own under the row, in both shapes. The row is
   already as wide as the card, so there is nowhere else for a sentence
   to go. */
.cms-token > .cms-help--bad { grid-column: 1 / -1; grid-row: 2; }
.cms-token:has(.cms-grad) > .cms-help--bad { flex: 1 1 100%; order: 9; margin: 0; }

/* A gradient and a surface ask five questions, and stacking them made a
   token 370px tall. Across the full width they are one line.
 *
 * One line, not two. The label was `flex: 0 0 8.5rem` beside a .cms-grad
 * with no basis at all, so the gradient claimed the whole width and
 * pushed itself onto a second row -- 12 gradients x 36px of nothing.
 * The gradient takes what is left beside the label instead, and every
 * piece inside it is sized to fit in what that leaves: measured at
 * 950px of content, which is a 1440px window. */
.cms-token:has(.cms-grad) {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .6rem;
}
/* Two short lines, not two tall ones. "Slider picture shade" wraps at
   8rem, and at the body size those two lines were 51px against a 31px
   control -- the label, not the thing it names, setting the height of
   three of the twelve rows. */
.cms-token:has(.cms-grad) > label { flex: 0 0 7.5rem; margin: 0;
    font-size: .84rem; line-height: 1.15; }

/* One line, and it stays one line.
 *
 * Every piece had a fixed width and the row was allowed to wrap. That
 * fits at a 1366px window with 28px to spare, and wraps at anything
 * narrower, at browser zoom, or at a larger default font -- and a
 * wrapped Through is the second row back again, twelve times over.
 *
 * So nothing wraps: the two dropdowns give way instead. A dropdown short
 * of room shortens its own text and still opens in full, which is a far
 * smaller loss than the row splitting in two. Below 70rem, where
 * shortening them would leave nothing to read, wrapping comes back. */
.cms-token:has(.cms-grad) .cms-grad {
    flex: 1 1 0; min-width: 0;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: .25rem .5rem;
}
@media (min-width: 64rem) {
    .cms-token:has(.cms-grad) .cms-grad { flex-wrap: nowrap; }
}
.cms-token:has(.cms-grad) .cms-grad > .cms-select { flex: 0 1 8.5rem; min-width: 3.5rem; }
.cms-token:has(.cms-grad) .cms-grad-row { flex: 0 0 auto; gap: .3rem; }
/* The one holding a dropdown is the one allowed to give way. */
.cms-token:has(.cms-grad) .cms-grad-row:has(> .cms-select) { flex: 0 1 auto; min-width: 0; }
.cms-token:has(.cms-grad) .cms-grad-row .cms-select { flex: 0 1 6.25rem; min-width: 3.5rem; }
.cms-token:has(.cms-grad) .cms-hex { flex: 0 0 4.2rem; max-width: 4.2rem; min-width: 0;
    font-size: .76rem; padding-inline: .25rem; }
.cms-token:has(.cms-grad) .cms-swatch { width: 2.3rem; }
.cms-token:has(.cms-grad) .cms-grad-word { flex: 0 0 auto; }
/* What the row adds up to, at the end of the row where the eye lands
   after answering it. Two swatches and an arrow do not look like a
   gradient; this is the gradient. The border is for the pale ones --
   #FFFFFF to #FFFFFF against a white card is otherwise nothing at all,
   and "nothing at all" is a fair thing to be able to see. */
.cms-token:has(.cms-grad) .cms-grad-see { flex: 0 0 4.5rem; }

.cms-token.is-bad { outline: 2px solid var(--danger); outline-offset: 6px; border-radius: 6px; }

.cms-swatch-row { display: flex; align-items: center; gap: .6rem; }

/* A gradient: which way it runs, then where it starts and where it ends.
   The two colours used to be labelled From and To; they sit in that
   order already, so an arrow says it in 14px instead of 58. */
.cms-grad { display: flex; flex-direction: column; gap: .4rem; }
.cms-grad-row { display: flex; align-items: center; gap: .4rem; }
.cms-grad-word { font-size: .78rem; color: var(--ink-soft); white-space: nowrap; }
.cms-grad-arrow { font-size: .9rem; color: var(--ink-soft); line-height: 1; }
.cms-grad-see {
    display: block; height: 1.6rem; border-radius: 5px;
    border: 1px solid var(--line); background-clip: padding-box;
    /* It is a way in as well as a picture: clicking where a colour is
       opens that colour. themes.js works out which stop is nearest. */
    cursor: pointer;
}
.cms-grad-see:hover { border-color: var(--brand); }
.cms-grad-see[hidden] { display: none; }
.cms-grad-row .cms-swatch { flex: 0 0 auto; }

/* A row put away is put away. `hidden` is the weakest rule a browser has
   and `display: flex` two lines up beats it, so the Colour row of a
   surface set to a gradient was invisible and still 166px wide -- which
   is what pushed Through onto a second line. */
.cms-grad-row[hidden] { display: none; }

/* The colour code: wide enough for #RRGGBB and no wider, so it reads as a
   code rather than an empty field waiting for a sentence. */
.cms-hex { flex: 1 1 6rem; min-width: 5.5rem; max-width: 9rem;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    text-transform: uppercase; }
.cms-hex[readonly] { background: transparent; border-style: dashed; cursor: default; }
.cms-hex.is-bad { border-color: var(--danger); }
.cms-swatch {
    width: 3rem; height: 2.2rem; padding: 0;
    border: 1px solid var(--line); border-radius: 6px;
    background: none; cursor: pointer;
}
.cms-swatch-value {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: .82rem; color: var(--ink-soft);
}

/* --- Accreditation seals --- */
.cms-input--tiny { max-width: 7rem; }
.cms-seals td { vertical-align: top; }

.cms-seal-preview { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.2rem; }
.cms-seal-preview li { display: flex; flex-direction: column; align-items: center; width: 6rem; text-align: center; font-size: .75rem; gap: .35rem; }
.cms-seal-circle {
    width: 2.6rem; height: 2.6rem; border-radius: 50%;
    display: grid; place-items: center; overflow: hidden;
    background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: .72rem;
}
.cms-seal-circle img { width: 100%; height: 100%; object-fit: contain; }

/* =====================================================================
   Sections
   ===================================================================== */

.cms-field--bad { outline: 2px solid var(--danger); outline-offset: 6px; border-radius: 6px; }
.cms-field-preview { display: block; margin-top: .5rem; max-width: 120px; }
.cms-field-preview img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }

.cms-subfields { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cms-subfields > span { flex: 1 1 12rem; }

/* --- repeater rows --- */
/* A repeater is read down the page, so every row's height is paid four or
   six times over. Four slides of a picture, a tag, a heading, a line, two
   buttons and a placement was a form nobody could see the bottom of.

   So the rows are tighter and the boxes inside them narrower, which fits
   more of them across before wrapping. Taking the per-field instructions
   out of the slider did the rest: they were the tallest thing in each row
   and they said the same words in every one. */
.cms-repeater { display: grid; gap: .4rem; }
.cms-repeater-row {
    display: flex; align-items: flex-start; gap: .5rem;
    padding: .45rem .5rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--bg);
}
/* Which row this is on the screen, so the Order box has something to be
   read against. Not a grip: nothing here drags. */
.cms-repeater-no {
    color: var(--ink-soft); font-size: .75rem; font-variant-numeric: tabular-nums;
    padding-top: 1.45rem; min-width: .9rem; text-align: right;
}
/* Twelve columns, so a widget can say what shares a row with what. A box
   that does not say falls back to a quarter, which is what auto-fit was
   giving most of them anyway. */
.cms-repeater-fields {
    flex: 1 1 auto; min-width: 0;
    display: grid; gap: .4rem .5rem;
    grid-template-columns: repeat(12, minmax(0, 1fr));
}
.cms-repeater-fields > .cms-field { grid-column: span 3; min-width: 0; }
.cms-repeater-fields > .cms-field[data-span="1"]  { grid-column: span 1; }
.cms-repeater-fields > .cms-field[data-span="2"]  { grid-column: span 2; }
.cms-repeater-fields > .cms-field[data-span="3"]  { grid-column: span 3; }
.cms-repeater-fields > .cms-field[data-span="4"]  { grid-column: span 4; }
.cms-repeater-fields > .cms-field[data-span="5"]  { grid-column: span 5; }
.cms-repeater-fields > .cms-field[data-span="6"]  { grid-column: span 6; }
.cms-repeater-fields > .cms-field[data-span="8"]  { grid-column: span 8; }
.cms-repeater-fields > .cms-field[data-span="12"] { grid-column: span 12; }

/* Tighter inside a row than out in the open.
   ---------------------------------------------------------------------
   A slide is nine boxes, and out in the open each of them carries a label
   at full size over a box with a comfortable amount of air in it. Nine of
   those is a slide taller than it needs to be, and the height is paid once
   per slide.

   So inside a row the label is smaller and sits closer to its box, the box
   itself is shallower, and a box that short cannot stretch to match the
   tallest thing beside it. Measured on a slide: 233px to 189px.

   None of this reaches a field out in the open -- the page title, the
   college name -- which is still read at full size. */
.cms-repeater-fields > .cms-field > label,
.cms-repeater-fields > .cms-field > .cms-label {
    font-size: .8rem; margin-bottom: .1rem;
}
.cms-repeater-fields .cms-input,
.cms-repeater-fields .cms-select { padding: .35rem .5rem; }
.cms-repeater-fields > .cms-field { align-self: start; }

/* A link inside a row is words, an address and "New tab". Out in the open
   each of the two boxes asks for 12rem before it will share a line, which
   in a cell a third of a row wide puts them one under another. They are
   short things -- "Apply Now", "/admissions" -- so here they ask for less
   and sit side by side where the cell is wide enough for it. */
.cms-repeater-fields .cms-subfields { gap: .35rem; }
.cms-repeater-fields .cms-subfields > span { flex: 1 1 7rem; }
.cms-repeater-fields .cms-check { font-size: .8rem; font-weight: 500; }

/* The line across the top of a row: a note, not a box, so it carries no
   label and no space for one. */
.cms-repeater-fields > .cms-field--note { margin: 0; }
.cms-repeater-fields > .cms-field--note .cms-help { margin: 0; }

/* Narrow: two across, then one. Twelve columns of a phone screen is twelve
   columns of nothing. */
@media (max-width: 1100px) {
    .cms-repeater-fields > .cms-field,
    .cms-repeater-fields > .cms-field[data-span] { grid-column: span 6; }
}
@media (max-width: 700px) {
    .cms-repeater-fields > .cms-field,
    .cms-repeater-fields > .cms-field[data-span] { grid-column: span 12; }
}
.cms-repeater-fields label { margin-bottom: .1rem; }
.cms-repeater-fields .cms-help { margin-top: .1rem; line-height: 1.3; }
.cms-repeater-fields .cms-field { margin-bottom: 0; }
.cms-repeater-drop {
    background: none; border: 0; padding: .2rem;
    font: inherit; font-size: .75rem; color: var(--ink-soft);
    text-decoration: underline; cursor: pointer; margin-top: 1.5rem;
}
.cms-repeater-drop:hover { color: var(--danger); }

/* --- choosing a kind of section --- */
.cms-dialog {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.5rem; max-width: 46rem; width: calc(100% - 2rem);
    background: var(--panel); color: var(--ink);
    box-shadow: var(--shadow);
}
.cms-dialog::backdrop { background: rgba(10, 20, 15, .45); }
.cms-dialog h2 { margin: 0 0 .25rem; font-size: 1.1rem; }
.cms-dialog .cms-task { text-align: start; cursor: pointer; font: inherit; }

@media (max-width: 599px) {
    .cms-repeater-row { flex-wrap: wrap; }
    .cms-repeater-no { display: none; }
    .cms-repeater-drop { margin-top: 0; }
}

/* --- keep one at the top of its list --- */
.cms-pin {
    background: none; border: 0; padding: .1rem .2rem;
    font: inherit; font-size: .9rem; line-height: 1;
    color: var(--line); cursor: pointer; vertical-align: middle;
}
.cms-pin:hover { color: var(--ink-soft); }
.cms-pin[aria-pressed="true"] { color: var(--warn); }
.cms-pin:disabled { opacity: .5; cursor: default; }

/* --- the strip of photographs on an item --- */
.cms-gallery {
    display: grid; gap: .6rem;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
}
.cms-gallery:empty { display: none; }
.cms-gallery-tile {
    display: flex; flex-direction: column; gap: .3rem;
    padding: .4rem; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--bg);
}
.cms-gallery-tile img {
    display: block; width: 100%; height: 6rem;
    object-fit: cover; border-radius: calc(var(--radius) - 4px);
    background: var(--line-soft);
}
.cms-gallery-name {
    font-size: .72rem; color: var(--ink-soft);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cms-gallery-acts { display: flex; gap: .2rem; justify-content: space-between; }
.cms-gallery-acts button {
    flex: 1 1 auto;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: calc(var(--radius) - 4px);
    padding: .15rem; font: inherit; font-size: .8rem; line-height: 1.2;
    color: var(--ink-soft); cursor: pointer;
}
.cms-gallery-acts button:hover { border-color: var(--brand); color: var(--brand); }
.cms-gallery-acts button[data-photo-drop]:hover { border-color: var(--danger); color: var(--danger); }

.cms-gallery-add {
    display: flex; flex-wrap: wrap; gap: .5rem;
    align-items: center; margin-top: .8rem;
}
.cms-gallery-add .cms-select { flex: 1 1 14rem; width: auto; }

/* --- a short numbered list of what to do next --- */
.cms-steps { margin: .4rem 0 .8rem; padding-left: 1.4rem; }
.cms-steps li { margin: .3rem 0; }

/* --- a list of things to tick, in columns so a long list stays readable --- */
.cms-ticks {
    display: grid; gap: .35rem .9rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
}
.cms-ticks .cms-check { margin: 0; }

/* --- handing over a password, once --- */
.cms-handover {
    border: 2px solid var(--brand);
    background: var(--brand-soft);
}
.cms-handover h2 { margin-top: 0; }
.cms-password {
    font: 1.3rem/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    letter-spacing: .06em;
    background: var(--panel);
    border: 1px dashed var(--brand);
    border-radius: var(--radius);
    padding: .7rem 1rem;
    margin: .6rem 0;
    user-select: all;            /* one click selects the whole thing */
    overflow-wrap: anywhere;
}

/* --- a group of permissions on the roles screen --- */
.cms-permgroup {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .8rem 1rem 1rem;
    margin: 0 0 1rem;
}
.cms-permgroup legend {
    font-size: .8rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
    color: var(--ink-soft);
    padding: 0 .4rem;
}
.cms-permgroup .cms-check { align-items: flex-start; }
.cms-permgroup .cms-check .cms-help { display: block; margin-top: .1rem; }

/* --- when an account may be used --- */
.cms-subhead {
    font-size: .8rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
    color: var(--ink-soft);
    margin: 1.2rem 0 .5rem;
}
.cms-subhead:first-of-type { margin-top: .4rem; }

/* When an account may be used: three rules, side by side.
   ---------------------------------------------------------------------
   The days, the dates and the number of browsers were two cards, then
   three tabs. Tabs are right where each one holds a form; each of these
   holds a line, and the question being asked is the three of them
   together -- "when may this account be used?". Across the card they are
   read at once.

   The days column is the widest of the three: seven buttons and two
   clocks. Below about 60rem of card there is no room for three columns
   and they stack, which is also what happens on a phone. */
.cms-access-across {
    display: grid; gap: .6rem 1.2rem;
    grid-template-columns: minmax(20rem, 1.6fr) minmax(13rem, 1fr) minmax(9rem, .7fr);
    align-items: start;
}
@media (max-width: 1100px) {
    .cms-access-across { grid-template-columns: minmax(0, 1fr); }
}
.cms-access-part { min-width: 0; }
.cms-access-part .cms-subhead:first-of-type { margin-top: 0; }

.cms-windows { display: grid; gap: .6rem; }
.cms-window {
    display: flex; flex-wrap: wrap; gap: .8rem; align-items: center;
    padding: .7rem; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--bg);
}
.cms-window-days { display: flex; flex-wrap: wrap; gap: .3rem; }
.cms-window-times { display: flex; gap: .4rem; align-items: center; flex: 1 1 16rem; }
.cms-window-times .cms-input { width: auto; flex: 0 1 8rem; }
.cms-window-times span { color: var(--ink-soft); font-size: .85rem; }

/* a day of the week as a small toggle */
.cms-daybox { position: relative; cursor: pointer; }
.cms-daybox input {
    position: absolute; opacity: 0; width: 100%; height: 100%;
    margin: 0; cursor: pointer;
}
.cms-daybox span {
    display: inline-block; min-width: 2.6rem; text-align: center;
    padding: .35rem .2rem; font-size: .75rem; font-weight: 600;
    border: 1px solid var(--line); border-radius: 99px;
    background: var(--panel); color: var(--ink-soft);
    transition: background .15s, color .15s, border-color .15s;
}
.cms-daybox input:checked + span {
    background: var(--brand); border-color: var(--brand); color: var(--on-brand);
}
.cms-daybox input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.cms-daybox:hover span { border-color: var(--brand); }

.cms-daybox input:checked + span { color: var(--on-brand); }

@media (max-width: 599px) {
    .cms-window { flex-direction: column; align-items: stretch; }
    .cms-window-times { flex-wrap: wrap; }
}

/* --- earlier versions --- */
.cms-versions { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.cms-version {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: .8rem 1rem; background: var(--bg);
}
.cms-version.is-now { border-color: var(--brand); background: var(--brand-soft); }
.cms-version-head {
    display: flex; flex-wrap: wrap; gap: .6rem;
    align-items: center; justify-content: space-between;
    margin-bottom: .5rem;
}
.cms-version-head form { margin: 0; }
.cms-version .cms-table-wrap { margin-top: .4rem; }

.cms-changes td { vertical-align: top; font-size: .85rem; }
.cms-changes .cms-was { color: var(--ink-soft); text-decoration: line-through; }
.cms-changes .cms-now { color: var(--ink); }

@media (max-width: 599px) {
    .cms-version-head { flex-direction: column; align-items: flex-start; }
}

/* The department and designation names a staff file may use. A list to
   match a spelling against, so it is dense and quiet rather than a
   feature of the page. */
.cms-names{list-style:none;margin:.15rem 0 0;padding:0;columns:2;font-size:.85rem}
.cms-names li{break-inside:avoid;padding:.1rem 0;color:var(--ink)}
@media (max-width:46rem){ .cms-names{columns:1} }

/* A heading inside a table: where one role ends and the next begins.
   Four accounts read fine as a flat list; two hundred do not, and the
   staff import makes two hundred. The number is on the heading because
   "how many admins are there" is the question somebody opens this
   screen with, and counting rows by eye is not an answer. */
.cms-table .cms-group th{background:var(--line-soft);font-size:.8rem;
  letter-spacing:.02em;text-transform:uppercase;color:var(--ink-soft);
  padding:.45rem .6rem;border-top:1px solid var(--line)}
.cms-table .cms-group th span{float:right;font-weight:600;text-transform:none;
  letter-spacing:0;color:var(--ink-soft)}

/* =====================================================================
   The page map: every part of one page, in the order it appears.
   ===================================================================== */

/* Tighter than a form. This is a picture of a page, read at a glance,
   and the home page is sixteen bands of it: every spare line between
   them is paid sixteen times over. Measured: 3166px to 2732px by taking
   two lines out of each box, and to 2498px with the spacing below. */
.cms-map { display: grid; gap: .4rem; margin-bottom: .8rem; }

.cms-band {
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--panel); padding: .45rem .7rem;
}
.cms-band--everywhere { border-style: dashed; }

/* The places the page offers that have nothing in them, named once at
   the end rather than left as three bands with nothing in them in the
   middle of the picture. A band holding nothing shows nothing of the
   page -- but it is the only place somebody finds out there is room
   under the menu at all, so it is said, once, where it interrupts
   nothing. */
.cms-band--spare { border-style: dashed; margin-bottom: 1rem; }
.cms-band--spare .cms-band-empty { margin: 0; }

/* A part the theme draws itself: nothing to place, somewhere else to change.
   Six of these stand between the top of the screen and the first thing the
   page actually holds -- the seals strip, the header, the menu bar, the
   breadcrumb, the side list, and the band under the menu. Nothing in any of
   them is edited here, so they are a line to read and a button to press,
   and they are kept to that. */
.cms-band--fixed {
    display: flex; flex-wrap: wrap; gap: .4rem .6rem;
    align-items: center; justify-content: space-between;
    padding: .35rem .8rem;
    background: var(--line-soft); border-style: dashed;
}
.cms-band--fixed .cms-band-head { margin: 0; }
/* A band may be changed in more than one place, so the buttons are a
   group of their own: they stay together on the far side and wrap as a
   group rather than one of them dropping away from the others. */
.cms-band-ways { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Several of those parts standing side by side, because that is how the page
   has them: the logo, the years badge, the seals and the social icons are one
   row across the top, not four bands down the screen. They are placed on the
   same twenty-four columns the sections are, so the picture is the shape the
   page is -- and they keep the dashed edge and the quiet grey that say there
   is nothing to arrange here, only somewhere else to go. */
.cms-box--fixed { background: var(--line-soft); border-style: dashed; }
.cms-box--fixed .cms-box-name { font-weight: 700; font-size: .85rem; }

.cms-band-head { display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; margin-bottom: .3rem; }
.cms-band-name { font-weight: 700; font-size: .85rem; }
.cms-band-note { font-size: .75rem; color: var(--ink-soft); }
.cms-band-empty { font-size: .8rem; color: var(--ink-soft); }

/* The band is drawn in the shape the row really has: twenty-four columns,
   and each box told where it stands. Twenty-four divides by 2, 3, 4, 6 and
   8, so the rows a theme actually uses land on whole numbers.

   It used to be auto-fit boxes of one size, which made the wide slider the
   same width as the news list beside it and put the rows that stack side by
   side. Somebody arranging the home page was reading a picture of a page
   that does not exist. */
.cms-boxes {
    display: grid; gap: .4rem;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    align-items: stretch;
}

/* The shape needs room to be worth drawing. The narrowest column the home
   page asks for is 4 of 24, and a box has to hold "History ↗" -- at 1440
   that column is 154px and the buttons sit two to a line, at 1100 it is
   123px and they stack four deep, so the picture of the page becomes taller
   than the page it is a picture of.

   So below that the shape is given up, in two steps: two equal columns
   while there is room for two, then one. The placement is an inline style,
   which is why these say !important -- the one case where the screen
   overrules what the theme asked for. */
@media (max-width: 1250px) {
    .cms-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cms-box { grid-column: auto !important; grid-row: auto !important; }
}

@media (max-width: 900px) {
    .cms-boxes { grid-template-columns: minmax(0, 1fr); }
}

.cms-box {
    display: flex; flex-direction: column; gap: .1rem;
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: .4rem .55rem; min-width: 0;
}

/* A box that stands two rows tall does not stretch to fill them.
   The top row of the home page is a wide slider beside two narrow columns,
   and in a 154px column four buttons stack four deep -- so those short
   boxes came out 238px tall and the slider box stretched to match, leaving
   350px of empty colour. The shape is still said by where the box starts
   and how wide it is; it does not need to be said again in dead space. */
.cms-box--tall { align-self: start; }
.cms-box-top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.cms-box-no { font-size: .7rem; font-weight: 700; letter-spacing: .03em; color: var(--ink-soft); text-transform: uppercase; }
.cms-box-name { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
/* What is left under a box's name: the one word that says a section has
   dates on it. The kind and the style used to be here too, and where it
   appeared -- the name above said the first nine times in ten, and the
   band's dashed edge says the second for the whole band at once. */
.cms-box-where { font-size: .72rem; color: var(--ink-soft); }
.cms-box-acts { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; }
.cms-box-btn {
    font-size: .72rem; font-weight: 600; text-decoration: none;
    padding: .18rem .42rem; border-radius: 99px; white-space: nowrap;
    border: 1px solid var(--line); background: var(--panel); color: var(--ink);
}
.cms-box-btn:hover { border-color: var(--brand); color: var(--brand); }

/* A steady, quiet colour per kind of section — the same kind is always the
   same colour, so a page is readable at a glance. Pale in both schemes, so
   the ink on them is fixed too and not taken from the scheme. */
:root {
    --tint-ink:      #17231d;
    --tint-ink-soft: #55675d;
}

.cms-tint-0  { background: #fdeaea; border-color: #f3c9c9; }
.cms-tint-1  { background: #fdf2e3; border-color: #f0d9b4; }
.cms-tint-2  { background: #fbf7da; border-color: #ead9a0; }
.cms-tint-3  { background: #eef7dc; border-color: #cfe3a8; }
.cms-tint-4  { background: #e2f5e8; border-color: #b2ddc2; }
.cms-tint-5  { background: #dff3f3; border-color: #a9d8d8; }
.cms-tint-6  { background: #e0eefb; border-color: #b0cfeb; }
.cms-tint-7  { background: #e7e8fa; border-color: #bcbee8; }
.cms-tint-8  { background: #f0e6f8; border-color: #d2bde9; }
.cms-tint-9  { background: #fae6f1; border-color: #e7bcd6; }
.cms-tint-10 { background: #f3eee8; border-color: #ddd0c0; }
.cms-tint-11 { background: #e9eef1; border-color: #c6d2da; }

/* What is written on a tint.

   The twelve colours above are fixed: one pale shade per kind of section,
   the same in both schemes, because the point of them is that a kind is
   always the same colour and a page is readable at a glance. A fixed pale
   background needs a fixed dark ink, so here it is -- the one pair in this
   file that does not come from the scheme.

   It used to be --on-brand, left behind from when these boxes really were
   a solid brand fill. In light mode that is white, and white on pale pink
   is a box with nothing readable in it; the whole Home page Setup screen
   had a dozen of them. It looked right in dark mode only because
   --on-brand flips to near-black there -- the correct answer arrived at by
   accident, which is why nobody caught it. */
.cms-box { color: var(--tint-ink); }
.cms-box .cms-box-no,
.cms-box .cms-box-where { color: var(--tint-ink-soft); }

@media (max-width: 599px) {
    .cms-boxes { grid-template-columns: 1fr; }
    .cms-band--fixed { flex-direction: column; align-items: flex-start; }
}

/* =====================================================================
   How the site is doing — findings and their level
   ===================================================================== */

/* A card whose heading has a button on the far side of it. */
.cms-card-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: .75rem; margin-bottom: .25rem;
}
.cms-card-head h2 { margin: 0; }

/* The count beside a finding's title. Colour carries the level, and the
   number carries the rest: a shape nobody has to learn. */
.cms-tag {
    display: inline-block;
    padding: .05rem .45rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.5;
    vertical-align: .08em;
}
.cms-tag--now  { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.cms-tag--soon { background: var(--warn-soft);   color: var(--warn);   border-color: var(--warn); }
.cms-tag--tidy { background: var(--line-soft);   color: var(--ink-soft); border-color: var(--line); }

.cms-findings { list-style: none; margin: 0; padding: 0; }
.cms-findings li {
    padding: .5rem 0;
    border-top: 1px solid var(--line-soft);
    font-size: .92rem;
    /* A path or a file name must be able to break, or a long one widens the
       whole card and the screen scrolls sideways on a phone. */
    overflow-wrap: anywhere;
}
.cms-findings li:first-child { border-top: 0; }
.cms-findings a { color: var(--brand); }

/* The passed checks, folded away. Ticked, quiet, and not asking for a click. */
.cms-findings--ok li { color: var(--ink-soft); }
.cms-findings--ok li::before { content: "✓"; color: var(--ok); margin-inline-end: .5rem; }

.cms-card details summary { cursor: pointer; }
.cms-card details[open] summary { margin-bottom: .5rem; }

@media (max-width: 599px) {
    .cms-card-head { flex-direction: column; }
}

/* =====================================================================
   Quick Add, the setup checklist and the drafts panel
   ===================================================================== */

/* A <details> menu: it opens, closes and takes the Escape key without a line
   of JavaScript, because the browser already knows how to do all three. */
.cms-quick { position: relative; }
.cms-quick > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.cms-quick > summary::-webkit-details-marker { display: none; }

.cms-quick-list {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + .35rem);
    z-index: 30;
    min-width: 12rem;
    margin: 0;
    padding: .35rem;
    list-style: none;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.cms-quick-list a {
    display: block;
    padding: .45rem .6rem;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
}
.cms-quick-list a:hover,
.cms-quick-list a:focus-visible { background: var(--brand-soft); color: var(--brand-dark); }

/* How far through setting the site up. A number as well as a bar: a bar on
   its own tells you roughly, and roughly is not what somebody wants when they
   are trying to finish. */
.cms-progress {
    display: block;
    height: .5rem;
    margin: .5rem 0 1rem;
    background: var(--line-soft);
    border-radius: 999px;
    overflow: hidden;
}
.cms-progress > span {
    display: block;
    height: 100%;
    background: var(--brand);
    border-radius: 999px;
}

.cms-steps { list-style: none; margin: 0; padding: 0; }
.cms-steps li {
    display: flex; gap: .6rem; align-items: baseline;
    padding: .55rem 0;
    border-top: 1px solid var(--line-soft);
}
.cms-steps li:first-child { border-top: 0; }
.cms-steps .cms-step-mark { flex: 0 0 1.1rem; text-align: center; }
.cms-steps .is-done .cms-step-mark { color: var(--ok); }
.cms-steps .is-done .cms-step-what { color: var(--ink-soft); text-decoration: line-through; }
.cms-steps .cms-step-why { display: block; font-size: .85rem; color: var(--ink-soft); }

@media (max-width: 599px) {
    /* Hung from the button's right edge, where the room is. Pinned to its
       left edge instead, a 12rem list started near the right of the bar and
       ran off a 320px screen, taking the whole page sideways. The width is
       capped as well, so no amount of wording can do it again. */
    .cms-quick-list {
        inset-inline-end: 0; inset-inline-start: auto;
        min-width: 11rem; max-width: calc(100vw - 1.5rem);
    }
}

/* The "Move to…" picker sits among the row's other actions, so it has to be
   small enough not to shove them about. */
.cms-select--tiny {
    width: auto;
    min-width: 7rem;
    padding: .2rem 1.4rem .2rem .4rem;
    font-size: .82rem;
}
@media (max-width: 599px) {
    .cms-select--tiny { min-width: 0; max-width: 8rem; }
}

/* =====================================================================
   The colour the admin is painted in

   Only the brand tokens change. Everything else -- the page, the panels,
   the ink, the warning and danger colours -- stays exactly as it is, so a
   colour cannot turn the admin into something unreadable. Each has a dark
   twin because a green that reads well on white is too dark on near-black.

   --on-brand goes with each one: white where the fill is deep, near-black
   where the fill is pale.
   ===================================================================== */

:root[data-colour="blue"]  { --brand:#1d5fa8; --brand-dark:#174b85; --brand-soft:#e6eef8; }
:root[data-colour="plum"]  { --brand:#7a3570; --brand-dark:#612a59; --brand-soft:#f5e9f3; }
:root[data-colour="teal"]  { --brand:#116b6b; --brand-dark:#0d5555; --brand-soft:#e2f1f1; }
:root[data-colour="slate"] { --brand:#3f4d5a; --brand-dark:#303b45; --brand-soft:#eceff2; }
:root[data-colour="rust"]  { --brand:#9a4a1f; --brand-dark:#7c3b18; --brand-soft:#f8ece4; }

/* The same five, lightened for a dark page. */
@media (prefers-color-scheme: dark) {
    :root[data-colour="blue"]:not([data-scheme="light"])  { --brand:#5a9bdd; --brand-dark:#79b1e8; --brand-soft:#17222e; }
    :root[data-colour="plum"]:not([data-scheme="light"])  { --brand:#c07ab4; --brand-dark:#d093c6; --brand-soft:#2a1b27; }
    :root[data-colour="teal"]:not([data-scheme="light"])  { --brand:#4fb0ae; --brand-dark:#6cc5c3; --brand-soft:#132727; }
    :root[data-colour="slate"]:not([data-scheme="light"]) { --brand:#8fa3b5; --brand-dark:#a8b9c8; --brand-soft:#1b2228; }
    :root[data-colour="rust"]:not([data-scheme="light"])  { --brand:#d98a5c; --brand-dark:#e5a279; --brand-soft:#2b1d14; }
}

:root[data-scheme="dark"][data-colour="blue"]  { --brand:#5a9bdd; --brand-dark:#79b1e8; --brand-soft:#17222e; }
:root[data-scheme="dark"][data-colour="plum"]  { --brand:#c07ab4; --brand-dark:#d093c6; --brand-soft:#2a1b27; }
:root[data-scheme="dark"][data-colour="teal"]  { --brand:#4fb0ae; --brand-dark:#6cc5c3; --brand-soft:#132727; }
:root[data-scheme="dark"][data-colour="slate"] { --brand:#8fa3b5; --brand-dark:#a8b9c8; --brand-soft:#1b2228; }
:root[data-scheme="dark"][data-colour="rust"]  { --brand:#d98a5c; --brand-dark:#e5a279; --brand-soft:#2b1d14; }

/* =====================================================================
   The picker in the top bar
   ===================================================================== */

.cms-look { position: relative; }
.cms-look > summary {
    list-style: none; cursor: pointer;
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--panel); color: var(--ink);
    display: grid; place-items: center; font-size: 1rem;
}
.cms-look > summary::-webkit-details-marker { display: none; }
.cms-look > summary:hover { background: var(--line-soft); }
.cms-look[open] > summary { border-color: var(--brand); color: var(--brand); }

.cms-look-panel {
    position: absolute; inset-inline-end: 0; top: calc(100% + .5rem); z-index: 60;
    width: 15rem; padding: .9rem;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.cms-look-panel h3 {
    margin: 0 0 .45rem; font-size: .72rem; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft);
}
.cms-look-panel h3 + * { margin-bottom: .9rem; }

.cms-look-row { display: flex; gap: .3rem; }
.cms-look-row button {
    flex: 1; padding: .45rem .2rem; font: inherit; font-size: .8rem;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--panel); color: var(--ink); cursor: pointer;
}
.cms-look-row button:hover { background: var(--line-soft); }
.cms-look-row button[aria-pressed="true"] {
    background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600;
}

.cms-look-colours { display: flex; flex-wrap: wrap; gap: .4rem; }
.cms-look-colours button {
    width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line);
    padding: 0;
}
.cms-look-colours button[aria-pressed="true"] {
    border-color: var(--panel); box-shadow: 0 0 0 2px var(--brand);
}

/* The swatch shows its own colour, not the one in use. */
.cms-swatch--green { background: #1f6b4a; }
.cms-swatch--blue  { background: #1d5fa8; }
.cms-swatch--plum  { background: #7a3570; }
.cms-swatch--teal  { background: #116b6b; }
.cms-swatch--slate { background: #3f4d5a; }
.cms-swatch--rust  { background: #9a4a1f; }

.cms-look-note { margin: .2rem 0 0; font-size: .72rem; color: var(--ink-soft); }

@media (max-width: 599px) {
    .cms-look-panel { width: 13rem; }
}

/* =====================================================================
   Choosing a picture

   A button showing what is chosen, and a dialog of thumbnails behind it.
   This replaced a <select> of file names: nobody recognises a logo by
   "7532270523232945Q_spiders.png", and the list stopped at 200 so past
   that the rest of the library could not be chosen at all.
   ===================================================================== */

.cms-picked { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.cms-picked-btn {
    display: flex; align-items: center; gap: .6rem;
    padding: .35rem .7rem .35rem .35rem;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--panel); color: var(--ink);
    font: inherit; cursor: pointer; text-align: start;
    max-width: 22rem;
}
.cms-picked-btn:hover { border-color: var(--brand); }

.cms-picked-pic {
    width: 44px; height: 44px; flex: none;
    border-radius: 8px; overflow: hidden;
    background: var(--line-soft);
    display: grid; place-items: center;
    font-size: .7rem; font-weight: 700; color: var(--ink-soft);
}
.cms-picked-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cms-picked-pic--none { border: 1px dashed var(--line); background: none; font-size: 1.1rem; }

.cms-picked-name {
    min-width: 0; font-size: .85rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cms-picked-name--none { color: var(--ink-soft); }

.cms-picked-crop,
.cms-picked-clear {
    background: none; border: 0; padding: 0;
    font: inherit; font-size: .78rem;
    color: var(--brand); text-decoration: underline; cursor: pointer;
}
.cms-picked-crop[hidden],
.cms-picked-clear[hidden] { display: none; }

/* --- the dialog --- */
.cms-picker {
    width: min(46rem, 94vw); max-height: 86vh;
    padding: 0; border: 0; border-radius: var(--radius);
    background: var(--panel); color: var(--ink);
    box-shadow: var(--shadow);
}
.cms-picker::backdrop { background: rgba(10, 20, 15, .5); }

.cms-picker-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--line);
}
.cms-picker-head h2 { margin: 0; font-size: 1.05rem; }

.cms-picker-bar {
    display: flex; gap: .6rem; align-items: center;
    padding: .9rem 1.25rem 0;
}
.cms-picker-bar .cms-input { flex: 1; min-width: 0; }
.cms-picker-upload { flex: none; cursor: pointer; }

.cms-picker-say { margin: .6rem 1.25rem 0; font-size: .85rem; color: var(--ink-soft); }
.cms-picker-say:empty { display: none; }

.cms-picker-grid {
    display: grid; gap: .75rem;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    padding: .9rem 1.25rem;
    overflow-y: auto; max-height: 52vh;
}

.cms-picker-tile {
    display: flex; flex-direction: column; gap: .35rem;
    padding: .4rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--panel); color: var(--ink);
    font: inherit; cursor: pointer; text-align: start;
}
.cms-picker-tile:hover { border-color: var(--brand); background: var(--brand-soft); }

.cms-picker-pic {
    aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden;
    background: var(--line-soft);
    display: grid; place-items: center;
    font-size: .78rem; font-weight: 700; color: var(--ink-soft);
}
.cms-picker-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cms-picker-name {
    font-size: .74rem; line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.cms-picker-more { padding: 0 1.25rem 1.25rem; text-align: center; }
.cms-picker-more button[hidden] { display: none; }

/* --- choosing several at once ---
   A ticked tile has to read as ticked at a glance across a grid of twenty,
   so it is a filled corner and a border, not a faint tint: the tint alone
   disappeared against the hover state on the tile beside it. */
.cms-picker-tile.is-marked {
    border-color: var(--brand); background: var(--brand-soft);
    box-shadow: inset 0 0 0 1px var(--brand);
}
.cms-picker-tile.is-marked .cms-picker-pic::after {
    content: "✓";
    position: absolute; inset-block-start: .25rem; inset-inline-end: .25rem;
    width: 1.4rem; height: 1.4rem; border-radius: 50%;
    background: var(--brand); color: var(--on-brand);
    display: grid; place-items: center; font-size: .8rem; font-weight: 700;
}
.cms-picker-tile.is-marked .cms-picker-pic { position: relative; }
.cms-picker-tile.is-marked .cms-picker-name { font-weight: 600; }

/* Sticky, because the grid scrolls: the count and the button must stay
   where they were when somebody is twenty tiles down. */
.cms-picker-foot {
    position: sticky; bottom: 0;
    display: flex; flex-wrap: wrap; gap: .75rem;
    align-items: center; justify-content: space-between;
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--line);
    background: var(--panel);
}
.cms-picker-foot[hidden] { display: none; }
.cms-picker-count { font-size: .85rem; color: var(--ink-soft); }

@media (max-width: 599px) {
    .cms-picker-grid { grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); }
    .cms-picked-btn { max-width: 100%; }
}

/* --- headings between groups of screens in the side rail ---
   aria-hidden, because a screen reader is given the sections by the <nav>
   label already and a bare word in a list of links reads as a broken link. */
.cms-nav-head {
    margin: 1.1rem 0 .2rem;
    padding: 0 .9rem;
    font-size: .68rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink-soft);
}
.cms-nav-head:first-child { margin-top: 0; }

/* =====================================================================
   What staff have sent in

   A card each, decided on the row itself. A screen per record would be
   three clicks to approve one line of text, and there are forty of them.

   "Send it back" carries its reason in the same form as the button, so
   nothing can be returned without saying why -- somebody looking at a bare
   "sent back" can only guess, and the usual guess is to send it again
   unchanged.
   ===================================================================== */
.cms-subs { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .7rem; }

.cms-sub {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: .9rem 1rem; background: var(--panel);
}
.cms-sub-top { display: flex; gap: .75rem; align-items: start; justify-content: space-between; }
.cms-sub-title { margin: 0; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; min-width: 0; }
.cms-sub-kind {
    flex: 0 0 auto; white-space: nowrap;
    padding: .15rem .6rem; border-radius: 999px;
    background: var(--line-soft); color: var(--ink-soft);
    font-size: .78rem; font-weight: 700;
}
.cms-sub-detail { margin: .45rem 0 0; font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }

.cms-sub-acts {
    display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
    margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line);
}
/* The reason and its button read as one control, because they are one. */
.cms-sub-back { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1 1 22rem; min-width: 0; }
.cms-sub-back .cms-input { flex: 1 1 12rem; min-width: 0; }

/* =====================================================================
   Keeping part of a picture.
   ---------------------------------------------------------------------
   The picture is shown at whatever size fits; the piece is held in the
   picture's own pixels and multiplied by that scale to draw it. Which
   means a photograph cropped on a telephone is cropped exactly where it
   was drawn, not within a few pixels of it.
   ===================================================================== */

.cms-crop {
    width: min(52rem, 96vw); max-height: 94vh;
    padding: 0; border: 0; border-radius: var(--radius);
    background: var(--panel); color: var(--ink);
    box-shadow: var(--shadow);
}
.cms-crop::backdrop { background: rgba(10, 20, 15, .5); }

.cms-crop-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--line);
}
.cms-crop-head h2 { margin: 0; font-size: 1.05rem; }

/* The chequerboard shows through a see-through PNG, so somebody cropping
   a logo can tell the clear part from a white one. */
.cms-crop-hold {
    display: flex; justify-content: center;
    padding: 1rem;
    background:
        repeating-conic-gradient(var(--line) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}

.cms-crop-stage { position: relative; overflow: hidden; touch-action: none; cursor: crosshair; }
.cms-crop-stage img {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    user-select: none; -webkit-user-drag: none;
}

/* Everything outside the piece is dimmed by a ring of shadow rather than
   four boxes: one element, and it cannot fall out of step with itself. */
.cms-crop-sel {
    position: absolute; box-sizing: border-box;
    border: 1px solid #fff;
    box-shadow: 0 0 0 100vmax rgba(10, 20, 15, .55);
    cursor: move;
}
.cms-crop-sel:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.cms-crop-grip {
    position: absolute; width: 14px; height: 14px;
    background: #fff; border: 1px solid rgba(10, 20, 15, .4);
}
.cms-crop-grip[data-grip="nw"] { top: -7px; left: -7px; cursor: nwse-resize; }
.cms-crop-grip[data-grip="ne"] { top: -7px; right: -7px; cursor: nesw-resize; }
.cms-crop-grip[data-grip="sw"] { bottom: -7px; left: -7px; cursor: nesw-resize; }
.cms-crop-grip[data-grip="se"] { bottom: -7px; right: -7px; cursor: nwse-resize; }

.cms-crop-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    padding: .85rem 1.25rem; border-top: 1px solid var(--line);
}
.cms-crop-set { display: flex; }
.cms-crop-set button {
    font: inherit; font-size: .82rem; cursor: pointer;
    padding: .35rem .6rem; border: 1px solid var(--line);
    background: var(--panel); color: var(--ink);
}
.cms-crop-set button + button { border-left: 0; }
.cms-crop-set button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.cms-crop-set button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.cms-crop-set button.is-on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

.cms-crop-says { margin-inline-start: auto; font-size: .82rem; color: var(--ink-soft); }
.cms-crop-warn { margin: 0 1.25rem 1rem; }
.cms-crop-warn:empty { display: none; }
