/* Overrides every page shares (template CR-001). The base look is
   ../shared/pico.classless.min.css, linked FIRST; this file second; a
   page's own inline <style> (if any) last. Colours are Pico variables
   only, never hex: Pico follows prefers-color-scheme, and a hard-coded
   light colour becomes an illegible patch in dark mode. */

/* [hidden] must beat any author display rule (an overlay with
   display:flex, say): otherwise a "hidden" overlay still covers the page
   and eats every tap — a real shipped bug in the template's ancestry. Dialogs don't depend on this; they
   open/close via [open] (showModal()/close()), which Pico handles. */
[hidden] { display: none !important; }

/* #status = the login line (text + action buttons); #message = per-action
   feedback under it */
#status { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
    padding: .5rem .8rem; margin-bottom: 1rem; border-radius: var(--pico-border-radius);
    border: var(--pico-border-width) solid transparent;
    background: var(--pico-card-sectioning-background-color); }
#status.warn { color: var(--pico-del-color); border-color: var(--pico-del-color); }
#status button { margin: 0; padding: .25rem .8rem; }
#message { min-height: 1.4rem; margin-bottom: var(--pico-spacing); color: var(--pico-ins-color); }
#message.error { color: var(--pico-del-color); white-space: pre-wrap; }

/* #message's stand-in inside an open dialog: the modal backdrop covers the
   header, so a failure must be reported where the user is looking */
.dialog-message { color: var(--pico-ins-color); }
.dialog-message.error { color: var(--pico-del-color); white-space: pre-wrap; }
.dialog-message:empty { display: none; }

/* buttons in a row (cards, toolbars) */
button + button { margin-left: .5rem; }

/* Pico draws read-only inputs exactly like editable ones; dim them so a
   locked field (an id that can't change once saved) reads as locked */
input[readonly] { opacity: var(--pico-form-element-disabled-opacity); }

/* controls inside table cells: no form-element spacing, natural width */
td :is(input, select, button) { margin: 0; }
td select { width: auto; }

/* a wide table scrolls inside its own box instead of widening the page
   (phones) */
.table-scroll { overflow-x: auto; }
