/* Admin panel styles. Hand-written, no build step. The CSP allows no inline style: every look lives here (class prefix wm-). */
:root {
  --wm-bg: #f5f6f8; --wm-surface: #fff; --wm-text: #1b1f27; --wm-muted: #5d6675; --wm-line: #dfe3ea;
  --wm-primary: #1d4ed8; --wm-primary-d: #1639a8; --wm-danger: #b42318; --wm-danger-bg: #fdecea; --wm-ok: #067647; --wm-ok-bg: #e7f6ee; --wm-warn: #8a5a00; --wm-warn-bg: #fff4d6; --wm-info-bg: #e8eefc;
  --wm-radius: 10px; --wm-side: 15rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--wm-text);
}
*, *::before, *::after { box-sizing: border-box; }
body.wm-body { margin: 0; background: var(--wm-bg); line-height: 1.5; font-size: 15px; }
h1, h2, h3, p { margin: 0; }
a { color: var(--wm-primary); }
.wm-muted { color: var(--wm-muted); }
.wm-help { color: var(--wm-muted); font-size: 13px; }
.wm-icon { flex: none; }
.wm-brand { font-weight: 700; letter-spacing: .01em; display: block; }
.wm-logo { display: block; width: 11.5rem; max-width: 100%; height: auto; }

/* shell */
.wm-shell { --wm-top-h: 5.25rem; --wm-pad: 1.5rem; display: grid; grid-template-columns: var(--wm-side) 1fr; min-height: 100vh; }   /* the side menu's first button starts at the height of the content's first card: top bar height + content padding */
.wm-side { background: #121826; color: #e8ebf2; display: flex; flex-direction: column; padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.wm-side-head { display: flex; align-items: center; height: calc(var(--wm-top-h) - 1rem); margin-bottom: var(--wm-pad); padding: 0 .5rem; font-size: 1.1rem; }
.wm-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.wm-nav-group { margin: 1rem .5rem .25rem; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #8e98ab; }
.wm-nav-link { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: 8px; color: #d6dbe6; text-decoration: none; }
.wm-nav-link:hover { background: #1c2437; }
.wm-nav-link.is-active { background: #263353; color: #fff; }
.wm-side .wm-btn-secondary { background: #1c2437; color: #e8ebf2; border-color: #2c3753; }
.wm-main { min-width: 0; display: flex; flex-direction: column; }
.wm-top { box-sizing: border-box; min-height: var(--wm-top-h); display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; background: var(--wm-surface); border-bottom: 1px solid var(--wm-line); }
.wm-top-title { flex: 1; min-width: 0; }
.wm-top-title h1 { font-size: 1.25rem; }
.wm-usermenu { align-self: stretch; display: flex; margin: -1rem -1.5rem -1rem .25rem; }
.wm-userchip { display: inline-flex; align-items: center; gap: .6rem; height: 100%; min-height: 2.75rem; max-width: 20rem; padding: 0 1.5rem 0 1rem; border: 0; border-radius: 0; background: transparent; color: var(--wm-text); font: inherit; text-align: left; cursor: pointer; }
.wm-userchip:hover, .wm-userchip[aria-expanded="true"] { background: #eef1f6; }
.wm-userchip:focus-visible { outline: 2px solid var(--wm-primary); outline-offset: -2px; }
.wm-userchip-text { display: grid; min-width: 0; line-height: 1.25; font-size: 12.5px; color: var(--wm-muted); }
.wm-userchip-text strong { font-size: 14px; color: var(--wm-text); }
.wm-userchip-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-userchip-ico { display: none; }
.wm-userchip .wm-icon { width: 18px; height: 18px; flex: none; }
.wm-usermenu .wm-menu > a .wm-icon, .wm-usermenu .wm-menu-form > button .wm-icon { width: 18px; height: 18px; margin-right: .6rem; flex: none; }
.wm-content { padding: 1.5rem; display: grid; gap: 1rem; align-content: start; width: 100%; }
@media (min-width: 861px) { .wm-shell.is-collapsed { grid-template-columns: 1fr; } .wm-shell.is-collapsed .wm-side { display: none; } }
.wm-scrim { position: fixed; inset: 0; background: rgba(10, 14, 22, .5); z-index: 19; }
@media (max-width: 860px) {
  .wm-shell { --wm-pad: 1rem; }
  .wm-shell { grid-template-columns: 1fr; }
  .wm-side { position: fixed; inset: 0 auto 0 0; width: min(80vw, 18rem); transform: translateX(-100%); transition: transform .15s; z-index: 20; }
  .wm-side.is-open { transform: none; }
  .wm-top { padding: .75rem 1rem; gap: .5rem; }
  .wm-usermenu { margin: -.75rem -1rem -.75rem 0; }
  .wm-userchip { padding: 0 1rem; }
  .wm-userchip-text { display: none; }
  .wm-userchip-ico { display: inline-flex; }
  .wm-content { padding: 1rem; }
}

/* cards, grid, tables */
.wm-card { background: var(--wm-surface); border: 1px solid var(--wm-line); border-radius: var(--wm-radius); padding: 1.1rem 1.25rem; display: grid; gap: .8rem; align-content: start; }
.wm-card-title { font-size: 1rem; }
.wm-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.wm-table-wrap { overflow-x: auto; }
.wm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wm-table th, .wm-table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--wm-line); vertical-align: middle; }
.wm-table th { color: var(--wm-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.wm-empty { color: var(--wm-muted); padding: 1rem 0; }
.wm-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.wm-stack { display: grid; gap: .8rem; }
.wm-kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; }
.wm-kv dt { color: var(--wm-muted); }
.wm-kv dd { margin: 0; word-break: break-word; }
.wm-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.wm-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .4rem; margin: 0; padding: 0; list-style: none; }
.wm-codes li { background: var(--wm-bg); border: 1px dashed var(--wm-line); border-radius: 6px; padding: .35rem .5rem; text-align: center; font-family: ui-monospace, Menlo, monospace; }

/* forms */
.wm-field { display: grid; gap: .3rem; }
.wm-label { font-weight: 600; font-size: 13px; }
.wm-req { color: var(--wm-danger); }
.wm-input { width: 100%; min-height: 2.5rem; padding: .55rem .7rem; font: inherit; color: inherit; background: #fff; border: 1px solid #c3cad6; border-radius: 8px; }
.wm-input:focus-visible, .wm-btn:focus-visible, .wm-nav-link:focus-visible, .wm-icon-btn:focus-visible, a:focus-visible { outline: 2px solid var(--wm-primary); outline-offset: 2px; }
.wm-check { display: flex; gap: .5rem; align-items: flex-start; }
.wm-check input { margin-top: .25rem; }
.wm-inline-form { display: inline; margin: 0; }
.wm-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem .9rem; font: inherit; font-weight: 600; border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none; min-height: 40px; }
.wm-btn-primary { background: var(--wm-primary); color: #fff; }
.wm-btn-primary:hover { background: var(--wm-primary-d); }
.wm-btn-secondary { background: #fff; color: var(--wm-text); border-color: #c3cad6; }
.wm-btn-danger { background: var(--wm-danger); color: #fff; }
.wm-btn-block { width: 100%; }
.wm-btn[disabled] { opacity: .55; cursor: not-allowed; }
.wm-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--wm-line); background: #fff; border-radius: 8px; cursor: pointer; color: inherit; }
.wm-link { color: var(--wm-primary); }

/* feedback */
.wm-alert { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; border-radius: 8px; background: var(--wm-info-bg); }
.wm-alert-success { background: var(--wm-ok-bg); color: var(--wm-ok); }
.wm-alert-danger { background: var(--wm-danger-bg); color: var(--wm-danger); }
.wm-alert-warning { background: var(--wm-warn-bg); color: var(--wm-warn); }
.wm-alert-list { margin: 0; padding-left: 2rem; display: block; }
.wm-badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e9ecf2; color: #394150; }
.wm-badge-success { background: var(--wm-ok-bg); color: var(--wm-ok); }
.wm-badge-warning { background: var(--wm-warn-bg); color: var(--wm-warn); }
.wm-badge-danger { background: var(--wm-danger-bg); color: var(--wm-danger); }
.wm-badge-info { background: var(--wm-info-bg); color: var(--wm-primary-d); }

/* sign-in screens */

/* confirmation dialog (created by admin.js), always centered */
.wm-dialog { position: fixed; inset: 0; margin: auto; width: min(24rem, calc(100vw - 2rem)); height: fit-content; border: 1px solid var(--wm-line); border-radius: 14px; padding: 1.25rem; }
.wm-dialog::backdrop { background: rgba(10, 14, 22, .5); }
.wm-dialog p { margin-bottom: 1rem; }

.wm-qr { display: block; width: min(14rem, 100%); height: auto; margin: .5rem auto 1rem; border: 1px solid var(--wm-line); border-radius: 8px; }

/* Forms assigned to a person who only fills, and the fill screen (private route /forms/{slug}/fill) */
.wm-formlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.wm-formrow { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border: 1px solid var(--wm-line); border-radius: 10px; background: #fff; }
.wm-formrow-main { display: grid; gap: .2rem; min-width: 0; flex: 1; justify-items: start; }
.wm-formrow > .wm-fav-form .wm-fav { margin: 0; }
.wm-formrow-name { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.wm-formrow-main .wm-help { margin: 0; }
.wm-fill { width: 100%; max-width: 56rem; margin-inline: auto; display: grid; gap: 1rem; }   /* the form keeps its width (56rem) and sits in the middle of its card */
.wm-fill .yf-form { --yf-primary: var(--wm-primary); --yf-line: #c3cad6; --yf-text: var(--wm-text); --yf-muted: var(--wm-muted); --yf-err: var(--wm-danger); }

/* ============================================================ shared UI standards (docs/UI-UX-STANDARDS.md) */
[hidden] { display: none !important; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
:root { --wm-brand: #143a8c; --wm-ring: rgb(29 78 216 / .22); --wm-sunken: #f2f4f9; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--wm-primary); width: 1.05rem; height: 1.05rem; flex: none; }
.wm-input:hover { border-color: #aab4c6; }
.wm-input:focus-visible { outline: 0; border-color: var(--wm-primary); box-shadow: 0 0 0 3px var(--wm-ring); }
.wm-input[disabled] { background: #f4f6fa; color: var(--wm-muted); cursor: not-allowed; }
textarea.wm-input { resize: vertical; line-height: 1.45; }
.wm-btn { min-height: 2.5rem; transition: background .12s, border-color .12s, box-shadow .12s; }
.wm-btn-secondary:hover:not([disabled]) { background: var(--wm-sunken); border-color: #aab4c6; }
.wm-check { align-items: center; min-height: 2.25rem; cursor: pointer; }
.wm-check input { margin: 0; }
.wm-table tbody tr:hover { background: #fafbfd; }
.wm-table td .wm-btn { min-height: 2rem; padding: .3rem .7rem; font-size: 13px; }

/* "back" link: above the page content, right under the header (never inside it) */
.wm-pageback { margin: -.25rem 0 -.25rem; }
.wm-back { display: inline-flex; align-items: center; gap: .3rem; min-height: 2rem; color: var(--wm-muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.wm-back:hover { color: var(--wm-primary); }
.wm-back .wm-icon { width: 16px; height: 16px; }

/* filter row and two-column form grid */
.wm-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.wm-toolbar .wm-field { flex: 1 1 12rem; max-width: 22rem; min-width: 0; }
.wm-toolbar .wm-btn { flex: none; }
.wm-toolbar-end { margin-left: auto; display: inline-flex; gap: .5rem; flex: none; }
.wm-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; align-items: start; }
.wm-span-2 { grid-column: 1 / -1; }
.wm-form-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wm-section-title { margin: .25rem 0 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--wm-muted); }
.wm-actions-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding-top: .25rem; }

/* on/off switch */
.wm-toggle { display: flex; align-items: flex-start; gap: .7rem; cursor: pointer; min-height: 2.25rem; }
.wm-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wm-sw { flex: none; position: relative; width: 38px; height: 22px; margin-top: .1rem; border-radius: 999px; background: #c3cad6; transition: background .15s; }
.wm-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .15s; }
.wm-toggle input:checked + .wm-sw { background: var(--wm-primary); }
.wm-toggle input:checked + .wm-sw::after { transform: translateX(16px); }
.wm-toggle input:focus-visible + .wm-sw { outline: 2px solid var(--wm-primary); outline-offset: 2px; }
.wm-toggle input[disabled] + .wm-sw { opacity: .5; }
.wm-tl { display: grid; font-size: 14px; font-weight: 600; }
.wm-tl small { font-weight: 400; font-size: 13px; color: var(--wm-muted); line-height: 1.4; }

/* option groups (permissions, alert actions): a card per group, options in a responsive grid */
.wm-groups { display: grid; gap: 1rem; }
.wm-group { border: 1px solid var(--wm-line); border-radius: 12px; background: #fff; overflow: hidden; }
.wm-group-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem .9rem; background: #fafbfd; border-bottom: 1px solid var(--wm-line); }
.wm-group-title { margin: 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--wm-muted); }
.wm-group-all { min-height: 2rem; border: 0; background: transparent; color: var(--wm-primary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: .2rem .4rem; border-radius: 6px; }
.wm-group-all:hover { background: var(--wm-info-bg); }
.wm-optgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 0; }
.wm-opt { display: flex; align-items: flex-start; gap: .65rem; padding: .7rem .9rem; border-bottom: 1px solid #eef0f4; cursor: pointer; }
.wm-opt:hover { background: #fafbfd; }
.wm-opt input { margin-top: .15rem; }
.wm-opt-b { display: grid; gap: .1rem; min-width: 0; }
.wm-opt-t { font-size: 14px; }
.wm-opt-c { font-size: 12px; color: var(--wm-muted); overflow-wrap: anywhere; }
.wm-opt.is-locked { cursor: default; opacity: .75; }

/* choice cards (roles to assign, etc.) */
.wm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem; }
.wm-card-opt { display: flex; align-items: flex-start; gap: .65rem; padding: .75rem .9rem; border: 1px solid #d5dbe6; border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .12s, background .12s; }
.wm-card-opt:hover { border-color: #aab4c6; }
.wm-card-opt:has(input:checked) { border-color: var(--wm-primary); background: var(--wm-info-bg); box-shadow: inset 0 0 0 1px var(--wm-primary); }
.wm-card-opt:has(input:focus-visible) { outline: 2px solid var(--wm-primary); outline-offset: 2px; }
.wm-card-opt input { margin-top: .15rem; }
.wm-card-opt strong, .wm-card-opt small { display: block; }
.wm-checks-t { display: flex; flex-direction: column; gap: .1rem; min-width: 0; overflow-wrap: anywhere; }
.wm-checks-t strong { display: block; }

/* file upload (admin.js shows the chosen name and handles drag & drop) */
.wm-upload { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: 1.1rem 1.25rem; border: 2px dashed #c3cad6; border-radius: 12px; background: #fafbfd; transition: border-color .12s, background .12s; }
.wm-upload.is-over { border-color: var(--wm-primary); background: var(--wm-info-bg); }
.wm-upload input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.wm-upload-btn { display: inline-flex; align-items: center; gap: .45rem; }
.wm-upload-name { color: var(--wm-muted); font-size: 14px; overflow-wrap: anywhere; flex: 1; min-width: 8rem; }
.wm-upload:focus-within { outline: 2px solid var(--wm-primary); outline-offset: 2px; }
.wm-upload .wm-icon { width: 18px; height: 18px; }

/* destructive area inside a card */
.wm-danger-zone { padding: 1rem; border: 1px solid #f3c4bf; border-radius: 12px; background: #fff8f7; }
.wm-notes { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; }
.wm-cell-actions { white-space: nowrap; }
.wm-cell-actions .wm-btn + .wm-btn { margin-left: .35rem; }

/* page tabs (segmented) */
.wm-tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--wm-sunken); border-radius: 10px; width: max-content; max-width: 100%; }
.wm-tab { padding: .4rem 1rem; border-radius: 8px; color: var(--wm-muted); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.wm-tab:hover { color: var(--wm-text); }
.wm-tab[aria-current="page"] { background: #fff; color: var(--wm-primary); box-shadow: 0 1px 2px rgb(16 24 40 / .12); }

/* Settings: hub of cards + a screen with its own side navigation (docs/UI-UX-STANDARDS.md) */
.wm-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 1rem; }
.wm-hub-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; background: var(--wm-surface); border: 1px solid var(--wm-line); border-radius: 14px; color: inherit; text-decoration: none; transition: border-color .12s, box-shadow .12s, transform .12s; }
.wm-hub-card:hover { border-color: var(--wm-primary); box-shadow: 0 6px 18px rgb(16 24 40 / .08); transform: translateY(-1px); }
.wm-hub-card:focus-visible { outline: 2px solid var(--wm-primary); outline-offset: 2px; }
.wm-hub-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--wm-info-bg); color: var(--wm-primary); }
.wm-hub-icon .wm-icon { width: 22px; height: 22px; }
.wm-hub-body { display: grid; gap: .15rem; min-width: 0; flex: 1; }
.wm-hub-title { font-size: 16px; }
.wm-hub-desc { font-size: 13.5px; line-height: 1.4; color: var(--wm-muted); }
.wm-hub-go { flex: none; color: var(--wm-muted); font-size: 18px; transition: transform .12s, color .12s; }
.wm-hub-card:hover .wm-hub-go { transform: translateX(3px); color: var(--wm-primary); }
.wm-settings { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.wm-snav { position: sticky; top: 1rem; display: grid; gap: 2px; padding: .5rem; background: var(--wm-surface); border: 1px solid var(--wm-line); border-radius: 14px; }
.wm-snav-link { display: flex; align-items: center; gap: .65rem; min-height: 2.5rem; padding: .5rem .7rem; border-radius: 9px; color: var(--wm-text); font-size: 14.5px; font-weight: 500; text-decoration: none; }
.wm-snav-link .wm-icon { width: 18px; height: 18px; color: var(--wm-muted); flex: none; }
.wm-snav-link:hover { background: var(--wm-sunken); }
.wm-snav-link:focus-visible { outline: 2px solid var(--wm-primary); outline-offset: -2px; }
.wm-snav-link[aria-current="page"] { background: var(--wm-info-bg); color: var(--wm-primary-d); font-weight: 700; }
.wm-snav-link[aria-current="page"] .wm-icon { color: var(--wm-primary); }
.wm-snav-home { margin-bottom: .35rem; padding-bottom: .65rem; border-bottom: 1px solid var(--wm-line); border-radius: 9px 9px 0 0; color: var(--wm-muted); font-size: 13.5px; }
.wm-settings-main { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.wm-sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: .85rem; border-bottom: 1px solid var(--wm-line); }
.wm-sec-title h2 { margin: 0; font-size: 1.25rem; }
.wm-sec-title .wm-help { margin: .2rem 0 0; }
.wm-sec-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.wm-sec-actions:empty { display: none; }
@media (max-width: 860px) {
  .wm-settings { grid-template-columns: 1fr; gap: 1rem; }
  .wm-snav { position: static; display: flex; overflow-x: auto; scrollbar-width: thin; gap: .25rem; padding: .4rem; }
  .wm-snav-link { flex: none; white-space: nowrap; }
  .wm-snav-home { margin: 0; padding: .5rem .7rem; border-bottom: 0; border-right: 1px solid var(--wm-line); border-radius: 9px; }
}

/* dashboard blocks */
.wm-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; }
.wm-block { display: grid; gap: .6rem; align-content: start; }
.wm-block-link { justify-self: start; font-size: 14px; font-weight: 600; text-decoration: none; }
.wm-block-link:hover { text-decoration: underline; }

/* sign-in screens: same corporate look as the home page */
.wm-auth { min-height: 100vh; display: flex; background: #0b1f4d url('/assets/login-bg.svg') center / cover no-repeat; }
.wm-auth-panel { width: min(32rem, 100%); min-height: 100vh; display: flex; align-items: center; padding: 2rem 2.5rem; background: #fff; box-shadow: 0 0 48px rgb(11 31 77 / .35); }
.wm-auth-box { width: 100%; max-width: 24rem; margin: 0 auto; display: grid; gap: .75rem; }
.wm-auth-brand { margin: 0 0 .5rem; font-size: 1.5rem; font-weight: 800; color: var(--wm-brand); }
.wm-auth-logo { display: block; width: 15rem; max-width: 100%; height: auto; }
.wm-auth-title { margin: 0; font-size: 1.35rem; line-height: 1.25; color: #0b1f4d; }
.wm-auth-body { display: grid; gap: 1rem; margin-top: .5rem; }
.wm-auth-body .wm-btn-primary { background: var(--wm-brand); }
.wm-auth-body .wm-btn-primary:hover { background: #0f2f73; }
@media (max-width: 760px) { .wm-auth-panel { padding: 1.5rem 1.25rem; box-shadow: none; } }

/* tables become stacked cards on narrow screens (admin.js adds data-label to every cell) */
@media (max-width: 640px) {
  .wm-table.is-stacked, .wm-table.is-stacked tbody, .wm-table.is-stacked tr, .wm-table.is-stacked td { display: block; width: 100%; }
  .wm-table.is-stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .wm-table.is-stacked tr { border: 1px solid var(--wm-line); border-radius: 12px; padding: .35rem .85rem; margin-bottom: .7rem; background: #fff; }
  .wm-table.is-stacked td { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border: 0; border-bottom: 1px solid #f0f2f6; padding: .5rem 0; text-align: right; overflow-wrap: anywhere; }
  .wm-table.is-stacked td:last-child { border-bottom: 0; }
  .wm-table.is-stacked td::before { content: attr(data-label); flex: none; max-width: 45%; color: var(--wm-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
  .wm-table.is-stacked td:empty { display: none; }
  .wm-form-grid, .wm-form-grid.is-3 { grid-template-columns: 1fr; }
  .wm-toolbar .wm-field { max-width: none; flex-basis: 100%; }
  .wm-optgrid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


/* Forms list: icon inside a badge, and the empty state with its call to action */
.wm-badge .wm-icon { width: 12px; height: 12px; vertical-align: -2px; }
.wm-empty-cta { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: .5rem 0; }
.wm-empty-cta .wm-empty, .wm-empty-cta .wm-help { padding: 0; margin: 0; }
.wm-toolbar .wm-btn .wm-icon { width: 16px; height: 16px; }
.wm-cell-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.wm-cell-main .wm-mono { font-size: 12.5px; overflow-wrap: anywhere; }
.wm-cell-main .wm-cell-desc { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Status and Destination never use two lines on a desktop screen (>= 1280 px): the badges sit in one row and each badge is one line. Narrower screens keep wrapping so the table does not scroll sideways. */
@media (min-width: 1280px) { #forms-table td .wm-cell-badges, #favorites-table td .wm-cell-badges { flex-wrap: nowrap; } #forms-table td .wm-badge, #favorites-table td .wm-badge { white-space: nowrap; } }
/* Forms tables: on a desktop screen every column keeps the width it has at 1300 px (Status and Destination fit their one-line content) and Name takes ALL the rest; on narrower screens the columns adapt as before (Name 40 %). */
@media (min-width: 721px) and (max-width: 1279px) { #forms-table th:first-child, #favorites-table th:first-child { width: 40%; } }
@media (min-width: 1280px) {
  #forms-table, #favorites-table { width: 100%; }
  #forms-table th:nth-child(2), #favorites-table th:nth-child(2) { width: 80px; }
  #forms-table th:nth-child(3), #favorites-table th:nth-child(3), #forms-table th:nth-child(4), #favorites-table th:nth-child(4) { width: 1%; }   /* Status and Destination fit their content, on ONE line */
  #forms-table th:nth-child(5), #favorites-table th:nth-child(5) { width: 100px; }
  #forms-table th:nth-child(6), #favorites-table th:nth-child(6) { width: 122px; }
}
.wm-cell-badges { display: flex; flex-wrap: wrap; gap: .3rem; }
@media (max-width: 720px) { .wm-cell-main { align-items: flex-end; text-align: right; } .wm-cell-badges { justify-content: flex-end; } }

/* Folders (flat) and the "⋮" actions menu: shared patterns, see docs/UI-UX-STANDARDS.md §11. Behaviour: public/assets/forms-folders.js */
.wm-dsec { margin-bottom: 1.25rem; }
.wm-toolbar + .wm-dsec { margin-top: 1.5rem; }
.wm-dsec .wm-section-title { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; }
.wm-fstatus { margin: 0 0 .75rem; }
.wm-fstatus:empty { margin: 0; }
.wm-fstatus.is-error { color: var(--wm-danger); font-weight: 600; }
.wm-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.wm-folder { position: relative; display: flex; align-items: center; min-width: 0; min-height: 3.5rem; border: 1px solid var(--wm-line); border-radius: 12px; background: var(--wm-surface); box-shadow: 0 1px 2px rgb(15 23 42 / .06); transition: border-color .12s, background .12s; }
/* folder colours: a fixed palette of keys (FormRepo::FOLDER_COLORS) drawn with classes, never with a stored CSS value (strict CSP). --fc is the colour in use. */
.is-c-blue { --fc: #1d4ed8; } .is-c-green { --fc: #15803d; } .is-c-amber { --fc: #b45309; } .is-c-red { --fc: #b91c1c; }
.is-c-purple { --fc: #7e22ce; } .is-c-teal { --fc: #0f766e; } .is-c-pink { --fc: #be185d; } .is-c-gray { --fc: #475569; }
.wm-folder.has-color { border-left: 4px solid var(--fc); }
.wm-folder.has-color.is-active { border-left-color: var(--fc); }
.wm-folder.has-color .wm-folder-main .wm-icon, .fs-ct[class*="is-c-"] .wm-icon { color: var(--fc); }
.wm-swatches { margin: 0; padding: 0; border: 0; min-width: 0; }
.wm-swatches legend { padding: 0; margin-bottom: .4rem; }
.wm-swatch-row { display: flex; flex-wrap: wrap; gap: .25rem; }
.wm-swatch { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; cursor: pointer; }
.wm-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.wm-swatch-dot { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--fc, #fff); border: 2px solid transparent; color: #fff; }
.wm-swatch.is-none .wm-swatch-dot { background: #fff; border: 2px dashed #8e98ab; }
.wm-swatch-dot .wm-icon { width: 16px; height: 16px; stroke-width: 3; opacity: 0; }
.wm-swatch.is-none .wm-swatch-dot .wm-icon { color: var(--wm-muted); }
.wm-swatch:has(input:checked) .wm-swatch-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--fc, #8e98ab); }
.wm-swatch:has(input:checked) .wm-swatch-dot .wm-icon { opacity: 1; }
.wm-swatch:has(input:focus-visible) { outline: 2px solid var(--wm-primary); outline-offset: 0; }
.wm-folder:hover { border-color: #aab4c6; }
.wm-folder.has-color:hover { border-left-color: var(--fc); }
.wm-folder.is-active { border-color: var(--wm-primary); background: var(--wm-info-bg); }
.wm-folder.is-virtual, .wm-folder.is-add { border-style: dashed; }
.wm-folder.is-add { background: transparent; box-shadow: none; }
.wm-folder-main { display: flex; flex: 1 1 auto; align-items: center; gap: .65rem; min-width: 0; min-height: 3.5rem; padding: .5rem .5rem .5rem .9rem; border: 0; border-radius: 12px; background: none; color: var(--wm-text); font: inherit; font-weight: 600; text-decoration: none; text-align: left; cursor: pointer; }
.wm-folder-main .wm-icon { width: 20px; height: 20px; flex: none; color: var(--wm-primary); }
.wm-folder.is-virtual .wm-folder-main .wm-icon { color: var(--wm-muted); }
.wm-folder-main:focus-visible { outline: 2px solid var(--wm-primary); outline-offset: 2px; }
.wm-folder-name { flex: 1 1 auto; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; line-height: 1.25; }
.wm-folder-main .wm-badge { flex: none; }
.wm-subcount { gap: .2rem; }
.wm-subcount .wm-icon { width: 13px; height: 13px; }
.wm-folder > .wm-menu-wrap { margin-right: .25rem; }
tr.is-busy { opacity: .6; pointer-events: none; }
.wm-cell-actions { white-space: nowrap; }
.wm-cell-actions .wm-menu-wrap { display: inline-block; vertical-align: middle; }
.wm-cell-badges[data-ff-chips]:empty::before { content: "—"; color: var(--wm-muted); }   /* a form in no folder shows a dash */
.wm-cell-badges a.wm-badge { text-decoration: none; }
.wm-cell-badges a.wm-badge:hover { background: #dfe4ee; }
.wm-menu-wrap { position: relative; flex: none; }
.wm-menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--wm-muted); cursor: pointer; }
.wm-menu-btn:hover, .wm-menu-btn[aria-expanded="true"] { background: #eef1f6; color: var(--wm-text); }
.wm-menu-btn:focus-visible { outline: 2px solid var(--wm-primary); outline-offset: 1px; }
.wm-menu-btn .wm-icon { width: 20px; height: 20px; stroke-width: 2.6; }
.wm-menu { position: fixed; z-index: 1000; top: 0; left: 0; min-width: 12.5rem; max-width: 18rem; padding: .35rem 0; border: 1px solid var(--wm-line); border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgb(15 23 42 / .2); }
.wm-menu[hidden] { display: none; }
.wm-menu-form { margin: 0; }
.wm-menu-sep { height: 1px; margin: .35rem 0; background: var(--wm-line); }
.wm-menu > a, .wm-menu > button, .wm-menu-form > button { display: flex; align-items: center; width: 100%; min-height: 2.5rem; padding: .4rem .9rem; border: 0; background: none; color: var(--wm-text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.wm-menu > a:hover, .wm-menu > button:hover, .wm-menu-form > button:hover, .wm-menu > a:focus-visible, .wm-menu > button:focus-visible, .wm-menu-form > button:focus-visible { background: #eef1f6; outline: none; }
.wm-menu .is-danger { color: var(--wm-danger); }
@media (max-width: 40rem) {
  .wm-folders { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wm-menu-btn { width: 2.75rem; height: 2.75rem; }
  .wm-menu > a, .wm-menu > button, .wm-menu-form > button { min-height: 2.75rem; }
}
@media (max-width: 30rem) { .wm-folders { grid-template-columns: 1fr; } }

/* Pager of the forms list (/matrix/forms): "Showing x–y of n", page buttons and the page-size choice */
.wm-toolbar-search { display: contents; }
.wm-pager { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding: .75rem 1rem; }
.wm-pager-info { margin: 0; margin-right: auto; }
.wm-pager-nav { display: inline-flex; align-items: center; gap: .25rem; }
.wm-pager-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 2.5rem; height: 2.5rem; padding: 0 .5rem; border: 1px solid var(--wm-line); border-radius: 8px; background: var(--wm-surface, #fff); color: var(--wm-text); font-weight: 600; text-decoration: none; }
.wm-pager-btn svg { width: 1.1rem; height: 1.1rem; }
.wm-pager-btn.is-next svg { transform: rotate(180deg); }
a.wm-pager-btn:hover { border-color: var(--wm-primary); color: var(--wm-primary); }
.wm-pager-btn.is-current { background: var(--wm-primary); border-color: var(--wm-primary); color: #fff; }
.wm-pager-btn.is-disabled { opacity: .4; }
.wm-pager-gap { padding: 0 .25rem; color: var(--wm-muted); }
.wm-pager-per { display: inline-flex; align-items: center; gap: .5rem; }
.wm-pager-per .wm-label { margin: 0; white-space: nowrap; }
.wm-pager-per .wm-input { width: auto; min-width: 4.5rem; }
@media (max-width: 720px) { .wm-pager { justify-content: center; } .wm-pager-info { margin-right: 0; flex-basis: 100%; text-align: center; } .wm-pager-btn { min-width: 2.75rem; height: 2.75rem; } }

/* Favourite star of the forms list: a 40 px button before the name; filled and amber when on (the pressed state is also announced, never colour alone) */
.wm-cell-name { display: flex; align-items: flex-start; gap: .25rem; }
.wm-fav-form { margin: 0; flex: none; }
.wm-fav { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; margin: -.4rem 0 -.4rem -.6rem; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--wm-muted); cursor: pointer; }
.wm-fav svg { width: 1.3rem; height: 1.3rem; fill: none; }
.wm-fav:hover { background: var(--wm-bg); color: var(--wm-warn); }
.wm-fav.is-on { color: #b7791f; }
.wm-fav.is-on svg { fill: currentColor; }
.wm-fav:disabled { opacity: .5; cursor: progress; }
@media (max-width: 720px) { .wm-fav { width: 2.75rem; height: 2.75rem; } }

/* Detail of one answer (/matrix/forms/{id}/responses/{sid}): the definition grid `.wm-fields` (label above the value; a long value takes the whole row; `.is-rows` puts the label beside the value) */
.wm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; margin: 0; }
.wm-fields > div { min-width: 0; padding: .75rem 0; border-bottom: 1px solid var(--wm-line); }
.wm-fields > div.is-wide { grid-column: 1 / -1; }
.wm-fields > div:last-child { border-bottom: 0; }
.wm-fields dt { margin: 0; color: var(--wm-muted); font-size: 13px; font-weight: 600; }
.wm-fields dd { margin: .2rem 0 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.wm-fields.is-rows { grid-template-columns: minmax(0, 1fr); }
.wm-fields.is-rows > div { display: grid; grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr); gap: .25rem 1rem; padding: .6rem 0; }
.wm-fields.is-rows dd { margin: 0; font-size: 14px; }
.wm-fields dd.is-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
@media (max-width: 720px) {
  .wm-fields { grid-template-columns: minmax(0, 1fr); }
  .wm-fields.is-rows > div { grid-template-columns: minmax(0, 1fr); }
}

.fb-meta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-left: auto; }
.fb-meta-actions .wm-inline-form { margin: 0; }
.fb-meta-actions .wm-btn { padding: .4rem .9rem; font-size: 14px; white-space: nowrap; }
.fb-meta-actions .wm-btn .wm-icon { width: 16px; height: 16px; margin-right: .35rem; vertical-align: -3px; }
.fb-sdialog .wm-fields.is-rows > div:last-child { border-bottom: 0; }
@media (max-width: 720px) { .fb-meta-actions { width: 100%; } .fb-meta-actions .wm-btn { flex: 1; min-height: 44px; } }
.fb-meta + .wm-dsec { margin-top: 1.5rem; }

/* Forms tables: Language, Status, Destination, Answers and Actions are centred, the heading and the data (the Name column stays on the left). On phones the rows are stacked cards and keep their own layout. */
@media (min-width: 721px) {
  #forms-table :is(th, td):nth-child(n+2), #favorites-table :is(th, td):nth-child(n+2) { text-align: center; }
  #forms-table td:nth-child(n+2) .wm-cell-badges, #favorites-table td:nth-child(n+2) .wm-cell-badges { justify-content: center; }
}

/* The notice of an action that just happened goes away by itself (admin.js): a close button, a short fade (not with reduced motion) and no jump of the content below (the box collapses as it fades). */
.wm-alert[data-wm-autohide] { position: relative; padding-right: 2.75rem; transition: opacity .2s ease, max-height .25s ease, margin .25s ease, padding .25s ease; max-height: 12rem; overflow: hidden; }
.wm-alert[data-wm-autohide].is-leaving { opacity: 0; max-height: 0; margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
.wm-alert-close { position: absolute; top: .3rem; right: .4rem; width: 2.25rem; height: 2.25rem; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.wm-alert-close:hover { background: rgb(0 0 0 / .08); }
@media (prefers-reduced-motion: reduce) { .wm-alert[data-wm-autohide] { transition: none; } }

/* Touch: a link that stands alone (a table cell, a card link, the status line of the editor) is a 44 px target, not a line of text. Links inside a sentence keep their size. */
@media (max-width: 900px) {
  .wm-table td a.wm-link, a.wm-block-link, .fb-st-info a.wm-link { display: inline-flex; align-items: center; min-height: 2.75rem; min-width: 2.75rem; }
  .wm-table td a.wm-link:only-child { justify-content: flex-start; }
}

/* ---- Phone and installed app (PWA) --------------------------------------------------------------------------------------------------------------------------------------------
   Mobile rules of the panel: the real height of the screen (dvh: the address bar of a phone is not part of it), the notch and the home bar (safe-area insets: the app is shown edge to edge),
   no 300 ms wait or zoom on a double tap, no zoom-in when a field is focused (16 px), and the screens that are made for a big screen are replaced by a notice. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button, summary, label, select, [role="button"], .wm-btn, .wm-nav-link { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.wm-shell { min-height: 100vh; min-height: 100dvh; }
.wm-auth, .wm-auth-panel { min-height: 100vh; min-height: 100dvh; }
@media (min-width: 861px) { .wm-side { height: 100vh; height: 100dvh; } }
.wm-desk-notice { display: none; }
@media (max-width: 860px) {
  .wm-desk-only { display: none !important; }   /* a screen or button meant for a computer or a tablet held horizontally (the form editor, creating a form, the role editor) */
  .wm-desk-notice { display: block; }
  body.wm-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]), body.wm-body select, body.wm-body textarea, body.wm-body .wm-input { font-size: 16px; }
  body.wm-body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .wm-top { padding-top: calc(1rem + env(safe-area-inset-top)); }
  .wm-main { padding-bottom: env(safe-area-inset-bottom); }
  .wm-side { padding-top: calc(1rem + env(safe-area-inset-top)); padding-bottom: calc(1rem + env(safe-area-inset-bottom)); padding-left: calc(.75rem + env(safe-area-inset-left)); height: 100vh; height: 100dvh; }
}
@media (display-mode: standalone) {   /* installed: there is no browser bar, so nothing may sit under the status bar */
  .wm-auth-panel { padding-top: calc(2rem + env(safe-area-inset-top)); padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
}

/* ==== The phone is its own app (<= 860 px) ================================================================================================================================================
   Structure, not just size. What a person does on a phone: open the forms that are theirs, fill one in, look at an answer, check who is in. So: a bottom tab bar in the reach of the thumb with the
   person's own destinations (an agent: Forms + More), "More" as a bottom sheet (the rest, My account, install, Sign out), a slim top bar that only says where you are, folders as chips you swipe,
   every table as cards that show the few columns that matter (th data-m: title | meta | metalabel | actions | hide), and the form screen with its Send button fixed at the bottom (no tab bar there). */
.wm-tabbar, .wm-top-mark { display: none; }
@media (max-width: 860px) {
  .wm-side, .wm-scrim, [data-wm-nav-toggle], .wm-usermenu { display: none !important; }
  .wm-top { position: sticky; top: 0; z-index: 10; min-height: 3.25rem; padding-top: calc(.5rem + env(safe-area-inset-top)); padding-bottom: .5rem; gap: .65rem; }
  .wm-top-mark { display: block; flex: none; border-radius: 7px; }
  .wm-top-title h1 { font-size: 1.1rem; line-height: 1.25; overflow-wrap: anywhere; }
  .wm-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--wm-surface); border-top: 1px solid var(--wm-line); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); box-shadow: 0 -1px 8px rgb(15 23 42 / .06); }
  .wm-tab { position: relative; flex: 1 1 0; min-width: 0; min-height: 3.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; padding: .35rem .25rem; border: 0; background: none; font: inherit; font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--wm-muted); text-decoration: none; cursor: pointer; }
  .wm-tab .wm-icon { width: 22px; height: 22px; }
  .wm-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wm-tabbar .wm-tab, .wm-tabbar .wm-tab[aria-current="page"] { background: none; box-shadow: none; border: 0; }   /* the bottom bar never inherits the desktop tab's white pill and shadow */
  .wm-tabbar .wm-tab.is-active, .wm-tabbar .wm-tab[aria-current="page"] { color: var(--wm-primary); }   /* the current tab: the colour of its icon and text, plus the line on top (no pill, shadow or border) */
  .wm-tabbar .wm-tab.is-active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--wm-primary); }
  .wm-tab:active { background: var(--wm-info-bg); }
  .wm-content { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }   /* the column may shrink below its content: a row of chips scrolls inside itself, it never widens the page */
  .wm-content > * { min-width: 0; }
  body:has(.wm-fill) .wm-tabbar { display: none; }   /* filling a form is a task of its own: no tab bar, the Send button is fixed at the bottom */
  body:has(.wm-fill) .wm-content { padding-bottom: 1rem; }

  /* comfortable controls */
  .wm-input { min-height: 3rem; }
  .wm-btn { min-height: 2.75rem; }
  .wm-table td .wm-btn { min-height: 2.75rem; }

  /* folders: chips you swipe, not cards; managing folders is desk work */
  section[aria-labelledby="ff-folders-h"] > .wm-section-title, .wm-folder > .wm-menu-wrap, .wm-folder.is-add { display: none; }
  .wm-folders { display: flex; flex-wrap: nowrap; gap: .5rem; overflow-x: auto; margin: 0 -1rem; padding: .1rem 1rem .5rem; scroll-snap-type: x proximity; scroll-padding-inline: 1rem; scrollbar-width: none; }
  .wm-folders::-webkit-scrollbar { display: none; }
  .wm-folder { flex: none; min-height: 2.75rem; border-radius: 999px; scroll-snap-align: start; box-shadow: none; }
  .wm-folder.has-color { border-left-width: 1px; }
  .wm-folder-main { min-height: 2.75rem; padding: .25rem .9rem; gap: .5rem; border-radius: 999px; }
  .wm-folder-name { display: block; -webkit-line-clamp: unset; white-space: nowrap; }

  /* the forms toolbar is just the search */
  .wm-toolbar { gap: .5rem; }
  .wm-toolbar-search { display: flex; width: 100%; gap: .5rem; align-items: flex-end; }
  .wm-toolbar-search .wm-field { flex: 1 1 0; min-width: 0; max-width: none; }
  .wm-toolbar-search .wm-input { min-width: 0; }
  .wm-toolbar-search .wm-btn { flex: none; }
  /* a toolbar that is a search plus ONE page action (book an appointment, step 1): the action takes the full row below the search */
}
@media (max-width: 640px) {
  /* every table is a list of cards; with data-m on its headings the card shows the title, a line of meta and the actions, not a label/value row per column */
  .wm-card:has(> .wm-table-wrap > .wm-table.is-m) { padding: 0; border: 0; background: none; box-shadow: none; }   /* the cards ARE the list: no card around the cards */
  .wm-table.is-m tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: .9rem; row-gap: .1rem; padding: .8rem .9rem; }
  .wm-table.is-m td { width: auto; display: block; border: 0; padding: .1rem 0; text-align: left; }
  .wm-table.is-m td::before { display: none; }
  .wm-table.is-m td[data-m="title"] { width: 100%; font-size: 16px; font-weight: 600; padding-bottom: .25rem; }
  .wm-table.is-m td[data-m="hide"] { display: none; }
  .wm-table.is-m td[data-m="meta"], .wm-table.is-m td[data-m="metalabel"] { font-size: 14px; color: var(--wm-muted); }
  .wm-table.is-m td[data-m="metalabel"]::before { display: inline; max-width: none; margin-right: .35rem; font-size: 12px; letter-spacing: .03em; }
  .wm-table.is-m td[data-m="actions"] { width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: .5rem; padding-top: .55rem; }
  .wm-table.is-m td[data-m="actions"]::before { display: none; }
  .wm-table.is-m .wm-cell-main { align-items: flex-start; text-align: left; }
  .wm-table.is-m .wm-cell-badges { justify-content: flex-start; }
  #forms-table td[data-m="title"] .wm-cell-name { align-items: center; }
  .wm-table.is-m td[data-m="title"] a.wm-link { min-height: 2.5rem; }
  .wm-table.is-m td[data-m="metalabel"] a.wm-link { min-height: 2.25rem; }
  .wm-table.is-m td[data-m="actions"] { padding-top: .35rem; }
}

/* the "More" sheet */
.wm-sheet { padding: 0; border: 0; width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 86vh; max-height: 86dvh; background: var(--wm-surface); color: inherit; box-shadow: 0 -10px 36px rgb(16 24 40 / .28); overscroll-behavior: contain; overflow-y: auto; }
.wm-sheet::backdrop { background: rgb(16 24 40 / .5); }
.wm-sheet-head { display: flex; align-items: center; gap: .6rem; padding: 1rem 1rem .4rem 1.25rem; }
.wm-sheet-head strong { font-size: 17px; overflow-wrap: anywhere; }
.wm-sheet-head .wm-icon-btn { margin-left: auto; }
.wm-sheet-list { list-style: none; margin: 0; padding: .25rem .5rem calc(.75rem + env(safe-area-inset-bottom)); }
.wm-sheet-form { margin: 0; }
.wm-sheet-link { display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 3.25rem; padding: .5rem .75rem; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 16px; color: var(--wm-text); text-align: left; text-decoration: none; cursor: pointer; }
.wm-sheet-link .wm-icon { width: 22px; height: 22px; flex: none; color: var(--wm-muted); }
.wm-sheet-link:active, .wm-sheet-link.is-active { background: var(--wm-info-bg); }
.wm-sheet-link.is-active { color: var(--wm-primary); font-weight: 600; }
.wm-sheet-link.is-danger, .wm-sheet-link.is-danger .wm-icon { color: var(--wm-danger); }
.wm-sheet-note { display: flex; align-items: flex-start; gap: .9rem; margin: 0; padding: .75rem; color: var(--wm-muted); font-size: 14px; }
.wm-sheet-note .wm-icon { width: 22px; height: 22px; flex: none; }
html.wm-sheet-open { overflow: hidden; }
@media (min-width: 861px) { .wm-sheet { display: none; } }

/* filling a form on a phone: the Send button stays at the bottom of the screen, as wide as the screen, above the home bar */
@media (max-width: 860px) {
  .wm-fill .yf-actions { position: sticky; bottom: 0; margin: 1rem -1rem 0; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); background: linear-gradient(to top, #fff 82%, rgb(255 255 255 / 0)); z-index: 2; }
  .wm-fill .yf-submit { width: 100%; min-height: 3rem; font-size: 16px; }
  .wm-fill .yf-input { min-height: 3rem; }
}

/* ==== The form card on the phone: one card = one form, built to be read and used with a thumb ======================================================================================
   Hierarchy: the NAME first (17 px bold, not a blue link: the whole card is the tap target, with the most likely action behind it: fill it in, else its answers), then ONE line of state (a colour dot AND
   the word, public or private, "unpublished changes" in amber), then the description. The star (my quick access) sits at the top right, where a thumb of the right hand rests. The actions are at the
   bottom of the card, in the reach of the thumb, 44 px, equal width: the primary one filled ("Fill in"), the second with the number of answers ("Answers 12"), and ⋮ for the rest. */
.wm-mcards { display: none; list-style: none; margin: 0; padding: 0; }
@media (max-width: 640px) {
  .wm-m-hide { display: none !important; }
  .wm-card:has(> .wm-mcards) { padding: 0; border: 0; background: none; box-shadow: none; }
  .wm-mcards { display: grid; gap: .75rem; }
  .wm-mcard { position: relative; display: grid; gap: .8rem; padding: .95rem .95rem .85rem; background: var(--wm-surface); border: 1px solid var(--wm-line); border-radius: 14px; box-shadow: 0 1px 2px rgb(15 23 42 / .05); }
  .wm-mcard:active { background: var(--wm-info-bg); }
  .wm-mcard-head { display: flex; align-items: flex-start; gap: .5rem; }
  .wm-mcard-id { flex: 1 1 auto; min-width: 0; display: grid; gap: .35rem; }
  .wm-mcard-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--wm-text); text-decoration: none; }
  a.wm-mcard-title::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }   /* the whole card is the link */
  .wm-mcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .45rem; margin: 0; font-size: 13px; line-height: 1.4; color: var(--wm-muted); }
  .wm-mcard-meta .wm-icon { width: 14px; height: 14px; flex: none; }
  .wm-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--wm-muted); }
  .wm-dot.is-ok { background: var(--wm-ok); }
  .wm-dot.is-warn { background: #d99a00; }
  .wm-mcard-warn { color: var(--wm-warn); font-weight: 600; }
  .wm-mcard-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: 14px; line-height: 1.4; color: var(--wm-muted); }
  .wm-mcard .wm-fav-form { position: relative; z-index: 1; flex: none; margin: 0; }
  .wm-mcard .wm-fav { margin: -.45rem -.55rem 0 0; width: 2.75rem; height: 2.75rem; }
  .wm-mcard-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: .5rem; }
  .wm-mcard-actions > .wm-btn { flex: 1 1 0; min-width: 0; min-height: 2.75rem; justify-content: center; text-align: center; }
  .wm-mcard-actions .wm-menu-wrap { flex: none; }
  .wm-mcard-count { margin-left: .45rem; padding: .05rem .55rem; border-radius: 999px; background: rgb(15 23 42 / .09); font-size: 12px; font-weight: 700; }
  .wm-btn-primary .wm-mcard-count { background: rgb(255 255 255 / .25); }
  /* the other lists (users, answers, roles, audit): the same idea - the whole card is the link, the title is the name, the rest is one line of facts, a chevron says "opens" */
  .wm-table.is-m tr { position: relative; padding-right: 2.4rem; }
  .wm-table.is-m td[data-m="title"] a.wm-link { color: var(--wm-text); text-decoration: none; font-weight: 700; }
  .wm-table.is-m td[data-m="title"] a.wm-link::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
  .wm-table.is-m tr:has(td[data-m="title"] a)::after { content: ""; position: absolute; right: 1rem; top: 50%; width: .6rem; height: .6rem; margin-top: -.3rem; border-top: 2px solid var(--wm-muted); border-right: 2px solid var(--wm-muted); transform: rotate(45deg); }
  .wm-table.is-m tr:active { background: var(--wm-info-bg); }
  .wm-table.is-m td[data-m="meta"], .wm-table.is-m td[data-m="metalabel"] { font-size: 13px; }
}

/* Phone: a toolbar with several fields is a small grid, not a column of full-width controls: the search takes the whole row, a second filter and its button share the next one, the primary action closes it at full width. */
@media (max-width: 860px) {
  .wm-toolbar:has(> .wm-field + .wm-field) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .6rem; }
  .wm-toolbar:has(> .wm-field + .wm-field) > .wm-field:first-child { grid-column: 1 / -1; }
  .wm-toolbar:has(> .wm-field + .wm-field) > .wm-field { max-width: none; flex-basis: auto; }
  .wm-toolbar:has(> .wm-field + .wm-field) > .wm-toolbar-end { grid-column: 1 / -1; margin-left: 0; display: grid; }
  .wm-toolbar:has(> .wm-field + .wm-field) > .wm-toolbar-end .wm-btn { width: 100%; justify-content: center; }
}

@media (max-width: 640px) {
  /* an answer: WHO first (its first answer is the title), then when (the date, a quiet line) and the second answer; the card still opens the answer */
  .wm-table.is-m td[data-m="title"] { order: -1; }
  .wm-table.is-m td a.wm-link-card { color: inherit; text-decoration: none; min-height: 0; }
  .wm-table.is-m td a.wm-link-card::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
  .wm-table.is-m tr:has(a.wm-link-card)::after { content: ""; position: absolute; right: 1rem; top: 50%; width: .6rem; height: .6rem; margin-top: -.3rem; border-top: 2px solid var(--wm-muted); border-right: 2px solid var(--wm-muted); transform: rotate(45deg); }
}

/* Settings > App: status list as rows (badge, then the text) and the four icons side by side */
.wm-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.wm-checks li { display: flex; align-items: flex-start; gap: .65rem; }
.wm-checks li .wm-badge { flex: none; margin-top: .1rem; }
.wm-icons { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.wm-icon-prev { margin: 0; }
.wm-checks-t a.wm-link { display: inline-flex; align-items: center; min-height: 44px; }

/* Settings > App: "Refresh on every device" is its own card: text on the left, the button on the right; on a phone the button is full width */
.wm-refresh { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wm-refresh-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.wm-refresh-action .wm-inline-form, .wm-refresh-action form { margin: 0; }
@media (max-width: 860px) {
  .wm-refresh { flex-direction: column; align-items: stretch; }
  .wm-refresh-action, .wm-refresh-action form, .wm-refresh-action .wm-btn { width: 100%; }
}
.wm-refresh-action { flex: none; } .wm-refresh-action .wm-btn { white-space: nowrap; }

/* Upload zone (Settings > App): everything centered inside the dashed zone, the hint under the button in grey, the send button OUTSIDE it and off until a file is chosen */
.wm-upload--zone { flex-direction: column; justify-content: center; text-align: center; gap: .5rem; padding: 1.5rem 1rem; }
.wm-upload--zone .wm-upload-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--wm-info-bg); color: var(--wm-primary); }
.wm-upload--zone .wm-upload-ico .wm-icon { width: 22px; height: 22px; }
.wm-upload--zone .wm-upload-title { font-weight: 600; }
.wm-upload--zone .wm-upload-hint { color: var(--wm-muted); font-size: 14px; }
.wm-upload--zone .wm-upload-name { flex: none; min-width: 0; max-width: 100%; font-size: 14px; }
.wm-upload--zone .wm-upload-name.is-chosen { color: var(--wm-text); font-weight: 600; }
.wm-upload-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.wm-upload-actions form { margin: 0; }
.wm-upload-actions .wm-btn:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 860px) {
  .wm-upload-actions { flex-direction: column; align-items: stretch; }
  .wm-upload-actions .wm-btn, .wm-upload-actions form { width: 100%; }
  .wm-upload--zone .wm-upload-btn { width: 100%; justify-content: center; }
}

/* Pull to refresh (pwa.js, installed app only): the round indicator that follows the finger. Position and opacity are set from the script (CSSOM, allowed by the CSP). */
html.wm-ptr-on { overscroll-behavior-y: contain; }
.wm-ptr { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; z-index: 40; width: 40px; height: 40px; margin-top: 0; border-radius: 50%; background: var(--wm-surface); border: 1px solid var(--wm-line); box-shadow: 0 2px 10px rgb(15 23 42 / .18); transform: translate(-50%, 0); opacity: 0; pointer-events: none; display: grid; place-items: center; }
.wm-ptr[hidden] { display: none; }
.wm-ptr::before { content: ""; width: 10px; height: 10px; border-right: 2.5px solid var(--wm-muted); border-bottom: 2.5px solid var(--wm-muted); transform: translateY(-2px) rotate(45deg); transition: transform .15s ease, border-color .15s ease; }
.wm-ptr.is-ready::before { border-color: var(--wm-primary); transform: translateY(2px) rotate(225deg); }
.wm-ptr.is-loading::before { width: 18px; height: 18px; border: 2.5px solid var(--wm-line); border-top-color: var(--wm-primary); border-radius: 50%; transform: none; animation: wm-ptr-spin .7s linear infinite; }
@keyframes wm-ptr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wm-ptr::before, .wm-ptr.is-loading::before { transition: none; animation-duration: 1.6s; } }
.wm-ptr .wm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Files: a round + button at the bottom right (above the tab bar on a phone) opens the upload dialog. */
.wm-fab { display: grid; place-items: center; position: fixed; z-index: 16; right: calc(1.5rem + env(safe-area-inset-right)); bottom: calc(1.5rem + env(safe-area-inset-bottom)); width: 3.5rem; height: 3.5rem; padding: 0; border: 0; border-radius: 50%; background: var(--wm-primary); color: #fff; box-shadow: 0 4px 14px rgb(15 23 42 / .28); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .12s, box-shadow .12s; }
.wm-fab:hover { box-shadow: 0 6px 18px rgb(15 23 42 / .34); }
.wm-fab .wm-icon { width: 26px; height: 26px; stroke-width: 2.4; }
.wm-fab:active { transform: scale(.96); }
.wm-fab:focus-visible { outline: 3px solid var(--wm-primary); outline-offset: 3px; }
body:has(.wm-fab) .wm-content { padding-bottom: 6rem; }   /* the last file is never under the button */
@media (max-width: 860px) {
  .wm-fab { right: calc(1rem + env(safe-area-inset-right)); bottom: calc(3.5rem + env(safe-area-inset-bottom) + 1rem); }
  body:has(.wm-fab) .wm-content { padding-bottom: calc(9rem + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .wm-fab { transition: none; } }
.wm-sr, .wm-fab .wm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* /matrix/media: one card = one file. Thumbnail on top, name first (the card is the link to the file), one meta line, actions below. */
.wm-media-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); list-style: none; margin: 0; padding: 0; }
.wm-media { position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--wm-surface); border: 1px solid var(--wm-line); border-radius: 12px; box-shadow: 0 1px 2px rgb(15 23 42 / .05); overflow: hidden; }
.wm-media:hover { border-color: #aab4c6; }
.wm-media:has(.wm-media-name:focus-visible) { outline: 2px solid var(--wm-primary); outline-offset: 2px; }
.wm-media-thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #eef1f6; border-bottom: 1px solid var(--wm-line); overflow: hidden; }
.wm-media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wm-media-thumb.is-file { align-content: center; justify-items: center; gap: .35rem; color: var(--wm-muted); font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.wm-media-thumb.is-file .wm-icon { width: 40px; height: 40px; }
.wm-media-body { display: grid; gap: .35rem; align-content: start; padding: .85rem 1rem 0; min-width: 0; }
.wm-media-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--wm-text); text-decoration: none; }
.wm-media-name::after { content: ""; position: absolute; inset: 0; }   /* the whole card opens the file */
.wm-media-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .5rem; margin: 0; font-size: 13px; color: var(--wm-muted); }
.wm-media-sub { margin: 0; font-size: 12.5px; color: #5d6675; overflow-wrap: anywhere; }
.wm-media-head { display: flex; align-items: flex-start; gap: .25rem; }
.wm-media-head .wm-media-name { flex: 1 1 auto; min-width: 0; }
.wm-media-head .wm-menu-wrap { position: relative; z-index: 1; margin: -.3rem -.55rem 0 0; }
.wm-media-body { padding-bottom: 1rem; }
@media (max-width: 480px) { .wm-media-grid { grid-template-columns: 1fr; } .wm-media-thumb { aspect-ratio: 16 / 9; } }

/* /matrix/media as a file cloud: breadcrumbs, view toggle, folders, selection bar, list view, drop veil and upload progress */
.wm-viewtoggle { gap: 0; border: 1px solid var(--wm-line); border-radius: 8px; background: var(--wm-surface); overflow: hidden; }
.wm-viewbtn { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; color: var(--wm-muted); }
.wm-viewbtn + .wm-viewbtn { border-left: 1px solid var(--wm-line); }
.wm-viewbtn:hover { background: #eef1f6; color: var(--wm-text); }
.wm-viewbtn.is-on { background: var(--wm-info-bg); color: var(--wm-primary); }
.wm-viewbtn:focus-visible { outline: 2px solid var(--wm-primary); outline-offset: -2px; }
.wm-viewbtn .wm-icon { width: 18px; height: 18px; }
.wm-mfolders { margin-top: .5rem; }
.wm-folder.is-over { border-color: var(--wm-primary); background: var(--wm-info-bg); box-shadow: inset 0 0 0 2px var(--wm-primary); }
section[aria-labelledby="media-files-h"], section[aria-labelledby="media-folders-h"] { margin-top: 1rem; display: grid; gap: .6rem; }
.wm-bulk { position: sticky; top: calc(var(--wm-top-h, 3.5rem) + .25rem); z-index: 12; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; padding: .6rem .75rem; border: 1px solid var(--wm-primary); border-radius: 12px; background: var(--wm-info-bg); box-shadow: 0 2px 8px rgb(15 23 42 / .12); }
.wm-bulk[hidden] { display: none; }
.wm-bulk-count { font-weight: 700; }
.wm-bulk-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.wm-bulk-actions form { margin: 0; }
.wm-pick { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--wm-primary); cursor: pointer; }
.wm-media-check { position: absolute; top: .4rem; left: .4rem; z-index: 2; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 10px; background: rgb(255 255 255 / .88); box-shadow: 0 1px 3px rgb(15 23 42 / .25); cursor: pointer; }
.wm-media { cursor: default; }
.wm-media.is-selected { border-color: var(--wm-primary); box-shadow: 0 0 0 2px var(--wm-primary); }
.wm-media.is-dragging, tr.is-dragging { opacity: .45; }
.wm-media-thumb { position: relative; }
.wm-col-pick { width: 2.75rem; }
tr.is-selected td { background: var(--wm-info-bg); }
.wm-media-table td { vertical-align: middle; }
.wm-media-mini { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: #eef1f6; flex: none; color: var(--wm-muted); }
.wm-media-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wm-media-mini .wm-icon { width: 20px; height: 20px; }
.wm-folder.is-media-add { border-style: dashed; }
.wm-media-sub .wm-icon, .wm-cell-desc .wm-icon { width: 13px; height: 13px; vertical-align: -2px; }
.wm-dropveil { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; background: rgb(15 23 42 / .55); color: #fff; text-align: center; pointer-events: none; }
.wm-dropveil[hidden] { display: none; }
.wm-dropveil > div { display: grid; justify-items: center; gap: .5rem; padding: 2.5rem 3rem; border: 3px dashed #fff; border-radius: 20px; background: rgb(15 23 42 / .35); font-size: 1.2rem; font-weight: 700; }
.wm-dropveil .wm-icon { width: 44px; height: 44px; }
.wm-uplist { position: fixed; z-index: 2001; right: 1.5rem; bottom: 6rem; width: min(22rem, calc(100vw - 2rem)); max-height: 50vh; overflow: auto; border: 1px solid var(--wm-line); border-radius: 14px; background: #fff; box-shadow: 0 12px 32px rgb(15 23 42 / .25); }
.wm-uplist[hidden] { display: none; }
.wm-uplist-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--wm-line); }
.wm-uplist-x { min-width: 2.75rem; min-height: 2.75rem; margin: -.5rem -.5rem -.5rem 0; border: 0; border-radius: 8px; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--wm-muted); }
.wm-up { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem .9rem; font-size: 14px; border-bottom: 1px solid var(--wm-line); }
.wm-up:last-child { border-bottom: 0; }
.wm-up-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-up-state { flex: none; color: var(--wm-muted); }
.wm-up.is-ok .wm-up-state { color: var(--wm-ok); font-weight: 600; }
.wm-up.is-err .wm-up-state { color: var(--wm-danger); font-weight: 600; max-width: 55%; text-align: right; }
@media (prefers-reduced-motion: reduce) { .wm-bulk { box-shadow: none; } }
@media (max-width: 860px) {
  .wm-mfolders .wm-folder > .wm-menu-wrap, .wm-mfolders .wm-folder.is-add { display: flex; }   /* on a phone the library's folders keep their menu and the new-folder chip */
  .wm-mfolders .wm-folder > .wm-menu-wrap { margin-right: .1rem; }
  .wm-viewbtn { width: 2.75rem; height: 2.75rem; }
  .wm-bulk { top: .25rem; }
  .wm-bulk-actions { width: 100%; }
  .wm-bulk-actions > .wm-btn, .wm-bulk-actions form, .wm-bulk-actions form .wm-btn { flex: 1 1 0; }
  .wm-uplist { right: 1rem; bottom: calc(5.5rem + env(safe-area-inset-bottom) + 3.5rem); }
  .wm-media-check { width: 2.75rem; height: 2.75rem; }
}
@media (max-width: 860px) {   /* the library's filters on a phone: search + Search on one row, then the sort list and the grid/list switch */
  #media-filters.wm-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .6rem; }
  #media-filters.wm-toolbar > .wm-field { max-width: none; min-width: 0; }
  #media-filters.wm-toolbar > .wm-btn { justify-content: center; }
  #media-filters.wm-toolbar > .wm-viewtoggle { margin-left: 0; display: inline-flex; justify-self: end; }
  #media-filters .wm-viewbtn { width: 2.75rem; height: 2.75rem; }
}
#media-filters.wm-toolbar { align-items: flex-end; }
#media-filters .wm-tb-q { flex: 1 1 18rem; max-width: 28rem; }
.wm-here { display: flex; align-items: center; gap: .5rem; margin: 1.25rem 0 .25rem; font-size: 17px; font-weight: 700; color: var(--wm-text); overflow-wrap: anywhere; }
.wm-here svg { flex: none; width: 20px; height: 20px; color: var(--wm-primary); }
[data-media] { padding-bottom: 5.5rem; }   /* the round + button never covers the last file */
.wm-media-table .wm-media-rowmeta { display: none; }
@media (max-width: 860px) {   /* list view on a phone: compact rows (checkbox, thumbnail with name and details, menu), not stacked cards */
  .wm-media-listcard { padding: 0; border: 0; background: none; box-shadow: none; }
  .wm-media-table, .wm-media-table tbody { display: block; width: 100%; }
  .wm-media-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .wm-media-table tr { position: relative; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; align-items: center; gap: 0 .25rem; margin-bottom: .5rem; padding: .35rem .35rem .35rem .15rem; border: 1px solid var(--wm-line); border-radius: 12px; background: var(--wm-surface); }
  .wm-media-table td { display: block; padding: 0; border: 0; }
  .wm-media-table td.wm-col-type, .wm-media-table td.wm-col-size, .wm-media-table td.wm-col-date { display: none; }
  .wm-media-table td.wm-col-pick { width: auto; display: grid; place-items: center; min-height: 2.75rem; }
  .wm-media-table .wm-cell-name { display: flex; align-items: center; gap: .65rem; min-width: 0; }
  .wm-media-table .wm-media-mini { width: 48px; height: 48px; }
  .wm-media-table .wm-cell-main { min-width: 0; display: grid; gap: .1rem; }
  .wm-media-table .wm-cell-main a { min-height: 0; overflow-wrap: anywhere; color: var(--wm-text); text-decoration: none; font-size: 15px; }
  .wm-media-table .wm-cell-main a::after { content: ""; position: absolute; inset: 0 3.2rem 0 2.9rem; }   /* the row opens the file, but not over the checkbox or the menu */
  .wm-media-table .wm-media-rowmeta { display: block; font-size: 12.5px; line-height: 1.35; }
  .wm-media-table td.wm-cell-actions { display: block; }
  .wm-media-table tr.is-selected { border-color: var(--wm-primary); background: var(--wm-info-bg); }
  .wm-media-table tr.is-selected td { background: none; }
}

@media (max-width: 860px) { .wm-media-table .wm-cell-main, .wm-media-table .wm-cell-main * { text-align: left; } }
section[aria-labelledby="mset-use-h"] { margin-top: 1.5rem; }   /* Settings > Files: the usage table is a section of its own, apart from the form */
section[aria-labelledby="mset-types-h"] > .wm-help { margin-top: .75rem; }

/* Tenants and calendar (module calendar) */
.wm-copyrow { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .25rem 0; }
.wm-copyrow code { flex: 1 1 18rem; min-width: 0; overflow-wrap: anywhere; padding: .5rem .7rem; border: 1px solid var(--wm-line); border-radius: 8px; background: var(--wm-bg, #f4f6f9); font-size: 13px; }
.wm-tenantswitch { margin-bottom: .5rem; }
.wm-folder-form { display: contents; }
.wm-folder-form .wm-folder-main { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.wm-bookframe { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }   /* the booking widget of GHL draws its own surface and borders: nothing of the panel's around it */
.wm-bookframe-f { display: block; width: 100%; height: 78vh; height: 78dvh; min-height: 640px; border: 0; background: transparent; color-scheme: normal; }
.wm-calcards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.wm-calcard { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0; }
.wm-calcard > div { display: grid; gap: .15rem; min-width: 0; }
.wm-calcard-n { overflow-wrap: anywhere; }
@media (max-width: 860px) { .wm-calcard { flex-direction: column; align-items: stretch; } .wm-calcard .wm-btn, .wm-calcard form { width: 100%; justify-content: center; } .wm-bookframe-f { min-height: 560px; } }

.fs-sec .wm-field + .wm-field { margin-top: .85rem; }

.wm-sechead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: 1.25rem 0 .6rem; }
.wm-sechead .wm-section-title { margin: 0; }

.wm-toolbar .wm-tb-q { flex: 1 1 18rem; max-width: 28rem; }
.wm-cell-fav { width: 3.25rem; padding-right: 0; }
.wm-th-actions { width: 1px; white-space: nowrap; }
.wm-here .wm-badge { margin-left: .25rem; }
@media (max-width: 640px) { .wm-mcard-actions > .wm-inline-form { flex: 1 1 0; display: flex; } .wm-mcard-actions > .wm-inline-form .wm-btn { flex: 1 1 auto; justify-content: center; min-height: 44px; } }
/* webhook activity and the connection guide of a company */
.wm-sechead-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.wm-fact { display: inline-flex; align-items: center; gap: .25rem; margin: .1rem .5rem .1rem 0; font-size: 13px; color: var(--wm-muted); white-space: nowrap; }
.wm-fact .wm-icon { width: 14px; height: 14px; }
.wm-fact.is-ok { color: var(--wm-success, #166534); }
.wm-keys { display: block; max-width: 28rem; overflow-wrap: anywhere; font-size: 12px; color: var(--wm-muted); }
.wm-steps { margin: 0; padding-left: 1.25rem; display: grid; gap: .75rem; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 640px) { .wm-sechead-actions { width: 100%; } .wm-sechead-actions .wm-btn { flex: 1 1 auto; justify-content: center; } }

/* Book an appointment, step 1: the search in GHL is the main thing of the page (large field, its own card); the empty-state action fills the row on a phone */
.wm-findbox { padding: 1rem 1.25rem 1.25rem; }
.wm-findbox .wm-section-title { margin: 0 0 .75rem; }
.wm-findbox .wm-toolbar-search { display: flex; gap: .75rem; align-items: flex-end; }
.wm-findbox .wm-toolbar-search .wm-field { flex: 1 1 auto; max-width: none; min-width: 0; }
.wm-findbox .wm-input { min-height: 3rem; font-size: 1rem; }
.wm-findbox .wm-btn { min-height: 3rem; flex: none; }
@media (max-width: 860px) { .wm-findbox { padding: 1rem; } .wm-empty-cta .wm-btn { width: 100%; justify-content: center; } }

/* Book an appointment, step 2 (booked in the Matrix): the usual booking layout: a month calendar where only the days with free times can be chosen, the times of the chosen day beside it (below on a phone) */
.wm-book { display: grid; grid-template-columns: minmax(0, 23rem) minmax(0, 1fr); gap: 1.5rem 2.5rem; align-items: start; padding: 1.25rem 1.5rem; }
.wm-calnav { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.wm-calnav-title { font-size: 16px; color: var(--wm-text); }
.wm-calnav-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 999px; color: var(--wm-text); touch-action: manipulation; transition: background-color .15s; }
a.wm-calnav-btn:hover { background: var(--wm-info-bg); }
a.wm-calnav-btn:focus-visible { outline: 2px solid var(--wm-primary); outline-offset: 2px; }
.wm-calnav-btn.is-off { opacity: .35; }
.wm-calnav-btn svg { width: 18px; height: 18px; }
.wm-flip { transform: scaleX(-1); }
a.wm-cal-day, .wm-time, .wm-calnav-btn { text-decoration: none; }
.wm-cal { width: 100%; border-collapse: separate; border-spacing: 2px 4px; table-layout: fixed; }
.wm-cal th { padding: .25rem 0; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; text-align: center; color: var(--wm-muted, #5d6675); }
.wm-cal td { padding: 0; text-align: center; }
.wm-cal-day { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 2.75rem; border-radius: 999px; font-size: 14px; color: #8a93a3; touch-action: manipulation; }
a.wm-cal-day { font-weight: 700; background: var(--wm-info-bg); color: var(--wm-primary-d); transition: background-color .15s, color .15s; }
a.wm-cal-day:hover { background: #dbe6ff; }
a.wm-cal-day:focus-visible { outline: 2px solid var(--wm-primary); outline-offset: 2px; }
a.wm-cal-day.is-selected, a.wm-cal-day.is-selected:hover { background: var(--wm-primary); color: #fff; }
.wm-cal-day.is-today { box-shadow: inset 0 0 0 1.5px currentColor; }
.wm-book-zone { display: flex; align-items: center; gap: .4rem; margin: .75rem 0 0; }
.wm-book-zone svg { width: 14px; height: 14px; flex: none; }
.wm-book-day { margin: 0 0 .75rem; font-size: 16px; font-weight: 700; color: var(--wm-text); }
.wm-times { list-style: none; margin: 0; padding: 0 .25rem 0 0; display: grid; gap: .5rem; max-height: 26rem; overflow-y: auto; overscroll-behavior: contain; }
.wm-time { display: flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 1rem; border: 1px solid var(--wm-primary); border-radius: 8px; background: #fff; color: var(--wm-primary-d); font-size: 15px; font-weight: 700; touch-action: manipulation; transition: background-color .15s, color .15s; }
.wm-time:hover { background: var(--wm-primary); color: #fff; }
.wm-time:focus-visible { outline: 2px solid var(--wm-primary); outline-offset: 2px; }
/* the confirm screen (step 3): the primary action first, the way back beside it */
.wm-confirm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem; }
@media (max-width: 860px) {
  .wm-confirm-actions .wm-btn { flex: 1 1 100%; justify-content: center; }
  .wm-book { grid-template-columns: minmax(0, 1fr); padding: 1rem; }
  .wm-times { max-height: none; overflow: visible; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .wm-calnav-btn, .wm-cal-day, .wm-time { transition: none; } }
